]> granicus.if.org Git - nethack/commitdiff
life-saved, while helpless
authorPatR <rankin@nethack.org>
Mon, 4 Apr 2022 17:20:28 +0000 (10:20 -0700)
committerPatR <rankin@nethack.org>
Mon, 4 Apr 2022 17:20:28 +0000 (10:20 -0700)
Implement the suggestion by entrez to avoid "while helpless" in the
reason for the second death if hero gets killed, life-saved, and
killed again at the same time.  Life saving sets 'multi' to -1 which
prevents the hero from moving again until next turn and is intended
to make the sequencing of "you survived that attempt on your life"
work if you're being interrupted during some multi-turn activity.

It used to behave differently when the first death occurred while
engaged in some voluntary multi-turn activity.  I've removed that
because I couldn't figure out why; it might need to be put back.

doc/fixes3-7-0.txt
src/end.c

index 202f54b57d12c0b0d69a5505ecc12834ff5c4360..68d66f96c3e44d4e8fa361e9aa48d3734dd1c0c9 100644 (file)
@@ -864,6 +864,8 @@ be more flexible when wishing checks for artifact name matches; now allows
 exclude unique monsters from pacification when untrapped from web
 ask to kick a door open, if it's locked and you don't have unlocking tool
 give a message when stinking cloud is created on top of hero
+when being life-saved prevents the hero from moving again during current turn,
+       avoid logfile annotation "while helpless" if hero dies a second time
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 6c928dd619d0c543389e9275caf603fd3ea919f7..7cc61559fb1d752ba57da8966cfd3553c3de43d3 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -924,10 +924,15 @@ savelife(int how)
     }
     g.nomovemsg = "You survived that attempt on your life.";
     g.context.move = 0;
-    if (g.multi > 0)
-        g.multi = 0;
-    else
-        g.multi = -1;
+
+    g.multi = -1; /* can't move again during the current turn */
+    /* in case being life-saved is immediately followed by being killed
+       again (perhaps due to zap rebound); this text will be appended to
+          "killed by <something>, while "
+       in high scores entry, if any, and in logfile (but not on tombstone) */
+    g.multi_reason = Role_if(PM_TOURIST) ? "being toyed with by Fate"
+                                         : "attempting to cheat Death";
+
     if (u.utrap && u.utraptype == TT_LAVA)
         reset_utrap(FALSE);
     g.context.botl = TRUE;