00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MONSTUFF_H
00009 #define MONSTUFF_H
00010
00011 #define ORIG_MONSTER_KEY "orig_monster_key"
00012
00013 enum mon_dam_level_type
00014 {
00015 MDAM_OKAY,
00016 MDAM_LIGHTLY_DAMAGED,
00017 MDAM_MODERATELY_DAMAGED,
00018 MDAM_HEAVILY_DAMAGED,
00019 MDAM_SEVERELY_DAMAGED,
00020 MDAM_ALMOST_DEAD,
00021 MDAM_DEAD,
00022 };
00023
00024 enum mon_desc_type
00025 {
00026 MDSC_LEAVES_HIDE,
00027 MDSC_REGENERATES,
00028 MDSC_NOMSG_WOUNDS,
00029 };
00030
00031 struct level_exit
00032 {
00033 coord_def target;
00034 bool unreachable;
00035
00036 level_exit(coord_def t = coord_def(-1, -1), bool u = true)
00037 : target(t), unreachable(u)
00038 {
00039 }
00040 };
00041
00042 #define FRESHEST_CORPSE 210
00043 #define ROTTING_CORPSE 99
00044
00045 #define YOU_KILL(x) ((x) == KILL_YOU || (x) == KILL_YOU_MISSILE \
00046 || (x) == KILL_YOU_CONF)
00047 #define MON_KILL(x) ((x) == KILL_MON || (x) == KILL_MON_MISSILE)
00048
00049 #define SAME_ATTITUDE(x) (x->friendly() ? BEH_FRIENDLY : \
00050 x->good_neutral() ? BEH_GOOD_NEUTRAL : \
00051 x->strict_neutral() ? BEH_STRICT_NEUTRAL : \
00052 x->neutral() ? BEH_NEUTRAL \
00053 : BEH_HOSTILE)
00054
00055 #define MONST_INTERESTING(x) (x->flags & MF_INTERESTING)
00056
00057
00058 const item_def *give_mimic_item(monster* mimic);
00059 const item_def &get_mimic_item(const monster* mimic);
00060 int get_mimic_colour(const monster* mimic);
00061 dungeon_feature_type get_mimic_feat (const monster* mimic);
00062 bool feature_mimic_at (const coord_def &c);
00063
00064 void alert_nearby_monsters(void);
00065
00066 beh_type attitude_creation_behavior(mon_attitude_type att);
00067 beh_type actual_same_attitude(const monster& base);
00068
00069 enum poly_power_type {
00070 PPT_LESS,
00071 PPT_MORE,
00072 PPT_SAME,
00073 };
00074
00075 bool monster_polymorph(monster* mons, monster_type targetc,
00076 poly_power_type power = PPT_SAME,
00077 bool force_beh = false);
00078
00079 int monster_die(monster* mons, killer_type killer,
00080 int killer_index, bool silent = false, bool wizard = false,
00081 bool fake = false);
00082
00083 int mounted_kill(monster* daddy, monster_type mc, killer_type killer,
00084 int killer_index);
00085
00086 monster_type fill_out_corpse(const monster* mons,
00087 monster_type mtype,
00088 item_def& corpse,
00089 bool force_corpse = false);
00090
00091 bool explode_corpse(item_def& corpse, const coord_def& where);
00092
00093 int place_monster_corpse(const monster* mons, bool silent,
00094 bool force = false);
00095
00096 void slimify_monster(monster* mons, bool hostile = false);
00097
00098 bool mon_can_be_slimified(monster* mons);
00099
00100 void corrode_monster(monster* mons);
00101
00102 void mons_check_pool(monster* mons, const coord_def &oldpos,
00103 killer_type killer = KILL_NONE, int killnum = -1);
00104
00105 void monster_cleanup(monster* mons);
00106
00107 int dismiss_monsters(std::string pattern);
00108
00109 bool curse_an_item(bool decay_potions, bool quiet = false);
00110
00111 bool is_any_item(const item_def& item);
00112 void monster_drop_things(
00113 monster* mons,
00114 bool mark_item_origins = false,
00115 bool (*suitable)(const item_def& item) = is_any_item,
00116 int owner_id = NON_ITEM);
00117
00118 bool monster_blink(monster* mons, bool quiet = false);
00119
00120 bool simple_monster_message(const monster* mons, const char *event,
00121 msg_channel_type channel = MSGCH_PLAIN,
00122 int param = 0,
00123 description_level_type descrip = DESC_CAP_THE);
00124
00125 bool choose_any_monster(const monster* mon);
00126 monster *choose_random_nearby_monster(
00127 int weight,
00128 bool (*suitable)(const monster* mon) =
00129 choose_any_monster,
00130 bool in_sight = true,
00131 bool prefer_named = false, bool prefer_priest = false);
00132
00133 monster *choose_random_monster_on_level(
00134 int weight,
00135 bool (*suitable)(const monster* mon) =
00136 choose_any_monster,
00137 bool in_sight = true, bool near_by = false,
00138 bool prefer_named = false, bool prefer_priest = false);
00139
00140 bool swap_places(monster* mons);
00141 bool swap_places(monster* mons, const coord_def &loc);
00142 bool swap_check(monster* mons, coord_def &loc, bool quiet = false);
00143
00144
00145 std::string get_wounds_description(const monster* mons, bool colour=false);
00146 std::string get_wounds_description_sentence(const monster* mons);
00147 void print_wounds(const monster* mons);
00148 bool monster_descriptor(int which_class, mon_desc_type which_descriptor);
00149
00150
00151 monster *get_current_target();
00152
00153 mon_dam_level_type mons_get_damage_level(const monster* mons);
00154
00155 std::string get_damage_level_string(mon_holy_type holi,
00156 mon_dam_level_type mdam);
00157
00158 void seen_monster(monster* mons);
00159
00160 bool shift_monster(monster* mon, coord_def p = coord_def(0, 0));
00161
00162 int mons_weapon_damage_rating(const item_def &launcher);
00163 int mons_missile_damage(monster* mons, const item_def *launch,
00164 const item_def *missile);
00165 int mons_pick_best_missile(monster* mons, item_def **launcher,
00166 bool ignore_melee = false);
00167 int mons_thrown_weapon_damage(const item_def *weap,
00168 bool only_returning_weapons = false);
00169
00170 int mons_natural_regen_rate(monster* mons);
00171
00172 void mons_relocated(monster* mons);
00173 void mons_att_changed(monster* mons);
00174
00175 bool can_go_straight(const coord_def& p1, const coord_def& p2,
00176 dungeon_feature_type allowed);
00177
00178 bool is_item_jelly_edible(const item_def &item);
00179
00180 bool monster_random_space(const monster* mons, coord_def& target,
00181 bool forbid_sanctuary = false);
00182 bool monster_random_space(monster_type mon, coord_def& target,
00183 bool forbid_sanctuary = false);
00184 void monster_teleport(monster* mons, bool instan, bool silent = false);
00185 void mons_clear_trapping_net(monster* mon);
00186
00187 std::string summoned_poof_msg(const monster* mons, bool plural = false);
00188 std::string summoned_poof_msg(const int midx, const item_def &item);
00189 std::string summoned_poof_msg(const monster* mons, const item_def &item);
00190
00191 bool mons_reaped(actor *killer, monster* victim);
00192
00193 actor* forest_near_enemy(const actor *mon);
00194 void forest_message(const coord_def pos, const std::string msg,
00195 msg_channel_type ch = MSGCH_PLAIN);
00196 void forest_damage(const actor *mon);
00197
00198 struct bolt;
00199
00200 void setup_spore_explosion(bolt & beam, const monster& origin);
00201 void setup_lightning_explosion(bolt & beam, const monster& origin);
00202
00203 bool mons_avoids_cloud(const monster* mons, cloud_type cl_type,
00204 bool placement = false);
00205
00206
00207
00208 bool mons_avoids_cloud(const monster* mons, int cloud_num,
00209 bool placement = false);
00210
00211 void debuff_monster(monster* mons);
00212 int exp_rate(int killer);
00213 int count_monsters(monster_type mtyp, bool friendlyOnly);
00214 int count_allies();
00215
00216 #endif