1 /* NetHack 3.6 potion.c $NHDT-Date: 1573848199 2019/11/15 20:03:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2013. */
4 /* NetHack may be freely redistributed. See license for details. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2020 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 boolean notonhead = FALSE;
15 static NEARDATA int nothing, unkn;
16 static NEARDATA const char beverages[] = { POTION_CLASS, 0 };
18 STATIC_DCL long FDECL(itimeout, (long));
19 STATIC_DCL long FDECL(itimeout_incr, (long, int));
20 STATIC_DCL void NDECL(ghost_from_bottle);
22 FDECL(H2Opotion_dip, (struct obj *, struct obj *, BOOLEAN_P, const char *));
23 STATIC_DCL short FDECL(mixtype, (struct obj *, struct obj *));
25 /* force `val' to be within valid range for intrinsic timeout value */
38 /* increment `old' by `incr' and force result to be valid intrinsic timeout */
40 itimeout_incr(old, incr)
44 return itimeout((old & TIMEOUT) + (long) incr);
47 /* set the timeout field of intrinsic `which' */
49 set_itimeout(which, val)
53 *which |= itimeout(val);
56 /* increment the timeout field of intrinsic `which' */
58 incr_itimeout(which, incr)
62 set_itimeout(which, itimeout_incr(*which, incr));
66 make_confused(xtime, talk)
70 long old = HConfusion;
78 You_feel("less %s now.", Hallucination ? "trippy" : "confused");
80 You("%s
\82ª
\82¨
\82³
\82Ü
\82Á
\82½
\81D", Hallucination ? "
\83w
\83\8d\83w
\83\8d" : "
\8d¬
\97\90");
82 if ((xtime && !old) || (!xtime && old))
85 set_itimeout(&HConfusion, xtime);
89 make_stunned(xtime, talk)
102 Hallucination ? "less wobbly" : "a bit steadier");
105 Hallucination ? "
\82Ö
\82ë
\82è
\82ç
\82ª
\82¨
\82³
\82Ü
\82Á
\82½" : "
\82¾
\82ñ
\82¾
\82ñ
\82µ
\82Á
\82©
\82è
\82µ
\82Ä
\82«
\82½");
112 You("wobble in the saddle.");
114 You("
\88Æ
\82Ì
\8fã
\82Å
\82®
\82ç
\82®
\82ç
\82µ
\82½
\81D");
117 You("%s...", stagger(youmonst.data, "stagger"));
119 You("
\82
\82ç
\82
\82ç
\82µ
\82½
\81D
\81D
\81D");
122 if ((!xtime && old) || (xtime && !old))
125 set_itimeout(&HStun, xtime);
128 /* Sick is overloaded with both fatal illness and food poisoning (via
129 u.usick_type bit mask), but delayed killer can only support one or
130 the other at a time. They should become separate intrinsics.... */
132 make_sick(xtime, cause, talk, type)
134 const char *cause; /* sickness cause */
141 #if 0 /* tell player even if hero is unconscious */
151 You_feel("deathly sick.");
153 You("
\95a
\8bC
\82Å
\8e\80\82É
\82»
\82¤
\82¾
\81D");
158 You_feel("%s worse.", xtime <= Sick / 2L ? "much" : "even");
160 You("%s
\88«
\89»
\82µ
\82½
\82æ
\82¤
\82È
\8bC
\82ª
\82·
\82é
\81D", xtime <= Sick/2L ? "
\82³
\82ç
\82É" : "
\82à
\82Á
\82Æ");
162 set_itimeout(&Sick, xtime);
163 u.usick_type |= type;
165 } else if (old && (type & u.usick_type)) {
166 /* was sick, now not */
167 u.usick_type &= ~type;
168 if (u.usick_type) { /* only partly cured */
171 You_feel("somewhat better.");
173 You("
\82¿
\82å
\82Á
\82Æ
\82æ
\82
\82È
\82Á
\82½
\81D");
174 set_itimeout(&Sick, Sick * 2); /* approximation */
178 You_feel("cured. What a relief!");
180 pline("
\89ñ
\95\9c\82µ
\82½
\81D
\82 \82 \8f\95\82©
\82Á
\82½
\81I");
181 Sick = 0L; /* set_itimeout(&Sick, 0L) */
186 kptr = find_delayed_killer(SICK);
188 exercise(A_CON, FALSE);
189 /* setting delayed_killer used to be unconditional, but that's
190 not right when make_sick(0) is called to cure food poisoning
191 if hero was also fatally ill; this is only approximate */
192 if (xtime || !old || !kptr) {
193 int kpfx = ((cause && !strcmp(cause, "#wizintrinsic"))
194 ? KILLED_BY : KILLED_BY_AN);
196 delayed_killer(SICK, kpfx, cause);
199 dealloc_killer(kptr);
203 make_slimed(xtime, msg)
209 #if 0 /* tell player even if hero is unconscious */
213 set_itimeout(&Slimed, xtime);
214 if ((xtime != 0L) ^ (old != 0L)) {
220 dealloc_killer(find_delayed_killer(SLIMED));
221 /* fake appearance is set late in turn-to-slime countdown */
222 if (U_AP_TYPE == M_AP_MONSTER
223 && youmonst.mappearance == PM_GREEN_SLIME) {
224 youmonst.m_ap_type = M_AP_NOTHING;
225 youmonst.mappearance = 0;
230 /* start or stop petrification */
232 make_stoned(xtime, msg, killedby, killername)
236 const char *killername;
240 #if 0 /* tell player even if hero is unconscious */
244 set_itimeout(&Stoned, xtime);
245 if ((xtime != 0L) ^ (old != 0L)) {
251 dealloc_killer(find_delayed_killer(STONED));
253 delayed_killer(STONED, killedby, killername);
257 make_vomiting(xtime, talk)
266 set_itimeout(&Vomiting, xtime);
271 You_feel("much less nauseated now.");
273 You("
\93f
\82«
\8bC
\82ª
\82¨
\82³
\82Ü
\82Á
\82½
\81D");
277 static const char vismsg[] = "vision seems to %s for a moment but is %s now.";
279 static const char vismsg[] = "
\8e\8b\8aE
\82Í
\88ê
\8fu%s
\82È
\82Á
\82½
\82ª
\82Ü
\82½%s
\82È
\82Á
\82½
\81D";
281 static const char eyemsg[] = "%s momentarily %s.";
283 static const char eyemsg[] = "%s
\82Í
\88ê
\8fu%s
\81D";
286 make_blinded(xtime, talk)
291 boolean u_could_see, can_see_now;
296 /* we need to probe ahead in case the Eyes of the Overworld
297 are or will be overriding blindness */
298 u_could_see = !Blind;
299 Blinded = xtime ? 1L : 0L;
300 can_see_now = !Blind;
301 Blinded = old; /* restore */
306 if (can_see_now && !u_could_see) { /* regaining sight */
310 pline("Far out! Everything is all cosmic again!");
312 pline("
\82°
\81I
\82È
\82É
\82à
\82©
\82à
\82ª
\82Ü
\82½
\93ø
\90F
\82É
\8c©
\82¦
\82é
\81I");
315 You("can see again.");
317 You("
\82Ü
\82½
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
319 } else if (old && !xtime) {
320 /* clearing temporary blindness without toggling blindness */
322 if (!haseyes(youmonst.data)) {
323 strange_feeling((struct obj *) 0, (char *) 0);
324 } else if (Blindfolded) {
326 eyes = body_part(EYE);
327 if (eyecount(youmonst.data) != 1)
328 eyes = makeplural(eyes);
329 Your(eyemsg, eyes, vtense(eyes, "itch"));
331 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
333 } else { /* Eyes of the Overworld */
335 Your(vismsg, "brighten", Hallucination ? "sadder" : "normal");
337 Your(vismsg, "
\96¾
\82é
\82", Hallucination ? "
\8dª
\88Ã
\82É" : "
\95\81\92Ê
\82É");
342 if (u_could_see && !can_see_now) { /* losing sight */
346 pline("Oh, bummer! Everything is dark! Help!");
348 pline("
\88Ã
\82¢
\82æ
\81[
\81C
\8b·
\82¢
\82æ
\81[
\81C
\8b°
\82¢
\82æ
\81[
\81I");
351 pline("A cloud of darkness falls upon you.");
353 pline("
\88Ã
\8d\95\82Ì
\89_
\82ª
\82 \82È
\82½
\82ð
\95¢
\82Á
\82½
\81D");
355 /* Before the hero goes blind, set the ball&chain variables. */
358 } else if (!old && xtime) {
359 /* setting temporary blindness without toggling blindness */
361 if (!haseyes(youmonst.data)) {
362 strange_feeling((struct obj *) 0, (char *) 0);
363 } else if (Blindfolded) {
365 eyes = body_part(EYE);
366 if (eyecount(youmonst.data) != 1)
367 eyes = makeplural(eyes);
368 Your(eyemsg, eyes, vtense(eyes, "twitch"));
370 Your(eyemsg, body_part(EYE), "
\83s
\83N
\83s
\83N
\82µ
\82½");
372 } else { /* Eyes of the Overworld */
374 Your(vismsg, "dim", Hallucination ? "happier" : "normal");
376 Your(vismsg, "
\94\96\88Ã
\82", Hallucination ? "
\83n
\83b
\83s
\81[
\82É" : "
\95\81\92Ê
\82É");
381 set_itimeout(&Blinded, xtime);
383 if (u_could_see ^ can_see_now) { /* one or the other but not both */
388 /* blindness has just started or just ended--caller enforces that;
389 called by Blindf_on(), Blindf_off(), and make_blinded() */
393 boolean Stinging = (uwep && (EWarn_of_mon & W_WEP) != 0L);
395 /* blindness has just been toggled */
396 context.botl = TRUE; /* status conditions need update */
397 vision_full_recalc = 1; /* vision has changed */
398 /* this vision recalculation used to be deferred until moveloop(),
399 but that made it possible for vision irregularities to occur
400 (cited case was force bolt hitting an adjacent potion of blindness
401 and then a secret door; hero was blinded by vapors but then got the
402 message "a door appears in the wall" because wall spot was IN_SIGHT) */
404 if (Blind_telepat || Infravision || Stinging)
405 see_monsters(); /* also counts EWarn_of_mon monsters */
407 * Avoid either of the sequences
408 * "Sting starts glowing", [become blind], "Sting stops quivering" or
409 * "Sting starts quivering", [regain sight], "Sting stops glowing"
410 * by giving "Sting is quivering" when becoming blind or
411 * "Sting is glowing" when regaining sight so that the eventual
412 * "stops" message matches the most recent "Sting is ..." one.
416 /* update dknown flag for inventory picked up while blind */
418 learn_unseen_invent();
422 make_hallucinated(xtime, talk, mask)
423 long xtime; /* nonzero if this is an attempt to turn on hallucination */
425 long mask; /* nonzero if resistance status should change by mask */
427 long old = HHallucination;
429 const char *message, *verb;
435 message = (!xtime) ? "Everything %s SO boring now."
436 : "Oh wow! Everything %s so cosmic!";
438 message = (!xtime) ? "
\89½
\82à
\82©
\82à
\82ª
\81\96\91Þ
\8bü
\81\96\82É%s
\82é
\81D"
439 : "
\83\8f\81[
\83I
\81I
\89½
\82à
\82©
\82à
\93ø
\90F
\82É%s
\82é
\81I";
442 verb = (!Blind) ? "looks" : "feels";
444 verb = (!Blind) ? "
\8c©
\82¦" : "
\8a´
\82¶";
451 EHalluc_resistance |= mask;
453 EHalluc_resistance &= ~mask;
455 if (!EHalluc_resistance && (!!HHallucination != !!xtime))
457 set_itimeout(&HHallucination, xtime);
459 /* clearing temporary hallucination without toggling vision */
460 if (!changed && !HHallucination && old && talk) {
461 if (!haseyes(youmonst.data)) {
462 strange_feeling((struct obj *) 0, (char *) 0);
465 const char *eyes = body_part(EYE);
467 if (eyecount(youmonst.data) != 1)
468 eyes = makeplural(eyes);
469 Your(eyemsg, eyes, vtense(eyes, "itch"));
471 Your(eyemsg, body_part(EYE), "
\82©
\82ä
\82
\82È
\82Á
\82½");
473 } else { /* Grayswandir */
475 Your(vismsg, "flatten", "normal");
477 Your(vismsg, "
\82¨
\82©
\82µ
\82", "
\95\81\92Ê
\82É");
483 /* in case we're mimicking an orange (hallucinatory form
484 of mimicking gold) update the mimicking's-over message */
489 swallowed(0); /* redraw swallow display */
491 /* The see_* routines should be called *before* the pline. */
497 /* for perm_inv and anything similar
498 (eg. Qt windowport's equipped items display) */
503 pline(message, verb);
509 make_deaf(xtime, talk)
518 set_itimeout(&HDeaf, xtime);
519 if ((xtime != 0L) ^ (old != 0L)) {
523 You(old ? "can hear again." : "are unable to hear anything.");
525 You(old ? "
\82Ü
\82½
\95·
\82±
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D" : "
\89½
\82à
\95·
\82±
\82¦
\82È
\82
\82È
\82Á
\82½
\81D");
529 /* set or clear "slippery fingers" */
534 set_itimeout(&Glib, xtime);
535 /* may change "(being worn)" to "(being worn; slippery)" or vice versa */
545 Hallucination ? "Far out, man! You"
546 : "Gee! All of a sudden, you",
547 See_invisible ? "can see right through yourself"
548 : "can't see yourself");
550 pline("%s
\82 \82È
\82½
\82Í%s
\81D",
551 Hallucination ? "
\83\8f\81[
\83I
\81I" : "
\82°
\81I
\93Ë
\91R",
552 See_invisible ? "
\8e©
\95ª
\8e©
\90g
\82ª
\82¿
\82á
\82ñ
\82Æ
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½"
553 : "
\8e©
\95ª
\8e©
\90g
\82ª
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½");
560 struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS);
564 pline("This bottle turns out to be empty.");
566 pline("
\95r
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
571 pline("As you open the bottle, %s emerges.", something);
573 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\89½
\82©
\82ª
\8fo
\82Ä
\82«
\82½
\81D");
577 pline("As you open the bottle, an enormous %s emerges!",
578 Hallucination ? rndmonnam(NULL) : (const char *) "ghost");
580 pline("
\95r
\82ð
\8aJ
\82¯
\82é
\82Æ
\81C
\8b\90\91å
\82È%s
\82ª
\8fo
\82Ä
\82«
\82½
\81I",
581 Hallucination ? rndmonnam(NULL) : (const char *) "
\97H
\97ì");
585 You("are frightened to death, and unable to move.");
587 You("
\82Ü
\82Á
\82³
\82¨
\82É
\82È
\82Á
\82Ä
\8bÁ
\82«
\81C
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
590 multi_reason = "being frightened to death";
592 multi_reason = "
\8e\80\82Ê
\82Ù
\82Ç
\8bÁ
\82¢
\82½
\8c\84\82É";
594 nomovemsg = "You regain your composure.";
596 nomovemsg = "
\82 \82È
\82½
\82Í
\95½
\90Ã
\82ð
\8eæ
\82è
\96ß
\82µ
\82½
\81D";
599 /* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
603 register struct obj *otmp;
604 const char *potion_descr;
608 pline("If you can't breathe air, how can you drink liquid?");
610 pline("
\91§
\82à
\82Å
\82«
\82È
\82¢
\82Ì
\82É
\81C
\82Ç
\82¤
\82â
\82Á
\82Ä
\89t
\91Ì
\82ð
\88ù
\82Þ
\82ñ
\82¾
\82¢
\81H");
613 /* Is there a fountain to drink from here? */
614 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
615 /* not as low as floor level but similar restrictions apply */
616 && can_reach_floor(FALSE)) {
618 if (yn("Drink from the fountain?") == 'y') {
620 if (yn("
\90ò
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
625 /* Or a kitchen sink? */
626 if (IS_SINK(levl[u.ux][u.uy].typ)
627 /* not as low as floor level but similar restrictions apply */
628 && can_reach_floor(FALSE)) {
630 if (yn("Drink from the sink?") == 'y') {
632 if (yn("
\97¬
\82µ
\91ä
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
637 /* Or are you surrounded by water? */
638 if (Underwater && !u.uswallow) {
640 if (yn("Drink the water around you?") == 'y') {
642 if (yn("
\82Ü
\82í
\82è
\82Ì
\90\85\82ð
\88ù
\82Ý
\82Ü
\82·
\82©
\81H") == 'y') {
644 pline("Do you know what lives in this water?");
646 pline("
\82±
\82Ì
\90\85\92\86\82Å
\89½
\82ª
\90¶
\82«
\82Ä
\82¢
\82é
\82Ì
\82©
\92m
\82Á
\82Ä
\82é
\82©
\82¢
\81H");
651 otmp = getobj(beverages, "drink");
655 /* quan > 1 used to be left to useup(), but we need to force
656 the current potion to be unworn, and don't want to do
657 that for the entire stack when starting with more than 1.
658 [Drinking a wielded potion of polymorph can trigger a shape
659 change which causes hero's weapon to be dropped. In 3.4.x,
660 that led to an "object lost" panic since subsequent useup()
661 was no longer dealing with an inventory item. Unwearing
662 the current potion is intended to keep it in inventory.] */
663 if (otmp->quan > 1L) {
664 otmp = splitobj(otmp, 1L);
665 otmp->owornmask = 0L; /* rest of original stuck unaffected */
666 } else if (otmp->owornmask) {
667 remove_worn_item(otmp, FALSE);
669 otmp->in_use = TRUE; /* you've opened the stopper */
671 potion_descr = OBJ_DESCR(objects[otmp->otyp]);
674 if (!strcmp(potion_descr, "milky")
676 if (!strcmp(potion_descr, "
\83~
\83\8b\83N
\90F
\82Ì")
677 && !(mvitals[PM_GHOST].mvflags & G_GONE)
678 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_GHOST].born))) {
683 } else if (!strcmp(potion_descr, "smoky")
685 } else if (!strcmp(potion_descr, "
\89\8c\82ª
\82Å
\82Ä
\82¢
\82é")
686 && !(mvitals[PM_DJINNI].mvflags & G_GONE)
687 && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_DJINNI].born))) {
688 djinni_from_bottle(otmp);
693 return dopotion(otmp);
698 register struct obj *otmp;
704 if ((retval = peffects(otmp)) >= 0)
710 You("have a %s feeling for a moment, then it passes.",
711 Hallucination ? "normal" : "peculiar");
713 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
714 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\93Æ
\93Á
\82È");
717 if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
719 makeknown(otmp->otyp);
720 more_experienced(0, 10);
721 } else if (!objects[otmp->otyp].oc_uname)
730 register struct obj *otmp;
732 register int i, ii, lim;
734 switch (otmp->otyp) {
735 case POT_RESTORE_ABILITY:
736 case SPE_RESTORE_ABILITY:
740 pline("Ulch! This makes you feel mediocre!");
742 pline("
\82¤
\81[
\82ñ
\81C
\82Ç
\82¤
\82à
\82³
\82¦
\82È
\82¢
\82È
\82 \81D");
745 /* unlike unicorn horn, overrides Fixed_abil */
747 pline("Wow! This makes you feel %s!",
749 ? (unfixable_trouble_count(FALSE) ? "better" : "great")
752 pline("
\83\8f\81[
\83I
\81I
\8bC
\95ª
\82ª%s
\82È
\82Á
\82½
\81I",
754 ? (unfixable_trouble_count(FALSE) ? "
\82¾
\82¢
\82Ô
\82æ
\82" : "
\82Æ
\82Ä
\82à
\82æ
\82")
757 i = rn2(A_MAX); /* start at a random point */
758 for (ii = 0; ii < A_MAX; ii++) {
760 /* this used to adjust 'lim' for A_STR when u.uhs was
761 WEAK or worse, but that's handled via ATEMP(A_STR) now */
762 if (ABASE(i) < lim) {
765 /* only first found if not blessed */
773 /* when using the potion (not the spell) also restore lost levels,
774 to make the potion more worth keeping around for players with
775 the spell or with a unihorn; this is better than full healing
776 in that it can restore all of them, not just half, and a
777 blessed potion restores them all at once */
778 if (otmp->otyp == POT_RESTORE_ABILITY && u.ulevel < u.ulevelmax) {
781 } while (u.ulevel < u.ulevelmax && otmp->blessed);
785 case POT_HALLUCINATION:
786 if (Hallucination || Halluc_resistance)
788 (void) make_hallucinated(itimeout_incr(HHallucination,
789 rn1(200, 600 - 300 * bcsign(otmp))),
793 if (!otmp->blessed && !otmp->cursed) {
795 pline("This tastes like %s.", hliquid("water"));
797 pline("%s
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D", hliquid("
\90\85"));
798 u.uhunger += rnd(10);
803 if (is_undead(youmonst.data) || is_demon(youmonst.data)
804 || u.ualign.type == A_CHAOTIC) {
807 pline("This burns like %s!", hliquid("acid"));
809 pline("%s
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I", hliquid("
\8e_"));
810 exercise(A_CON, FALSE);
811 if (u.ulycn >= LOW_PM) {
813 Your("affinity to %s disappears!",
815 Your("%s
\82Ö
\82Ì
\90e
\8bß
\8a´
\82Í
\82È
\82
\82È
\82Á
\82½
\81I",
816 makeplural(mons[u.ulycn].mname));
817 if (youmonst.data == &mons[u.ulycn])
819 set_ulycn(NON_PM); /* cure lycanthropy */
822 losehp(Maybe_Half_Phys(d(2, 6)), "potion of holy water",
824 losehp(Maybe_Half_Phys(d(2, 6)), "
\90¹
\90\85\82Å",
826 } else if (otmp->cursed) {
828 You_feel("quite proud of yourself.");
830 You("
\8e©
\91¸
\90S
\82ð
\8a´
\82¶
\82½
\81D");
831 healup(d(2, 6), 0, 0, 0);
832 if (u.ulycn >= LOW_PM && !Upolyd)
834 exercise(A_CON, TRUE);
839 You_feel("full of awe.");
841 You("
\88Ø
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
842 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
843 exercise(A_WIS, TRUE);
844 exercise(A_CON, TRUE);
845 if (u.ulycn >= LOW_PM)
846 you_unwere(TRUE); /* "Purified" */
847 /* make_confused(0L, TRUE); */
849 if (u.ualign.type == A_LAWFUL) {
851 pline("This burns like %s!", hliquid("acid"));
853 pline("%s
\82Ì
\82æ
\82¤
\82É
\90ã
\82ª
\82Ð
\82è
\82Ð
\82è
\82·
\82é
\81I", hliquid("
\8e_"));
855 losehp(Maybe_Half_Phys(d(2, 6)), "potion of unholy water",
857 losehp(Maybe_Half_Phys(d(2, 6)), "
\95s
\8fò
\82È
\90\85\82Å",
861 You_feel("full of dread.");
863 You("
\8b°
\95|
\82Ì
\94O
\82É
\82©
\82ç
\82ê
\82½
\81D");
864 if (u.ulycn >= LOW_PM && !Upolyd)
866 exercise(A_CON, FALSE);
873 pline("Ooph! This tastes like %s%s!",
874 otmp->odiluted ? "watered down " : "",
875 Hallucination ? "dandelion wine" : "liquid fire");
877 pline("
\82¤
\82¥
\82Á
\82Õ
\81I
\82±
\82ê
\82Í%s%s
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81I",
878 otmp->odiluted ? "
\90\85\82Å
\94\96\82ß
\82½" : "",
879 Hallucination ? "
\82½
\82ñ
\82Û
\82Û
\82Ì
\82¨
\8eð" : "
\94R
\97¿
\83I
\83C
\83\8b");
882 make_confused(itimeout_incr(HConfusion, d(3, 8)), FALSE);
883 /* the whiskey makes us feel better */
885 healup(1, 0, FALSE, FALSE);
886 u.uhunger += 10 * (2 + bcsign(otmp));
888 exercise(A_WIS, FALSE);
893 You("
\8bC
\90â
\82µ
\82½
\81D");
896 nomovemsg = "You awake with a headache.";
898 nomovemsg = "
\96Ú
\82ª
\82³
\82ß
\82½
\82ª
\93ª
\92É
\82ª
\82·
\82é
\81D";
901 case POT_ENLIGHTENMENT:
905 You("have an uneasy feeling...");
907 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D
\81D
\81D");
908 exercise(A_WIS, FALSE);
911 (void) adjattrib(A_INT, 1, FALSE);
912 (void) adjattrib(A_WIS, 1, FALSE);
915 You_feel("self-knowledgeable...");
917 You("
\8e©
\95ª
\8e©
\90g
\82ª
\94»
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D
\81D
\81D");
918 display_nhwindow(WIN_MESSAGE, FALSE);
919 enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
921 pline_The("feeling subsides.");
923 pline("
\82»
\82Ì
\8a´
\82¶
\82Í
\82È
\82
\82È
\82Á
\82½
\81D");
924 exercise(A_WIS, TRUE);
927 case SPE_INVISIBILITY:
928 /* spell cannot penetrate mummy wrapping */
929 if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
931 You_feel("rather itchy under %s.", yname(uarmc));
933 You("%s
\82Ì
\89º
\82ª
\83\80\83Y
\83\80\83Y
\82µ
\82½
\81D", xname(uarmc));
937 case POT_INVISIBILITY:
938 if (Invis || Blind || BInvis) {
941 self_invis_message();
944 HInvis |= FROMOUTSIDE;
946 incr_itimeout(&HInvis, rn1(15, 31));
947 newsym(u.ux, u.uy); /* update position */
950 pline("For some reason, you feel your presence is known.");
952 pline("
\82È
\82º
\82©
\81C
\91¶
\8dÝ
\82ª
\92m
\82ç
\82ê
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
956 case POT_SEE_INVISIBLE: /* tastes like fruit juice in Rogue */
957 case POT_FRUIT_JUICE: {
958 int msg = Invisible && !Blind;
963 pline("Yecch! This tastes %s.",
964 Hallucination ? "overripe" : "rotten");
966 pline("
\83I
\83F
\81[
\81I
\82±
\82ê
\82Í%s
\83W
\83\85\81[
\83X
\82Ì
\96¡
\82ª
\82·
\82é
\81D",
967 Hallucination ? "
\8fn
\82µ
\82·
\82¬
\82½" : "
\95\85\82Á
\82½");
973 ? "This tastes like 10%% real %s%s all-natural beverage."
974 : "This tastes like %s%s.",
975 otmp->odiluted ? "reconstituted " : "", fruitname(TRUE));
979 ? "10%%%s
\82Ì
\8f\83\8e©
\91R
\88ù
\97¿
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D"
980 : "%s%s
\83W
\83\85\81[
\83X
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D",
981 otmp->odiluted ? "
\90¬
\95ª
\92²
\90®
\82³
\82ê
\82½" : "", fruitname(TRUE));
983 if (otmp->otyp == POT_FRUIT_JUICE) {
984 u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
989 /* Tell them they can see again immediately, which
990 * will help them identify the potion...
992 make_blinded(0L, TRUE);
995 HSee_invisible |= FROMOUTSIDE;
997 incr_itimeout(&HSee_invisible, rn1(100, 750));
998 set_mimic_blocking(); /* do special mimic handling */
999 see_monsters(); /* see invisible monsters */
1000 newsym(u.ux, u.uy); /* see yourself! */
1001 if (msg && !Blind) { /* Blind possible if polymorphed */
1003 You("can see through yourself, but you are visible!");
1005 You("
\93§
\96¾
\82Å
\82 \82é
\81D
\82µ
\82©
\82µ
\8c©
\82¦
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81I");
1013 You("stiffen momentarily.");
1015 You("
\88ê
\8fu
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
1017 if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
1019 You("are motionlessly suspended.");
1021 You("
\8bó
\92\86\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D");
1024 You("are frozen in place!");
1026 You("
\82»
\82Ì
\8fê
\82Å
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
1029 Your("%s are frozen to the %s!", makeplural(body_part(FOOT)),
1030 surface(u.ux, u.uy));
1032 You("
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
1034 nomul(-(rn1(10, 25 - 12 * bcsign(otmp))));
1036 multi_reason = "frozen by a potion";
1038 multi_reason = "
\96ò
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
1039 nomovemsg = You_can_move_again;
1040 exercise(A_DEX, FALSE);
1044 if (Sleep_resistance || Free_action) {
1048 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
1051 You("suddenly fall asleep!");
1053 pline("
\93Ë
\91R
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I");
1054 fall_asleep(-rn1(10, 25 - 12 * bcsign(otmp)), TRUE);
1057 case POT_MONSTER_DETECTION:
1058 case SPE_DETECT_MONSTERS:
1059 if (otmp->blessed) {
1062 if (Detect_monsters)
1065 /* after a while, repeated uses become less effective */
1066 if ((HDetect_monsters & TIMEOUT) >= 300L)
1070 incr_itimeout(&HDetect_monsters, i);
1071 for (x = 1; x < COLNO; x++) {
1072 for (y = 0; y < ROWNO; y++) {
1073 if (levl[x][y].glyph == GLYPH_INVISIBLE) {
1084 You_feel("lonely.");
1086 You("
\90S
\8d×
\82
\82È
\82Á
\82½
\81D");
1089 if (monster_detect(otmp, 0))
1090 return 1; /* nothing detected */
1091 exercise(A_WIS, TRUE);
1093 case POT_OBJECT_DETECTION:
1094 case SPE_DETECT_TREASURE:
1095 if (object_detect(otmp, 0))
1096 return 1; /* nothing detected */
1097 exercise(A_WIS, TRUE);
1101 pline("Yecch! This stuff tastes like poison.");
1103 pline("
\83E
\83F
\81[
\81I
\93Å
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1104 if (otmp->blessed) {
1106 pline("(But in fact it was mildly stale %s.)", fruitname(TRUE));
1108 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\8f
\82µ
\8cÃ
\82
\82È
\82Á
\82½%s
\81D)", fruitname(TRUE));
1109 if (!Role_if(PM_HEALER)) {
1110 /* NB: blessed otmp->fromsink is not possible */
1112 losehp(1, "mildly contaminated potion", KILLED_BY_AN);
1114 losehp(1, "
\95a
\8bC
\82É
\89\98\90õ
\82³
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1117 if (Poison_resistance)
1119 pline("(But in fact it was biologically contaminated %s.)",
1121 pline("(
\82µ
\82©
\82µ
\8eÀ
\8dÛ
\82»
\82ê
\82Í
\90¶
\95¨
\8aw
\93I
\82É
\89\98\90õ
\82³
\82ê
\82½%s
\82¾
\81D)",
1123 if (Role_if(PM_HEALER)) {
1125 pline("Fortunately, you have been immunized.");
1127 pline("
\8dK
\89^
\82È
\82±
\82Æ
\82É
\81C
\82 \82È
\82½
\82Í
\96Æ
\89u
\82ª
\82 \82é
\81D");
1129 char contaminant[BUFSZ];
1130 int typ = rn2(A_MAX);
1133 Sprintf(contaminant, "%s%s",
1134 (Poison_resistance) ? "mildly " : "",
1135 (otmp->fromsink) ? "contaminated tap water"
1136 : "contaminated potion");
1138 Sprintf(contaminant, "%s
\89\98\90õ
\82³
\82ê
\82½%s
\82Å",
1139 (Poison_resistance) ? "
\8f
\82µ" : "",
1140 (otmp->fromsink) ? "
\90\85"
1144 poisontell(typ, FALSE);
1145 (void) adjattrib(typ, Poison_resistance ? -1 : -rn1(4, 3),
1148 if (!Poison_resistance) {
1150 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1153 losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1156 /* rnd loss is so that unblessed poorer than blessed */
1157 losehp(1 + rn2(2), contaminant,
1158 (otmp->fromsink) ? KILLED_BY : KILLED_BY_AN);
1160 exercise(A_CON, FALSE);
1163 if (Hallucination) {
1165 You("are shocked back to your senses!");
1167 You("
\8cÜ
\8a´
\82É
\8fÕ
\8c\82\82ð
\8eó
\82¯
\82½
\81I");
1168 (void) make_hallucinated(0L, FALSE, 0L);
1173 if (Hallucination) {
1175 pline("What a trippy feeling!");
1177 pline("
\82È
\82ñ
\82©
\83w
\83\8d\83w
\83\8d\82·
\82é
\81I");
1181 pline("Huh, What? Where am I?");
1183 pline("
\82Ù
\82¦
\81H
\8e\84\82Í
\92N
\81H");
1186 make_confused(itimeout_incr(HConfusion,
1187 rn1(7, 16 - 8 * bcsign(otmp))),
1190 case POT_GAIN_ABILITY:
1193 pline("Ulch! That potion tasted foul!");
1195 pline("
\83E
\83F
\81I
\88«
\8fL
\82ª
\82·
\82é
\81I");
1197 } else if (Fixed_abil) {
1199 } else { /* If blessed, increase all; if not, try up to */
1200 int itmp; /* 6 times to find one which can be increased. */
1202 i = -1; /* increment to 0 */
1203 for (ii = A_MAX; ii > 0; ii--) {
1204 i = (otmp->blessed ? i + 1 : rn2(A_MAX));
1205 /* only give "your X is already as high as it can get"
1206 message on last attempt (except blessed potions) */
1207 itmp = (otmp->blessed || ii == 1) ? 0 : -1;
1208 if (adjattrib(i, 1, itmp) && !otmp->blessed)
1214 /* skip when mounted; heal_legs() would heal steed's legs */
1215 if (Wounded_legs && !otmp->cursed && !u.usteed) {
1221 case SPE_HASTE_SELF:
1222 if (!Very_fast) { /* wwf@doe.carleton.ca */
1224 You("are suddenly moving %sfaster.", Fast ? "" : "much ");
1226 You("
\93Ë
\91R%s
\91¬
\82
\88Ú
\93®
\82Å
\82«
\82é
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D", Fast ? "" : "
\82Æ
\82Ä
\82à");
1229 Your("%s get new energy.", makeplural(body_part(LEG)));
1231 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));
1234 exercise(A_DEX, TRUE);
1235 incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp)));
1240 make_blinded(itimeout_incr(Blinded,
1241 rn1(200, 250 - 125 * bcsign(otmp))),
1244 case POT_GAIN_LEVEL:
1247 /* they went up a level */
1248 if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
1249 || Can_rise_up(u.ux, u.uy, &u.uz)) {
1251 const char *riseup = "rise up, through the %s!";
1253 const char *riseup ="%s
\82ð
\93Ë
\82«
\94²
\82¯
\82½
\81I";
1255 if (ledger_no(&u.uz) == 1) {
1256 You(riseup, ceiling(u.ux, u.uy));
1257 goto_level(&earth_level, FALSE, FALSE, FALSE);
1259 register int newlev = depth(&u.uz) - 1;
1262 get_level(&newlevel, newlev);
1263 if (on_level(&newlevel, &u.uz)) {
1265 pline("It tasted bad.");
1267 pline("
\82Æ
\82Ä
\82à
\82Ü
\82¸
\82¢
\81D");
1270 You(riseup, ceiling(u.ux, u.uy));
1271 goto_level(&newlevel, FALSE, FALSE, FALSE);
1275 You("have an uneasy feeling.");
1277 You("
\95s
\88À
\82È
\8bC
\8e\9d\82É
\82È
\82Á
\82½
\81D");
1281 /* blessed potions place you at a random spot in the
1282 middle of the new level instead of the low point */
1284 u.uexp = rndexp(TRUE);
1288 You_feel("better.");
1290 You("
\8bC
\95ª
\82ª
\82æ
\82
\82È
\82Á
\82½
\81D");
1291 healup(d(6 + 2 * bcsign(otmp), 4), !otmp->cursed ? 1 : 0,
1292 !!otmp->blessed, !otmp->cursed);
1293 exercise(A_CON, TRUE);
1295 case POT_EXTRA_HEALING:
1297 You_feel("much better.");
1299 You("
\8bC
\95ª
\82ª
\82Æ
\82Ä
\82à
\82æ
\82
\82È
\82Á
\82½
\81D");
1300 healup(d(6 + 2 * bcsign(otmp), 8),
1301 otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, !otmp->cursed,
1303 (void) make_hallucinated(0L, TRUE, 0L);
1304 exercise(A_CON, TRUE);
1305 exercise(A_STR, TRUE);
1307 case POT_FULL_HEALING:
1309 You_feel("completely healed.");
1311 You("
\8a®
\91S
\82É
\89ñ
\95\9c\82µ
\82½
\81D");
1312 healup(400, 4 + 4 * bcsign(otmp), !otmp->cursed, TRUE);
1313 /* Restore one lost level if blessed */
1314 if (otmp->blessed && u.ulevel < u.ulevelmax) {
1315 /* when multiple levels have been lost, drinking
1316 multiple potions will only get half of them back */
1320 (void) make_hallucinated(0L, TRUE, 0L);
1321 exercise(A_STR, TRUE);
1322 exercise(A_CON, TRUE);
1324 case POT_LEVITATION:
1325 case SPE_LEVITATION:
1327 * BLevitation will be set if levitation is blocked due to being
1328 * inside rock (currently or formerly in phazing xorn form, perhaps)
1329 * but it doesn't prevent setting or incrementing Levitation timeout
1330 * (which will take effect after escaping from the rock if it hasn't
1333 if (!Levitation && !BLevitation) {
1334 /* kludge to ensure proper operation of float_up() */
1335 set_itimeout(&HLevitation, 1L);
1337 /* This used to set timeout back to 0, then increment it below
1338 for blessed and uncursed effects. But now we leave it so
1339 that cursed effect yields "you float down" on next turn.
1340 Blessed and uncursed get one extra turn duration. */
1341 } else /* already levitating, or can't levitate */
1345 /* 'already levitating' used to block the cursed effect(s)
1346 aside from ~I_SPECIAL; it was not clear whether that was
1347 intentional; either way, it no longer does (as of 3.6.1) */
1348 HLevitation &= ~I_SPECIAL; /* can't descend upon demand */
1350 ; /* rising via levitation is blocked */
1351 } else if ((u.ux == xupstair && u.uy == yupstair)
1352 || (sstairs.up && u.ux == sstairs.sx && u.uy == sstairs.sy)
1353 || (xupladder && u.ux == xupladder && u.uy == yupladder)) {
1355 /* in case we're already Levitating, which would have
1356 resulted in incrementing 'nothing' */
1357 nothing = 0; /* not nothing after all */
1358 } else if (has_ceiling(&u.uz)) {
1359 int dmg = rnd(!uarmh ? 10 : !is_metallic(uarmh) ? 6 : 3);
1362 You("hit your %s on the %s.", body_part(HEAD),
1363 ceiling(u.ux, u.uy));
1365 You("%s
\82ð%s
\82É
\82Ô
\82Â
\82¯
\82½
\81D", body_part(HEAD),
1366 ceiling(u.ux,u.uy));
1369 losehp(Maybe_Half_Phys(dmg), "colliding with the ceiling",
1371 losehp(Maybe_Half_Phys(dmg), "
\93V
\88ä
\82É
\93ª
\82ð
\82Ô
\82Â
\82¯
\82Ä",
1373 nothing = 0; /* not nothing after all */
1375 } else if (otmp->blessed) {
1376 /* at this point, timeout is already at least 1 */
1377 incr_itimeout(&HLevitation, rn1(50, 250));
1378 /* can descend at will (stop levitating via '>') provided timeout
1379 is the only factor (ie, not also wearing Lev ring or boots) */
1380 HLevitation |= I_SPECIAL;
1381 } else /* timeout is already at least 1 */
1382 incr_itimeout(&HLevitation, rn1(140, 10));
1384 if (Levitation && IS_SINK(levl[u.ux][u.uy].typ))
1386 /* levitating blocks flying */
1389 case POT_GAIN_ENERGY: { /* M. Stephenson */
1394 You_feel("lackluster.");
1396 You("
\88Ó
\8bC
\8fÁ
\92¾
\82µ
\82½
\81D");
1399 pline("Magical energies course through your body.");
1401 pline("
\96\82\96@
\82Ì
\83G
\83l
\83\8b\83M
\81[
\82ª
\82 \82È
\82½
\82Ì
\91Ì
\82É
\96\9e\82¿
\82½
\81D");
1403 /* old: num = rnd(5) + 5 * otmp->blessed + 1;
1404 * blessed: +7..11 max & current (+9 avg)
1405 * uncursed: +2.. 6 max & current (+4 avg)
1406 * cursed: -2.. 6 max & current (-4 avg)
1408 * blessed: +3..18 max (+10.5 avg), +9..54 current (+31.5 avg)
1409 * uncursed: +2..12 max (+ 7 avg), +6..36 current (+21 avg)
1410 * cursed: -1.. 6 max (- 3.5 avg), -3..18 current (-10.5 avg)
1412 num = d(otmp->blessed ? 3 : !otmp->cursed ? 2 : 1, 6);
1414 num = -num; /* subtract instead of add when cursed */
1419 if (u.uen > u.uenmax)
1421 else if (u.uen <= 0)
1424 exercise(A_WIS, TRUE);
1427 case POT_OIL: { /* P. Winner */
1428 boolean good_for_you = FALSE;
1430 if (otmp->lamplit) {
1431 if (likes_fire(youmonst.data)) {
1433 pline("Ahh, a refreshing drink.");
1435 pline("
\82í
\81[
\82¨
\81C
\90¶
\82«
\95Ô
\82é
\81D");
1436 good_for_you = TRUE;
1439 You("burn your %s.", body_part(FACE));
1441 Your("%s
\82Í
\8d\95\8fÅ
\82°
\82É
\82È
\82Á
\82½
\81D", body_part(FACE));
1444 losehp(d(Fire_resistance ? 1 : 3, 4), "burning potion of oil",
1446 losehp(d(Fire_resistance ? 1 : 3, 4), "
\94R
\82¦
\82Ä
\82¢
\82é
\96û
\82ð
\88ù
\82ñ
\82Å",
1449 } else if (otmp->cursed)
1451 pline("This tastes like castor oil.");
1453 pline("
\82Ð
\82Ü
\82µ
\96û
\82Ì
\82æ
\82¤
\82È
\96¡
\82ª
\82·
\82é
\81D");
1456 pline("That was smooth!");
1458 pline("
\8cû
\82 \82½
\82è
\82ª
\82æ
\82¢
\81I");
1459 exercise(A_WIS, good_for_you);
1463 if (Acid_resistance) {
1464 /* Not necessarily a creature who _likes_ acid */
1466 pline("This tastes %s.", Hallucination ? "tangy" : "sour");
1468 pline("%s
\96¡
\82ª
\82·
\82é
\81D", Hallucination ? "
\82Ò
\82è
\82Á
\82Æ
\82µ
\82½" : "
\8e_
\82Ì");
1473 pline("This burns%s!",
1474 otmp->blessed ? " a little" : otmp->cursed ? " a lot"
1477 pline("%s
\8fÅ
\82°
\82½
\81I",
1478 otmp->blessed ? "
\8f
\82µ" : otmp->cursed ? "
\82·
\82²
\82"
1481 dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
1483 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1485 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\88ù
\82ñ
\82Å", KILLED_BY_AN);
1486 exercise(A_CON, FALSE);
1489 fix_petrification();
1490 unkn++; /* holy/unholy water can burn like acid too */
1494 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1496 You("
\8f
\82µ%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1501 impossible("What a funny potion! (%u)", otmp->otyp);
1509 make_totter(xtime, talk)
1510 long xtime; /* nonzero if this is an attempt to turn on hallucination */
1513 const char *message = 0;
1516 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\90³
\8fí
\82É
\82È
\82Á
\82½
\81D";
1518 message = "
\95û
\8cü
\8a´
\8ao
\82ª
\96\83á
\83\82µ
\82½
\81D";
1520 set_itimeout(&Totter, xtime);
1526 healup(nhp, nxtra, curesick, cureblind)
1528 register boolean curesick, cureblind;
1534 u.mh = (u.mhmax += nxtra);
1537 if (u.uhp > u.uhpmax)
1538 u.uhp = (u.uhpmax += nxtra);
1542 /* 3.6.1: it's debatible whether healing magic should clean off
1543 mundane 'dirt', but if it doesn't, blindness isn't cured */
1545 make_blinded(0L, TRUE);
1546 /* heal deafness too */
1547 make_deaf(0L, TRUE);
1550 make_vomiting(0L, TRUE);
1551 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
1558 strange_feeling(obj, txt)
1562 if (flags.beginner || !txt)
1564 You("have a %s feeling for a moment, then it passes.",
1565 Hallucination ? "normal" : "strange");
1567 You("%s
\8bC
\95ª
\82É
\82¨
\82»
\82í
\82ê
\82½
\82ª
\81C
\82·
\82®
\82É
\8fÁ
\82¦
\82³
\82Á
\82½
\81D",
1568 Hallucination ? "
\95\81\92Ê
\82Ì" : "
\8aï
\96
\82È");
1573 if (!obj) /* e.g., crystal ball finds no traps */
1576 if (obj->dknown && !objects[obj->otyp].oc_name_known
1577 && !objects[obj->otyp].oc_uname)
1584 const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
1585 "flask", "jar", "vial" };
1587 const char *bottlenames[] = { "
\95r", "àÞ
\97\9e\95r", "
\88ê
\8f¡
\95r", "
\90\85\8d·
\82µ",
1588 "
\83t
\83\89\83X
\83R", "
\92Ù", "
\83K
\83\89\83X
\95r" };
1594 return bottlenames[rn2(SIZE(bottlenames))];
1597 /* handle item dipped into water potion or steed saddle splashed by same */
1599 H2Opotion_dip(potion, targobj, useeit, objphrase)
1600 struct obj *potion, *targobj;
1602 const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
1604 void FDECL((*func), (OBJ_P)) = 0;
1605 const char *glowcolor = 0;
1606 #define COST_alter (-2)
1607 #define COST_none (-1)
1608 int costchange = COST_none;
1609 boolean altfmt = FALSE, res = FALSE;
1611 if (!potion || potion->otyp != POT_WATER)
1614 if (potion->blessed) {
1615 if (targobj->cursed) {
1617 glowcolor = NH_AMBER;
1618 costchange = COST_UNCURS;
1619 } else if (!targobj->blessed) {
1621 glowcolor = NH_LIGHT_BLUE;
1622 costchange = COST_alter;
1623 altfmt = TRUE; /* "with a <color> aura" */
1625 } else if (potion->cursed) {
1626 if (targobj->blessed) {
1629 glowcolor = "brown";
1631 glowcolor = "
\92\83\90F
\82Ì";
1632 costchange = COST_UNBLSS;
1633 } else if (!targobj->cursed) {
1635 glowcolor = NH_BLACK;
1636 costchange = COST_alter;
1640 /* dipping into uncursed water; carried() check skips steed saddle */
1641 if (carried(targobj)) {
1642 if (water_damage(targobj, 0, TRUE) != ER_NOTHING)
1647 /* give feedback before altering the target object;
1648 this used to set obj->bknown even when not seeing
1649 the effect; now hero has to see the glow, and bknown
1650 is cleared instead of set if perception is distorted */
1652 glowcolor = hcolor(glowcolor);
1653 /*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¿*/
1656 pline("%s with %s aura.", objphrase, an(glowcolor));
1658 pline("%s
\82Í%s
\83I
\81[
\83\89\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D", objphrase, glowcolor);
1662 pline("%s %s.", objphrase, glowcolor);
1664 pline("%s
\82Í%s
\8bP
\82¢
\82½
\81D", objphrase, jconj_adj(glowcolor));
1666 iflags.last_msg = PLNMSG_OBJ_GLOWS;
1667 targobj->bknown = !Hallucination;
1669 /* didn't see what happened: forget the BUC state if that was
1670 known unless the bless/curse state of the water is known;
1671 without this, hero would know the new state even without
1672 seeing the glow; priest[ess] will immediately relearn it */
1673 if (!potion->bknown || !potion->dknown)
1674 targobj->bknown = 0;
1675 /* [should the bknown+dknown exception require that water
1676 be discovered or at least named?] */
1678 /* potions of water are the only shop goods whose price depends
1679 on their curse/bless state */
1680 if (targobj->unpaid && targobj->otyp == POT_WATER) {
1681 if (costchange == COST_alter)
1682 /* added blessing or cursing; update shop
1683 bill to reflect item's new higher price */
1684 alter_cost(targobj, 0L);
1685 else if (costchange != COST_none)
1686 /* removed blessing or cursing; you
1687 degraded it, now you'll have to buy it... */
1688 costly_alteration(targobj, costchange);
1690 /* finally, change curse/bless state */
1697 /* potion obj hits monster mon, which might be youmonst; obj always used up */
1699 potionhit(mon, obj, how)
1704 const char *botlnam = bottlename();
1705 boolean isyou = (mon == &youmonst);
1706 int distance, tx, ty;
1707 struct obj *saddle = (struct obj *) 0;
1708 boolean hit_saddle = FALSE, your_fault = (how <= POTHIT_HERO_THROW);
1711 tx = u.ux, ty = u.uy;
1714 pline_The("%s crashes on your %s and breaks into shards.", botlnam,
1717 pline("%s
\82ª
\82 \82È
\82½
\82Ì%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1721 losehp(Maybe_Half_Phys(rnd(2)),
1722 (how == POTHIT_OTHER_THROW) ? "propelled potion" /* scatter */
1725 #else /*
\82Ç
\82¿
\82ç
\82à
\81u
\93\8a\82°
\82ç
\82ê
\82½
\81v
\82Å
\82æ
\82¢*/
1726 losehp(Maybe_Half_Phys(rnd(2)), "
\93\8a\82°
\82ç
\82ê
\82½
\96ò
\82Å", KILLED_BY_AN);
1729 tx = mon->mx, ty = mon->my;
1730 /* sometimes it hits the saddle */
1731 if (((mon->misc_worn_check & W_SADDLE)
1732 && (saddle = which_armor(mon, W_SADDLE)))
1734 || (obj->otyp == POT_WATER
1735 && ((rnl(10) > 7 && obj->cursed)
1736 || (rnl(10) < 4 && obj->blessed) || !rn2(3)))))
1738 distance = distu(tx, ty);
1739 if (!cansee(tx, ty)) {
1743 pline("
\83K
\83V
\83\83\83\93\81I");
1745 char *mnam = mon_nam(mon);
1748 if (hit_saddle && saddle) {
1750 Sprintf(buf, "%s saddle",
1751 s_suffix(x_monnam(mon, ARTICLE_THE, (char *) 0,
1752 (SUPPRESS_IT | SUPPRESS_SADDLE),
1755 Sprintf(buf, "%s
\82Ì
\88Æ",
1756 x_monnam(mon, ARTICLE_THE, (char *) 0,
1757 (SUPPRESS_IT | SUPPRESS_SADDLE),
1760 } else if (has_head(mon->data)) {
1762 Sprintf(buf, "%s %s", s_suffix(mnam),
1763 (notonhead ? "body" : "head"));
1765 Sprintf(buf, "%s
\82Ì%s", mnam,
1766 (notonhead ? "
\91Ì" : "
\93ª"));
1772 pline_The("%s crashes on %s and breaks into shards.", botlnam,
1775 pline("%s
\82ª%s
\82Ì
\8fã
\82Å
\89ó
\82ê
\94j
\95Ð
\82Æ
\82È
\82Á
\82½
\81D", botlnam,
1779 if (rn2(5) && mon->mhp > 1 && !hit_saddle)
1783 /* oil doesn't instantly evaporate; Neither does a saddle hit */
1784 if (obj->otyp != POT_OIL && !hit_saddle && cansee(tx, ty))
1786 pline("%s.", Tobjnam(obj, "evaporate"));
1788 pline("%s
\82Í
\8fö
\94
\82µ
\82½
\81D", xname(obj));
1791 switch (obj->otyp) {
1794 explode_oil(obj, u.ux, u.uy);
1798 You_feel("a little %s.", Hallucination ? "normal" : "strange");
1800 You("%s
\82È
\8a´
\82¶
\82ª
\82µ
\82½
\81D", Hallucination ? "
\95\81\92Ê" : "
\95Ï");
1801 if (!Unchanging && !Antimagic)
1805 if (!Acid_resistance) {
1809 pline("This burns%s!",
1810 obj->blessed ? " a little"
1811 : obj->cursed ? " a lot" : "");
1813 pline("%s
\94R
\82¦
\82½
\81I",
1814 obj->blessed ? "
\8f
\82µ"
1815 : obj->cursed ? "
\82Í
\82°
\82µ
\82" : "");
1817 dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1819 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1821 losehp(Maybe_Half_Phys(dmg), "
\8e_
\82Ì
\96ò
\82ð
\97\81\82Ñ
\82Ä", KILLED_BY_AN);
1825 } else if (hit_saddle && saddle) {
1826 char *mnam, buf[BUFSZ], saddle_glows[BUFSZ];
1827 boolean affected = FALSE;
1828 boolean useeit = !Blind && canseemon(mon) && cansee(tx, ty);
1830 mnam = x_monnam(mon, ARTICLE_THE, (char *) 0,
1831 (SUPPRESS_IT | SUPPRESS_SADDLE), FALSE);
1832 Sprintf(buf, "%s", upstart(s_suffix(mnam)));
1834 switch (obj->otyp) {
1837 Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
1839 Sprintf(saddle_glows, "%s", buf);
1840 affected = H2Opotion_dip(obj, saddle, useeit, saddle_glows);
1843 /* Do we allow the saddle to polymorph? */
1846 if (useeit && !affected)
1848 pline("%s %s wet.", buf, aobjnam(saddle, "get"));
1850 pline("%s
\82Í
\94G
\82ê
\82½
\81D", buf);
1852 boolean angermon = your_fault, cureblind = FALSE;
1854 switch (obj->otyp) {
1855 case POT_FULL_HEALING:
1858 case POT_EXTRA_HEALING:
1865 if (mon->data == &mons[PM_PESTILENCE])
1868 case POT_RESTORE_ABILITY:
1869 case POT_GAIN_ABILITY:
1872 if (mon->mhp < mon->mhpmax) {
1873 mon->mhp = mon->mhpmax;
1876 pline("%s looks sound and hale again.", Monnam(mon));
1878 pline("%s
\82Í
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1881 mcureblindness(mon, canseemon(mon));
1884 if (mon->data == &mons[PM_PESTILENCE])
1886 if (dmgtype(mon->data, AD_DISE)
1887 /* won't happen, see prior goto */
1888 || dmgtype(mon->data, AD_PEST)
1889 /* most common case */
1890 || resists_poison(mon)) {
1893 pline("%s looks unharmed.", Monnam(mon));
1895 pline("%s
\82Í
\82È
\82ñ
\82Æ
\82à
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mon));
1900 if ((mon->mhpmax > 3) && !resist(mon, POTION_CLASS, 0, NOTELL))
1902 if ((mon->mhp > 2) && !resist(mon, POTION_CLASS, 0, NOTELL))
1904 if (mon->mhp > mon->mhpmax)
1905 mon->mhp = mon->mhpmax;
1908 pline("%s looks rather ill.", Monnam(mon));
1910 pline("%s
\82Í
\95a
\8bC
\82Á
\82Û
\82
\8c©
\82¦
\82é
\81D", Monnam(mon));
1914 if (!resist(mon, POTION_CLASS, 0, NOTELL))
1917 case POT_INVISIBILITY: {
1918 boolean sawit = canspotmon(mon);
1921 mon_set_minvis(mon);
1922 if (sawit && !canspotmon(mon) && cansee(mon->mx, mon->my))
1923 map_invisible(mon->mx, mon->my);
1927 /* wakeup() doesn't rouse victims of temporary sleep */
1928 if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
1930 pline("%s falls asleep.", Monnam(mon));
1932 pline("%s
\82Í
\96°
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D", Monnam(mon));
1937 if (mon->mcanmove) {
1938 /* really should be rnd(5) for consistency with players
1939 * breathing potions, but...
1941 paralyze_monst(mon, rnd(25));
1946 mon_adjust_speed(mon, 1, obj);
1949 if (haseyes(mon->data)) {
1950 int btmp = 64 + rn2(32)
1951 + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
1953 btmp += mon->mblinded;
1954 mon->mblinded = min(btmp, 127);
1959 if (is_undead(mon->data) || is_demon(mon->data)
1960 || is_were(mon->data) || is_vampshifter(mon)) {
1963 pline("%s %s in pain!", Monnam(mon),
1964 is_silent(mon->data) ? "writhes" : "shrieks");
1966 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
1967 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
1969 if (!is_silent(mon->data))
1970 wake_nearto(tx, ty, mon->data->mlevel * 10);
1971 mon->mhp -= d(2, 6);
1972 /* should only be by you */
1973 if (DEADMONSTER(mon))
1975 else if (is_were(mon->data) && !is_human(mon->data))
1976 new_were(mon); /* revert to human */
1977 } else if (obj->cursed) {
1981 pline("%s looks healthier.", Monnam(mon));
1983 pline("%s
\82Í
\82æ
\82è
\8c³
\8bC
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", Monnam(mon));
1984 mon->mhp += d(2, 6);
1985 if (mon->mhp > mon->mhpmax)
1986 mon->mhp = mon->mhpmax;
1987 if (is_were(mon->data) && is_human(mon->data)
1988 && !Protection_from_shape_changers)
1989 new_were(mon); /* transform into beast */
1991 } else if (mon->data == &mons[PM_GREMLIN]) {
1993 (void) split_mon(mon, (struct monst *) 0);
1994 } else if (mon->data == &mons[PM_IRON_GOLEM]) {
1997 pline("%s rusts.", Monnam(mon));
1999 pline("%s
\82Í
\8eK
\82Ñ
\82½
\81D", Monnam(mon));
2000 mon->mhp -= d(1, 6);
2001 /* should only be by you */
2002 if (DEADMONSTER(mon))
2008 explode_oil(obj, tx, ty);
2011 if (!resists_acid(mon) && !resist(mon, POTION_CLASS, 0, NOTELL)) {
2013 pline("%s %s in pain!", Monnam(mon),
2014 is_silent(mon->data) ? "writhes" : "shrieks");
2016 pline("%s
\82Í
\8bê
\92É%s
\81I", Monnam(mon),
2017 is_silent(mon->data) ? "
\82É
\90g
\82à
\82¾
\82¦
\82µ
\82½" : "
\82Ì
\8b©
\82Ñ
\90º
\82ð
\82 \82°
\82½");
2019 if (!is_silent(mon->data))
2020 wake_nearto(tx, ty, mon->data->mlevel * 10);
2021 mon->mhp -= d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
2022 if (DEADMONSTER(mon)) {
2026 monkilled(mon, "", AD_ACID);
2031 (void) bhitm(mon, obj);
2034 case POT_GAIN_LEVEL:
2035 case POT_LEVITATION:
2036 case POT_FRUIT_JUICE:
2037 case POT_MONSTER_DETECTION:
2038 case POT_OBJECT_DETECTION:
2042 /* target might have been killed */
2043 if (!DEADMONSTER(mon)) {
2051 /* Note: potionbreathe() does its own docall() */
2052 if ((distance == 0 || (distance < 3 && rn2(5)))
2053 && (!breathless(youmonst.data) || haseyes(youmonst.data)))
2055 else if (obj->dknown && !objects[obj->otyp].oc_name_known
2056 && !objects[obj->otyp].oc_uname && cansee(tx, ty))
2059 if (*u.ushops && obj->unpaid) {
2060 struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
2062 /* neither of the first two cases should be able to happen;
2063 only the hero should ever have an unpaid item, and only
2064 when inside a tended shop */
2065 if (!shkp) /* if shkp was killed, unpaid ought to cleared already */
2067 else if (context.mon_moving) /* obj thrown by monster */
2068 subfrombill(obj, shkp);
2069 else /* obj thrown by hero */
2070 (void) stolen_value(obj, u.ux, u.uy, (boolean) shkp->mpeaceful,
2073 obfree(obj, (struct obj *) 0);
2076 /* vapors are inhaled or get in your eyes */
2079 register struct obj *obj;
2081 int i, ii, isdone, kn = 0;
2082 boolean cureblind = FALSE;
2084 /* potion of unholy water might be wielded; prevent
2085 you_were() -> drop_weapon() from dropping it so that it
2086 remains in inventory where our caller expects it to be */
2089 switch (obj->otyp) {
2090 case POT_RESTORE_ABILITY:
2091 case POT_GAIN_ABILITY:
2093 if (!breathless(youmonst.data))
2095 pline("Ulch! That potion smells terrible!");
2097 pline("
\83E
\83Q
\83F
\81I
\96ò
\82Í
\82à
\82Ì
\82·
\82²
\82¢
\93õ
\82¢
\82ª
\82·
\82é
\81I");
2098 else if (haseyes(youmonst.data)) {
2100 const char *eyes = body_part(EYE);
2102 if (eyecount(youmonst.data) != 1)
2103 eyes = makeplural(eyes);
2104 Your("%s %s!", eyes, vtense(eyes, "sting"));
2106 Your("%s
\82ª
\82¸
\82«
\82¸
\82«
\82·
\82é
\81I", body_part(EYE));
2111 i = rn2(A_MAX); /* start at a random point */
2112 for (isdone = ii = 0; !isdone && ii < A_MAX; ii++) {
2113 if (ABASE(i) < AMAX(i)) {
2115 /* only first found if not blessed */
2116 isdone = !(obj->blessed);
2124 case POT_FULL_HEALING:
2125 if (Upolyd && u.mh < u.mhmax)
2126 u.mh++, context.botl = 1;
2127 if (u.uhp < u.uhpmax)
2128 u.uhp++, context.botl = 1;
2131 case POT_EXTRA_HEALING:
2132 if (Upolyd && u.mh < u.mhmax)
2133 u.mh++, context.botl = 1;
2134 if (u.uhp < u.uhpmax)
2135 u.uhp++, context.botl = 1;
2140 if (Upolyd && u.mh < u.mhmax)
2141 u.mh++, context.botl = 1;
2142 if (u.uhp < u.uhpmax)
2143 u.uhp++, context.botl = 1;
2147 make_blinded(0L, !u.ucreamed);
2148 make_deaf(0L, TRUE);
2150 exercise(A_CON, TRUE);
2153 if (!Role_if(PM_HEALER)) {
2166 exercise(A_CON, FALSE);
2169 case POT_HALLUCINATION:
2171 You("have a momentary vision.");
2173 You("
\88ê
\8fu
\8c¶
\89e
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81D");
2179 You_feel("somewhat dizzy.");
2181 You("
\82ß
\82Ü
\82¢
\82ð
\8a´
\82¶
\82½
\81D");
2182 make_confused(itimeout_incr(HConfusion, rnd(5)), FALSE);
2184 case POT_INVISIBILITY:
2185 if (!Blind && !Invis) {
2188 pline("For an instant you %s!",
2189 See_invisible ? "could see right through yourself"
2190 : "couldn't see yourself");
2192 pline("
\88ê
\8fu
\8e©
\95ª
\8e©
\90g
\82ª%s
\8c©
\82¦
\82È
\82
\82È
\82Á
\82½
\81I",
2193 See_invisible ? "
\90³
\82µ
\82"
2202 pline("%s seems to be holding you.", Something);
2204 pline("%s
\82ª
\82 \82È
\82½
\82ð
\82Â
\82©
\82Ü
\82¦
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D", Something);
2207 multi_reason = "frozen by a potion";
2209 multi_reason = "
\96ò
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8e\9e\82É";
2210 nomovemsg = You_can_move_again;
2211 exercise(A_DEX, FALSE);
2214 You("stiffen momentarily.");
2216 You("
\88ê
\8fu
\8dd
\92¼
\82µ
\82½
\81D");
2220 if (!Free_action && !Sleep_resistance) {
2222 You_feel("rather tired.");
2224 You("
\82·
\82±
\82µ
\94æ
\82ê
\82½
\81D");
2227 multi_reason = "sleeping off a magical draught";
2229 multi_reason = "
\96\82\96@
\93I
\82É
\96°
\82Á
\82Ä
\82¢
\82é
\8aÔ
\82É";
2230 nomovemsg = You_can_move_again;
2231 exercise(A_DEX, FALSE);
2236 You("
\82 \82
\82Ñ
\82ð
\82µ
\82½
\81D");
2241 Your("knees seem more flexible now.");
2243 Your("
\95G
\82Í
\82æ
\82è
\82·
\82Î
\82â
\82
\93®
\82
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
2244 incr_itimeout(&HFast, rnd(5));
2245 exercise(A_DEX, TRUE);
2248 if (!Blind && !Unaware) {
2251 pline("It suddenly gets dark.");
2253 pline("
\93Ë
\91R
\88Ã
\82
\82È
\82Á
\82½
\81D");
2255 make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
2256 if (!Blind && !Unaware)
2257 Your1(vision_clears);
2260 if (u.umonnum == PM_GREMLIN) {
2261 (void) split_mon(&youmonst, (struct monst *) 0);
2262 } else if (u.ulycn >= LOW_PM) {
2263 /* vapor from [un]holy water will trigger
2264 transformation but won't cure lycanthropy */
2265 if (obj->blessed && youmonst.data == &mons[u.ulycn])
2267 else if (obj->cursed && !Upolyd)
2273 exercise(A_CON, FALSE);
2276 case POT_GAIN_LEVEL:
2277 case POT_LEVITATION:
2278 case POT_FRUIT_JUICE:
2279 case POT_MONSTER_DETECTION:
2280 case POT_OBJECT_DETECTION:
2285 /* note: no obfree() -- that's our caller's responsibility */
2288 makeknown(obj->otyp);
2289 else if (!objects[obj->otyp].oc_name_known
2290 && !objects[obj->otyp].oc_uname)
2295 /* returns the potion type when o1 is dipped in o2 */
2298 register struct obj *o1, *o2;
2300 int o1typ = o1->otyp, o2typ = o2->otyp;
2302 /* cut down on the number of cases below */
2303 if (o1->oclass == POTION_CLASS
2304 && (o2typ == POT_GAIN_LEVEL || o2typ == POT_GAIN_ENERGY
2305 || o2typ == POT_HEALING || o2typ == POT_EXTRA_HEALING
2306 || o2typ == POT_FULL_HEALING || o2typ == POT_ENLIGHTENMENT
2307 || o2typ == POT_FRUIT_JUICE)) {
2308 /* swap o1 and o2 */
2315 if (o2typ == POT_SPEED)
2316 return POT_EXTRA_HEALING;
2318 case POT_EXTRA_HEALING:
2319 case POT_FULL_HEALING:
2320 if (o2typ == POT_GAIN_LEVEL || o2typ == POT_GAIN_ENERGY)
2321 return (o1typ == POT_HEALING) ? POT_EXTRA_HEALING
2322 : (o1typ == POT_EXTRA_HEALING) ? POT_FULL_HEALING
2328 return POT_FRUIT_JUICE;
2329 case POT_HALLUCINATION:
2335 case AMETHYST: /* "a-methyst" == "not intoxicated" */
2336 if (o2typ == POT_BOOZE)
2337 return POT_FRUIT_JUICE;
2339 case POT_GAIN_LEVEL:
2340 case POT_GAIN_ENERGY:
2343 return (rn2(3) ? POT_BOOZE : POT_ENLIGHTENMENT);
2345 return POT_EXTRA_HEALING;
2346 case POT_EXTRA_HEALING:
2347 return POT_FULL_HEALING;
2348 case POT_FULL_HEALING:
2349 return POT_GAIN_ABILITY;
2350 case POT_FRUIT_JUICE:
2351 return POT_SEE_INVISIBLE;
2353 return POT_HALLUCINATION;
2356 case POT_FRUIT_JUICE:
2359 return POT_SICKNESS;
2360 case POT_ENLIGHTENMENT:
2363 case POT_GAIN_LEVEL:
2364 case POT_GAIN_ENERGY:
2365 return POT_SEE_INVISIBLE;
2368 case POT_ENLIGHTENMENT:
2370 case POT_LEVITATION:
2372 return POT_GAIN_LEVEL;
2374 case POT_FRUIT_JUICE:
2377 return POT_CONFUSION;
2382 return STRANGE_OBJECT;
2390 static const char Dip_[] = "Dip ";
2392 static const char Dip_[] = "
\90Z
\82·";
2393 register struct obj *potion, *obj;
2394 struct obj *singlepotion;
2398 char qbuf[QBUFSZ], obuf[QBUFSZ];
2400 const char *shortestname; /* last resort obj name for prompt */
2403 allowall[0] = ALL_CLASSES;
2405 if (!(obj = getobj(allowall, "dip")))
2408 if (inaccessible_equipment(obj, "dip", FALSE))
2410 if (inaccessible_equipment(obj, "
\82ð
\90Z
\82·", FALSE))
2414 shortestname = (is_plural(obj) || pair_of(obj)) ? "them" : "it";
2417 * Bypass safe_qbuf() since it doesn't handle varying suffix without
2418 * an awful lot of support work. Format the object once, even though
2419 * the fountain and pool prompts offer a lot more room for it.
2420 * 3.6.0 used thesimpleoname() unconditionally, which posed no risk
2421 * of buffer overflow but drew bug reports because it omits user-
2422 * supplied type name.
2423 * getobj: "What do you want to dip <the object> into? [xyz or ?*] "
2425 Strcpy(obuf, short_oname(obj, doname, thesimpleoname,
2426 /* 128 - (24 + 54 + 1) leaves 49 for <object> */
2427 QBUFSZ - sizeof "What do you want to dip \
2428 into? [abdeghjkmnpqstvwyzBCEFHIKLNOQRTUWXZ#-# or ?*] "));
2430 here = levl[u.ux][u.uy].typ;
2431 /* Is there a fountain to dip into here? */
2432 if (IS_FOUNTAIN(here)) {
2434 Sprintf(qbuf, "%s%s into the fountain?", Dip_,
2435 flags.verbose ? obuf : shortestname);
2437 Sprintf(qbuf, "
\90ò
\82É%s
\81H", Dip_);
2439 /* "Dip <the object> into the fountain?" */
2440 if (yn(qbuf) == 'y') {
2444 } else if (is_pool(u.ux, u.uy)) {
2445 const char *pooltype = waterbody_name(u.ux, u.uy);
2448 Sprintf(qbuf, "%s%s into the %s?", Dip_,
2449 flags.verbose ? obuf : shortestname, pooltype);
2450 #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ª*/
2451 Sprintf(qbuf, "%s
\82É%s
\81H", pooltype, Dip_);
2453 /* "Dip <the object> into the {pool, moat, &c}?" */
2454 if (yn(qbuf) == 'y') {
2456 floating_above(pooltype);
2457 } else if (u.usteed && !is_swimmer(u.usteed->data)
2458 && P_SKILL(P_RIDING) < P_BASIC) {
2459 rider_cant_reach(); /* not skilled enough to reach */
2461 if (obj->otyp == POT_ACID)
2463 if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use)
2471 /* "What do you want to dip <the object> into? [xyz or ?*] " */
2472 Sprintf(qbuf, "dip %s into", flags.verbose ? obuf : shortestname);
2474 /* "What do you want to dip into? [xyz or ?*] " */
2475 Sprintf(qbuf, "dip into");
2477 potion = getobj(beverages, qbuf);
2480 if (potion == obj && potion->quan == 1L) {
2482 pline("That is a potion bottle, not a Klein bottle!");
2484 pline("
\82±
\82ê
\82Í
\96ò
\95r
\82¾
\81I
\83N
\83\89\83C
\83\93\82Ì
\92Ù
\82¶
\82á
\82È
\82¢
\81I");
2487 potion->in_use = TRUE; /* assume it will be used up */
2488 if (potion->otyp == POT_WATER) {
2489 boolean useeit = !Blind || (obj == ublindf && Blindfolded_only);
2491 const char *obj_glows = Yobjnam2(obj, "glow");
2493 const char *obj_glows = cxname(obj);
2496 if (H2Opotion_dip(potion, obj, useeit, obj_glows))
2498 } else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
2499 /* some objects can't be polymorphed */
2500 if (obj->otyp == potion->otyp /* both POT_POLY */
2501 || obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
2502 || obj == uball || obj == uskin
2503 || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
2505 pline1(nothing_happens);
2507 short save_otyp = obj->otyp;
2510 u.uconduct.polypiles++;
2512 obj = poly_obj(obj, STRANGE_OBJECT);
2515 * obj might be gone:
2516 * poly_obj() -> set_wear() -> Amulet_on() -> useup()
2517 * if obj->otyp is worn amulet and becomes AMULET_OF_CHANGE.
2520 makeknown(POT_POLYMORPH);
2522 } else if (obj->otyp != save_otyp) {
2523 makeknown(POT_POLYMORPH);
2525 prinv((char *) 0, obj, 0L);
2529 pline("Nothing seems to happen.");
2531 pline("
\89½
\82à
\8bN
\82±
\82ç
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2535 potion->in_use = FALSE; /* didn't go poof */
2537 } else if (obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {
2538 int amt = (int) obj->quan;
2541 mixture = mixtype(obj, potion);
2543 magic = (mixture != STRANGE_OBJECT) ? objects[mixture].oc_magic
2544 : (objects[obj->otyp].oc_magic || objects[potion->otyp].oc_magic);
2546 Strcpy(qbuf, "The"); /* assume full stack */
2550 if (amt > (magic ? 3 : 7)) {
2551 /* trying to dip multiple potions will usually affect only a
2552 subset; pick an amount between 3 and 8, inclusive, for magic
2553 potion result, between 7 and N for non-magic */
2555 amt = rnd(min(amt, 8) - (3 - 1)) + (3 - 1); /* 1..6 + 2 */
2557 amt = rnd(amt - (7 - 1)) + (7 - 1); /* 1..(N-6) + 6 */
2559 if ((long) amt < obj->quan) {
2560 obj = splitobj(obj, (long) amt);
2562 Sprintf(qbuf, "%ld of the", obj->quan);
2564 Sprintf(qbuf, "%ld
\96{
\82Ì", obj->quan);
2567 /* [N of] the {obj(s)} mix(es) with [one of] {the potion}... */
2569 pline("%s %s %s with %s%s...", qbuf, simpleonames(obj),
2570 otense(obj, "mix"), (potion->quan > 1L) ? "one of " : "",
2571 thesimpleoname(potion));
2572 #else /* [N
\96{
\82Ì]{obj}
\82ð{the potion}[
\82Ì
\88ê
\82Â]
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D */
2573 pline("%s%s
\82ð%s%s
\82Æ
\8d¬
\82º
\82½
\81D
\81D
\81D", qbuf, simpleonames(obj),
2574 thesimpleoname(potion),
2575 (potion->quan > 1L) ? "
\82Ì
\88ê
\82Â" : "");
2577 /* get rid of 'dippee' before potential perm_invent updates */
2578 useup(potion); /* now gone */
2579 /* Mixing potions is dangerous...
2580 KMH, balance patch -- acid is particularly unstable */
2581 if (obj->cursed || obj->otyp == POT_ACID || !rn2(10)) {
2582 /* it would be better to use up the whole stack in advance
2583 of the message, but we can't because we need to keep it
2584 around for potionbreathe() [and we can't set obj->in_use
2585 to 'amt' because that's not implemented] */
2588 pline("%sThey explode!", !Deaf ? "BOOM! " : "");
2590 pline("%s
\94\9a\94
\82µ
\82½
\81I", !Deaf ? "
\83o
\81[
\83\93\81I" : "");
2591 wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
2592 exercise(A_STR, FALSE);
2593 if (!breathless(youmonst.data) || haseyes(youmonst.data))
2596 losehp(amt + rnd(9), /* not physical damage */
2598 "alchemic blast", KILLED_BY_AN);
2600 "
\92²
\8d\87\82Ì
\8e¸
\94s
\82Å", KILLED_BY_AN);
2604 obj->blessed = obj->cursed = obj->bknown = 0;
2605 if (Blind || Hallucination)
2608 if (mixture != STRANGE_OBJECT) {
2609 obj->otyp = mixture;
2613 switch (obj->odiluted ? 1 : rnd(8)) {
2615 obj->otyp = POT_WATER;
2619 obj->otyp = POT_SICKNESS;
2622 otmp = mkobj(POTION_CLASS, FALSE);
2623 obj->otyp = otmp->otyp;
2624 obfree(otmp, (struct obj *) 0);
2629 pline_The("mixture %sevaporates.",
2630 !Blind ? "glows brightly and " : "");
2632 pline_The("
\8d¬
\82º
\82é
\82Æ
\96ò
\82Í%s
\8fö
\94
\82µ
\82½
\81D",
2633 !Blind ? "
\96¾
\82é
\82
\8bP
\82«
\81C" : "");
2638 obj->odiluted = (obj->otyp != POT_WATER);
2640 if (obj->otyp == POT_WATER && !Hallucination) {
2642 pline_The("mixture bubbles%s.", Blind ? "" : ", then clears");
2644 pline("
\96ò
\82ð
\8d¬
\82º
\82é
\82Æ%s
\96A
\82¾
\82Á
\82½
\81D", Blind ? "" : "
\82µ
\82Î
\82ç
\82");
2645 } else if (!Blind) {
2647 pline_The("mixture looks %s.",
2649 pline("
\8d¬
\82º
\82½
\96ò
\82Í%s
\96ò
\82É
\8c©
\82¦
\82é
\81D",
2650 hcolor(OBJ_DESCR(objects[obj->otyp])));
2653 /* this is required when 'obj' was split off from a bigger stack,
2654 so that 'obj' will now be assigned its own inventory slot;
2655 it has a side-effect of merging 'obj' into another compatible
2656 stack if there is one, so we do it even when no split has
2657 been made in order to get the merge result for both cases;
2658 as a consequence, mixing while Fumbling drops the mixture */
2661 (void) hold_another_object(obj, "You drop %s!", doname(obj),
2664 (void) hold_another_object(obj, "%s
\82ð
\97\8e\82µ
\82½
\81I", doname(obj),
2670 if (potion->otyp == POT_ACID && obj->otyp == CORPSE
2671 && obj->corpsenm == PM_LICHEN) {
2673 pline("%s %s %s around the edges.", The(cxname(obj)),
2674 otense(obj, "turn"), Blind ? "wrinkled"
2675 : potion->odiluted ? hcolor(NH_ORANGE)
2678 pline("%s
\82Í
\82Ó
\82¿
\82ª%s
\82È
\82Á
\82½
\81D", The(cxname(obj)),
2679 Blind ? "
\82µ
\82í
\82µ
\82í
\82É"
2680 : jconj_adj(potion->odiluted ? hcolor(NH_ORANGE)
2683 potion->in_use = FALSE; /* didn't go poof */
2685 && !objects[potion->otyp].oc_name_known
2686 && !objects[potion->otyp].oc_uname)
2691 if (potion->otyp == POT_WATER && obj->otyp == TOWEL) {
2693 pline_The("towel soaks it up!");
2695 pline_The("
\83^
\83I
\83\8b\82Í
\90\85\82ð
\8bz
\82¢
\8d\9e\82ñ
\82¾
\81I");
2696 /* wetting towel already done via water_damage() in H2Opotion_dip */
2700 if (is_poisonable(obj)) {
2701 if (potion->otyp == POT_SICKNESS && !obj->opoisoned) {
2704 if (potion->quan > 1L)
2706 Sprintf(buf, "One of %s", the(xname(potion)));
2708 Sprintf(buf, "%s
\82Ì
\88ê
\82Â", the(xname(potion)));
2710 Strcpy(buf, The(xname(potion)));
2712 pline("%s forms a coating on %s.", buf, the(xname(obj)));
2714 pline("%s
\82ª%s
\82É
\93h
\82ç
\82ê
\82½
\81D", buf, the(xname(obj)));
2715 obj->opoisoned = TRUE;
2717 } else if (obj->opoisoned && (potion->otyp == POT_HEALING
2718 || potion->otyp == POT_EXTRA_HEALING
2719 || potion->otyp == POT_FULL_HEALING)) {
2721 pline("A coating wears off %s.", the(xname(obj)));
2723 pline("
\93Å
\82ª%s
\82©
\82ç
\94\8d\82°
\82¨
\82¿
\82½
\81D", the(xname(obj)));
2729 if (potion->otyp == POT_ACID) {
2730 if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING)
2734 if (potion->otyp == POT_OIL) {
2735 boolean wisx = FALSE;
2737 if (potion->lamplit) { /* burning */
2738 fire_damage(obj, TRUE, u.ux, u.uy);
2739 } else if (potion->cursed) {
2741 pline_The("potion spills and covers your %s with oil.",
2743 pline("
\96û
\82Í
\94ò
\82Ñ
\8eU
\82è
\82 \82È
\82½
\82Ì%s
\82É
\82©
\82©
\82Á
\82½
\81D",
2744 fingers_or_gloves(TRUE));
2745 make_glib((int) (Glib & TIMEOUT) + d(2, 10));
2746 } else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
2747 /* the following cases apply only to weapons */
2749 /* Oil removes rust and corrosion, but doesn't unburn.
2750 * Arrows, etc are classed as metallic due to arrowhead
2751 * material, but dipping in oil shouldn't repair them.
2753 } else if ((!is_rustprone(obj) && !is_corrodeable(obj))
2754 || is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
2755 /* uses up potion, doesn't set obj->greased */
2758 pline("%s %s with an oily sheen.", Yname2(obj),
2759 otense(obj, "gleam"));
2761 pline("%s
\82Í
\96û
\82Ì
\8cõ
\91ò
\82Å
\82«
\82ç
\82è
\82Æ
\8cõ
\82Á
\82½
\81D", Yname2(obj));
2763 else /*if (!uarmg)*/
2765 pline("%s %s oily.", Yname2(obj), otense(obj, "feel"));
2767 pline("%s
\82Í
\96û
\82Á
\82Û
\82¢
\81D", Yname2(obj));
2770 pline("%s %s less %s.", Yname2(obj),
2771 otense(obj, !Blind ? "are" : "feel"),
2772 (obj->oeroded && obj->oeroded2)
2773 ? "corroded and rusty"
2774 : obj->oeroded ? "rusty" : "corroded");
2776 pline("%s
\82Ì%s
\82ª
\8eæ
\82ê
\82½%s
\81D", Yname2(obj),
2777 (obj->oeroded && obj->oeroded2)
2778 ? "
\95\85\90H
\82Æ
\8eK"
2779 : obj->oeroded ? "
\8eK" : "
\95\85\90H",
2780 !Blind ? "" : "
\82æ
\82¤
\82¾");
2782 if (obj->oeroded > 0)
2784 if (obj->oeroded2 > 0)
2788 exercise(A_WIS, wisx);
2790 makeknown(potion->otyp);
2796 /* Allow filling of MAGIC_LAMPs to prevent identification by player */
2797 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP)
2798 && (potion->otyp == POT_OIL)) {
2799 /* Turn off engine before fueling, turn off fuel too :-) */
2800 if (obj->lamplit || potion->lamplit) {
2802 explode(u.ux, u.uy, 11, d(6, 6), 0, EXPL_FIERY);
2803 exercise(A_WIS, FALSE);
2806 /* Adding oil to an empty magic lamp renders it into an oil lamp */
2807 if ((obj->otyp == MAGIC_LAMP) && obj->spe == 0) {
2808 obj->otyp = OIL_LAMP;
2811 if (obj->age > 1000L) {
2813 pline("%s %s full.", Yname2(obj), otense(obj, "are"));
2815 pline("%s
\82É
\82Í
\82½
\82Á
\82Õ
\82è
\93ü
\82Á
\82Ä
\82¢
\82é
\81D", Yname2(obj));
2816 potion->in_use = FALSE; /* didn't go poof */
2819 You("fill %s with oil.", yname(obj));
2821 You("%s
\82É
\96û
\82ð
\93ü
\82ê
\82½
\81D", yname(obj));
2822 check_unpaid(potion); /* Yendorian Fuel Tax */
2823 /* burns more efficiently in a lamp than in a bottle;
2824 diluted potion provides less benefit but we don't attempt
2825 to track that the lamp now also has some non-oil in it */
2826 obj->age += (!potion->odiluted ? 4L : 3L) * potion->age / 2L;
2827 if (obj->age > 1500L)
2830 exercise(A_WIS, TRUE);
2839 potion->in_use = FALSE; /* didn't go poof */
2840 if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST)
2841 && (mixture = mixtype(obj, potion)) != STRANGE_OBJECT) {
2842 char oldbuf[BUFSZ], newbuf[BUFSZ];
2843 short old_otyp = potion->otyp;
2844 boolean old_dknown = FALSE;
2845 boolean more_than_one = potion->quan > 1L;
2848 if (potion->dknown) {
2851 Sprintf(oldbuf, "%s ", hcolor(OBJ_DESCR(objects[potion->otyp])));
2853 Sprintf(oldbuf, "%s", hcolor(OBJ_DESCR(objects[potion->otyp])));
2855 /* with multiple merged potions, split off one and
2857 if (potion->quan > 1L) {
2858 singlepotion = splitobj(potion, 1L);
2860 singlepotion = potion;
2862 costly_alteration(singlepotion, COST_NUTRLZ);
2863 singlepotion->otyp = mixture;
2864 singlepotion->blessed = 0;
2865 if (mixture == POT_WATER)
2866 singlepotion->cursed = singlepotion->odiluted = 0;
2868 singlepotion->cursed = obj->cursed; /* odiluted left as-is */
2869 singlepotion->bknown = FALSE;
2871 singlepotion->dknown = FALSE;
2873 singlepotion->dknown = !Hallucination;
2875 if (mixture == POT_WATER && singlepotion->dknown)
2877 Sprintf(newbuf, "clears");
2879 Sprintf(newbuf, "
\93§
\96¾");
2882 Sprintf(newbuf, "turns %s",
2883 hcolor(OBJ_DESCR(objects[mixture])));
2885 Sprintf(newbuf, "%s
\96ò",
2886 hcolor(OBJ_DESCR(objects[mixture])));
2890 pline_The("%spotion%s %s.", oldbuf,
2891 more_than_one ? " that you dipped into" : "",
2894 pline_The("%s%s
\96ò
\82Í%s
\82É
\82È
\82Á
\82½
\81D.",
2895 more_than_one ? "
\90Z
\82µ
\82½" : "",
2900 pline("Something happens.");
2902 pline("
\89½
\82©
\82ª
\8bN
\82«
\82½
\81D");
2905 && !objects[old_otyp].oc_name_known
2906 && !objects[old_otyp].oc_uname) {
2911 fakeobj.otyp = old_otyp;
2912 fakeobj.oclass = POTION_CLASS;
2916 obj_extract_self(singlepotion);
2917 singlepotion = hold_another_object(singlepotion,
2919 "You juggle and drop %s!",
2921 "
\82¨
\8eè
\8bÊ
\82µ
\82Ä%s
\82ð
\97\8e\82Æ
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\81I",
2922 doname(singlepotion),
2924 nhUse(singlepotion);
2930 pline("Interesting...");
2932 pline("
\96Ê
\94\92\82¢
\81D
\81D
\81D");
2937 && !objects[potion->otyp].oc_name_known
2938 && !objects[potion->otyp].oc_uname)
2944 /* *monp grants a wish and then leaves the game */
2947 struct monst **monp;
2949 struct monst *mon = *monp;
2950 int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
2952 /* remove the monster first in case wish proves to be fatal
2953 (blasted by artifact), to keep it out of resulting bones file */
2955 *monp = 0; /* inform caller that monster is gone */
2956 /* hide that removal from player--map is visible during wish prompt */
2957 tmp_at(DISP_ALWAYS, glyph);
2959 /* grant the wish */
2962 tmp_at(DISP_END, 0);
2966 djinni_from_bottle(obj)
2972 if (!(mtmp = makemon(&mons[PM_DJINNI], u.ux, u.uy, NO_MM_FLAGS))) {
2974 pline("It turns out to be empty.");
2976 if (obj->otyp == MAGIC_LAMP) {
2977 pline("
\83\89\83\93\83v
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2979 pline("
\96ò
\82Í
\8bó
\82Á
\82Û
\82¾
\82Á
\82½
\81D");
2987 pline("In a cloud of smoke, %s emerges!", a_monnam(mtmp));
2989 pline("
\89\8c\82Ì
\92\86\82©
\82ç
\81C%s
\82ª
\8c»
\82í
\82ê
\82½
\81I", a_monnam(mtmp));
2991 pline("%s speaks.", Monnam(mtmp));
2993 pline("%s
\82Í
\98b
\82µ
\82©
\82¯
\82½
\81D", Monnam(mtmp));
2996 You("smell acrid fumes.");
2998 You("
\83c
\83\93\82Æ
\82·
\82é
\93õ
\82¢
\82ª
\82µ
\82½
\81D");
3000 pline("%s speaks.", Something);
3002 pline("%s
\82ª
\98b
\82µ
\82©
\82¯
\82½
\81D", Something);
3007 chance = (chance == 4) ? rnd(4) : 0;
3008 else if (obj->cursed)
3009 chance = (chance == 0) ? rn2(4) : 4;
3010 /* 0,1,2,3,4: b=80%,5,5,5,5; nc=20%,20,20,20,20; c=5%,5,5,5,80 */
3015 verbalize("I am in your debt. I will grant one wish!");
3017 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");
3018 /* give a wish and discard the monster (mtmp set to null) */
3019 mongrantswish(&mtmp);
3023 verbalize("Thank you for freeing me!");
3025 verbalize("
\8e\84\82ð
\8f\95\82¯
\82Ä
\82
\82ê
\82½
\82±
\82Æ
\82ð
\8a´
\8eÓ
\82·
\82é
\81I");
3026 (void) tamedog(mtmp, (struct obj *) 0);
3030 verbalize("You freed me!");
3032 verbalize("
\89ð
\95ú
\82µ
\82Ä
\82
\82ê
\82½
\82Ì
\82Í
\82¨
\91O
\82©
\81I");
3033 mtmp->mpeaceful = TRUE;
3038 verbalize("It is about time!");
3040 verbalize("
\82³
\82ç
\82Î
\82¾
\81I");
3041 if (canspotmon(mtmp))
3043 pline("%s vanishes.", Monnam(mtmp));
3045 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81D", Monnam(mtmp));
3050 verbalize("You disturbed me, fool!");
3052 verbalize("
\82¨
\82Ü
\82¦
\82Í
\8e\84\82Ì
\96°
\82è
\82ð
\96W
\82°
\82½
\81D
\82¨
\82ë
\82©
\82à
\82Ì
\82ß
\81I");
3053 mtmp->mpeaceful = FALSE;
3059 /* clone a gremlin or mold (2nd arg non-null implies heat as the trigger);
3060 hit points are cut in half (odd HP stays with original) */
3062 split_mon(mon, mtmp)
3063 struct monst *mon, /* monster being split */
3064 *mtmp; /* optional attacker whose heat triggered it */
3066 struct monst *mtmp2;
3072 Sprintf(reason, " from %s heat",
3073 (mtmp == &youmonst) ? the_your[1]
3074 : (const char *) s_suffix(mon_nam(mtmp)));
3076 Sprintf(reason, "%s
\82Ì
\94M
\82Å",
3077 (mtmp == &youmonst) ? the_your[1]
3078 : (const char *) mon_nam(mtmp));
3081 if (mon == &youmonst) {
3084 mtmp2->mhpmax = u.mhmax / 2;
3085 u.mhmax -= mtmp2->mhpmax;
3088 You("multiply%s!", reason);
3090 You("%s
\95ª
\97ô
\82µ
\82½
\81I", reason);
3093 mtmp2 = clone_mon(mon, 0, 0);
3095 mtmp2->mhpmax = mon->mhpmax / 2;
3096 mon->mhpmax -= mtmp2->mhpmax;
3097 if (canspotmon(mon))
3099 pline("%s multiplies%s!", Monnam(mon), reason);
3101 pline("%s
\82Í%s
\95ª
\97ô
\82µ
\82½
\81I", Monnam(mon), reason);