fix #H2633 - turning to stone or slime while limbless

Michael's fix got here first, but didn't catch the green slime case.
This commit is contained in:
nethack.rankin
2012-04-16 00:57:37 +00:00
parent 7d44b04e8c
commit 19945b31b0
2 changed files with 17 additions and 11 deletions
+1
View File
@@ -828,6 +828,7 @@ fix message given when part of a stack of items in a monster's inventory is
being destroyed being destroyed
add "Boing!" message when hero zaps resistant monster with striking/force bolt add "Boing!" message when hero zaps resistant monster with striking/force bolt
adjust gaze reflection message when your scales are embedded in your skin adjust gaze reflection message when your scales are embedded in your skin
adjust turning-to-stone or -slime messages when you have no limbs
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+15 -10
View File
@@ -26,13 +26,15 @@ static NEARDATA const char * const stoned_texts[] = {
STATIC_OVL void STATIC_OVL void
stoned_dialogue() stoned_dialogue()
{ {
char buf[BUFSZ];
register long i = (Stoned & TIMEOUT); register long i = (Stoned & TIMEOUT);
if (i > 0L && i <= SIZE(stoned_texts)) { if (i > 0L && i <= SIZE(stoned_texts)) {
char buf[BUFSZ];
Strcpy(buf, stoned_texts[SIZE(stoned_texts) - i]); Strcpy(buf, stoned_texts[SIZE(stoned_texts) - i]);
pline1(nolimbs(youmonst.data) ? if (nolimbs(youmonst.data) && strstri(buf, "limbs"))
strsubst(buf, "limbs", "extremities") : buf); (void) strsubst(buf, "limbs", "extremities");
pline1(buf);
} }
switch ((int) i) { switch ((int) i) {
case 5: /* slowing down */ case 5: /* slowing down */
@@ -149,18 +151,21 @@ slime_dialogue()
{ {
register long i = (Slimed & TIMEOUT) / 2L; register long i = (Slimed & TIMEOUT) / 2L;
if (((Slimed & TIMEOUT) % 2L) && i >= 0L if (((Slimed & TIMEOUT) % 2L) && i >= 0L && i < SIZE(slime_texts)) {
&& i < SIZE(slime_texts)) { char buf[BUFSZ];
const char *str = slime_texts[SIZE(slime_texts) - i - 1L];
if (index(str, '%')) { Strcpy(buf, slime_texts[SIZE(slime_texts) - i - 1L]);
if (nolimbs(youmonst.data) && strstri(buf, "limbs"))
(void) strsubst(buf, "limbs", "extremities");
if (index(buf, '%')) {
if (i == 4L) { /* "you are turning green" */ if (i == 4L) { /* "you are turning green" */
if (!Blind) /* [what if you're already green?] */ if (!Blind) /* [what if you're already green?] */
pline(str, hcolor(NH_GREEN)); pline(buf, hcolor(NH_GREEN));
} else } else
pline(str, an(Hallucination ? rndmonnam() : "green slime")); pline(buf, an(Hallucination ? rndmonnam() : "green slime"));
} else } else
pline1(str); pline1(buf);
} }
if (i == 3L) { /* limbs becoming oozy */ if (i == 3L) { /* limbs becoming oozy */
HFast = 0L; /* lose intrinsic speed */ HFast = 0L; /* lose intrinsic speed */