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 #define PR_LIGHT 0x02000000L /* Display light level */
77 
81 #define PR_BASIC \
82  (PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
83  PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
84  PR_MANA | PR_DEPTH | PR_HEALTH | PR_SPEED)
85 
89 #define PR_EXTRA \
90  (PR_STATUS | PR_STATE | PR_STUDY)
91 
95 #define PR_SUBWINDOW \
96  (PR_MONSTER | PR_OBJECT | PR_MONLIST | PR_ITEMLIST)
97 
98 
99 extern const int adj_dex_th[STAT_RANGE];
100 extern const int adj_str_td[STAT_RANGE];
101 extern const int adj_str_blow[STAT_RANGE];
102 extern const int adj_dex_safe[STAT_RANGE];
103 extern const int adj_con_fix[STAT_RANGE];
104 extern const int adj_str_hold[STAT_RANGE];
105 
106 bool earlier_object(struct object *orig, struct object *new, bool store);
107 int equipped_item_slot(struct player_body body, struct object *obj);
108 void calc_inventory(struct player_upkeep *upkeep, struct object *gear,
109  struct player_body body);
110 void calc_bonuses(struct player *p, struct player_state *state, bool known_only,
111  bool update);
112 void calc_digging_chances(struct player_state *state, int chances[DIGGING_MAX]);
113 int calc_blows(struct player *p, const struct object *obj,
114  struct player_state *state, int extra_blows);
115 
116 void health_track(struct player_upkeep *upkeep, struct monster *mon);
117 void monster_race_track(struct player_upkeep *upkeep,
118  struct monster_race *race);
119 void track_object(struct player_upkeep *upkeep, struct object *obj);
120 void track_object_kind(struct player_upkeep *upkeep, struct object_kind *kind);
121 void track_object_cancel(struct player_upkeep *upkeep);
122 bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj);
123 
124 void notice_stuff(struct player *p);
125 void update_stuff(struct player *p);
126 void redraw_stuff(struct player *p);
127 void handle_stuff(struct player *p);
128 int weight_remaining(struct player *p);
129 
130 #endif /* !PLAYER_CALCS_H */
Monster "race" information, including racial memories.
Definition: monster.h:307
Monster information, for a specific monster.
Definition: monster.h:369
Information about object kinds, including player knowledge.
Definition: object.h:165
int weight_remaining(struct player *p)
Computes weight remaining before burdened.
Definition: player-calcs.c:1664
void health_track(struct player_upkeep *upkeep, struct monster *mon)
Monster and object tracking functions
Definition: player-calcs.c:2371
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:2466
void track_object_cancel(struct player_upkeep *upkeep)
Cancel all object tracking.
Definition: player-calcs.c:2412
Player implementation.
All the variable state that changes when you put on/take off equipment.
Definition: player.h:385
const int adj_dex_th[STAT_RANGE]
Stat Table (DEX) – bonus to hit.
Definition: player-calcs.c:317
#define STAT_RANGE
The range of possible indexes into tables based upon stats.
Definition: player.h:74
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:1767
void monster_race_track(struct player_upkeep *upkeep, struct monster_race *race)
Track the given monster race.
Definition: player-calcs.c:2380
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:430
bool tracked_object_is(struct player_upkeep *upkeep, struct object *obj)
Is the given item tracked?
Definition: player-calcs.c:2422
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:2579
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:1585
void handle_stuff(struct player *p)
Handle "player->upkeep->update" and "player->upkeep->redraw".
Definition: player-calcs.c:2629
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:2437
Definition: store.h:57
void track_object(struct player_upkeep *upkeep, struct object *obj)
Track the given object.
Definition: player-calcs.c:2392
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:2402
Most of the "player" information goes here.
Definition: player.h:489
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:1611
const int adj_str_td[STAT_RANGE]
Stat Table (STR) – bonus to dam.
Definition: player-calcs.c:271
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:158
int equipped_item_slot(struct player_body body, struct object *obj)
Definition: player-calcs.c:997
Definition: player.h:109