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.
This commit is contained in:
cohrs
2002-07-13 22:27:01 +00:00
parent 34149babc3
commit 05e993d48e
2 changed files with 10 additions and 2 deletions
+1
View 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 blessed gain level when already at level 30 won't reduce experience points
keep counting spell skill exercise even after expert status is reached 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 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 Platform- and/or Interface-Specific Fixes
+9 -2
View File
@@ -311,7 +311,8 @@ ghost_from_bottle()
/* "Quaffing is like drinking, except you spill more." -- Terry Pratchett /* "Quaffing is like drinking, except you spill more." -- Terry Pratchett
*/ */
int int
dodrink() { dodrink()
{
register struct obj *otmp; register struct obj *otmp;
const char *potion_descr; const char *potion_descr;
@@ -375,6 +376,7 @@ register struct obj *otmp;
{ {
int retval; int retval;
otmp->in_use = TRUE;
nothing = unkn = 0; nothing = unkn = 0;
if((retval = peffects(otmp)) >= 0) return(retval); if((retval = peffects(otmp)) >= 0) return(retval);
@@ -1547,6 +1549,7 @@ dodip()
pline("That is a potion bottle, not a Klein bottle!"); pline("That is a potion bottle, not a Klein bottle!");
return 0; return 0;
} }
potion->in_use = TRUE; /* assume it will be used up */
if(potion->otyp == POT_WATER) { if(potion->otyp == POT_WATER) {
boolean useeit = !Blind; boolean useeit = !Blind;
if (useeit) (void) Shk_Your(Your_buf, obj); if (useeit) (void) Shk_Your(Your_buf, obj);
@@ -1632,11 +1635,13 @@ dodip()
makeknown(POT_POLYMORPH); makeknown(POT_POLYMORPH);
useup(potion); useup(potion);
prinv((char *)0, obj, 0L); prinv((char *)0, obj, 0L);
return 1;
} else { } else {
pline("Nothing seems to happen."); pline("Nothing seems to happen.");
useup(potion); goto poof;
} }
} }
potion->in_use = FALSE; /* didn't go poof */
return(1); return(1);
} else if(obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) { } else if(obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {
/* Mixing potions is dangerous... */ /* Mixing potions is dangerous... */
@@ -1821,6 +1826,7 @@ dodip()
} }
if (obj->age > 1000L) { if (obj->age > 1000L) {
pline("%s %s full.", Yname2(obj), otense(obj, "are")); pline("%s %s full.", Yname2(obj), otense(obj, "are"));
potion->in_use = FALSE; /* didn't go poof */
} else { } else {
You("fill %s with oil.", yname(obj)); You("fill %s with oil.", yname(obj));
check_unpaid(potion); /* Yendorian Fuel Tax */ check_unpaid(potion); /* Yendorian Fuel Tax */
@@ -1835,6 +1841,7 @@ dodip()
return 1; return 1;
} }
potion->in_use = FALSE; /* didn't go poof */
if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST) && if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST) &&
(mixture = mixtype(obj, potion)) != 0) { (mixture = mixtype(obj, potion)) != 0) {
boolean more_than_one = potion->quan > 1; boolean more_than_one = potion->quan > 1;