Ejemplo n.º 1
0
void
curse(register struct obj *otmp)
{
#ifdef GOLDOBJ
    if (otmp->oclass == COIN_CLASS) return;
#endif
    otmp->blessed = 0;
    otmp->cursed = 1;
    /* welded two-handed weapon interferes with some armor removal */
    if (otmp == uwep && bimanual(uwep)) reset_remarm();
    /* rules at top of wield.c state that twoweapon cannot be done
       with cursed alternate weapon */
    if (otmp == uswapwep && u.twoweap)
        drop_uswapwep();
    /* some cursed items need immediate updating */
    if (carried(otmp) && confers_luck(otmp))
        set_moreluck();
    else if (otmp->otyp == BAG_OF_HOLDING)
        otmp->owt = weight(otmp);
    else if (otmp->otyp == FIGURINE) {
        if (otmp->corpsenm != NON_PM
                && !dead_species(otmp->corpsenm,TRUE)
                && (carried(otmp) || mcarried(otmp)))
            attach_fig_transform_timeout(otmp);
    }
    return;
}
Ejemplo n.º 2
0
int dowield(struct obj *wep)
{
	struct obj *oldwep;
	int result;

	/* May we attempt this? */
	multi = 0;
	if (cantwield(youmonst.data)) {
		pline("Don't be ridiculous!");
		return 0;
	}

	/* Prompt for a new weapon */
	if (wep && !validate_object(wep, wield_objs, "wield"))
		return 0;
	else if (!wep)
		wep = getobj(wield_objs, "wield");
	if (!wep)
		/* Cancelled */
		return 0;
	else if (wep == uwep) {
	    pline("You are already wielding that!");
	    if (is_weptool(wep)) unweapon = FALSE;	/* [see setuwep()] */
		return 0;
	} else if (welded(uwep)) {
		weldmsg(uwep);
		/* previously interrupted armor removal mustn't be resumed */
		reset_remarm();
		return 0;
	}

	/* Handle no object, or object in other slot */
	if (wep == &zeroobj)
		wep = NULL;
	else if (wep == uswapwep)
		return doswapweapon();
	else if (wep == uquiver)
		setuqwep(NULL);
	else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL
			| W_SADDLE)) {
		pline("You cannot wield that!");
		return 0;
	}

	/* Set your new primary weapon */
	oldwep = uwep;
	result = ready_weapon(wep);
	if (flags.pushweapon && oldwep && uwep != oldwep)
		setuswapwep(oldwep);
	untwoweapon();

	return result;
}
Ejemplo n.º 3
0
/* If you have moved since initially setting some occupations, they
 * now shouldn't be able to restart.
 *
 * The basic rule is that if you are carrying it, you can continue
 * since it is with you.  If you are acting on something at a distance,
 * your orientation to it must have changed when you moved.
 *
 * The exception to this is taking off items, since they can be taken
 * off in a number of ways in the intervening time, screwing up ordering.
 *
 *	Currently:	Take off all armor.
 *			Picking Locks / Forcing Chests.
 */
void
reset_occupations() {

	reset_remarm();
	reset_pick();
}