ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/player.h
(Generate patch)

Comparing deliantra/server/include/player.h (file contents):
Revision 1.1 by root, Fri Feb 3 07:12:50 2006 UTC vs.
Revision 1.9 by root, Tue Aug 29 07:33:58 2006 UTC

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.9 2006/08/29 07:33:58 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
35 35
36 36
37/* wand/rod/horn rolled into range_misc. They all use the same body location 37/* wand/rod/horn rolled into range_misc. They all use the same body location
38 * anyways. 38 * anyways.
39 */ 39 */
40typedef enum rangetype { 40enum rangetype {
41 range_bottom = -1, 41 range_bottom = -1,
42 range_none = 0, 42 range_none = 0,
43 range_bow = 1, 43 range_bow = 1,
44 range_magic = 2, 44 range_magic = 2,
45 range_misc = 3, 45 range_misc = 3,
46 range_golem = 4, 46 range_golem = 4,
47 range_skill = 5, 47 range_skill = 5,
48 range_builder = 6, 48 range_builder = 6,
49 range_size = 7 49 range_size = 7
50} rangetype; 50};
51 51
52typedef enum _bowtype { 52enum bowtype_t {
53 bow_normal = 0, 53 bow_normal = 0,
54 bow_threewide = 1, 54 bow_threewide = 1,
55 bow_spreadshot = 2, 55 bow_spreadshot = 2,
56 bow_n = 3, /* must stay at 3 */ 56 bow_n = 3, /* must stay at 3 */
57 bow_ne = 4, 57 bow_ne = 4,
60 bow_s = 7, 60 bow_s = 7,
61 bow_sw = 8, 61 bow_sw = 8,
62 bow_w = 9, 62 bow_w = 9,
63 bow_nw = 10, /* must stay at 10 */ 63 bow_nw = 10, /* must stay at 10 */
64 bow_bestarrow = 11 64 bow_bestarrow = 11
65} bowtype_t; 65};
66 66
67typedef enum _petmode { 67typedef enum _petmode {
68 pet_normal = 0, 68 pet_normal = 0,
69 pet_sad = 1, 69 pet_sad = 1,
70 pet_defend = 2, 70 pet_defend = 2,
104#endif 104#endif
105 sint64 total_exp; 105 sint64 total_exp;
106 uint32 kills; 106 uint32 kills;
107} partylist; 107} partylist;
108 108
109typedef struct pl { 109// memsettable part of player
110 struct pl *next; /* Pointer to next player, NULL if this is last */ 110struct player_memset
111 NewSocket socket; /* Socket information for this player */ 111{
112 char maplevel[MAX_BUF]; /* On which level is the player? */ 112 object *ob; /* The object representing the player */
113 struct mapdef *loading; /* When entering a map in progress of loading, not really used */ 113 mapstruct *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 */ 114 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? */ 115 bowtype_t bowtype; /* which firemode? */
119 petmode_t petmode; /* which petmode? */ 116 petmode_t petmode; /* which petmode? */
120 object *ranges[range_size];/* object for each range. Set up in fix player. Note */ 117 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 */ 118 /* That not all are used, it is just nice to map this 1:1 */
122 /* With the range names */ 119 /* With the range names */
137 sint8 last_level; /* Last level we sent to client */ 134 sint8 last_level; /* Last level we sent to client */
138 135
139 /* Try to put all the bitfields together - saves some small amount of memory */ 136 /* Try to put all the bitfields together - saves some small amount of memory */
140 uint32 braced:1; /* Will not move if braced, only attack */ 137 uint32 braced:1; /* Will not move if braced, only attack */
141 uint32 tmp_invis:1; /* Will invis go away when we attack ? */ 138 uint32 tmp_invis:1; /* Will invis go away when we attack ? */
142 const char *invis_race;/* What race invisible to? */ 139 const char *invis_race; /* What race invisible to? */
143 uint32 do_los:1; /* If true, need to call update_los() in draw(), and clear */ 140 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 */ 141 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 */ 142 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 */ 143 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. */ 144 uint32 name_changed:1; /* If true, the player has set a name. */
164 living orig_stats; /* Permanent real stats of player */ 161 living orig_stats; /* Permanent real stats of player */
165 living last_stats; /* Last stats as sent to client */ 162 living last_stats; /* Last stats as sent to client */
166 float last_speed; /* Last speed as sent to client */ 163 float last_speed; /* Last speed as sent to client */
167 sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */ 164 sint16 last_resist[NROFATTACKS]; /* last resist values sent to client */
168 int Swap_First; /* First stat player has selected to swap */ 165 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 */ 166 object *last_used; /* Pointer to object last picked or applied */
171 uint32 last_used_id; /* Safety measures to be sure it's the same */ 167 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 */ 168 sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */
173 /* the player can see. For maps smaller than */ 169 /* the player can see. For maps smaller than */
174 /* MAP_CLIENT_.., the upper left is used */ 170 /* MAP_CLIENT_.., the upper left is used */
171
172 sint16 bed_x, bed_y; /* x,y - coordinates of respawn (savebed) */
173 char savebed_map[MAX_BUF]; /* map where player will respawn after death */
174 char maplevel[MAX_BUF]; /* On which level is the player? */
175 char spellparam[MAX_BUF]; /* What param to add to spells */
175 176
176 char own_title[MAX_NAME]; /* Title the player has chosen for themself */ 177 char own_title[MAX_NAME]; /* Title the player has chosen for themself */
177 /* Note that for dragon players, this is filled in for them */ 178 /* Note that for dragon players, this is filled in for them */
178 char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */ 179 char title[BIG_NAME]; /* Default title, like fighter, wizard, etc */
179 180
207 object *mark; /* marked object */ 208 object *mark; /* marked object */
208 uint32 mark_count; /* count of mark object */ 209 uint32 mark_count; /* count of mark object */
209 /* Special DM fields */ 210 /* Special DM fields */
210 tag_t* stack_items; /* Item stack for patch/dump/... commands */ 211 tag_t* stack_items; /* Item stack for patch/dump/... commands */
211 int stack_position; /* Current stack position, 0 for no item */ 212 int stack_position; /* Current stack position, 0 for no item */
213};
214
215typedef struct pl : player_memset, attachable<struct pl>
216{
217 static data_type get_dt () { return DT_PLAYER; }
218
219 struct pl *next; /* Pointer to next player, NULL if this is last */
220 NewSocket socket; /* Socket information for this player */
212} player; 221} player;
222

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines