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_DTRAP 0x00004000L /* Trap detection indicator */
66 #define PR_STATE 0x00008000L /* Display Extra (State) */
67 #define PR_MAP 0x00010000L /* Redraw whole map */
68 #define PR_INVEN 0x00020000L /* Display inven/equip */
69 #define PR_EQUIP 0x00040000L /* Display equip/inven */
70 #define PR_MESSAGE 0x00080000L /* Display messages */
71 #define PR_MONSTER 0x00100000L /* Display monster recall */
72 #define PR_OBJECT 0x00200000L /* Display object recall */
73 #define PR_MONLIST 0x00400000L /* Display monster list */
74 #define PR_ITEMLIST 0x00800000L /* Display item list */
75 #define PR_FEELING 0x01000000L /* Display level feeling */
76 
80 #define PR_BASIC \
81  (PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
82  PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
83  PR_MANA | PR_DEPTH | PR_HEALTH | PR_SPEED)
84 
88 #define PR_EXTRA \
89  (PR_STATUS | PR_STATE | PR_STUDY)
90 
94 #define PR_SUBWINDOW \
95  (PR_MONSTER | PR_OBJECT | PR_MONLIST | PR_ITEMLIST)
96 
97 
98 extern const int adj_str_blow[STAT_RANGE];
99 extern const int adj_dex_safe[STAT_RANGE];
100 extern const int adj_con_fix[STAT_RANGE];
101 extern const int adj_str_hold[STAT_RANGE];
102 
103 bool earlier_object(struct object *orig, struct object *new, bool store);
104 int equipped_item_slot(struct player_body body, struct object *obj);
105 void calc_inventory(struct player_upkeep *upkeep, struct object *gear,
106  struct player_body body);
107 void calc_bonuses(struct player *p, struct player_state *state, bool known_only,
108  bool update);
109 void calc_digging_chances(struct player_state *state, int chances[DIGGING_MAX]);
110 int calc_blows(struct player *p, const struct object *obj,
111  struct player_state *state, int extra_blows);
112 
113 void health_track(struct player_upkeep *upkeep, struct monster *mon);
114 void monster_race_track(struct player_upkeep *upkeep,
115  struct monster_race *race);
116 void track_object(struct player_upkeep *upkeep, struct object *obj);
117 void track_object_kind(struct player_upkeep *upkeep, struct object_kind *kind);
118 void track_object_cancel(struct player_upkeep *upkeep);
119 bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj);
120 
121 void notice_stuff(struct player *p);
122 void update_stuff(struct player *p);
123 void redraw_stuff(struct player *p);
124 void handle_stuff(struct player *p);
125 int weight_remaining(struct player *p);
126 
127 #endif /* !PLAYER_CALCS_H */
Monster "race" information, including racial memories.
Definition: monster.h:265
Monster information, for a specific monster.
Definition: monster.h:323
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:2212
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:2307
void track_object_cancel(struct player_upkeep *upkeep)
Cancel all object tracking.
Definition: player-calcs.c:2253
Player implementation.
All the variable state that changes when you put on/take off equipment.
Definition: player.h:351
Definition: player.h:111
#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:2221
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:393
bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj)
Is the given item tracked?
Definition: player-calcs.c:2263
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:2418
Use the roguelike command false Show damage player deals to false Always pickup false Show flavors in object false Highlight player with cursor between false Show walls as solid false false Center map false Automatically clear more false Allow mouse clicks to move the true Show effective speed as false false false false false Generate connected true Word of Recall has no false Stack objects on the true Show level true Start with a kit of useful gear
Definition: list-options.h:90
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:2468
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:2278
Definition: store.h:57
void track_object(struct player_upkeep *upkeep, struct object *obj)
Track the given object.
Definition: player-calcs.c:2233
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:2243
Most of the "player" information goes here.
Definition: player.h:450
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