diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 8ff5c8116..4092c2326 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1135,7 +1135,6 @@ give feedback when some types of damage are avoided due to MC (aka negation) feedback if a named, shape-shifted vampire reverted to original shape rather than dying when engulfed could say "Dracula turns into Dracula" adjust archeologist and valkyrie starting intrinsics -once per game if receiving killing blow from near-full hp, leave 1 hp spell of knock can knock back small monsters protection from shape changers now prevents the Wizard from mimicking monsters having worn levitation boots removed and destroyed (scroll, monster spell, @@ -2675,6 +2674,14 @@ pyrolisk eggs explode when broken pauper-option to start the character with no possessions wand of secret door detection, spell of detect unseen, and wizard mode ^E now flash the cursor at each location where detection finds something +saving-grace: once per game if receiving a killing blow from full or nearly + full HP, survive with 1 HP +livelog/#chronicle for saving-grace: if saving-grace prevents hero's death, + report it [at present, it uses the livelog classification for breaking + a conduct] +enlightenment/attribute disclosure for saving-grace: include a line for have + or haven't been saved (game in progress) or did or didn't get saved + (game over) via saving-grace Platform- and/or Interface-Specific New Features diff --git a/src/hack.c b/src/hack.c index 1e249a68c..da9ea36f4 100644 --- a/src/hack.c +++ b/src/hack.c @@ -4045,6 +4045,15 @@ saving_grace(int dmg) } if (!u.usaving_grace && dmg >= u.uhp && (u.uhp * 100 / u.uhpmax) > 90) { + /* saving_grace doesn't have it's own livelog classification; + we might invent one, or perhaps use LL_LIFESAVE, but surviving + certain death (or preserving worn amulet of life saving) via + saving-grace feels like breaking a conduct; not sure how best + to phrase this though... */ + livelog_printf(LL_CONDUCT, "%s (%d damage, %d/%d HP)", + "survived one-shot death via saving-grave", + dmg, u.uhp, u.uhpmax); + /* note: this could reduce dmg to 0 if u.uhpmax==1 */ dmg = u.uhp - 1; u.usaving_grace = 1; /* used up */ diff --git a/src/insight.c b/src/insight.c index c1cb1a698..8faa2a375 100644 --- a/src/insight.c +++ b/src/insight.c @@ -1922,6 +1922,20 @@ attributes_enlightenment( } #endif + { + static const char *verbchoices[2][2] = { + { "might avoid", "have avoided" }, + { "could have avoided", "avoided" }, + }; + /* u.usaving_grace will always be 0 or 1; final is 0 (game in + progress), 1 (game over, survived), or 2 (game over, died) */ + const char *verb = verbchoices[!!final][u.usaving_grace]; + + /* 'verb' has already been set for present or past but enl_msg() + needs it twice, one for in progress, the other for game over */ + enl_msg(You_, verb, verb, " a one-shot death via saving-grace", ""); + } + { const char *p;