From 05e993d48e5be44e0f38a0e211fb7d5ba923860b Mon Sep 17 00:00:00 2001 From: cohrs Date: Sat, 13 Jul 2002 22:27:01 +0000 Subject: [PATCH] B04004 - naming polymorph potions Provide a chance for the player to name a polymorph potion if you dip something into it and nothing happens. Also fix several places in dipping and drinking potions where the HUP cheat would allow you to use the potion a 2nd time, made more important since the polymorph sequence includes what is currently a unique message. --- doc/fixes34.1 | 1 + src/potion.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 683b54d4a..b536a8b42 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -158,6 +158,7 @@ a knight applying a lance did not do a caitiff check blessed gain level when already at level 30 won't reduce experience points keep counting spell skill exercise even after expert status is reached when a fountain dries up or a throne vanishes, make sure it really happens +allow player to name polymorph potion if nothing seems to happen Platform- and/or Interface-Specific Fixes diff --git a/src/potion.c b/src/potion.c index fe8726a09..2a79d856e 100644 --- a/src/potion.c +++ b/src/potion.c @@ -311,7 +311,8 @@ ghost_from_bottle() /* "Quaffing is like drinking, except you spill more." -- Terry Pratchett */ int -dodrink() { +dodrink() +{ register struct obj *otmp; const char *potion_descr; @@ -375,6 +376,7 @@ register struct obj *otmp; { int retval; + otmp->in_use = TRUE; nothing = unkn = 0; if((retval = peffects(otmp)) >= 0) return(retval); @@ -1547,6 +1549,7 @@ dodip() pline("That is a potion bottle, not a Klein bottle!"); return 0; } + potion->in_use = TRUE; /* assume it will be used up */ if(potion->otyp == POT_WATER) { boolean useeit = !Blind; if (useeit) (void) Shk_Your(Your_buf, obj); @@ -1632,11 +1635,13 @@ dodip() makeknown(POT_POLYMORPH); useup(potion); prinv((char *)0, obj, 0L); + return 1; } else { pline("Nothing seems to happen."); - useup(potion); + goto poof; } } + potion->in_use = FALSE; /* didn't go poof */ return(1); } else if(obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) { /* Mixing potions is dangerous... */ @@ -1821,6 +1826,7 @@ dodip() } if (obj->age > 1000L) { pline("%s %s full.", Yname2(obj), otense(obj, "are")); + potion->in_use = FALSE; /* didn't go poof */ } else { You("fill %s with oil.", yname(obj)); check_unpaid(potion); /* Yendorian Fuel Tax */ @@ -1835,6 +1841,7 @@ dodip() return 1; } + potion->in_use = FALSE; /* didn't go poof */ if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST) && (mixture = mixtype(obj, potion)) != 0) { boolean more_than_one = potion->quan > 1;