1 | /* |
1 | /* |
2 | * static char *rcsid_player_h = |
2 | * static char *rcsid_player_h = |
3 | * "$Id: player.h,v 1.1 2006/02/03 07:12:50 root Exp $"; |
3 | * "$Id: player.h,v 1.3 2006/04/19 08:25:25 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
104 | #endif |
104 | #endif |
105 | sint64 total_exp; |
105 | sint64 total_exp; |
106 | uint32 kills; |
106 | uint32 kills; |
107 | } partylist; |
107 | } partylist; |
108 | |
108 | |
|
|
109 | // the layout of this structure cnanot be changed unless adjusting the inialisation code |
|
|
110 | // in server/player.c:get_player has been verified. |
109 | typedef struct pl { |
111 | typedef struct pl { |
110 | struct pl *next; /* Pointer to next player, NULL if this is last */ |
112 | struct pl *next; /* Pointer to next player, NULL if this is last */ |
111 | NewSocket socket; /* Socket information for this player */ |
113 | NewSocket socket; /* Socket information for this player */ |
112 | char maplevel[MAX_BUF]; /* On which level is the player? */ |
114 | object *ob; /* The object representing the player */ |
113 | struct mapdef *loading; /* When entering a map in progress of loading, not really used */ |
115 | struct mapdef *loading; /* When entering a map in progress of loading, not really used */ |
114 | char savebed_map[MAX_BUF]; /* map where player will respawn after death */ |
|
|
115 | sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */ |
|
|
116 | rangetype shoottype; /* Which range-attack is being used by player */ |
116 | rangetype shoottype; /* Which range-attack is being used by player */ |
117 | char spellparam[MAX_BUF]; /* What param to add to spells */ |
|
|
118 | bowtype_t bowtype; /* which firemode? */ |
117 | bowtype_t bowtype; /* which firemode? */ |
119 | petmode_t petmode; /* which petmode? */ |
118 | petmode_t petmode; /* which petmode? */ |
120 | object *ranges[range_size];/* object for each range. Set up in fix player. Note */ |
119 | object *ranges[range_size];/* object for each range. Set up in fix player. Note */ |
121 | /* That not all are used, it is just nice to map this 1:1 */ |
120 | /* That not all are used, it is just nice to map this 1:1 */ |
122 | /* With the range names */ |
121 | /* With the range names */ |
… | |
… | |
137 | sint8 last_level; /* Last level we sent to client */ |
136 | sint8 last_level; /* Last level we sent to client */ |
138 | |
137 | |
139 | /* Try to put all the bitfields together - saves some small amount of memory */ |
138 | /* Try to put all the bitfields together - saves some small amount of memory */ |
140 | uint32 braced:1; /* Will not move if braced, only attack */ |
139 | uint32 braced:1; /* Will not move if braced, only attack */ |
141 | uint32 tmp_invis:1; /* Will invis go away when we attack ? */ |
140 | uint32 tmp_invis:1; /* Will invis go away when we attack ? */ |
142 | const char *invis_race;/* What race invisible to? */ |
141 | const char *invis_race; /* What race invisible to? */ |
143 | uint32 do_los:1; /* If true, need to call update_los() in draw(), and clear */ |
142 | uint32 do_los:1; /* If true, need to call update_los() in draw(), and clear */ |
144 | uint32 fire_on:1; /* Player should fire object, not move */ |
143 | uint32 fire_on:1; /* Player should fire object, not move */ |
145 | uint32 run_on:1; /* Player should keep moving in dir until run is off */ |
144 | uint32 run_on:1; /* Player should keep moving in dir until run is off */ |
146 | uint32 has_hit:1; /* If set, weapon_sp instead of speed will count */ |
145 | uint32 has_hit:1; /* If set, weapon_sp instead of speed will count */ |
147 | uint32 name_changed:1; /* If true, the player has set a name. */ |
146 | uint32 name_changed:1; /* If true, the player has set a name. */ |
… | |
… | |
164 | living orig_stats; /* Permanent real stats of player */ |
163 | living orig_stats; /* Permanent real stats of player */ |
165 | living last_stats; /* Last stats as sent to client */ |
164 | living last_stats; /* Last stats as sent to client */ |
166 | float last_speed; /* Last speed as sent to client */ |
165 | float last_speed; /* Last speed as sent to client */ |
167 | sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */ |
166 | sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */ |
168 | int Swap_First; /* First stat player has selected to swap */ |
167 | int Swap_First; /* First stat player has selected to swap */ |
169 | object *ob; /* The object representing the player */ |
|
|
170 | object *last_used; /* Pointer to object last picked or applied */ |
168 | object *last_used; /* Pointer to object last picked or applied */ |
171 | uint32 last_used_id; /* Safety measures to be sure it's the same */ |
169 | uint32 last_used_id; /* Safety measures to be sure it's the same */ |
172 | sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
170 | sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
173 | /* the player can see. For maps smaller than */ |
171 | /* the player can see. For maps smaller than */ |
174 | /* MAP_CLIENT_.., the upper left is used */ |
172 | /* MAP_CLIENT_.., the upper left is used */ |
|
|
173 | |
|
|
174 | sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */ |
|
|
175 | char savebed_map[MAX_BUF]; /* map where player will respawn after death */ |
|
|
176 | char maplevel[MAX_BUF]; /* On which level is the player? */ |
|
|
177 | char spellparam[MAX_BUF]; /* What param to add to spells */ |
175 | |
178 | |
176 | char own_title[MAX_NAME]; /* Title the player has chosen for themself */ |
179 | char own_title[MAX_NAME]; /* Title the player has chosen for themself */ |
177 | /* Note that for dragon players, this is filled in for them */ |
180 | /* Note that for dragon players, this is filled in for them */ |
178 | char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */ |
181 | char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */ |
179 | |
182 | |
… | |
… | |
204 | Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ |
207 | Output_Buf outputs[NUM_OUTPUT_BUFS]; /* holds output strings to client */ |
205 | uint16 outputs_sync; /* How often to print, no matter what */ |
208 | uint16 outputs_sync; /* How often to print, no matter what */ |
206 | uint16 outputs_count; /* Print if this count is exceeded */ |
209 | uint16 outputs_count; /* Print if this count is exceeded */ |
207 | object *mark; /* marked object */ |
210 | object *mark; /* marked object */ |
208 | uint32 mark_count; /* count of mark object */ |
211 | uint32 mark_count; /* count of mark object */ |
|
|
212 | object *transport; /* transport the player is in */ |
209 | /* Special DM fields */ |
213 | /* Special DM fields */ |
210 | tag_t* stack_items; /* Item stack for patch/dump/... commands */ |
214 | tag_t* stack_items; /* Item stack for patch/dump/... commands */ |
211 | int stack_position; /* Current stack position, 0 for no item */ |
215 | int stack_position; /* Current stack position, 0 for no item */ |
212 | } player; |
216 | } player; |