Crossfire Server, Trunk  R20513
Go to the documentation of this file.
6 #ifndef PLAYER_H
7 #define PLAYER_H
15 typedef enum rangetype {
16  range_bottom = -1,
17  range_none = 0,
18  range_bow = 1,
20  range_misc = 3,
25 } rangetype;
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;
44 typedef enum _petmode {
45  pet_normal = 0,
46  pet_sad = 1,
47  pet_defend = 2,
48  pet_arena = 3
49 } petmode_t;
52 typedef enum usekeytype {
54  keyrings = 1,
56 } usekeytype;
62 typedef enum unapplymode {
69 } unapplymode;
74 typedef struct client_spell {
75  object *spell;
79  struct client_spell *next;
80 } client_spell;
85 typedef enum party_rejoin_mode {
92 typedef struct pl {
93  struct pl *next;
96  char maplevel[MAX_BUF];
103  object *ranges[range_size];
123  /* Try to put all the bitfields together - saves some small amount of memory */
135  const char *invis_race;
154  float last_speed;
158  object *ob;
165  char title[BIG_NAME];
167  int8_t levhp[11];
168  int8_t levsp[11];
171  char killer[BIG_NAME];
176  char password[16];
177  char new_password[16];
180 #ifdef SAVE_INTERVAL
181  time_t last_save_time;
182 #endif /* SAVE_INTERVAL */
183 #ifdef AUTOSAVE
184  uint32_t last_save_tick;
185 #endif
194  object *mark;
195  object *transport;
197  /* Special DM fields */
201  int language;
202  const char *unarmed_skill;
204 } player;
213 #define FIND_PLAYER_NO_HIDDEN_DM 0x2
222 #define ADD_PLAYER_NEW 0x1
223 #define ADD_PLAYER_NO_MAP 0x2
224 #define ADD_PLAYER_NO_STATS_ROLL 0x4
227 #endif /* PLAYER_H */
Use skill.
Definition: player.h:22
Will unapply whatever is necessary - this goes beyond no choice - if there are multiple ojbect of the...
Definition: player.h:65
int16_t last_golem_maxhp
Last golem max hp value sent to the client.
Definition: player.h:157
Bow firing mode.
Definition: player.h:28
One player.
Definition: player.h:92
Use keys in inventory and active containers.
Definition: player.h:55
int16_t last_sp
Last spell cost.
Definition: player.h:76
int swap_first
First stat player has selected to swap.
Definition: player.h:147
int16_t gen_hp
Bonuses to regeneration speed of hp.
Definition: player.h:113
Fire north-west whatever the facing direction.
Definition: player.h:39
char input_buf[MAX_BUF]
Holds command to run.
Definition: player.h:175
Attack other players in arena.
Definition: player.h:48
living last_race_stats
Last race stats sent to the client.
Definition: player.h:151
int16_t last_dam
Last damage.
Definition: player.h:78
int16_t bed_x
Definition: player.h:98
uint32_t run_on
Player should keep moving in dir until run is off.
Definition: player.h:128
Fire three arrows in the same direction.
Definition: player.h:30
uint32_t braced
Will not move if braced, only attack.
Definition: player.h:124
unsigned char uint8_t
Definition: win32.h:161
char spellparam[MAX_BUF]
What param to add to spells.
Definition: player.h:100
uint32_t name_changed
If true, the player has set a name.
Definition: player.h:130
int16_t last_resist[NROFATTACKS]
last resist values sent to client.
Definition: player.h:155
One party.
Definition: party.h:10
Information on one title.
Definition: readable.c:106
uint32_t has_directory
If 0, the player was not yet saved, its directory doesn't exist.
Definition: player.h:134
No range selected.
Definition: player.h:17
object * spell
Spell object this structure is about.
Definition: player.h:75
int16_t gen_grace
Bonuses to regeneration speed of grace.
Definition: player.h:116
#define BIG_NAME
Definition: define.h:42
This is used to control what to do when we need to unapply an object before we can apply another one...
Definition: player.h:62
struct pl player
One player.
Socket structure, represents a client-server connection.
Definition: newserver.h:99
char new_password[16]
2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16
Definition: player.h:177
int8_t levsp[11]
What sp bonus the player gained on that level.
Definition: player.h:168
socket_struct socket
Socket information for this player.
Definition: player.h:94
rangetype shoottype
Which range-attack is being used by player.
Definition: player.h:99
object * ranges[range_size]
Object for each range.
Definition: player.h:103
uint32_t mark_count
Count of marked object.
Definition: player.h:193
int16_t last_golem_hp
Last golem hp value sent to the client.
Definition: player.h:156
int language
The language the player wishes to use.
Definition: player.h:201
Misc items.
Definition: player.h:20
This stores, for a spell a player knows, the last sp/gr/dam information sent to client.
Definition: player.h:74
Various statistics of objects.
Definition: living.h:34
Use keys in inventory and active key rings.
Definition: player.h:54
Try to find an arrow matching the target.
Definition: player.h:40
uint32_t hidden
If True, player (DM) is hidden from view.
Definition: player.h:132
Will not unapply objects automatically.
Definition: player.h:64
char savebed_map[MAX_BUF]
Map where player will respawn after death.
Definition: player.h:97
Minimum, exclusive, value.
Definition: player.h:16
int stack_position
Current stack position, 0 for no item.
Definition: player.h:200
partylist * party
Party this player is part of.
Definition: player.h:186
Fire north whatever the facing direction.
Definition: player.h:32
uint32_t no_shout
if True, player is *not *able to use shout command.
Definition: player.h:133
uint32_t ticks_played
How many ticks this player has played.
Definition: player.h:203
Fire east whatever the facing direction.
Definition: player.h:34
Whether to rejoin party at login or not.
Definition: player.h:85
Fire three arrows in a cone.
Definition: player.h:31
living applied_stats
Stat changes due to gear or skills.
Definition: player.h:152
Definition: player.h:44
Fire south whatever the facing direction.
Definition: player.h:36
How to use keys.
Definition: player.h:52
unapplymode unapply
Method for auto unapply.
Definition: player.h:108
int16_t gen_sp
Bonuses to regeneration speed of sp.
Definition: player.h:114
If party doesn't exist, form it.
Definition: player.h:88
int8_t last_level
Last level we sent to client.
Definition: player.h:121
signed short int16_t
Definition: win32.h:160
enum _petmode petmode_t
uint16_t last_flags
Fire/run on flags for last tick.
Definition: player.h:141
uint32_t tmp_invis
Will invis go away when we attack?
Definition: player.h:125
char search_str[MAX_BUF]
Item we are looking for.
Definition: player.h:192
tag_t * stack_items
Item stack for patch/dump/...
Definition: player.h:198
Map builder.
Definition: player.h:23
Fire north-east whatever the facing direction.
Definition: player.h:33
object * transport
Transport the player is in.
Definition: player.h:195
Standard mode, one random arrow.
Definition: player.h:29
Control golem.
Definition: player.h:21
Rejoin if party exists.
Definition: player.h:87
int16_t bed_y
x,y - coordinates of respawn (savebed).
Definition: player.h:98
living orig_stats
Permanent real stats of player.
Definition: player.h:148
Fire south-west whatever the facing direction.
Definition: player.h:37
living last_applied_stats
Last applied stats sent to the client.
Definition: player.h:153
uint8_t state
Input state of the player (name, password, etc).
Definition: player.h:118
char last_tell[MAX_NAME]
last player that told you something [mids 01/14/2002].
Definition: player.h:172
int16_t last_grace
Last grace cost.
Definition: player.h:77
uint8_t listening
Which priority will be used in info_all.
Definition: player.h:120
uint32_t has_hit
If set, weapon_sp instead of speed will count.
Definition: player.h:129
Don't rejoin.
Definition: player.h:86
int32_t last_weight_limit
Last weight limit transmitted to client.
Definition: player.h:143
int8_t blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
Array showing what spaces the player can see.
Definition: player.h:159
uint32_t tag_t
Object tag, unique during the whole game.
Definition: object.h:12
party_rejoin_mode rejoin_party
Whether to rejoin or not party at login.
Definition: player.h:191
uint32_t golem_count
To track the golem.
Definition: player.h:106
#define MAX_BUF
Used for all kinds of things.
Definition: define.h:35
Standard mode/.
Definition: player.h:45
uint32_t peaceful
If set, won't attack friendly creatures.
Definition: player.h:131
enum _bowtype bowtype_t
Bow firing mode.
char own_title[MAX_NAME]
Title the player has chosen for themself.
Definition: player.h:163
int16_t encumbrance
How much our player is encumbered.
Definition: player.h:179
int8_t levhp[11]
What hp bonus the player gained on that level.
Definition: player.h:167
#define MAP_CLIENT_X
This determines the maximum map size the client can request (and thus what the server will send to th...
Definition: config.h:236
struct client_spell client_spell
This stores, for a spell a player knows, the last sp/gr/dam information sent to client.
#define NUM_SKILLS
This is the highest number skill in the table +1 This is used to store pointers to the actual skills ...
Definition: skills.h:71
unsigned short uint16_t
Definition: win32.h:163
signed __int64 int64_t
Definition: win32.h:168
client_spell * spell_state
Spell information sent to client.
Definition: player.h:196
object * ob
The object representing the player.
Definition: player.h:158
const char * sstring
Strings that should be manipulated through add_string() and free_string().
Definition: global.h:40
unsigned int uint32_t
Definition: win32.h:162
struct client_spell * next
Next spell information.
Definition: player.h:79
bowtype_t bowtype
Which firemode?
Definition: player.h:101
char killer[BIG_NAME]
Who killed this player.
Definition: player.h:171
Maximum, exclusive, value.
Definition: player.h:24
#define MAP_CLIENT_Y
Definition: config.h:237
Fire south-east whatever the facing direction.
Definition: player.h:35
float last_speed
Last speed as sent to client.
Definition: player.h:154
living last_stats
Last stats as sent to client.
Definition: player.h:149
const char * invis_race
What race invisible to?
Definition: player.h:135
signed char int8_t
Type definitions for fixed-size integer types.
Definition: win32.h:158
uint32_t fire_on
Player should fire object, not move.
Definition: player.h:127
char password[16]
2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16
Definition: player.h:176
int32_t last_weight
Last weight as sent to client; -1 means do not send weight.
Definition: player.h:142
float last_weapon_sp
if diff than weapon_sp, update client.
Definition: player.h:140
uint32_t do_los
If true, need to call update_los() in draw(), and clear.
Definition: player.h:126
uint32_t mode
Mode of player for pickup.
Definition: player.h:110
What range is currently selected by the player.
Definition: player.h:15
Definition: attack.h:17
signed int int32_t
Definition: win32.h:159
int64_t last_skill_exp[NUM_SKILLS]
Last exp sent to client.
Definition: player.h:138
Fire west whatever the facing direction.
Definition: player.h:38
Definition: player.h:18
int16_t gen_sp_armour
Penalty to sp regen from armour.
Definition: player.h:115
struct pl * next
Pointer to next player, NULL if this is last.
Definition: player.h:93
Will unapply objects when there no choice to unapply.
Definition: player.h:63
petmode_t petmode
Which petmode?
Definition: player.h:102
uint32_t last_path_repelled
Last spell repelled sent to client.
Definition: player.h:145
char maplevel[MAX_BUF]
On which level is the player?
Definition: player.h:96
Definition: player.h:19
usekeytype usekeys
Method for finding keys for doors.
Definition: player.h:107
Try to find enemies.
Definition: player.h:46
int16_t item_power
Total item power of objects equipped.
Definition: player.h:117
object * mark
Marked object.
Definition: player.h:194
Stay close to the owner.
Definition: player.h:47
#define MAX_NAME
Definition: define.h:41
object * last_skill_ob[NUM_SKILLS]
Exp objects sent to client.
Definition: player.h:137
uint32_t last_path_attuned
Last spell attunment sent to client.
Definition: player.h:144
Only use keys in inventory.
Definition: player.h:53
char write_buf[MAX_BUF]
Holds arbitrary input from client.
Definition: player.h:174
int8_t levgrace[11]
What grace bonus the player gained on that level.
Definition: player.h:169
const char * unarmed_skill
Prefered skill to use in unarmed combat.
Definition: player.h:202
partylist * party_to_join
Used when player wants to join a party but we will have to get password first so we have to remember ...
Definition: player.h:187
int16_t digestion
Any bonuses/penalties to digestion.
Definition: player.h:112
sstring followed_player
Player the DM is following.
Definition: player.h:199
uint32_t last_path_denied
Last spell denied sent to client.
Definition: player.h:146
living last_orig_stats
Last permanent stats sent to client.
Definition: player.h:150
uint32_t count
Any numbers typed before a command.
Definition: player.h:109