… | |
… | |
450 | owner = owner->owner; |
450 | owner = owner->owner; |
451 | |
451 | |
452 | this->owner = owner; |
452 | this->owner = owner; |
453 | } |
453 | } |
454 | |
454 | |
|
|
455 | int |
|
|
456 | object::slottype () const |
|
|
457 | { |
|
|
458 | if (type == SKILL) |
|
|
459 | { |
|
|
460 | if (IS_COMBAT_SKILL (subtype)) return slot_combat; |
|
|
461 | if (IS_RANGED_SKILL (subtype)) return slot_ranged; |
|
|
462 | } |
|
|
463 | else |
|
|
464 | { |
|
|
465 | if (slot [body_combat].info) return slot_combat; |
|
|
466 | if (slot [body_range ].info) return slot_ranged; |
|
|
467 | } |
|
|
468 | |
|
|
469 | return slot_none; |
|
|
470 | } |
|
|
471 | |
455 | bool |
472 | bool |
456 | object::change_weapon (object *ob) |
473 | object::change_weapon (object *ob) |
457 | { |
474 | { |
458 | if (current_weapon == ob) |
475 | if (current_weapon == ob) |
459 | return true; |
476 | return true; |
… | |
… | |
483 | "You try to balance your applied items all at once, but the %s is too much. " |
500 | "You try to balance your applied items all at once, but the %s is too much. " |
484 | "You need to unapply some items first.", &ob->name); |
501 | "You need to unapply some items first.", &ob->name); |
485 | return false; |
502 | return false; |
486 | } |
503 | } |
487 | |
504 | |
488 | new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); |
505 | //new_draw_info_format (NDI_UNIQUE, 0, this, "You switch to your %s.", &ob->name); |
489 | } |
506 | } |
490 | else |
507 | else |
491 | new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons."); |
508 | ;//new_draw_info_format (NDI_UNIQUE, 0, this, "You unwield your weapons."); |
|
|
509 | |
|
|
510 | if (ob && !ob->flag [FLAG_APPLIED] && ob->type != SPELL) |
|
|
511 | { |
|
|
512 | LOG (llevError | logBacktrace, "%s changed to unapplied weapon %s", |
|
|
513 | &name, ob->debug_desc ()); |
|
|
514 | return false; |
|
|
515 | } |
492 | |
516 | |
493 | return true; |
517 | return true; |
494 | } |
518 | } |
495 | |
519 | |
496 | /* Zero the key_values on op, decrementing the shared-string |
520 | /* Zero the key_values on op, decrementing the shared-string |
… | |
… | |
1641 | LOG (llevError, "Trying to put object in NULL.\n%s\n", dump); |
1665 | LOG (llevError, "Trying to put object in NULL.\n%s\n", dump); |
1642 | free (dump); |
1666 | free (dump); |
1643 | return op; |
1667 | return op; |
1644 | } |
1668 | } |
1645 | |
1669 | |
1646 | if (where->head) |
1670 | if (where->head_ () != where) |
1647 | { |
1671 | { |
1648 | LOG (llevDebug, "Warning: Tried to insert object into wrong part of multipart object.\n"); |
1672 | LOG (llevError | logBacktrace, "Warning: Tried to insert object into wrong part of multipart object.\n"); |
1649 | where = where->head; |
1673 | where = where->head; |
1650 | } |
1674 | } |
1651 | |
1675 | |
1652 | return where->insert (op); |
1676 | return where->insert (op); |
1653 | } |
1677 | } |
… | |
… | |
1981 | for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) |
2005 | for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) |
1982 | { |
2006 | { |
1983 | CLEAR_FLAG (tmp, flag); |
2007 | CLEAR_FLAG (tmp, flag); |
1984 | unflag_inv (tmp, flag); |
2008 | unflag_inv (tmp, flag); |
1985 | } |
2009 | } |
1986 | } |
|
|
1987 | |
|
|
1988 | /* |
|
|
1989 | * set_cheat(object) sets the cheat flag (WAS_WIZ) in the object and in |
|
|
1990 | * all it's inventory (recursively). |
|
|
1991 | * If checksums are used, a player will get set_cheat called for |
|
|
1992 | * him/her-self and all object carried by a call to this function. |
|
|
1993 | */ |
|
|
1994 | void |
|
|
1995 | set_cheat (object *op) |
|
|
1996 | { |
|
|
1997 | SET_FLAG (op, FLAG_WAS_WIZ); |
|
|
1998 | flag_inv (op, FLAG_WAS_WIZ); |
|
|
1999 | } |
2010 | } |
2000 | |
2011 | |
2001 | /* |
2012 | /* |
2002 | * find_free_spot(object, map, x, y, start, stop) will search for |
2013 | * find_free_spot(object, map, x, y, start, stop) will search for |
2003 | * a spot at the given map and coordinates which will be able to contain |
2014 | * a spot at the given map and coordinates which will be able to contain |