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 enum
29 {
30  #define TMD(a, b, c) TMD_##a,
31  #include "list-player-timed.h"
32  #undef TMD
33  TMD_MAX
34 };
35 
39 enum {
44 };
45 
46 struct timed_grade {
47  int grade;
49  int max;
50  char *name;
51  char *up_msg;
52  char *down_msg;
53  struct timed_grade *next;
54 };
55 
60  const char *name;
63 
64  int index;
65  char *desc;
66  char *on_end;
67  char *on_increase;
68  char *on_decrease;
69  int msgt;
70  int fail_code;
71  int fail;
72  struct timed_grade *grade;
73 };
74 
78 extern int PY_FOOD_MAX; /* Food value (Bloated) */
79 extern int PY_FOOD_FULL; /* Food value (Normal) */
80 extern int PY_FOOD_HUNGRY; /* Food value (Hungry) */
81 extern int PY_FOOD_WEAK; /* Food value (Weak) */
82 extern int PY_FOOD_FAINT; /* Food value (Fainting) */
83 extern int PY_FOOD_STARVE; /* Food value (Starving) */
84 
85 extern struct file_parser player_timed_parser;
87 
88 int timed_name_to_idx(const char *name);
89 bool player_timed_grade_eq(struct player *p, int idx, char *match);
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 
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:585
const char * name
Definition: player-timed.h:60
int fail
Definition: player-timed.h:71
int timed_name_to_idx(const char *name)
Definition: player-timed.c:57
uint32_t u32b
Definition: h-basic.h:172
char * on_decrease
Definition: player-timed.h:68
char * desc
Definition: player-timed.h:65
int grade
Definition: player-timed.h:47
int max
Definition: player-timed.h:49
uint8_t byte
Definition: h-basic.h:167
struct timed_effect_data timed_effects[TMD_MAX]
Definition: player-timed.c:51
Data struct.
Definition: player-timed.h:59
int PY_FOOD_MAX
Player food values.
Definition: player-timed.c:32
Definition: player-timed.h:42
Player implementation.
char * on_increase
Definition: player-timed.h:67
timed player properties
bool player_timed_grade_eq(struct player *p, int idx, char *match)
Return true if the player timed effect matches the given string.
Definition: player-timed.c:355
char * on_end
Definition: player-timed.h:66
bool player_dec_timed(struct player *p, int idx, int v, bool notify)
Decrease the timed effect idx by v.
Definition: player-timed.c:568
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:545
int PY_FOOD_STARVE
Definition: player-timed.c:37
char * up_msg
Definition: player-timed.h:51
struct file_parser player_timed_parser
Definition: player-timed.c:317
struct timed_grade * next
Definition: player-timed.h:53
int PY_FOOD_HUNGRY
Definition: player-timed.c:34
int fail_code
Definition: player-timed.h:70
Definition: player-timed.h:96
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:376
int msgt
Definition: player-timed.h:69
char * name
Definition: player-timed.h:50
Definition: datafile.h:25
struct timed_grade * grade
Definition: player-timed.h:72
Definition: player-timed.h:46
int PY_FOOD_FULL
Definition: player-timed.c:33
Definition: player-timed.h:43
bool player_inc_check(struct player *p, int idx, bool lore)
Check whether a timed effect will affect the player.
Definition: player-timed.c:472
Definition: player-timed.h:41
int PY_FOOD_FAINT
Definition: player-timed.c:36
int index
Definition: player-timed.h:64
int PY_FOOD_WEAK
Definition: player-timed.c:35
u32b flag_redraw
Definition: player-timed.h:61
char * down_msg
Definition: player-timed.h:52
Intialize random names
Definition: init.c:843
Definition: player-timed.h:40
Most of the "player" information goes here.
Definition: player.h:489
u32b flag_update
Definition: player-timed.h:62
byte color
Definition: player-timed.h:48