Angband
mon-util.h
Go to the documentation of this file.
1 
19 #ifndef MONSTER_UTILITIES_H
20 #define MONSTER_UTILITIES_H
21 
22 #include "monster.h"
23 #include "mon-msg.h"
24 
25 const char *describe_race_flag(int flag);
26 void create_mon_flag_mask(bitflag *f, ...);
27 struct monster_race *lookup_monster(const char *name);
28 struct monster_base *lookup_monster_base(const char *name);
29 bool match_monster_bases(const struct monster_base *base, ...);
30 void update_mon(struct monster *mon, struct chunk *c, bool full);
31 void update_monsters(bool full);
32 bool monster_carry(struct chunk *c, struct monster *mon, struct object *obj);
33 void monster_swap(struct loc grid1, struct loc grid2);
34 void monster_wake(struct monster *mon, bool notify, int aware_chance);
35 bool monster_can_see(struct chunk *c, struct monster *mon, struct loc grid);
36 void become_aware(struct monster *m);
37 void update_smart_learn(struct monster *mon, struct player *p, int flag,
38  int pflag, int element);
39 bool find_any_nearby_injured_kin(struct chunk *c, const struct monster *mon);
40 struct monster *choose_nearby_injured_kin(struct chunk *c, const struct monster *mon);
41 void monster_death(struct monster *mon, bool stats);
42 bool mon_take_nonplayer_hit(int dam, struct monster *t_mon,
43  enum mon_messages hurt_msg,
44  enum mon_messages die_msg);
45 bool mon_take_hit(struct monster *mon, int dam, bool *fear, const char *note);
46 void kill_arena_monster(struct monster *mon);
47 void monster_take_terrain_damage(struct monster *mon);
48 bool monster_taking_terrain_damage(struct monster *mon);
49 struct monster *get_commanded_monster(void);
50 struct object *get_random_monster_object(struct monster *mon);
51 void steal_monster_item(struct monster *mon, int midx);
52 bool monster_change_shape(struct monster *mon);
53 bool monster_revert_shape(struct monster *mon);
54 
55 #endif /* MONSTER_UTILITIES_H */
bool mon_take_nonplayer_hit(int dam, struct monster *t_mon, enum mon_messages hurt_msg, enum mon_messages die_msg)
Deal damage to a monster from another monster (or at least not the player).
Definition: mon-util.c:1081
Monster "race" information, including racial memories.
Definition: monster.h:307
static int stats[STAT_MAX]
All of these should be in some kind of 'birth state' struct somewhere else
Definition: player-birth.c:118
void monster_wake(struct monster *mon, bool notify, int aware_chance)
Monster wakes up and possibly becomes aware of the player.
Definition: mon-util.c:603
struct monster_base * lookup_monster_base(const char *name)
Return the monster base matching the given name.
Definition: mon-util.c:138
Monster information, for a specific monster.
Definition: monster.h:369
Definition: z-type.h:24
Structures and functions for monster messages.
bool find_any_nearby_injured_kin(struct chunk *c, const struct monster *mon)
Find out if there are any injured monsters nearby.
Definition: mon-util.c:772
png_infop png_uint_32 flag
Definition: libpng12/png.h:2191
struct monster * get_commanded_monster(void)
Returns the monster currently commanded, or NULL.
Definition: mon-util.c:1236
bool match_monster_bases(const struct monster_base *base,...)
Return whether the given base matches any of the names given.
Definition: mon-util.c:158
bool monster_can_see(struct chunk *c, struct monster *mon, struct loc grid)
Monster can see a grid.
Definition: mon-util.c:615
mon_messages
Monster message constants.
Definition: mon-msg.h:27
Definition: cave.h:178
void update_monsters(bool full)
Updates all the (non-dead) monsters via update_mon().
Definition: mon-util.c:450
Object information, for a specific object.
Definition: object.h:399
void become_aware(struct monster *m)
Make player fully aware of the given mimic.
Definition: mon-util.c:626
struct monster_race * lookup_monster(const char *name)
Returns the monster with the given name.
Definition: mon-util.c:111
void create_mon_flag_mask(bitflag *f,...)
Create a mask of monster flags of a specific type.
Definition: mon-util.c:83
Base monster type.
Definition: monster.h:200
void kill_arena_monster(struct monster *mon)
Definition: mon-util.c:1191
void monster_take_terrain_damage(struct monster *mon)
Terrain damages monster.
Definition: mon-util.c:1202
const char ** p[]
Definition: name.c:40
byte bitflag
Definition: z-bitflag.h:27
Flags, structures and variables for monsters.
const char * describe_race_flag(int flag)
Return a description for the given monster race flag.
Definition: mon-util.c:65
void update_smart_learn(struct monster *mon, struct player *p, int flag, int pflag, int element)
The given monster learns about an "observed" resistance or other player state property, or lack of it.
Definition: mon-util.c:679
bool monster_revert_shape(struct monster *mon)
Monster reverse shapechange.
Definition: mon-util.c:1534
struct object * get_random_monster_object(struct monster *mon)
Get a random object from a monster's inventory.
Definition: mon-util.c:1257
void steal_monster_item(struct monster *mon, int midx)
Player or monster midx steals an item from a monster.
Definition: mon-util.c:1287
void monster_death(struct monster *mon, bool stats)
Handles the "death" of a monster.
Definition: mon-util.c:832
struct monster * choose_nearby_injured_kin(struct chunk *c, const struct monster *mon)
Choose one injured monster of the same base in LOS of the provided monster.
Definition: mon-util.c:794
void update_mon(struct monster *mon, struct chunk *c, bool full)
This function updates the monster record of the given monster.
Definition: mon-util.c:258
bool monster_taking_terrain_damage(struct monster *mon)
Terrain is currently damaging monster.
Definition: mon-util.c:1222
Intialize random names
Definition: init.c:847
Most of the "player" information goes here.
Definition: player.h:489
bool mon_take_hit(struct monster *mon, int dam, bool *fear, const char *note)
Decreases a monster's hit points by dam and handle monster death.
Definition: mon-util.c:1147
bool monster_change_shape(struct monster *mon)
Monster shapechange.
Definition: mon-util.c:1439
void monster_swap(struct loc grid1, struct loc grid2)
Swap the players/monsters (if any) at two locations.
Definition: mon-util.c:521
void note(const char *message)
Utility
Definition: savefile.c:177
bool monster_carry(struct chunk *c, struct monster *mon, struct object *obj)
Add the given object to the given monster's inventory.
Definition: mon-util.c:471