… | |
… | |
19 | * and the GNU General Public License along with this program. If not, see |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * <http://www.gnu.org/licenses/>. |
20 | * <http://www.gnu.org/licenses/>. |
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_ |
|
|
25 | #define PLAYER_H_ |
|
|
26 | |
|
|
27 | //+GPL |
24 | |
28 | |
25 | enum bowtype_t |
29 | enum bowtype_t |
26 | { |
30 | { |
27 | bow_normal = 0, |
31 | bow_normal = 0, |
28 | bow_threewide = 1, |
32 | bow_threewide = 1, |
… | |
… | |
84 | sint64 ACC (RW, total_exp); |
88 | sint64 ACC (RW, total_exp); |
85 | uint32 ACC (RW, kills); |
89 | uint32 ACC (RW, kills); |
86 | }; |
90 | }; |
87 | |
91 | |
88 | // used for pet monster logic etc. |
92 | // used for pet monster logic etc. |
89 | static bool |
93 | static inline bool |
90 | same_party (partylist *a, partylist *b) |
94 | same_party (partylist *a, partylist *b) |
91 | { |
95 | { |
92 | return a == b && a; |
96 | return a == b && a; |
93 | } |
97 | } |
94 | |
98 | |
… | |
… | |
132 | 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 */ |
133 | |
137 | |
134 | 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 |
135 | 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 |
136 | object_ptr ACC (RW, golem); // the currently controlled golem |
140 | object_ptr ACC (RW, golem); // the currently controlled golem |
137 | 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) |
138 | |
143 | |
139 | 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) */ |
140 | 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 */ |
141 | shstr ACC (RW, maplevel); /* On which level is the player? */ |
146 | shstr ACC (RW, maplevel); /* On which level is the player? */ |
142 | 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 */ |
… | |
… | |
169 | 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 */ |
170 | 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 */ |
171 | /* the player can see. For maps smaller than */ |
176 | /* the player can see. For maps smaller than */ |
172 | /* MAP_CLIENT_.., the center is used */ |
177 | /* MAP_CLIENT_.., the center is used */ |
173 | |
178 | |
|
|
179 | //-GPL |
|
|
180 | |
174 | // return the los value for the given coordinate |
181 | // return the los value for the given coordinate |
175 | MTH sint8 blocked_los (int dx, int dy) const |
182 | MTH sint8 blocked_los (int dx, int dy) const |
176 | { |
183 | { |
177 | dx += LOS_X0; |
184 | dx += LOS_X0; |
178 | dy += LOS_Y0; |
185 | dy += LOS_Y0; |
… | |
… | |
232 | |
239 | |
233 | MTH void chargen_race_done (); |
240 | MTH void chargen_race_done (); |
234 | MTH void chargen_race_next (); |
241 | MTH void chargen_race_next (); |
235 | |
242 | |
236 | MTH void set_observe (object_ornull *ob); |
243 | MTH void set_observe (object_ornull *ob); |
|
|
244 | MTH void set_viewpoint (object_ornull *ob); |
237 | |
245 | |
238 | void send_msg (int color, const char *type, const char *msg) |
246 | void send_msg (int color, const char *type, const char *msg) |
239 | { |
247 | { |
240 | ns->send_msg (color, type, msg); |
248 | ns->send_msg (color, type, msg); |
241 | } |
249 | } |
… | |
… | |
282 | inline void |
290 | inline void |
283 | object::failmsg (const char *msg, int color) |
291 | object::failmsg (const char *msg, int color) |
284 | { |
292 | { |
285 | if (expect_true (contr)) contr->failmsg (msg, color); |
293 | if (expect_true (contr)) contr->failmsg (msg, color); |
286 | } |
294 | } |
|
|
295 | |
|
|
296 | #endif |