… | |
… | |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | #ifndef PLAYER_H_ |
24 | #ifndef PLAYER_H_ |
25 | #define PLAYER_H_ |
25 | #define PLAYER_H_ |
|
|
26 | |
|
|
27 | //+GPL |
26 | |
28 | |
27 | enum bowtype_t |
29 | enum bowtype_t |
28 | { |
30 | { |
29 | bow_normal = 0, |
31 | bow_normal = 0, |
30 | bow_threewide = 1, |
32 | bow_threewide = 1, |
… | |
… | |
86 | sint64 ACC (RW, total_exp); |
88 | sint64 ACC (RW, total_exp); |
87 | uint32 ACC (RW, kills); |
89 | uint32 ACC (RW, kills); |
88 | }; |
90 | }; |
89 | |
91 | |
90 | // used for pet monster logic etc. |
92 | // used for pet monster logic etc. |
91 | static bool |
93 | static inline bool |
92 | same_party (partylist *a, partylist *b) |
94 | same_party (partylist *a, partylist *b) |
93 | { |
95 | { |
94 | return a == b && a; |
96 | return a == b && a; |
95 | } |
97 | } |
96 | |
98 | |
… | |
… | |
152 | sint8 ACC (RW, levsp[11]); /* Same for sp */ |
154 | sint8 ACC (RW, levsp[11]); /* Same for sp */ |
153 | sint8 ACC (RW, levgrace[11]); /* And same for grace */ |
155 | sint8 ACC (RW, levgrace[11]); /* And same for grace */ |
154 | |
156 | |
155 | object_ptr ACC (RW, killer); /* Who last tried to kill this player (this object is usually destroyed) */ |
157 | object_ptr ACC (RW, killer); /* Who last tried to kill this player (this object is usually destroyed) */ |
156 | |
158 | |
|
|
159 | float speed_left_save; // spee doptimisation, see process_players[12] |
157 | char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ /* should go */ |
160 | char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ /* should go */ |
158 | char ACC (RW, password)[16]; /* 2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16 */ |
161 | char ACC (RW, password)[16]; /* 2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16 */ |
159 | |
162 | |
160 | partylist *ACC (RW, party); /* Party this player is part of */ |
163 | partylist *ACC (RW, party); /* Party this player is part of */ |
161 | partylist *ACC (RW, party_to_join); /* used when player wants to join a party */ |
164 | partylist *ACC (RW, party_to_join); /* used when player wants to join a party */ |
162 | /* but we will have to get password first */ |
165 | /* but we will have to get password first */ |
163 | /* so we have to remember which party to */ |
166 | /* so we have to remember which party to */ |
164 | /* join */ |
167 | /* join */ |
165 | char ACC (RW, search_str)[MAX_BUF]; /* Item we are looking for */ |
168 | char ACC (RW, search_str)[256]; /* Item we are looking for */ |
166 | sint16 ACC (RW, encumbrance); /* How much our player is encumbered */ |
169 | sint16 ACC (RW, encumbrance); /* How much our player is encumbered */ |
167 | uint16 ACC (RW, outputs_sync); /* How often to print, no matter what */ |
170 | uint16 ACC (RW, outputs_sync); /* How often to print, no matter what */ |
168 | uint16 ACC (RW, outputs_count); /* Print if this count is exceeded */ |
171 | uint16 ACC (RW, outputs_count); /* Print if this count is exceeded */ |
169 | object_ptr ACC (RW, mark); /* marked object */ |
172 | object_ptr ACC (RW, mark); /* marked object */ |
170 | /* Special DM fields */ |
173 | /* Special DM fields */ |
… | |
… | |
172 | int ACC (RW, stack_position); /* Current stack position, 0 for no item */ |
175 | int ACC (RW, stack_position); /* Current stack position, 0 for no item */ |
173 | sint8 los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
176 | sint8 los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
174 | /* the player can see. For maps smaller than */ |
177 | /* the player can see. For maps smaller than */ |
175 | /* MAP_CLIENT_.., the center is used */ |
178 | /* MAP_CLIENT_.., the center is used */ |
176 | |
179 | |
|
|
180 | //-GPL |
|
|
181 | |
|
|
182 | // stats updates are very costly, so delay them if at all possible |
|
|
183 | bool ACC (RW, delayed_update); |
|
|
184 | void queue_stats_update () |
|
|
185 | { |
|
|
186 | delayed_update = true; |
|
|
187 | } |
|
|
188 | void need_updated_stats () |
|
|
189 | { |
|
|
190 | if (delayed_update) |
|
|
191 | ob->update_stats (); |
|
|
192 | } |
|
|
193 | |
177 | // return the los value for the given coordinate |
194 | // return the los value for the given coordinate |
178 | MTH sint8 blocked_los (int dx, int dy) const |
195 | MTH sint8 blocked_los (int dx, int dy) const |
179 | { |
196 | { |
180 | dx += LOS_X0; |
197 | dx += LOS_X0; |
181 | dy += LOS_Y0; |
198 | dy += LOS_Y0; |
… | |
… | |
256 | |
273 | |
257 | // a prominent box that signifies some error such as a failed |
274 | // a prominent box that signifies some error such as a failed |
258 | // improvement potion. should not be long. |
275 | // improvement potion. should not be long. |
259 | MTH void failmsg (const char *msg, int color = NDI_RED); |
276 | MTH void failmsg (const char *msg, int color = NDI_RED); |
260 | |
277 | |
|
|
278 | MTH void update_spells () const |
|
|
279 | { |
|
|
280 | if (ns) |
|
|
281 | ns->update_spells = true; |
|
|
282 | } |
|
|
283 | |
261 | ~player (); |
284 | ~player (); |
262 | |
285 | |
263 | private: |
286 | private: |
264 | void set_object (object *op); |
287 | void set_object (object *op); |
265 | player (); |
288 | player (); |