ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/object.h
(Generate patch)

Comparing deliantra/server/include/object.h (file contents):
Revision 1.69 by root, Tue Dec 26 05:44:15 2006 UTC vs.
Revision 1.73 by root, Sat Dec 30 10:16:10 2006 UTC

267 && op1->name == op2->name 267 && op1->name == op2->name
268 && can_merge_slow (op1, op2); 268 && can_merge_slow (op1, op2);
269 } 269 }
270 270
271 MTH void set_owner (object *owner); 271 MTH void set_owner (object *owner);
272 MTH void set_speed (float speed);
272 273
273 MTH void instantiate () 274 MTH void instantiate ()
274 { 275 {
275 if (!uuid.seq) // HACK 276 if (!uuid.seq) // HACK
276 uuid = gen_uuid (); 277 uuid = gen_uuid ();
287 MTH void drain_stat (); 288 MTH void drain_stat ();
288 MTH void drain_specific_stat (int deplete_stats); 289 MTH void drain_specific_stat (int deplete_stats);
289 MTH void change_luck (int value); 290 MTH void change_luck (int value);
290 291
291 // info must hold 256 * 3 bytes currently 292 // info must hold 256 * 3 bytes currently
292 MTH const char *debug_desc (char *info) const; 293 const char *debug_desc (char *info) const;
293 MTH const char *debug_desc () const; 294 MTH const char *debug_desc () const;
294 295
295 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } 296 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; }
296 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET 297 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET
297 || type == CLOAK || type == BOOTS || type == GLOVES 298 || type == CLOAK || type == BOOTS || type == GLOVES
302 && !flag [FLAG_IS_A_TEMPLATE]; } 303 && !flag [FLAG_IS_A_TEMPLATE]; }
303 MTH bool is_arrow () const { return type == ARROW 304 MTH bool is_arrow () const { return type == ARROW
304 || (type == SPELL_EFFECT 305 || (type == SPELL_EFFECT
305 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } 306 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
306 307
308 // temporary: wether the objetc can be saved in a map file
309 // contr => is a player
310 // head => only save head of a multitile object
311 // owner => can not reference owner yet
312 MTH bool can_map_save () const { return !contr && !head && !owner; }
313
307 /* This return true if object has still randomitems which 314 /* This return true if object has still randomitems which
308 * could be expanded. 315 * could be expanded.
309 */ 316 */
310 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 317 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
311 318
316 if (op->type == PLAYER) 323 if (op->type == PLAYER)
317 return op; 324 return op;
318 325
319 return 0; 326 return 0;
320 } 327 }
328
329 // "temporary" helper function
330 MTH object *head_ ()
331 {
332 return head ? head : this;
333 }
334
335 // insert object at same map position as 'where'
336 // handles both inventory and map "positions"
337 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
338
339 MTH void activate (bool recursive = true);
340 MTH void deactivate (bool recursive = true);
341
342 void enter_exit (object *exit);//PERL
343 MTH void enter_map (maptile *newmap, int x, int y);
321 344
322 // returns the mapspace this object is in 345 // returns the mapspace this object is in
323 mapspace &ms () const; 346 mapspace &ms () const;
324 347
325 // fully recursive iterator 348 // fully recursive iterator

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines