Angband
obj-knowledge.h
Go to the documentation of this file.
1 
19 #include "angband.h"
20 #include "object.h"
21 #include "player.h"
22 
31 };
32 
33 
39 };
40 
41 struct rune {
43  int index;
45  const char *name;
46 };
47 
48 int max_runes(void);
49 enum rune_variety rune_variety(size_t i);
50 bool player_knows_rune(struct player *p, size_t i);
51 char *rune_name(size_t i);
52 char *rune_desc(size_t i);
53 quark_t rune_note(size_t i);
54 void rune_set_note(size_t i, const char *inscription);
55 
56 bool player_knows_brand(struct player *p, int i);
57 bool player_knows_slay(struct player *p, int i);
58 bool player_knows_curse(struct player *p, int i);
59 bool player_knows_ego(struct player *p, struct ego_item *ego);
60 bool object_effect_is_known(const struct object *obj);
61 bool object_is_known_artifact(const struct object *obj);
62 bool object_is_in_store(const struct object *obj);
63 bool object_has_standard_to_h(const struct object *obj);
64 bool object_has_rune(const struct object *obj, int rune_no);
65 bool object_runes_known(const struct object *obj);
66 bool object_fully_known(const struct object *obj);
67 bool object_flag_is_known(const struct object *obj, int flag);
68 bool object_element_is_known(const struct object *obj, int element);
69 
70 void object_set_base_known(struct object *obj);
71 void object_sense(struct player *p, struct object *obj);
72 void object_see(struct player *p, struct object *obj);
73 void object_touch(struct player *p, struct object *obj);
74 void player_know_object(struct player *p, struct object *obj);
76 
77 void player_learn_flag(struct player *p, int flag);
78 void player_learn_curse(struct player *p, struct curse *curse);
79 void player_learn_everything(struct player *p);
80 
81 void equip_learn_on_defend(struct player *p);
84 void equip_learn_flag(struct player *p, int flag);
85 void equip_learn_element(struct player *p, int element);
86 void equip_learn_after_time(struct player *p);
87 
88 void object_learn_unknown_rune(struct player *p, struct object *obj);
89 void object_learn_on_wield(struct player *p, struct object *obj);
90 void object_learn_on_use(struct player *p, struct object *obj);
91 void object_learn_brand(struct player *p, struct object *obj, int index);
92 void object_learn_slay(struct player *p, struct object *obj, int index);
93 void missile_learn_on_ranged_attack(struct player *p, struct object *obj);
94 
95 bool easy_know(const struct object *obj);
96 bool object_flavor_is_aware(const struct object *obj);
97 bool object_flavor_was_tried(const struct object *obj);
98 void object_flavor_aware(struct object *obj);
99 void object_flavor_tried(struct object *obj);
bool object_flavor_was_tried(const struct object *obj)
Checks whether the player has tried to use other objects of the same kind.
Definition: obj-knowledge.c:1996
bool player_knows_ego(struct player *p, struct ego_item *ego)
Check if an ego item type is known to the player.
Definition: obj-knowledge.c:460
int index
Definition: obj-knowledge.h:43
rune_variety
Definition: obj-knowledge.h:23
Includes basic includes.
void object_learn_on_use(struct player *p, struct object *obj)
Learn object properties that become obvious on use, mark it as aware and reward the player with some ...
Definition: obj-knowledge.c:1638
void equip_learn_on_defend(struct player *p)
Functions for learning about equipment properties These functions are for gaining object knowledge f...
Definition: obj-knowledge.c:1739
void player_learn_curse(struct player *p, struct curse *curse)
Learn a curse.
Definition: obj-knowledge.c:1235
quark_t note
Definition: obj-knowledge.h:44
png_uint_32 i
Definition: libpng12/png.h:2821
bool object_fully_known(const struct object *obj)
Check if an object is fully known to the player.
Definition: obj-knowledge.c:707
enum rune_variety variety
Definition: obj-knowledge.h:42
quark_t rune_note(size_t i)
The autoinscription index (if any) of a rune.
Definition: obj-knowledge.c:397
void object_sense(struct player *p, struct object *obj)
Gain knowledge based on sensing an object on the floor.
Definition: obj-knowledge.c:804
Definition: obj-knowledge.h:28
Definition: obj-knowledge.h:24
png_infop png_uint_32 flag
Definition: libpng12/png.h:2191
int max_runes(void)
Rune knowledge functions These functions provide details about the rune list for use in player knowl...
Definition: obj-knowledge.c:225
bool object_element_is_known(const struct object *obj, int element)
Checks whether the player knows the given element properties of an object.
Definition: obj-knowledge.c:745
void object_flavor_aware(struct object *obj)
Mark an object's flavour as as one the player is aware of.
Definition: obj-knowledge.c:2007
void object_touch(struct player *p, struct object *obj)
Gain knowledge based on being an the same square as an object.
Definition: obj-knowledge.c:916
void object_learn_brand(struct player *p, struct object *obj, int index)
Notice any brands on a particular object which affect a particular monster.
Definition: obj-knowledge.c:1682
void object_learn_slay(struct player *p, struct object *obj, int index)
Notice any slays on a particular object which affect a particular monster.
Definition: obj-knowledge.c:1656
const char * name
Definition: obj-knowledge.h:45
bool object_is_in_store(const struct object *obj)
Checks whether the object is in a store.
Definition: obj-knowledge.c:532
void player_learn_flag(struct player *p, int flag)
Learn a flag.
Definition: obj-knowledge.c:1226
Definition: obj-knowledge.h:26
void object_learn_on_wield(struct player *p, struct object *obj)
Learn object properties that become obvious on wielding or wearing.
Definition: obj-knowledge.c:1563
void update_player_object_knowledge(struct player *p)
Propagate player knowledge of objects to all objects.
Definition: obj-knowledge.c:1065
bool easy_know(const struct object *obj)
Object kind functions These deal with knowledge of an object's kind
Definition: obj-knowledge.c:1971
Player implementation.
Definition: obj-knowledge.h:27
bool object_runes_known(const struct object *obj)
Check if all the runes on an object are known to the player.
Definition: obj-knowledge.c:646
void equip_learn_on_ranged_attack(struct player *p)
Learn to-hit bonus on making a ranged attack.
Definition: obj-knowledge.c:1765
combat_runes
Definition: obj-knowledge.h:34
void player_know_object(struct player *p, struct object *obj)
Transfer player object knowledge to an object.
Definition: obj-knowledge.c:936
Definition: obj-knowledge.h:41
void object_see(struct player *p, struct object *obj)
Gain knowledge based on seeing an object on the floor.
Definition: obj-knowledge.c:841
Definition: obj-knowledge.h:38
void object_flavor_tried(struct object *obj)
Mark an object's flavour as tried.
Definition: obj-knowledge.c:2061
void equip_learn_on_melee_attack(struct player *p)
Learn things which happen on making a melee attack.
Definition: obj-knowledge.c:1796
void object_learn_unknown_rune(struct player *p, struct object *obj)
Learn a random unknown rune from an object.
Definition: obj-knowledge.c:1545
Definition: obj-knowledge.h:37
const char ** p[]
Definition: name.c:40
char * rune_desc(size_t i)
The description of a rune.
Definition: obj-knowledge.c:337
bool object_flag_is_known(const struct object *obj, int flag)
Checks whether the player knows whether an object has a given flag.
Definition: obj-knowledge.c:725
bool player_knows_rune(struct player *p, size_t i)
Reports if the player knows a given rune.
Definition: obj-knowledge.c:244
void rune_set_note(size_t i, const char *inscription)
Set an autoinscription on a rune.
Definition: obj-knowledge.c:405
bool object_has_rune(const struct object *obj, int rune_no)
Check if an object has a rune.
Definition: obj-knowledge.c:571
void player_learn_everything(struct player *p)
Learn absolutely everything.
Definition: obj-knowledge.c:1249
bool object_effect_is_known(const struct object *obj)
Checks whether the player is aware of the object's effect when used.
Definition: obj-knowledge.c:509
char * rune_name(size_t i)
The name of a rune.
Definition: obj-knowledge.c:316
Information about ego-items.
Definition: object.h:303
bool object_has_standard_to_h(const struct object *obj)
Checks whether the object has the usual to-hit value.
Definition: obj-knowledge.c:552
basic object structs and enums
bool object_flavor_is_aware(const struct object *obj)
Checks whether the player is aware of the object's flavour.
Definition: obj-knowledge.c:1985
Definition: obj-knowledge.h:36
Curse type.
Definition: object.h:91
bool player_knows_brand(struct player *p, int i)
Object knowledge predicates These functions tell how much the player knows about an object ...
Definition: obj-knowledge.c:427
bool player_knows_slay(struct player *p, int i)
Check if a slay is known to the player.
Definition: obj-knowledge.c:438
void object_set_base_known(struct object *obj)
Object knowledge propagators These functions transfer player knowledge to objects ...
Definition: obj-knowledge.c:769
bool player_knows_curse(struct player *p, int i)
Check if a curse is known to the player.
Definition: obj-knowledge.c:449
Most of the "player" information goes here.
Definition: player.h:454
void equip_learn_element(struct player *p, int element)
Learn the elemental resistance properties on wielded items.
Definition: obj-knowledge.c:1872
void equip_learn_flag(struct player *p, int flag)
Learn a given object flag on wielded items.
Definition: obj-knowledge.c:1832
void equip_learn_after_time(struct player *p)
Learn things that would be noticed in time.
Definition: obj-knowledge.c:1913
bool object_is_known_artifact(const struct object *obj)
Checks whether the object is known to be an artifact.
Definition: obj-knowledge.c:521
Definition: obj-knowledge.h:30
size_t quark_t
Quark type.
Definition: z-quark.h:29
int index
Definition: obj-info.c:68
Definition: obj-knowledge.h:29
void missile_learn_on_ranged_attack(struct player *p, struct object *obj)
Learn attack bonus on making a ranged attack.
Definition: obj-knowledge.c:1710
Definition: obj-knowledge.h:35
Definition: obj-knowledge.h:25