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 object_grab(struct player *p, struct object *obj);
75 void player_know_object(struct player *p, struct object *obj);
77 
78 void player_learn_flag(struct player *p, int flag);
79 void player_learn_curse(struct player *p, struct curse *curse);
80 void player_learn_innate(struct player *p);
81 void player_learn_all_runes(struct player *p);
82 
83 void equip_learn_on_defend(struct player *p);
86 void equip_learn_flag(struct player *p, int flag);
87 void equip_learn_element(struct player *p, int element);
88 void equip_learn_after_time(struct player *p);
89 
90 void object_learn_unknown_rune(struct player *p, struct object *obj);
91 void object_learn_on_wield(struct player *p, struct object *obj);
92 void shape_learn_on_assume(struct player *p, const char *name);
93 void object_learn_on_use(struct player *p, struct object *obj);
94 void object_learn_brand(struct player *p, struct object *obj, int index);
95 void object_learn_slay(struct player *p, struct object *obj, int index);
96 void missile_learn_on_ranged_attack(struct player *p, struct object *obj);
97 
98 bool easy_know(const struct object *obj);
99 bool object_flavor_is_aware(const struct object *obj);
100 bool object_flavor_was_tried(const struct object *obj);
101 void object_flavor_aware(struct object *obj);
102 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:2211
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:461
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:1801
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:1903
void player_learn_curse(struct player *p, struct curse *curse)
Learn a curse.
Definition: obj-knowledge.c:1311
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:723
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:398
void object_sense(struct player *p, struct object *obj)
Gain knowledge based on sensing an object on the floor.
Definition: obj-knowledge.c:827
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:226
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:761
void object_flavor_aware(struct object *obj)
Mark an object's flavour as as one the player is aware of.
Definition: obj-knowledge.c:2222
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:942
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:1846
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:1820
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:533
void player_learn_flag(struct player *p, int flag)
Learn a flag.
Definition: obj-knowledge.c:1302
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:1691
void update_player_object_knowledge(struct player *p)
Propagate player knowledge of objects to all objects.
Definition: obj-knowledge.c:1141
bool easy_know(const struct object *obj)
Object kind functions These deal with knowledge of an object's kind
Definition: obj-knowledge.c:2186
Player implementation.
void player_learn_all_runes(struct player *p)
Learn absolutely everything.
Definition: obj-knowledge.c:1350
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:703
void equip_learn_on_ranged_attack(struct player *p)
Learn to-hit bonus on making a ranged attack.
Definition: obj-knowledge.c:1936
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:1006
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:862
Definition: obj-knowledge.h:38
void object_flavor_tried(struct object *obj)
Mark an object's flavour as tried.
Definition: obj-knowledge.c:2275
void equip_learn_on_melee_attack(struct player *p)
Learn things which happen on making a melee attack.
Definition: obj-knowledge.c:1972
void object_learn_unknown_rune(struct player *p, struct object *obj)
Learn a random unknown rune from an object.
Definition: obj-knowledge.c:1673
void player_learn_innate(struct player *p)
Learn all innate runes.
Definition: obj-knowledge.c:1325
void shape_learn_on_assume(struct player *p, const char *name)
Learn object properties that become obvious on making a shapechange.
Definition: obj-knowledge.c:1769
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:338
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:741
bool player_knows_rune(struct player *p, size_t i)
Reports if the player knows a given rune.
Definition: obj-knowledge.c:245
void rune_set_note(size_t i, const char *inscription)
Set an autoinscription on a rune.
Definition: obj-knowledge.c:406
bool object_has_rune(const struct object *obj, int rune_no)
Check if an object has a rune.
Definition: obj-knowledge.c:572
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:510
char * rune_name(size_t i)
The name of a rune.
Definition: obj-knowledge.c:317
Information about ego-items.
Definition: object.h:309
void object_grab(struct player *p, struct object *obj)
Gain knowledge based on grabbing an object from a monster.
Definition: obj-knowledge.c:960
bool object_has_standard_to_h(const struct object *obj)
Checks whether the object has the usual to-hit value.
Definition: obj-knowledge.c:553
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:2200
Definition: obj-knowledge.h:36
Curse type.
Definition: object.h:95
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:428
bool player_knows_slay(struct player *p, int i)
Check if a slay is known to the player.
Definition: obj-knowledge.c:439
void object_set_base_known(struct object *obj)
Object knowledge propagators These functions transfer player knowledge to objects ...
Definition: obj-knowledge.c:785
Intialize random names
Definition: init.c:838
bool player_knows_curse(struct player *p, int i)
Check if a curse is known to the player.
Definition: obj-knowledge.c:450
Most of the "player" information goes here.
Definition: player.h:489
void equip_learn_element(struct player *p, int element)
Learn the elemental resistance properties on wielded items.
Definition: obj-knowledge.c:2065
void equip_learn_flag(struct player *p, int flag)
Learn a given object flag on wielded items.
Definition: obj-knowledge.c:2017
void equip_learn_after_time(struct player *p)
Learn things that would be noticed in time.
Definition: obj-knowledge.c:2114
bool object_is_known_artifact(const struct object *obj)
Checks whether the object is known to be an artifact.
Definition: obj-knowledge.c:522
Definition: obj-knowledge.h:30
size_t quark_t
Quark type.
Definition: z-quark.h:29
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:1874
Definition: obj-knowledge.h:35
Definition: obj-knowledge.h:25