]> granicus.if.org Git - nethack/commitdiff
B04004 - naming polymorph potions
authorcohrs <cohrs>
Sat, 13 Jul 2002 22:27:01 +0000 (22:27 +0000)
committercohrs <cohrs>
Sat, 13 Jul 2002 22:27:01 +0000 (22:27 +0000)
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
src/potion.c

index 683b54d4ab3b96f0723fb1253dbe4fd13a70afe1..b536a8b42ccc4d76b0276863d99f30414a10bcc8 100644 (file)
@@ -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
index fe8726a096be679530f9bc966a2d06a11bb91429..2a79d856e83e2b9d3dcd74e508eadeaeb8875203 100644 (file)
@@ -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;