… | |
… | |
32 | |
32 | |
33 | //+GPL |
33 | //+GPL |
34 | |
34 | |
35 | typedef int tag_t; |
35 | typedef int tag_t; |
36 | |
36 | |
|
|
37 | // also see common/item.C |
37 | enum { |
38 | enum { |
38 | body_skill, |
39 | body_skill, |
39 | body_combat, |
40 | body_combat, |
40 | body_range, |
41 | body_range, |
41 | body_shield, |
42 | body_shield, |
… | |
… | |
50 | body_wrist, |
51 | body_wrist, |
51 | body_waist, |
52 | body_waist, |
52 | NUM_BODY_LOCATIONS |
53 | NUM_BODY_LOCATIONS |
53 | }; |
54 | }; |
54 | |
55 | |
55 | enum slottype_t |
|
|
56 | { |
|
|
57 | slot_none, |
|
|
58 | slot_combat, |
|
|
59 | slot_ranged, |
|
|
60 | }; |
|
|
61 | |
|
|
62 | /* See common/item.c */ |
56 | /* See common/item.c */ |
63 | |
57 | |
64 | typedef struct Body_Locations |
58 | typedef struct Body_Locations |
65 | { |
59 | { |
66 | keyword save_name; /* Name used to load/save it to disk */ |
60 | keyword save_name; /* Name used to load/save it to disk */ |
… | |
… | |
289 | |
283 | |
290 | const_utf8_string query_weight (const object *op); |
284 | const_utf8_string query_weight (const object *op); |
291 | const_utf8_string query_short_name (const object *op); |
285 | const_utf8_string query_short_name (const object *op); |
292 | const_utf8_string query_name (const object *op); |
286 | const_utf8_string query_name (const object *op); |
293 | const_utf8_string query_base_name (const object *op, int plural); |
287 | const_utf8_string query_base_name (const object *op, int plural); |
|
|
288 | sint64 query_cost (const object *tmp, object *who, int flag); |
|
|
289 | const char *query_cost_string (const object *tmp, object *who, int flag); |
|
|
290 | |
|
|
291 | int change_ability_duration (object *spell, object *caster); |
|
|
292 | int min_casting_level (object *caster, object *spell); |
|
|
293 | int casting_level (object *caster, object *spell); |
|
|
294 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
|
|
295 | int SP_level_dam_adjust (object *caster, object *spob); |
|
|
296 | int SP_level_duration_adjust (object *caster, object *spob); |
|
|
297 | int SP_level_range_adjust (object *caster, object *spob); |
294 | |
298 | |
295 | struct object : zero_initialised, object_copy |
299 | struct object : zero_initialised, object_copy |
296 | { |
300 | { |
297 | // These variables are not changed by ->copy_to |
301 | // These variables are not changed by ->copy_to |
298 | maptile *ACC (RW, map); /* Pointer to the map in which this object is present */ |
302 | maptile *ACC (RW, map); /* Pointer to the map in which this object is present */ |
… | |
… | |
360 | bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all |
364 | bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all |
361 | MTH void post_load_check (); // do some adjustments after parsing |
365 | MTH void post_load_check (); // do some adjustments after parsing |
362 | static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. |
366 | static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. |
363 | bool write (object_freezer &f); |
367 | bool write (object_freezer &f); |
364 | |
368 | |
365 | MTH int slottype () const; |
|
|
366 | MTH static object *create (); |
369 | MTH static object *create (); |
367 | const mapxy &operator =(const mapxy &pos); |
370 | const mapxy &operator =(const mapxy &pos); |
368 | MTH void copy_to (object *dst); |
371 | MTH void copy_to (object *dst); |
369 | MTH object *clone (); // create + copy_to a single object |
372 | MTH object *clone (); // create + copy_to a single object |
370 | MTH object *deep_clone (); // copy whole more chain and inventory |
373 | MTH object *deep_clone (); // copy whole more chain and inventory |
… | |
… | |
429 | } |
432 | } |
430 | |
433 | |
431 | MTH void set_owner (object *owner); |
434 | MTH void set_owner (object *owner); |
432 | MTH void set_speed (float speed); |
435 | MTH void set_speed (float speed); |
433 | MTH void set_glow_radius (sint8 rad); |
436 | MTH void set_glow_radius (sint8 rad); |
434 | MTH bool change_weapon (object *ob); |
|
|
435 | MTH bool change_skill (object *ob); |
437 | MTH bool change_skill (object *ob); // deprecated? |
436 | |
438 | |
437 | MTH void open_container (object *new_container); |
439 | MTH void open_container (object *new_container); |
438 | MTH void close_container () |
440 | MTH void close_container () |
439 | { |
441 | { |
440 | open_container (0); |
442 | open_container (0); |
… | |
… | |
611 | MTH bool is_player () const |
613 | MTH bool is_player () const |
612 | { |
614 | { |
613 | return !!contr; |
615 | return !!contr; |
614 | } |
616 | } |
615 | |
617 | |
|
|
618 | /* elmex: this method checks whether the object is in a shop */ |
|
|
619 | MTH bool is_in_shop () const; |
|
|
620 | |
616 | MTH bool affects_los () const |
621 | MTH bool affects_los () const |
617 | { |
622 | { |
618 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
623 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
619 | } |
624 | } |
620 | |
625 | |
… | |
… | |
660 | MTH void set_flag_inv (int flag, int value = 1); |
665 | MTH void set_flag_inv (int flag, int value = 1); |
661 | |
666 | |
662 | void enter_exit (object *exit);//Perl |
667 | void enter_exit (object *exit);//Perl |
663 | MTH void enter_map (maptile *newmap, int x, int y); |
668 | MTH void enter_map (maptile *newmap, int x, int y); |
664 | void player_goto (const_utf8_string path, int x, int y); // only for players |
669 | void player_goto (const_utf8_string path, int x, int y); // only for players |
|
|
670 | MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 |
665 | |
671 | |
666 | // returns the mapspace this object is in |
672 | // returns the mapspace this object is in |
667 | mapspace &ms () const; |
673 | mapspace &ms () const; |
668 | |
674 | |
669 | // fully recursive iterator |
675 | // fully recursive iterator |