… | |
… | |
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 | |
… | |
… | |
134 | object_ptr ACC (RW, last_used); /* Pointer to object last picked or applied */ |
136 | object_ptr ACC (RW, last_used); /* Pointer to object last picked or applied */ |
135 | |
137 | |
136 | object_ptr ACC (RW, combat_ob); // which weapon/bow/skill to use for direct attacks |
138 | object_ptr ACC (RW, combat_ob); // which weapon/bow/skill to use for direct attacks |
137 | object_ptr ACC (RW, ranged_ob); // which skill/item/spell to use for ranged attacks |
139 | object_ptr ACC (RW, ranged_ob); // which skill/item/spell to use for ranged attacks |
138 | object_ptr ACC (RW, golem); // the currently controlled golem |
140 | object_ptr ACC (RW, golem); // the currently controlled golem |
139 | object_ptr ACC (RW, observe); // the object that is being observed (or 0) |
141 | object_ptr ACC (RW, observe); // the object that is being observed (never 0) |
|
|
142 | object_ptr ACC (RW, viewpoint); // the object that is being viewed in the map (never 0) |
140 | |
143 | |
141 | sint16 ACC (RW, bed_x), ACC (RW, bed_y); /* x,y - coordinates of respawn (savebed) */ |
144 | sint16 ACC (RW, bed_x), ACC (RW, bed_y); /* x,y - coordinates of respawn (savebed) */ |
142 | shstr ACC (RW, savebed_map); /* map where player will respawn after death */ |
145 | shstr ACC (RW, savebed_map); /* map where player will respawn after death */ |
143 | shstr ACC (RW, maplevel); /* On which level is the player? */ |
146 | shstr ACC (RW, maplevel); /* On which level is the player? */ |
144 | char ACC (RW, spellparam)[MAX_BUF]; /* What param to add to spells */ |
147 | char ACC (RW, spellparam)[MAX_BUF]; /* What param to add to spells */ |
… | |
… | |
159 | partylist *ACC (RW, party); /* Party this player is part of */ |
162 | partylist *ACC (RW, party); /* Party this player is part of */ |
160 | partylist *ACC (RW, party_to_join); /* used when player wants to join a party */ |
163 | partylist *ACC (RW, party_to_join); /* used when player wants to join a party */ |
161 | /* but we will have to get password first */ |
164 | /* but we will have to get password first */ |
162 | /* so we have to remember which party to */ |
165 | /* so we have to remember which party to */ |
163 | /* join */ |
166 | /* join */ |
164 | char ACC (RW, search_str)[MAX_BUF]; /* Item we are looking for */ |
167 | char ACC (RW, search_str)[256]; /* Item we are looking for */ |
165 | sint16 ACC (RW, encumbrance); /* How much our player is encumbered */ |
168 | sint16 ACC (RW, encumbrance); /* How much our player is encumbered */ |
166 | uint16 ACC (RW, outputs_sync); /* How often to print, no matter what */ |
169 | uint16 ACC (RW, outputs_sync); /* How often to print, no matter what */ |
167 | uint16 ACC (RW, outputs_count); /* Print if this count is exceeded */ |
170 | uint16 ACC (RW, outputs_count); /* Print if this count is exceeded */ |
168 | object_ptr ACC (RW, mark); /* marked object */ |
171 | object_ptr ACC (RW, mark); /* marked object */ |
169 | /* Special DM fields */ |
172 | /* Special DM fields */ |
… | |
… | |
171 | int ACC (RW, stack_position); /* Current stack position, 0 for no item */ |
174 | int ACC (RW, stack_position); /* Current stack position, 0 for no item */ |
172 | sint8 los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
175 | sint8 los[MAP_CLIENT_X][MAP_CLIENT_Y]; /* array showing what spaces */ |
173 | /* the player can see. For maps smaller than */ |
176 | /* the player can see. For maps smaller than */ |
174 | /* MAP_CLIENT_.., the center is used */ |
177 | /* MAP_CLIENT_.., the center is used */ |
175 | |
178 | |
|
|
179 | //-GPL |
|
|
180 | |
|
|
181 | // stats updates are very costly, so delay them if at all possible |
|
|
182 | bool ACC (RW, delayed_update); |
|
|
183 | void queue_stats_update () |
|
|
184 | { |
|
|
185 | delayed_update = true; |
|
|
186 | } |
|
|
187 | void need_updated_stats () |
|
|
188 | { |
|
|
189 | if (delayed_update) |
|
|
190 | ob->update_stats (); |
|
|
191 | } |
|
|
192 | |
176 | // return the los value for the given coordinate |
193 | // return the los value for the given coordinate |
177 | MTH sint8 blocked_los (int dx, int dy) const |
194 | MTH sint8 blocked_los (int dx, int dy) const |
178 | { |
195 | { |
179 | dx += LOS_X0; |
196 | dx += LOS_X0; |
180 | dy += LOS_Y0; |
197 | dy += LOS_Y0; |
… | |
… | |
234 | |
251 | |
235 | MTH void chargen_race_done (); |
252 | MTH void chargen_race_done (); |
236 | MTH void chargen_race_next (); |
253 | MTH void chargen_race_next (); |
237 | |
254 | |
238 | MTH void set_observe (object_ornull *ob); |
255 | MTH void set_observe (object_ornull *ob); |
|
|
256 | MTH void set_viewpoint (object_ornull *ob); |
239 | |
257 | |
240 | void send_msg (int color, const char *type, const char *msg) |
258 | void send_msg (int color, const char *type, const char *msg) |
241 | { |
259 | { |
242 | ns->send_msg (color, type, msg); |
260 | ns->send_msg (color, type, msg); |
243 | } |
261 | } |
… | |
… | |
254 | |
272 | |
255 | // a prominent box that signifies some error such as a failed |
273 | // a prominent box that signifies some error such as a failed |
256 | // improvement potion. should not be long. |
274 | // improvement potion. should not be long. |
257 | MTH void failmsg (const char *msg, int color = NDI_RED); |
275 | MTH void failmsg (const char *msg, int color = NDI_RED); |
258 | |
276 | |
|
|
277 | MTH void update_spells () const |
|
|
278 | { |
|
|
279 | if (ns) |
|
|
280 | ns->update_spells = true; |
|
|
281 | } |
|
|
282 | |
259 | ~player (); |
283 | ~player (); |
260 | |
284 | |
261 | private: |
285 | private: |
262 | void set_object (object *op); |
286 | void set_object (object *op); |
263 | player (); |
287 | player (); |