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("
\82
\82ç
\82
\82ç
\82µ
\82½
\81D
\81D
\81D");
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;
275 /* we need to probe ahead in case the Eyes of the Overworld
276 are or will be overriding blindness */
277 u_could_see = !Blind;
278 Blinded = xtime ? 1L : 0L;
279 can_see_now = !Blind;
280 Blinded = old; /* restore */
285 if (can_see_now && !u_could_see) { /* regaining sight */
289 pline("Far out! Everything is all cosmic again!");
291 pline("
\82°
\81I
\82È
\82É
\82à
\82©
\82à
\82ª
\82Ü
\82½
\93ø
\90F
\82É
\8c©
\82¦
\82é
\81I");
294 You("can see again.");
296 You("
\82Ü
\82½
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
298 } else if (old && !xtime) {
299 /* clearing temporary blindness without toggling blindness */
301 if (!haseyes(youmonst.data)) {
302 strange_feeling((struct obj *) 0, (char *) 0);
303 } else if (Blindfolded) {
305 eyes = body_part(EYE);
306 if (eyecount(youmonst.data) != 1)
307 eyes = makeplural(eyes);
308 Your(eyemsg, eyes, vtense(eyes, "itch"));
310 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
312 } else { /* Eyes of the Overworld */
314 Your(vismsg, "brighten", Hallucination ? "sadder" : "normal");
316 Your(vismsg, "
\96¾
\82é
\82", Hallucination ? "
\8dª
\88Ã
\82É" : "
\95\81\92Ê
\82É");
321 if (u_could_see && !can_see_now) { /* losing sight */
325 pline("Oh, bummer! Everything is dark! Help!");
327 pline("
\88Ã
\82¢
\82æ
\81[
\81C
\8b·
\82¢
\82æ
\81[
\81C
\8b°
\82¢
\82æ
\81[
\81I");
330 pline("A cloud of darkness falls upon you.");
332 pline("
\88Ã
\8d\95\82Ì
\89_
\82ª
\82 \82È
\82½
\82ð
\95¢
\82Á
\82½
\81D");
334 /* Before the hero goes blind, set the ball&chain variables. */
337 } else if (!old && xtime) {
338 /* setting temporary blindness without toggling blindness */
340 if (!haseyes(youmonst.data)) {
341 strange_feeling((struct obj *) 0, (char *) 0);
342 } else if (Blindfolded) {
344 eyes = body_part(EYE);
345 if (eyecount(youmonst.data) != 1)
346 eyes = makeplural(eyes);
347 Your(eyemsg, eyes, vtense(eyes, "twitch"));
349 Your(eyemsg, body_part(EYE), "
\83s
\83N
\83s
\83N
\82µ
\82½");
351 } else { /* Eyes of the Overworld */
353 Your(vismsg, "dim", Hallucination ? "happier" : "normal");
355 Your(vismsg, "
\94\96\88Ã
\82", Hallucination ? "
\83n
\83b
\83s
\81[
\82É" : "
\95\81\92Ê
\82É");
360 set_itimeout(&Blinded, xtime);
362 if (u_could_see ^ can_see_now) { /* one or the other but not both */
364 vision_full_recalc = 1; /* blindness just got toggled */
365 /* this vision recalculation used to be deferred until
366 moveloop(), but that made it possible for vision
367 irregularities to occur (cited case was force bolt
368 hitting adjacent potion of blindness and then a
369 secret door; hero was blinded by vapors but then
370 got the message "a door appears in the wall") */
372 if (Blind_telepat || Infravision)
375 /* avoid either of the sequences
376 "Sting starts glowing", [become blind], "Sting stops quivering" or
377 "Sting starts quivering", [regain sight], "Sting stops glowing"
378 by giving "Sting is quivering" when becoming blind or
379 "Sting is glowing" when regaining sight so that the eventual
380 "stops" message matches */
381 if (warn_obj_cnt && uwep && (EWarn_of_mon & W_WEP) != 0L)
383 /* update dknown flag for inventory picked up while blind */
385 learn_unseen_invent();
390 make_hallucinated(xtime, talk, mask)
391 long xtime; /* nonzero if this is an attempt to turn on hallucination */
393 long mask; /* nonzero if resistance status should change by mask */
395 long old = HHallucination;
397 const char *message, *verb;
403 message = (!xtime) ? "Everything %s SO boring now."
404 : "Oh wow! Everything %s so cosmic!";
406 message = (!xtime) ? "
\89½
\82à
\82©
\82à
\82ª
\81\96\91Þ
\8bü
\81\96\82É%s
\82é
\81D"
407 : "
\83\8f\81[
\83I
\81I
\89½
\82à
\82©
\82à
\93ø
\90F
\82É%s
\82é
\81I";
410 verb = (!Blind) ? "looks" : "feels";
412 verb = (!Blind) ? "
\8c©
\82¦" : "
\8a´
\82¶";
419 EHalluc_resistance |= mask;
421 EHalluc_resistance &= ~mask;
423 if (!EHalluc_resistance && (!!HHallucination != !!xtime))
425 set_itimeout(&HHallucination, xtime);
427 /* clearing temporary hallucination without toggling vision */
428 if (!changed && !HHallucination && old && talk) {
429 if (!haseyes(youmonst.data)) {
430 strange_feeling((struct obj *) 0, (char *) 0);
433 const char *eyes = body_part(EYE);
435 if (eyecount(youmonst.data) != 1)
436 eyes = makeplural(eyes);
437 Your(eyemsg, eyes, vtense(eyes, "itch"));
439 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
441 } else { /* Grayswandir */
443 Your(vismsg, "flatten", "normal");
445 Your(vismsg, "
\82¨
\82©
\82µ
\82", "
\95\81\92Ê
\82É");
451 /* in case we're mimicking an orange (hallucinatory form
452 of mimicking gold) update the mimicking's-over message */
457 swallowed(0); /* redraw swallow display */
459 /* The see_* routines should be called *before* the pline. */
465 /* for perm_inv and anything similar
466 (eg. Qt windowport's equipped items display) */
471 pline(message, verb);
477 make_deaf(xtime, talk)
482 boolean toggled = FALSE;
490 You("can hear again.");
492 You("
\82Ü
\82½
\95·
\82±
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
494 } else if (xtime && !old) {
497 You("are unable to hear anything.");
499 You("
\89½
\82à
\95·
\82±
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
502 /* deafness isn't presently shown on status line, but
503 request a status update in case that changes someday */
507 set_itimeout(&HDeaf, xtime);
513 struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS);
517 pline("This bottle turns out to be empty.");
519 pline("
\95r
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
524 pline("As you open the bottle, %s emerges.", something);
526 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\89½
\82©
\82ª
\8fo
\82Ä
\82«
\82½
\81D");
530 pline("As you open the bottle, an enormous %s emerges!",
531 Hallucination ? rndmonnam(NULL) : (const char *) "ghost");
533 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\8b\90\91å
\82È%s
\82ª
\8fo
\82Ä
\82«
\82½
\81I",
534 Hallucination ? rndmonnam(NULL) : (const char *) "
\97H
\97ì");
538 You("are frightened to death, and unable to move.");
540 You("
\82Ü
\82Á
\82³
\82¨
\82É
\82È
\82Á
\82Ä
\8bÁ
\82«
\81C
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
543 multi_reason = "being frightened to death";
545 multi_reason = "
\8e\80\82Ê
\82Ù
\82Ç
\8bÁ
\82¢
\82½
\8c\84\82É";
547 nomovemsg = "You regain your composure.";
549 nomovemsg = "
\82 \82È
\82½
\82Í
\95½
\90Ã
\82ð
\8eæ
\82è
\96ß
\82µ
\82½
\81D";
552 /* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
556 register struct obj *otmp;
557 const char *potion_descr;
561 pline("If you can't breathe air, how can you drink liquid?");
563 pline("
\91§
\82à
\82Å
\82«
\82È
\82¢
\82Ì
\82É
\81C
\82Ç
\82¤
\82â
\82Á
\82Ä
\89t
\91Ì
\82ð
\88ù
\82Þ
\82ñ
\82¾
\82¢
\81H");
566 /* Is there a fountain to drink from here? */
567 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
568 /* not as low as floor level but similar restrictions apply */
569 && can_reach_floor(FALSE)) {
571 if (yn("Drink from the fountain?") == 'y') {
573 if (yn("
\90ò
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
578 /* Or a kitchen sink? */
579 if (IS_SINK(levl[u.ux][u.uy].typ)
580 /* not as low as floor level but similar restrictions apply */
581 && can_reach_floor(FALSE)) {
583 if (yn("Drink from the sink?") == 'y') {
585 if (yn("
\97¬
\82µ
\91ä
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
590 /* Or are you surrounded by water? */
591 if (Underwater && !u.uswallow) {
593 if (yn("Drink the water around you?") == 'y') {
595 if (yn("
\82Ü
\82í
\82è
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
597 pline("Do you know what lives in this water?");
599 pline("
\82±
\82Ì
\90\85\92\86\82Å
\89½
\82ª
\90¶
\82«
\82Ä
\82¢
\82é
\82Ì
\82©
\92m
\82Á
\82Ä
\82é
\82©
\82¢
\81H");
604 otmp = getobj(beverages, "drink");
608 /* quan > 1 used to be left to useup(), but we need to force
609 the current potion to be unworn, and don't want to do
610 that for the entire stack when starting with more than 1.
611 [Drinking a wielded potion of polymorph can trigger a shape
612 change which causes hero's weapon to be dropped. In 3.4.x,
613 that led to an "object lost" panic since subsequent useup()
614 was no longer dealing with an inventory item. Unwearing
615 the current potion is intended to keep it in inventory.] */
616 if (otmp->quan > 1L) {
617 otmp = splitobj(otmp, 1L);
618 otmp->owornmask = 0L; /* rest of original stuck unaffected */
619 } else if (otmp->owornmask) {
620 remove_worn_item(otmp, FALSE);
622 otmp->in_use = TRUE; /* you've opened the stopper */
624 potion_descr = OBJ_DESCR(objects[otmp->otyp]);
627 if (!strcmp(potion_descr, "milky")
629 if (!strcmp(potion_descr, "
\83~
\83\8b\83N
\90F
\82Ì")
630 && !(mvitals[PM_GHOST].mvflags & G_GONE)
631 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_GHOST].born))) {
636 } else if (!strcmp(potion_descr, "smoky")
638 } else if (!strcmp(potion_descr, "
\89\8c\82ª
\82Å
\82Ä
\82¢
\82é")
639 && !(mvitals[PM_DJINNI].mvflags & G_GONE)
640 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_DJINNI].born))) {
641 djinni_from_bottle(otmp);
646 return dopotion(otmp);
651 register struct obj *otmp;
657 if ((retval = peffects(otmp)) >= 0)
663 You("have a %s feeling for a moment, then it passes.",
664 Hallucination ? "normal" : "peculiar");
666 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
667 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\93Æ
\93Á
\82È");
670 if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
672 makeknown(otmp->otyp);
673 more_experienced(0, 10);
674 } else if (!objects[otmp->otyp].oc_uname)
683 register struct obj *otmp;
685 register int i, ii, lim;
687 switch (otmp->otyp) {
688 case POT_RESTORE_ABILITY:
689 case SPE_RESTORE_ABILITY:
693 pline("Ulch! This makes you feel mediocre!");
695 pline("
\82¤
\81[
\82ñ
\81C
\82Ç
\82¤
\82à
\82³
\82¦
\82È
\82¢
\82È
\82 \81D");
698 /* unlike unicorn horn, overrides Fixed_abil */
700 pline("Wow! This makes you feel %s!",
702 ? (unfixable_trouble_count(FALSE) ? "better" : "great")
705 pline("
\83\8f\81[
\83I
\81I
\8bC
\95ª
\82ª%s
\82È
\82Á
\82½
\81I",
707 ? (unfixable_trouble_count(FALSE) ? "
\82¾
\82¢
\82Ô
\82æ
\82" : "
\82Æ
\82Ä
\82à
\82æ
\82")
710 i = rn2(A_MAX); /* start at a random point */
711 for (ii = 0; ii < A_MAX; ii++) {
713 if (i == A_STR && u.uhs >= 3)
715 if (ABASE(i) < lim) {
718 /* only first found if not blessed */
727 case POT_HALLUCINATION:
728 if (Hallucination || Halluc_resistance)
730 (void) make_hallucinated(
731 itimeout_incr(HHallucination, rn1(200, 600 - 300 * bcsign(otmp))),
735 if (!otmp->blessed && !otmp->cursed) {
737 pline("This tastes like water.");
739 pline("
\90\85\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
740 u.uhunger += rnd(10);
745 if (is_undead(youmonst.data) || is_demon(youmonst.data)
746 || u.ualign.type == A_CHAOTIC) {
749 pline("This burns like acid!");
751 pline("
\8e_
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I");
752 exercise(A_CON, FALSE);
753 if (u.ulycn >= LOW_PM) {
755 Your("affinity to %s disappears!",
757 Your("%s
\82Ö
\82Ì
\90e
\8bß
\8a´
\82Í
\82È
\82
\82È
\82Á
\82½
\81I",
758 makeplural(mons[u.ulycn].mname));
759 if (youmonst.data == &mons[u.ulycn])
761 u.ulycn = NON_PM; /* cure lycanthropy */
764 losehp(Maybe_Half_Phys(d(2, 6)), "potion of holy water",
766 losehp(Maybe_Half_Phys(d(2, 6)), "
\90¹
\90\85\82Å",
768 } else if (otmp->cursed) {
770 You_feel("quite proud of yourself.");
772 You("
\8e©
\91¸
\90S
\82ð
\8a´
\82¶
\82½
\81D");
773 healup(d(2, 6), 0, 0, 0);
774 if (u.ulycn >= LOW_PM && !Upolyd)
776 exercise(A_CON, TRUE);
781 You_feel("full of awe.");
783 You("
\88Ø
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
784 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
785 exercise(A_WIS, TRUE);
786 exercise(A_CON, TRUE);
787 if (u.ulycn >= LOW_PM)
788 you_unwere(TRUE); /* "Purified" */
789 /* make_confused(0L, TRUE); */
791 if (u.ualign.type == A_LAWFUL) {
793 pline("This burns like acid!");
795 pline("
\8e_
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I");
797 losehp(Maybe_Half_Phys(d(2, 6)), "potion of unholy water",
799 losehp(Maybe_Half_Phys(d(2, 6)), "
\95s
\8fò
\82È
\90\85\82Å",
803 You_feel("full of dread.");
805 You("
\8b°
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
806 if (u.ulycn >= LOW_PM && !Upolyd)
808 exercise(A_CON, FALSE);
815 pline("Ooph! This tastes like %s%s!",
816 otmp->odiluted ? "watered down " : "",
817 Hallucination ? "dandelion wine" : "liquid fire");
819 pline("
\82¤
\82¥
\82Á
\82Õ
\81I
\82±
\82ê
\82Í%s%s
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81I",
820 otmp->odiluted ? "
\90\85\82Å
\94\96\82ß
\82½" : "",
821 Hallucination ? "
\83^
\83\93\83|
\83|
\83\8f\83C
\83\93" : "
\94R
\97¿
\83I
\83C
\83\8b");
824 make_confused(itimeout_incr(HConfusion, d(3, 8)), FALSE);
825 /* the whiskey makes us feel better */
827 healup(1, 0, FALSE, FALSE);
828 u.uhunger += 10 * (2 + bcsign(otmp));
830 exercise(A_WIS, FALSE);
835 You("
\8bC
\90â
\82µ
\82½
\81D");
838 nomovemsg = "You awake with a headache.";
840 nomovemsg = "
\96Ú
\82ª
\82³
\82ß
\82½
\82ª
\93ª
\92É
\82ª
\82·
\82é
\81D";
843 case POT_ENLIGHTENMENT:
847 You("have an uneasy feeling...");
849 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D
\81D
\81D");
850 exercise(A_WIS, FALSE);
853 (void) adjattrib(A_INT, 1, FALSE);
854 (void) adjattrib(A_WIS, 1, FALSE);
857 You_feel("self-knowledgeable...");
859 You("
\8e©
\95ª
\8e©
\90g
\82ª
\94»
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D
\81D
\81D");
860 display_nhwindow(WIN_MESSAGE, FALSE);
861 enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
863 pline_The("feeling subsides.");
865 pline("
\82»
\82Ì
\8a´
\82¶
\82Í
\82È
\82
\82È
\82Á
\82½
\81D");
866 exercise(A_WIS, TRUE);
869 case SPE_INVISIBILITY:
870 /* spell cannot penetrate mummy wrapping */
871 if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
873 You_feel("rather itchy under %s.", yname(uarmc));
875 You("%s
\82Ì
\89º
\82ª
\83\80\83Y
\83\80\83Y
\82µ
\82½
\81D", xname(uarmc));
879 case POT_INVISIBILITY:
880 if (Invis || Blind || BInvis) {
883 self_invis_message();
886 HInvis |= FROMOUTSIDE;
888 incr_itimeout(&HInvis, rn1(15, 31));
889 newsym(u.ux, u.uy); /* update position */
892 pline("For some reason, you feel your presence is known.");
894 pline("
\82È
\82º
\82©
\81C
\91¶
\8dÝ
\82ª
\92m
\82ç
\82ê
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
898 case POT_SEE_INVISIBLE: /* tastes like fruit juice in Rogue */
899 case POT_FRUIT_JUICE: {
900 int msg = Invisible && !Blind;
905 pline("Yecch! This tastes %s.",
906 Hallucination ? "overripe" : "rotten");
908 pline("
\83I
\83F
\81[
\81I
\82±
\82ê
\82Í%s
\83W
\83\85\81[
\83X
\82Ì
\96¡
\82ª
\82·
\82é
\81D",
909 Hallucination ? "
\8fn
\82µ
\82·
\82¬
\82½" : "
\95\85\82Á
\82½");
915 ? "This tastes like 10%% real %s%s all-natural beverage."
916 : "This tastes like %s%s.",
917 otmp->odiluted ? "reconstituted " : "", fruitname(TRUE));
921 ? "10%%%s
\82Ì
\8f\83\8e©
\91R
\88ù
\97¿
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D"
922 : "%s%s
\83W
\83\85\81[
\83X
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D",
923 otmp->odiluted ? "
\90¬
\95ª
\92²
\90®
\82³
\82ê
\82½" : "", fruitname(TRUE));
925 if (otmp->otyp == POT_FRUIT_JUICE) {
926 u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
931 /* Tell them they can see again immediately, which
932 * will help them identify the potion...
934 make_blinded(0L, TRUE);
937 HSee_invisible |= FROMOUTSIDE;
939 incr_itimeout(&HSee_invisible, rn1(100, 750));
940 set_mimic_blocking(); /* do special mimic handling */
941 see_monsters(); /* see invisible monsters */
942 newsym(u.ux, u.uy); /* see yourself! */
943 if (msg && !Blind) { /* Blind possible if polymorphed */
945 You("can see through yourself, but you are visible!");
947 You("
\93§
\96¾
\82Å
\82 \82é
\81D
\82µ
\82©
\82µ
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
955 You("stiffen momentarily.");
957 You("
\88ê
\8fu
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
959 if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
961 You("are motionlessly suspended.");
963 You("
\8bó
\92\86\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
966 You("are frozen in place!");
968 You("
\82»
\82Ì
\8fê
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
971 Your("%s are frozen to the %s!", makeplural(body_part(FOOT)),
972 surface(u.ux, u.uy));
974 You("
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
976 nomul(-(rn1(10, 25 - 12 * bcsign(otmp))));
978 multi_reason = "frozen by a potion";
980 multi_reason = "
\96ò
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
981 nomovemsg = You_can_move_again;
982 exercise(A_DEX, FALSE);
986 if (Sleep_resistance || Free_action) {
990 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
993 You("suddenly fall asleep!");
995 pline("
\93Ë
\91R
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I");
996 fall_asleep(-rn1(10, 25 - 12 * bcsign(otmp)), TRUE);
999 case POT_MONSTER_DETECTION:
1000 case SPE_DETECT_MONSTERS:
1001 if (otmp->blessed) {
1004 if (Detect_monsters)
1007 /* after a while, repeated uses become less effective */
1008 if ((HDetect_monsters & TIMEOUT) >= 300L)
1012 incr_itimeout(&HDetect_monsters, i);
1013 for (x = 1; x < COLNO; x++) {
1014 for (y = 0; y < ROWNO; y++) {
1015 if (levl[x][y].glyph == GLYPH_INVISIBLE) {
1026 You_feel("lonely.");
1028 You("
\90S
\8d×
\82
\82È
\82Á
\82½
\81D");
1031 if (monster_detect(otmp, 0))
1032 return 1; /* nothing detected */
1033 exercise(A_WIS, TRUE);
1035 case POT_OBJECT_DETECTION:
1036 case SPE_DETECT_TREASURE:
1037 if (object_detect(otmp, 0))
1038 return 1; /* nothing detected */
1039 exercise(A_WIS, TRUE);
1043 pline("Yecch! This stuff tastes like poison.");
1045 pline("
\83E
\83F
\81[
\81I
\93Å
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1046 if (otmp->blessed) {
1048 pline("(But in fact it was mildly stale %s.)", fruitname(TRUE));
1050 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\8f
\82µ
\8cÃ
\82
\82È
\82Á
\82½%s
\81D)", fruitname(TRUE));
1051 if (!Role_if(PM_HEALER)) {
1052 /* NB: blessed otmp->fromsink is not possible */
1054 losehp(1, "mildly contaminated potion", KILLED_BY_AN);
1056 losehp(1, "
\95a
\8bC
\82É
\89\98\90õ
\82³
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1059 if (Poison_resistance)
1061 pline("(But in fact it was biologically contaminated %s.)",
1063 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\90¶
\95¨
\8aw
\93I
\82É
\89\98\90õ
\82³
\82ê
\82½%s
\82¾
\81D)",
1065 if (Role_if(PM_HEALER)) {
1067 pline("Fortunately, you have been immunized.");
1069 pline("
\8dK
\89^
\82È
\82±
\82Æ
\82É
\81C
\82 \82È
\82½
\82Í
\96Æ
\89u
\82ª
\82 \82é
\81D");
1071 char contaminant[BUFSZ];
1072 int typ = rn2(A_MAX);
1075 Sprintf(contaminant, "%s%s",
1076 (Poison_resistance) ? "mildly " : "",
1077 (otmp->fromsink) ? "contaminated tap water"
1078 : "contaminated potion");
1080 Sprintf(contaminant, "%s
\89\98\90õ
\82³
\82ê
\82½%s
\82Å",
1081 (Poison_resistance) ? "
\8f
\82µ" : "",
1082 (otmp->fromsink) ? "
\90\85"
1086 poisontell(typ, FALSE);
1087 (void) adjattrib(typ, Poison_resistance ? -1 : -rn1(4, 3),
1090 if (!Poison_resistance) {
1092 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1095 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1098 /* rnd loss is so that unblessed poorer than blessed */
1099 losehp(1 + rn2(2), contaminant,
1100 (otmp->fromsink) ? KILLED_BY : KILLED_BY_AN);
1102 exercise(A_CON, FALSE);
1105 if (Hallucination) {
1107 You("are shocked back to your senses!");
1109 You("
\8cÜ
\8a´
\82É
\8fÕ
\8c\82\82ð
\8eó
\82¯
\82½
\81I");
1110 (void) make_hallucinated(0L, FALSE, 0L);
1115 if (Hallucination) {
1117 pline("What a trippy feeling!");
1119 pline("
\82È
\82ñ
\82©
\83w
\83\8d\83w
\83\8d\82·
\82é
\81I");
1123 pline("Huh, What? Where am I?");
1125 pline("
\82Ù
\82¦
\81H
\8e\84\82Í
\92N
\81H");
1128 make_confused(itimeout_incr(HConfusion,
1129 rn1(7, 16 - 8 * bcsign(otmp))),
1132 case POT_GAIN_ABILITY:
1135 pline("Ulch! That potion tasted foul!");
1137 pline("
\83E
\83F
\81I
\88«
\8fL
\82ª
\82·
\82é
\81I");
1139 } else if (Fixed_abil) {
1141 } else { /* If blessed, increase all; if not, try up to */
1142 int itmp; /* 6 times to find one which can be increased. */
1144 i = -1; /* increment to 0 */
1145 for (ii = A_MAX; ii > 0; ii--) {
1146 i = (otmp->blessed ? i + 1 : rn2(A_MAX));
1147 /* only give "your X is already as high as it can get"
1148 message on last attempt (except blessed potions) */
1149 itmp = (otmp->blessed || ii == 1) ? 0 : -1;
1150 if (adjattrib(i, 1, itmp) && !otmp->blessed)
1156 if (Wounded_legs && !otmp->cursed && !u.usteed) {
1157 /* heal_legs() would heal steeds legs */
1163 case SPE_HASTE_SELF:
1164 if (!Very_fast) { /* wwf@doe.carleton.ca */
1166 You("are suddenly moving %sfaster.", Fast ? "" : "much ");
1168 You("
\93Ë
\91R%s
\91¬
\82
\88Ú
\93®
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D", Fast ? "" : "
\82Æ
\82Ä
\82à");
1171 Your("%s get new energy.", makeplural(body_part(LEG)));
1173 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));
1176 exercise(A_DEX, TRUE);
1177 incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp)));
1182 make_blinded(itimeout_incr(Blinded,
1183 rn1(200, 250 - 125 * bcsign(otmp))),
1186 case POT_GAIN_LEVEL:
1189 /* they went up a level */
1190 if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
1191 || Can_rise_up(u.ux, u.uy, &u.uz)) {
1193 const char *riseup = "rise up, through the %s!";
1195 const char *riseup ="%s
\82ð
\93Ë
\82«
\94²
\82¯
\82½
\81I";
1197 if (ledger_no(&u.uz) == 1) {
1198 You(riseup, ceiling(u.ux, u.uy));
1199 goto_level(&earth_level, FALSE, FALSE, FALSE);
1201 register int newlev = depth(&u.uz) - 1;
1204 get_level(&newlevel, newlev);
1205 if (on_level(&newlevel, &u.uz)) {
1207 pline("It tasted bad.");
1209 pline("
\82Æ
\82Ä
\82à
\82Ü
\82¸
\82¢
\81D");
1212 You(riseup, ceiling(u.ux, u.uy));
1213 goto_level(&newlevel, FALSE, FALSE, FALSE);
1217 You("have an uneasy feeling.");
1219 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D");
1223 /* blessed potions place you at a random spot in the
1224 middle of the new level instead of the low point */
1226 u.uexp = rndexp(TRUE);
1230 You_feel("better.");
1232 You("
\8bC
\95ª
\82ª
\82æ
\82
\82È
\82Á
\82½
\81D");
1233 healup(d(6 + 2 * bcsign(otmp), 4), !otmp->cursed ? 1 : 0,
1234 !!otmp->blessed, !otmp->cursed);
1235 exercise(A_CON, TRUE);
1237 case POT_EXTRA_HEALING:
1239 You_feel("much better.");
1241 You("
\8bC
\95ª
\82ª
\82Æ
\82Ä
\82à
\82æ
\82
\82È
\82Á
\82½
\81D");
1242 healup(d(6 + 2 * bcsign(otmp), 8),
1243 otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, !otmp->cursed,
1245 (void) make_hallucinated(0L, TRUE, 0L);
1246 exercise(A_CON, TRUE);
1247 exercise(A_STR, TRUE);
1249 case POT_FULL_HEALING:
1251 You_feel("completely healed.");
1253 You("
\8a®
\91S
\82É
\89ñ
\95\9c\82µ
\82½
\81D");
1254 healup(400, 4 + 4 * bcsign(otmp), !otmp->cursed, TRUE);
1255 /* Restore one lost level if blessed */
1256 if (otmp->blessed && u.ulevel < u.ulevelmax) {
1257 /* when multiple levels have been lost, drinking
1258 multiple potions will only get half of them back */
1262 (void) make_hallucinated(0L, TRUE, 0L);
1263 exercise(A_STR, TRUE);
1264 exercise(A_CON, TRUE);
1266 case POT_LEVITATION:
1267 case SPE_LEVITATION:
1269 HLevitation &= ~I_SPECIAL;
1270 if (!Levitation && !BLevitation) {
1271 /* kludge to ensure proper operation of float_up() */
1272 set_itimeout(&HLevitation, 1L);
1274 /* reverse kludge */
1275 set_itimeout(&HLevitation, 0L);
1277 if ((u.ux == xupstair && u.uy == yupstair)
1278 || (sstairs.up && u.ux == sstairs.sx
1279 && u.uy == sstairs.sy)
1280 || (xupladder && u.ux == xupladder
1281 && u.uy == yupladder)) {
1283 } else if (has_ceiling(&u.uz)) {
1284 int dmg = uarmh ? 1 : rnd(10);
1287 You("hit your %s on the %s.", body_part(HEAD),
1288 ceiling(u.ux, u.uy));
1290 You("%s
\82ð%s
\82É
\82Ô
\82Â
\82¯
\82½
\81D", body_part(HEAD),
1291 ceiling(u.ux,u.uy));
1294 losehp(Maybe_Half_Phys(dmg), "colliding with the ceiling",
1296 losehp(Maybe_Half_Phys(dmg), "
\93V
\88ä
\82É
\93ª
\82ð
\82Ô
\82Â
\82¯
\82Ä",
1302 if (otmp->blessed) {
1303 incr_itimeout(&HLevitation, rn1(50, 250));
1304 HLevitation |= I_SPECIAL;
1306 incr_itimeout(&HLevitation, rn1(140, 10));
1308 spoteffects(FALSE); /* for sinks */
1311 case POT_GAIN_ENERGY: { /* M. Stephenson */
1316 You_feel("lackluster.");
1318 You("
\88Ó
\8bC
\8fÁ
\92¾
\82µ
\82½
\81D");
1321 pline("Magical energies course through your body.");
1323 pline("
\96\82\96@
\82Ì
\83G
\83l
\83\8b\83M
\81[
\82ª
\82 \82È
\82½
\82Ì
\91Ì
\82É
\96\9e\82¿
\82½
\81D");
1325 /* old: num = rnd(5) + 5 * otmp->blessed + 1;
1326 * blessed: +7..11 max & current (+9 avg)
1327 * uncursed: +2.. 6 max & current (+4 avg)
1328 * cursed: -2.. 6 max & current (-4 avg)
1330 * blessed: +3..18 max (+10.5 avg), +9..54 current (+31.5 avg)
1331 * uncursed: +2..12 max (+ 7 avg), +6..36 current (+21 avg)
1332 * cursed: -1.. 6 max (- 3.5 avg), -3..18 current (-10.5 avg)
1334 num = d(otmp->blessed ? 3 : !otmp->cursed ? 2 : 1, 6);
1336 num = -num; /* subtract instead of add when cursed */
1341 if (u.uen > u.uenmax)
1343 else if (u.uen <= 0)
1346 exercise(A_WIS, TRUE);
1349 case POT_OIL: { /* P. Winner */
1350 boolean good_for_you = FALSE;
1352 if (otmp->lamplit) {
1353 if (likes_fire(youmonst.data)) {
1355 pline("Ahh, a refreshing drink.");
1357 pline("
\82í
\81[
\82¨
\81C
\90¶
\82«
\95Ô
\82é
\81D");
1358 good_for_you = TRUE;
1361 You("burn your %s.", body_part(FACE));
1363 Your("%s
\82Í
\8d\95\8fÅ
\82°
\82É
\82È
\82Á
\82½
\81D", body_part(FACE));
1366 losehp(d(Fire_resistance ? 1 : 3, 4), "burning potion of oil",
1368 losehp(d(Fire_resistance ? 1 : 3, 4), "
\94R
\82¦
\82Ä
\82¢
\82é
\96û
\82ð
\88ù
\82ñ
\82Å",
1371 } else if (otmp->cursed)
1373 pline("This tastes like castor oil.");
1375 pline("
\82Ð
\82Ü
\82µ
\96û
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1378 pline("That was smooth!");
1380 pline("
\8cû
\82 \82½
\82è
\82ª
\82æ
\82¢
\81I");
1381 exercise(A_WIS, good_for_you);
1385 if (Acid_resistance) {
1386 /* Not necessarily a creature who _likes_ acid */
1388 pline("This tastes %s.", Hallucination ? "tangy" : "sour");
1390 pline("%s
\96¡
\82ª
\82·
\82é
\81D", Hallucination ? "
\82Ò
\82è
\82Á
\82Æ
\82µ
\82½" : "
\8e_
\82Ì");
1395 pline("This burns%s!",
1396 otmp->blessed ? " a little" : otmp->cursed ? " a lot"
1399 pline("%s
\8fÅ
\82°
\82½
\81I",
1400 otmp->blessed ? "
\8f
\82µ" : otmp->cursed ? "
\82·
\82²
\82"
1403 dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
1405 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1407 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\88ù
\82ñ
\82Å", KILLED_BY_AN);
1408 exercise(A_CON, FALSE);
1411 fix_petrification();
1412 unkn++; /* holy/unholy water can burn like acid too */
1416 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1418 You("
\8f
\82µ%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1423 impossible("What a funny potion! (%u)", otmp->otyp);
1431 make_totter(xtime, talk)
1432 long xtime; /* nonzero if this is an attempt to turn on hallucination */
1435 const char *message = 0;
1438 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\90³
\8fí
\82É
\82È
\82Á
\82½
\81D";
1440 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\96\83á
\83\82µ
\82½
\81D";
1442 set_itimeout(&Totter, xtime);
1448 healup(nhp, nxtra, curesick, cureblind)
1450 register boolean curesick, cureblind;
1456 u.mh = (u.mhmax += nxtra);
1459 if (u.uhp > u.uhpmax)
1460 u.uhp = (u.uhpmax += nxtra);
1464 make_blinded(0L, TRUE);
1466 make_vomiting(0L, TRUE);
1467 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
1474 strange_feeling(obj, txt)
1478 if (flags.beginner || !txt)
1480 You("have a %s feeling for a moment, then it passes.",
1481 Hallucination ? "normal" : "strange");
1483 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
1484 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\8aï
\96
\82È");
1489 if (!obj) /* e.g., crystal ball finds no traps */
1492 if (obj->dknown && !objects[obj->otyp].oc_name_known
1493 && !objects[obj->otyp].oc_uname)
1500 const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
1501 "flask", "jar", "vial" };
1503 const char *bottlenames[] = { "
\95r", "àÞ
\97\9e\95r", "
\88ê
\8f¡
\95r", "
\90\85\8d·
\82µ",
1504 "
\83t
\83\89\83X
\83R", "
\92Ù", "
\83K
\83\89\83X
\95r" };
1510 return bottlenames[rn2(SIZE(bottlenames))];
1513 /* handle item dipped into water potion or steed saddle splashed by same */
1515 H2Opotion_dip(potion, targobj, useeit, objphrase)
1516 struct obj *potion, *targobj;
1518 const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
1520 void FDECL((*func), (OBJ_P)) = 0;
1521 const char *glowcolor = 0;
1522 #define COST_alter (-2)
1523 #define COST_none (-1)
1524 int costchange = COST_none;
1525 boolean altfmt = FALSE, res = FALSE;
1527 if (!potion || potion->otyp != POT_WATER)
1530 if (potion->blessed) {
1531 if (targobj->cursed) {
1533 glowcolor = NH_AMBER;
1534 costchange = COST_UNCURS;
1535 } else if (!targobj->blessed) {
1537 glowcolor = NH_LIGHT_BLUE;
1538 costchange = COST_alter;
1539 altfmt = TRUE; /* "with a <color> aura" */
1541 } else if (potion->cursed) {
1542 if (targobj->blessed) {
1545 glowcolor = "brown";
1547 glowcolor = "
\92\83\90F
\82Ì";
1548 costchange = COST_UNBLSS;
1549 } else if (!targobj->cursed) {
1551 glowcolor = NH_BLACK;
1552 costchange = COST_alter;
1556 /* dipping into uncursed water; carried() check skips steed saddle */
1557 if (carried(targobj)) {
1558 if (water_damage(targobj, 0, TRUE) != ER_NOTHING)
1563 /* give feedback before altering the target object;
1564 this used to set obj->bknown even when not seeing
1565 the effect; now hero has to see the glow, and bknown
1566 is cleared instead of set if perception is distorted */
1568 glowcolor = hcolor(glowcolor);
1569 /*JP:3.6.0
\8e\9e\93_
\82Å
\82Í
\93®
\8e\8c\82Í"glow"
\82¾
\82¯
\82È
\82Ì
\82Å
\8c\88\82ß
\8c\82\82¿*/
1572 pline("%s with %s aura.", objphrase, an(glowcolor));
1574 pline("%s
\82Í%s
\83I
\81[
\83\89\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D", objphrase, glowcolor);
1578 pline("%s %s.", objphrase, glowcolor);
1580 pline("%s
\82Í%s
\8bP
\82¢
\82½
\81D", objphrase, jconj_adj(glowcolor));
1582 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1583 targobj->bknown = !Hallucination;
1585 /* potions of water are the only shop goods whose price depends
1586 on their curse/bless state */
1587 if (targobj->unpaid && targobj->otyp == POT_WATER) {
1588 if (costchange == COST_alter)
1589 /* added blessing or cursing; update shop
1590 bill to reflect item's new higher price */
1591 alter_cost(targobj, 0L);
1592 else if (costchange != COST_none)
1593 /* removed blessing or cursing; you
1594 degraded it, now you'll have to buy it... */
1595 costly_alteration(targobj, costchange);
1597 /* finally, change curse/bless state */
1605 potionhit(mon, obj, your_fault)
1606 register struct monst *mon;
1607 register struct obj *obj;
1610 const char *botlnam = bottlename();
1611 boolean isyou = (mon == &youmonst);
1613 struct obj *saddle = (struct obj *) 0;
1614 boolean hit_saddle = FALSE;
1619 pline_The("%s crashes on your %s and breaks into shards.", botlnam,
1622 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1626 losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN);
1628 losehp(Maybe_Half_Phys(rnd(2)), "
\93\8a\82°
\82ç
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1630 /* sometimes it hits the saddle */
1631 if (((mon->misc_worn_check & W_SADDLE)
1632 && (saddle = which_armor(mon, W_SADDLE)))
1634 || (obj->otyp == POT_WATER
1635 && ((rnl(10) > 7 && obj->cursed)
1636 || (rnl(10) < 4 && obj->blessed) || !rn2(3)))))
1638 distance = distu(mon->mx, mon->my);
1639 if (!cansee(mon->mx, mon->my))
1643 pline("
\83K
\83V
\83\83\83\93\81I");
1645 char *mnam = mon_nam(mon);
1648 if (hit_saddle && saddle) {
1650 Sprintf(buf, "%s saddle",
1652 Sprintf(buf, "%s
\82Ì
\88Æ",
1653 s_suffix(x_monnam(mon, ARTICLE_THE, (char *) 0,
1654 (SUPPRESS_IT | SUPPRESS_SADDLE),
1656 } else if (has_head(mon->data)) {
1658 Sprintf(buf, "%s %s", s_suffix(mnam),
1659 (notonhead ? "body" : "head"));
1661 Sprintf(buf, "%s
\82Ì%s", s_suffix(mnam),
1662 (notonhead ? "
\91Ì" : "
\93ª"));
1668 pline_The("%s crashes on %s and breaks into shards.", botlnam,
1671 pline("%s
\82ª%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1675 if (rn2(5) && mon->mhp > 1 && !hit_saddle)
1679 /* oil doesn't instantly evaporate; Neither does a saddle hit */
1680 if (obj->otyp != POT_OIL && !hit_saddle && cansee(mon->mx, mon->my))
1682 pline("%s.", Tobjnam(obj, "evaporate"));
1684 pline("%s
\82Í
\8fö
\94
\82µ
\82½
\81D", xname(obj));
1687 switch (obj->otyp) {
1690 explode_oil(obj, u.ux, u.uy);
1694 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1696 You("%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1697 if (!Unchanging && !Antimagic)
1701 if (!Acid_resistance) {
1704 pline("This burns%s!",
1705 obj->blessed ? " a little"
1706 : obj->cursed ? " a lot" : "");
1708 pline("%s
\94R
\82¦
\82½
\81I",
1709 obj->blessed ? "
\8f
\82µ"
1710 : obj->cursed ? "
\82Í
\82°
\82µ
\82" : "");
1712 dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1714 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1716 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\97\81\82Ñ
\82Ä", KILLED_BY_AN);
1720 } else if (hit_saddle && saddle) {
1721 char *mnam, buf[BUFSZ], saddle_glows[BUFSZ];
1722 boolean affected = FALSE;
1723 boolean useeit = !Blind && canseemon(mon) && cansee(mon->mx, mon->my);
1725 mnam = x_monnam(mon, ARTICLE_THE, (char *) 0,
1726 (SUPPRESS_IT | SUPPRESS_SADDLE), FALSE);
1727 Sprintf(buf, "%s", upstart(s_suffix(mnam)));
1729 switch (obj->otyp) {
1732 Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
1734 Sprintf(saddle_glows, "%s", buf);
1735 affected = H2Opotion_dip(obj, saddle, useeit, saddle_glows);
1738 /* Do we allow the saddle to polymorph? */
1741 if (useeit && !affected)
1743 pline("%s %s wet.", buf, aobjnam(saddle, "get"));
1745 pline("%s
\82Í
\94G
\82ê
\82½
\81D", buf);
1747 boolean angermon = TRUE;
1751 switch (obj->otyp) {
1753 case POT_EXTRA_HEALING:
1754 case POT_FULL_HEALING:
1755 if (mon->data == &mons[PM_PESTILENCE])
1758 case POT_RESTORE_ABILITY:
1759 case POT_GAIN_ABILITY:
1762 if (mon->mhp < mon->mhpmax) {
1763 mon->mhp = mon->mhpmax;
1766 pline("%s looks sound and hale again.", Monnam(mon));
1768 pline("%s
\82Í
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1772 if (mon->data == &mons[PM_PESTILENCE])
1774 if (dmgtype(mon->data, AD_DISE)
1775 /* won't happen, see prior goto */
1776 || dmgtype(mon->data, AD_PEST)
1777 /* most common case */
1778 || resists_poison(mon)) {
1781 pline("%s looks unharmed.", Monnam(mon));
1783 pline("%s
\82Í
\82È
\82ñ
\82Æ
\82à
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mon));
1788 if ((mon->mhpmax > 3) && !resist(mon, POTION_CLASS, 0, NOTELL))
1790 if ((mon->mhp > 2) && !resist(mon, POTION_CLASS, 0, NOTELL))
1792 if (mon->mhp > mon->mhpmax)
1793 mon->mhp = mon->mhpmax;
1796 pline("%s looks rather ill.", Monnam(mon));
1798 pline("%s
\82Í
\95a
\8bC
\82Á
\82Û
\82
\8c©
\82¦
\82é
\81D", Monnam(mon));
1802 if (!resist(mon, POTION_CLASS, 0, NOTELL))
1805 case POT_INVISIBILITY:
1807 mon_set_minvis(mon);
1810 /* wakeup() doesn't rouse victims of temporary sleep */
1811 if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
1813 pline("%s falls asleep.", Monnam(mon));
1815 pline("%s
\82Í
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D", Monnam(mon));
1820 if (mon->mcanmove) {
1821 /* really should be rnd(5) for consistency with players
1822 * breathing potions, but...
1824 paralyze_monst(mon, rnd(25));
1829 mon_adjust_speed(mon, 1, obj);
1832 if (haseyes(mon->data)) {
1833 register int btmp = 64 + rn2(32)
1834 + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
1836 btmp += mon->mblinded;
1837 mon->mblinded = min(btmp, 127);
1842 if (is_undead(mon->data) || is_demon(mon->data)
1843 || is_were(mon->data) || is_vampshifter(mon)) {
1846 pline("%s %s in pain!", Monnam(mon),
1847 is_silent(mon->data) ? "writhes" : "shrieks");
1849 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
1850 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
1852 if (!is_silent(mon->data))
1853 wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1854 mon->mhp -= d(2, 6);
1855 /* should only be by you */
1858 else if (is_were(mon->data) && !is_human(mon->data))
1859 new_were(mon); /* revert to human */
1860 } else if (obj->cursed) {
1864 pline("%s looks healthier.", Monnam(mon));
1866 pline("%s
\82Í
\82æ
\82è
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1867 mon->mhp += d(2, 6);
1868 if (mon->mhp > mon->mhpmax)
1869 mon->mhp = mon->mhpmax;
1870 if (is_were(mon->data) && is_human(mon->data)
1871 && !Protection_from_shape_changers)
1872 new_were(mon); /* transform into beast */
1874 } else if (mon->data == &mons[PM_GREMLIN]) {
1876 (void) split_mon(mon, (struct monst *) 0);
1877 } else if (mon->data == &mons[PM_IRON_GOLEM]) {
1880 pline("%s rusts.", Monnam(mon));
1882 pline("%s
\82Í
\8eK
\82Ñ
\82½
\81D", Monnam(mon));
1883 mon->mhp -= d(1, 6);
1884 /* should only be by you */
1891 explode_oil(obj, mon->mx, mon->my);
1894 if (!resists_acid(mon) && !resist(mon, POTION_CLASS, 0, NOTELL)) {
1896 pline("%s %s in pain!", Monnam(mon),
1897 is_silent(mon->data) ? "writhes" : "shrieks");
1899 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
1900 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
1902 if (!is_silent(mon->data))
1903 wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1904 mon->mhp -= d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1909 monkilled(mon, "", AD_ACID);
1914 (void) bhitm(mon, obj);
1917 case POT_GAIN_LEVEL:
1918 case POT_LEVITATION:
1919 case POT_FRUIT_JUICE:
1920 case POT_MONSTER_DETECTION:
1921 case POT_OBJECT_DETECTION:
1931 /* Note: potionbreathe() does its own docall() */
1932 if ((distance == 0 || ((distance < 3) && rn2(5)))
1933 && (!breathless(youmonst.data) || haseyes(youmonst.data)))
1935 else if (obj->dknown && !objects[obj->otyp].oc_name_known
1936 && !objects[obj->otyp].oc_uname && cansee(mon->mx, mon->my))
1938 if (*u.ushops && obj->unpaid) {
1939 struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
1942 (void) stolen_value(obj, u.ux, u.uy, (boolean) shkp->mpeaceful,
1947 obfree(obj, (struct obj *) 0);
1950 /* vapors are inhaled or get in your eyes */
1953 register struct obj *obj;
1955 register int i, ii, isdone, kn = 0;
1957 switch (obj->otyp) {
1958 case POT_RESTORE_ABILITY:
1959 case POT_GAIN_ABILITY:
1961 if (!breathless(youmonst.data))
1963 pline("Ulch! That potion smells terrible!");
1965 pline("
\83E
\83Q
\83F
\81I
\96ò
\82Í
\82à
\82Ì
\82·
\82²
\82¢
\93õ
\82¢
\82ª
\82·
\82é
\81I");
1966 else if (haseyes(youmonst.data)) {
1968 const char *eyes = body_part(EYE);
1970 if (eyecount(youmonst.data) != 1)
1971 eyes = makeplural(eyes);
1972 Your("%s %s!", eyes, vtense(eyes, "sting"));
1974 Your("%s
\82ª
\82¸
\82«
\82¸
\82«
\82·
\82é
\81I", body_part(EYE));
1979 i = rn2(A_MAX); /* start at a random point */
1980 for (isdone = ii = 0; !isdone && ii < A_MAX; ii++) {
1981 if (ABASE(i) < AMAX(i)) {
1983 /* only first found if not blessed */
1984 isdone = !(obj->blessed);
1992 case POT_FULL_HEALING:
1993 if (Upolyd && u.mh < u.mhmax)
1994 u.mh++, context.botl = 1;
1995 if (u.uhp < u.uhpmax)
1996 u.uhp++, context.botl = 1;
1998 case POT_EXTRA_HEALING:
1999 if (Upolyd && u.mh < u.mhmax)
2000 u.mh++, context.botl = 1;
2001 if (u.uhp < u.uhpmax)
2002 u.uhp++, context.botl = 1;
2005 if (Upolyd && u.mh < u.mhmax)
2006 u.mh++, context.botl = 1;
2007 if (u.uhp < u.uhpmax)
2008 u.uhp++, context.botl = 1;
2009 exercise(A_CON, TRUE);
2012 if (!Role_if(PM_HEALER)) {
2025 exercise(A_CON, FALSE);
2028 case POT_HALLUCINATION:
2030 You("have a momentary vision.");
2032 You("
\88ê
\8fu
\8c¶
\89e
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D");
2038 You_feel("somewhat dizzy.");
2040 You("
\82ß
\82Ü
\82¢
\82ð
\8a´
\82¶
\82½
\81D");
2041 make_confused(itimeout_incr(HConfusion, rnd(5)), FALSE);
2043 case POT_INVISIBILITY:
2044 if (!Blind && !Invis) {
2047 pline("For an instant you %s!",
2048 See_invisible ? "could see right through yourself"
2049 : "couldn't see yourself");
2051 pline("
\88ê
\8fu
\8e©
\95ª
\8e©
\90g
\82ª%s
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81I",
2052 See_invisible ? "
\90³
\82µ
\82"
2061 pline("%s seems to be holding you.", Something);
2063 pline("%s
\82ª
\82 \82È
\82½
\82ð
\82Â
\82©
\82Ü
\82¦
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Something);
2066 multi_reason = "frozen by a potion";
2068 multi_reason = "
\96ò
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2069 nomovemsg = You_can_move_again;
2070 exercise(A_DEX, FALSE);
2073 You("stiffen momentarily.");
2075 You("
\88ê
\8fu
\8dd
\92¼
\82µ
\82½
\81D");
2079 if (!Free_action && !Sleep_resistance) {
2081 You_feel("rather tired.");
2083 You("
\82·
\82±
\82µ
\94æ
\82ê
\82½
\81D");
2086 multi_reason = "sleeping off a magical draught";
2088 multi_reason = "
\96\82\96@
\93I
\82É
\96°
\82Á
\82Ä
\82¢
\82é
\8aÔ
\82É";
2089 nomovemsg = You_can_move_again;
2090 exercise(A_DEX, FALSE);
2095 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
2100 Your("knees seem more flexible now.");
2102 Your("
\95G
\82Í
\82æ
\82è
\82·
\82Î
\82â
\82
\93®
\82
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
2103 incr_itimeout(&HFast, rnd(5));
2104 exercise(A_DEX, TRUE);
2107 if (!Blind && !Unaware) {
2110 pline("It suddenly gets dark.");
2112 pline("
\93Ë
\91R
\88Ã
\82
\82È
\82Á
\82½
\81D");
2114 make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
2115 if (!Blind && !Unaware)
2116 Your1(vision_clears);
2119 if (u.umonnum == PM_GREMLIN) {
2120 (void) split_mon(&youmonst, (struct monst *) 0);
2121 } else if (u.ulycn >= LOW_PM) {
2122 /* vapor from [un]holy water will trigger
2123 transformation but won't cure lycanthropy */
2124 if (obj->blessed && youmonst.data == &mons[u.ulycn])
2126 else if (obj->cursed && !Upolyd)
2132 exercise(A_CON, FALSE);
2135 case POT_GAIN_LEVEL:
2136 case POT_LEVITATION:
2137 case POT_FRUIT_JUICE:
2138 case POT_MONSTER_DETECTION:
2139 case POT_OBJECT_DETECTION:
2144 /* note: no obfree() */
2147 makeknown(obj->otyp);
2148 else if (!objects[obj->otyp].oc_name_known
2149 && !objects[obj->otyp].oc_uname)
2154 /* returns the potion type when o1 is dipped in o2 */
2157 register struct obj *o1, *o2;
2159 /* cut down on the number of cases below */
2160 if (o1->oclass == POTION_CLASS
2161 && (o2->otyp == POT_GAIN_LEVEL || o2->otyp == POT_GAIN_ENERGY
2162 || o2->otyp == POT_HEALING || o2->otyp == POT_EXTRA_HEALING
2163 || o2->otyp == POT_FULL_HEALING || o2->otyp == POT_ENLIGHTENMENT
2164 || o2->otyp == POT_FRUIT_JUICE)) {
2176 case POT_GAIN_LEVEL:
2177 case POT_GAIN_ENERGY:
2178 return POT_EXTRA_HEALING;
2180 case POT_EXTRA_HEALING:
2182 case POT_GAIN_LEVEL:
2183 case POT_GAIN_ENERGY:
2184 return POT_FULL_HEALING;
2186 case POT_FULL_HEALING:
2188 case POT_GAIN_LEVEL:
2189 case POT_GAIN_ENERGY:
2190 return POT_GAIN_ABILITY;
2195 return POT_FRUIT_JUICE;
2196 case POT_HALLUCINATION:
2202 case AMETHYST: /* "a-methyst" == "not intoxicated" */
2203 if (o2->otyp == POT_BOOZE)
2204 return POT_FRUIT_JUICE;
2206 case POT_GAIN_LEVEL:
2207 case POT_GAIN_ENERGY:
2210 return (rn2(3) ? POT_BOOZE : POT_ENLIGHTENMENT);
2212 return POT_EXTRA_HEALING;
2213 case POT_EXTRA_HEALING:
2214 return POT_FULL_HEALING;
2215 case POT_FULL_HEALING:
2216 return POT_GAIN_ABILITY;
2217 case POT_FRUIT_JUICE:
2218 return POT_SEE_INVISIBLE;
2220 return POT_HALLUCINATION;
2223 case POT_FRUIT_JUICE:
2226 return POT_SICKNESS;
2229 case POT_GAIN_LEVEL:
2230 case POT_GAIN_ENERGY:
2231 return POT_SEE_INVISIBLE;
2234 case POT_ENLIGHTENMENT:
2236 case POT_LEVITATION:
2238 return POT_GAIN_LEVEL;
2240 case POT_FRUIT_JUICE:
2243 return POT_CONFUSION;
2255 register struct obj *potion, *obj;
2256 struct obj *singlepotion;
2260 char qbuf[QBUFSZ], qtoo[QBUFSZ];
2262 allowall[0] = ALL_CLASSES;
2264 if (!(obj = getobj(allowall, "dip")))
2267 if (inaccessible_equipment(obj, "dip", FALSE))
2269 if (inaccessible_equipment(obj, "
\82ð
\90Z
\82·", FALSE))
2273 Sprintf(qbuf, "dip %s into", thesimpleoname(obj));
2274 #else /*JP:
\89p
\8cê
\82Å
\82Í
\89½
\82ð
\90Z
\82·
\82©
\82ð
\8aÜ
\82ß
\82Ä
\82¢
\82é
\82ª
\93ú
\96{
\8cê
\82Å
\82Í
\8f\88\97\9d\82Ì
\93s
\8d\87\82Å
\82Æ
\82è
\82 \82¦
\82¸
\8fÈ
\97ª*/
2275 Sprintf(qbuf, "dip into");
2277 here = levl[u.ux][u.uy].typ;
2278 /* Is there a fountain to dip into here? */
2279 if (IS_FOUNTAIN(here)) {
2280 /* "Dip <the object> into the fountain?" */
2282 Sprintf(qtoo, "%s the fountain?", qbuf);
2284 Sprintf(qtoo, "
\90ò
\82É%s
\81H", qbuf);
2286 if (yn(upstart(qtoo)) == 'y') {
2290 } else if (is_pool(u.ux, u.uy)) {
2291 const char *pooltype = waterbody_name(u.ux, u.uy);
2293 /* "Dip <the object> into the {pool, moat, &c}?" */
2295 Sprintf(qtoo, "%s the %s?", qbuf, pooltype);
2297 Sprintf(qtoo, "%s
\82É%s
\81H", pooltype, qbuf);
2299 if (yn(upstart(qtoo)) == 'y') {
2301 floating_above(pooltype);
2302 } else if (u.usteed && !is_swimmer(u.usteed->data)
2303 && P_SKILL(P_RIDING) < P_BASIC) {
2304 rider_cant_reach(); /* not skilled enough to reach */
2306 if (obj->otyp == POT_ACID)
2308 if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use)
2315 /* "What do you want to dip <the object> into?" */
2316 potion = getobj(beverages, qbuf); /* "dip into" */
2319 if (potion == obj && potion->quan == 1L) {
2321 pline("That is a potion bottle, not a Klein bottle!");
2323 pline("
\82±
\82ê
\82Í
\96ò
\95r
\82¾
\81I
\83N
\83\89\83C
\83\93\82Ì
\92Ù
\82¶
\82á
\82È
\82¢
\81I");
2326 potion->in_use = TRUE; /* assume it will be used up */
2327 if (potion->otyp == POT_WATER) {
2328 boolean useeit = !Blind || (obj == ublindf && Blindfolded_only);
2330 const char *obj_glows = Yobjnam2(obj, "glow");
2332 const char *obj_glows = cxname(obj);
2335 if (H2Opotion_dip(potion, obj, useeit, obj_glows))
2337 } else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
2338 /* some objects can't be polymorphed */
2339 if (obj->otyp == potion->otyp /* both POT_POLY */
2340 || obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
2341 || obj == uball || obj == uskin
2342 || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
2344 pline1(nothing_happens);
2346 boolean was_wep, was_swapwep, was_quiver;
2347 short save_otyp = obj->otyp;
2350 u.uconduct.polypiles++;
2352 was_wep = (obj == uwep);
2353 was_swapwep = (obj == uswapwep);
2354 was_quiver = (obj == uquiver);
2356 obj = poly_obj(obj, STRANGE_OBJECT);
2360 else if (was_swapwep)
2362 else if (was_quiver)
2365 if (obj->otyp != save_otyp) {
2366 makeknown(POT_POLYMORPH);
2368 prinv((char *) 0, obj, 0L);
2372 pline("Nothing seems to happen.");
2374 pline("
\89½
\82à
\8bN
\82±
\82ç
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2378 potion->in_use = FALSE; /* didn't go poof */
2380 } else if (obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {
2381 long amt = obj->quan;
2384 Strcpy(qbuf, "The");
2388 if (amt > (objects[potion->otyp].oc_magic ? 2L : 9L)) {
2389 /* trying to dip multiple potions will usually affect only a
2390 subset; pick an amount between 2 and min(N,9), inclusive */
2393 amt = (long) rnd((int) amt);
2394 } while (amt >= 9L);
2396 if (amt < obj->quan) {
2397 obj = splitobj(obj, amt);
2399 Sprintf(qbuf, "%ld of the", obj->quan);
2401 Sprintf(qbuf, "%ld
\96{
\82Ì", obj->quan);
2405 /* [N of] the {obj(s)} mix(es) with [one of] {the potion}... */
2407 pline("%s %s %s with %s%s...", qbuf, simpleonames(obj),
2408 otense(obj, "mix"), (potion->quan > 1L) ? "one of " : "",
2409 thesimpleoname(potion));
2410 #else /* [N
\96{
\82Ì]{obj}
\82ð{the potion}[
\82Ì
\88ê
\82Â]
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D */
2411 pline("%s%s
\82ð%s%s
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D", qbuf, simpleonames(obj),
2412 thesimpleoname(potion),
2413 (potion->quan > 1L) ? "
\82Ì
\88ê
\82Â" : "");
2415 /* Mixing potions is dangerous...
2416 KMH, balance patch -- acid is particularly unstable */
2417 if (obj->cursed || obj->otyp == POT_ACID || !rn2(10)) {
2418 /* it would be better to use up the whole stack in advance
2419 of the message, but we can't because we need to keep it
2420 around for potionbreathe() [and we can't set obj->in_use
2421 to 'amt' because that's not implemented] */
2424 pline("BOOM! They explode!");
2426 pline("
\83o
\81[
\83\93\81I
\94\9a\94
\82µ
\82½
\81I");
2427 wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
2428 exercise(A_STR, FALSE);
2429 if (!breathless(youmonst.data) || haseyes(youmonst.data))
2433 losehp((int) (amt + rnd(9)), /* not physical damage */
2435 "alchemic blast", KILLED_BY_AN);
2437 "
\92²
\8d\87\82Ì
\8e¸
\94s
\82Å", KILLED_BY_AN);
2441 obj->blessed = obj->cursed = obj->bknown = 0;
2442 if (Blind || Hallucination)
2445 if ((mixture = mixtype(obj, potion)) != 0) {
2446 obj->otyp = mixture;
2448 switch (obj->odiluted ? 1 : rnd(8)) {
2450 obj->otyp = POT_WATER;
2454 obj->otyp = POT_SICKNESS;
2457 struct obj *otmp = mkobj(POTION_CLASS, FALSE);
2459 obj->otyp = otmp->otyp;
2460 obfree(otmp, (struct obj *) 0);
2468 pline_The("mixture glows brightly and evaporates.");
2470 pline("
\8d¬
\82º
\82é
\82Æ
\96ò
\82Í
\96¾
\82é
\82
\8bP
\82«
\81C
\8fö
\94
\82µ
\82½
\81D");
2474 obj->odiluted = (obj->otyp != POT_WATER);
2476 if (obj->otyp == POT_WATER && !Hallucination) {
2478 pline_The("mixture bubbles%s.", Blind ? "" : ", then clears");
2480 pline("
\96ò
\82ð
\8d¬
\82º
\82é
\82Æ%s
\96A
\82¾
\82Á
\82½
\81D", Blind ? "" : "
\82µ
\82Î
\82ç
\82");
2481 } else if (!Blind) {
2483 pline_The("mixture looks %s.",
2485 pline("
\8d¬
\82º
\82½
\96ò
\82Í%s
\96ò
\82É
\8c©
\82¦
\82é
\81D",
2486 hcolor(OBJ_DESCR(objects[obj->otyp])));
2490 /* this is required when 'obj' was split off from a bigger stack,
2491 so that 'obj' will now be assigned its own inventory slot;
2492 it has a side-effect of merging 'obj' into another compatible
2493 stack if there is one, so we do it even when no split has
2494 been made in order to get the merge result for both cases;
2495 as a consequence, mixing while Fumbling drops the mixture */
2498 (void) hold_another_object(obj, "You drop %s!", doname(obj),
2501 (void) hold_another_object(obj, "%s
\82ð
\97\8e\82µ
\82½
\81I", doname(obj),
2507 if (potion->otyp == POT_ACID && obj->otyp == CORPSE
2508 && obj->corpsenm == PM_LICHEN && !Blind) {
2510 pline("%s %s %s around the edges.", The(cxname(obj)),
2511 otense(obj, "turn"),
2512 potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED));
2514 pline("%s
\82Í
\82Ó
\82¿
\82ª%s
\82È
\82Á
\82½
\81D", The(cxname(obj)),
2515 jconj_adj(potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED)));
2517 potion->in_use = FALSE; /* didn't go poof */
2521 if (potion->otyp == POT_WATER && obj->otyp == TOWEL) {
2523 pline_The("towel soaks it up!");
2525 pline_The("
\83^
\83I
\83\8b\82Í
\90\85\82ð
\8bz
\82¢
\8d\9e\82ñ
\82¾
\81I");
2526 /* wetting towel already done via water_damage() in H2Opotion_dip */
2530 if (is_poisonable(obj)) {
2531 if (potion->otyp == POT_SICKNESS && !obj->opoisoned) {
2534 if (potion->quan > 1L)
2536 Sprintf(buf, "One of %s", the(xname(potion)));
2538 Sprintf(buf, "%s
\82Ì
\88ê
\82Â", the(xname(potion)));
2540 Strcpy(buf, The(xname(potion)));
2542 pline("%s forms a coating on %s.", buf, the(xname(obj)));
2544 pline("%s
\82ª%s
\82É
\93h
\82ç
\82ê
\82½
\81D", buf, the(xname(obj)));
2545 obj->opoisoned = TRUE;
2547 } else if (obj->opoisoned && (potion->otyp == POT_HEALING
2548 || potion->otyp == POT_EXTRA_HEALING
2549 || potion->otyp == POT_FULL_HEALING)) {
2551 pline("A coating wears off %s.", the(xname(obj)));
2553 pline("
\93Å
\82ª%s
\82©
\82ç
\94\8d\82°
\82¨
\82¿
\82½
\81D", the(xname(obj)));
2559 if (potion->otyp == POT_ACID) {
2560 if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING)
2564 if (potion->otyp == POT_OIL) {
2565 boolean wisx = FALSE;
2567 if (potion->lamplit) { /* burning */
2568 fire_damage(obj, TRUE, u.ux, u.uy);
2569 } else if (potion->cursed) {
2571 pline_The("potion spills and covers your %s with oil.",
2573 pline("
\96û
\82Í
\94ò
\82Ñ
\8eU
\82è
\82 \82È
\82½
\82Ì%s
\82É
\82©
\82©
\82Á
\82½
\81D",
2574 makeplural(body_part(FINGER)));
2575 incr_itimeout(&Glib, d(2, 10));
2576 } else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
2577 /* the following cases apply only to weapons */
2579 /* Oil removes rust and corrosion, but doesn't unburn.
2580 * Arrows, etc are classed as metallic due to arrowhead
2581 * material, but dipping in oil shouldn't repair them.
2583 } else if ((!is_rustprone(obj) && !is_corrodeable(obj))
2584 || is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
2585 /* uses up potion, doesn't set obj->greased */
2587 pline("%s %s with an oily sheen.", Yname2(obj),
2588 otense(obj, "gleam"));
2590 pline("%s
\82Í
\96û
\82Ì
\8cõ
\91ò
\82Å
\82«
\82ç
\82è
\82Æ
\8cõ
\82Á
\82½
\81D", Yname2(obj));
2594 pline("%s %s less %s.", Yname2(obj), otense(obj, "are"),
2595 (obj->oeroded && obj->oeroded2)
2596 ? "corroded and rusty"
2597 : obj->oeroded ? "rusty" : "corroded");
2599 pline("%s
\82Ì%s
\82ª
\8eæ
\82ê
\82½
\81D", Yname2(obj),
2600 (obj->oeroded && obj->oeroded2)
2601 ? "
\95\85\90H
\82Æ
\8eK"
2602 : obj->oeroded ? "
\8eK" : "
\95\85\90H");
2604 if (obj->oeroded > 0)
2606 if (obj->oeroded2 > 0)
2610 exercise(A_WIS, wisx);
2611 makeknown(potion->otyp);
2617 /* Allow filling of MAGIC_LAMPs to prevent identification by player */
2618 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP)
2619 && (potion->otyp == POT_OIL)) {
2620 /* Turn off engine before fueling, turn off fuel too :-) */
2621 if (obj->lamplit || potion->lamplit) {
2623 explode(u.ux, u.uy, 11, d(6, 6), 0, EXPL_FIERY);
2624 exercise(A_WIS, FALSE);
2627 /* Adding oil to an empty magic lamp renders it into an oil lamp */
2628 if ((obj->otyp == MAGIC_LAMP) && obj->spe == 0) {
2629 obj->otyp = OIL_LAMP;
2632 if (obj->age > 1000L) {
2634 pline("%s %s full.", Yname2(obj), otense(obj, "are"));
2636 pline("%s
\82É
\82Í
\82½
\82Á
\82Õ
\82è
\93ü
\82Á
\82Ä
\82¢
\82é
\81D", Yname2(obj));
2637 potion->in_use = FALSE; /* didn't go poof */
2640 You("fill %s with oil.", yname(obj));
2642 You("%s
\82É
\96û
\82ð
\93ü
\82ê
\82½
\81D", yname(obj));
2643 check_unpaid(potion); /* Yendorian Fuel Tax */
2644 obj->age += 2 * potion->age; /* burns more efficiently */
2645 if (obj->age > 1500L)
2648 exercise(A_WIS, TRUE);
2656 potion->in_use = FALSE; /* didn't go poof */
2657 if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST)
2658 && (mixture = mixtype(obj, potion)) != 0) {
2659 char oldbuf[BUFSZ], newbuf[BUFSZ];
2660 short old_otyp = potion->otyp;
2661 boolean old_dknown = FALSE;
2662 boolean more_than_one = potion->quan > 1L;
2665 if (potion->dknown) {
2668 Sprintf(oldbuf, "%s ", hcolor(OBJ_DESCR(objects[potion->otyp])));
2670 Sprintf(oldbuf, "%s", hcolor(OBJ_DESCR(objects[potion->otyp])));
2672 /* with multiple merged potions, split off one and
2674 if (potion->quan > 1L) {
2675 singlepotion = splitobj(potion, 1L);
2677 singlepotion = potion;
2679 costly_alteration(singlepotion, COST_NUTRLZ);
2680 singlepotion->otyp = mixture;
2681 singlepotion->blessed = 0;
2682 if (mixture == POT_WATER)
2683 singlepotion->cursed = singlepotion->odiluted = 0;
2685 singlepotion->cursed = obj->cursed; /* odiluted left as-is */
2686 singlepotion->bknown = FALSE;
2688 singlepotion->dknown = FALSE;
2690 singlepotion->dknown = !Hallucination;
2692 if (mixture == POT_WATER && singlepotion->dknown)
2693 Sprintf(newbuf, "clears");
2695 Sprintf(newbuf, "turns %s",
2696 hcolor(OBJ_DESCR(objects[mixture])));
2697 pline_The("%spotion%s %s.", oldbuf,
2698 more_than_one ? " that you dipped into" : "", newbuf);
2700 if (mixture == POT_WATER && singlepotion->dknown)
2701 Sprintf(newbuf, "
\93§
\96¾");
2703 Sprintf(newbuf, "%s
\96ò",
2704 hcolor(OBJ_DESCR(objects[mixture])));
2705 pline_The("%s%s
\96ò
\82Í%s
\82É
\82È
\82Á
\82½
\81D.", more_than_one ? "
\90Z
\82µ
\82½" : "",
2708 if (!objects[old_otyp].oc_uname
2709 && !objects[old_otyp].oc_name_known && old_dknown) {
2713 fakeobj.otyp = old_otyp;
2714 fakeobj.oclass = POTION_CLASS;
2718 obj_extract_self(singlepotion);
2721 hold_another_object(singlepotion, "You juggle and drop %s!",
2723 hold_another_object(singlepotion, "
\82¨
\8eè
\8bÊ
\82µ
\82Ä%s
\82ð
\97\8e\82Æ
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I",
2724 doname(singlepotion), (const char *) 0);
2730 pline("Interesting...");
2732 pline("
\96Ê
\94\92\82¢
\81D
\81D
\81D");
2736 if (!objects[potion->otyp].oc_name_known
2737 && !objects[potion->otyp].oc_uname)
2743 /* *monp grants a wish and then leaves the game */
2746 struct monst **monp;
2748 struct monst *mon = *monp;
2749 int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
2751 /* remove the monster first in case wish proves to be fatal
2752 (blasted by artifact), to keep it out of resulting bones file */
2754 *monp = 0; /* inform caller that monster is gone */
2755 /* hide that removal from player--map is visible during wish prompt */
2756 tmp_at(DISP_ALWAYS, glyph);
2758 /* grant the wish */
2761 tmp_at(DISP_END, 0);
2765 djinni_from_bottle(obj)
2771 if (!(mtmp = makemon(&mons[PM_DJINNI], u.ux, u.uy, NO_MM_FLAGS))) {
2773 pline("It turns out to be empty.");
2775 if (obj->otyp == MAGIC_LAMP) {
2776 pline("
\83\89\83\93\83v
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2778 pline("
\96ò
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2786 pline("In a cloud of smoke, %s emerges!", a_monnam(mtmp));
2788 pline("
\89\8c\82Ì
\92\86\82©
\82ç
\81C%s
\82ª
\8c»
\82í
\82ê
\82½
\81I", a_monnam(mtmp));
2790 pline("%s speaks.", Monnam(mtmp));
2792 pline("%s
\82Í
\98b
\82µ
\82©
\82¯
\82½
\81D", Monnam(mtmp));
2795 You("smell acrid fumes.");
2797 You("
\83c
\83\93\82Æ
\82·
\82é
\93õ
\82¢
\82ª
\82µ
\82½
\81D");
2799 pline("%s speaks.", Something);
2801 pline("%s
\82ª
\98b
\82µ
\82©
\82¯
\82½
\81D", Something);
2806 chance = (chance == 4) ? rnd(4) : 0;
2807 else if (obj->cursed)
2808 chance = (chance == 0) ? rn2(4) : 4;
2809 /* 0,1,2,3,4: b=80%,5,5,5,5; nc=20%,20,20,20,20; c=5%,5,5,5,80 */
2814 verbalize("I am in your debt. I will grant one wish!");
2816 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");
2817 /* give a wish and discard the monster (mtmp set to null) */
2818 mongrantswish(&mtmp);
2822 verbalize("Thank you for freeing me!");
2824 verbalize("
\8e\84\82ð
\8f\95\82¯
\82Ä
\82
\82ê
\82½
\82±
\82Æ
\82ð
\8a´
\8eÓ
\82·
\82é
\81I");
2825 (void) tamedog(mtmp, (struct obj *) 0);
2829 verbalize("You freed me!");
2831 verbalize("
\89ð
\95ú
\82µ
\82Ä
\82
\82ê
\82½
\82Ì
\82Í
\82¨
\91O
\82©
\81I");
2832 mtmp->mpeaceful = TRUE;
2837 verbalize("It is about time!");
2839 verbalize("
\82³
\82ç
\82Î
\82¾
\81I");
2840 if (canspotmon(mtmp))
2842 pline("%s vanishes.", Monnam(mtmp));
2844 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81D", Monnam(mtmp));
2849 verbalize("You disturbed me, fool!");
2851 verbalize("
\82¨
\82Ü
\82¦
\82Í
\8e\84\82Ì
\96°
\82è
\82ð
\96W
\82°
\82½
\81D
\82¨
\82ë
\82©
\82à
\82Ì
\82ß
\81I");
2852 mtmp->mpeaceful = FALSE;
2858 /* clone a gremlin or mold (2nd arg non-null implies heat as the trigger);
2859 hit points are cut in half (odd HP stays with original) */
2861 split_mon(mon, mtmp)
2862 struct monst *mon, /* monster being split */
2863 *mtmp; /* optional attacker whose heat triggered it */
2865 struct monst *mtmp2;
2871 Sprintf(reason, " from %s heat",
2872 (mtmp == &youmonst) ? the_your[1]
2873 : (const char *) s_suffix(mon_nam(mtmp)));
2875 Sprintf(reason, "%s
\82Ì
\94M
\82Å",
2876 (mtmp == &youmonst) ? the_your[1]
2877 : (const char *) s_suffix(mon_nam(mtmp)));
2880 if (mon == &youmonst) {
2883 mtmp2->mhpmax = u.mhmax / 2;
2884 u.mhmax -= mtmp2->mhpmax;
2887 You("multiply%s!", reason);
2889 You("%s
\95ª
\97ô
\82µ
\82½
\81I", reason);
2892 mtmp2 = clone_mon(mon, 0, 0);
2894 mtmp2->mhpmax = mon->mhpmax / 2;
2895 mon->mhpmax -= mtmp2->mhpmax;
2896 if (canspotmon(mon))
2898 pline("%s multiplies%s!", Monnam(mon), reason);
2900 pline("%s
\82Í%s
\95ª
\97ô
\82µ
\82½
\81I", Monnam(mon), reason);