1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
… | |
… | |
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 | |
24 | #ifndef PLAYER_H_ |
25 | #ifndef PLAYER_H_ |
25 | #define PLAYER_H_ |
26 | #define PLAYER_H_ |
26 | |
27 | |
27 | //+GPL |
28 | //+GPL |
28 | |
29 | |
… | |
… | |
72 | |
73 | |
73 | /* not really the player, but tied pretty closely */ |
74 | /* not really the player, but tied pretty closely */ |
74 | INTERFACE_CLASS (partylist) |
75 | INTERFACE_CLASS (partylist) |
75 | struct partylist |
76 | struct partylist |
76 | { |
77 | { |
77 | char *ACC (RW, partyleader); |
78 | utf8_string ACC (RW, partyleader); |
78 | char ACC (RW, passwd)[9]; |
79 | char ACC (RW, passwd)[9]; |
79 | partylist *ACC (RW, next); |
80 | partylist *ACC (RW, next); |
80 | char *ACC (RW, partyname); |
81 | utf8_string ACC (RW, partyname); |
81 | |
82 | |
82 | struct party_kill |
83 | struct party_kill |
83 | { |
84 | { |
84 | char killer[MAX_NAME + 1], dead[MAX_NAME + 1]; |
85 | char killer[MAX_NAME + 1], dead[MAX_NAME + 1]; |
85 | sint64 exp; |
86 | sint64 exp; |
… | |
… | |
211 | MTH void clear_los (sint8 value = LOS_BLOCKED); |
212 | MTH void clear_los (sint8 value = LOS_BLOCKED); |
212 | MTH void update_los (); |
213 | MTH void update_los (); |
213 | |
214 | |
214 | shstr ACC (RW, invis_race); /* What race invisible to? */ |
215 | shstr ACC (RW, invis_race); /* What race invisible to? */ |
215 | |
216 | |
216 | MTH const char *killer_name () const; // makes a string out of ->killer |
217 | MTH const_utf8_string killer_name () const; // makes a string out of ->killer |
217 | |
218 | |
218 | MTH static player *create (); |
219 | MTH static player *create (); |
219 | static player *find (const_utf8_string name); |
220 | static player *find (const_utf8_string name); |
220 | |
221 | |
221 | static player *load_pl (object_thawer &thawer); |
222 | static player *load_pl (object_thawer &thawer); |
… | |
… | |
223 | |
224 | |
224 | MTH void link_skills (); |
225 | MTH void link_skills (); |
225 | MTH object *find_skill (shstr_cmp name) const; |
226 | MTH object *find_skill (shstr_cmp name) const; |
226 | |
227 | |
227 | bool save_pl (object_freezer &freezer); |
228 | bool save_pl (object_freezer &freezer); |
228 | MTH bool save_pl (const char *path); |
229 | MTH bool save_pl (const_octet_string path); |
229 | |
230 | |
230 | void do_destroy (); |
231 | void do_destroy (); |
231 | void gather_callbacks (AV *&callbacks, event_type event) const; |
232 | void gather_callbacks (AV *&callbacks, event_type event) const; |
232 | |
233 | |
233 | MTH dynbuf_text *expand_cfpod (const char *cfpod) const; |
234 | MTH dynbuf_text *expand_cfpod (const_utf8_string cfpod) const; |
234 | |
235 | |
235 | MTH void touch () { dirty = true; } // need to touch when logged out and changed |
236 | MTH void touch () { dirty = true; } // need to touch when logged out and changed |
236 | |
237 | |
237 | MTH void play_sound (faceidx sound, int dx = 0, int dy = 0) const |
238 | MTH void play_sound (faceidx sound, int dx = 0, int dy = 0) const |
238 | { |
239 | { |
… | |
… | |
254 | MTH void chargen_race_next (); |
255 | MTH void chargen_race_next (); |
255 | |
256 | |
256 | MTH void set_observe (object_ornull *ob); |
257 | MTH void set_observe (object_ornull *ob); |
257 | MTH void set_viewpoint (object_ornull *ob); |
258 | MTH void set_viewpoint (object_ornull *ob); |
258 | |
259 | |
259 | void send_msg (int color, const char *type, const char *msg) |
260 | void send_msg (int color, const_utf8_string type, const_utf8_string msg) |
260 | { |
261 | { |
261 | ns->send_msg (color, type, msg); |
262 | ns->send_msg (color, type, msg); |
262 | } |
263 | } |
263 | |
264 | |
264 | // a prominent box that can easily be escaped away or so |
265 | // a prominent box that can easily be escaped away or so |
265 | // should be used for informative output such as who, maps etc. |
266 | // should be used for informative output such as who, maps etc. |
266 | // will stay on-screen |
267 | // will stay on-screen |
267 | MTH void infobox (const char *title, const char *msg, int color = NDI_BLACK); |
268 | MTH void infobox (const_utf8_string title, const_utf8_string msg, int color = NDI_BLACK); |
268 | |
269 | |
269 | // a prominent msg that signifies some important event, |
270 | // a prominent msg that signifies some important event, |
270 | // an improvement potion effect potion. should not be long. |
271 | // an improvement potion effect potion. should not be long. |
271 | // might time out after a while |
272 | // might time out after a while |
272 | MTH void statusmsg (const char *msg, int color = NDI_BLACK); |
273 | MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK); |
273 | |
274 | |
274 | // a prominent box that signifies some error such as a failed |
275 | // a prominent box that signifies some error such as a failed |
275 | // improvement potion. should not be long. |
276 | // improvement potion. should not be long. |
276 | MTH void failmsg (const char *msg, int color = NDI_RED); |
277 | MTH void failmsg (const_utf8_string msg, int color = NDI_RED); |
277 | |
278 | |
278 | MTH void update_spells () const |
279 | MTH void update_spells () const |
279 | { |
280 | { |
280 | if (ns) |
281 | if (ns) |
281 | ns->update_spells = true; |
282 | ns->update_spells = true; |
… | |
… | |
299 | #define for_all_players_on_map(var,mapp) \ |
300 | #define for_all_players_on_map(var,mapp) \ |
300 | for_all_players(var) \ |
301 | for_all_players(var) \ |
301 | if ((var)->ob->map == (mapp)) |
302 | if ((var)->ob->map == (mapp)) |
302 | |
303 | |
303 | inline void |
304 | inline void |
304 | object::statusmsg (const char *msg, int color) |
305 | object::statusmsg (const_utf8_string msg, int color) |
305 | { |
306 | { |
306 | if (expect_true (contr)) contr->statusmsg (msg, color); |
307 | if (expect_true (contr)) contr->statusmsg (msg, color); |
307 | } |
308 | } |
308 | |
309 | |
309 | inline void |
310 | inline void |
310 | object::failmsg (const char *msg, int color) |
311 | object::failmsg (const_utf8_string msg, int color) |
311 | { |
312 | { |
312 | if (expect_true (contr)) contr->failmsg (msg, color); |
313 | if (expect_true (contr)) contr->failmsg (msg, color); |
313 | } |
314 | } |
314 | |
315 | |
315 | #endif |
316 | #endif |
|
|
317 | |