Angband
player-calcs.h
Go to the documentation of this file.
1 
20 #ifndef PLAYER_CALCS_H
21 #define PLAYER_CALCS_H
22 
23 #include "player.h"
24 
28 #define PN_COMBINE 0x00000001L /* Combine the pack */
29 #define PN_IGNORE 0x00000004L /* Ignore stuff */
30 #define PN_MON_MESSAGE 0x00000010L /* flush monster pain messages */
31 
32 
36 #define PU_BONUS 0x00000001L /* Calculate bonuses */
37 #define PU_TORCH 0x00000002L /* Calculate torch radius */
38 #define PU_HP 0x00000004L /* Calculate chp and mhp */
39 #define PU_MANA 0x00000008L /* Calculate csp and msp */
40 #define PU_SPELLS 0x00000010L /* Calculate spells */
41 /* 0x20L */
42 #define PU_UPDATE_VIEW 0x00000040L /* Update field of view */
43 #define PU_FORGET_FLOW 0x00000080L /* Forget flow data */
44 #define PU_UPDATE_FLOW 0x00000100L /* Update flow data */
45 #define PU_MONSTERS 0x00000200L /* Update monsters */
46 #define PU_DISTANCE 0x00000400L /* Update distances */
47 #define PU_PANEL 0x00000800L /* Update panel */
48 #define PU_INVEN 0x00001000L /* Update inventory */
49 
50 
54 #define PR_MISC 0x00000001L /* Display Race/Class */
55 #define PR_TITLE 0x00000002L /* Display Title */
56 #define PR_LEV 0x00000004L /* Display Level */
57 #define PR_EXP 0x00000008L /* Display Experience */
58 #define PR_STATS 0x00000010L /* Display Stats */
59 #define PR_ARMOR 0x00000020L /* Display Armor */
60 #define PR_HP 0x00000040L /* Display Hitpoints */
61 #define PR_MANA 0x00000080L /* Display Mana */
62 #define PR_GOLD 0x00000100L /* Display Gold */
63 #define PR_HEALTH 0x00000200L /* Display Health Bar */
64 #define PR_SPEED 0x00000400L /* Display Extra (Speed) */
65 #define PR_STUDY 0x00000800L /* Display Extra (Study) */
66 #define PR_DEPTH 0x00001000L /* Display Depth */
67 #define PR_STATUS 0x00002000L
68 #define PR_STATE 0x00008000L /* Display Extra (State) */
69 #define PR_MAP 0x00010000L /* Redraw whole map */
70 #define PR_INVEN 0x00020000L /* Display inven/equip */
71 #define PR_EQUIP 0x00040000L /* Display equip/inven */
72 #define PR_MESSAGE 0x00080000L /* Display messages */
73 #define PR_MONSTER 0x00100000L /* Display monster recall */
74 #define PR_OBJECT 0x00200000L /* Display object recall */
75 #define PR_MONLIST 0x00400000L /* Display monster list */
76 #define PR_ITEMLIST 0x00800000L /* Display item list */
77 #define PR_FEELING 0x01000000L /* Display level feeling */
78 
82 #define PR_BASIC \
83  (PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
84  PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
85  PR_MANA | PR_DEPTH | PR_HEALTH | PR_SPEED)
86 
90 #define PR_EXTRA \
91  (PR_STATUS | PR_STATE | PR_STUDY)
92 
96 #define PR_SUBWINDOW \
97  (PR_MONSTER | PR_OBJECT | PR_MONLIST | PR_ITEMLIST)
98 
99 
100 extern const int adj_str_blow[STAT_RANGE];
101 extern const int adj_dex_safe[STAT_RANGE];
102 extern const int adj_con_fix[STAT_RANGE];
103 extern const int adj_str_hold[STAT_RANGE];
104 
105 bool earlier_object(struct object *orig, struct object *new, bool store);
106 int equipped_item_slot(struct player_body body, struct object *obj);
107 void calc_inventory(struct player_upkeep *upkeep, struct object *gear,
108  struct player_body body);
109 void calc_bonuses(struct player *p, struct player_state *state, bool known_only,
110  bool update);
111 void calc_digging_chances(struct player_state *state, int chances[DIGGING_MAX]);
112 int calc_blows(struct player *p, const struct object *obj,
113  struct player_state *state, int extra_blows);
114 
115 void health_track(struct player_upkeep *upkeep, struct monster *mon);
116 void monster_race_track(struct player_upkeep *upkeep,
117  struct monster_race *race);
118 void track_object(struct player_upkeep *upkeep, struct object *obj);
119 void track_object_kind(struct player_upkeep *upkeep, struct object_kind *kind);
120 void track_object_cancel(struct player_upkeep *upkeep);
121 bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj);
122 
123 void notice_stuff(struct player *p);
124 void update_stuff(struct player *p);
125 void redraw_stuff(struct player *p);
126 void handle_stuff(struct player *p);
127 int weight_remaining(struct player *p);
128 
129 #endif /* !PLAYER_CALCS_H */
Monster "race" information, including racial memories.
Definition: monster.h:263
Monster information, for a specific monster.
Definition: monster.h:320
Information about object kinds, including player knowledge.
Definition: object.h:157
int weight_remaining(struct player *p)
Computes weight remaining before burdened.
Definition: player-calcs.c:1654
void health_track(struct player_upkeep *upkeep, struct monster *mon)
Monster and object tracking functions
Definition: player-calcs.c:2200
const int adj_str_blow[STAT_RANGE]
Stat Table (STR) – help index into the "blow" table.
Definition: player-calcs.c:547
void update_stuff(struct player *p)
Handle "player->upkeep->update".
Definition: player-calcs.c:2295
void track_object_cancel(struct player_upkeep *upkeep)
Cancel all object tracking.
Definition: player-calcs.c:2241
Player implementation.
All the variable state that changes when you put on/take off equipment.
Definition: player.h:354
#define STAT_RANGE
The range of possible indexes into tables based upon stats.
Definition: player.h:76
void calc_bonuses(struct player *p, struct player_state *state, bool known_only, bool update)
Calculate the players current "state", taking into account not only race/class intrinsics, but also objects being worn and temporary spell effects.
Definition: player-calcs.c:1689
void monster_race_track(struct player_upkeep *upkeep, struct monster_race *race)
Track the given monster race.
Definition: player-calcs.c:2209
const char ** p[]
Definition: name.c:40
void calc_inventory(struct player_upkeep *upkeep, struct object *gear, struct player_body body)
Put the player's inventory and quiver into easily accessible arrays.
Definition: player-calcs.c:1015
Temporary, derived, player-related variables used during play but not saved.
Definition: player.h:398
bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj)
Is the given item tracked?
Definition: player-calcs.c:2251
const int adj_con_fix[STAT_RANGE]
Stat Table (CON) – base regeneration rate.
Definition: player-calcs.c:685
void redraw_stuff(struct player *p)
Handle "player->upkeep->redraw".
Definition: player-calcs.c:2416
void calc_digging_chances(struct player_state *state, int chances[DIGGING_MAX])
Populates chances with the player's chance of digging through the diggable terrain types in one turn ...
Definition: player-calcs.c:1576
void handle_stuff(struct player *p)
Handle "player->upkeep->update" and "player->upkeep->redraw".
Definition: player-calcs.c:2466
const int adj_dex_safe[STAT_RANGE]
Stat Table (DEX) – chance of avoiding "theft" and "falling".
Definition: player-calcs.c:639
void notice_stuff(struct player *p)
Generic "deal with" functions
Definition: player-calcs.c:2266
Definition: store.h:57
void track_object(struct player_upkeep *upkeep, struct object *obj)
Track the given object.
Definition: player-calcs.c:2221
bool earlier_object(struct object *orig, struct object *new, bool store)
Decide which object comes earlier in the standard inventory listing, defaulting to the first if nothi...
Definition: player-calcs.c:938
void track_object_kind(struct player_upkeep *upkeep, struct object_kind *kind)
Track the given object kind.
Definition: player-calcs.c:2231
Most of the "player" information goes here.
Definition: player.h:454
int calc_blows(struct player *p, const struct object *obj, struct player_state *state, int extra_blows)
Calculate the blows a player would get.
Definition: player-calcs.c:1602
const int adj_str_hold[STAT_RANGE]
Stat Table (STR) – weapon weight limit in pounds.
Definition: player-calcs.c:455
A player 'body'.
Definition: player.h:160
int equipped_item_slot(struct player_body body, struct object *obj)
Definition: player-calcs.c:997
Definition: player.h:111