Exemplo n.º 1
0
/* An object you're wearing has been taken off by a monster (theft or
   seduction).  Also used if a worn item gets transformed (stone to flesh). */
void
remove_worn_item(struct obj *obj, boolean unchain_ball)
{       /* whether to unpunish or just unwield */
    if (donning(obj))
        cancel_don();
    if (!obj->owornmask)
        return;

    if (obj->owornmask & W_ARMOR) {
        if (obj == uskin) {
            impossible("Removing embedded scales?");
            skinback(TRUE);     /* uarm = uskin; uskin = 0; */
        }
        if (obj == uarm)
            Armor_off();
        else if (obj == uarmc)
            Cloak_off();
        else if (obj == uarmf)
            Boots_off();
        else if (obj == uarmg)
            Gloves_off();
        else if (obj == uarmh)
            Helmet_off();
        else if (obj == uarms)
            Shield_off();
        else if (obj == uarmu)
            Shirt_off();
        /* catchall -- should never happen */
        else
            setworn(NULL, obj->owornmask & W_ARMOR);
    } else if (obj->owornmask & W_AMUL) {
        Amulet_off();
    } else if (obj->owornmask & W_RING) {
        Ring_gone(obj);
    } else if (obj->owornmask & W_TOOL) {
        Blindf_off(obj);
    } else if (obj->owornmask & (W_WEP | W_SWAPWEP | W_QUIVER)) {
        if (obj == uwep)
            uwepgone();
        if (obj == uswapwep)
            uswapwepgone();
        if (obj == uquiver)
            uqwepgone();
    }

    if (obj->owornmask & (W_BALL | W_CHAIN)) {
        if (unchain_ball)
            unpunish();
    } else if (obj->owornmask) {
        /* catchall */
        setnotworn(obj);
    }
}
Exemplo n.º 2
0
/* An object you're wearing has been taken off by a monster (theft or
   seduction).  Also used if a worn item gets transformed (stone to flesh). */
void
remove_worn_item(struct obj *obj, boolean unchain_ball)
{       /* whether to unpunish or just unwield */
    if (!obj->owornmask)
        return;

    unwield_silently(obj);
    if (obj->owornmask & W_WORN) {
        if (obj == uskin()) {
            impossible("Removing embedded scales?");
        }
        setunequip(obj);
    }

    if (obj == uball || obj == uchain) {
        if (unchain_ball)
            unpunish();
    } else if (obj->owornmask) {
        /* This is a catchall for cases not considered above. It's used for
           uninvoking artifacts, but possibly not for anything else. */
        setnotworn(obj);
    }
}