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 
67 struct timed_grade {
68  int grade;
70  int max;
71  char *name;
72  char *msg;
73  struct timed_grade *next;
74 };
75 
80  const char *name;
83 
84  int index;
85  char *desc;
86  char *on_end;
87  char *on_increase;
88  char *on_decrease;
89  int msgt;
90  int fail_code;
91  int fail;
92  struct timed_grade *grade;
93 };
94 
95 extern struct file_parser player_timed_parser;
97 
98 int timed_name_to_idx(const char *name);
99 bool player_set_timed(struct player *p, int idx, int v, bool notify);
100 bool player_inc_check(struct player *p, int idx, bool lore);
101 bool player_inc_timed(struct player *p, int idx, int v, bool notify,
102  bool check);
103 bool player_dec_timed(struct player *p, int idx, int v, bool notify);
104 bool player_clear_timed(struct player *p, int idx, bool notify);
105 bool player_set_food(struct player *p, int v);
106 
107 #endif /* !PLAYER_TIMED_H */
bool player_clear_timed(struct player *p, int idx, bool notify)
Clear the timed effect idx.
Definition: player-timed.c:614
const char * name
Definition: player-timed.h:80
int fail
Definition: player-timed.h:91
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:323
Definition: player-timed.h:62
uint32_t u32b
Definition: h-basic.h:172
char * on_decrease
Definition: player-timed.h:88
char * desc
Definition: player-timed.h:85
int grade
Definition: player-timed.h:68
Definition: player-timed.h:115
int max
Definition: player-timed.h:70
uint8_t byte
Definition: h-basic.h:167
struct timed_effect_data timed_effects[TMD_MAX]
Definition: player-timed.c:44
Data struct.
Definition: player-timed.h:79
Player implementation.
char * on_increase
Definition: player-timed.h:87
timed player properties
char * on_end
Definition: player-timed.h:86
bool player_dec_timed(struct player *p, int idx, int v, bool notify)
Decrease the timed effect idx by v.
Definition: player-timed.c:597
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:574
struct file_parser player_timed_parser
Definition: player-timed.c:274
struct timed_grade * next
Definition: player-timed.h:73
int fail_code
Definition: player-timed.h:90
char * msg
Definition: player-timed.h:72
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:409
int msgt
Definition: player-timed.h:89
Definition: player-timed.h:63
char * name
Definition: player-timed.h:71
Definition: datafile.h:25
struct timed_grade * grade
Definition: player-timed.h:92
Definition: player-timed.h:67
bool player_inc_check(struct player *p, int idx, bool lore)
Check whether a timed effect will affect the player.
Definition: player-timed.c:501
Definition: player-timed.h:64
int index
Definition: player-timed.h:84
u32b flag_redraw
Definition: player-timed.h:81
Definition: player-timed.h:61
Intialize random names
Definition: init.c:838
Most of the "player" information goes here.
Definition: player.h:490
u32b flag_update
Definition: player-timed.h:82
byte color
Definition: player-timed.h:69