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; }
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); }
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; }
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; }
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); }
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; }