… | |
… | |
449 | owner = owner->owner; |
449 | owner = owner->owner; |
450 | |
450 | |
451 | this->owner = owner; |
451 | this->owner = owner; |
452 | } |
452 | } |
453 | |
453 | |
|
|
454 | void |
|
|
455 | object::set_weapon (object *ob) |
|
|
456 | { |
|
|
457 | if (current_weapon == ob) |
|
|
458 | return; |
|
|
459 | |
|
|
460 | current_weapon = ob; |
|
|
461 | new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); |
|
|
462 | update_stats (); |
|
|
463 | } |
|
|
464 | |
454 | /* Zero the key_values on op, decrementing the shared-string |
465 | /* Zero the key_values on op, decrementing the shared-string |
455 | * refcounts and freeing the links. |
466 | * refcounts and freeing the links. |
456 | */ |
467 | */ |
457 | static void |
468 | static void |
458 | free_key_values (object *op) |
469 | free_key_values (object *op) |
… | |
… | |
538 | * need for monsters, but doesn't hurt to do it for everything. |
549 | * need for monsters, but doesn't hurt to do it for everything. |
539 | * by doing so, when a monster is created, it has good starting |
550 | * by doing so, when a monster is created, it has good starting |
540 | * values for the body_used info, so when items are created |
551 | * values for the body_used info, so when items are created |
541 | * for it, they can be properly equipped. |
552 | * for it, they can be properly equipped. |
542 | */ |
553 | */ |
543 | memcpy (body_used, body_info, sizeof (body_used)); |
554 | for (int i = NUM_BODY_LOCATIONS; i--; ) |
|
|
555 | slot[i].used = slot[i].info; |
544 | |
556 | |
545 | attachable::instantiate (); |
557 | attachable::instantiate (); |
546 | } |
558 | } |
547 | |
559 | |
548 | object * |
560 | object * |
… | |
… | |
2584 | } |
2596 | } |
2585 | |
2597 | |
2586 | const char * |
2598 | const char * |
2587 | object::debug_desc () const |
2599 | object::debug_desc () const |
2588 | { |
2600 | { |
2589 | static char info[256 * 4]; |
2601 | static char info[3][256 * 4]; |
|
|
2602 | static int info_idx; |
|
|
2603 | |
2590 | return debug_desc (info); |
2604 | return debug_desc (info [++info_idx % 3]); |
2591 | } |
|
|
2592 | |
|
|
2593 | const char * |
|
|
2594 | object::debug_desc2 () const |
|
|
2595 | { |
|
|
2596 | static char info[256 * 4]; |
|
|
2597 | return debug_desc (info); |
|
|
2598 | } |
2605 | } |
2599 | |
2606 | |
2600 | struct region * |
2607 | struct region * |
2601 | object::region () const |
2608 | object::region () const |
2602 | { |
2609 | { |