Crossfire Server, Trunk
player.h
Go to the documentation of this file.
1 
6 #ifndef PLAYER_H
7 #define PLAYER_H
8 
15 typedef enum rangetype {
16  range_bottom = -1,
17  range_none = 0,
18  range_bow = 1,
20  range_misc = 3,
25 } rangetype;
26 
28 typedef enum _bowtype {
29  bow_normal = 0,
32  bow_n = 3,
33  bow_ne = 4,
34  bow_e = 5,
35  bow_se = 6,
36  bow_s = 7,
37  bow_sw = 8,
38  bow_w = 9,
39  bow_nw = 10,
41 } bowtype_t;
42 
44 typedef enum _petmode {
45  pet_normal = 0,
46  pet_sad = 1,
47  pet_defend = 2,
48  pet_arena = 3
49 } petmode_t;
50 
52 typedef enum usekeytype {
54  keyrings = 1,
56 } usekeytype;
57 
62 typedef enum unapplymode {
69 } unapplymode;
70 
74 typedef struct client_spell {
75  object *spell;
76  int16_t last_sp;
77  int16_t last_grace;
78  int16_t last_dam;
79  struct client_spell *next;
80 } client_spell;
81 
85 typedef enum party_rejoin_mode {
90 
92 typedef struct pl {
93  struct pl *next;
96  char maplevel[MAX_BUF];
98  int16_t bed_x, bed_y;
103  object *ranges[range_size];
106  uint32_t golem_count;
109  uint32_t count;
110  uint32_t mode;
112  int16_t digestion;
113  int16_t gen_hp;
114  int16_t gen_sp;
115  int16_t gen_sp_armour;
116  int16_t gen_grace;
117  int16_t item_power;
118  uint8_t state;
120  uint8_t listening;
121  int8_t last_level;
125  /* Try to put all the bitfields together - saves some small amount of memory */
126  uint32_t braced:1;
127  uint32_t tmp_invis:1;
128  uint32_t do_los:1;
129  uint32_t fire_on:1;
130  uint32_t run_on:1;
131  uint32_t has_hit:1;
132  uint32_t name_changed:1;
133  uint32_t peaceful:1;
134  uint32_t hidden:1;
135  uint32_t no_shout:1;
136  uint32_t has_directory:1;
137  const char *invis_race;
143  uint16_t last_flags;
144  int32_t last_weight;
146  uint32_t last_path_attuned;
148  uint32_t last_path_denied;
150  uint16_t last_item_power;
158  float last_speed;
160  int16_t last_golem_hp;
162  object *ob;
169  char title[BIG_NAME];
171  int8_t levhp[11];
172  int8_t levsp[11];
173  int8_t levgrace[11];
175  char killer[BIG_NAME];
178  char password[16];
179  char new_password[16];
181  int16_t encumbrance;
182 #ifdef SAVE_INTERVAL
183  time_t last_save_time;
184 #endif /* SAVE_INTERVAL */
185 #ifdef AUTOSAVE
186  uint32_t last_save_tick;
187 #endif
193  struct obj *last_exit;
197  uint32_t mark_count;
198  object *mark;
199  object *transport;
201  /* Special DM fields */
205  int language;
206  const char *unarmed_skill;
207  uint32_t ticks_played;
212 } player;
213 
219 
220 #define FIND_PLAYER_PARTIAL_NAME 0x1
221 #define FIND_PLAYER_NO_HIDDEN_DM 0x2
224 
225 
230 #define ADD_PLAYER_NEW 0x1
231 #define ADD_PLAYER_NO_MAP 0x2
232 #define ADD_PLAYER_NO_STATS_ROLL 0x4
234 
235 #endif /* PLAYER_H */
party_rejoin_no
@ party_rejoin_no
Definition: player.h:86
MAP_CLIENT_X
#define MAP_CLIENT_X
Definition: config.h:237
pl::delayed_buffers
SockList ** delayed_buffers
Definition: player.h:211
bow_nw
@ bow_nw
Definition: player.h:39
pl::count
uint32_t count
Definition: player.h:109
pl::golem_count
uint32_t golem_count
Definition: player.h:106
pl::transport
object * transport
Definition: player.h:199
pl::spellparam
char spellparam[MAX_BUF]
Definition: player.h:100
range_bow
@ range_bow
Definition: player.h:18
client_spell
Definition: player.h:74
bow_sw
@ bow_sw
Definition: player.h:37
pl::peaceful
uint32_t peaceful
Definition: player.h:133
pl::last_race_stats
living last_race_stats
Definition: player.h:155
socket_struct
Definition: newserver.h:89
client_spell::next
struct client_spell * next
Definition: player.h:79
pl::braced
uint32_t braced
Definition: player.h:126
pl::socket
socket_struct socket
Definition: player.h:94
pl::shoottype
rangetype shoottype
Definition: player.h:99
pl
Definition: player.h:92
pl::blocked_los
int8_t blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
Definition: player.h:163
pl::name_changed
uint32_t name_changed
Definition: player.h:132
client_spell
struct client_spell client_spell
pl::swap_first
int swap_first
Definition: player.h:151
_bowtype
_bowtype
Definition: player.h:28
pl::last_golem_hp
int16_t last_golem_hp
Definition: player.h:160
range_none
@ range_none
Definition: player.h:17
party_rejoin_if_exists
@ party_rejoin_if_exists
Definition: player.h:87
pl::mode
uint32_t mode
Definition: player.h:110
pl::ob
object * ob
Definition: player.h:162
bow_threewide
@ bow_threewide
Definition: player.h:30
client_spell::last_sp
int16_t last_sp
Definition: player.h:76
pl::delayed_buffers_used
uint8_t delayed_buffers_used
Definition: player.h:210
bowtype_t
enum _bowtype bowtype_t
pl::bowtype
bowtype_t bowtype
Definition: player.h:101
unapply_always
@ unapply_always
Definition: player.h:65
NROFATTACKS
#define NROFATTACKS
Definition: attack.h:17
pl::last_resist
int16_t last_resist[NROFATTACKS]
Definition: player.h:159
pl::last_weapon_sp
float last_weapon_sp
Definition: player.h:142
range_golem
@ range_golem
Definition: player.h:21
pl::maplevel
char maplevel[MAX_BUF]
Definition: player.h:96
pl::gen_sp
int16_t gen_sp
Definition: player.h:114
pl::last_speed
float last_speed
Definition: player.h:158
party_rejoin_always
@ party_rejoin_always
Definition: player.h:88
obj
Definition: object.h:275
range_builder
@ range_builder
Definition: player.h:23
pl::levsp
int8_t levsp[11]
Definition: player.h:172
pl::item_power
int16_t item_power
Definition: player.h:117
bow_ne
@ bow_ne
Definition: player.h:33
pl::savebed_map
char savebed_map[MAX_BUF]
Definition: player.h:97
pl::mark
object * mark
Definition: player.h:198
pl::next
struct pl * next
Definition: player.h:93
MAP_CLIENT_Y
#define MAP_CLIENT_Y
Definition: config.h:238
titlestruct
Definition: readable.c:107
bow_n
@ bow_n
Definition: player.h:32
pl::state
uint8_t state
Definition: player.h:118
pl::digestion
int16_t digestion
Definition: player.h:112
client_spell::last_dam
int16_t last_dam
Definition: player.h:78
bow_bestarrow
@ bow_bestarrow
Definition: player.h:40
range_size
@ range_size
Definition: player.h:24
pl::tmp_invis
uint32_t tmp_invis
Definition: player.h:127
pl::unarmed_skill
const char * unarmed_skill
Definition: player.h:206
pl::last_orig_stats
living last_orig_stats
Definition: player.h:154
pet_normal
@ pet_normal
Definition: player.h:45
unapplymode
unapplymode
Definition: player.h:62
pl::petmode
petmode_t petmode
Definition: player.h:102
petmode_t
enum _petmode petmode_t
range_magic
@ range_magic
Definition: player.h:19
pet_defend
@ pet_defend
Definition: player.h:47
pl::party_to_join
partylist * party_to_join
Definition: player.h:189
bow_se
@ bow_se
Definition: player.h:35
pl::last_path_attuned
uint32_t last_path_attuned
Definition: player.h:146
client_spell::spell
object * spell
Definition: player.h:75
pl::last_character_flags
uint32_t last_character_flags
Definition: player.h:149
client_spell::last_grace
int16_t last_grace
Definition: player.h:77
pl::no_shout
uint32_t no_shout
Definition: player.h:135
pl::levgrace
int8_t levgrace[11]
Definition: player.h:173
MAX_NAME
#define MAX_NAME
Definition: define.h:41
pl::last_character_load
float last_character_load
Definition: player.h:123
pl::has_hit
uint32_t has_hit
Definition: player.h:131
player
struct pl player
range_bottom
@ range_bottom
Definition: player.h:16
sstring
const typedef char * sstring
Definition: global.h:40
pl::run_on
uint32_t run_on
Definition: player.h:130
pl::gen_hp
int16_t gen_hp
Definition: player.h:113
rangetype
rangetype
Definition: player.h:15
pl::followed_player
sstring followed_player
Definition: player.h:203
tag_t
uint32_t tag_t
Definition: object.h:12
MAX_SKILLS
#define MAX_SKILLS
Definition: skills.h:70
pl::last_golem_maxhp
int16_t last_golem_maxhp
Definition: player.h:161
pl::last_path_denied
uint32_t last_path_denied
Definition: player.h:148
pl::unapply
unapplymode unapply
Definition: player.h:108
liv
Definition: living.h:35
pl::bed_x
int16_t bed_x
Definition: player.h:98
pl::last_tell
char last_tell[MAX_NAME]
Definition: player.h:176
party_struct
Definition: party.h:10
key_inventory
@ key_inventory
Definition: player.h:53
pl::listening
uint8_t listening
Definition: player.h:120
MAX_BUF
#define MAX_BUF
Definition: define.h:35
pl::search_str
char search_str[MAX_BUF]
Definition: player.h:196
pl::levhp
int8_t levhp[11]
Definition: player.h:171
pl::last_weight
int32_t last_weight
Definition: player.h:144
bow_normal
@ bow_normal
Definition: player.h:29
pl::spell_state
client_spell * spell_state
Definition: player.h:200
pl::gen_grace
int16_t gen_grace
Definition: player.h:116
range_misc
@ range_misc
Definition: player.h:20
pl::bed_y
int16_t bed_y
Definition: player.h:98
pl::last_applied_stats
living last_applied_stats
Definition: player.h:157
bow_spreadshot
@ bow_spreadshot
Definition: player.h:31
pl::language
int language
Definition: player.h:205
pl::gen_sp_armour
int16_t gen_sp_armour
Definition: player.h:115
pl::encumbrance
int16_t encumbrance
Definition: player.h:181
unapply_nochoice
@ unapply_nochoice
Definition: player.h:63
pl::fire_on
uint32_t fire_on
Definition: player.h:129
pl::password
char password[16]
Definition: player.h:178
pl::last_skill_exp
int64_t last_skill_exp[MAX_SKILLS]
Definition: player.h:140
pl::delayed_buffers_allocated
uint8_t delayed_buffers_allocated
Definition: player.h:209
pl::has_directory
uint32_t has_directory
Definition: player.h:136
pet_sad
@ pet_sad
Definition: player.h:46
pl::do_los
uint32_t do_los
Definition: player.h:128
pl::last_weight_limit
int32_t last_weight_limit
Definition: player.h:145
pl::last_skill_ob
object * last_skill_ob[MAX_SKILLS]
Definition: player.h:139
pet_arena
@ pet_arena
Definition: player.h:48
_petmode
_petmode
Definition: player.h:44
pl::killer
char killer[BIG_NAME]
Definition: player.h:175
bow_w
@ bow_w
Definition: player.h:38
pl::rejoin_party
party_rejoin_mode rejoin_party
Definition: player.h:195
pl::stack_position
int stack_position
Definition: player.h:204
pl::new_password
char new_password[16]
Definition: player.h:179
pl::hidden
uint32_t hidden
Definition: player.h:134
pl::last_stats
living last_stats
Definition: player.h:153
pl::invis_race
const char * invis_race
Definition: player.h:137
bow_e
@ bow_e
Definition: player.h:34
pl::own_title
char own_title[MAX_NAME]
Definition: player.h:167
pl::ranges
object * ranges[range_size]
Definition: player.h:103
containers
@ containers
Definition: player.h:55
keyrings
@ keyrings
Definition: player.h:54
pl::mark_count
uint32_t mark_count
Definition: player.h:197
pl::ticks_played
uint32_t ticks_played
Definition: player.h:207
pl::last_exit
struct obj * last_exit
Definition: player.h:193
unapply_never
@ unapply_never
Definition: player.h:64
range_skill
@ range_skill
Definition: player.h:22
pl::stack_items
tag_t * stack_items
Definition: player.h:202
BIG_NAME
#define BIG_NAME
Definition: define.h:42
pl::character_load
float character_load
Definition: player.h:122
pl::party
partylist * party
Definition: player.h:188
pl::usekeys
usekeytype usekeys
Definition: player.h:107
bow_s
@ bow_s
Definition: player.h:36
party_rejoin_mode
party_rejoin_mode
Definition: player.h:85
SockList
Definition: newclient.h:681
pl::applied_stats
living applied_stats
Definition: player.h:156
pl::last_level
int8_t last_level
Definition: player.h:121
usekeytype
usekeytype
Definition: player.h:52
pl::last_flags
uint16_t last_flags
Definition: player.h:143
pl::orig_stats
living orig_stats
Definition: player.h:152
pl::last_item_power
uint16_t last_item_power
Definition: player.h:150
pl::last_path_repelled
uint32_t last_path_repelled
Definition: player.h:147