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 {
65 };
66 
71  const char *name;
74 
75  int index;
76  char *desc;
77  char *on_begin;
78  char *on_end;
79  char *on_increase;
80  char *on_decrease;
81  int msgt;
82  int fail_code;
83  int fail;
84 };
85 
86 extern struct file_parser player_timed_parser;
88 
89 int timed_name_to_idx(const char *name);
90 bool player_set_timed(struct player *p, int idx, int v, bool notify);
91 bool player_inc_check(struct player *p, int idx, bool lore);
92 bool player_inc_timed(struct player *p, int idx, int v, bool notify,
93  bool check);
94 bool player_dec_timed(struct player *p, int idx, int v, bool notify);
95 bool player_clear_timed(struct player *p, int idx, bool notify);
96 bool player_set_food(struct player *p, int v);
97 
98 #endif /* !PLAYER_TIMED_H */
bool player_clear_timed(struct player *p, int idx, bool notify)
Clear the timed effect idx.
Definition: player-timed.c:812
const char * name
Definition: player-timed.h:71
int fail
Definition: player-timed.h:83
int timed_name_to_idx(const char *name)
Definition: player-timed.c:50
bool player_set_food(struct player *p, int v)
Set "player->food", notice observable changes.
Definition: player-timed.c:531
Definition: player-timed.h:62
uint32_t u32b
Definition: h-basic.h:172
char * on_decrease
Definition: player-timed.h:80
char * desc
Definition: player-timed.h:76
Definition: player-timed.h:110
struct timed_effect_data timed_effects[TMD_MAX]
Definition: player-timed.c:44
Data struct.
Definition: player-timed.h:70
Player implementation.
char * on_increase
Definition: player-timed.h:79
timed player properties
char * on_end
Definition: player-timed.h:78
bool player_dec_timed(struct player *p, int idx, int v, bool notify)
Decrease the timed effect idx by v.
Definition: player-timed.c:798
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:775
struct file_parser player_timed_parser
Definition: player-timed.c:238
int fail_code
Definition: player-timed.h:82
const char ** p[]
Definition: name.c:40
bool player_set_timed(struct player *p, int idx, int v, bool notify)
Setting, increasing, decreasing and clearing timed effects
Definition: player-timed.c:617
int msgt
Definition: player-timed.h:81
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:702
Definition: player-timed.h:64
char * on_begin
Definition: player-timed.h:77
int index
Definition: player-timed.h:75
u32b flag_redraw
Definition: player-timed.h:72
Definition: player-timed.h:61
Intialize random names
Definition: init.c:837
Most of the "player" information goes here.
Definition: player.h:487
u32b flag_update
Definition: player-timed.h:73