1 /* NetHack 3.6 potion.c $NHDT-Date: 1446861768 2015/11/07 02:02:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.121 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
8 /* JNetHack may be freely redistributed. See license for details. */
12 boolean notonhead = FALSE;
14 static NEARDATA int nothing, unkn;
15 static NEARDATA const char beverages[] = { POTION_CLASS, 0 };
17 STATIC_DCL long FDECL(itimeout, (long));
18 STATIC_DCL long FDECL(itimeout_incr, (long, int));
19 STATIC_DCL void NDECL(ghost_from_bottle);
21 FDECL(H2Opotion_dip, (struct obj *, struct obj *, BOOLEAN_P, const char *));
22 STATIC_DCL short FDECL(mixtype, (struct obj *, struct obj *));
24 /* force `val' to be within valid range for intrinsic timeout value */
37 /* increment `old' by `incr' and force result to be valid intrinsic timeout */
39 itimeout_incr(old, incr)
43 return itimeout((old & TIMEOUT) + (long) incr);
46 /* set the timeout field of intrinsic `which' */
48 set_itimeout(which, val)
52 *which |= itimeout(val);
55 /* increment the timeout field of intrinsic `which' */
57 incr_itimeout(which, incr)
61 set_itimeout(which, itimeout_incr(*which, incr));
65 make_confused(xtime, talk)
69 long old = HConfusion;
77 You_feel("less %s now.", Hallucination ? "trippy" : "confused");
79 You("%s
\82ª
\82¨
\82³
\82Ü
\82Á
\82½
\81D", Hallucination ? "
\83w
\83\8d\83w
\83\8d" : "
\8d¬
\97\90");
81 if ((xtime && !old) || (!xtime && old))
84 set_itimeout(&HConfusion, xtime);
88 make_stunned(xtime, talk)
101 Hallucination ? "less wobbly" : "a bit steadier");
104 Hallucination ? "
\82Ö
\82ë
\82è
\82ç
\82ª
\82¨
\82³
\82Ü
\82Á
\82½" : "
\82¾
\82ñ
\82¾
\82ñ
\82µ
\82Á
\82©
\82è
\82µ
\82Ä
\82«
\82½");
111 You("wobble in the saddle.");
113 You("
\88Æ
\82Ì
\8fã
\82Å
\82®
\82ç
\82®
\82ç
\82µ
\82½
\81D");
116 You("%s...", stagger(youmonst.data, "stagger"));
118 You("%s
\81D
\81D
\81D", stagger(youmonst.data, "
\82
\82ç
\82
\82ç
\82µ
\82½"));
121 if ((!xtime && old) || (xtime && !old))
124 set_itimeout(&HStun, xtime);
128 make_sick(xtime, cause, talk, type)
130 const char *cause; /* sickness cause */
146 You_feel("deathly sick.");
148 You("
\95a
\8bC
\82Å
\8e\80\82É
\82»
\82¤
\82¾
\81D");
153 You_feel("%s worse.", xtime <= Sick / 2L ? "much" : "even");
155 You("%s
\88«
\89»
\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é
\81D", xtime <= Sick/2L ? "
\82³
\82ç
\82É" : "
\82à
\82Á
\82Æ");
157 set_itimeout(&Sick, xtime);
158 u.usick_type |= type;
160 } else if (old && (type & u.usick_type)) {
161 /* was sick, now not */
162 u.usick_type &= ~type;
163 if (u.usick_type) { /* only partly cured */
166 You_feel("somewhat better.");
168 You("
\82¿
\82å
\82Á
\82Æ
\82æ
\82
\82È
\82Á
\82½
\81D");
169 set_itimeout(&Sick, Sick * 2); /* approximation */
173 You_feel("cured. What a relief!");
175 pline("
\89ñ
\95\9c\82µ
\82½
\81D
\82 \82 \8f\95\82©
\82Á
\82½
\81I");
176 Sick = 0L; /* set_itimeout(&Sick, 0L) */
182 exercise(A_CON, FALSE);
183 delayed_killer(SICK, KILLED_BY_AN, cause);
185 dealloc_killer(find_delayed_killer(SICK));
189 make_slimed(xtime, msg)
199 if ((!xtime && old) || (xtime && !old)) {
204 set_itimeout(&Slimed, xtime);
206 dealloc_killer(find_delayed_killer(SLIMED));
209 /* start or stop petrification */
211 make_stoned(xtime, msg, killedby, killername)
215 const char *killername;
223 if ((!xtime && old) || (xtime && !old)) {
226 /* context.botl = 1; --- Stoned is not a status line item */
228 set_itimeout(&Stoned, xtime);
230 dealloc_killer(find_delayed_killer(STONED));
232 delayed_killer(STONED, killedby, killername);
236 make_vomiting(xtime, talk)
248 You_feel("much less nauseated now.");
250 You("
\93f
\82«
\8bC
\82ª
\82¨
\82³
\82Ü
\82Á
\82½
\81D");
252 set_itimeout(&Vomiting, xtime);
256 static const char vismsg[] = "vision seems to %s for a moment but is %s now.";
258 static const char vismsg[] = "
\8e\8b\8aE
\82Í
\88ê
\8fu%s
\82È
\82Á
\82½
\82ª
\82Ü
\82½%s
\82È
\82Á
\82½
\81D";
260 static const char eyemsg[] = "%s momentarily %s.";
262 static const char eyemsg[] = "%s
\82Í
\88ê
\8fu%s
\81D";
265 make_blinded(xtime, talk)
270 boolean u_could_see, can_see_now;
273 /* we need to probe ahead in case the Eyes of the Overworld
274 are or will be overriding blindness */
275 u_could_see = !Blind;
276 Blinded = xtime ? 1L : 0L;
277 can_see_now = !Blind;
278 Blinded = old; /* restore */
283 if (can_see_now && !u_could_see) { /* regaining sight */
287 pline("Far out! Everything is all cosmic again!");
289 pline("
\82°
\81I
\82È
\82É
\82à
\82©
\82à
\82ª
\82Ü
\82½
\93ø
\90F
\82É
\8c©
\82¦
\82é
\81I");
292 You("can see again.");
294 You("
\82Ü
\82½
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
296 } else if (old && !xtime) {
297 /* clearing temporary blindness without toggling blindness */
299 if (!haseyes(youmonst.data)) {
300 strange_feeling((struct obj *) 0, (char *) 0);
301 } else if (Blindfolded) {
303 eyes = body_part(EYE);
304 if (eyecount(youmonst.data) != 1)
305 eyes = makeplural(eyes);
306 Your(eyemsg, eyes, vtense(eyes, "itch"));
308 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
310 } else { /* Eyes of the Overworld */
312 Your(vismsg, "brighten", Hallucination ? "sadder" : "normal");
314 Your(vismsg, "
\96¾
\82é
\82", Hallucination ? "
\8dª
\88Ã
\82É" : "
\95\81\92Ê
\82É");
319 if (u_could_see && !can_see_now) { /* losing sight */
323 pline("Oh, bummer! Everything is dark! Help!");
325 pline("
\88Ã
\82¢
\82æ
\81[
\81C
\8b·
\82¢
\82æ
\81[
\81C
\8b°
\82¢
\82æ
\81[
\81I");
328 pline("A cloud of darkness falls upon you.");
330 pline("
\88Ã
\8d\95\82Ì
\89_
\82ª
\82 \82È
\82½
\82ð
\95¢
\82Á
\82½
\81D");
332 /* Before the hero goes blind, set the ball&chain variables. */
335 } else if (!old && xtime) {
336 /* setting temporary blindness without toggling blindness */
338 if (!haseyes(youmonst.data)) {
339 strange_feeling((struct obj *) 0, (char *) 0);
340 } else if (Blindfolded) {
342 eyes = body_part(EYE);
343 if (eyecount(youmonst.data) != 1)
344 eyes = makeplural(eyes);
345 Your(eyemsg, eyes, vtense(eyes, "twitch"));
347 Your(eyemsg, body_part(EYE), "
\83s
\83N
\83s
\83N
\82µ
\82½");
349 } else { /* Eyes of the Overworld */
351 Your(vismsg, "dim", Hallucination ? "happier" : "normal");
353 Your(vismsg, "
\94\96\88Ã
\82", Hallucination ? "
\83n
\83b
\83s
\81[
\82É" : "
\95\81\92Ê
\82É");
358 set_itimeout(&Blinded, xtime);
360 if (u_could_see ^ can_see_now) { /* one or the other but not both */
362 vision_full_recalc = 1; /* blindness just got toggled */
363 /* this vision recalculation used to be deferred until
364 moveloop(), but that made it possible for vision
365 irregularities to occur (cited case was force bolt
366 hitting adjacent potion of blindness and then a
367 secret door; hero was blinded by vapors but then
368 got the message "a door appears in the wall") */
370 if (Blind_telepat || Infravision)
373 /* avoid either of the sequences
374 "Sting starts glowing", [become blind], "Sting stops quivering" or
375 "Sting starts quivering", [regain sight], "Sting stops glowing"
376 by giving "Sting is quivering" when becoming blind or
377 "Sting is glowing" when regaining sight so that the eventual
378 "stops" message matches */
379 if (warn_obj_cnt && uwep && (EWarn_of_mon & W_WEP) != 0L)
381 /* update dknown flag for inventory picked up while blind */
383 learn_unseen_invent();
388 make_hallucinated(xtime, talk, mask)
389 long xtime; /* nonzero if this is an attempt to turn on hallucination */
391 long mask; /* nonzero if resistance status should change by mask */
393 long old = HHallucination;
395 const char *message, *verb;
401 message = (!xtime) ? "Everything %s SO boring now."
402 : "Oh wow! Everything %s so cosmic!";
404 message = (!xtime) ? "
\89½
\82à
\82©
\82à
\82ª
\81\96\91Þ
\8bü
\81\96\82É%s
\82é
\81D"
405 : "
\83\8f\81[
\83I
\81I
\89½
\82à
\82©
\82à
\93ø
\90F
\82É%s
\82é
\81I";
408 verb = (!Blind) ? "looks" : "feels";
410 verb = (!Blind) ? "
\8c©
\82¦" : "
\8a´
\82¶";
417 EHalluc_resistance |= mask;
419 EHalluc_resistance &= ~mask;
421 if (!EHalluc_resistance && (!!HHallucination != !!xtime))
423 set_itimeout(&HHallucination, xtime);
425 /* clearing temporary hallucination without toggling vision */
426 if (!changed && !HHallucination && old && talk) {
427 if (!haseyes(youmonst.data)) {
428 strange_feeling((struct obj *) 0, (char *) 0);
431 const char *eyes = body_part(EYE);
433 if (eyecount(youmonst.data) != 1)
434 eyes = makeplural(eyes);
435 Your(eyemsg, eyes, vtense(eyes, "itch"));
437 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
439 } else { /* Grayswandir */
441 Your(vismsg, "flatten", "normal");
443 Your(vismsg, "
\82¨
\82©
\82µ
\82", "
\95\81\92Ê
\82É");
449 /* in case we're mimicking an orange (hallucinatory form
450 of mimicking gold) update the mimicking's-over message */
455 swallowed(0); /* redraw swallow display */
457 /* The see_* routines should be called *before* the pline. */
463 /* for perm_inv and anything similar
464 (eg. Qt windowport's equipped items display) */
469 pline(message, verb);
475 make_deaf(xtime, talk)
480 boolean toggled = FALSE;
487 You("can hear again.");
489 } else if (xtime && !old) {
491 You("are unable to hear anything.");
494 /* deafness isn't presently shown on status line, but
495 request a status update in case that changes someday */
499 set_itimeout(&HDeaf, xtime);
505 struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS);
509 pline("This bottle turns out to be empty.");
511 pline("
\95r
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
516 pline("As you open the bottle, %s emerges.", something);
518 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\89½
\82©
\82ª
\8fo
\82Ä
\82«
\82½
\81D");
522 pline("As you open the bottle, an enormous %s emerges!",
523 Hallucination ? rndmonnam(NULL) : (const char *) "ghost");
525 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\8b\90\91å
\82È%s
\82ª
\8fo
\82Ä
\82«
\82½
\81I",
526 Hallucination ? rndmonnam(NULL) : (const char *) "
\97H
\97ì");
530 You("are frightened to death, and unable to move.");
532 You("
\82Ü
\82Á
\82³
\82¨
\82É
\82È
\82Á
\82Ä
\8bÁ
\82«
\81C
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
534 multi_reason = "being frightened to death";
536 nomovemsg = "You regain your composure.";
538 nomovemsg = "
\82 \82È
\82½
\82Í
\95½
\90Ã
\82ð
\8eæ
\82è
\96ß
\82µ
\82½
\81D";
541 /* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
545 register struct obj *otmp;
546 const char *potion_descr;
550 pline("If you can't breathe air, how can you drink liquid?");
552 pline("
\91§
\82à
\82Å
\82«
\82È
\82¢
\82Ì
\82É
\81C
\82Ç
\82¤
\82â
\82Á
\82Ä
\89t
\91Ì
\82ð
\88ù
\82Þ
\82ñ
\82¾
\82¢
\81H");
555 /* Is there a fountain to drink from here? */
556 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
557 /* not as low as floor level but similar restrictions apply */
558 && can_reach_floor(FALSE)) {
560 if (yn("Drink from the fountain?") == 'y') {
562 if (yn("
\90ò
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
567 /* Or a kitchen sink? */
568 if (IS_SINK(levl[u.ux][u.uy].typ)
569 /* not as low as floor level but similar restrictions apply */
570 && can_reach_floor(FALSE)) {
572 if (yn("Drink from the sink?") == 'y') {
574 if (yn("
\97¬
\82µ
\91ä
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
579 /* Or are you surrounded by water? */
580 if (Underwater && !u.uswallow) {
582 if (yn("Drink the water around you?") == 'y') {
584 if (yn("
\82Ü
\82í
\82è
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
586 pline("Do you know what lives in this water?");
588 pline("
\82±
\82Ì
\90\85\92\86\82Å
\89½
\82ª
\90¶
\82«
\82Ä
\82¢
\82é
\82Ì
\82©
\92m
\82Á
\82Ä
\82é
\82©
\82¢
\81H");
593 otmp = getobj(beverages, "drink");
597 /* quan > 1 used to be left to useup(), but we need to force
598 the current potion to be unworn, and don't want to do
599 that for the entire stack when starting with more than 1.
600 [Drinking a wielded potion of polymorph can trigger a shape
601 change which causes hero's weapon to be dropped. In 3.4.x,
602 that led to an "object lost" panic since subsequent useup()
603 was no longer dealing with an inventory item. Unwearing
604 the current potion is intended to keep it in inventory.] */
605 if (otmp->quan > 1L) {
606 otmp = splitobj(otmp, 1L);
607 otmp->owornmask = 0L; /* rest of original stuck unaffected */
608 } else if (otmp->owornmask) {
609 remove_worn_item(otmp, FALSE);
611 otmp->in_use = TRUE; /* you've opened the stopper */
613 potion_descr = OBJ_DESCR(objects[otmp->otyp]);
616 if (!strcmp(potion_descr, "milky")
618 if (!strcmp(potion_descr, "
\83~
\83\8b\83N
\90F
\82Ì")
619 && !(mvitals[PM_GHOST].mvflags & G_GONE)
620 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_GHOST].born))) {
625 } else if (!strcmp(potion_descr, "smoky")
627 } else if (!strcmp(potion_descr, "
\89\8c\82ª
\82Å
\82Ä
\82¢
\82é")
628 && !(mvitals[PM_DJINNI].mvflags & G_GONE)
629 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_DJINNI].born))) {
630 djinni_from_bottle(otmp);
635 return dopotion(otmp);
640 register struct obj *otmp;
646 if ((retval = peffects(otmp)) >= 0)
652 You("have a %s feeling for a moment, then it passes.",
653 Hallucination ? "normal" : "peculiar");
655 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
656 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\93Æ
\93Á
\82È");
659 if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
661 makeknown(otmp->otyp);
662 more_experienced(0, 10);
663 } else if (!objects[otmp->otyp].oc_uname)
672 register struct obj *otmp;
674 register int i, ii, lim;
676 switch (otmp->otyp) {
677 case POT_RESTORE_ABILITY:
678 case SPE_RESTORE_ABILITY:
682 pline("Ulch! This makes you feel mediocre!");
684 pline("
\82¤
\81[
\82ñ
\81C
\82Ç
\82¤
\82à
\82³
\82¦
\82È
\82¢
\82È
\82 \81D");
687 /* unlike unicorn horn, overrides Fixed_abil */
689 pline("Wow! This makes you feel %s!",
691 ? (unfixable_trouble_count(FALSE) ? "better" : "great")
694 pline("
\83\8f\81[
\83I
\81I
\8bC
\95ª
\82ª%s
\82È
\82Á
\82½
\81I",
696 ? (unfixable_trouble_count(FALSE) ? "
\82¾
\82¢
\82Ô
\82æ
\82" : "
\82Æ
\82Ä
\82à
\82æ
\82")
699 i = rn2(A_MAX); /* start at a random point */
700 for (ii = 0; ii < A_MAX; ii++) {
702 if (i == A_STR && u.uhs >= 3)
704 if (ABASE(i) < lim) {
707 /* only first found if not blessed */
716 case POT_HALLUCINATION:
717 if (Hallucination || Halluc_resistance)
719 (void) make_hallucinated(
720 itimeout_incr(HHallucination, rn1(200, 600 - 300 * bcsign(otmp))),
724 if (!otmp->blessed && !otmp->cursed) {
726 pline("This tastes like water.");
728 pline("
\90\85\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
729 u.uhunger += rnd(10);
734 if (is_undead(youmonst.data) || is_demon(youmonst.data)
735 || u.ualign.type == A_CHAOTIC) {
738 pline("This burns like acid!");
740 pline("
\8e_
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I");
741 exercise(A_CON, FALSE);
742 if (u.ulycn >= LOW_PM) {
744 Your("affinity to %s disappears!",
746 Your("%s
\82Ö
\82Ì
\90e
\8bß
\8a´
\82Í
\82È
\82
\82È
\82Á
\82½
\81I",
747 makeplural(mons[u.ulycn].mname));
748 if (youmonst.data == &mons[u.ulycn])
750 u.ulycn = NON_PM; /* cure lycanthropy */
753 losehp(Maybe_Half_Phys(d(2, 6)), "potion of holy water",
755 losehp(Maybe_Half_Phys(d(2, 6)), "
\90¹
\90\85\82Å",
757 } else if (otmp->cursed) {
759 You_feel("quite proud of yourself.");
761 You("
\8e©
\91¸
\90S
\82ð
\8a´
\82¶
\82½
\81D");
762 healup(d(2, 6), 0, 0, 0);
763 if (u.ulycn >= LOW_PM && !Upolyd)
765 exercise(A_CON, TRUE);
770 You_feel("full of awe.");
772 You("
\88Ø
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
773 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
774 exercise(A_WIS, TRUE);
775 exercise(A_CON, TRUE);
776 if (u.ulycn >= LOW_PM)
777 you_unwere(TRUE); /* "Purified" */
778 /* make_confused(0L, TRUE); */
780 if (u.ualign.type == A_LAWFUL) {
782 pline("This burns like acid!");
784 pline("
\8e_
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I");
786 losehp(Maybe_Half_Phys(d(2, 6)), "potion of unholy water",
788 losehp(Maybe_Half_Phys(d(2, 6)), "
\95s
\8fò
\82È
\90\85\82Å",
792 You_feel("full of dread.");
794 You("
\8b°
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
795 if (u.ulycn >= LOW_PM && !Upolyd)
797 exercise(A_CON, FALSE);
804 pline("Ooph! This tastes like %s%s!",
805 otmp->odiluted ? "watered down " : "",
806 Hallucination ? "dandelion wine" : "liquid fire");
808 pline("
\82¤
\82¥
\82Á
\82Õ
\81I
\82±
\82ê
\82Í%s%s
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81I",
809 otmp->odiluted ? "
\90\85\82Å
\94\96\82ß
\82½" : "",
810 Hallucination ? "
\83^
\83\93\83|
\83|
\83\8f\83C
\83\93" : "
\94R
\97¿
\83I
\83C
\83\8b");
813 make_confused(itimeout_incr(HConfusion, d(3, 8)), FALSE);
814 /* the whiskey makes us feel better */
816 healup(1, 0, FALSE, FALSE);
817 u.uhunger += 10 * (2 + bcsign(otmp));
819 exercise(A_WIS, FALSE);
824 You("
\8bC
\90â
\82µ
\82½
\81D");
827 nomovemsg = "You awake with a headache.";
829 nomovemsg = "
\96Ú
\82ª
\82³
\82ß
\82½
\82ª
\93ª
\92É
\82ª
\82·
\82é
\81D";
832 case POT_ENLIGHTENMENT:
836 You("have an uneasy feeling...");
838 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D
\81D
\81D");
839 exercise(A_WIS, FALSE);
842 (void) adjattrib(A_INT, 1, FALSE);
843 (void) adjattrib(A_WIS, 1, FALSE);
846 You_feel("self-knowledgeable...");
848 You("
\8e©
\95ª
\8e©
\90g
\82ª
\94»
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D
\81D
\81D");
849 display_nhwindow(WIN_MESSAGE, FALSE);
850 enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
852 pline_The("feeling subsides.");
854 pline("
\82»
\82Ì
\8a´
\82¶
\82Í
\82È
\82
\82È
\82Á
\82½
\81D");
855 exercise(A_WIS, TRUE);
858 case SPE_INVISIBILITY:
859 /* spell cannot penetrate mummy wrapping */
860 if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
862 You_feel("rather itchy under %s.", yname(uarmc));
864 You("%s
\82Ì
\89º
\82ª
\83\80\83Y
\83\80\83Y
\82µ
\82½
\81D", xname(uarmc));
868 case POT_INVISIBILITY:
869 if (Invis || Blind || BInvis) {
872 self_invis_message();
875 HInvis |= FROMOUTSIDE;
877 incr_itimeout(&HInvis, rn1(15, 31));
878 newsym(u.ux, u.uy); /* update position */
881 pline("For some reason, you feel your presence is known.");
883 pline("
\82È
\82º
\82©
\81C
\91¶
\8dÝ
\82ª
\92m
\82ç
\82ê
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
887 case POT_SEE_INVISIBLE: /* tastes like fruit juice in Rogue */
888 case POT_FRUIT_JUICE: {
889 int msg = Invisible && !Blind;
894 pline("Yecch! This tastes %s.",
895 Hallucination ? "overripe" : "rotten");
897 pline("
\83I
\83F
\81[
\81I
\82±
\82ê
\82Í%s
\83W
\83\85\81[
\83X
\82Ì
\96¡
\82ª
\82·
\82é
\81D",
898 Hallucination ? "
\8fn
\82µ
\82·
\82¬
\82½" : "
\95\85\82Á
\82½");
904 ? "This tastes like 10%% real %s%s all-natural beverage."
905 : "This tastes like %s%s.",
906 otmp->odiluted ? "reconstituted " : "", fruitname(TRUE));
910 ? "10%%%s
\82Ì
\8f\83\8e©
\91R
\88ù
\97¿
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D"
911 : "%s%s
\83W
\83\85\81[
\83X
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D",
912 otmp->odiluted ? "
\90¬
\95ª
\92²
\90®
\82³
\82ê
\82½" : "", fruitname(TRUE));
914 if (otmp->otyp == POT_FRUIT_JUICE) {
915 u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
920 /* Tell them they can see again immediately, which
921 * will help them identify the potion...
923 make_blinded(0L, TRUE);
926 HSee_invisible |= FROMOUTSIDE;
928 incr_itimeout(&HSee_invisible, rn1(100, 750));
929 set_mimic_blocking(); /* do special mimic handling */
930 see_monsters(); /* see invisible monsters */
931 newsym(u.ux, u.uy); /* see yourself! */
932 if (msg && !Blind) { /* Blind possible if polymorphed */
934 You("can see through yourself, but you are visible!");
936 You("
\93§
\96¾
\82Å
\82 \82é
\81D
\82µ
\82©
\82µ
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
944 You("stiffen momentarily.");
946 You("
\88ê
\8fu
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
948 if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
950 You("are motionlessly suspended.");
952 You("
\8bó
\92\86\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
955 You("are frozen in place!");
957 You("
\82»
\82Ì
\8fê
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
960 Your("%s are frozen to the %s!", makeplural(body_part(FOOT)),
961 surface(u.ux, u.uy));
963 You("
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
965 nomul(-(rn1(10, 25 - 12 * bcsign(otmp))));
966 multi_reason = "frozen by a potion";
967 nomovemsg = You_can_move_again;
968 exercise(A_DEX, FALSE);
972 if (Sleep_resistance || Free_action) {
976 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
979 You("suddenly fall asleep!");
981 pline("
\93Ë
\91R
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I");
982 fall_asleep(-rn1(10, 25 - 12 * bcsign(otmp)), TRUE);
985 case POT_MONSTER_DETECTION:
986 case SPE_DETECT_MONSTERS:
993 /* after a while, repeated uses become less effective */
994 if ((HDetect_monsters & TIMEOUT) >= 300L)
998 incr_itimeout(&HDetect_monsters, i);
999 for (x = 1; x < COLNO; x++) {
1000 for (y = 0; y < ROWNO; y++) {
1001 if (levl[x][y].glyph == GLYPH_INVISIBLE) {
1012 You_feel("lonely.");
1014 You("
\90S
\8d×
\82
\82È
\82Á
\82½
\81D");
1017 if (monster_detect(otmp, 0))
1018 return 1; /* nothing detected */
1019 exercise(A_WIS, TRUE);
1021 case POT_OBJECT_DETECTION:
1022 case SPE_DETECT_TREASURE:
1023 if (object_detect(otmp, 0))
1024 return 1; /* nothing detected */
1025 exercise(A_WIS, TRUE);
1029 pline("Yecch! This stuff tastes like poison.");
1031 pline("
\83E
\83F
\81[
\81I
\93Å
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1032 if (otmp->blessed) {
1034 pline("(But in fact it was mildly stale %s.)", fruitname(TRUE));
1036 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\8f
\82µ
\8cÃ
\82
\82È
\82Á
\82½%s
\81D)", fruitname(TRUE));
1037 if (!Role_if(PM_HEALER)) {
1038 /* NB: blessed otmp->fromsink is not possible */
1040 losehp(1, "mildly contaminated potion", KILLED_BY_AN);
1042 losehp(1, "
\95a
\8bC
\82É
\89\98\90õ
\82³
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1045 if (Poison_resistance)
1047 pline("(But in fact it was biologically contaminated %s.)",
1049 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\90¶
\95¨
\8aw
\93I
\82É
\89\98\90õ
\82³
\82ê
\82½%s
\82¾
\81D)",
1051 if (Role_if(PM_HEALER)) {
1053 pline("Fortunately, you have been immunized.");
1055 pline("
\8dK
\89^
\82È
\82±
\82Æ
\82É
\81C
\82 \82È
\82½
\82Í
\96Æ
\89u
\82ª
\82 \82é
\81D");
1057 char contaminant[BUFSZ];
1058 int typ = rn2(A_MAX);
1061 Sprintf(contaminant, "%s%s",
1062 (Poison_resistance) ? "mildly " : "",
1063 (otmp->fromsink) ? "contaminated tap water"
1064 : "contaminated potion");
1066 Sprintf(contaminant, "%s
\89\98\90õ
\82³
\82ê
\82½%s
\82Å",
1067 (Poison_resistance) ? "
\8f
\82µ" : "",
1068 (otmp->fromsink) ? "
\90\85"
1072 poisontell(typ, FALSE);
1073 (void) adjattrib(typ, Poison_resistance ? -1 : -rn1(4, 3),
1076 if (!Poison_resistance) {
1078 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1081 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1084 /* rnd loss is so that unblessed poorer than blessed */
1085 losehp(1 + rn2(2), contaminant,
1086 (otmp->fromsink) ? KILLED_BY : KILLED_BY_AN);
1088 exercise(A_CON, FALSE);
1091 if (Hallucination) {
1093 You("are shocked back to your senses!");
1095 You("
\8cÜ
\8a´
\82É
\8fÕ
\8c\82\82ð
\8eó
\82¯
\82½
\81I");
1096 (void) make_hallucinated(0L, FALSE, 0L);
1101 if (Hallucination) {
1103 pline("What a trippy feeling!");
1105 pline("
\82È
\82ñ
\82©
\83w
\83\8d\83w
\83\8d\82·
\82é
\81I");
1109 pline("Huh, What? Where am I?");
1111 pline("
\82Ù
\82¦
\81H
\8e\84\82Í
\92N
\81H");
1114 make_confused(itimeout_incr(HConfusion,
1115 rn1(7, 16 - 8 * bcsign(otmp))),
1118 case POT_GAIN_ABILITY:
1121 pline("Ulch! That potion tasted foul!");
1123 pline("
\83E
\83F
\81I
\88«
\8fL
\82ª
\82·
\82é
\81I");
1125 } else if (Fixed_abil) {
1127 } else { /* If blessed, increase all; if not, try up to */
1128 int itmp; /* 6 times to find one which can be increased. */
1130 i = -1; /* increment to 0 */
1131 for (ii = A_MAX; ii > 0; ii--) {
1132 i = (otmp->blessed ? i + 1 : rn2(A_MAX));
1133 /* only give "your X is already as high as it can get"
1134 message on last attempt (except blessed potions) */
1135 itmp = (otmp->blessed || ii == 1) ? 0 : -1;
1136 if (adjattrib(i, 1, itmp) && !otmp->blessed)
1142 if (Wounded_legs && !otmp->cursed && !u.usteed) {
1143 /* heal_legs() would heal steeds legs */
1149 case SPE_HASTE_SELF:
1150 if (!Very_fast) { /* wwf@doe.carleton.ca */
1152 You("are suddenly moving %sfaster.", Fast ? "" : "much ");
1154 You("
\93Ë
\91R%s
\91¬
\82
\88Ú
\93®
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D", Fast ? "" : "
\82Æ
\82Ä
\82à");
1157 Your("%s get new energy.", makeplural(body_part(LEG)));
1159 pline("%s
\82É
\83G
\83l
\83\8b\83M
\81[
\82ª
\92\8d\82¬
\82±
\82Ü
\82ê
\82é
\82æ
\82¤
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", body_part(LEG));
1162 exercise(A_DEX, TRUE);
1163 incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp)));
1168 make_blinded(itimeout_incr(Blinded,
1169 rn1(200, 250 - 125 * bcsign(otmp))),
1172 case POT_GAIN_LEVEL:
1175 /* they went up a level */
1176 if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
1177 || Can_rise_up(u.ux, u.uy, &u.uz)) {
1179 const char *riseup = "rise up, through the %s!";
1181 const char *riseup ="%s
\82ð
\93Ë
\82«
\94²
\82¯
\82½
\81I";
1183 if (ledger_no(&u.uz) == 1) {
1184 You(riseup, ceiling(u.ux, u.uy));
1185 goto_level(&earth_level, FALSE, FALSE, FALSE);
1187 register int newlev = depth(&u.uz) - 1;
1190 get_level(&newlevel, newlev);
1191 if (on_level(&newlevel, &u.uz)) {
1193 pline("It tasted bad.");
1195 pline("
\82Æ
\82Ä
\82à
\82Ü
\82¸
\82¢
\81D");
1198 You(riseup, ceiling(u.ux, u.uy));
1199 goto_level(&newlevel, FALSE, FALSE, FALSE);
1203 You("have an uneasy feeling.");
1205 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D");
1209 /* blessed potions place you at a random spot in the
1210 middle of the new level instead of the low point */
1212 u.uexp = rndexp(TRUE);
1216 You_feel("better.");
1218 You("
\8bC
\95ª
\82ª
\82æ
\82
\82È
\82Á
\82½
\81D");
1219 healup(d(6 + 2 * bcsign(otmp), 4), !otmp->cursed ? 1 : 0,
1220 !!otmp->blessed, !otmp->cursed);
1221 exercise(A_CON, TRUE);
1223 case POT_EXTRA_HEALING:
1225 You_feel("much better.");
1227 You("
\8bC
\95ª
\82ª
\82Æ
\82Ä
\82à
\82æ
\82
\82È
\82Á
\82½
\81D");
1228 healup(d(6 + 2 * bcsign(otmp), 8),
1229 otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, !otmp->cursed,
1231 (void) make_hallucinated(0L, TRUE, 0L);
1232 exercise(A_CON, TRUE);
1233 exercise(A_STR, TRUE);
1235 case POT_FULL_HEALING:
1237 You_feel("completely healed.");
1239 You("
\8a®
\91S
\82É
\89ñ
\95\9c\82µ
\82½
\81D");
1240 healup(400, 4 + 4 * bcsign(otmp), !otmp->cursed, TRUE);
1241 /* Restore one lost level if blessed */
1242 if (otmp->blessed && u.ulevel < u.ulevelmax) {
1243 /* when multiple levels have been lost, drinking
1244 multiple potions will only get half of them back */
1248 (void) make_hallucinated(0L, TRUE, 0L);
1249 exercise(A_STR, TRUE);
1250 exercise(A_CON, TRUE);
1252 case POT_LEVITATION:
1253 case SPE_LEVITATION:
1255 HLevitation &= ~I_SPECIAL;
1256 if (!Levitation && !BLevitation) {
1257 /* kludge to ensure proper operation of float_up() */
1258 set_itimeout(&HLevitation, 1L);
1260 /* reverse kludge */
1261 set_itimeout(&HLevitation, 0L);
1263 if ((u.ux == xupstair && u.uy == yupstair)
1264 || (sstairs.up && u.ux == sstairs.sx
1265 && u.uy == sstairs.sy)
1266 || (xupladder && u.ux == xupladder
1267 && u.uy == yupladder)) {
1269 } else if (has_ceiling(&u.uz)) {
1270 int dmg = uarmh ? 1 : rnd(10);
1273 You("hit your %s on the %s.", body_part(HEAD),
1274 ceiling(u.ux, u.uy));
1276 You("%s
\82ð%s
\82É
\82Ô
\82Â
\82¯
\82½
\81D", body_part(HEAD),
1277 ceiling(u.ux,u.uy));
1280 losehp(Maybe_Half_Phys(dmg), "colliding with the ceiling",
1282 losehp(Maybe_Half_Phys(dmg), "
\93V
\88ä
\82É
\93ª
\82ð
\82Ô
\82Â
\82¯
\82Ä",
1288 if (otmp->blessed) {
1289 incr_itimeout(&HLevitation, rn1(50, 250));
1290 HLevitation |= I_SPECIAL;
1292 incr_itimeout(&HLevitation, rn1(140, 10));
1294 spoteffects(FALSE); /* for sinks */
1297 case POT_GAIN_ENERGY: { /* M. Stephenson */
1302 You_feel("lackluster.");
1304 You("
\88Ó
\8bC
\8fÁ
\92¾
\82µ
\82½
\81D");
1307 pline("Magical energies course through your body.");
1309 pline("
\96\82\96@
\82Ì
\83G
\83l
\83\8b\83M
\81[
\82ª
\82 \82È
\82½
\82Ì
\91Ì
\82É
\96\9e\82¿
\82½
\81D");
1311 /* old: num = rnd(5) + 5 * otmp->blessed + 1;
1312 * blessed: +7..11 max & current (+9 avg)
1313 * uncursed: +2.. 6 max & current (+4 avg)
1314 * cursed: -2.. 6 max & current (-4 avg)
1316 * blessed: +3..18 max (+10.5 avg), +9..54 current (+31.5 avg)
1317 * uncursed: +2..12 max (+ 7 avg), +6..36 current (+21 avg)
1318 * cursed: -1.. 6 max (- 3.5 avg), -3..18 current (-10.5 avg)
1320 num = d(otmp->blessed ? 3 : !otmp->cursed ? 2 : 1, 6);
1322 num = -num; /* subtract instead of add when cursed */
1327 if (u.uen > u.uenmax)
1329 else if (u.uen <= 0)
1332 exercise(A_WIS, TRUE);
1335 case POT_OIL: { /* P. Winner */
1336 boolean good_for_you = FALSE;
1338 if (otmp->lamplit) {
1339 if (likes_fire(youmonst.data)) {
1341 pline("Ahh, a refreshing drink.");
1343 pline("
\82í
\81[
\82¨
\81C
\90¶
\82«
\95Ô
\82é
\81D");
1344 good_for_you = TRUE;
1347 You("burn your %s.", body_part(FACE));
1349 Your("%s
\82Í
\8d\95\8fÅ
\82°
\82É
\82È
\82Á
\82½
\81D", body_part(FACE));
1352 losehp(d(Fire_resistance ? 1 : 3, 4), "burning potion of oil",
1354 losehp(d(Fire_resistance ? 1 : 3, 4), "
\94R
\82¦
\82Ä
\82¢
\82é
\96û
\82ð
\88ù
\82ñ
\82Å",
1357 } else if (otmp->cursed)
1359 pline("This tastes like castor oil.");
1361 pline("
\82Ð
\82Ü
\82µ
\96û
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1364 pline("That was smooth!");
1366 pline("
\8cû
\82 \82½
\82è
\82ª
\82æ
\82¢
\81I");
1367 exercise(A_WIS, good_for_you);
1371 if (Acid_resistance) {
1372 /* Not necessarily a creature who _likes_ acid */
1374 pline("This tastes %s.", Hallucination ? "tangy" : "sour");
1376 pline("%s
\96¡
\82ª
\82·
\82é
\81D", Hallucination ? "
\82Ò
\82è
\82Á
\82Æ
\82µ
\82½" : "
\8e_
\82Ì");
1381 pline("This burns%s!",
1382 otmp->blessed ? " a little" : otmp->cursed ? " a lot"
1385 pline("%s
\8fÅ
\82°
\82½
\81I",
1386 otmp->blessed ? "
\8f
\82µ" : otmp->cursed ? "
\82·
\82²
\82"
1389 dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
1391 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1393 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\88ù
\82ñ
\82Å", KILLED_BY_AN);
1394 exercise(A_CON, FALSE);
1397 fix_petrification();
1398 unkn++; /* holy/unholy water can burn like acid too */
1402 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1404 You("
\8f
\82µ%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1409 impossible("What a funny potion! (%u)", otmp->otyp);
1417 make_totter(xtime, talk)
1418 long xtime; /* nonzero if this is an attempt to turn on hallucination */
1421 const char *message = 0;
1424 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\90³
\8fí
\82É
\82È
\82Á
\82½
\81D";
1426 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\96\83á
\83\82µ
\82½
\81D";
1428 set_itimeout(&Totter, xtime);
1434 healup(nhp, nxtra, curesick, cureblind)
1436 register boolean curesick, cureblind;
1442 u.mh = (u.mhmax += nxtra);
1445 if (u.uhp > u.uhpmax)
1446 u.uhp = (u.uhpmax += nxtra);
1450 make_blinded(0L, TRUE);
1452 make_vomiting(0L, TRUE);
1453 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
1460 strange_feeling(obj, txt)
1464 if (flags.beginner || !txt)
1466 You("have a %s feeling for a moment, then it passes.",
1467 Hallucination ? "normal" : "strange");
1469 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
1470 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\8aï
\96
\82È");
1475 if (!obj) /* e.g., crystal ball finds no traps */
1478 if (obj->dknown && !objects[obj->otyp].oc_name_known
1479 && !objects[obj->otyp].oc_uname)
1486 const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
1487 "flask", "jar", "vial" };
1489 const char *bottlenames[] = { "
\95r", "àÞ
\97\9e\95r", "
\88ê
\8f¡
\95r", "
\90\85\8d·
\82µ",
1490 "
\83t
\83\89\83X
\83R", "
\92Ù", "
\83K
\83\89\83X
\95r" };
1496 return bottlenames[rn2(SIZE(bottlenames))];
1499 /* handle item dipped into water potion or steed saddle splashed by same */
1501 H2Opotion_dip(potion, targobj, useeit, objphrase)
1502 struct obj *potion, *targobj;
1504 const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
1506 void FDECL((*func), (OBJ_P)) = 0;
1507 const char *glowcolor = 0;
1508 #define COST_alter (-2)
1509 #define COST_none (-1)
1510 int costchange = COST_none;
1511 boolean altfmt = FALSE, res = FALSE;
1513 if (!potion || potion->otyp != POT_WATER)
1516 if (potion->blessed) {
1517 if (targobj->cursed) {
1519 glowcolor = NH_AMBER;
1520 costchange = COST_UNCURS;
1521 } else if (!targobj->blessed) {
1523 glowcolor = NH_LIGHT_BLUE;
1524 costchange = COST_alter;
1525 altfmt = TRUE; /* "with a <color> aura" */
1527 } else if (potion->cursed) {
1528 if (targobj->blessed) {
1530 glowcolor = "brown";
1531 costchange = COST_UNBLSS;
1532 } else if (!targobj->cursed) {
1534 glowcolor = NH_BLACK;
1535 costchange = COST_alter;
1539 /* dipping into uncursed water; carried() check skips steed saddle */
1540 if (carried(targobj)) {
1541 if (water_damage(targobj, 0, TRUE) != ER_NOTHING)
1546 /* give feedback before altering the target object;
1547 this used to set obj->bknown even when not seeing
1548 the effect; now hero has to see the glow, and bknown
1549 is cleared instead of set if perception is distorted */
1551 glowcolor = hcolor(glowcolor);
1553 pline("%s with %s aura.", objphrase, an(glowcolor));
1555 pline("%s %s.", objphrase, glowcolor);
1556 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1557 targobj->bknown = !Hallucination;
1559 /* potions of water are the only shop goods whose price depends
1560 on their curse/bless state */
1561 if (targobj->unpaid && targobj->otyp == POT_WATER) {
1562 if (costchange == COST_alter)
1563 /* added blessing or cursing; update shop
1564 bill to reflect item's new higher price */
1565 alter_cost(targobj, 0L);
1566 else if (costchange != COST_none)
1567 /* removed blessing or cursing; you
1568 degraded it, now you'll have to buy it... */
1569 costly_alteration(targobj, costchange);
1571 /* finally, change curse/bless state */
1579 potionhit(mon, obj, your_fault)
1580 register struct monst *mon;
1581 register struct obj *obj;
1584 const char *botlnam = bottlename();
1585 boolean isyou = (mon == &youmonst);
1587 struct obj *saddle = (struct obj *) 0;
1588 boolean hit_saddle = FALSE;
1593 pline_The("%s crashes on your %s and breaks into shards.", botlnam,
1596 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1600 losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN);
1602 losehp(Maybe_Half_Phys(rnd(2)), "
\93\8a\82°
\82ç
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1604 /* sometimes it hits the saddle */
1605 if (((mon->misc_worn_check & W_SADDLE)
1606 && (saddle = which_armor(mon, W_SADDLE)))
1608 || (obj->otyp == POT_WATER
1609 && ((rnl(10) > 7 && obj->cursed)
1610 || (rnl(10) < 4 && obj->blessed) || !rn2(3)))))
1612 distance = distu(mon->mx, mon->my);
1613 if (!cansee(mon->mx, mon->my))
1617 pline("
\83K
\83V
\83\83\83\93\81I");
1619 char *mnam = mon_nam(mon);
1622 if (hit_saddle && saddle) {
1624 Sprintf(buf, "%s saddle",
1626 Sprintf(buf, "%s
\82Ì
\88Æ",
1627 s_suffix(x_monnam(mon, ARTICLE_THE, (char *) 0,
1628 (SUPPRESS_IT | SUPPRESS_SADDLE),
1630 } else if (has_head(mon->data)) {
1632 Sprintf(buf, "%s %s", s_suffix(mnam),
1633 (notonhead ? "body" : "head"));
1635 Sprintf(buf, "%s
\82Ì%s", s_suffix(mnam),
1636 (notonhead ? "
\91Ì" : "
\93ª"));
1642 pline_The("%s crashes on %s and breaks into shards.", botlnam,
1645 pline("%s
\82ª%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1649 if (rn2(5) && mon->mhp > 1 && !hit_saddle)
1653 /* oil doesn't instantly evaporate; Neither does a saddle hit */
1654 if (obj->otyp != POT_OIL && !hit_saddle && cansee(mon->mx, mon->my))
1656 pline("%s.", Tobjnam(obj, "evaporate"));
1658 pline("%s
\82Í
\8fö
\94
\82µ
\82½
\81D", xname(obj));
1661 switch (obj->otyp) {
1664 explode_oil(obj, u.ux, u.uy);
1668 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1670 You("%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1671 if (!Unchanging && !Antimagic)
1675 if (!Acid_resistance) {
1678 pline("This burns%s!",
1679 obj->blessed ? " a little"
1680 : obj->cursed ? " a lot" : "");
1682 pline("%s
\94R
\82¦
\82½
\81I",
1683 obj->blessed ? "
\8f
\82µ"
1684 : obj->cursed ? "
\82Í
\82°
\82µ
\82" : "");
1686 dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1688 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1690 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\97\81\82Ñ
\82Ä", KILLED_BY_AN);
1694 } else if (hit_saddle && saddle) {
1695 char *mnam, buf[BUFSZ], saddle_glows[BUFSZ];
1696 boolean affected = FALSE;
1697 boolean useeit = !Blind && canseemon(mon) && cansee(mon->mx, mon->my);
1699 mnam = x_monnam(mon, ARTICLE_THE, (char *) 0,
1700 (SUPPRESS_IT | SUPPRESS_SADDLE), FALSE);
1701 Sprintf(buf, "%s", upstart(s_suffix(mnam)));
1703 switch (obj->otyp) {
1705 Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
1706 affected = H2Opotion_dip(obj, saddle, useeit, saddle_glows);
1709 /* Do we allow the saddle to polymorph? */
1712 if (useeit && !affected)
1713 pline("%s %s wet.", buf, aobjnam(saddle, "get"));
1715 boolean angermon = TRUE;
1719 switch (obj->otyp) {
1721 case POT_EXTRA_HEALING:
1722 case POT_FULL_HEALING:
1723 if (mon->data == &mons[PM_PESTILENCE])
1726 case POT_RESTORE_ABILITY:
1727 case POT_GAIN_ABILITY:
1730 if (mon->mhp < mon->mhpmax) {
1731 mon->mhp = mon->mhpmax;
1734 pline("%s looks sound and hale again.", Monnam(mon));
1736 pline("%s
\82Í
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1740 if (mon->data == &mons[PM_PESTILENCE])
1742 if (dmgtype(mon->data, AD_DISE)
1743 /* won't happen, see prior goto */
1744 || dmgtype(mon->data, AD_PEST)
1745 /* most common case */
1746 || resists_poison(mon)) {
1749 pline("%s looks unharmed.", Monnam(mon));
1751 pline("%s
\82Í
\82È
\82ñ
\82Æ
\82à
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mon));
1756 if ((mon->mhpmax > 3) && !resist(mon, POTION_CLASS, 0, NOTELL))
1758 if ((mon->mhp > 2) && !resist(mon, POTION_CLASS, 0, NOTELL))
1760 if (mon->mhp > mon->mhpmax)
1761 mon->mhp = mon->mhpmax;
1764 pline("%s looks rather ill.", Monnam(mon));
1766 pline("%s
\82Í
\95a
\8bC
\82Á
\82Û
\82
\8c©
\82¦
\82é
\81D", Monnam(mon));
1770 if (!resist(mon, POTION_CLASS, 0, NOTELL))
1773 case POT_INVISIBILITY:
1775 mon_set_minvis(mon);
1778 /* wakeup() doesn't rouse victims of temporary sleep */
1779 if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
1781 pline("%s falls asleep.", Monnam(mon));
1783 pline("%s
\82Í
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D", Monnam(mon));
1788 if (mon->mcanmove) {
1789 /* really should be rnd(5) for consistency with players
1790 * breathing potions, but...
1792 paralyze_monst(mon, rnd(25));
1797 mon_adjust_speed(mon, 1, obj);
1800 if (haseyes(mon->data)) {
1801 register int btmp = 64 + rn2(32)
1802 + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
1804 btmp += mon->mblinded;
1805 mon->mblinded = min(btmp, 127);
1810 if (is_undead(mon->data) || is_demon(mon->data)
1811 || is_were(mon->data) || is_vampshifter(mon)) {
1814 pline("%s %s in pain!", Monnam(mon),
1815 is_silent(mon->data) ? "writhes" : "shrieks");
1817 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
1818 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
1820 if (!is_silent(mon->data))
1821 wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1822 mon->mhp -= d(2, 6);
1823 /* should only be by you */
1826 else if (is_were(mon->data) && !is_human(mon->data))
1827 new_were(mon); /* revert to human */
1828 } else if (obj->cursed) {
1832 pline("%s looks healthier.", Monnam(mon));
1834 pline("%s
\82Í
\82æ
\82è
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1835 mon->mhp += d(2, 6);
1836 if (mon->mhp > mon->mhpmax)
1837 mon->mhp = mon->mhpmax;
1838 if (is_were(mon->data) && is_human(mon->data)
1839 && !Protection_from_shape_changers)
1840 new_were(mon); /* transform into beast */
1842 } else if (mon->data == &mons[PM_GREMLIN]) {
1844 (void) split_mon(mon, (struct monst *) 0);
1845 } else if (mon->data == &mons[PM_IRON_GOLEM]) {
1848 pline("%s rusts.", Monnam(mon));
1850 pline("%s
\82Í
\8eK
\82Ñ
\82½
\81D", Monnam(mon));
1851 mon->mhp -= d(1, 6);
1852 /* should only be by you */
1859 explode_oil(obj, mon->mx, mon->my);
1862 if (!resists_acid(mon) && !resist(mon, POTION_CLASS, 0, NOTELL)) {
1864 pline("%s %s in pain!", Monnam(mon),
1865 is_silent(mon->data) ? "writhes" : "shrieks");
1867 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
1868 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
1870 if (!is_silent(mon->data))
1871 wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1872 mon->mhp -= d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1877 monkilled(mon, "", AD_ACID);
1882 (void) bhitm(mon, obj);
1885 case POT_GAIN_LEVEL:
1886 case POT_LEVITATION:
1887 case POT_FRUIT_JUICE:
1888 case POT_MONSTER_DETECTION:
1889 case POT_OBJECT_DETECTION:
1899 /* Note: potionbreathe() does its own docall() */
1900 if ((distance == 0 || ((distance < 3) && rn2(5)))
1901 && (!breathless(youmonst.data) || haseyes(youmonst.data)))
1903 else if (obj->dknown && !objects[obj->otyp].oc_name_known
1904 && !objects[obj->otyp].oc_uname && cansee(mon->mx, mon->my))
1906 if (*u.ushops && obj->unpaid) {
1907 struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
1910 (void) stolen_value(obj, u.ux, u.uy, (boolean) shkp->mpeaceful,
1915 obfree(obj, (struct obj *) 0);
1918 /* vapors are inhaled or get in your eyes */
1921 register struct obj *obj;
1923 register int i, ii, isdone, kn = 0;
1925 switch (obj->otyp) {
1926 case POT_RESTORE_ABILITY:
1927 case POT_GAIN_ABILITY:
1929 if (!breathless(youmonst.data))
1931 pline("Ulch! That potion smells terrible!");
1933 pline("
\83E
\83Q
\83F
\81I
\96ò
\82Í
\82à
\82Ì
\82·
\82²
\82¢
\93õ
\82¢
\82ª
\82·
\82é
\81I");
1934 else if (haseyes(youmonst.data)) {
1936 const char *eyes = body_part(EYE);
1938 if (eyecount(youmonst.data) != 1)
1939 eyes = makeplural(eyes);
1940 Your("%s %s!", eyes, vtense(eyes, "sting"));
1942 Your("%s
\82ª
\82¸
\82«
\82¸
\82«
\82·
\82é
\81I", body_part(EYE));
1947 i = rn2(A_MAX); /* start at a random point */
1948 for (isdone = ii = 0; !isdone && ii < A_MAX; ii++) {
1949 if (ABASE(i) < AMAX(i)) {
1951 /* only first found if not blessed */
1952 isdone = !(obj->blessed);
1960 case POT_FULL_HEALING:
1961 if (Upolyd && u.mh < u.mhmax)
1962 u.mh++, context.botl = 1;
1963 if (u.uhp < u.uhpmax)
1964 u.uhp++, context.botl = 1;
1966 case POT_EXTRA_HEALING:
1967 if (Upolyd && u.mh < u.mhmax)
1968 u.mh++, context.botl = 1;
1969 if (u.uhp < u.uhpmax)
1970 u.uhp++, context.botl = 1;
1973 if (Upolyd && u.mh < u.mhmax)
1974 u.mh++, context.botl = 1;
1975 if (u.uhp < u.uhpmax)
1976 u.uhp++, context.botl = 1;
1977 exercise(A_CON, TRUE);
1980 if (!Role_if(PM_HEALER)) {
1993 exercise(A_CON, FALSE);
1996 case POT_HALLUCINATION:
1998 You("have a momentary vision.");
2000 You("
\88ê
\8fu
\8c¶
\89e
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D");
2006 You_feel("somewhat dizzy.");
2008 You("
\82ß
\82Ü
\82¢
\82ð
\8a´
\82¶
\82½
\81D");
2009 make_confused(itimeout_incr(HConfusion, rnd(5)), FALSE);
2011 case POT_INVISIBILITY:
2012 if (!Blind && !Invis) {
2015 pline("For an instant you %s!",
2016 See_invisible ? "could see right through yourself"
2017 : "couldn't see yourself");
2019 pline("
\88ê
\8fu
\8e©
\95ª
\8e©
\90g
\82ª%s
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81I",
2020 See_invisible ? "
\90³
\82µ
\82"
2029 pline("%s seems to be holding you.", Something);
2031 pline("%s
\82ª
\82 \82È
\82½
\82ð
\82Â
\82©
\82Ü
\82¦
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Something);
2033 multi_reason = "frozen by a potion";
2034 nomovemsg = You_can_move_again;
2035 exercise(A_DEX, FALSE);
2038 You("stiffen momentarily.");
2040 You("
\88ê
\8fu
\8dd
\92¼
\82µ
\82½
\81D");
2044 if (!Free_action && !Sleep_resistance) {
2046 You_feel("rather tired.");
2048 You("
\82·
\82±
\82µ
\94æ
\82ê
\82½
\81D");
2050 multi_reason = "sleeping off a magical draught";
2051 nomovemsg = You_can_move_again;
2052 exercise(A_DEX, FALSE);
2057 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
2062 Your("knees seem more flexible now.");
2064 Your("
\95G
\82Í
\82æ
\82è
\82·
\82Î
\82â
\82
\93®
\82
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
2065 incr_itimeout(&HFast, rnd(5));
2066 exercise(A_DEX, TRUE);
2069 if (!Blind && !Unaware) {
2072 pline("It suddenly gets dark.");
2074 pline("
\93Ë
\91R
\88Ã
\82
\82È
\82Á
\82½
\81D");
2076 make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
2077 if (!Blind && !Unaware)
2078 Your1(vision_clears);
2081 if (u.umonnum == PM_GREMLIN) {
2082 (void) split_mon(&youmonst, (struct monst *) 0);
2083 } else if (u.ulycn >= LOW_PM) {
2084 /* vapor from [un]holy water will trigger
2085 transformation but won't cure lycanthropy */
2086 if (obj->blessed && youmonst.data == &mons[u.ulycn])
2088 else if (obj->cursed && !Upolyd)
2094 exercise(A_CON, FALSE);
2097 case POT_GAIN_LEVEL:
2098 case POT_LEVITATION:
2099 case POT_FRUIT_JUICE:
2100 case POT_MONSTER_DETECTION:
2101 case POT_OBJECT_DETECTION:
2106 /* note: no obfree() */
2109 makeknown(obj->otyp);
2110 else if (!objects[obj->otyp].oc_name_known
2111 && !objects[obj->otyp].oc_uname)
2116 /* returns the potion type when o1 is dipped in o2 */
2119 register struct obj *o1, *o2;
2121 /* cut down on the number of cases below */
2122 if (o1->oclass == POTION_CLASS
2123 && (o2->otyp == POT_GAIN_LEVEL || o2->otyp == POT_GAIN_ENERGY
2124 || o2->otyp == POT_HEALING || o2->otyp == POT_EXTRA_HEALING
2125 || o2->otyp == POT_FULL_HEALING || o2->otyp == POT_ENLIGHTENMENT
2126 || o2->otyp == POT_FRUIT_JUICE)) {
2138 case POT_GAIN_LEVEL:
2139 case POT_GAIN_ENERGY:
2140 return POT_EXTRA_HEALING;
2142 case POT_EXTRA_HEALING:
2144 case POT_GAIN_LEVEL:
2145 case POT_GAIN_ENERGY:
2146 return POT_FULL_HEALING;
2148 case POT_FULL_HEALING:
2150 case POT_GAIN_LEVEL:
2151 case POT_GAIN_ENERGY:
2152 return POT_GAIN_ABILITY;
2157 return POT_FRUIT_JUICE;
2158 case POT_HALLUCINATION:
2164 case AMETHYST: /* "a-methyst" == "not intoxicated" */
2165 if (o2->otyp == POT_BOOZE)
2166 return POT_FRUIT_JUICE;
2168 case POT_GAIN_LEVEL:
2169 case POT_GAIN_ENERGY:
2172 return (rn2(3) ? POT_BOOZE : POT_ENLIGHTENMENT);
2174 return POT_EXTRA_HEALING;
2175 case POT_EXTRA_HEALING:
2176 return POT_FULL_HEALING;
2177 case POT_FULL_HEALING:
2178 return POT_GAIN_ABILITY;
2179 case POT_FRUIT_JUICE:
2180 return POT_SEE_INVISIBLE;
2182 return POT_HALLUCINATION;
2185 case POT_FRUIT_JUICE:
2188 return POT_SICKNESS;
2191 case POT_GAIN_LEVEL:
2192 case POT_GAIN_ENERGY:
2193 return POT_SEE_INVISIBLE;
2196 case POT_ENLIGHTENMENT:
2198 case POT_LEVITATION:
2200 return POT_GAIN_LEVEL;
2202 case POT_FRUIT_JUICE:
2205 return POT_CONFUSION;
2217 register struct obj *potion, *obj;
2218 struct obj *singlepotion;
2222 char qbuf[QBUFSZ], qtoo[QBUFSZ];
2224 allowall[0] = ALL_CLASSES;
2226 if (!(obj = getobj(allowall, "dip")))
2228 if (inaccessible_equipment(obj, "dip", FALSE))
2232 Sprintf(qbuf, "dip %s into", thesimpleoname(obj));
2234 Sprintf(qbuf, "%s
\82ð
\90Z
\82µ
\82Ü
\82·
\82©", thesimpleoname(obj));
2236 here = levl[u.ux][u.uy].typ;
2237 /* Is there a fountain to dip into here? */
2238 if (IS_FOUNTAIN(here)) {
2239 /* "Dip <the object> into the fountain?" */
2241 Sprintf(qtoo, "%s the fountain?", qbuf);
2243 Sprintf(qtoo, "
\90ò
\82É%s
\81H", qbuf);
2245 if (yn(upstart(qtoo)) == 'y') {
2249 } else if (is_pool(u.ux, u.uy)) {
2250 const char *pooltype = waterbody_name(u.ux, u.uy);
2252 /* "Dip <the object> into the {pool, moat, &c}?" */
2254 Sprintf(qtoo, "%s the %s?", qbuf, pooltype);
2256 Sprintf(qtoo, "%s
\82É%s
\81H", pooltype, qbuf);
2258 if (yn(upstart(qtoo)) == 'y') {
2260 floating_above(pooltype);
2261 } else if (u.usteed && !is_swimmer(u.usteed->data)
2262 && P_SKILL(P_RIDING) < P_BASIC) {
2263 rider_cant_reach(); /* not skilled enough to reach */
2265 if (obj->otyp == POT_ACID)
2267 if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use)
2274 /* "What do you want to dip <the object> into?" */
2275 potion = getobj(beverages, qbuf); /* "dip into" */
2278 if (potion == obj && potion->quan == 1L) {
2280 pline("That is a potion bottle, not a Klein bottle!");
2282 pline("
\82±
\82ê
\82Í
\96ò
\95r
\82¾
\81I
\83N
\83\89\83C
\83\93\82Ì
\92Ù
\82¶
\82á
\82È
\82¢
\81I");
2285 potion->in_use = TRUE; /* assume it will be used up */
2286 if (potion->otyp == POT_WATER) {
2287 boolean useeit = !Blind || (obj == ublindf && Blindfolded_only);
2288 const char *obj_glows = Yobjnam2(obj, "glow");
2290 if (H2Opotion_dip(potion, obj, useeit, obj_glows))
2292 } else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
2293 /* some objects can't be polymorphed */
2294 if (obj->otyp == potion->otyp /* both POT_POLY */
2295 || obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
2296 || obj == uball || obj == uskin
2297 || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
2299 pline1(nothing_happens);
2301 boolean was_wep, was_swapwep, was_quiver;
2302 short save_otyp = obj->otyp;
2305 u.uconduct.polypiles++;
2307 was_wep = (obj == uwep);
2308 was_swapwep = (obj == uswapwep);
2309 was_quiver = (obj == uquiver);
2311 obj = poly_obj(obj, STRANGE_OBJECT);
2315 else if (was_swapwep)
2317 else if (was_quiver)
2320 if (obj->otyp != save_otyp) {
2321 makeknown(POT_POLYMORPH);
2323 prinv((char *) 0, obj, 0L);
2327 pline("Nothing seems to happen.");
2329 pline("
\89½
\82à
\8bN
\82±
\82ç
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2333 potion->in_use = FALSE; /* didn't go poof */
2335 } else if (obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {
2336 long amt = obj->quan;
2339 Strcpy(qbuf, "The");
2343 if (amt > (objects[potion->otyp].oc_magic ? 2L : 9L)) {
2344 /* trying to dip multiple potions will usually affect only a
2345 subset; pick an amount between 2 and min(N,9), inclusive */
2348 amt = (long) rnd((int) amt);
2349 } while (amt >= 9L);
2351 if (amt < obj->quan) {
2352 obj = splitobj(obj, amt);
2354 Sprintf(qbuf, "%ld of the", obj->quan);
2356 Sprintf(qbuf, "%ld
\96{
\82Ì", obj->quan);
2360 /* [N of] the {obj(s)} mix(es) with [one of] {the potion}... */
2362 pline("%s %s %s with %s%s...", qbuf, simpleonames(obj),
2363 otense(obj, "mix"), (potion->quan > 1L) ? "one of " : "",
2364 thesimpleoname(potion));
2365 #else /* [N
\96{
\82Ì]{obj}
\82ð{the potion}[
\82Ì
\88ê
\82Â]
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D */
2366 pline("%s%s
\82ð%s%s
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D", qbuf, simpleonames(obj),
2367 thesimpleoname(potion),
2368 (potion->quan > 1L) ? "
\82Ì
\88ê
\82Â" : "");
2370 /* Mixing potions is dangerous...
2371 KMH, balance patch -- acid is particularly unstable */
2372 if (obj->cursed || obj->otyp == POT_ACID || !rn2(10)) {
2373 /* it would be better to use up the whole stack in advance
2374 of the message, but we can't because we need to keep it
2375 around for potionbreathe() [and we can't set obj->in_use
2376 to 'amt' because that's not implemented] */
2379 pline("BOOM! They explode!");
2381 pline("
\83o
\81[
\83\93\81I
\94\9a\94
\82µ
\82½
\81I");
2382 wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
2383 exercise(A_STR, FALSE);
2384 if (!breathless(youmonst.data) || haseyes(youmonst.data))
2388 losehp((int) (amt + rnd(9)), /* not physical damage */
2390 "alchemic blast", KILLED_BY_AN);
2392 "
\92²
\8d\87\82Ì
\8e¸
\94s
\82Å", KILLED_BY_AN);
2396 obj->blessed = obj->cursed = obj->bknown = 0;
2397 if (Blind || Hallucination)
2400 if ((mixture = mixtype(obj, potion)) != 0) {
2401 obj->otyp = mixture;
2403 switch (obj->odiluted ? 1 : rnd(8)) {
2405 obj->otyp = POT_WATER;
2409 obj->otyp = POT_SICKNESS;
2412 struct obj *otmp = mkobj(POTION_CLASS, FALSE);
2414 obj->otyp = otmp->otyp;
2415 obfree(otmp, (struct obj *) 0);
2423 pline_The("mixture glows brightly and evaporates.");
2425 pline("
\8d¬
\82º
\82é
\82Æ
\96ò
\82Í
\96¾
\82é
\82
\8bP
\82«
\81C
\8fö
\94
\82µ
\82½
\81D");
2429 obj->odiluted = (obj->otyp != POT_WATER);
2431 if (obj->otyp == POT_WATER && !Hallucination) {
2433 pline_The("mixture bubbles%s.", Blind ? "" : ", then clears");
2435 pline("
\96ò
\82ð
\8d¬
\82º
\82é
\82Æ%s
\96A
\82¾
\82Á
\82½
\81D", Blind ? "" : "
\82µ
\82Î
\82ç
\82");
2436 } else if (!Blind) {
2438 pline_The("mixture looks %s.",
2440 pline("
\8d¬
\82º
\82½
\96ò
\82Í%s
\96ò
\82É
\8c©
\82¦
\82é
\81D",
2441 hcolor(OBJ_DESCR(objects[obj->otyp])));
2445 /* this is required when 'obj' was split off from a bigger stack,
2446 so that 'obj' will now be assigned its own inventory slot;
2447 it has a side-effect of merging 'obj' into another compatible
2448 stack if there is one, so we do it even when no split has
2449 been made in order to get the merge result for both cases;
2450 as a consequence, mixing while Fumbling drops the mixture */
2452 (void) hold_another_object(obj, "You drop %s!", doname(obj),
2457 if (potion->otyp == POT_ACID && obj->otyp == CORPSE
2458 && obj->corpsenm == PM_LICHEN && !Blind) {
2459 pline("%s %s %s around the edges.", The(cxname(obj)),
2460 otense(obj, "turn"),
2461 potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED));
2462 potion->in_use = FALSE; /* didn't go poof */
2466 if (potion->otyp == POT_WATER && obj->otyp == TOWEL) {
2467 pline_The("towel soaks it up!");
2468 /* wetting towel already done via water_damage() in H2Opotion_dip */
2472 if (is_poisonable(obj)) {
2473 if (potion->otyp == POT_SICKNESS && !obj->opoisoned) {
2476 if (potion->quan > 1L)
2478 Sprintf(buf, "One of %s", the(xname(potion)));
2480 Sprintf(buf, "%s
\82Ì
\88ê
\82Â", the(xname(potion)));
2482 Strcpy(buf, The(xname(potion)));
2484 pline("%s forms a coating on %s.", buf, the(xname(obj)));
2486 pline("%s
\82ª%s
\82É
\93h
\82ç
\82ê
\82½
\81D", buf, the(xname(obj)));
2487 obj->opoisoned = TRUE;
2489 } else if (obj->opoisoned && (potion->otyp == POT_HEALING
2490 || potion->otyp == POT_EXTRA_HEALING
2491 || potion->otyp == POT_FULL_HEALING)) {
2493 pline("A coating wears off %s.", the(xname(obj)));
2495 pline("
\93Å
\82ª%s
\82©
\82ç
\94\8d\82°
\82¨
\82¿
\82½
\81D", the(xname(obj)));
2501 if (potion->otyp == POT_ACID) {
2502 if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING)
2506 if (potion->otyp == POT_OIL) {
2507 boolean wisx = FALSE;
2509 if (potion->lamplit) { /* burning */
2510 fire_damage(obj, TRUE, u.ux, u.uy);
2511 } else if (potion->cursed) {
2513 pline_The("potion spills and covers your %s with oil.",
2515 pline("
\96û
\82Í
\94ò
\82Ñ
\8eU
\82è
\82 \82È
\82½
\82Ì%s
\82É
\82©
\82©
\82Á
\82½
\81D",
2516 makeplural(body_part(FINGER)));
2517 incr_itimeout(&Glib, d(2, 10));
2518 } else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
2519 /* the following cases apply only to weapons */
2521 /* Oil removes rust and corrosion, but doesn't unburn.
2522 * Arrows, etc are classed as metallic due to arrowhead
2523 * material, but dipping in oil shouldn't repair them.
2525 } else if ((!is_rustprone(obj) && !is_corrodeable(obj))
2526 || is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
2527 /* uses up potion, doesn't set obj->greased */
2529 pline("%s %s with an oily sheen.", Yname2(obj),
2530 otense(obj, "gleam"));
2532 pline("%s
\82Í
\96û
\82Ì
\8cõ
\91ò
\82Å
\82«
\82ç
\82è
\82Æ
\8cõ
\82Á
\82½
\81D", Yname2(obj));
2536 pline("%s %s less %s.", Yname2(obj), otense(obj, "are"),
2537 (obj->oeroded && obj->oeroded2)
2538 ? "corroded and rusty"
2539 : obj->oeroded ? "rusty" : "corroded");
2541 pline("%s
\82Ì%s
\82ª
\8eæ
\82ê
\82½
\81D", Yname2(obj),
2542 (obj->oeroded && obj->oeroded2)
2543 ? "
\95\85\90H
\82Æ
\8eK"
2544 : obj->oeroded ? "
\8eK" : "
\95\85\90H");
2546 if (obj->oeroded > 0)
2548 if (obj->oeroded2 > 0)
2552 exercise(A_WIS, wisx);
2553 makeknown(potion->otyp);
2559 /* Allow filling of MAGIC_LAMPs to prevent identification by player */
2560 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP)
2561 && (potion->otyp == POT_OIL)) {
2562 /* Turn off engine before fueling, turn off fuel too :-) */
2563 if (obj->lamplit || potion->lamplit) {
2565 explode(u.ux, u.uy, 11, d(6, 6), 0, EXPL_FIERY);
2566 exercise(A_WIS, FALSE);
2569 /* Adding oil to an empty magic lamp renders it into an oil lamp */
2570 if ((obj->otyp == MAGIC_LAMP) && obj->spe == 0) {
2571 obj->otyp = OIL_LAMP;
2574 if (obj->age > 1000L) {
2576 pline("%s %s full.", Yname2(obj), otense(obj, "are"));
2578 pline("%s
\82É
\82Í
\82½
\82Á
\82Õ
\82è
\93ü
\82Á
\82Ä
\82¢
\82é
\81D", Yname2(obj));
2579 potion->in_use = FALSE; /* didn't go poof */
2582 You("fill %s with oil.", yname(obj));
2584 You("%s
\82É
\96û
\82ð
\93ü
\82ê
\82½
\81D", yname(obj));
2585 check_unpaid(potion); /* Yendorian Fuel Tax */
2586 obj->age += 2 * potion->age; /* burns more efficiently */
2587 if (obj->age > 1500L)
2590 exercise(A_WIS, TRUE);
2598 potion->in_use = FALSE; /* didn't go poof */
2599 if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST)
2600 && (mixture = mixtype(obj, potion)) != 0) {
2601 char oldbuf[BUFSZ], newbuf[BUFSZ];
2602 short old_otyp = potion->otyp;
2603 boolean old_dknown = FALSE;
2604 boolean more_than_one = potion->quan > 1L;
2607 if (potion->dknown) {
2610 Sprintf(oldbuf, "%s ", hcolor(OBJ_DESCR(objects[potion->otyp])));
2612 Sprintf(oldbuf, "%s", hcolor(OBJ_DESCR(objects[potion->otyp])));
2614 /* with multiple merged potions, split off one and
2616 if (potion->quan > 1L) {
2617 singlepotion = splitobj(potion, 1L);
2619 singlepotion = potion;
2621 costly_alteration(singlepotion, COST_NUTRLZ);
2622 singlepotion->otyp = mixture;
2623 singlepotion->blessed = 0;
2624 if (mixture == POT_WATER)
2625 singlepotion->cursed = singlepotion->odiluted = 0;
2627 singlepotion->cursed = obj->cursed; /* odiluted left as-is */
2628 singlepotion->bknown = FALSE;
2630 singlepotion->dknown = FALSE;
2632 singlepotion->dknown = !Hallucination;
2634 if (mixture == POT_WATER && singlepotion->dknown)
2635 Sprintf(newbuf, "clears");
2637 Sprintf(newbuf, "turns %s",
2638 hcolor(OBJ_DESCR(objects[mixture])));
2639 pline_The("%spotion%s %s.", oldbuf,
2640 more_than_one ? " that you dipped into" : "", newbuf);
2642 if (mixture == POT_WATER && singlepotion->dknown)
2643 Sprintf(newbuf, "
\93§
\96¾");
2645 Sprintf(newbuf, "%s
\96ò",
2646 hcolor(OBJ_DESCR(objects[mixture])));
2647 pline_The("%s%s
\96ò
\82Í%s
\82É
\82È
\82Á
\82½
\81D.", more_than_one ? "
\90Z
\82µ
\82½" : "",
2650 if (!objects[old_otyp].oc_uname
2651 && !objects[old_otyp].oc_name_known && old_dknown) {
2655 fakeobj.otyp = old_otyp;
2656 fakeobj.oclass = POTION_CLASS;
2660 obj_extract_self(singlepotion);
2663 hold_another_object(singlepotion, "You juggle and drop %s!",
2665 hold_another_object(singlepotion, "
\82¨
\8eè
\8bÊ
\82µ
\82Ä%s
\82ð
\97\8e\82Æ
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I",
2666 doname(singlepotion), (const char *) 0);
2672 pline("Interesting...");
2674 pline("
\96Ê
\94\92\82¢
\81D
\81D
\81D");
2678 if (!objects[potion->otyp].oc_name_known
2679 && !objects[potion->otyp].oc_uname)
2685 /* *monp grants a wish and then leaves the game */
2688 struct monst **monp;
2690 struct monst *mon = *monp;
2691 int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
2693 /* remove the monster first in case wish proves to be fatal
2694 (blasted by artifact), to keep it out of resulting bones file */
2696 *monp = 0; /* inform caller that monster is gone */
2697 /* hide that removal from player--map is visible during wish prompt */
2698 tmp_at(DISP_ALWAYS, glyph);
2700 /* grant the wish */
2703 tmp_at(DISP_END, 0);
2707 djinni_from_bottle(obj)
2713 if (!(mtmp = makemon(&mons[PM_DJINNI], u.ux, u.uy, NO_MM_FLAGS))) {
2715 pline("It turns out to be empty.");
2717 if (obj->otyp == MAGIC_LAMP) {
2718 pline("
\83\89\83\93\83v
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2720 pline("
\96ò
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2728 pline("In a cloud of smoke, %s emerges!", a_monnam(mtmp));
2730 pline("
\89\8c\82Ì
\92\86\82©
\82ç
\81C%s
\82ª
\8c»
\82í
\82ê
\82½
\81I", a_monnam(mtmp));
2732 pline("%s speaks.", Monnam(mtmp));
2734 pline("%s
\82Í
\98b
\82µ
\82©
\82¯
\82½
\81D", Monnam(mtmp));
2737 You("smell acrid fumes.");
2739 You("
\83c
\83\93\82Æ
\82·
\82é
\93õ
\82¢
\82ª
\82µ
\82½
\81D");
2741 pline("%s speaks.", Something);
2743 pline("%s
\82ª
\98b
\82µ
\82©
\82¯
\82½
\81D", Something);
2748 chance = (chance == 4) ? rnd(4) : 0;
2749 else if (obj->cursed)
2750 chance = (chance == 0) ? rn2(4) : 4;
2751 /* 0,1,2,3,4: b=80%,5,5,5,5; nc=20%,20,20,20,20; c=5%,5,5,5,80 */
2756 verbalize("I am in your debt. I will grant one wish!");
2758 verbalize("
\82¨
\91O
\82É
\82Í
\8eØ
\82è
\82ª
\82Å
\82«
\82½
\81D
\88ê
\82Â
\8aè
\82¢
\82ð
\82©
\82È
\82¦
\82Ä
\82â
\82ë
\82¤
\81I");
2759 /* give a wish and discard the monster (mtmp set to null) */
2760 mongrantswish(&mtmp);
2764 verbalize("Thank you for freeing me!");
2766 verbalize("
\8e\84\82ð
\8f\95\82¯
\82Ä
\82
\82ê
\82½
\82±
\82Æ
\82ð
\8a´
\8eÓ
\82·
\82é
\81I");
2767 (void) tamedog(mtmp, (struct obj *) 0);
2771 verbalize("You freed me!");
2773 verbalize("
\89ð
\95ú
\82µ
\82Ä
\82
\82ê
\82½
\82Ì
\82Í
\82¨
\91O
\82©
\81I");
2774 mtmp->mpeaceful = TRUE;
2779 verbalize("It is about time!");
2781 verbalize("
\82³
\82ç
\82Î
\82¾
\81I");
2782 if (canspotmon(mtmp))
2784 pline("%s vanishes.", Monnam(mtmp));
2786 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81D", Monnam(mtmp));
2791 verbalize("You disturbed me, fool!");
2793 verbalize("
\82¨
\82Ü
\82¦
\82Í
\8e\84\82Ì
\96°
\82è
\82ð
\96W
\82°
\82½
\81D
\82¨
\82ë
\82©
\82à
\82Ì
\82ß
\81I");
2794 mtmp->mpeaceful = FALSE;
2800 /* clone a gremlin or mold (2nd arg non-null implies heat as the trigger);
2801 hit points are cut in half (odd HP stays with original) */
2803 split_mon(mon, mtmp)
2804 struct monst *mon, /* monster being split */
2805 *mtmp; /* optional attacker whose heat triggered it */
2807 struct monst *mtmp2;
2813 Sprintf(reason, " from %s heat",
2814 (mtmp == &youmonst) ? the_your[1]
2815 : (const char *) s_suffix(mon_nam(mtmp)));
2817 Sprintf(reason, "%s
\82Ì
\94M
\82Å",
2818 (mtmp == &youmonst) ? the_your[1]
2819 : (const char *) s_suffix(mon_nam(mtmp)));
2822 if (mon == &youmonst) {
2825 mtmp2->mhpmax = u.mhmax / 2;
2826 u.mhmax -= mtmp2->mhpmax;
2829 You("multiply%s!", reason);
2831 You("%s
\95ª
\97ô
\82µ
\82½
\81I", reason);
2834 mtmp2 = clone_mon(mon, 0, 0);
2836 mtmp2->mhpmax = mon->mhpmax / 2;
2837 mon->mhpmax -= mtmp2->mhpmax;
2838 if (canspotmon(mon))
2840 pline("%s multiplies%s!", Monnam(mon), reason);
2842 pline("%s
\82Í%s
\95ª
\97ô
\82µ
\82½
\81I", Monnam(mon), reason);