… | |
… | |
308 | object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different |
308 | object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different |
309 | client_container *seen_by; // seen by which player/container currently? |
309 | client_container *seen_by; // seen by which player/container currently? |
310 | key_value *key_values; /* Fields not explictly known by the loader. */ |
310 | key_value *key_values; /* Fields not explictly known by the loader. */ |
311 | |
311 | |
312 | // privates / perl |
312 | // privates / perl |
313 | const shstr &kv_get (const shstr &key) const; |
313 | shstr_tmp kv_get (shstr_tmp key) const; |
314 | void kv_del (const shstr &key); |
314 | void kv_del (shstr_tmp key); |
315 | void kv_set (const shstr &key, const shstr &value); |
315 | void kv_set (shstr_tmp key, shstr_tmp value); |
316 | |
316 | |
317 | // custom extra fields management |
317 | // custom extra fields management |
318 | struct key_value_access_proxy |
318 | struct key_value_access_proxy |
319 | { |
319 | { |
320 | object &ob; |
320 | object &ob; |
321 | shstr key; |
321 | shstr_tmp key; |
322 | |
322 | |
323 | key_value_access_proxy (object &ob, const shstr &key) |
323 | key_value_access_proxy (object &ob, shstr_tmp key) |
324 | : ob (ob), key (key) |
324 | : ob (ob), key (key) |
325 | { |
325 | { |
326 | } |
326 | } |
327 | |
327 | |
328 | const key_value_access_proxy &operator =(const shstr &value) const |
328 | const key_value_access_proxy &operator =(shstr_tmp value) const |
329 | { |
329 | { |
330 | ob.kv_set (key, value); |
330 | ob.kv_set (key, value); |
331 | return *this; |
331 | return *this; |
332 | } |
332 | } |
333 | |
333 | |
334 | operator const shstr &() const { return ob.kv_get (key); } |
334 | operator const shstr_tmp () const { return ob.kv_get (key); } |
335 | operator const char *() const { return ob.kv_get (key); } |
335 | operator const char *() const { return ob.kv_get (key); } |
336 | |
336 | |
337 | private: |
337 | private: |
338 | void operator =(int); |
338 | void operator =(int); |
339 | }; |
339 | }; |
340 | |
340 | |
341 | // operator [] is too annoying to use |
341 | // operator [] is too annoying to use |
342 | const key_value_access_proxy kv (const shstr &key) |
342 | const key_value_access_proxy kv (shstr_tmp key) |
343 | { |
343 | { |
344 | return key_value_access_proxy (*this, key); |
344 | return key_value_access_proxy (*this, key); |
345 | } |
345 | } |
346 | |
346 | |
347 | bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all |
347 | bool parse_kv (object_thawer &f); // parse kv pairs, (ab-)used by archetypes, which should not exist at all |
… | |
… | |
412 | MTH void close_container () |
412 | MTH void close_container () |
413 | { |
413 | { |
414 | open_container (0); |
414 | open_container (0); |
415 | } |
415 | } |
416 | |
416 | |
417 | MTH object *force_find (const shstr name); |
417 | MTH object *force_find (shstr_tmp name); |
418 | MTH object *force_add (const shstr name, int duration = 0); |
418 | MTH object *force_add (shstr_tmp name, int duration = 0); |
419 | |
419 | |
420 | // overwrite the attachable should_invoke function with a version that also checks ev_want_type |
420 | // overwrite the attachable should_invoke function with a version that also checks ev_want_type |
421 | bool should_invoke (event_type event) |
421 | bool should_invoke (event_type event) |
422 | { |
422 | { |
423 | return ev_want_event [event] || ev_want_type [type] || cb; |
423 | return ev_want_event [event] || ev_want_type [type] || cb; |
… | |
… | |
556 | MTH bool affects_los () const |
556 | MTH bool affects_los () const |
557 | { |
557 | { |
558 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
558 | return glow_radius || flag [FLAG_BLOCKSVIEW]; |
559 | } |
559 | } |
560 | |
560 | |
|
|
561 | MTH bool has_carried_lights () const |
|
|
562 | { |
|
|
563 | return glow_radius; |
|
|
564 | } |
|
|
565 | |
561 | // returns the player that cna see this object, if any |
566 | // returns the player that cna see this object, if any |
562 | MTH object *visible_to () const; |
567 | MTH object *visible_to () const; |
563 | |
568 | |
564 | MTH std::string long_desc (object *who = 0); |
569 | MTH std::string long_desc (object *who = 0); |
565 | MTH std::string describe_monster (object *who = 0); |
570 | MTH std::string describe_monster (object *who = 0); |
… | |
… | |
705 | struct oblnk *link; |
710 | struct oblnk *link; |
706 | sint32 value; /* Used as connected value in buttons/gates */ |
711 | sint32 value; /* Used as connected value in buttons/gates */ |
707 | struct oblinkpt *next; |
712 | struct oblinkpt *next; |
708 | } oblinkpt; |
713 | } oblinkpt; |
709 | |
714 | |
710 | object *find_skill_by_name (object *who, const char *name); |
715 | object *find_skill_by_name_fuzzy (object *who, const char *name); |
711 | object *find_skill_by_name (object *who, const shstr &sh); |
716 | object *find_skill_by_name (object *who, shstr_cmp sh); |
712 | object *find_skill_by_number (object *who, int skillno); |
717 | object *find_skill_by_number (object *who, int skillno); |
713 | |
718 | |
714 | /* |
719 | /* |
715 | * The archetype structure is a set of rules on how to generate and manipulate |
720 | * The archetype structure is a set of rules on how to generate and manipulate |
716 | * objects which point to archetypes. |
721 | * objects which point to archetypes. |