/* used so that callers don't need to known about SPFX_ codes */ boolean confers_luck(struct obj *obj) { /* might as well check for this too */ if (obj->otyp == LUCKSTONE) return TRUE; return obj->oartifact && spec_ability(obj, SPFX_LUCK); }
void rndcurse() /* curse a few inventory items at random! */ { int nobj = 0; int cnt, onum; struct obj *otmp; static const char *mal_aura = "feel a malignant aura surround %s."; if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) { You(mal_aura, "the magic-absorbing blade"); return; } if(Antimagic) { shieldeff(u.ux, u.uy); You(mal_aura, "you"); } for (otmp = invent; otmp; otmp = otmp->nobj) nobj++; if (nobj) for (cnt = rnd(6/((!!Antimagic) + (!!Half_spell_damage) + 1)); cnt > 0; cnt--) { onum = rn2(nobj); for(otmp = invent; onum != 0; onum--) otmp = otmp->nobj; if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && rn2(10) < 8) { pline("%s resists!", The(xname(otmp))); continue; } if(otmp->blessed) unbless(otmp); else curse(otmp); } }
void rndcurse() /* curse a few inventory items at random! */ { int nobj = 0; int cnt, onum; struct obj *otmp; static const char mal_aura[] = "VERB_SPUEREN eine bösartige Aura um OBJECT %s."; /* EN static const char mal_aura[] = "feel a malignant aura surround %s."; */ if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) { You(mal_aura, "ARTIKEL_BESTIMMTER ADJEKTIV_MAGIE_ABSORBIEREND NOUN_KLINGE"); /* EN You(mal_aura, "the magic-absorbing blade"); */ return; } if(Antimagic) { shieldeff(u.ux, u.uy); You(mal_aura, "PRONOMEN_PERSONAL"); /* EN You(mal_aura, "you"); */ } for (otmp = invent; otmp; otmp = otmp->nobj) { #ifdef GOLDOBJ /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; #endif nobj++; } if (nobj) { for (cnt = rnd(6/((!!Antimagic) + (!!Half_spell_damage) + 1)); cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { #ifdef GOLDOBJ /* as above */ if (otmp->oclass == COIN_CLASS) continue; #endif if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already cursed item happens--avoid "resists" message in that case */ if (!otmp || otmp->cursed) continue; /* next target */ if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && rn2(10) < 8) { pline("%s!", Tobjnam(otmp, "VERB_WIDERSTEHEN")); /* EN pline("%s!", Tobjnam(otmp, "resist")); */ continue; } if(otmp->blessed) unbless(otmp); else curse(otmp); } update_inventory(); } #ifdef STEED /* treat steed's saddle as extended part of hero's inventory */ if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 && !otmp->cursed) { /* skip if already cursed */ if (otmp->blessed) unbless(otmp); else curse(otmp); if (!Blind) { pline("SUBJECT %s %s %s.", /* EN pline("%s %s %s.", */ genitivattribut_zu_wort(y_monnam(u.usteed), /* EN s_suffix(upstart(y_monnam(u.usteed))), */ cxname(otmp)), "VERB_LEUCHTEN", /* EN aobjnam(otmp, "glow"), */ hcolor(otmp->cursed ? NH_BLACK : (const char *)"ADJEKTIV_FARBE_BRAUN")); /* EN hcolor(otmp->cursed ? NH_BLACK : (const char *)"brown")); */ otmp->bknown = TRUE; } } #endif /*STEED*/ }
void rndcurse() /* curse a few inventory items at random! */ { int nobj = 0; int cnt, onum; struct obj *otmp; static const char mal_aura[] = "feel a malignant aura surround %s."; if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) { You(mal_aura, "the magic-absorbing blade"); return; } if(Antimagic) { shieldeff(u.ux, u.uy); You(mal_aura, "you"); } for (otmp = invent; otmp; otmp = otmp->nobj) { #ifdef GOLDOBJ /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; #endif nobj++; } if (nobj) { for (cnt = rnd(6/((!!Antimagic) + (!!Half_spell_damage) + 1)); cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { #ifdef GOLDOBJ /* as above */ if (otmp->oclass == COIN_CLASS) continue; #endif if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already cursed item happens--avoid "resists" message in that case */ if (!otmp || otmp->cursed) continue; /* next target */ if(otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && rn2(10) < 8) { pline("%s!", Tobjnam(otmp, "resist")); continue; } if(otmp->blessed) unbless(otmp); else curse(otmp); } update_inventory(); } #ifdef STEED /* treat steed's saddle as extended part of hero's inventory */ if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 && !otmp->cursed) { /* skip if already cursed */ if (otmp->blessed) unbless(otmp); else curse(otmp); if (!Blind) { pline("%s %s %s.", s_suffix(upstart(y_monnam(u.usteed))), aobjnam(otmp, "glow"), hcolor(otmp->cursed ? NH_BLACK : (const char *)"brown")); otmp->bknown = TRUE; } } #endif /*STEED*/ }
/* curse a few inventory items at random! */ void rndcurse() { int nobj = 0; int cnt, onum; struct obj *otmp; /*JP static const char mal_aura[] = "feel a malignant aura surround %s."; */ static const char mal_aura[] = "邪悪なオーラを%sの回りに感じた."; if (uwep && (uwep->oartifact == ART_MAGICBANE) && rn2(20)) { /*JP You(mal_aura, "the magic-absorbing blade"); */ You(mal_aura, "魔力を吸いとる刀"); return; } if (Antimagic) { shieldeff(u.ux, u.uy); /*JP You(mal_aura, "you"); */ You(mal_aura, "あなた"); } for (otmp = invent; otmp; otmp = otmp->nobj) { /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; nobj++; } if (nobj) { for (cnt = rnd(6 / ((!!Antimagic) + (!!Half_spell_damage) + 1)); cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { /* as above */ if (otmp->oclass == COIN_CLASS) continue; if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already cursed item happens--avoid "resists" message in that case */ if (!otmp || otmp->cursed) continue; /* next target */ if (otmp->oartifact && spec_ability(otmp, SPFX_INTEL) && rn2(10) < 8) { /*JP pline("%s!", Tobjnam(otmp, "resist")); */ pline("%sは影響を受けない!", xname(otmp)); continue; } if (otmp->blessed) unbless(otmp); else curse(otmp); } update_inventory(); } /* treat steed's saddle as extended part of hero's inventory */ if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 && !otmp->cursed) { /* skip if already cursed */ if (otmp->blessed) unbless(otmp); else curse(otmp); if (!Blind) { #if 0 /*JP*/ pline("%s %s.", Yobjnam2(otmp, "glow"), hcolor(otmp->cursed ? NH_BLACK : (const char *) "brown")); #else pline("%sは%s輝いた.", xname(otmp), jconj_adj(hcolor(otmp->cursed ? NH_BLACK : (const char *)"茶色の"))); #endif otmp->bknown = TRUE; } } }
/* Function used when someone attacks someone else with an artifact * weapon. Only adds the special (artifact) damage, and returns a 1 if it * did something special (in which case the caller won't print the normal * hit message). This should be called once upon every artifact attack; * dmgval() no longer takes artifact bonuses into account. Possible * extension: change the killer so that when an orc kills you with * Stormbringer it's "killed by Stormbringer" instead of "killed by an orc". */ boolean artifact_hit( struct monst *magr, struct monst *mdef, struct obj *otmp, int *dmgptr, int dieroll /* needed for Magicbane and vorpal blades */ ) { boolean youattack = (magr == &youmonst); boolean youdefend = (mdef == &youmonst); boolean vis = (!youattack && magr && cansee(magr->mx, magr->my)) || (!youdefend && cansee(mdef->mx, mdef->my)) || (youattack && u.uswallow && mdef == u.ustuck && !Blind); boolean realizes_damage; char hittee[BUFSZ]; strcpy(hittee, youdefend ? "you" : mon_nam(mdef)); /* The following takes care of most of the damage, but not all-- * the exception being for level draining, which is specially * handled. Messages are done in this function, however. */ *dmgptr += spec_dbon(otmp, mdef, *dmgptr); if (youattack && youdefend) { impossible("attacking yourself with weapon?"); return FALSE; } realizes_damage = (youdefend || vis || /* feel the effect even if not seen */ (youattack && mdef == u.ustuck)); /* the four basic attacks: fire, cold, shock and missiles */ if (attacks(AD_FIRE, otmp)) { if (realizes_damage) pline("The fiery blade %s %s%c", !spec_dbon_applies ? "hits" : (mdef->data == &mons[PM_WATER_ELEMENTAL]) ? "vaporizes part of" : "burns", hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(4)) destroy_mitem(mdef, POTION_CLASS, AD_FIRE); if (!rn2(4)) destroy_mitem(mdef, SCROLL_CLASS, AD_FIRE); if (!rn2(7)) destroy_mitem(mdef, SPBOOK_CLASS, AD_FIRE); if (youdefend && Slimed) burn_away_slime(); return realizes_damage; } if (attacks(AD_COLD, otmp)) { if (realizes_damage) pline("The ice-cold blade %s %s%c", !spec_dbon_applies ? "hits" : "freezes", hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(4)) destroy_mitem(mdef, POTION_CLASS, AD_COLD); return realizes_damage; } if (attacks(AD_ELEC, otmp)) { if (realizes_damage) pline("The massive hammer hits%s %s%c", !spec_dbon_applies ? "" : "! Lightning strikes", hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(5)) destroy_mitem(mdef, RING_CLASS, AD_ELEC); if (!rn2(5)) destroy_mitem(mdef, WAND_CLASS, AD_ELEC); return realizes_damage; } if (attacks(AD_MAGM, otmp)) { if (realizes_damage) pline("The imaginary widget hits%s %s%c", !spec_dbon_applies ? "" : "! A hail of magic missiles strikes", hittee, !spec_dbon_applies ? '.' : '!'); return realizes_damage; } if (attacks(AD_STUN, otmp) && dieroll <= MB_MAX_DIEROLL) { /* Magicbane's special attacks (possibly modifies hittee[]) */ return magicbane_hit(magr, mdef, otmp, dmgptr, dieroll, vis, hittee); } if (!spec_dbon_applies) { /* since damage bonus didn't apply, nothing more to do; no further attacks have side-effects on inventory */ return FALSE; } /* Tsurugi of Muramasa, Vorpal Blade */ if (spec_ability(otmp, SPFX_BEHEAD)) return artifact_hit_behead(magr, mdef, otmp, dmgptr, dieroll); /* Stormbringer */ if (spec_ability(otmp, SPFX_DRLI)) return artifact_hit_drainlife(magr, mdef, otmp, dmgptr); return FALSE; }