00001
00002
00003
00004
00005
00006
00007 #ifndef TERRAIN_H
00008 #define TERRAIN_H
00009
00010 #include "enum.h"
00011 #include <memory>
00012
00013 class actor;
00014 struct coord_def;
00015
00016 typedef FixedArray<bool, GXM, GYM> map_mask_boolean;
00017
00018
00019
00020 class unwind_slime_wall_precomputer
00021 {
00022 public:
00023 unwind_slime_wall_precomputer(bool docompute = true);
00024 ~unwind_slime_wall_precomputer();
00025 private:
00026 bool did_compute_mask;
00027 };
00028
00029 actor* actor_at(const coord_def& c);
00030
00031 int count_neighbours_with_func (const coord_def& c, bool (*checker)(dungeon_feature_type));
00032 bool feat_is_test (dungeon_feature_type feat, bool (*checker)(dungeon_feature_type));
00033 bool feat_is_test (const coord_def& c, bool (*checker)(dungeon_feature_type));
00034
00035 bool fall_into_a_pool(const coord_def& entry, bool allow_shift,
00036 dungeon_feature_type terrain);
00037
00038 bool cell_is_solid(int x, int y);
00039 bool cell_is_solid(const coord_def &c);
00040
00041 bool feat_is_malign_gateway_suitable (dungeon_feature_type feat);
00042 bool feat_is_wall(dungeon_feature_type feat);
00043 bool feat_is_opaque(dungeon_feature_type feat);
00044 bool feat_is_solid(dungeon_feature_type feat);
00045 bool feat_is_floor(dungeon_feature_type feat);
00046 bool feat_has_solid_floor(dungeon_feature_type feat);
00047 bool feat_is_door(dungeon_feature_type feat);
00048 bool feat_is_closed_door(dungeon_feature_type feat);
00049 bool feat_is_secret_door(dungeon_feature_type feat);
00050 bool feat_is_statue_or_idol(dungeon_feature_type feat);
00051 bool feat_is_rock(dungeon_feature_type feat);
00052 bool feat_is_permarock(dungeon_feature_type feat);
00053 bool feat_is_stone_stair(dungeon_feature_type feat);
00054 bool feat_is_staircase(dungeon_feature_type feat);
00055 bool feat_is_escape_hatch(dungeon_feature_type feat);
00056 bool feat_is_trap(dungeon_feature_type feat, bool undiscovered_too = false);
00057 command_type feat_stair_direction(dungeon_feature_type feat);
00058 bool feat_sealable_portal(dungeon_feature_type feat);
00059 bool feat_is_portal(dungeon_feature_type feat);
00060 bool feat_is_tree(dungeon_feature_type feat);
00061
00062 bool feat_is_stair(dungeon_feature_type feat);
00063 bool feat_is_travelable_stair(dungeon_feature_type feat);
00064 bool feat_is_escape_hatch(dungeon_feature_type feat);
00065 bool feat_is_gate(dungeon_feature_type feat);
00066
00067 std::string feat_preposition(dungeon_feature_type feat, bool active = false,
00068 const actor* who = NULL);
00069 std::string stair_climb_verb(dungeon_feature_type feat);
00070
00071 bool feat_is_water(dungeon_feature_type feat);
00072 bool feat_is_watery(dungeon_feature_type feat);
00073 god_type feat_altar_god(dungeon_feature_type feat);
00074 dungeon_feature_type altar_for_god(god_type god);
00075 bool feat_is_altar(dungeon_feature_type feat);
00076 bool feat_is_player_altar(dungeon_feature_type grid);
00077
00078 bool feat_is_branch_stairs(dungeon_feature_type feat);
00079 bool feat_is_bidirectional_portal(dungeon_feature_type feat);
00080 void find_connected_identical(const coord_def& d, dungeon_feature_type ft,
00081 std::set<coord_def>& out);
00082 std::set<coord_def> connected_doors(const coord_def& d);
00083
00084 bool slime_wall_neighbour(const coord_def& c);
00085
00086 void get_door_description(int door_size, const char** adjective,
00087 const char** noun);
00088
00089
00090
00091 bool find_secret_door_info(const coord_def &where,
00092 dungeon_feature_type *feat,
00093 coord_def *gc);
00094 dungeon_feature_type grid_secret_door_appearance(const coord_def &where);
00095 dungeon_feature_type grid_appearance(const coord_def &gc);
00096 bool feat_destroys_item(dungeon_feature_type feat, const item_def &item, bool noisy = false);
00097
00098
00099 void dungeon_terrain_changed(const coord_def &pos,
00100 dungeon_feature_type feat = DNGN_UNSEEN,
00101 bool affect_player = true,
00102 bool preserve_features = false,
00103 bool preserve_items = false);
00104
00105
00106 void dgn_move_entities_at(coord_def src,
00107 coord_def dst,
00108 bool move_player,
00109 bool move_monster,
00110 bool move_items);
00111
00112 bool swap_features(const coord_def &pos1, const coord_def &pos2,
00113 bool swap_everything = false, bool announce = true);
00114
00115 bool slide_feature_over(const coord_def &src,
00116 coord_def prefered_dest = coord_def(-1, -1),
00117 bool announce = true);
00118
00119 bool is_critical_feature(dungeon_feature_type feat);
00120
00121 void init_feat_desc_cache();
00122 dungeon_feature_type feat_by_desc(std::string desc);
00123
00124 dungeon_feature_type dungeon_feature_by_name(const std::string &name);
00125 std::vector<std::string> dungeon_feature_matches(const std::string &name);
00126 const char *dungeon_feature_name(dungeon_feature_type rfeat);
00127 void nuke_wall(const coord_def& p);
00128
00129 #endif