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.135 by root, Sun Jul 1 05:00:18 2007 UTC vs.
Revision 1.145 by root, Sat Aug 25 22:19:26 2007 UTC

184 sint32 ACC (RW, carrying); /* How much weight this object contains */ 184 sint32 ACC (RW, carrying); /* How much weight this object contains */
185 sint64 ACC (RW, perm_exp); /* Permanent exp */ 185 sint64 ACC (RW, perm_exp); /* Permanent exp */
186 uint32 ACC (RW, weapontype); /* type of weapon */ 186 uint32 ACC (RW, weapontype); /* type of weapon */
187 uint32 ACC (RW, tooltype); /* type of tool or build facility */ 187 uint32 ACC (RW, tooltype); /* type of tool or build facility */
188 body_slot slot [NUM_BODY_LOCATIONS]; 188 body_slot slot [NUM_BODY_LOCATIONS];
189 faceidx ACC (RW, face); /* Face with colors */ 189 faceidx ACC (RW, face); /* the graphical face */
190 faceidx ACC (RW, sound); /* the sound face */
191 faceidx ACC (RW, sound_destroy); /* played on destroy */
190 living ACC (RO, stats); /* Str, Con, Dex, etc */ 192 living ACC (RO, stats); /* Str, Con, Dex, etc */
191 /* See the pod/objects.pod for more info about body locations */ 193 /* See the pod/objects.pod for more info about body locations */
192 194
193 /* Following mostly refers to fields only used for monsters */ 195 /* Following mostly refers to fields only used for monsters */
194 uint32 ACC (RW, hide); /* The object is hidden, not invisible */ 196 uint32 ACC (RW, hide); /* The object is hidden, not invisible */
248 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc. 250 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc.
249 int ACC (RO, count); 251 int ACC (RO, count);
250 object_vector_index ACC (RO, index); // index into objects 252 object_vector_index ACC (RO, index); // index into objects
251 object_vector_index ACC (RO, active); // index into actives 253 object_vector_index ACC (RO, active); // index into actives
252 254
253 player_ptr ACC (RW, contr); /* Pointer to the player which control this object */ 255 player_ptr ACC (RW, contr); /* Pointer to the player which control this object, ALWAYS set *iff* type == PLAYER */
254 256
255 object *ACC (RW, below); /* Pointer to the object stacked below this one */ 257 object *ACC (RW, below); /* Pointer to the object stacked below this one */
256 object *ACC (RW, above); /* Pointer to the object stacked above this one */ 258 object *ACC (RW, above); /* Pointer to the object stacked above this one */
257 /* Note: stacked in the *same* environment */ 259 /* Note: stacked in the *same* environment */
258 object *inv; /* Pointer to the first object in the inventory */ 260 object *inv; /* Pointer to the first object in the inventory */
284 MTH void destroy (bool destroy_inventory = false); 286 MTH void destroy (bool destroy_inventory = false);
285 287
286 // recursively destroy all objects in inventory, optionally dropping them to the ground instead 288 // recursively destroy all objects in inventory, optionally dropping them to the ground instead
287 MTH void destroy_inv (bool drop_to_ground = false); 289 MTH void destroy_inv (bool drop_to_ground = false);
288 MTH object *insert (object *item); // insert into inventory 290 MTH object *insert (object *item); // insert into inventory
291 MTH void play_sound (faceidx sound) const;
292
289 void do_remove (); 293 void do_remove ();
290 MTH void remove () 294 MTH void remove ()
291 { 295 {
292 if (!flag [FLAG_REMOVED]) 296 if (!flag [FLAG_REMOVED])
293 do_remove (); 297 do_remove ();
311 MTH void open_container (object *new_container); 315 MTH void open_container (object *new_container);
312 MTH void close_container () 316 MTH void close_container ()
313 { 317 {
314 open_container (0); 318 open_container (0);
315 } 319 }
320
321 MTH object *force_find (const shstr name);
322 MTH void force_add (const shstr name, int duration = 0);
316 323
317 // overwrite the attachable should_invoke function with a version that also checks ev_want_type 324 // overwrite the attachable should_invoke function with a version that also checks ev_want_type
318 bool should_invoke (event_type event) 325 bool should_invoke (event_type event)
319 { 326 {
320 return ev_want_event [event] || ev_want_type [type] || cb; 327 return ev_want_event [event] || ev_want_type [type] || cb;
376 383
377 // temporary: wether the object can be saved in a map file 384 // temporary: wether the object can be saved in a map file
378 // contr => is a player 385 // contr => is a player
379 // head => only save head of a multitile object 386 // head => only save head of a multitile object
380 // owner => can not reference owner yet 387 // owner => can not reference owner yet
381 MTH bool can_map_save () const { return !contr && !head && !owner && !flag [FLAG_NO_MAP_SAVE]; } 388 MTH bool can_map_save () const { return !head && (!owner || owner->contr) && !contr && !flag [FLAG_NO_MAP_SAVE]; }
382 389
383 /* This return true if object has still randomitems which 390 /* This return true if object has still randomitems which
384 * could be expanded. 391 * could be expanded.
385 */ 392 */
386 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 393 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
420 MTH void create_treasure (treasurelist *tl, int flags = 0); 427 MTH void create_treasure (treasurelist *tl, int flags = 0);
421 428
422 // insert object at same map position as 'where' 429 // insert object at same map position as 'where'
423 // handles both inventory and map "positions" 430 // handles both inventory and map "positions"
424 MTH object *insert_at (object *where, object *originator = 0, int flags = 0); 431 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
432 MTH void drop_unpaid_items ();
425 433
426 MTH void activate (); 434 MTH void activate ();
427 MTH void deactivate (); 435 MTH void deactivate ();
428 MTH void activate_recursive (); 436 MTH void activate_recursive ();
429 MTH void deactivate_recursive (); 437 MTH void deactivate_recursive ();
484 { 492 {
485 return !invisible && type != PLAYER; 493 return !invisible && type != PLAYER;
486 } 494 }
487 495
488 MTH struct region *region () const; 496 MTH struct region *region () const;
497
498 void statusmsg (const char *msg, int color = NDI_BLACK);
499 void failmsg (const char *msg, int color = NDI_RED);
489 500
490protected: 501protected:
491 void link (); 502 void link ();
492 void unlink (); 503 void unlink ();
493 504

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines