]> granicus.if.org Git - nethack/commitdiff
Change touch of death from instadeath to maxhp reduction and damage
authorPasi Kallinen <paxed@alt.org>
Tue, 18 May 2021 15:58:30 +0000 (18:58 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 18 May 2021 15:58:34 +0000 (18:58 +0300)
Touch of death will now do 50 + 8d6 damage, and drain max HP for half
of that. If the drain is equal or greater than your max HP, then it
will kill you instantly.

Change originally from SporkHack by Derek Ray.

doc/fixes37.0
include/extern.h
src/mcastu.c
src/uhitm.c

index 7956836bc8f21100ec7b319b1b315424fde24c28..3c82aaf5d0a5c45afe76a52b6589264ed7ea334c 100644 (file)
@@ -521,6 +521,7 @@ prediscovered weapons adjustmens:  only knights and samurai know polearms;
        of their race/species; likewise, rogues know all daggers
 if the move counter ever reaches 1000000000, end the game
 knights get no metal armor penalty for clerical spells
+change touch of death from instadeath to maxhp reduction and damage
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 230948f510f8d5558e8824775be71a18f0e3a441..5956b547d647e79489ddab363f5ff8906bc0f767 100644 (file)
@@ -1171,6 +1171,7 @@ extern boolean usmellmon(struct permonst *);
 /* ### mcastu.c ### */
 
 extern int castmu(struct monst *, struct attack *, boolean, boolean);
+extern void touch_of_death(void);
 extern int buzzmu(struct monst *, struct attack *);
 
 /* ### mdlib.c ### */
index 829a2dee1f99438cefb9aa1f5a333cc2cc623608..76a53fd2fe475be986780e8f3d320221d64bf41a 100644 (file)
@@ -346,6 +346,24 @@ m_cure_self(struct monst *mtmp, int dmg)
     return dmg;
 }
 
+void
+touch_of_death(void)
+{
+    int dmg = 50 + d(8, 6);
+    int drain = dmg / 2;
+
+    You_feel("drained...");
+
+    if (drain >= u.uhpmax) {
+        g.killer.format = KILLED_BY_AN;
+        Strcpy(g.killer.name, "touch of death");
+        done(DIED);
+    } else {
+        u.uhpmax -= drain;
+        losehp(dmg, "touch of death", KILLED_BY_AN);
+    }
+}
+
 /* monster wizard and cleric spellcasting functions */
 /*
    If dmg is zero, then the monster is not casting at you.
@@ -373,9 +391,7 @@ cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum)
             if (Hallucination) {
                 You("have an out of body experience.");
             } else {
-                g.killer.format = KILLED_BY_AN;
-                Strcpy(g.killer.name, "touch of death");
-                done(DIED);
+                touch_of_death();
             }
         } else {
             if (Antimagic) {
index b93796306c3fa5ab0c2d991397c24513c6b18999..36518c71fc15badca5329798c40aa61421b92b67 100644 (file)
@@ -3209,9 +3209,7 @@ mhitm_ad_deth(struct monst *magr, struct attack *mattk UNUSED,
         case 18:
         case 17:
             if (!Antimagic) {
-                g.killer.format = KILLED_BY_AN;
-                Strcpy(g.killer.name, "touch of death");
-                done(DIED);
+                touch_of_death();
                 mhm->damage = 0;
                 return;
             }