From a29b06ac2fdf50cdb0d98ecde5e706fd0a2cbb2e Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 7 Dec 2006 05:27:18 +0000 Subject: [PATCH] spell of protection feedback From the newsgroup (subject: "3 xorn fixes"): casting spell of protection would report "the air around you begins to shimmer" even when you were embedded in rock or swallowed. It included a pointer to a patch; I looked at that but ended up not using it. --- doc/fixes34.4 | 1 + src/spell.c | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 33fce45da..deb91b9ab 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -285,6 +285,7 @@ suppress corpse from bones data if death is due to being dissolved in lava suppress "you rise from the dead" if game ends due to be turned into slime don't give erroneous " disppears" message for hero poly'd into quantum mechanic who hits engulfer while swallowed and blinded +feedback from casting spell of protection was wrong in some situations Platform- and/or Interface-Specific Fixes diff --git a/src/spell.c b/src/spell.c index ccef69891..150551cb4 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)spell.c 3.5 2006/07/08 */ +/* SCCS Id: @(#)spell.c 3.5 2006/12/06 */ /* Copyright (c) M. Stephenson 1988 */ /* NetHack may be freely redistributed. See license for details. */ @@ -704,16 +704,25 @@ cast_protection() if (gain > 0) { if (!Blind) { - const char *hgolden = hcolor(NH_GOLDEN); + int rmtyp; + const char *hgolden = hcolor(NH_GOLDEN), *atmosphere; - if (u.uspellprot) + if (u.uspellprot) { pline_The("%s haze around you becomes more dense.", hgolden); - else + } else { + rmtyp = levl[u.ux][u.uy].typ; + atmosphere = u.uswallow ? + ((u.ustuck->data == &mons[PM_FOG_CLOUD]) ? "mist" : + is_whirly(u.ustuck->data) ? "maelstrom" : + is_animal(u.ustuck->data) ? "maw" : "ooze") : + u.uinwater ? "water" : + (rmtyp == CLOUD) ? "cloud" : + IS_TREE(rmtyp) ? "vegitation" : + IS_STWALL(rmtyp) ? "stone" : "air"; pline_The("%s around you begins to shimmer with %s haze.", - /*[ what about being inside solid rock while polyd? ]*/ - (Underwater || Is_waterlevel(&u.uz)) ? "water" : "air", - an(hgolden)); + atmosphere, an(hgolden)); + } } u.uspellprot += gain; u.uspmtime = -- 2.40.0