Beispiel #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;
}
Beispiel #2
0
void unbless(struct obj *otmp)
{
	otmp->blessed = 0;
	if (carried(otmp) && confers_luck(otmp))
	    set_moreluck();
	else if (otmp->otyp == BAG_OF_HOLDING)
	    otmp->owt = weight(otmp);
}
Beispiel #3
0
void uncurse(struct obj *otmp)
{
	otmp->cursed = 0;
	if (carried(otmp) && confers_luck(otmp))
	    set_moreluck();
	else if (otmp->otyp == BAG_OF_HOLDING)
	    otmp->owt = weight(otmp);
	else if (otmp->otyp == FIGURINE && otmp->timed)
	    stop_timer(otmp->olev, FIG_TRANSFORM, otmp);
	return;
}
Beispiel #4
0
void bless(struct obj *otmp)
{
	if (otmp->oclass == COIN_CLASS) return;
	otmp->cursed = 0;
	otmp->blessed = 1;
	if (carried(otmp) && confers_luck(otmp))
	    set_moreluck();
	else if (otmp->otyp == BAG_OF_HOLDING)
	    otmp->owt = weight(otmp);
	else if (otmp->otyp == FIGURINE && otmp->timed)
		stop_timer(otmp->olev, FIG_TRANSFORM, otmp);
	return;
}
Beispiel #5
0
int stone_luck(bool parameter) {
    struct obj *otmp;
    long bonchance = 0;

    for (otmp = invent; otmp; otmp = otmp->nobj)
        if (confers_luck(otmp)) {
            if (otmp->cursed) bonchance -= otmp->quan;
            else if (otmp->blessed) bonchance += otmp->quan;
            else if (parameter) bonchance += otmp->quan;
        }

    return sgn((int)bonchance);
}
Beispiel #6
0
void
bless(register struct obj *otmp)
{
#ifdef GOLDOBJ
    if (otmp->oclass == COIN_CLASS) return;
#endif
    otmp->cursed = 0;
    otmp->blessed = 1;
    if (carried(otmp) && confers_luck(otmp))
        set_moreluck();
    else if (otmp->otyp == BAG_OF_HOLDING)
        otmp->owt = weight(otmp);
    else if (otmp->otyp == FIGURINE && otmp->timed)
        (void) stop_timer(FIG_TRANSFORM, (genericptr_t) otmp);
    return;
}