]> granicus.if.org Git - nethack/commitdiff
Demonbane changes
authorPasi Kallinen <paxed@alt.org>
Tue, 19 Jul 2022 18:23:23 +0000 (21:23 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 19 Jul 2022 18:23:26 +0000 (21:23 +0300)
Demonbane is now a mace, the first sac gift for priests,
and gets an invoke ability to banish demons.

doc/fixes3-7-0.txt
include/artifact.h
include/artilist.h
include/extern.h
src/artifact.c
src/mon.c

index 5c32f0b1b869e46923dbdb0967844912046229ef..3fcb7fd55b28bea36c02c5d5865ecd7630f0c9b1 100644 (file)
@@ -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
index b91e3602eeef7a6b39ff1ed08f474be587ea7678..3085c6eb5ab8eb5bfbcd34f3b19dd068c1b5d8a5 100644 (file)
@@ -63,7 +63,8 @@ enum invoke_prop_types {
     LEV_TELE,
     CREATE_PORTAL,
     ENLIGHTENING,
-    CREATE_AMMO
+    CREATE_AMMO,
+    BANISH
 };
 
 /* clang-format on */
index b3b756d669429912ddeb84a5d3e7b9976e526754..71c26ecf89cd7a3e3e957579eca55729cb23d6ee 100644 (file)
@@ -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,
index 7d76b0af7f2b6bac0961472aa2990c890005be92..2bc42fb699fb3a79ca27571fe6e747218db05863 100644 (file)
@@ -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);
index aab7a288c766670c4bb38b31bf74d919e189bbcd..657ff8ce898221ad647e714ea2d658ad17c460d5 100644 (file)
@@ -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),
index d7f6e9c8b8459dc05310fb3965e4d39e3b8b7bd6..0ba0da2d0b517a033542a2fa99a755ca1b26a3be 100644 (file)
--- 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 */