From b1a5a9c3903a0282f82787d20fd70f13196e2465 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 19 Jul 2022 21:23:23 +0300 Subject: [PATCH] Demonbane changes Demonbane is now a mace, the first sac gift for priests, and gets an invoke ability to banish demons. --- doc/fixes3-7-0.txt | 2 ++ include/artifact.h | 3 ++- include/artilist.h | 4 ++-- include/extern.h | 1 + src/artifact.c | 29 +++++++++++++++++++++++++++++ src/mon.c | 3 +-- 6 files changed, 37 insertions(+), 5 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 5c32f0b1b..3fcb7fd55 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -972,6 +972,8 @@ moving with 'm' prefix allows hero to enter a known pit carefully rangers always succeed in disarming bear traps, unless impaired bigroom variant 2 may have ice floor in unlit areas some large monsters can knock back smaller monsters with a hit +change Demonbane to a mace, make it the first sac gift for priests, + and give it an invoke ability to banish demons Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/include/artifact.h b/include/artifact.h index b91e3602e..3085c6eb5 100644 --- a/include/artifact.h +++ b/include/artifact.h @@ -63,7 +63,8 @@ enum invoke_prop_types { LEV_TELE, CREATE_PORTAL, ENLIGHTENING, - CREATE_AMMO + CREATE_AMMO, + BANISH }; /* clang-format on */ diff --git a/include/artilist.h b/include/artilist.h index b3b756d66..71c26ecf8 100644 --- a/include/artilist.h +++ b/include/artilist.h @@ -126,8 +126,8 @@ static NEARDATA struct artifact artilist[] = { PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 500L, NO_COLOR, DRAGONBANE), - A("Demonbane", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON, - PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 2500L, + A("Demonbane", MACE, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON, + PHYS(5, 0), NO_DFNS, NO_CARY, BANISH, A_LAWFUL, PM_CLERIC, NON_PM, 2500L, NO_COLOR, DEMONBANE), A("Werebane", SILVER_SABER, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_WERE, diff --git a/include/extern.h b/include/extern.h index 7d76b0af7..2bc42fb69 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1550,6 +1550,7 @@ extern void killed(struct monst *); extern void xkilled(struct monst *, int); extern void mon_to_stone(struct monst *); extern void m_into_limbo(struct monst *); +extern void migrate_mon(struct monst *, coordxy, coordxy); extern void mnexto(struct monst *, unsigned); extern void maybe_mnexto(struct monst *); extern int mnearto(struct monst *, coordxy, coordxy, boolean, unsigned); diff --git a/src/artifact.c b/src/artifact.c index aab7a288c..657ff8ce8 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1831,6 +1831,35 @@ arti_invoke(struct obj *obj) nhUse(otmp); break; } + case BANISH: { + if (!Inhell) { + int nvanished = 0; + struct monst *mtmp, *mtmp2; + d_level dest; + + find_hell(&dest); + + for (mtmp = fmon; mtmp; mtmp = mtmp2) { + mtmp2 = mtmp->nmon; + if (DEADMONSTER(mtmp) || !isok(mtmp->mx, mtmp->my)) + continue; + if (!is_demon(mtmp->data) && mtmp->data->mlet != S_IMP) + continue; + if (!couldsee(mtmp->mx, mtmp->my)) + continue; + dest.dlevel = rn2(dunlevs_in_dungeon(&dest)); + mtmp->msleeping = mtmp->mtame = mtmp->mpeaceful = 0; + nvanished++; + migrate_mon(mtmp, ledger_no(&dest), MIGR_RANDOM); + } + + if (nvanished) + pline("The demon%s disappear%s in a cloud of brimstone!", + nvanished > 1 ? "s" : "", + nvanished > 1 ? "" : "s"); + } + break; + } } } else { long eprop = (u.uprops[oart->inv_prop].extrinsic ^= W_ARTI), diff --git a/src/mon.c b/src/mon.c index d7f6e9c8b..0ba0da2d0 100644 --- a/src/mon.c +++ b/src/mon.c @@ -19,7 +19,6 @@ static void mon_leaving_level(struct monst *); static void m_detach(struct monst *, struct permonst *); static void set_mon_min_mhpmax(struct monst *, int); static void lifesaved_monster(struct monst *); -static void migrate_mon(struct monst *, coordxy, coordxy); static boolean ok_to_obliterate(struct monst *); static void deal_with_overcrowding(struct monst *); static void m_restartcham(struct monst *); @@ -3296,7 +3295,7 @@ m_into_limbo(struct monst *mtmp) migrate_mon(mtmp, target_lev, xyloc); } -static void +void migrate_mon( struct monst *mtmp, xint16 target_lev, /* destination level */