Angband
player-timed.h
Go to the documentation of this file.
1 
20 #ifndef PLAYER_TIMED_H
21 #define PLAYER_TIMED_H
22 
23 #include "player.h"
24 
28 #define PY_FOOD_MAX 17000 /* Food value (Bloated) */
29 #define PY_FOOD_FULL 10000 /* Food value (Normal) */
30 #define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
31 #define PY_FOOD_WEAK 1000 /* Food value (Weak) */
32 #define PY_FOOD_FAINT 500 /* Food value (Fainting) */
33 #define PY_FOOD_STARVE 100 /* Food value (Starving) */
34 
38 #define TMD_CUT_NONE 0
39 #define TMD_CUT_GRAZE 10
40 #define TMD_CUT_LIGHT 25
41 #define TMD_CUT_BAD 50
42 #define TMD_CUT_NASTY 100
43 #define TMD_CUT_SEVERE 200
44 #define TMD_CUT_DEEP 1000
45 
49 enum
50 {
51  #define TMD(a, b, c) TMD_##a,
52  #include "list-player-timed.h"
53  #undef TMD
54  TMD_MAX
55 };
56 
60 enum {
64 };
65 
70  const char *name;
73 
74  int index;
75  char *desc;
76  char *on_begin;
77  char *on_end;
78  char *on_increase;
79  char *on_decrease;
80  int msgt;
81  int fail_code;
82  int fail;
83 };
84 
85 extern struct file_parser player_timed_parser;
87 
88 int timed_name_to_idx(const char *name);
89 bool player_set_timed(struct player *p, int idx, int v, bool notify);
90 bool player_inc_check(struct player *p, int idx, bool lore);
91 bool player_inc_timed(struct player *p, int idx, int v, bool notify,
92  bool check);
93 bool player_dec_timed(struct player *p, int idx, int v, bool notify);
94 bool player_clear_timed(struct player *p, int idx, bool notify);
95 bool player_set_food(struct player *p, int v);
96 
97 #endif /* !PLAYER_TIMED_H */
bool player_clear_timed(struct player *p, int idx, bool notify)
Clear the timed effect idx.
Definition: player-timed.c:266
const char * name
Definition: player-timed.h:70
int fail
Definition: player-timed.h:82
int timed_name_to_idx(const char *name)
Definition: player-timed.c:44
bool player_set_food(struct player *p, int v)
Set "player->food", notice observable changes.
Definition: player-timed.c:532
Definition: player-timed.h:62
uint32_t u32b
Definition: h-basic.h:172
char * on_decrease
Definition: player-timed.h:79
char * desc
Definition: player-timed.h:75
Definition: player-timed.h:98
struct timed_effect_data timed_effects[TMD_MAX]
Definition: player-timed.c:38
Data struct.
Definition: player-timed.h:69
Player implementation.
char * on_increase
Definition: player-timed.h:78
timed player properties
char * on_end
Definition: player-timed.h:77
bool player_dec_timed(struct player *p, int idx, int v, bool notify)
Decrease the timed effect idx by v.
Definition: player-timed.c:252
bool player_inc_timed(struct player *p, int idx, int v, bool notify, bool check)
Increase the timed effect idx by v.
Definition: player-timed.c:229
struct file_parser player_timed_parser
Definition: player-timed.c:786
int fail_code
Definition: player-timed.h:81
const char ** p[]
Definition: name.c:40
bool player_set_timed(struct player *p, int idx, int v, bool notify)
Set a timed effect.
Definition: player-timed.c:80
int msgt
Definition: player-timed.h:80
Definition: player-timed.h:63
Definition: datafile.h:25
bool player_inc_check(struct player *p, int idx, bool lore)
Check whether a timed effect will affect the player.
Definition: player-timed.c:161
char * on_begin
Definition: player-timed.h:76
int index
Definition: player-timed.h:74
u32b flag_redraw
Definition: player-timed.h:71
Definition: player-timed.h:61
Intialize random names
Definition: init.c:664
Most of the "player" information goes here.
Definition: player.h:450
u32b flag_update
Definition: player-timed.h:72