Angband
mon-lore.h
Go to the documentation of this file.
1 
19 #ifndef MONSTER_LORE_H
20 #define MONSTER_LORE_H
21 
22 #include "z-textblock.h"
23 #include "monster.h"
24 
28 typedef struct monster_lore
29 {
30  int ridx; /* Index of monster race */
31 
32  u16b sights; /* Count sightings of this monster */
33  u16b deaths; /* Count deaths from this monster */
34 
35  u16b pkills; /* Count monsters killed in this life */
36  u16b thefts; /* Count objects stolen in this life */
37  u16b tkills; /* Count monsters killed in all lives */
38 
39  byte wake; /* Number of times woken up (?) */
40  byte ignore; /* Number of times ignored (?) */
41 
42  byte drop_gold; /* Max number of gold dropped at once */
43  byte drop_item; /* Max number of item dropped at once */
44 
45  byte cast_innate; /* Max number of innate spells seen */
46  byte cast_spell; /* Max number of other spells seen */
47 
48  struct monster_blow *blows; /* Knowledge of blows */
49 
50  bitflag flags[RF_SIZE]; /* Observed racial flags - a 1 indicates
51  * the flag (or lack thereof) is known to
52  * the player */
53  bitflag spell_flags[RSF_SIZE]; /* Observed racial spell flags */
54 
59 
60  /* Derived known fields, put here for simplicity */
61  bool all_known;
62  bool *blow_known;
64  bool drop_known;
67 } monster_lore;
68 
72 extern struct monster_lore *l_list;
73 
74 void get_attack_colors(int *melee_colors);
75 void lore_append_kills(textblock *tb, const struct monster_race *race,
76  const struct monster_lore *lore,
77  const bitflag known_flags[RF_SIZE]);
78 void lore_append_flavor(textblock *tb, const struct monster_race *race,
79  bool append_utf8);
80 void lore_append_movement(textblock *tb, const struct monster_race *race,
81  const struct monster_lore *lore,
82  bitflag known_flags[RF_SIZE]);
83 void lore_append_toughness(textblock *tb, const struct monster_race *race,
84  const struct monster_lore *lore,
85  bitflag known_flags[RF_SIZE]);
86 void lore_append_exp(textblock *tb, const struct monster_race *race,
87  const struct monster_lore *lore,
88  bitflag known_flags[RF_SIZE]);
89 void lore_append_drop(textblock *tb, const struct monster_race *race,
90  const struct monster_lore *lore,
91  bitflag known_flags[RF_SIZE]);
92 void lore_append_abilities(textblock *tb, const struct monster_race *race,
93  const struct monster_lore *lore,
94  bitflag known_flags[RF_SIZE]);
95 void lore_append_awareness(textblock *tb, const struct monster_race *race,
96  const struct monster_lore *lore,
97  bitflag known_flags[RF_SIZE]);
98 void lore_append_friends(textblock *tb, const struct monster_race *race,
99  const struct monster_lore *lore,
100  bitflag known_flags[RF_SIZE]);
101 void lore_append_spells(textblock *tb, const struct monster_race *race,
102  const struct monster_lore *lore,
103  bitflag known_flags[RF_SIZE]);
104 void lore_append_attack(textblock *tb, const struct monster_race *race,
105  const struct monster_lore *lore,
106  bitflag known_flags[RF_SIZE]);
107 
108 void lore_learn_spell_if_has(struct monster_lore *lore, const struct monster_race *race, int flag);
109 void lore_learn_spell_if_visible(struct monster_lore *lore, const struct monster *mon, int flag);
110 void lore_learn_flag_if_visible(struct monster_lore *lore, const struct monster *mon, int flag);
111 
112 void lore_update(const struct monster_race *race, struct monster_lore *lore);
113 void cheat_monster_lore(const struct monster_race *race,
114  struct monster_lore *lore);
115 void wipe_monster_lore(const struct monster_race *race,
116  struct monster_lore *lore);
117 void lore_do_probe(struct monster *m);
118 bool lore_is_fully_known(const struct monster_race *race);
119 void monster_flags_known(const struct monster_race *race,
120  const struct monster_lore *lore,
122 void lore_treasure(struct monster *mon, int num_item, int num_gold);
123 struct monster_lore *get_lore(const struct monster_race *race);
124 bool lore_save(const char *name);
125 
126 #endif /* MONSTER_LORE_H */
uint16_t u16b
Definition: h-basic.h:169
bool * blow_known
Definition: mon-lore.h:62
Specified monster drops.
Definition: monster.h:218
Monster "race" information, including racial memories.
Definition: monster.h:307
byte drop_item
Definition: mon-lore.h:43
Text output bugger (?NRM) code.
struct monster_lore * l_list
Array[z_info->r_max] of monster lore.
Definition: mon-init.c:44
bool lore_is_fully_known(const struct monster_race *race)
Determine whether the monster is fully known.
Definition: mon-lore.c:399
int ridx
Definition: mon-lore.h:30
void lore_append_awareness(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append how the monster reacts to intruders and at what distance it does so.
Definition: mon-lore.c:1352
bool sleep_known
Definition: mon-lore.h:65
void lore_append_abilities(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster abilities (resists, weaknesses, other traits) to a textblock.
Definition: mon-lore.c:1205
Monster information, for a specific monster.
Definition: monster.h:369
bool all_known
Definition: mon-lore.h:61
void lore_append_exp(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the experience value description to a textblock.
Definition: mon-lore.c:1070
byte cast_innate
Definition: mon-lore.h:45
void lore_append_friends(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append information about what other races the monster appears with and if they work together...
Definition: mon-lore.c:1385
struct monster_lore * get_lore(const struct monster_race *race)
Get the lore record for this monster race.
Definition: mon-lore.c:1642
png_infop png_uint_32 flag
Definition: libpng12/png.h:2191
bool spell_freq_known
Definition: mon-lore.h:66
void lore_do_probe(struct monster *m)
Learn about a monster (by "probing" it)
Definition: mon-lore.c:384
u16b sights
Definition: mon-lore.h:32
void lore_append_movement(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster type, location, and movement patterns to a textblock.
Definition: mon-lore.c:912
uint8_t byte
Definition: h-basic.h:167
void lore_append_drop(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster drop description to a textblock.
Definition: mon-lore.c:1137
#define RSF_SIZE
Definition: monster.h:129
bool drop_known
Definition: mon-lore.h:64
bitflag flags[RF_SIZE]
Definition: mon-lore.h:50
Monster friends (specific monster)
Definition: monster.h:238
void lore_append_attack(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster's melee attacks to a textblock.
Definition: mon-lore.c:1522
void lore_append_spells(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster's attack spells to a textblock.
Definition: mon-lore.c:1418
struct monster_drop * drops
Definition: mon-lore.h:55
void lore_learn_spell_if_has(struct monster_lore *lore, const struct monster_race *race, int flag)
Definition: mon-lore.c:277
u16b tkills
Definition: mon-lore.h:37
bool lore_save(const char *name)
Save the lore to a file in the user directory.
Definition: mon-lore.c:1810
struct monster_friends_base * friends_base
Definition: mon-lore.h:57
byte bitflag
Definition: z-bitflag.h:27
void lore_append_flavor(textblock *tb, const struct monster_race *race, bool append_utf8)
Append the monster race description to a textblock.
Definition: mon-lore.c:888
Flags, structures and variables for monsters.
struct monster_lore monster_lore
Monster "lore" information.
void lore_learn_flag_if_visible(struct monster_lore *lore, const struct monster *mon, int flag)
Definition: mon-lore.c:291
struct monster_blow * blows
Definition: mon-lore.h:48
u16b thefts
Definition: mon-lore.h:36
byte wake
Definition: mon-lore.h:39
bool armour_known
Definition: mon-lore.h:63
void cheat_monster_lore(const struct monster_race *race, struct monster_lore *lore)
Learn everything about a monster.
Definition: mon-lore.c:356
u16b pkills
Definition: mon-lore.h:35
bitflag spell_flags[RSF_SIZE]
Definition: mon-lore.h:53
byte ignore
Definition: mon-lore.h:40
Monster "lore" information.
Definition: mon-lore.h:28
byte cast_spell
Definition: mon-lore.h:46
void lore_learn_spell_if_visible(struct monster_lore *lore, const struct monster *mon, int flag)
Definition: mon-lore.c:284
Intialize random names
Definition: init.c:847
struct monster_mimic * mimic_kinds
Definition: mon-lore.h:58
void lore_append_kills(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, const bitflag known_flags[RF_SIZE])
Append the kill history to a texblock for a given monster race.
Definition: mon-lore.c:810
u16b deaths
Definition: mon-lore.h:33
void wipe_monster_lore(const struct monster_race *race, struct monster_lore *lore)
Forget everything about a monster.
Definition: mon-lore.c:369
How monsters mimic.
Definition: monster.h:277
void lore_treasure(struct monster *mon, int num_item, int num_gold)
Take note that the given monster just dropped some treasure.
Definition: mon-lore.c:459
void monster_flags_known(const struct monster_race *race, const struct monster_lore *lore, bitflag flags[RF_SIZE])
Copies into flags the flags of the given monster race that are known to the given lore structure (usu...
Definition: mon-lore.c:488
struct monster_friends * friends
Definition: mon-lore.h:56
void get_attack_colors(int *melee_colors)
#define RF_SIZE
Definition: monster.h:97
void lore_update(const struct monster_race *race, struct monster_lore *lore)
Update which bits of lore are known.
Definition: mon-lore.c:302
Monster friends (general type)
Definition: monster.h:251
Monster blows.
Definition: monster.h:146
Definition: z-textblock.c:33
void lore_append_toughness(textblock *tb, const struct monster_race *race, const struct monster_lore *lore, bitflag known_flags[RF_SIZE])
Append the monster AC, HP, and hit chance to a textblock.
Definition: mon-lore.c:1008
byte drop_gold
Definition: mon-lore.h:42