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  s16b sights; /* Count sightings of this monster */
33  s16b deaths; /* Count deaths from this monster */
34 
35  s16b pkills; /* Count monsters killed in this life */
36  s16b tkills; /* Count monsters killed in all lives */
37 
38  byte wake; /* Number of times woken up (?) */
39  byte ignore; /* Number of times ignored (?) */
40 
41  byte drop_gold; /* Max number of gold dropped at once */
42  byte drop_item; /* Max number of item dropped at once */
43 
44  byte cast_innate; /* Max number of innate spells seen */
45  byte cast_spell; /* Max number of other spells seen */
46 
47  struct monster_blow *blows; /* Knowledge of blows */
48 
49  bitflag flags[RF_SIZE]; /* Observed racial flags - a 1 indicates
50  * the flag (or lack thereof) is known to
51  * the player */
52  bitflag spell_flags[RSF_SIZE]; /* Observed racial spell flags */
53 
58 
59  /* Derived known fields, put here for simplicity */
60  bool all_known;
61  bool *blow_known;
63  bool drop_known;
66 } monster_lore;
67 
71 extern struct monster_lore *l_list;
72 
73 void get_attack_colors(int *melee_colors);
74 void lore_append_kills(textblock *tb, const struct monster_race *race,
75  const struct monster_lore *lore,
76  const bitflag known_flags[RF_SIZE]);
77 void lore_append_flavor(textblock *tb, const struct monster_race *race,
78  bool append_utf8);
79 void lore_append_movement(textblock *tb, const struct monster_race *race,
80  const struct monster_lore *lore,
81  bitflag known_flags[RF_SIZE]);
82 void lore_append_toughness(textblock *tb, const struct monster_race *race,
83  const struct monster_lore *lore,
84  bitflag known_flags[RF_SIZE]);
85 void lore_append_exp(textblock *tb, const struct monster_race *race,
86  const struct monster_lore *lore,
87  bitflag known_flags[RF_SIZE]);
88 void lore_append_drop(textblock *tb, const struct monster_race *race,
89  const struct monster_lore *lore,
90  bitflag known_flags[RF_SIZE]);
91 void lore_append_abilities(textblock *tb, const struct monster_race *race,
92  const struct monster_lore *lore,
93  bitflag known_flags[RF_SIZE]);
94 void lore_append_awareness(textblock *tb, const struct monster_race *race,
95  const struct monster_lore *lore,
96  bitflag known_flags[RF_SIZE]);
97 void lore_append_friends(textblock *tb, const struct monster_race *race,
98  const struct monster_lore *lore,
99  bitflag known_flags[RF_SIZE]);
100 void lore_append_spells(textblock *tb, const struct monster_race *race,
101  const struct monster_lore *lore,
102  bitflag known_flags[RF_SIZE]);
103 void lore_append_attack(textblock *tb, const struct monster_race *race,
104  const struct monster_lore *lore,
105  bitflag known_flags[RF_SIZE]);
106 
107 void lore_learn_spell_if_has(struct monster_lore *lore, const struct monster_race *race, int flag);
108 void lore_learn_spell_if_visible(struct monster_lore *lore, const struct monster *mon, int flag);
109 void lore_learn_flag_if_visible(struct monster_lore *lore, const struct monster *mon, int flag);
110 
111 void lore_update(const struct monster_race *race, struct monster_lore *lore);
112 void cheat_monster_lore(const struct monster_race *race,
113  struct monster_lore *lore);
114 void wipe_monster_lore(const struct monster_race *race,
115  struct monster_lore *lore);
116 void lore_do_probe(struct monster *m);
117 bool lore_is_fully_known(const struct monster_race *race);
118 void monster_flags_known(const struct monster_race *race,
119  const struct monster_lore *lore,
121 void lore_treasure(struct monster *mon, int num_item, int num_gold);
122 struct monster_lore *get_lore(const struct monster_race *race);
123 bool lore_save(const char *name);
124 
125 #endif /* MONSTER_LORE_H */
bool * blow_known
Definition: mon-lore.h:61
s16b deaths
Definition: mon-lore.h:33
Specified monster drops.
Definition: monster.h:208
Monster "race" information, including racial memories.
Definition: monster.h:263
byte drop_item
Definition: mon-lore.h:42
s16b sights
Definition: mon-lore.h:32
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:350
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:1224
bool sleep_known
Definition: mon-lore.h:64
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:1096
Monster information, for a specific monster.
Definition: monster.h:320
bool all_known
Definition: mon-lore.h:60
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:963
byte cast_innate
Definition: mon-lore.h:44
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:1257
struct monster_lore * get_lore(const struct monster_race *race)
Get the lore record for this monster race.
Definition: mon-lore.c:1488
png_infop png_uint_32 flag
Definition: libpng12/png.h:2191
bool spell_freq_known
Definition: mon-lore.h:65
void lore_do_probe(struct monster *m)
Learn about a monster (by "probing" it)
Definition: mon-lore.c:335
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:802
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:1028
#define RSF_SIZE
Definition: monster.h:128
bool drop_known
Definition: mon-lore.h:63
bitflag flags[RF_SIZE]
Definition: mon-lore.h:49
Monster friends (specific monster)
Definition: monster.h:220
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:1394
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:1290
struct monster_drop * drops
Definition: mon-lore.h:54
void lore_learn_spell_if_has(struct monster_lore *lore, const struct monster_race *race, int flag)
Definition: mon-lore.c:230
bool lore_save(const char *name)
Save the lore to a file in the user directory.
Definition: mon-lore.c:1626
png_uint_32 int flags
Definition: libpng12/png.h:1681
struct monster_friends_base * friends_base
Definition: mon-lore.h:56
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:778
Flags, structures and variables for monsters.
int16_t s16b
Definition: h-basic.h:170
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:244
struct monster_blow * blows
Definition: mon-lore.h:47
byte wake
Definition: mon-lore.h:38
bool armour_known
Definition: mon-lore.h:62
void cheat_monster_lore(const struct monster_race *race, struct monster_lore *lore)
Learn everything about a monster.
Definition: mon-lore.c:303
bitflag spell_flags[RSF_SIZE]
Definition: mon-lore.h:52
s16b pkills
Definition: mon-lore.h:35
byte ignore
Definition: mon-lore.h:39
Monster "lore" information.
Definition: mon-lore.h:28
byte cast_spell
Definition: mon-lore.h:45
void lore_learn_spell_if_visible(struct monster_lore *lore, const struct monster *mon, int flag)
Definition: mon-lore.c:237
Intialize random names
Definition: init.c:658
struct monster_mimic * mimic_kinds
Definition: mon-lore.h:57
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:700
void wipe_monster_lore(const struct monster_race *race, struct monster_lore *lore)
Forget everything about a monster.
Definition: mon-lore.c:320
How monsters mimic.
Definition: monster.h:243
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:410
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:439
struct monster_friends * friends
Definition: mon-lore.h:55
void get_attack_colors(int *melee_colors)
#define RF_SIZE
Definition: monster.h:96
void lore_update(const struct monster_race *race, struct monster_lore *lore)
Update which bits of lore are known.
Definition: mon-lore.c:255
Monster friends (general type)
Definition: monster.h:232
Monster blows.
Definition: monster.h:145
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:900
s16b tkills
Definition: mon-lore.h:36
byte drop_gold
Definition: mon-lore.h:41