Adjust Demonbane invoke ability

Demon lords and princes have a chance to resist the effect.
Demons in quest when nemesis is alive have a very high chance
of resisting.
When invoked in Gehennom, teleports the demons within the same
level.
This commit is contained in:
Pasi Kallinen
2022-07-20 09:42:28 +03:00
parent b1a5a9c390
commit ced920df54
+26 -5
View File
@@ -1832,14 +1832,15 @@ arti_invoke(struct obj *obj)
break; break;
} }
case BANISH: { case BANISH: {
if (!Inhell) { int nvanished = 0, nstayed = 0;
int nvanished = 0;
struct monst *mtmp, *mtmp2; struct monst *mtmp, *mtmp2;
d_level dest; d_level dest;
find_hell(&dest); find_hell(&dest);
for (mtmp = fmon; mtmp; mtmp = mtmp2) { for (mtmp = fmon; mtmp; mtmp = mtmp2) {
int chance = 1;
mtmp2 = mtmp->nmon; mtmp2 = mtmp->nmon;
if (DEADMONSTER(mtmp) || !isok(mtmp->mx, mtmp->my)) if (DEADMONSTER(mtmp) || !isok(mtmp->mx, mtmp->my))
continue; continue;
@@ -1847,14 +1848,34 @@ arti_invoke(struct obj *obj)
continue; continue;
if (!couldsee(mtmp->mx, mtmp->my)) if (!couldsee(mtmp->mx, mtmp->my))
continue; continue;
dest.dlevel = rn2(dunlevs_in_dungeon(&dest)); if (mtmp->data->msound == MS_NEMESIS)
continue;
if (In_quest(&u.uz) && !g.quest_status.killed_nemesis)
chance += 10;
if (is_dprince(mtmp->data))
chance += 2;
if (is_dlord(mtmp->data))
chance++;
mtmp->msleeping = mtmp->mtame = mtmp->mpeaceful = 0; mtmp->msleeping = mtmp->mtame = mtmp->mpeaceful = 0;
if (chance <= 1 || !rn2(chance)) {
if (!Inhell) {
nvanished++; nvanished++;
/* banish to a random level in Gehennom */
dest.dlevel = rn2(dunlevs_in_dungeon(&dest));
migrate_mon(mtmp, ledger_no(&dest), MIGR_RANDOM); migrate_mon(mtmp, ledger_no(&dest), MIGR_RANDOM);
} else {
u_teleport_mon(mtmp, FALSE);
}
} else {
nstayed++;
}
} }
if (nvanished) if (nvanished) {
pline("The demon%s disappear%s in a cloud of brimstone!", pline("%she demon%s disappear%s in a cloud of brimstone!",
nstayed ? (nvanished > nstayed ? "Most of t" : "Some of t") : "T",
nvanished > 1 ? "s" : "", nvanished > 1 ? "s" : "",
nvanished > 1 ? "" : "s"); nvanished > 1 ? "" : "s");
} }