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 0x00000002L /* Ignore stuff */
30 #define PN_MON_MESSAGE 0x00000004L /* 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 #define PU_UPDATE_VIEW 0x00000020L /* Update field of view */
42 #define PU_MONSTERS 0x00000040L /* Update monsters */
43 #define PU_DISTANCE 0x00000080L /* Update distances */
44 #define PU_PANEL 0x00000100L /* Update panel */
45 #define PU_INVEN 0x00000200L /* Update inventory */
46 
47 
51 #define PR_MISC 0x00000001L /* Display Race/Class */
52 #define PR_TITLE 0x00000002L /* Display Title */
53 #define PR_LEV 0x00000004L /* Display Level */
54 #define PR_EXP 0x00000008L /* Display Experience */
55 #define PR_STATS 0x00000010L /* Display Stats */
56 #define PR_ARMOR 0x00000020L /* Display Armor */
57 #define PR_HP 0x00000040L /* Display Hitpoints */
58 #define PR_MANA 0x00000080L /* Display Mana */
59 #define PR_GOLD 0x00000100L /* Display Gold */
60 #define PR_HEALTH 0x00000200L /* Display Health Bar */
61 #define PR_SPEED 0x00000400L /* Display Extra (Speed) */
62 #define PR_STUDY 0x00000800L /* Display Extra (Study) */
63 #define PR_DEPTH 0x00001000L /* Display Depth */
64 #define PR_STATUS 0x00002000L
65 #define PR_STATE 0x00008000L /* Display Extra (State) */
66 #define PR_MAP 0x00010000L /* Redraw whole map */
67 #define PR_INVEN 0x00020000L /* Display inven/equip */
68 #define PR_EQUIP 0x00040000L /* Display equip/inven */
69 #define PR_MESSAGE 0x00080000L /* Display messages */
70 #define PR_MONSTER 0x00100000L /* Display monster recall */
71 #define PR_OBJECT 0x00200000L /* Display object recall */
72 #define PR_MONLIST 0x00400000L /* Display monster list */
73 #define PR_ITEMLIST 0x00800000L /* Display item list */
74 #define PR_FEELING 0x01000000L /* Display level feeling */
75 
79 #define PR_BASIC \
80  (PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
81  PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
82  PR_MANA | PR_DEPTH | PR_HEALTH | PR_SPEED)
83 
87 #define PR_EXTRA \
88  (PR_STATUS | PR_STATE | PR_STUDY)
89 
93 #define PR_SUBWINDOW \
94  (PR_MONSTER | PR_OBJECT | PR_MONLIST | PR_ITEMLIST)
95 
96 
97 extern const int adj_str_blow[STAT_RANGE];
98 extern const int adj_dex_safe[STAT_RANGE];
99 extern const int adj_con_fix[STAT_RANGE];
100 extern const int adj_str_hold[STAT_RANGE];
101 
102 bool earlier_object(struct object *orig, struct object *new, bool store);
103 int equipped_item_slot(struct player_body body, struct object *obj);
104 void calc_inventory(struct player_upkeep *upkeep, struct object *gear,
105  struct player_body body);
106 void calc_bonuses(struct player *p, struct player_state *state, bool known_only,
107  bool update);
108 void calc_digging_chances(struct player_state *state, int chances[DIGGING_MAX]);
109 int calc_blows(struct player *p, const struct object *obj,
110  struct player_state *state, int extra_blows);
111 
112 void health_track(struct player_upkeep *upkeep, struct monster *mon);
113 void monster_race_track(struct player_upkeep *upkeep,
114  struct monster_race *race);
115 void track_object(struct player_upkeep *upkeep, struct object *obj);
116 void track_object_kind(struct player_upkeep *upkeep, struct object_kind *kind);
117 void track_object_cancel(struct player_upkeep *upkeep);
118 bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj);
119 
120 void notice_stuff(struct player *p);
121 void update_stuff(struct player *p);
122 void redraw_stuff(struct player *p);
123 void handle_stuff(struct player *p);
124 int weight_remaining(struct player *p);
125 
126 #endif /* !PLAYER_CALCS_H */
Monster "race" information, including racial memories.
Definition: monster.h:266
Monster information, for a specific monster.
Definition: monster.h:324
Information about object kinds, including player knowledge.
Definition: object.h:158
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:2199
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:2294
void track_object_cancel(struct player_upkeep *upkeep)
Cancel all object tracking.
Definition: player-calcs.c:2240
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:2208
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:396
bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj)
Is the given item tracked?
Definition: player-calcs.c:2250
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:2404
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:2454
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:2265
Definition: store.h:57
void track_object(struct player_upkeep *upkeep, struct object *obj)
Track the given object.
Definition: player-calcs.c:2220
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:2230
Most of the "player" information goes here.
Definition: player.h:452
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