… | |
… | |
136 | { |
136 | { |
137 | signed char info:4; /* body info as loaded from the file */ |
137 | signed char info:4; /* body info as loaded from the file */ |
138 | signed char used:4; /* Calculated value based on items equipped */ |
138 | signed char used:4; /* Calculated value based on items equipped */ |
139 | }; |
139 | }; |
140 | |
140 | |
|
|
141 | typedef struct oblnk |
|
|
142 | { /* Used to link together several objects */ |
|
|
143 | object_ptr ob; |
|
|
144 | struct oblnk *next; |
|
|
145 | } objectlink; |
|
|
146 | |
|
|
147 | typedef struct oblinkpt |
|
|
148 | { /* Used to link together several object links */ |
|
|
149 | struct oblnk *link; |
|
|
150 | struct oblinkpt *next; |
|
|
151 | shstr id; /* Used as connected value in buttons/gates */ |
|
|
152 | } oblinkpt; |
|
|
153 | |
141 | INTERFACE_CLASS (object) |
154 | INTERFACE_CLASS (object) |
142 | // these are being copied |
155 | // these are being copied |
143 | struct object_copy : attachable |
156 | struct object_copy : attachable |
144 | { |
157 | { |
145 | sint16 ACC (RW, x), ACC (RW, y); /* Position in the map for this object */ |
158 | sint16 ACC (RW, x), ACC (RW, y); /* Position in the map for this object */ |
… | |
… | |
323 | key_value_access_proxy (object &ob, shstr_tmp key) |
336 | key_value_access_proxy (object &ob, shstr_tmp key) |
324 | : ob (ob), key (key) |
337 | : ob (ob), key (key) |
325 | { |
338 | { |
326 | } |
339 | } |
327 | |
340 | |
328 | const key_value_access_proxy &operator =(const shstr_tmp &value) const |
341 | const key_value_access_proxy &operator =(shstr_tmp value) const |
329 | { |
342 | { |
330 | ob.kv_set (key, value); |
343 | ob.kv_set (key, value); |
331 | return *this; |
344 | return *this; |
332 | } |
345 | } |
333 | |
346 | |
… | |
… | |
414 | open_container (0); |
427 | open_container (0); |
415 | } |
428 | } |
416 | |
429 | |
417 | MTH object *force_find (shstr_tmp name); |
430 | MTH object *force_find (shstr_tmp name); |
418 | MTH object *force_add (shstr_tmp name, int duration = 0); |
431 | MTH object *force_add (shstr_tmp name, int duration = 0); |
|
|
432 | |
|
|
433 | oblinkpt *find_link () const; |
|
|
434 | MTH void add_link (maptile *map, shstr_tmp id); |
|
|
435 | MTH void remove_link (); |
419 | |
436 | |
420 | // overwrite the attachable should_invoke function with a version that also checks ev_want_type |
437 | // overwrite the attachable should_invoke function with a version that also checks ev_want_type |
421 | bool should_invoke (event_type event) |
438 | bool should_invoke (event_type event) |
422 | { |
439 | { |
423 | return ev_want_event [event] || ev_want_type [type] || cb; |
440 | return ev_want_event [event] || ev_want_type [type] || cb; |
… | |
… | |
556 | MTH bool affects_los () const |
573 | MTH bool affects_los () const |
557 | { |
574 | { |
558 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
575 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
559 | } |
576 | } |
560 | |
577 | |
|
|
578 | MTH bool has_carried_lights () const |
|
|
579 | { |
|
|
580 | return glow_radius; |
|
|
581 | } |
|
|
582 | |
561 | // returns the player that cna see this object, if any |
583 | // returns the player that cna see this object, if any |
562 | MTH object *visible_to () const; |
584 | MTH object *visible_to () const; |
563 | |
585 | |
564 | MTH std::string long_desc (object *who = 0); |
586 | MTH std::string long_desc (object *who = 0); |
565 | MTH std::string describe_monster (object *who = 0); |
587 | MTH std::string describe_monster (object *who = 0); |
… | |
… | |
692 | } |
714 | } |
693 | |
715 | |
694 | return ob; |
716 | return ob; |
695 | } |
717 | } |
696 | |
718 | |
697 | typedef struct oblnk |
|
|
698 | { /* Used to link together several objects */ |
|
|
699 | object_ptr ob; |
|
|
700 | struct oblnk *next; |
|
|
701 | } objectlink; |
|
|
702 | |
|
|
703 | typedef struct oblinkpt |
|
|
704 | { /* Used to link together several object links */ |
|
|
705 | struct oblnk *link; |
|
|
706 | sint32 value; /* Used as connected value in buttons/gates */ |
|
|
707 | struct oblinkpt *next; |
|
|
708 | } oblinkpt; |
|
|
709 | |
|
|
710 | object *find_skill_by_name (object *who, const char *name); |
719 | object *find_skill_by_name_fuzzy (object *who, const char *name); |
711 | object *find_skill_by_name (object *who, shstr_tmp sh); |
720 | object *find_skill_by_name (object *who, shstr_cmp sh); |
712 | object *find_skill_by_number (object *who, int skillno); |
721 | object *find_skill_by_number (object *who, int skillno); |
713 | |
722 | |
714 | /* |
723 | /* |
715 | * The archetype structure is a set of rules on how to generate and manipulate |
724 | * The archetype structure is a set of rules on how to generate and manipulate |
716 | * objects which point to archetypes. |
725 | * objects which point to archetypes. |