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.101 by root, Sat Jan 16 13:41:37 2010 UTC vs.
Revision 1.109 by root, Sat Apr 23 04:56:49 2011 UTC

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,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 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
130 bool ACC (RW, dirty); // set if player is dirty (not reliable yet!) 131 bool ACC (RW, dirty); // set if player is dirty (not reliable yet!)
131 132
132 float ACC (RW, weapon_sp); /* Penalties to speed when fighting w speed >ws/10 */ 133 float ACC (RW, weapon_sp); /* Penalties to speed when fighting w speed >ws/10 */
133 float ACC (RW, weapon_sp_left); // same as speed_left, but for attacks 134 float ACC (RW, weapon_sp_left); // same as speed_left, but for attacks
134 living ACC (RO, orig_stats); /* Permanent real stats of player */ 135 living ACC (RO, orig_stats); /* Permanent real stats of player */
135 object_ptr last_skill_ob[NUM_SKILLS]; /* the exp object */ 136 object_ptr last_skill_ob[CS_NUM_SKILLS]; /* the exp object */
136 object_ptr ACC (RW, last_used); /* Pointer to object last picked or applied */ 137 object_ptr ACC (RW, last_used); /* Pointer to object last picked or applied */
137 138
138 object_ptr ACC (RW, combat_ob); // which weapon/bow/skill to use for direct attacks 139 object_ptr ACC (RW, combat_ob); // which weapon/bow/skill to use for direct attacks
139 object_ptr ACC (RW, ranged_ob); // which skill/item/spell to use for ranged attacks 140 object_ptr ACC (RW, ranged_ob); // which skill/item/spell to use for ranged attacks
140 object_ptr ACC (RW, golem); // the currently controlled golem 141 object_ptr ACC (RW, golem); // the currently controlled golem
156 157
157 object_ptr ACC (RW, killer); /* Who last tried to kill this player (this object is usually destroyed) */ 158 object_ptr ACC (RW, killer); /* Who last tried to kill this player (this object is usually destroyed) */
158 159
159 float speed_left_save; // spee doptimisation, see process_players[12] 160 float speed_left_save; // spee doptimisation, see process_players[12]
160 char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ /* should go */ 161 char write_buf[MAX_BUF]; /* Holds arbitrary input from client */ /* should go */
161 char ACC (RW, password)[16]; /* 2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16 */ 162 char ACC (RW, password)[256]; /* 2 (seed) + 11 (crypted) + 1 (EOS) + 2 (safety) = 16 */
162 163
163 partylist *ACC (RW, party); /* Party this player is part of */ 164 partylist *ACC (RW, party); /* Party this player is part of */
164 partylist *ACC (RW, party_to_join); /* used when player wants to join a party */ 165 partylist *ACC (RW, party_to_join); /* used when player wants to join a party */
165 /* but we will have to get password first */ 166 /* but we will have to get password first */
166 /* so we have to remember which party to */ 167 /* so we have to remember which party to */
189 { 190 {
190 if (delayed_update) 191 if (delayed_update)
191 ob->update_stats (); 192 ob->update_stats ();
192 } 193 }
193 194
195#if 0
196 enum {
197 SA_SPELLS = 1<<0,
198 SA_EXP = 1<<1,
199 };
200
201 uint8 ACxC (RW, stat_update_flags);
202
203 void need_stat_update (int flags)
204 {
205 stat_update_flags |= flags;
206 }
207#endif
208
194 // return the los value for the given coordinate 209 // return the los value for the given coordinate
195 MTH sint8 blocked_los (int dx, int dy) const 210 MTH sint8 blocked_los (int dx, int dy) const
196 { 211 {
197 dx += LOS_X0; 212 dx += LOS_X0;
198 dy += LOS_Y0; 213 dy += LOS_Y0;
223 238
224 MTH void link_skills (); 239 MTH void link_skills ();
225 MTH object *find_skill (shstr_cmp name) const; 240 MTH object *find_skill (shstr_cmp name) const;
226 241
227 bool save_pl (object_freezer &freezer); 242 bool save_pl (object_freezer &freezer);
228 MTH bool save_pl (const_utf8_string path); 243 MTH bool save_pl (const_octet_string path);
229 244
230 void do_destroy (); 245 void do_destroy ();
231 void gather_callbacks (AV *&callbacks, event_type event) const; 246 void gather_callbacks (AV *&callbacks, event_type event) const;
232 247
233 MTH dynbuf_text *expand_cfpod (const_utf8_string cfpod) const; 248 MTH dynbuf_text *expand_cfpod (const_utf8_string cfpod) const;
272 MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK); 287 MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK);
273 288
274 // a prominent box that signifies some error such as a failed 289 // a prominent box that signifies some error such as a failed
275 // improvement potion. should not be long. 290 // improvement potion. should not be long.
276 MTH void failmsg (const_utf8_string msg, int color = NDI_RED); 291 MTH void failmsg (const_utf8_string msg, int color = NDI_RED);
292 void failmsgf (const_utf8_string format, ...); // always NDI_RED
277 293
278 MTH void update_spells () const 294 MTH void update_spells () const
279 { 295 {
280 if (ns) 296 if (ns)
281 ns->update_spells = true; 297 ns->update_spells = true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines