/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.potion.c - version 1.0.3 */
extern struct monst youmonst
;
extern struct monst
*makemon();
register struct obj
*otmp
,*objs
;
register struct monst
*mtmp
;
register int unkn
= 0, nothing
= 0;
otmp
= getobj("!", "drink");
if(!strcmp(objects
[otmp
->otyp
].oc_descr
, "smoky") && !rn2(13)) {
case POT_RESTORE_STRENGTH
:
pline("Wow! This makes you feel great!");
pline("Ooph! This tastes like liquid fire!");
/* the whiskey makes us feel better */
if(u
.uhp
< u
.uhpmax
) losehp(-1, "bottle of whiskey");
nomovemsg
= "You awake with a headache.";
if(Invis
|| See_invisible
)
pline("Gee! All of a sudden, you can't see yourself.");
pline("You feel rather airy."), unkn
++;
pline("This tastes like fruit juice.");
pline("You begin to feel better.");
if(Blind
) Blind
= 1; /* see on next move */
pline("You are motionlessly suspended.");
pline("Your feet are frozen to the floor!");
case POT_MONSTER_DETECTION
:
strange_feeling(otmp
, "You feel threatened.");
for(mtmp
= fmon
; mtmp
; mtmp
= mtmp
->nmon
)
at(mtmp
->mx
,mtmp
->my
,mtmp
->data
->mlet
);
pline("You sense the presence of monsters.");
case POT_OBJECT_DETECTION
:
strange_feeling(otmp
, "You feel a pull downward.");
for(objs
= fobj
; objs
; objs
= objs
->nobj
)
if(objs
->ox
!= u
.ux
|| objs
->oy
!= u
.uy
)
pline("You sense the presence of objects close nearby.");
for(objs
= fobj
; objs
; objs
= objs
->nobj
)
at(objs
->ox
,objs
->oy
,objs
->olet
);
pline("You sense the presence of objects.");
pline("Yech! This stuff tastes like poison.");
pline("(But in fact it was biologically contaminated orange juice.)");
losehp(rnd(10), "contaminated potion");
pline("Huh, What? Where am I?");
pline("Wow do you feel strong!");
if(u
.ustr
>= 118) break; /* > 118 is impossible */
if(u
.ustr
> 17) u
.ustr
+= rnd(118-u
.ustr
);
if(u
.ustr
> u
.ustrmax
) u
.ustrmax
= u
.ustr
;
pline("You are suddenly moving much faster.");
pline("Your legs get new energy."), unkn
++;
pline("A cloud of darkness falls upon you.");
pline("You feel much better.");
u
.uprops
[PROP(RIN_LEVITATION
)].p_tofn
= float_down
;
impossible("What a funny potion! (%u)", otmp
->otyp
);
pline("You have a peculiar feeling for a moment, then it passes.");
if(otmp
->dknown
&& !objects
[otmp
->otyp
].oc_name_known
) {
objects
[otmp
->otyp
].oc_name_known
= 1;
} else if(!objects
[otmp
->otyp
].oc_uname
)
pline("You feel more experienced.");
pline("Welcome to experience level %u.", ++u
.ulevel
);
register struct obj
*obj
;
pline("You have a strange feeling for a moment, then it passes.");
if(!objects
[obj
->otyp
].oc_name_known
&& !objects
[obj
->otyp
].oc_uname
)
"bottle", "phial", "flagon", "carafe", "flask", "jar", "vial"
register struct monst
*mon
;
register struct obj
*obj
;
register char *botlnam
= bottlenames
[rn2(SIZE(bottlenames
))];
boolean uclose
, isyou
= (mon
== &youmonst
);
pline("The %s crashes on your head and breaks into shivers.",
losehp(rnd(2), "thrown potion");
uclose
= (dist(mon
->mx
,mon
->my
) < 3);
/* perhaps 'E' and 'a' have no head? */
pline("The %s crashes on %s's head and breaks into shivers.",
if(rn2(5) && mon
->mhp
> 1)
pline("The %s evaporates.", xname(obj
));
if(!isyou
&& !rn2(3)) switch(obj
->otyp
) {
case POT_RESTORE_STRENGTH
:
if(mon
->mhp
< mon
->mhpmax
) {
pline("%s looks sound and hale again!", Monnam(mon
));
mon
->mblinded
|= 64 + rn2(64);
case POT_MONSTER_DETECTION:
case POT_OBJECT_DETECTION:
register struct obj
*obj
;
case POT_RESTORE_STRENGTH
:
if(u
.ustr
< u
.ustrmax
) u
.ustr
++, flags
.botl
= 1;
if(u
.uhp
< u
.uhpmax
) u
.uhp
++, flags
.botl
= 1;
if(u
.uhp
<= 5) u
.uhp
= 1; else u
.uhp
-= 5;
pline("You feel somewhat dizzy.");
pline("For an instant you couldn't see your right hand.");
pline("Something seems to be holding you.");
pline("Your knees seem more flexible now.");
if(!Blind
) pline("It suddenly gets dark.");
case POT_MONSTER_DETECTION:
case POT_OBJECT_DETECTION:
* -- rudimentary -- to do this correctly requires much more work
* -- all sharp weapons get one or more qualities derived from the potions
* -- texts on scrolls may be (partially) wiped out; do they become blank?
* -- or does their effect change, like under Confusion?
* -- all objects may be made invisible by POT_INVISIBILITY
* -- If the flask is small, can one dip a large object? Does it magically
register struct obj
*potion
, *obj
;
if(!(obj
= getobj("#", "dip")))
if(!(potion
= getobj("!", "dip into")))
if(obj
->otyp
== ARROW
|| obj
->otyp
== DART
||
obj
->otyp
== CROSSBOW_BOLT
) {
if(potion
->otyp
== POT_SICKNESS
) {
if(obj
->spe
< 7) obj
->spe
++; /* %% */
extern struct permonst pm_ghost
;
register struct monst
*mtmp
;
if(!(mtmp
= makemon(PM_GHOST
,u
.ux
,u
.uy
))){
pline("This bottle turns out to be empty.");
pline("As you open the bottle, an enormous ghost emerges!");
pline("You are frightened to death, and unable to move.");