OSDN Git Service

add translation
[jnethack/source.git] / src / potion.c
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. */
4
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. */
9
10 #include "hack.h"
11
12 boolean notonhead = FALSE;
13
14 static NEARDATA int nothing, unkn;
15 static NEARDATA const char beverages[] = { POTION_CLASS, 0 };
16
17 STATIC_DCL long FDECL(itimeout, (long));
18 STATIC_DCL long FDECL(itimeout_incr, (long, int));
19 STATIC_DCL void NDECL(ghost_from_bottle);
20 STATIC_DCL boolean
21 FDECL(H2Opotion_dip, (struct obj *, struct obj *, BOOLEAN_P, const char *));
22 STATIC_DCL short FDECL(mixtype, (struct obj *, struct obj *));
23
24 /* force `val' to be within valid range for intrinsic timeout value */
25 STATIC_OVL long
26 itimeout(val)
27 long val;
28 {
29     if (val >= TIMEOUT)
30         val = TIMEOUT;
31     else if (val < 1)
32         val = 0;
33
34     return val;
35 }
36
37 /* increment `old' by `incr' and force result to be valid intrinsic timeout */
38 STATIC_OVL long
39 itimeout_incr(old, incr)
40 long old;
41 int incr;
42 {
43     return itimeout((old & TIMEOUT) + (long) incr);
44 }
45
46 /* set the timeout field of intrinsic `which' */
47 void
48 set_itimeout(which, val)
49 long *which, val;
50 {
51     *which &= ~TIMEOUT;
52     *which |= itimeout(val);
53 }
54
55 /* increment the timeout field of intrinsic `which' */
56 void
57 incr_itimeout(which, incr)
58 long *which;
59 int incr;
60 {
61     set_itimeout(which, itimeout_incr(*which, incr));
62 }
63
64 void
65 make_confused(xtime, talk)
66 long xtime;
67 boolean talk;
68 {
69     long old = HConfusion;
70
71     if (Unaware)
72         talk = FALSE;
73
74     if (!xtime && old) {
75         if (talk)
76 /*JP
77             You_feel("less %s now.", Hallucination ? "trippy" : "confused");
78 */
79             You("%s\82ª\82¨\82³\82Ü\82Á\82½\81D", Hallucination ? "\83w\83\8d\83w\83\8d" : "\8d¬\97\90");
80     }
81     if ((xtime && !old) || (!xtime && old))
82         context.botl = TRUE;
83
84     set_itimeout(&HConfusion, xtime);
85 }
86
87 void
88 make_stunned(xtime, talk)
89 long xtime;
90 boolean talk;
91 {
92     long old = HStun;
93
94     if (Unaware)
95         talk = FALSE;
96
97     if (!xtime && old) {
98         if (talk)
99 #if 0 /*JP*/
100             You_feel("%s now.",
101                      Hallucination ? "less wobbly" : "a bit steadier");
102 #else
103             You_feel("%s\81D",
104                      Hallucination ? "\82Ö\82ë\82è\82ç\82ª\82¨\82³\82Ü\82Á\82½" : "\82¾\82ñ\82¾\82ñ\82µ\82Á\82©\82è\82µ\82Ä\82«\82½");
105 #endif
106     }
107     if (xtime && !old) {
108         if (talk) {
109             if (u.usteed)
110 /*JP
111                 You("wobble in the saddle.");
112 */
113                 You("\88Æ\82Ì\8fã\82Å\82®\82ç\82®\82ç\82µ\82½\81D");
114             else
115 /*JP
116                 You("%s...", stagger(youmonst.data, "stagger"));
117 */
118                 You("%s\81D\81D\81D", stagger(youmonst.data, "\82­\82ç\82­\82ç\82µ\82½"));
119         }
120     }
121     if ((!xtime && old) || (xtime && !old))
122         context.botl = TRUE;
123
124     set_itimeout(&HStun, xtime);
125 }
126
127 void
128 make_sick(xtime, cause, talk, type)
129 long xtime;
130 const char *cause; /* sickness cause */
131 boolean talk;
132 int type;
133 {
134     long old = Sick;
135
136 #if 0
137     if (Unaware)
138         talk = FALSE;
139 #endif
140     if (xtime > 0L) {
141         if (Sick_resistance)
142             return;
143         if (!old) {
144             /* newly sick */
145 /*JP
146             You_feel("deathly sick.");
147 */
148             You("\95a\8bC\82Å\8e\80\82É\82»\82¤\82¾\81D");
149         } else {
150             /* already sick */
151             if (talk)
152 /*JP
153                 You_feel("%s worse.", xtime <= Sick / 2L ? "much" : "even");
154 */
155                 You("%s\88«\89»\82µ\82½\82æ\82¤\82È\8bC\82ª\82·\82é\81D", xtime <= Sick/2L ? "\82³\82ç\82É" : "\82à\82Á\82Æ");
156         }
157         set_itimeout(&Sick, xtime);
158         u.usick_type |= type;
159         context.botl = TRUE;
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 */
164             if (talk)
165 /*JP
166                 You_feel("somewhat better.");
167 */
168                 You("\82¿\82å\82Á\82Æ\82æ\82­\82È\82Á\82½\81D");
169             set_itimeout(&Sick, Sick * 2); /* approximation */
170         } else {
171             if (talk)
172 /*JP
173                 You_feel("cured.  What a relief!");
174 */
175                 pline("\89ñ\95\9c\82µ\82½\81D\82 \82 \8f\95\82©\82Á\82½\81I");
176             Sick = 0L; /* set_itimeout(&Sick, 0L) */
177         }
178         context.botl = TRUE;
179     }
180
181     if (Sick) {
182         exercise(A_CON, FALSE);
183         delayed_killer(SICK, KILLED_BY_AN, cause);
184     } else
185         dealloc_killer(find_delayed_killer(SICK));
186 }
187
188 void
189 make_slimed(xtime, msg)
190 long xtime;
191 const char *msg;
192 {
193     long old = Slimed;
194
195 #if 0
196     if (Unaware)
197         msg = 0;
198 #endif
199     if ((!xtime && old) || (xtime && !old)) {
200         if (msg)
201             pline1(msg);
202         context.botl = 1;
203     }
204     set_itimeout(&Slimed, xtime);
205     if (!Slimed)
206         dealloc_killer(find_delayed_killer(SLIMED));
207 }
208
209 /* start or stop petrification */
210 void
211 make_stoned(xtime, msg, killedby, killername)
212 long xtime;
213 const char *msg;
214 int killedby;
215 const char *killername;
216 {
217     long old = Stoned;
218
219 #if 0
220     if (Unaware)
221         msg = 0;
222 #endif
223     if ((!xtime && old) || (xtime && !old)) {
224         if (msg)
225             pline1(msg);
226         /* context.botl = 1;   --- Stoned is not a status line item */
227     }
228     set_itimeout(&Stoned, xtime);
229     if (!Stoned)
230         dealloc_killer(find_delayed_killer(STONED));
231     else if (!old)
232         delayed_killer(STONED, killedby, killername);
233 }
234
235 void
236 make_vomiting(xtime, talk)
237 long xtime;
238 boolean talk;
239 {
240     long old = Vomiting;
241
242     if (Unaware)
243         talk = FALSE;
244
245     if (!xtime && old)
246         if (talk)
247 /*JP
248             You_feel("much less nauseated now.");
249 */
250             You("\93f\82«\8bC\82ª\82¨\82³\82Ü\82Á\82½\81D");
251
252     set_itimeout(&Vomiting, xtime);
253 }
254
255 /*JP
256 static const char vismsg[] = "vision seems to %s for a moment but is %s now.";
257 */
258 static const char vismsg[] = "\8e\8b\8aE\82Í\88ê\8fu%s\82È\82Á\82½\82ª\82Ü\82½%s\82È\82Á\82½\81D";
259 /*JP
260 static const char eyemsg[] = "%s momentarily %s.";
261 */
262 static const char eyemsg[] = "%s\82Í\88ê\8fu%s\81D";
263
264 void
265 make_blinded(xtime, talk)
266 long xtime;
267 boolean talk;
268 {
269     long old = Blinded;
270     boolean u_could_see, can_see_now;
271     const char *eyes;
272
273     /* we need to probe ahead in case the Eyes of the Overworld
274        are or will be overriding blindness */
275     u_could_see = !Blind;
276     Blinded = xtime ? 1L : 0L;
277     can_see_now = !Blind;
278     Blinded = old; /* restore */
279
280     if (Unaware)
281         talk = FALSE;
282
283     if (can_see_now && !u_could_see) { /* regaining sight */
284         if (talk) {
285             if (Hallucination)
286 /*JP
287                 pline("Far out!  Everything is all cosmic again!");
288 */
289                 pline("\82°\81I\82È\82É\82à\82©\82à\82ª\82Ü\82½\93ø\90F\82É\8c©\82¦\82é\81I");
290             else
291 /*JP
292                 You("can see again.");
293 */
294                 You("\82Ü\82½\8c©\82¦\82é\82æ\82¤\82É\82È\82Á\82½\81D");
295         }
296     } else if (old && !xtime) {
297         /* clearing temporary blindness without toggling blindness */
298         if (talk) {
299             if (!haseyes(youmonst.data)) {
300                 strange_feeling((struct obj *) 0, (char *) 0);
301             } else if (Blindfolded) {
302 #if 0 /*JP*/
303                 eyes = body_part(EYE);
304                 if (eyecount(youmonst.data) != 1)
305                     eyes = makeplural(eyes);
306                 Your(eyemsg, eyes, vtense(eyes, "itch"));
307 #else
308                 Your(eyemsg, body_part(EYE), "\82©\82ä\82­\82È\82Á\82½");
309 #endif
310             } else { /* Eyes of the Overworld */
311 /*JP
312                 Your(vismsg, "brighten", Hallucination ? "sadder" : "normal");
313 */
314                 Your(vismsg, "\96¾\82é\82­", Hallucination ? "\8dª\88Ã\82É" : "\95\81\92Ê\82É");
315             }
316         }
317     }
318
319     if (u_could_see && !can_see_now) { /* losing sight */
320         if (talk) {
321             if (Hallucination)
322 /*JP
323                 pline("Oh, bummer!  Everything is dark!  Help!");
324 */
325                 pline("\88Ã\82¢\82æ\81[\81C\8b·\82¢\82æ\81[\81C\8b°\82¢\82æ\81[\81I");
326             else
327 /*JP
328                 pline("A cloud of darkness falls upon you.");
329 */
330                 pline("\88Ã\8d\95\82Ì\89_\82ª\82 \82È\82½\82ð\95¢\82Á\82½\81D");
331         }
332         /* Before the hero goes blind, set the ball&chain variables. */
333         if (Punished)
334             set_bc(0);
335     } else if (!old && xtime) {
336         /* setting temporary blindness without toggling blindness */
337         if (talk) {
338             if (!haseyes(youmonst.data)) {
339                 strange_feeling((struct obj *) 0, (char *) 0);
340             } else if (Blindfolded) {
341 #if 0 /*JP*/
342                 eyes = body_part(EYE);
343                 if (eyecount(youmonst.data) != 1)
344                     eyes = makeplural(eyes);
345                 Your(eyemsg, eyes, vtense(eyes, "twitch"));
346 #else
347                 Your(eyemsg, body_part(EYE), "\83s\83N\83s\83N\82µ\82½");
348 #endif
349             } else { /* Eyes of the Overworld */
350 /*JP
351                 Your(vismsg, "dim", Hallucination ? "happier" : "normal");
352 */
353                 Your(vismsg, "\94\96\88Ã\82­", Hallucination ? "\83n\83b\83s\81[\82É" : "\95\81\92Ê\82É");
354             }
355         }
356     }
357
358     set_itimeout(&Blinded, xtime);
359
360     if (u_could_see ^ can_see_now) { /* one or the other but not both */
361         context.botl = 1;
362         vision_full_recalc = 1; /* blindness just got toggled */
363         /* this vision recalculation used to be deferred until
364            moveloop(), but that made it possible for vision
365            irregularities to occur (cited case was force bolt
366            hitting adjacent potion of blindness and then a
367            secret door; hero was blinded by vapors but then
368            got the message "a door appears in the wall") */
369         vision_recalc(0);
370         if (Blind_telepat || Infravision)
371             see_monsters();
372
373         /* avoid either of the sequences
374            "Sting starts glowing", [become blind], "Sting stops quivering" or
375            "Sting starts quivering", [regain sight], "Sting stops glowing"
376            by giving "Sting is quivering" when becoming blind or
377            "Sting is glowing" when regaining sight so that the eventual
378            "stops" message matches */
379         if (warn_obj_cnt && uwep && (EWarn_of_mon & W_WEP) != 0L)
380             Sting_effects(-1);
381         /* update dknown flag for inventory picked up while blind */
382         if (can_see_now)
383             learn_unseen_invent();
384     }
385 }
386
387 boolean
388 make_hallucinated(xtime, talk, mask)
389 long xtime; /* nonzero if this is an attempt to turn on hallucination */
390 boolean talk;
391 long mask; /* nonzero if resistance status should change by mask */
392 {
393     long old = HHallucination;
394     boolean changed = 0;
395     const char *message, *verb;
396
397     if (Unaware)
398         talk = FALSE;
399
400 #if 0 /*JP*/
401     message = (!xtime) ? "Everything %s SO boring now."
402                        : "Oh wow!  Everything %s so cosmic!";
403 #else
404     message = (!xtime) ? "\89½\82à\82©\82à\82ª\81\96\91Þ\8bü\81\96\82É%s\82é\81D"
405                        : "\83\8f\81[\83I\81I\89½\82à\82©\82à\93ø\90F\82É%s\82é\81I";
406 #endif
407 /*JP
408     verb = (!Blind) ? "looks" : "feels";
409 */
410     verb = (!Blind) ? "\8c©\82¦" : "\8a´\82¶";
411
412     if (mask) {
413         if (HHallucination)
414             changed = TRUE;
415
416         if (!xtime)
417             EHalluc_resistance |= mask;
418         else
419             EHalluc_resistance &= ~mask;
420     } else {
421         if (!EHalluc_resistance && (!!HHallucination != !!xtime))
422             changed = TRUE;
423         set_itimeout(&HHallucination, xtime);
424
425         /* clearing temporary hallucination without toggling vision */
426         if (!changed && !HHallucination && old && talk) {
427             if (!haseyes(youmonst.data)) {
428                 strange_feeling((struct obj *) 0, (char *) 0);
429             } else if (Blind) {
430 #if 0 /*JP*/
431                 const char *eyes = body_part(EYE);
432
433                 if (eyecount(youmonst.data) != 1)
434                     eyes = makeplural(eyes);
435                 Your(eyemsg, eyes, vtense(eyes, "itch"));
436 #else
437                 Your(eyemsg, body_part(EYE), "\82©\82ä\82­\82È\82Á\82½");
438 #endif
439             } else { /* Grayswandir */
440 /*JP
441                 Your(vismsg, "flatten", "normal");
442 */
443                 Your(vismsg, "\82¨\82©\82µ\82­", "\95\81\92Ê\82É");
444             }
445         }
446     }
447
448     if (changed) {
449         /* in case we're mimicking an orange (hallucinatory form
450            of mimicking gold) update the mimicking's-over message */
451         if (!Hallucination)
452             eatmupdate();
453
454         if (u.uswallow) {
455             swallowed(0); /* redraw swallow display */
456         } else {
457             /* The see_* routines should be called *before* the pline. */
458             see_monsters();
459             see_objects();
460             see_traps();
461         }
462
463         /* for perm_inv and anything similar
464         (eg. Qt windowport's equipped items display) */
465         update_inventory();
466
467         context.botl = 1;
468         if (talk)
469             pline(message, verb);
470     }
471     return changed;
472 }
473
474 void
475 make_deaf(xtime, talk)
476 long xtime;
477 boolean talk;
478 {
479     long old = HDeaf;
480     boolean toggled = FALSE;
481
482     if (Unaware)
483         talk = FALSE;
484
485     if (!xtime && old) {
486         if (talk)
487             You("can hear again.");
488         toggled = TRUE;
489     } else if (xtime && !old) {
490         if (talk)
491             You("are unable to hear anything.");
492         toggled = TRUE;
493     }
494     /* deafness isn't presently shown on status line, but
495        request a status update in case that changes someday */
496     if (toggled)
497         context.botl = TRUE;
498
499     set_itimeout(&HDeaf, xtime);
500 }
501
502 STATIC_OVL void
503 ghost_from_bottle()
504 {
505     struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS);
506
507     if (!mtmp) {
508 /*JP
509         pline("This bottle turns out to be empty.");
510 */
511         pline("\95r\82Í\8bó\82Á\82Û\82¾\82Á\82½\81D");
512         return;
513     }
514     if (Blind) {
515 /*JP
516         pline("As you open the bottle, %s emerges.", something);
517 */
518         pline("\95r\82ð\8aJ\82¯\82é\82Æ\81C\89½\82©\82ª\8fo\82Ä\82«\82½\81D");
519         return;
520     }
521 #if 0 /*JP*/
522     pline("As you open the bottle, an enormous %s emerges!",
523           Hallucination ? rndmonnam(NULL) : (const char *) "ghost");
524 #else
525     pline("\95r\82ð\8aJ\82¯\82é\82Æ\81C\8b\90\91å\82È%s\82ª\8fo\82Ä\82«\82½\81I",
526           Hallucination ? rndmonnam(NULL) : (const char *) "\97H\97ì");
527 #endif
528     if (flags.verbose)
529 /*JP
530         You("are frightened to death, and unable to move.");
531 */
532         You("\82Ü\82Á\82³\82¨\82É\82È\82Á\82Ä\8bÁ\82«\81C\93®\82¯\82È\82­\82È\82Á\82½\81D");
533     nomul(-3);
534     multi_reason = "being frightened to death";
535 /*JP
536     nomovemsg = "You regain your composure.";
537 */
538     nomovemsg = "\82 \82È\82½\82Í\95½\90Ã\82ð\8eæ\82è\96ß\82µ\82½\81D";
539 }
540
541 /* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
542 int
543 dodrink()
544 {
545     register struct obj *otmp;
546     const char *potion_descr;
547
548     if (Strangled) {
549 /*JP
550         pline("If you can't breathe air, how can you drink liquid?");
551 */
552         pline("\91§\82à\82Å\82«\82È\82¢\82Ì\82É\81C\82Ç\82¤\82â\82Á\82Ä\89t\91Ì\82ð\88ù\82Þ\82ñ\82¾\82¢\81H");
553         return 0;
554     }
555     /* Is there a fountain to drink from here? */
556     if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
557         /* not as low as floor level but similar restrictions apply */
558         && can_reach_floor(FALSE)) {
559 /*JP
560         if (yn("Drink from the fountain?") == 'y') {
561 */
562         if (yn("\90ò\82Ì\90\85\82ð\88ù\82Ý\82Ü\82·\82©\81H") == 'y') {
563             drinkfountain();
564             return 1;
565         }
566     }
567     /* Or a kitchen sink? */
568     if (IS_SINK(levl[u.ux][u.uy].typ)
569         /* not as low as floor level but similar restrictions apply */
570         && can_reach_floor(FALSE)) {
571 /*JP
572         if (yn("Drink from the sink?") == 'y') {
573 */
574         if (yn("\97¬\82µ\91ä\82Ì\90\85\82ð\88ù\82Ý\82Ü\82·\82©\81H") == 'y') {
575             drinksink();
576             return 1;
577         }
578     }
579     /* Or are you surrounded by water? */
580     if (Underwater && !u.uswallow) {
581 /*JP
582         if (yn("Drink the water around you?") == 'y') {
583 */
584         if (yn("\82Ü\82í\82è\82Ì\90\85\82ð\88ù\82Ý\82Ü\82·\82©\81H") == 'y') {
585 /*JP
586             pline("Do you know what lives in this water?");
587 */
588             pline("\82±\82Ì\90\85\92\86\82Å\89½\82ª\90\82«\82Ä\82¢\82é\82Ì\82©\92m\82Á\82Ä\82é\82©\82¢\81H");
589             return 1;
590         }
591     }
592
593     otmp = getobj(beverages, "drink");
594     if (!otmp)
595         return 0;
596
597     /* quan > 1 used to be left to useup(), but we need to force
598        the current potion to be unworn, and don't want to do
599        that for the entire stack when starting with more than 1.
600        [Drinking a wielded potion of polymorph can trigger a shape
601        change which causes hero's weapon to be dropped.  In 3.4.x,
602        that led to an "object lost" panic since subsequent useup()
603        was no longer dealing with an inventory item.  Unwearing
604        the current potion is intended to keep it in inventory.] */
605     if (otmp->quan > 1L) {
606         otmp = splitobj(otmp, 1L);
607         otmp->owornmask = 0L; /* rest of original stuck unaffected */
608     } else if (otmp->owornmask) {
609         remove_worn_item(otmp, FALSE);
610     }
611     otmp->in_use = TRUE; /* you've opened the stopper */
612
613     potion_descr = OBJ_DESCR(objects[otmp->otyp]);
614     if (potion_descr) {
615 /*JP
616         if (!strcmp(potion_descr, "milky")
617 */
618         if (!strcmp(potion_descr, "\83~\83\8b\83N\90F\82Ì")
619             && !(mvitals[PM_GHOST].mvflags & G_GONE)
620             && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_GHOST].born))) {
621             ghost_from_bottle();
622             useup(otmp);
623             return 1;
624 /*JP
625         } else if (!strcmp(potion_descr, "smoky")
626 */
627         } else if (!strcmp(potion_descr, "\89\8c\82ª\82Å\82Ä\82¢\82é")
628                    && !(mvitals[PM_DJINNI].mvflags & G_GONE)
629                    && !rn2(POTION_OCCUPANT_CHANCE(mvitals[PM_DJINNI].born))) {
630             djinni_from_bottle(otmp);
631             useup(otmp);
632             return 1;
633         }
634     }
635     return dopotion(otmp);
636 }
637
638 int
639 dopotion(otmp)
640 register struct obj *otmp;
641 {
642     int retval;
643
644     otmp->in_use = TRUE;
645     nothing = unkn = 0;
646     if ((retval = peffects(otmp)) >= 0)
647         return retval;
648
649     if (nothing) {
650         unkn++;
651 #if 0 /*JP*/
652         You("have a %s feeling for a moment, then it passes.",
653             Hallucination ? "normal" : "peculiar");
654 #else
655         You("%s\8bC\95ª\82É\82¨\82»\82í\82ê\82½\82ª\81C\82·\82®\82É\8fÁ\82¦\82³\82Á\82½\81D",
656             Hallucination ? "\95\81\92Ê\82Ì" : "\93Æ\93Á\82È");
657 #endif
658     }
659     if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
660         if (!unkn) {
661             makeknown(otmp->otyp);
662             more_experienced(0, 10);
663         } else if (!objects[otmp->otyp].oc_uname)
664             docall(otmp);
665     }
666     useup(otmp);
667     return 1;
668 }
669
670 int
671 peffects(otmp)
672 register struct obj *otmp;
673 {
674     register int i, ii, lim;
675
676     switch (otmp->otyp) {
677     case POT_RESTORE_ABILITY:
678     case SPE_RESTORE_ABILITY:
679         unkn++;
680         if (otmp->cursed) {
681 /*JP
682             pline("Ulch!  This makes you feel mediocre!");
683 */
684             pline("\82¤\81[\82ñ\81C\82Ç\82¤\82à\82³\82¦\82È\82¢\82È\82 \81D");
685             break;
686         } else {
687             /* unlike unicorn horn, overrides Fixed_abil */
688 #if 0 /*JP*/
689             pline("Wow!  This makes you feel %s!",
690                   (otmp->blessed)
691                       ? (unfixable_trouble_count(FALSE) ? "better" : "great")
692                       : "good");
693 #else
694             pline("\83\8f\81[\83I\81I\8bC\95ª\82ª%s\82È\82Á\82½\81I",
695                   (otmp->blessed)
696                       ? (unfixable_trouble_count(FALSE) ? "\82¾\82¢\82Ô\82æ\82­" : "\82Æ\82Ä\82à\82æ\82­")
697                       : "\82æ\82­");
698 #endif
699             i = rn2(A_MAX); /* start at a random point */
700             for (ii = 0; ii < A_MAX; ii++) {
701                 lim = AMAX(i);
702                 if (i == A_STR && u.uhs >= 3)
703                     --lim; /* WEAK */
704                 if (ABASE(i) < lim) {
705                     ABASE(i) = lim;
706                     context.botl = 1;
707                     /* only first found if not blessed */
708                     if (!otmp->blessed)
709                         break;
710                 }
711                 if (++i >= A_MAX)
712                     i = 0;
713             }
714         }
715         break;
716     case POT_HALLUCINATION:
717         if (Hallucination || Halluc_resistance)
718             nothing++;
719         (void) make_hallucinated(
720             itimeout_incr(HHallucination, rn1(200, 600 - 300 * bcsign(otmp))),
721             TRUE, 0L);
722         break;
723     case POT_WATER:
724         if (!otmp->blessed && !otmp->cursed) {
725 /*JP
726             pline("This tastes like water.");
727 */
728             pline("\90\85\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81D");
729             u.uhunger += rnd(10);
730             newuhs(FALSE);
731             break;
732         }
733         unkn++;
734         if (is_undead(youmonst.data) || is_demon(youmonst.data)
735             || u.ualign.type == A_CHAOTIC) {
736             if (otmp->blessed) {
737 /*JP
738                 pline("This burns like acid!");
739 */
740                 pline("\8e_\82Ì\82æ\82¤\82É\90ã\82ª\82Ð\82è\82Ð\82è\82·\82é\81I");
741                 exercise(A_CON, FALSE);
742                 if (u.ulycn >= LOW_PM) {
743 /*JP
744                     Your("affinity to %s disappears!",
745 */
746                     Your("%s\82Ö\82Ì\90e\8bß\8a´\82Í\82È\82­\82È\82Á\82½\81I",
747                          makeplural(mons[u.ulycn].mname));
748                     if (youmonst.data == &mons[u.ulycn])
749                         you_unwere(FALSE);
750                     u.ulycn = NON_PM; /* cure lycanthropy */
751                 }
752 /*JP
753                 losehp(Maybe_Half_Phys(d(2, 6)), "potion of holy water",
754 */
755                 losehp(Maybe_Half_Phys(d(2, 6)), "\90¹\90\85\82Å",
756                        KILLED_BY_AN);
757             } else if (otmp->cursed) {
758 /*JP
759                 You_feel("quite proud of yourself.");
760 */
761                 You("\8e©\91¸\90S\82ð\8a´\82\82½\81D");
762                 healup(d(2, 6), 0, 0, 0);
763                 if (u.ulycn >= LOW_PM && !Upolyd)
764                     you_were();
765                 exercise(A_CON, TRUE);
766             }
767         } else {
768             if (otmp->blessed) {
769 /*JP
770                 You_feel("full of awe.");
771 */
772                 You("\88Ø\95|\82Ì\94O\82É\82©\82ç\82ê\82½\81D");
773                 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
774                 exercise(A_WIS, TRUE);
775                 exercise(A_CON, TRUE);
776                 if (u.ulycn >= LOW_PM)
777                     you_unwere(TRUE); /* "Purified" */
778                 /* make_confused(0L, TRUE); */
779             } else {
780                 if (u.ualign.type == A_LAWFUL) {
781 /*JP
782                     pline("This burns like acid!");
783 */
784                     pline("\8e_\82Ì\82æ\82¤\82É\90ã\82ª\82Ð\82è\82Ð\82è\82·\82é\81I");
785 /*JP
786                     losehp(Maybe_Half_Phys(d(2, 6)), "potion of unholy water",
787 */
788                     losehp(Maybe_Half_Phys(d(2, 6)), "\95s\8fò\82È\90\85\82Å",
789                            KILLED_BY_AN);
790                 } else
791 /*JP
792                     You_feel("full of dread.");
793 */
794                     You("\8b°\95|\82Ì\94O\82É\82©\82ç\82ê\82½\81D");
795                 if (u.ulycn >= LOW_PM && !Upolyd)
796                     you_were();
797                 exercise(A_CON, FALSE);
798             }
799         }
800         break;
801     case POT_BOOZE:
802         unkn++;
803 #if 0 /*JP*/
804         pline("Ooph!  This tastes like %s%s!",
805               otmp->odiluted ? "watered down " : "",
806               Hallucination ? "dandelion wine" : "liquid fire");
807 #else
808         pline("\82¤\82¥\82Á\82Õ\81I\82±\82ê\82Í%s%s\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81I",
809               otmp->odiluted ? "\90\85\82Å\94\96\82ß\82½" : "",
810               Hallucination ? "\83^\83\93\83|\83|\83\8f\83C\83\93" : "\94R\97¿\83I\83C\83\8b");
811 #endif
812         if (!otmp->blessed)
813             make_confused(itimeout_incr(HConfusion, d(3, 8)), FALSE);
814         /* the whiskey makes us feel better */
815         if (!otmp->odiluted)
816             healup(1, 0, FALSE, FALSE);
817         u.uhunger += 10 * (2 + bcsign(otmp));
818         newuhs(FALSE);
819         exercise(A_WIS, FALSE);
820         if (otmp->cursed) {
821 /*JP
822             You("pass out.");
823 */
824             You("\8bC\90â\82µ\82½\81D");
825             multi = -rnd(15);
826 /*JP
827             nomovemsg = "You awake with a headache.";
828 */
829             nomovemsg = "\96Ú\82ª\82³\82ß\82½\82ª\93ª\92É\82ª\82·\82é\81D";
830         }
831         break;
832     case POT_ENLIGHTENMENT:
833         if (otmp->cursed) {
834             unkn++;
835 /*JP
836             You("have an uneasy feeling...");
837 */
838             You("\95s\88À\82È\8bC\8e\9d\82É\82È\82Á\82½\81D\81D\81D");
839             exercise(A_WIS, FALSE);
840         } else {
841             if (otmp->blessed) {
842                 (void) adjattrib(A_INT, 1, FALSE);
843                 (void) adjattrib(A_WIS, 1, FALSE);
844             }
845 /*JP
846             You_feel("self-knowledgeable...");
847 */
848             You("\8e©\95ª\8e©\90g\82ª\94»\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D\81D\81D");
849             display_nhwindow(WIN_MESSAGE, FALSE);
850             enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
851 /*JP
852             pline_The("feeling subsides.");
853 */
854             pline("\82»\82Ì\8a´\82\82Í\82È\82­\82È\82Á\82½\81D");
855             exercise(A_WIS, TRUE);
856         }
857         break;
858     case SPE_INVISIBILITY:
859         /* spell cannot penetrate mummy wrapping */
860         if (BInvis && uarmc->otyp == MUMMY_WRAPPING) {
861 /*JP
862             You_feel("rather itchy under %s.", yname(uarmc));
863 */
864             You("%s\82Ì\89º\82ª\83\80\83Y\83\80\83Y\82µ\82½\81D", xname(uarmc));
865             break;
866         }
867         /* FALLTHRU */
868     case POT_INVISIBILITY:
869         if (Invis || Blind || BInvis) {
870             nothing++;
871         } else {
872             self_invis_message();
873         }
874         if (otmp->blessed)
875             HInvis |= FROMOUTSIDE;
876         else
877             incr_itimeout(&HInvis, rn1(15, 31));
878         newsym(u.ux, u.uy); /* update position */
879         if (otmp->cursed) {
880 /*JP
881             pline("For some reason, you feel your presence is known.");
882 */
883             pline("\82È\82º\82©\81C\91\8dÝ\82ª\92m\82ç\82ê\82Ä\82¢\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
884             aggravate();
885         }
886         break;
887     case POT_SEE_INVISIBLE: /* tastes like fruit juice in Rogue */
888     case POT_FRUIT_JUICE: {
889         int msg = Invisible && !Blind;
890
891         unkn++;
892         if (otmp->cursed)
893 #if 0 /*JP*/
894             pline("Yecch!  This tastes %s.",
895                   Hallucination ? "overripe" : "rotten");
896 #else
897             pline("\83I\83F\81[\81I\82±\82ê\82Í%s\83W\83\85\81[\83X\82Ì\96¡\82ª\82·\82é\81D",
898                   Hallucination ? "\8fn\82µ\82·\82¬\82½" : "\95\85\82Á\82½");
899 #endif
900         else
901 #if 0 /*JP*/
902             pline(
903                 Hallucination
904                     ? "This tastes like 10%% real %s%s all-natural beverage."
905                     : "This tastes like %s%s.",
906                 otmp->odiluted ? "reconstituted " : "", fruitname(TRUE));
907 #else
908             pline(
909                 Hallucination
910                     ? "10%%%s\82Ì\8f\83\8e©\91R\88ù\97¿\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81D"
911                     : "%s%s\83W\83\85\81[\83X\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81D",
912                 otmp->odiluted ? "\90¬\95ª\92²\90®\82³\82ê\82½" : "", fruitname(TRUE));
913 #endif
914         if (otmp->otyp == POT_FRUIT_JUICE) {
915             u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
916             newuhs(FALSE);
917             break;
918         }
919         if (!otmp->cursed) {
920             /* Tell them they can see again immediately, which
921              * will help them identify the potion...
922              */
923             make_blinded(0L, TRUE);
924         }
925         if (otmp->blessed)
926             HSee_invisible |= FROMOUTSIDE;
927         else
928             incr_itimeout(&HSee_invisible, rn1(100, 750));
929         set_mimic_blocking(); /* do special mimic handling */
930         see_monsters();       /* see invisible monsters */
931         newsym(u.ux, u.uy);   /* see yourself! */
932         if (msg && !Blind) {  /* Blind possible if polymorphed */
933 /*JP
934             You("can see through yourself, but you are visible!");
935 */
936             You("\93§\96¾\82Å\82 \82é\81D\82µ\82©\82µ\8c©\82¦\82é\82æ\82¤\82É\82È\82Á\82½\81I");
937             unkn--;
938         }
939         break;
940     }
941     case POT_PARALYSIS:
942         if (Free_action) {
943 /*JP
944             You("stiffen momentarily.");
945 */
946             You("\88ê\8fu\93®\82¯\82È\82­\82È\82Á\82½\81D");
947         } else {
948             if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
949 /*JP
950                 You("are motionlessly suspended.");
951 */
952                 You("\8bó\92\86\82Å\93®\82¯\82È\82­\82È\82Á\82½\81D");
953             else if (u.usteed)
954 /*JP
955                 You("are frozen in place!");
956 */
957                 You("\82»\82Ì\8fê\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I");
958             else
959 #if 0 /*JP*/
960                 Your("%s are frozen to the %s!", makeplural(body_part(FOOT)),
961                      surface(u.ux, u.uy));
962 #else
963                 You("\93®\82¯\82È\82­\82È\82Á\82½\81I");
964 #endif
965             nomul(-(rn1(10, 25 - 12 * bcsign(otmp))));
966             multi_reason = "frozen by a potion";
967             nomovemsg = You_can_move_again;
968             exercise(A_DEX, FALSE);
969         }
970         break;
971     case POT_SLEEPING:
972         if (Sleep_resistance || Free_action) {
973 /*JP
974             You("yawn.");
975 */
976             You("\82 \82­\82Ñ\82ð\82µ\82½\81D");
977         } else {
978 /*JP
979             You("suddenly fall asleep!");
980 */
981             pline("\93Ë\91R\96°\82Á\82Ä\82µ\82Ü\82Á\82½\81I");
982             fall_asleep(-rn1(10, 25 - 12 * bcsign(otmp)), TRUE);
983         }
984         break;
985     case POT_MONSTER_DETECTION:
986     case SPE_DETECT_MONSTERS:
987         if (otmp->blessed) {
988             int x, y;
989
990             if (Detect_monsters)
991                 nothing++;
992             unkn++;
993             /* after a while, repeated uses become less effective */
994             if ((HDetect_monsters & TIMEOUT) >= 300L)
995                 i = 1;
996             else
997                 i = rn1(40, 21);
998             incr_itimeout(&HDetect_monsters, i);
999             for (x = 1; x < COLNO; x++) {
1000                 for (y = 0; y < ROWNO; y++) {
1001                     if (levl[x][y].glyph == GLYPH_INVISIBLE) {
1002                         unmap_object(x, y);
1003                         newsym(x, y);
1004                     }
1005                     if (MON_AT(x, y))
1006                         unkn = 0;
1007                 }
1008             }
1009             see_monsters();
1010             if (unkn)
1011 /*JP
1012                 You_feel("lonely.");
1013 */
1014                 You("\90S\8d×\82­\82È\82Á\82½\81D");
1015             break;
1016         }
1017         if (monster_detect(otmp, 0))
1018             return 1; /* nothing detected */
1019         exercise(A_WIS, TRUE);
1020         break;
1021     case POT_OBJECT_DETECTION:
1022     case SPE_DETECT_TREASURE:
1023         if (object_detect(otmp, 0))
1024             return 1; /* nothing detected */
1025         exercise(A_WIS, TRUE);
1026         break;
1027     case POT_SICKNESS:
1028 /*JP
1029         pline("Yecch!  This stuff tastes like poison.");
1030 */
1031         pline("\83E\83F\81[\81I\93Å\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81D");
1032         if (otmp->blessed) {
1033 /*JP
1034             pline("(But in fact it was mildly stale %s.)", fruitname(TRUE));
1035 */
1036             pline("(\82µ\82©\82µ\8eÀ\8dÛ\82»\82ê\82Í\8f­\82µ\8cÃ\82­\82È\82Á\82½%s\81D)", fruitname(TRUE));
1037             if (!Role_if(PM_HEALER)) {
1038                 /* NB: blessed otmp->fromsink is not possible */
1039 /*JP
1040                 losehp(1, "mildly contaminated potion", KILLED_BY_AN);
1041 */
1042                 losehp(1, "\95a\8bC\82É\89\98\90õ\82³\82ê\82½\96ò\82Å", KILLED_BY_AN);
1043             }
1044         } else {
1045             if (Poison_resistance)
1046 /*JP
1047                 pline("(But in fact it was biologically contaminated %s.)",
1048 */
1049                 pline("(\82µ\82©\82µ\8eÀ\8dÛ\82»\82ê\82Í\90\95¨\8aw\93I\82É\89\98\90õ\82³\82ê\82½%s\82¾\81D)",
1050                       fruitname(TRUE));
1051             if (Role_if(PM_HEALER)) {
1052 /*JP
1053                 pline("Fortunately, you have been immunized.");
1054 */
1055                 pline("\8dK\89^\82È\82±\82Æ\82É\81C\82 \82È\82½\82Í\96Æ\89u\82ª\82 \82é\81D");
1056             } else {
1057                 char contaminant[BUFSZ];
1058                 int typ = rn2(A_MAX);
1059
1060 #if 0 /*JP*/
1061                 Sprintf(contaminant, "%s%s",
1062                         (Poison_resistance) ? "mildly " : "",
1063                         (otmp->fromsink) ? "contaminated tap water"
1064                                          : "contaminated potion");
1065 #else
1066                 Sprintf(contaminant, "%s\89\98\90õ\82³\82ê\82½%s\82Å",
1067                         (Poison_resistance) ? "\8f­\82µ" : "",
1068                         (otmp->fromsink) ? "\90\85"
1069                                          : "\96ò");
1070 #endif
1071                 if (!Fixed_abil) {
1072                     poisontell(typ, FALSE);
1073                     (void) adjattrib(typ, Poison_resistance ? -1 : -rn1(4, 3),
1074                                      1);
1075                 }
1076                 if (!Poison_resistance) {
1077                     if (otmp->fromsink)
1078                         losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1079                                KILLED_BY);
1080                     else
1081                         losehp(rnd(10) + 5 * !!(otmp->cursed), contaminant,
1082                                KILLED_BY_AN);
1083                 } else {
1084                     /* rnd loss is so that unblessed poorer than blessed */
1085                     losehp(1 + rn2(2), contaminant,
1086                            (otmp->fromsink) ? KILLED_BY : KILLED_BY_AN);
1087                 }
1088                 exercise(A_CON, FALSE);
1089             }
1090         }
1091         if (Hallucination) {
1092 /*JP
1093             You("are shocked back to your senses!");
1094 */
1095             You("\8cÜ\8a´\82É\8fÕ\8c\82\82ð\8eó\82¯\82½\81I");
1096             (void) make_hallucinated(0L, FALSE, 0L);
1097         }
1098         break;
1099     case POT_CONFUSION:
1100         if (!Confusion) {
1101             if (Hallucination) {
1102 /*JP
1103                 pline("What a trippy feeling!");
1104 */
1105                 pline("\82È\82ñ\82©\83w\83\8d\83w\83\8d\82·\82é\81I");
1106                 unkn++;
1107             } else
1108 /*JP
1109                 pline("Huh, What?  Where am I?");
1110 */
1111                 pline("\82Ù\82¦\81H\8e\84\82Í\92N\81H");
1112         } else
1113             nothing++;
1114         make_confused(itimeout_incr(HConfusion,
1115                                     rn1(7, 16 - 8 * bcsign(otmp))),
1116                       FALSE);
1117         break;
1118     case POT_GAIN_ABILITY:
1119         if (otmp->cursed) {
1120 /*JP
1121             pline("Ulch!  That potion tasted foul!");
1122 */
1123             pline("\83E\83F\81I\88«\8fL\82ª\82·\82é\81I");
1124             unkn++;
1125         } else if (Fixed_abil) {
1126             nothing++;
1127         } else {      /* If blessed, increase all; if not, try up to */
1128             int itmp; /* 6 times to find one which can be increased. */
1129
1130             i = -1;   /* increment to 0 */
1131             for (ii = A_MAX; ii > 0; ii--) {
1132                 i = (otmp->blessed ? i + 1 : rn2(A_MAX));
1133                 /* only give "your X is already as high as it can get"
1134                    message on last attempt (except blessed potions) */
1135                 itmp = (otmp->blessed || ii == 1) ? 0 : -1;
1136                 if (adjattrib(i, 1, itmp) && !otmp->blessed)
1137                     break;
1138             }
1139         }
1140         break;
1141     case POT_SPEED:
1142         if (Wounded_legs && !otmp->cursed && !u.usteed) {
1143             /* heal_legs() would heal steeds legs */
1144             heal_legs();
1145             unkn++;
1146             break;
1147         }
1148         /* FALLTHRU */
1149     case SPE_HASTE_SELF:
1150         if (!Very_fast) { /* wwf@doe.carleton.ca */
1151 /*JP
1152             You("are suddenly moving %sfaster.", Fast ? "" : "much ");
1153 */
1154             You("\93Ë\91R%s\91¬\82­\88Ú\93®\82Å\82«\82é\82æ\82¤\82É\82È\82Á\82½\81D", Fast ? "" : "\82Æ\82Ä\82à");
1155         } else {
1156 /*JP
1157             Your("%s get new energy.", makeplural(body_part(LEG)));
1158 */
1159             pline("%s\82É\83G\83l\83\8b\83M\81[\82ª\92\8d\82¬\82±\82Ü\82ê\82é\82æ\82¤\82È\8a´\82\82ª\82µ\82½\81D", body_part(LEG));
1160             unkn++;
1161         }
1162         exercise(A_DEX, TRUE);
1163         incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp)));
1164         break;
1165     case POT_BLINDNESS:
1166         if (Blind)
1167             nothing++;
1168         make_blinded(itimeout_incr(Blinded,
1169                                    rn1(200, 250 - 125 * bcsign(otmp))),
1170                      (boolean) !Blind);
1171         break;
1172     case POT_GAIN_LEVEL:
1173         if (otmp->cursed) {
1174             unkn++;
1175             /* they went up a level */
1176             if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
1177                 || Can_rise_up(u.ux, u.uy, &u.uz)) {
1178 /*JP
1179                 const char *riseup = "rise up, through the %s!";
1180 */
1181                 const char *riseup ="%s\82ð\93Ë\82«\94²\82¯\82½\81I";
1182
1183                 if (ledger_no(&u.uz) == 1) {
1184                     You(riseup, ceiling(u.ux, u.uy));
1185                     goto_level(&earth_level, FALSE, FALSE, FALSE);
1186                 } else {
1187                     register int newlev = depth(&u.uz) - 1;
1188                     d_level newlevel;
1189
1190                     get_level(&newlevel, newlev);
1191                     if (on_level(&newlevel, &u.uz)) {
1192 /*JP
1193                         pline("It tasted bad.");
1194 */
1195                         pline("\82Æ\82Ä\82à\82Ü\82¸\82¢\81D");
1196                         break;
1197                     } else
1198                         You(riseup, ceiling(u.ux, u.uy));
1199                     goto_level(&newlevel, FALSE, FALSE, FALSE);
1200                 }
1201             } else
1202 /*JP
1203                 You("have an uneasy feeling.");
1204 */
1205                 You("\95s\88À\82È\8bC\8e\9d\82É\82È\82Á\82½\81D");
1206             break;
1207         }
1208         pluslvl(FALSE);
1209         /* blessed potions place you at a random spot in the
1210            middle of the new level instead of the low point */
1211         if (otmp->blessed)
1212             u.uexp = rndexp(TRUE);
1213         break;
1214     case POT_HEALING:
1215 /*JP
1216         You_feel("better.");
1217 */
1218         You("\8bC\95ª\82ª\82æ\82­\82È\82Á\82½\81D");
1219         healup(d(6 + 2 * bcsign(otmp), 4), !otmp->cursed ? 1 : 0,
1220                !!otmp->blessed, !otmp->cursed);
1221         exercise(A_CON, TRUE);
1222         break;
1223     case POT_EXTRA_HEALING:
1224 /*JP
1225         You_feel("much better.");
1226 */
1227         You("\8bC\95ª\82ª\82Æ\82Ä\82à\82æ\82­\82È\82Á\82½\81D");
1228         healup(d(6 + 2 * bcsign(otmp), 8),
1229                otmp->blessed ? 5 : !otmp->cursed ? 2 : 0, !otmp->cursed,
1230                TRUE);
1231         (void) make_hallucinated(0L, TRUE, 0L);
1232         exercise(A_CON, TRUE);
1233         exercise(A_STR, TRUE);
1234         break;
1235     case POT_FULL_HEALING:
1236 /*JP
1237         You_feel("completely healed.");
1238 */
1239         You("\8a®\91S\82É\89ñ\95\9c\82µ\82½\81D");
1240         healup(400, 4 + 4 * bcsign(otmp), !otmp->cursed, TRUE);
1241         /* Restore one lost level if blessed */
1242         if (otmp->blessed && u.ulevel < u.ulevelmax) {
1243             /* when multiple levels have been lost, drinking
1244                multiple potions will only get half of them back */
1245             u.ulevelmax -= 1;
1246             pluslvl(FALSE);
1247         }
1248         (void) make_hallucinated(0L, TRUE, 0L);
1249         exercise(A_STR, TRUE);
1250         exercise(A_CON, TRUE);
1251         break;
1252     case POT_LEVITATION:
1253     case SPE_LEVITATION:
1254         if (otmp->cursed)
1255             HLevitation &= ~I_SPECIAL;
1256         if (!Levitation && !BLevitation) {
1257             /* kludge to ensure proper operation of float_up() */
1258             set_itimeout(&HLevitation, 1L);
1259             float_up();
1260             /* reverse kludge */
1261             set_itimeout(&HLevitation, 0L);
1262             if (otmp->cursed) {
1263                 if ((u.ux == xupstair && u.uy == yupstair)
1264                     || (sstairs.up && u.ux == sstairs.sx
1265                         && u.uy == sstairs.sy)
1266                     || (xupladder && u.ux == xupladder
1267                         && u.uy == yupladder)) {
1268                     (void) doup();
1269                 } else if (has_ceiling(&u.uz)) {
1270                     int dmg = uarmh ? 1 : rnd(10);
1271
1272 #if 0 /*JP*/
1273                     You("hit your %s on the %s.", body_part(HEAD),
1274                         ceiling(u.ux, u.uy));
1275 #else
1276                     You("%s\82ð%s\82É\82Ô\82Â\82¯\82½\81D", body_part(HEAD),
1277                         ceiling(u.ux,u.uy));
1278 #endif
1279 /*JP
1280                     losehp(Maybe_Half_Phys(dmg), "colliding with the ceiling",
1281 */
1282                     losehp(Maybe_Half_Phys(dmg), "\93V\88ä\82É\93ª\82ð\82Ô\82Â\82¯\82Ä",
1283                            KILLED_BY);
1284                 }
1285             } /*cursed*/
1286         } else
1287             nothing++;
1288         if (otmp->blessed) {
1289             incr_itimeout(&HLevitation, rn1(50, 250));
1290             HLevitation |= I_SPECIAL;
1291         } else
1292             incr_itimeout(&HLevitation, rn1(140, 10));
1293         if (Levitation)
1294             spoteffects(FALSE); /* for sinks */
1295         float_vs_flight();
1296         break;
1297     case POT_GAIN_ENERGY: { /* M. Stephenson */
1298         int num;
1299
1300         if (otmp->cursed)
1301 /*JP
1302             You_feel("lackluster.");
1303 */
1304             You("\88Ó\8bC\8fÁ\92¾\82µ\82½\81D");
1305         else
1306 /*JP
1307             pline("Magical energies course through your body.");
1308 */
1309             pline("\96\82\96@\82Ì\83G\83l\83\8b\83M\81[\82ª\82 \82È\82½\82Ì\91Ì\82É\96\9e\82¿\82½\81D");
1310
1311         /* old: num = rnd(5) + 5 * otmp->blessed + 1;
1312          *      blessed:  +7..11 max & current (+9 avg)
1313          *      uncursed: +2.. 6 max & current (+4 avg)
1314          *      cursed:   -2.. 6 max & current (-4 avg)
1315          * new: (3.6.0)
1316          *      blessed:  +3..18 max (+10.5 avg), +9..54 current (+31.5 avg)
1317          *      uncursed: +2..12 max (+ 7   avg), +6..36 current (+21   avg)
1318          *      cursed:   -1.. 6 max (- 3.5 avg), -3..18 current (-10.5 avg)
1319          */
1320         num = d(otmp->blessed ? 3 : !otmp->cursed ? 2 : 1, 6);
1321         if (otmp->cursed)
1322             num = -num; /* subtract instead of add when cursed */
1323         u.uenmax += num;
1324         if (u.uenmax <= 0)
1325             u.uenmax = 0;
1326         u.uen += 3 * num;
1327         if (u.uen > u.uenmax)
1328             u.uen = u.uenmax;
1329         else if (u.uen <= 0)
1330             u.uen = 0;
1331         context.botl = 1;
1332         exercise(A_WIS, TRUE);
1333         break;
1334     }
1335     case POT_OIL: { /* P. Winner */
1336         boolean good_for_you = FALSE;
1337
1338         if (otmp->lamplit) {
1339             if (likes_fire(youmonst.data)) {
1340 /*JP
1341                 pline("Ahh, a refreshing drink.");
1342 */
1343                 pline("\82í\81[\82¨\81C\90\82«\95Ô\82é\81D");
1344                 good_for_you = TRUE;
1345             } else {
1346 /*JP
1347                 You("burn your %s.", body_part(FACE));
1348 */
1349                 Your("%s\82Í\8d\95\8fÅ\82°\82É\82È\82Á\82½\81D", body_part(FACE));
1350                 /* fire damage */
1351 /*JP
1352                 losehp(d(Fire_resistance ? 1 : 3, 4), "burning potion of oil",
1353 */
1354                 losehp(d(Fire_resistance ? 1 : 3, 4), "\94R\82¦\82Ä\82¢\82é\96û\82ð\88ù\82ñ\82Å",
1355                        KILLED_BY_AN);
1356             }
1357         } else if (otmp->cursed)
1358 /*JP
1359             pline("This tastes like castor oil.");
1360 */
1361             pline("\82Ð\82Ü\82µ\96û\82Ì\82æ\82¤\82È\96¡\82ª\82·\82é\81D");
1362         else
1363 /*JP
1364             pline("That was smooth!");
1365 */
1366             pline("\8cû\82 \82½\82è\82ª\82æ\82¢\81I");
1367         exercise(A_WIS, good_for_you);
1368         break;
1369     }
1370     case POT_ACID:
1371         if (Acid_resistance) {
1372             /* Not necessarily a creature who _likes_ acid */
1373 /*JP
1374             pline("This tastes %s.", Hallucination ? "tangy" : "sour");
1375 */
1376             pline("%s\96¡\82ª\82·\82é\81D", Hallucination ? "\82Ò\82è\82Á\82Æ\82µ\82½" : "\8e_\82Ì");
1377         } else {
1378             int dmg;
1379
1380 #if 0 /*JP*/
1381             pline("This burns%s!",
1382                   otmp->blessed ? " a little" : otmp->cursed ? " a lot"
1383                                                              : " like acid");
1384 #else
1385             pline("%s\8fÅ\82°\82½\81I",
1386                   otmp->blessed ? "\8f­\82µ" : otmp->cursed ? "\82·\82²\82­"
1387                                                         : "");
1388 #endif
1389             dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
1390 /*JP
1391             losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1392 */
1393             losehp(Maybe_Half_Phys(dmg), "\8e_\82Ì\96ò\82ð\88ù\82ñ\82Å", KILLED_BY_AN);
1394             exercise(A_CON, FALSE);
1395         }
1396         if (Stoned)
1397             fix_petrification();
1398         unkn++; /* holy/unholy water can burn like acid too */
1399         break;
1400     case POT_POLYMORPH:
1401 /*JP
1402         You_feel("a little %s.", Hallucination ? "normal" : "strange");
1403 */
1404         You("\8f­\82µ%s\82È\8a´\82\82ª\82µ\82½\81D", Hallucination ? "\95\81\92Ê" : "\95Ï");
1405         if (!Unchanging)
1406             polyself(0);
1407         break;
1408     default:
1409         impossible("What a funny potion! (%u)", otmp->otyp);
1410         return 0;
1411     }
1412     return -1;
1413 }
1414
1415 #ifdef  JPEXTENSION
1416 void
1417 make_totter(xtime, talk)
1418 long xtime;     /* nonzero if this is an attempt to turn on hallucination */
1419 boolean talk;
1420 {
1421         const char *message = 0;
1422
1423         if (!xtime)
1424             message = "\95û\8cü\8a´\8ao\82ª\90³\8fí\82É\82È\82Á\82½\81D";
1425         else
1426             message = "\95û\8cü\8a´\8ao\82ª\96\83á\83\82µ\82½\81D";
1427
1428         set_itimeout(&Totter, xtime);
1429         pline(message);
1430 }
1431 #endif
1432
1433 void
1434 healup(nhp, nxtra, curesick, cureblind)
1435 int nhp, nxtra;
1436 register boolean curesick, cureblind;
1437 {
1438     if (nhp) {
1439         if (Upolyd) {
1440             u.mh += nhp;
1441             if (u.mh > u.mhmax)
1442                 u.mh = (u.mhmax += nxtra);
1443         } else {
1444             u.uhp += nhp;
1445             if (u.uhp > u.uhpmax)
1446                 u.uhp = (u.uhpmax += nxtra);
1447         }
1448     }
1449     if (cureblind)
1450         make_blinded(0L, TRUE);
1451     if (curesick) {
1452         make_vomiting(0L, TRUE);
1453         make_sick(0L, (char *) 0, TRUE, SICK_ALL);
1454     }
1455     context.botl = 1;
1456     return;
1457 }
1458
1459 void
1460 strange_feeling(obj, txt)
1461 struct obj *obj;
1462 const char *txt;
1463 {
1464     if (flags.beginner || !txt)
1465 #if 0 /*JP*/
1466         You("have a %s feeling for a moment, then it passes.",
1467             Hallucination ? "normal" : "strange");
1468 #else
1469         You("%s\8bC\95ª\82É\82¨\82»\82í\82ê\82½\82ª\81C\82·\82®\82É\8fÁ\82¦\82³\82Á\82½\81D",
1470             Hallucination ? "\95\81\92Ê\82Ì" : "\8aï\96­\82È");
1471 #endif
1472     else
1473         pline1(txt);
1474
1475     if (!obj) /* e.g., crystal ball finds no traps */
1476         return;
1477
1478     if (obj->dknown && !objects[obj->otyp].oc_name_known
1479         && !objects[obj->otyp].oc_uname)
1480         docall(obj);
1481
1482     useup(obj);
1483 }
1484
1485 #if 0 /*JP*/
1486 const char *bottlenames[] = { "bottle", "phial", "flagon", "carafe",
1487                               "flask",  "jar",   "vial" };
1488 #else
1489 const char *bottlenames[] = { "\95r", "àÞ\97\9e\95r", "\88ê\8f¡\95r", "\90\85\8d·\82µ",
1490                               "\83t\83\89\83X\83R", "\92Ù", "\83K\83\89\83X\95r" };
1491 #endif
1492
1493 const char *
1494 bottlename()
1495 {
1496     return bottlenames[rn2(SIZE(bottlenames))];
1497 }
1498
1499 /* handle item dipped into water potion or steed saddle splashed by same */
1500 STATIC_OVL boolean
1501 H2Opotion_dip(potion, targobj, useeit, objphrase)
1502 struct obj *potion, *targobj;
1503 boolean useeit;
1504 const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
1505 {
1506     void FDECL((*func), (OBJ_P)) = 0;
1507     const char *glowcolor = 0;
1508 #define COST_alter (-2)
1509 #define COST_none (-1)
1510     int costchange = COST_none;
1511     boolean altfmt = FALSE, res = FALSE;
1512
1513     if (!potion || potion->otyp != POT_WATER)
1514         return FALSE;
1515
1516     if (potion->blessed) {
1517         if (targobj->cursed) {
1518             func = uncurse;
1519             glowcolor = NH_AMBER;
1520             costchange = COST_UNCURS;
1521         } else if (!targobj->blessed) {
1522             func = bless;
1523             glowcolor = NH_LIGHT_BLUE;
1524             costchange = COST_alter;
1525             altfmt = TRUE; /* "with a <color> aura" */
1526         }
1527     } else if (potion->cursed) {
1528         if (targobj->blessed) {
1529             func = unbless;
1530             glowcolor = "brown";
1531             costchange = COST_UNBLSS;
1532         } else if (!targobj->cursed) {
1533             func = curse;
1534             glowcolor = NH_BLACK;
1535             costchange = COST_alter;
1536             altfmt = TRUE;
1537         }
1538     } else {
1539         /* dipping into uncursed water; carried() check skips steed saddle */
1540         if (carried(targobj)) {
1541             if (water_damage(targobj, 0, TRUE) != ER_NOTHING)
1542                 res = TRUE;
1543         }
1544     }
1545     if (func) {
1546         /* give feedback before altering the target object;
1547            this used to set obj->bknown even when not seeing
1548            the effect; now hero has to see the glow, and bknown
1549            is cleared instead of set if perception is distorted */
1550         if (useeit) {
1551             glowcolor = hcolor(glowcolor);
1552             if (altfmt)
1553                 pline("%s with %s aura.", objphrase, an(glowcolor));
1554             else
1555                 pline("%s %s.", objphrase, glowcolor);
1556             iflags.last_msg = PLNMSG_OBJ_GLOWS;
1557             targobj->bknown = !Hallucination;
1558         }
1559         /* potions of water are the only shop goods whose price depends
1560            on their curse/bless state */
1561         if (targobj->unpaid && targobj->otyp == POT_WATER) {
1562             if (costchange == COST_alter)
1563                 /* added blessing or cursing; update shop
1564                    bill to reflect item's new higher price */
1565                 alter_cost(targobj, 0L);
1566             else if (costchange != COST_none)
1567                 /* removed blessing or cursing; you
1568                    degraded it, now you'll have to buy it... */
1569                 costly_alteration(targobj, costchange);
1570         }
1571         /* finally, change curse/bless state */
1572         (*func)(targobj);
1573         res = TRUE;
1574     }
1575     return res;
1576 }
1577
1578 void
1579 potionhit(mon, obj, your_fault)
1580 register struct monst *mon;
1581 register struct obj *obj;
1582 boolean your_fault;
1583 {
1584     const char *botlnam = bottlename();
1585     boolean isyou = (mon == &youmonst);
1586     int distance;
1587     struct obj *saddle = (struct obj *) 0;
1588     boolean hit_saddle = FALSE;
1589
1590     if (isyou) {
1591         distance = 0;
1592 #if 0 /*JP*/
1593         pline_The("%s crashes on your %s and breaks into shards.", botlnam,
1594                   body_part(HEAD));
1595 #else
1596         pline("%s\82ª\82 \82È\82½\82Ì%s\82Ì\8fã\82Å\89ó\82ê\94j\95Ð\82Æ\82È\82Á\82½\81D", botlnam,
1597               body_part(HEAD));
1598 #endif
1599 /*JP
1600         losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN);
1601 */
1602         losehp(Maybe_Half_Phys(rnd(2)), "\93\8a\82°\82ç\82ê\82½\96ò\82Å", KILLED_BY_AN);
1603     } else {
1604         /* sometimes it hits the saddle */
1605         if (((mon->misc_worn_check & W_SADDLE)
1606              && (saddle = which_armor(mon, W_SADDLE)))
1607             && (!rn2(10)
1608                 || (obj->otyp == POT_WATER
1609                     && ((rnl(10) > 7 && obj->cursed)
1610                         || (rnl(10) < 4 && obj->blessed) || !rn2(3)))))
1611             hit_saddle = TRUE;
1612         distance = distu(mon->mx, mon->my);
1613         if (!cansee(mon->mx, mon->my))
1614 /*JP
1615             pline("Crash!");
1616 */
1617             pline("\83K\83V\83\83\83\93\81I");
1618         else {
1619             char *mnam = mon_nam(mon);
1620             char buf[BUFSZ];
1621
1622             if (hit_saddle && saddle) {
1623 /*JP
1624                 Sprintf(buf, "%s saddle",
1625 */
1626                 Sprintf(buf, "%s\82Ì\88Æ",
1627                         s_suffix(x_monnam(mon, ARTICLE_THE, (char *) 0,
1628                                           (SUPPRESS_IT | SUPPRESS_SADDLE),
1629                                           FALSE)));
1630             } else if (has_head(mon->data)) {
1631 #if 0 /*JP*/
1632                 Sprintf(buf, "%s %s", s_suffix(mnam),
1633                         (notonhead ? "body" : "head"));
1634 #else
1635                 Sprintf(buf, "%s\82Ì%s", s_suffix(mnam),
1636                         (notonhead ? "\91Ì" : "\93ª"));
1637 #endif
1638             } else {
1639                 Strcpy(buf, mnam);
1640             }
1641 #if 0 /*JP*/
1642             pline_The("%s crashes on %s and breaks into shards.", botlnam,
1643                       buf);
1644 #else
1645             pline("%s\82ª%s\82Ì\8fã\82Å\89ó\82ê\94j\95Ð\82Æ\82È\82Á\82½\81D", botlnam,
1646                       buf);
1647 #endif
1648         }
1649         if (rn2(5) && mon->mhp > 1 && !hit_saddle)
1650             mon->mhp--;
1651     }
1652
1653     /* oil doesn't instantly evaporate; Neither does a saddle hit */
1654     if (obj->otyp != POT_OIL && !hit_saddle && cansee(mon->mx, mon->my))
1655 /*JP
1656         pline("%s.", Tobjnam(obj, "evaporate"));
1657 */
1658         pline("%s\82Í\8fö\94­\82µ\82½\81D", xname(obj));
1659
1660     if (isyou) {
1661         switch (obj->otyp) {
1662         case POT_OIL:
1663             if (obj->lamplit)
1664                 explode_oil(obj, u.ux, u.uy);
1665             break;
1666         case POT_POLYMORPH:
1667 /*JP
1668             You_feel("a little %s.", Hallucination ? "normal" : "strange");
1669 */
1670             You("%s\82È\8a´\82\82ª\82µ\82½\81D", Hallucination ? "\95\81\92Ê" : "\95Ï");
1671             if (!Unchanging && !Antimagic)
1672                 polyself(0);
1673             break;
1674         case POT_ACID:
1675             if (!Acid_resistance) {
1676                 int dmg;
1677 #if 0 /*JP*/
1678                 pline("This burns%s!",
1679                       obj->blessed ? " a little"
1680                                    : obj->cursed ? " a lot" : "");
1681 #else
1682                 pline("%s\94R\82¦\82½\81I",
1683                       obj->blessed ? "\8f­\82µ"
1684                                    : obj->cursed ? "\82Í\82°\82µ\82­" : "");
1685 #endif
1686                 dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1687 /*JP
1688                 losehp(Maybe_Half_Phys(dmg), "potion of acid", KILLED_BY_AN);
1689 */
1690                 losehp(Maybe_Half_Phys(dmg), "\8e_\82Ì\96ò\82ð\97\81\82Ñ\82Ä", KILLED_BY_AN);
1691             }
1692             break;
1693         }
1694     } else if (hit_saddle && saddle) {
1695         char *mnam, buf[BUFSZ], saddle_glows[BUFSZ];
1696         boolean affected = FALSE;
1697         boolean useeit = !Blind && canseemon(mon) && cansee(mon->mx, mon->my);
1698
1699         mnam = x_monnam(mon, ARTICLE_THE, (char *) 0,
1700                         (SUPPRESS_IT | SUPPRESS_SADDLE), FALSE);
1701         Sprintf(buf, "%s", upstart(s_suffix(mnam)));
1702
1703         switch (obj->otyp) {
1704         case POT_WATER:
1705             Sprintf(saddle_glows, "%s %s", buf, aobjnam(saddle, "glow"));
1706             affected = H2Opotion_dip(obj, saddle, useeit, saddle_glows);
1707             break;
1708         case POT_POLYMORPH:
1709             /* Do we allow the saddle to polymorph? */
1710             break;
1711         }
1712         if (useeit && !affected)
1713             pline("%s %s wet.", buf, aobjnam(saddle, "get"));
1714     } else {
1715         boolean angermon = TRUE;
1716
1717         if (!your_fault)
1718             angermon = FALSE;
1719         switch (obj->otyp) {
1720         case POT_HEALING:
1721         case POT_EXTRA_HEALING:
1722         case POT_FULL_HEALING:
1723             if (mon->data == &mons[PM_PESTILENCE])
1724                 goto do_illness;
1725         /*FALLTHRU*/
1726         case POT_RESTORE_ABILITY:
1727         case POT_GAIN_ABILITY:
1728         do_healing:
1729             angermon = FALSE;
1730             if (mon->mhp < mon->mhpmax) {
1731                 mon->mhp = mon->mhpmax;
1732                 if (canseemon(mon))
1733 /*JP
1734                     pline("%s looks sound and hale again.", Monnam(mon));
1735 */
1736                     pline("%s\82Í\8c³\8bC\82É\82È\82Á\82½\82æ\82¤\82É\8c©\82¦\82é\81D", Monnam(mon));
1737             }
1738             break;
1739         case POT_SICKNESS:
1740             if (mon->data == &mons[PM_PESTILENCE])
1741                 goto do_healing;
1742             if (dmgtype(mon->data, AD_DISE)
1743                 /* won't happen, see prior goto */
1744                 || dmgtype(mon->data, AD_PEST)
1745                 /* most common case */
1746                 || resists_poison(mon)) {
1747                 if (canseemon(mon))
1748 #if 0 /*JP*/
1749                     pline("%s looks unharmed.", Monnam(mon));
1750 #else
1751                     pline("%s\82Í\82È\82ñ\82Æ\82à\82È\82¢\82æ\82¤\82¾\81D", Monnam(mon));
1752 #endif
1753                 break;
1754             }
1755         do_illness:
1756             if ((mon->mhpmax > 3) && !resist(mon, POTION_CLASS, 0, NOTELL))
1757                 mon->mhpmax /= 2;
1758             if ((mon->mhp > 2) && !resist(mon, POTION_CLASS, 0, NOTELL))
1759                 mon->mhp /= 2;
1760             if (mon->mhp > mon->mhpmax)
1761                 mon->mhp = mon->mhpmax;
1762             if (canseemon(mon))
1763 /*JP
1764                 pline("%s looks rather ill.", Monnam(mon));
1765 */
1766                 pline("%s\82Í\95a\8bC\82Á\82Û\82­\8c©\82¦\82é\81D", Monnam(mon));
1767             break;
1768         case POT_CONFUSION:
1769         case POT_BOOZE:
1770             if (!resist(mon, POTION_CLASS, 0, NOTELL))
1771                 mon->mconf = TRUE;
1772             break;
1773         case POT_INVISIBILITY:
1774             angermon = FALSE;
1775             mon_set_minvis(mon);
1776             break;
1777         case POT_SLEEPING:
1778             /* wakeup() doesn't rouse victims of temporary sleep */
1779             if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
1780 /*JP
1781                 pline("%s falls asleep.", Monnam(mon));
1782 */
1783                 pline("%s\82Í\96°\82Á\82Ä\82µ\82Ü\82Á\82½\81D", Monnam(mon));
1784                 slept_monst(mon);
1785             }
1786             break;
1787         case POT_PARALYSIS:
1788             if (mon->mcanmove) {
1789                 /* really should be rnd(5) for consistency with players
1790                  * breathing potions, but...
1791                  */
1792                 paralyze_monst(mon, rnd(25));
1793             }
1794             break;
1795         case POT_SPEED:
1796             angermon = FALSE;
1797             mon_adjust_speed(mon, 1, obj);
1798             break;
1799         case POT_BLINDNESS:
1800             if (haseyes(mon->data)) {
1801                 register int btmp = 64 + rn2(32)
1802                             + rn2(32) * !resist(mon, POTION_CLASS, 0, NOTELL);
1803
1804                 btmp += mon->mblinded;
1805                 mon->mblinded = min(btmp, 127);
1806                 mon->mcansee = 0;
1807             }
1808             break;
1809         case POT_WATER:
1810             if (is_undead(mon->data) || is_demon(mon->data)
1811                 || is_were(mon->data) || is_vampshifter(mon)) {
1812                 if (obj->blessed) {
1813 #if 0 /*JP*/
1814                     pline("%s %s in pain!", Monnam(mon),
1815                           is_silent(mon->data) ? "writhes" : "shrieks");
1816 #else
1817                     pline("%s\82Í\8bê\92É%s\81I", Monnam(mon),
1818                           is_silent(mon->data) ? "\82É\90g\82à\82¾\82¦\82µ\82½" : "\82Ì\8b©\82Ñ\90º\82ð\82 \82°\82½");
1819 #endif
1820                     if (!is_silent(mon->data))
1821                         wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1822                     mon->mhp -= d(2, 6);
1823                     /* should only be by you */
1824                     if (mon->mhp < 1)
1825                         killed(mon);
1826                     else if (is_were(mon->data) && !is_human(mon->data))
1827                         new_were(mon); /* revert to human */
1828                 } else if (obj->cursed) {
1829                     angermon = FALSE;
1830                     if (canseemon(mon))
1831 /*JP
1832                         pline("%s looks healthier.", Monnam(mon));
1833 */
1834                         pline("%s\82Í\82æ\82è\8c³\8bC\82É\82È\82Á\82½\82æ\82¤\82É\8c©\82¦\82é\81D", Monnam(mon));
1835                     mon->mhp += d(2, 6);
1836                     if (mon->mhp > mon->mhpmax)
1837                         mon->mhp = mon->mhpmax;
1838                     if (is_were(mon->data) && is_human(mon->data)
1839                         && !Protection_from_shape_changers)
1840                         new_were(mon); /* transform into beast */
1841                 }
1842             } else if (mon->data == &mons[PM_GREMLIN]) {
1843                 angermon = FALSE;
1844                 (void) split_mon(mon, (struct monst *) 0);
1845             } else if (mon->data == &mons[PM_IRON_GOLEM]) {
1846                 if (canseemon(mon))
1847 /*JP
1848                     pline("%s rusts.", Monnam(mon));
1849 */
1850                     pline("%s\82Í\8eK\82Ñ\82½\81D", Monnam(mon));
1851                 mon->mhp -= d(1, 6);
1852                 /* should only be by you */
1853                 if (mon->mhp < 1)
1854                     killed(mon);
1855             }
1856             break;
1857         case POT_OIL:
1858             if (obj->lamplit)
1859                 explode_oil(obj, mon->mx, mon->my);
1860             break;
1861         case POT_ACID:
1862             if (!resists_acid(mon) && !resist(mon, POTION_CLASS, 0, NOTELL)) {
1863 #if 0 /*JP*/
1864                 pline("%s %s in pain!", Monnam(mon),
1865                       is_silent(mon->data) ? "writhes" : "shrieks");
1866 #else
1867                 pline("%s\82Í\8bê\92É%s\81I", Monnam(mon),
1868                       is_silent(mon->data) ? "\82É\90g\82à\82¾\82¦\82µ\82½" : "\82Ì\8b©\82Ñ\90º\82ð\82 \82°\82½");
1869 #endif
1870                 if (!is_silent(mon->data))
1871                     wake_nearto(mon->mx, mon->my, mon->data->mlevel * 10);
1872                 mon->mhp -= d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
1873                 if (mon->mhp < 1) {
1874                     if (your_fault)
1875                         killed(mon);
1876                     else
1877                         monkilled(mon, "", AD_ACID);
1878                 }
1879             }
1880             break;
1881         case POT_POLYMORPH:
1882             (void) bhitm(mon, obj);
1883             break;
1884         /*
1885         case POT_GAIN_LEVEL:
1886         case POT_LEVITATION:
1887         case POT_FRUIT_JUICE:
1888         case POT_MONSTER_DETECTION:
1889         case POT_OBJECT_DETECTION:
1890             break;
1891         */
1892         }
1893         if (angermon)
1894             wakeup(mon);
1895         else
1896             mon->msleeping = 0;
1897     }
1898
1899     /* Note: potionbreathe() does its own docall() */
1900     if ((distance == 0 || ((distance < 3) && rn2(5)))
1901         && (!breathless(youmonst.data) || haseyes(youmonst.data)))
1902         potionbreathe(obj);
1903     else if (obj->dknown && !objects[obj->otyp].oc_name_known
1904              && !objects[obj->otyp].oc_uname && cansee(mon->mx, mon->my))
1905         docall(obj);
1906     if (*u.ushops && obj->unpaid) {
1907         struct monst *shkp = shop_keeper(*in_rooms(u.ux, u.uy, SHOPBASE));
1908
1909         if (shkp)
1910             (void) stolen_value(obj, u.ux, u.uy, (boolean) shkp->mpeaceful,
1911                                 FALSE);
1912         else
1913             obj->unpaid = 0;
1914     }
1915     obfree(obj, (struct obj *) 0);
1916 }
1917
1918 /* vapors are inhaled or get in your eyes */
1919 void
1920 potionbreathe(obj)
1921 register struct obj *obj;
1922 {
1923     register int i, ii, isdone, kn = 0;
1924
1925     switch (obj->otyp) {
1926     case POT_RESTORE_ABILITY:
1927     case POT_GAIN_ABILITY:
1928         if (obj->cursed) {
1929             if (!breathless(youmonst.data))
1930 /*JP
1931                 pline("Ulch!  That potion smells terrible!");
1932 */
1933                 pline("\83E\83Q\83F\81I\96ò\82Í\82à\82Ì\82·\82²\82¢\93õ\82¢\82ª\82·\82é\81I");
1934             else if (haseyes(youmonst.data)) {
1935 #if 0 /*JP*/
1936                 const char *eyes = body_part(EYE);
1937
1938                 if (eyecount(youmonst.data) != 1)
1939                     eyes = makeplural(eyes);
1940                 Your("%s %s!", eyes, vtense(eyes, "sting"));
1941 #else
1942                 Your("%s\82ª\82¸\82«\82¸\82«\82·\82é\81I", body_part(EYE));
1943 #endif
1944             }
1945             break;
1946         } else {
1947             i = rn2(A_MAX); /* start at a random point */
1948             for (isdone = ii = 0; !isdone && ii < A_MAX; ii++) {
1949                 if (ABASE(i) < AMAX(i)) {
1950                     ABASE(i)++;
1951                     /* only first found if not blessed */
1952                     isdone = !(obj->blessed);
1953                     context.botl = 1;
1954                 }
1955                 if (++i >= A_MAX)
1956                     i = 0;
1957             }
1958         }
1959         break;
1960     case POT_FULL_HEALING:
1961         if (Upolyd && u.mh < u.mhmax)
1962             u.mh++, context.botl = 1;
1963         if (u.uhp < u.uhpmax)
1964             u.uhp++, context.botl = 1;
1965         /*FALLTHRU*/
1966     case POT_EXTRA_HEALING:
1967         if (Upolyd && u.mh < u.mhmax)
1968             u.mh++, context.botl = 1;
1969         if (u.uhp < u.uhpmax)
1970             u.uhp++, context.botl = 1;
1971         /*FALLTHRU*/
1972     case POT_HEALING:
1973         if (Upolyd && u.mh < u.mhmax)
1974             u.mh++, context.botl = 1;
1975         if (u.uhp < u.uhpmax)
1976             u.uhp++, context.botl = 1;
1977         exercise(A_CON, TRUE);
1978         break;
1979     case POT_SICKNESS:
1980         if (!Role_if(PM_HEALER)) {
1981             if (Upolyd) {
1982                 if (u.mh <= 5)
1983                     u.mh = 1;
1984                 else
1985                     u.mh -= 5;
1986             } else {
1987                 if (u.uhp <= 5)
1988                     u.uhp = 1;
1989                 else
1990                     u.uhp -= 5;
1991             }
1992             context.botl = 1;
1993             exercise(A_CON, FALSE);
1994         }
1995         break;
1996     case POT_HALLUCINATION:
1997 /*JP
1998         You("have a momentary vision.");
1999 */
2000         You("\88ê\8fu\8c\89e\82É\82Â\82Â\82Ü\82ê\82½\81D");
2001         break;
2002     case POT_CONFUSION:
2003     case POT_BOOZE:
2004         if (!Confusion)
2005 /*JP
2006             You_feel("somewhat dizzy.");
2007 */
2008             You("\82ß\82Ü\82¢\82ð\8a´\82\82½\81D");
2009         make_confused(itimeout_incr(HConfusion, rnd(5)), FALSE);
2010         break;
2011     case POT_INVISIBILITY:
2012         if (!Blind && !Invis) {
2013             kn++;
2014 #if 0 /*JP*/
2015             pline("For an instant you %s!",
2016                   See_invisible ? "could see right through yourself"
2017                                 : "couldn't see yourself");
2018 #else
2019             pline("\88ê\8fu\8e©\95ª\8e©\90g\82ª%s\8c©\82¦\82È\82­\82È\82Á\82½\81I",
2020                   See_invisible ? "\90³\82µ\82­"
2021                                 : "");
2022 #endif
2023         }
2024         break;
2025     case POT_PARALYSIS:
2026         kn++;
2027         if (!Free_action) {
2028 /*JP
2029             pline("%s seems to be holding you.", Something);
2030 */
2031             pline("%s\82ª\82 \82È\82½\82ð\82Â\82©\82Ü\82¦\82Ä\82¢\82é\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", Something);
2032             nomul(-rnd(5));
2033             multi_reason = "frozen by a potion";
2034             nomovemsg = You_can_move_again;
2035             exercise(A_DEX, FALSE);
2036         } else
2037 /*JP
2038             You("stiffen momentarily.");
2039 */
2040             You("\88ê\8fu\8dd\92¼\82µ\82½\81D");
2041         break;
2042     case POT_SLEEPING:
2043         kn++;
2044         if (!Free_action && !Sleep_resistance) {
2045 /*JP
2046             You_feel("rather tired.");
2047 */
2048             You("\82·\82±\82µ\94æ\82ê\82½\81D");
2049             nomul(-rnd(5));
2050             multi_reason = "sleeping off a magical draught";
2051             nomovemsg = You_can_move_again;
2052             exercise(A_DEX, FALSE);
2053         } else
2054 /*JP
2055             You("yawn.");
2056 */
2057             You("\82 \82­\82Ñ\82ð\82µ\82½\81D");
2058         break;
2059     case POT_SPEED:
2060         if (!Fast)
2061 /*JP
2062             Your("knees seem more flexible now.");
2063 */
2064             Your("\95G\82Í\82æ\82è\82·\82Î\82â\82­\93®\82­\82æ\82¤\82É\82È\82Á\82½\81D");
2065         incr_itimeout(&HFast, rnd(5));
2066         exercise(A_DEX, TRUE);
2067         break;
2068     case POT_BLINDNESS:
2069         if (!Blind && !Unaware) {
2070             kn++;
2071 /*JP
2072             pline("It suddenly gets dark.");
2073 */
2074             pline("\93Ë\91R\88Ã\82­\82È\82Á\82½\81D");
2075         }
2076         make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
2077         if (!Blind && !Unaware)
2078             Your1(vision_clears);
2079         break;
2080     case POT_WATER:
2081         if (u.umonnum == PM_GREMLIN) {
2082             (void) split_mon(&youmonst, (struct monst *) 0);
2083         } else if (u.ulycn >= LOW_PM) {
2084             /* vapor from [un]holy water will trigger
2085                transformation but won't cure lycanthropy */
2086             if (obj->blessed && youmonst.data == &mons[u.ulycn])
2087                 you_unwere(FALSE);
2088             else if (obj->cursed && !Upolyd)
2089                 you_were();
2090         }
2091         break;
2092     case POT_ACID:
2093     case POT_POLYMORPH:
2094         exercise(A_CON, FALSE);
2095         break;
2096     /*
2097     case POT_GAIN_LEVEL:
2098     case POT_LEVITATION:
2099     case POT_FRUIT_JUICE:
2100     case POT_MONSTER_DETECTION:
2101     case POT_OBJECT_DETECTION:
2102     case POT_OIL:
2103         break;
2104      */
2105     }
2106     /* note: no obfree() */
2107     if (obj->dknown) {
2108         if (kn)
2109             makeknown(obj->otyp);
2110         else if (!objects[obj->otyp].oc_name_known
2111                  && !objects[obj->otyp].oc_uname)
2112             docall(obj);
2113     }
2114 }
2115
2116 /* returns the potion type when o1 is dipped in o2 */
2117 STATIC_OVL short
2118 mixtype(o1, o2)
2119 register struct obj *o1, *o2;
2120 {
2121     /* cut down on the number of cases below */
2122     if (o1->oclass == POTION_CLASS
2123         && (o2->otyp == POT_GAIN_LEVEL || o2->otyp == POT_GAIN_ENERGY
2124             || o2->otyp == POT_HEALING || o2->otyp == POT_EXTRA_HEALING
2125             || o2->otyp == POT_FULL_HEALING || o2->otyp == POT_ENLIGHTENMENT
2126             || o2->otyp == POT_FRUIT_JUICE)) {
2127         struct obj *swp;
2128
2129         swp = o1;
2130         o1 = o2;
2131         o2 = swp;
2132     }
2133
2134     switch (o1->otyp) {
2135     case POT_HEALING:
2136         switch (o2->otyp) {
2137         case POT_SPEED:
2138         case POT_GAIN_LEVEL:
2139         case POT_GAIN_ENERGY:
2140             return POT_EXTRA_HEALING;
2141         }
2142     case POT_EXTRA_HEALING:
2143         switch (o2->otyp) {
2144         case POT_GAIN_LEVEL:
2145         case POT_GAIN_ENERGY:
2146             return POT_FULL_HEALING;
2147         }
2148     case POT_FULL_HEALING:
2149         switch (o2->otyp) {
2150         case POT_GAIN_LEVEL:
2151         case POT_GAIN_ENERGY:
2152             return POT_GAIN_ABILITY;
2153         }
2154     case UNICORN_HORN:
2155         switch (o2->otyp) {
2156         case POT_SICKNESS:
2157             return POT_FRUIT_JUICE;
2158         case POT_HALLUCINATION:
2159         case POT_BLINDNESS:
2160         case POT_CONFUSION:
2161             return POT_WATER;
2162         }
2163         break;
2164     case AMETHYST: /* "a-methyst" == "not intoxicated" */
2165         if (o2->otyp == POT_BOOZE)
2166             return POT_FRUIT_JUICE;
2167         break;
2168     case POT_GAIN_LEVEL:
2169     case POT_GAIN_ENERGY:
2170         switch (o2->otyp) {
2171         case POT_CONFUSION:
2172             return (rn2(3) ? POT_BOOZE : POT_ENLIGHTENMENT);
2173         case POT_HEALING:
2174             return POT_EXTRA_HEALING;
2175         case POT_EXTRA_HEALING:
2176             return POT_FULL_HEALING;
2177         case POT_FULL_HEALING:
2178             return POT_GAIN_ABILITY;
2179         case POT_FRUIT_JUICE:
2180             return POT_SEE_INVISIBLE;
2181         case POT_BOOZE:
2182             return POT_HALLUCINATION;
2183         }
2184         break;
2185     case POT_FRUIT_JUICE:
2186         switch (o2->otyp) {
2187         case POT_SICKNESS:
2188             return POT_SICKNESS;
2189         case POT_SPEED:
2190             return POT_BOOZE;
2191         case POT_GAIN_LEVEL:
2192         case POT_GAIN_ENERGY:
2193             return POT_SEE_INVISIBLE;
2194         }
2195         break;
2196     case POT_ENLIGHTENMENT:
2197         switch (o2->otyp) {
2198         case POT_LEVITATION:
2199             if (rn2(3))
2200                 return POT_GAIN_LEVEL;
2201             break;
2202         case POT_FRUIT_JUICE:
2203             return POT_BOOZE;
2204         case POT_BOOZE:
2205             return POT_CONFUSION;
2206         }
2207         break;
2208     }
2209
2210     return 0;
2211 }
2212
2213 /* #dip command */
2214 int
2215 dodip()
2216 {
2217     register struct obj *potion, *obj;
2218     struct obj *singlepotion;
2219     uchar here;
2220     char allowall[2];
2221     short mixture;
2222     char qbuf[QBUFSZ], qtoo[QBUFSZ];
2223
2224     allowall[0] = ALL_CLASSES;
2225     allowall[1] = '\0';
2226     if (!(obj = getobj(allowall, "dip")))
2227         return 0;
2228 /*JP
2229     if (inaccessible_equipment(obj, "dip", FALSE))
2230 */
2231     if (inaccessible_equipment(obj, "\82ð\90Z\82·", FALSE))
2232         return 0;
2233
2234 #if 0 /*JP*/
2235     Sprintf(qbuf, "dip %s into", thesimpleoname(obj));
2236 #else
2237     Sprintf(qbuf, "%s\82ð\90Z\82µ\82Ü\82·\82©", thesimpleoname(obj));
2238 #endif
2239     here = levl[u.ux][u.uy].typ;
2240     /* Is there a fountain to dip into here? */
2241     if (IS_FOUNTAIN(here)) {
2242         /* "Dip <the object> into the fountain?" */
2243 #if 0 /*JP*/
2244         Sprintf(qtoo, "%s the fountain?", qbuf);
2245 #else
2246         Sprintf(qtoo, "\90ò\82É%s\81H", qbuf);
2247 #endif
2248         if (yn(upstart(qtoo)) == 'y') {
2249             dipfountain(obj);
2250             return 1;
2251         }
2252     } else if (is_pool(u.ux, u.uy)) {
2253         const char *pooltype = waterbody_name(u.ux, u.uy);
2254
2255         /* "Dip <the object> into the {pool, moat, &c}?" */
2256 #if 0 /*JP*/
2257         Sprintf(qtoo, "%s the %s?", qbuf, pooltype);
2258 #else
2259         Sprintf(qtoo, "%s\82É%s\81H", pooltype, qbuf);
2260 #endif
2261         if (yn(upstart(qtoo)) == 'y') {
2262             if (Levitation) {
2263                 floating_above(pooltype);
2264             } else if (u.usteed && !is_swimmer(u.usteed->data)
2265                        && P_SKILL(P_RIDING) < P_BASIC) {
2266                 rider_cant_reach(); /* not skilled enough to reach */
2267             } else {
2268                 if (obj->otyp == POT_ACID)
2269                     obj->in_use = 1;
2270                 if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use)
2271                     useup(obj);
2272             }
2273             return 1;
2274         }
2275     }
2276
2277     /* "What do you want to dip <the object> into?" */
2278     potion = getobj(beverages, qbuf); /* "dip into" */
2279     if (!potion)
2280         return 0;
2281     if (potion == obj && potion->quan == 1L) {
2282 /*JP
2283         pline("That is a potion bottle, not a Klein bottle!");
2284 */
2285         pline("\82±\82ê\82Í\96ò\95r\82¾\81I\83N\83\89\83C\83\93\82Ì\92Ù\82\82á\82È\82¢\81I");
2286         return 0;
2287     }
2288     potion->in_use = TRUE; /* assume it will be used up */
2289     if (potion->otyp == POT_WATER) {
2290         boolean useeit = !Blind || (obj == ublindf && Blindfolded_only);
2291         const char *obj_glows = Yobjnam2(obj, "glow");
2292
2293         if (H2Opotion_dip(potion, obj, useeit, obj_glows))
2294             goto poof;
2295     } else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
2296         /* some objects can't be polymorphed */
2297         if (obj->otyp == potion->otyp /* both POT_POLY */
2298             || obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
2299             || obj == uball || obj == uskin
2300             || obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
2301                            5, 95)) {
2302             pline1(nothing_happens);
2303         } else {
2304             boolean was_wep, was_swapwep, was_quiver;
2305             short save_otyp = obj->otyp;
2306
2307             /* KMH, conduct */
2308             u.uconduct.polypiles++;
2309
2310             was_wep = (obj == uwep);
2311             was_swapwep = (obj == uswapwep);
2312             was_quiver = (obj == uquiver);
2313
2314             obj = poly_obj(obj, STRANGE_OBJECT);
2315
2316             if (was_wep)
2317                 setuwep(obj);
2318             else if (was_swapwep)
2319                 setuswapwep(obj);
2320             else if (was_quiver)
2321                 setuqwep(obj);
2322
2323             if (obj->otyp != save_otyp) {
2324                 makeknown(POT_POLYMORPH);
2325                 useup(potion);
2326                 prinv((char *) 0, obj, 0L);
2327                 return 1;
2328             } else {
2329 /*JP
2330                 pline("Nothing seems to happen.");
2331 */
2332                 pline("\89½\82à\8bN\82±\82ç\82È\82©\82Á\82½\82æ\82¤\82¾\81D");
2333                 goto poof;
2334             }
2335         }
2336         potion->in_use = FALSE; /* didn't go poof */
2337         return 1;
2338     } else if (obj->oclass == POTION_CLASS && obj->otyp != potion->otyp) {
2339         long amt = obj->quan;
2340
2341 #if 0 /*JP*/
2342         Strcpy(qbuf, "The");
2343 #else
2344         Strcpy(qbuf, "");
2345 #endif
2346         if (amt > (objects[potion->otyp].oc_magic ? 2L : 9L)) {
2347             /* trying to dip multiple potions will usually affect only a
2348                subset; pick an amount between 2 and min(N,9), inclusive */
2349             amt -= 1L;
2350             do {
2351                 amt = (long) rnd((int) amt);
2352             } while (amt >= 9L);
2353             amt += 1L;
2354             if (amt < obj->quan) {
2355                 obj = splitobj(obj, amt);
2356 #if 0 /*JP*/
2357                 Sprintf(qbuf, "%ld of the", obj->quan);
2358 #else
2359                 Sprintf(qbuf, "%ld\96{\82Ì", obj->quan);
2360 #endif
2361             }
2362         }
2363         /* [N of] the {obj(s)} mix(es) with [one of] {the potion}... */
2364 #if 0 /*JP*/
2365         pline("%s %s %s with %s%s...", qbuf, simpleonames(obj),
2366               otense(obj, "mix"), (potion->quan > 1L) ? "one of " : "",
2367               thesimpleoname(potion));
2368 #else /* [N\96{\82Ì]{obj}\82ð{the potion}[\82Ì\88ê\82Â]\82Æ\8d¬\82º\82½\81D\81D\81D */
2369         pline("%s%s\82ð%s%s\82Æ\8d¬\82º\82½\81D\81D\81D", qbuf, simpleonames(obj),
2370               thesimpleoname(potion),
2371               (potion->quan > 1L) ? "\82Ì\88ê\82Â" : "");
2372 #endif
2373         /* Mixing potions is dangerous...
2374            KMH, balance patch -- acid is particularly unstable */
2375         if (obj->cursed || obj->otyp == POT_ACID || !rn2(10)) {
2376             /* it would be better to use up the whole stack in advance
2377                of the message, but we can't because we need to keep it
2378                around for potionbreathe() [and we can't set obj->in_use
2379                to 'amt' because that's not implemented] */
2380             obj->in_use = 1;
2381 /*JP
2382             pline("BOOM!  They explode!");
2383 */
2384             pline("\83o\81[\83\93\81I\94\9a\94­\82µ\82½\81I");
2385             wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
2386             exercise(A_STR, FALSE);
2387             if (!breathless(youmonst.data) || haseyes(youmonst.data))
2388                 potionbreathe(obj);
2389             useupall(obj);
2390             useup(potion);
2391             losehp((int) (amt + rnd(9)), /* not physical damage */
2392 /*JP
2393                    "alchemic blast", KILLED_BY_AN);
2394 */
2395                    "\92²\8d\87\82Ì\8e¸\94s\82Å", KILLED_BY_AN);
2396             return 1;
2397         }
2398
2399         obj->blessed = obj->cursed = obj->bknown = 0;
2400         if (Blind || Hallucination)
2401             obj->dknown = 0;
2402
2403         if ((mixture = mixtype(obj, potion)) != 0) {
2404             obj->otyp = mixture;
2405         } else {
2406             switch (obj->odiluted ? 1 : rnd(8)) {
2407             case 1:
2408                 obj->otyp = POT_WATER;
2409                 break;
2410             case 2:
2411             case 3:
2412                 obj->otyp = POT_SICKNESS;
2413                 break;
2414             case 4: {
2415                 struct obj *otmp = mkobj(POTION_CLASS, FALSE);
2416
2417                 obj->otyp = otmp->otyp;
2418                 obfree(otmp, (struct obj *) 0);
2419                 break;
2420             }
2421             default:
2422                 useupall(obj);
2423                 useup(potion);
2424                 if (!Blind)
2425 /*JP
2426                     pline_The("mixture glows brightly and evaporates.");
2427 */
2428                     pline("\8d¬\82º\82é\82Æ\96ò\82Í\96¾\82é\82­\8bP\82«\81C\8fö\94­\82µ\82½\81D");
2429                 return 1;
2430             }
2431         }
2432         obj->odiluted = (obj->otyp != POT_WATER);
2433
2434         if (obj->otyp == POT_WATER && !Hallucination) {
2435 /*JP
2436             pline_The("mixture bubbles%s.", Blind ? "" : ", then clears");
2437 */
2438             pline("\96ò\82ð\8d¬\82º\82é\82Æ%s\96A\82¾\82Á\82½\81D", Blind ? "" : "\82µ\82Î\82ç\82­");
2439         } else if (!Blind) {
2440 /*JP
2441             pline_The("mixture looks %s.",
2442 */
2443             pline("\8d¬\82º\82½\96ò\82Í%s\96ò\82É\8c©\82¦\82é\81D",
2444                       hcolor(OBJ_DESCR(objects[obj->otyp])));
2445         }
2446
2447         useup(potion);
2448         /* this is required when 'obj' was split off from a bigger stack,
2449            so that 'obj' will now be assigned its own inventory slot;
2450            it has a side-effect of merging 'obj' into another compatible
2451            stack if there is one, so we do it even when no split has
2452            been made in order to get the merge result for both cases;
2453            as a consequence, mixing while Fumbling drops the mixture */
2454         freeinv(obj);
2455         (void) hold_another_object(obj, "You drop %s!", doname(obj),
2456                                    (const char *) 0);
2457         return 1;
2458     }
2459
2460     if (potion->otyp == POT_ACID && obj->otyp == CORPSE
2461         && obj->corpsenm == PM_LICHEN && !Blind) {
2462         pline("%s %s %s around the edges.", The(cxname(obj)),
2463               otense(obj, "turn"),
2464               potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED));
2465         potion->in_use = FALSE; /* didn't go poof */
2466         return 1;
2467     }
2468
2469     if (potion->otyp == POT_WATER && obj->otyp == TOWEL) {
2470         pline_The("towel soaks it up!");
2471         /* wetting towel already done via water_damage() in H2Opotion_dip */
2472         goto poof;
2473     }
2474
2475     if (is_poisonable(obj)) {
2476         if (potion->otyp == POT_SICKNESS && !obj->opoisoned) {
2477             char buf[BUFSZ];
2478
2479             if (potion->quan > 1L)
2480 /*JP
2481                 Sprintf(buf, "One of %s", the(xname(potion)));
2482 */
2483                 Sprintf(buf, "%s\82Ì\88ê\82Â", the(xname(potion)));
2484             else
2485                 Strcpy(buf, The(xname(potion)));
2486 /*JP
2487             pline("%s forms a coating on %s.", buf, the(xname(obj)));
2488 */
2489             pline("%s\82ª%s\82É\93h\82ç\82ê\82½\81D", buf, the(xname(obj)));
2490             obj->opoisoned = TRUE;
2491             goto poof;
2492         } else if (obj->opoisoned && (potion->otyp == POT_HEALING
2493                                       || potion->otyp == POT_EXTRA_HEALING
2494                                       || potion->otyp == POT_FULL_HEALING)) {
2495 /*JP
2496             pline("A coating wears off %s.", the(xname(obj)));
2497 */
2498             pline("\93Å\82ª%s\82©\82ç\94\8d\82°\82¨\82¿\82½\81D", the(xname(obj)));
2499             obj->opoisoned = 0;
2500             goto poof;
2501         }
2502     }
2503
2504     if (potion->otyp == POT_ACID) {
2505         if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING)
2506             goto poof;
2507     }
2508
2509     if (potion->otyp == POT_OIL) {
2510         boolean wisx = FALSE;
2511
2512         if (potion->lamplit) { /* burning */
2513             fire_damage(obj, TRUE, u.ux, u.uy);
2514         } else if (potion->cursed) {
2515 /*JP
2516             pline_The("potion spills and covers your %s with oil.",
2517 */
2518             pline("\96û\82Í\94ò\82Ñ\8eU\82è\82 \82È\82½\82Ì%s\82É\82©\82©\82Á\82½\81D",
2519                       makeplural(body_part(FINGER)));
2520             incr_itimeout(&Glib, d(2, 10));
2521         } else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
2522             /* the following cases apply only to weapons */
2523             goto more_dips;
2524             /* Oil removes rust and corrosion, but doesn't unburn.
2525              * Arrows, etc are classed as metallic due to arrowhead
2526              * material, but dipping in oil shouldn't repair them.
2527              */
2528         } else if ((!is_rustprone(obj) && !is_corrodeable(obj))
2529                    || is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
2530             /* uses up potion, doesn't set obj->greased */
2531 #if 0 /*JP*/
2532             pline("%s %s with an oily sheen.", Yname2(obj),
2533                   otense(obj, "gleam"));
2534 #else
2535                 pline("%s\82Í\96û\82Ì\8cõ\91ò\82Å\82«\82ç\82è\82Æ\8cõ\82Á\82½\81D", Yname2(obj));
2536 #endif
2537         } else {
2538 #if 0 /*JP*/
2539             pline("%s %s less %s.", Yname2(obj), otense(obj, "are"),
2540                   (obj->oeroded && obj->oeroded2)
2541                       ? "corroded and rusty"
2542                       : obj->oeroded ? "rusty" : "corroded");
2543 #else
2544             pline("%s\82Ì%s\82ª\8eæ\82ê\82½\81D", Yname2(obj),
2545                   (obj->oeroded && obj->oeroded2)
2546                       ? "\95\85\90H\82Æ\8eK"
2547                       : obj->oeroded ? "\8eK" : "\95\85\90H");
2548 #endif
2549             if (obj->oeroded > 0)
2550                 obj->oeroded--;
2551             if (obj->oeroded2 > 0)
2552                 obj->oeroded2--;
2553             wisx = TRUE;
2554         }
2555         exercise(A_WIS, wisx);
2556         makeknown(potion->otyp);
2557         useup(potion);
2558         return 1;
2559     }
2560 more_dips:
2561
2562     /* Allow filling of MAGIC_LAMPs to prevent identification by player */
2563     if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP)
2564         && (potion->otyp == POT_OIL)) {
2565         /* Turn off engine before fueling, turn off fuel too :-)  */
2566         if (obj->lamplit || potion->lamplit) {
2567             useup(potion);
2568             explode(u.ux, u.uy, 11, d(6, 6), 0, EXPL_FIERY);
2569             exercise(A_WIS, FALSE);
2570             return 1;
2571         }
2572         /* Adding oil to an empty magic lamp renders it into an oil lamp */
2573         if ((obj->otyp == MAGIC_LAMP) && obj->spe == 0) {
2574             obj->otyp = OIL_LAMP;
2575             obj->age = 0;
2576         }
2577         if (obj->age > 1000L) {
2578 /*JP
2579             pline("%s %s full.", Yname2(obj), otense(obj, "are"));
2580 */
2581             pline("%s\82É\82Í\82½\82Á\82Õ\82è\93ü\82Á\82Ä\82¢\82é\81D", Yname2(obj));
2582             potion->in_use = FALSE; /* didn't go poof */
2583         } else {
2584 /*JP
2585             You("fill %s with oil.", yname(obj));
2586 */
2587             You("%s\82É\96û\82ð\93ü\82ê\82½\81D", yname(obj));
2588             check_unpaid(potion);        /* Yendorian Fuel Tax */
2589             obj->age += 2 * potion->age; /* burns more efficiently */
2590             if (obj->age > 1500L)
2591                 obj->age = 1500L;
2592             useup(potion);
2593             exercise(A_WIS, TRUE);
2594         }
2595         makeknown(POT_OIL);
2596         obj->spe = 1;
2597         update_inventory();
2598         return 1;
2599     }
2600
2601     potion->in_use = FALSE; /* didn't go poof */
2602     if ((obj->otyp == UNICORN_HORN || obj->otyp == AMETHYST)
2603         && (mixture = mixtype(obj, potion)) != 0) {
2604         char oldbuf[BUFSZ], newbuf[BUFSZ];
2605         short old_otyp = potion->otyp;
2606         boolean old_dknown = FALSE;
2607         boolean more_than_one = potion->quan > 1L;
2608
2609         oldbuf[0] = '\0';
2610         if (potion->dknown) {
2611             old_dknown = TRUE;
2612 /*JP
2613             Sprintf(oldbuf, "%s ", hcolor(OBJ_DESCR(objects[potion->otyp])));
2614 */
2615             Sprintf(oldbuf, "%s", hcolor(OBJ_DESCR(objects[potion->otyp])));
2616         }
2617         /* with multiple merged potions, split off one and
2618            just clear it */
2619         if (potion->quan > 1L) {
2620             singlepotion = splitobj(potion, 1L);
2621         } else
2622             singlepotion = potion;
2623
2624         costly_alteration(singlepotion, COST_NUTRLZ);
2625         singlepotion->otyp = mixture;
2626         singlepotion->blessed = 0;
2627         if (mixture == POT_WATER)
2628             singlepotion->cursed = singlepotion->odiluted = 0;
2629         else
2630             singlepotion->cursed = obj->cursed; /* odiluted left as-is */
2631         singlepotion->bknown = FALSE;
2632         if (Blind) {
2633             singlepotion->dknown = FALSE;
2634         } else {
2635             singlepotion->dknown = !Hallucination;
2636 #if 0 /*JP*/
2637             if (mixture == POT_WATER && singlepotion->dknown)
2638                 Sprintf(newbuf, "clears");
2639             else
2640                 Sprintf(newbuf, "turns %s",
2641                         hcolor(OBJ_DESCR(objects[mixture])));
2642             pline_The("%spotion%s %s.", oldbuf,
2643                       more_than_one ? " that you dipped into" : "", newbuf);
2644 #else
2645             if (mixture == POT_WATER && singlepotion->dknown)
2646                 Sprintf(newbuf, "\93§\96¾");
2647             else
2648                 Sprintf(newbuf, "%s\96ò",
2649                         hcolor(OBJ_DESCR(objects[mixture])));
2650             pline_The("%s%s\96ò\82Í%s\82É\82È\82Á\82½\81D.", more_than_one ? "\90Z\82µ\82½" : "",
2651                       oldbuf, newbuf);
2652 #endif
2653             if (!objects[old_otyp].oc_uname
2654                 && !objects[old_otyp].oc_name_known && old_dknown) {
2655                 struct obj fakeobj;
2656                 fakeobj = zeroobj;
2657                 fakeobj.dknown = 1;
2658                 fakeobj.otyp = old_otyp;
2659                 fakeobj.oclass = POTION_CLASS;
2660                 docall(&fakeobj);
2661             }
2662         }
2663         obj_extract_self(singlepotion);
2664         singlepotion =
2665 /*JP
2666             hold_another_object(singlepotion, "You juggle and drop %s!",
2667 */
2668             hold_another_object(singlepotion, "\82¨\8eè\8bÊ\82µ\82Ä%s\82ð\97\8e\82Æ\82µ\82Ä\82µ\82Ü\82Á\82½\81I",
2669                                 doname(singlepotion), (const char *) 0);
2670         update_inventory();
2671         return 1;
2672     }
2673
2674 /*JP
2675     pline("Interesting...");
2676 */
2677     pline("\96Ê\94\92\82¢\81D\81D\81D");
2678     return 1;
2679
2680 poof:
2681     if (!objects[potion->otyp].oc_name_known
2682         && !objects[potion->otyp].oc_uname)
2683         docall(potion);
2684     useup(potion);
2685     return 1;
2686 }
2687
2688 /* *monp grants a wish and then leaves the game */
2689 void
2690 mongrantswish(monp)
2691 struct monst **monp;
2692 {
2693     struct monst *mon = *monp;
2694     int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
2695
2696     /* remove the monster first in case wish proves to be fatal
2697        (blasted by artifact), to keep it out of resulting bones file */
2698     mongone(mon);
2699     *monp = 0; /* inform caller that monster is gone */
2700     /* hide that removal from player--map is visible during wish prompt */
2701     tmp_at(DISP_ALWAYS, glyph);
2702     tmp_at(mx, my);
2703     /* grant the wish */
2704     makewish();
2705     /* clean up */
2706     tmp_at(DISP_END, 0);
2707 }
2708
2709 void
2710 djinni_from_bottle(obj)
2711 struct obj *obj;
2712 {
2713     struct monst *mtmp;
2714     int chance;
2715
2716     if (!(mtmp = makemon(&mons[PM_DJINNI], u.ux, u.uy, NO_MM_FLAGS))) {
2717 #if 0 /*JP*/
2718         pline("It turns out to be empty.");
2719 #else
2720         if (obj->otyp == MAGIC_LAMP) {
2721             pline("\83\89\83\93\83v\82Í\8bó\82Á\82Û\82¾\82Á\82½\81D");
2722         } else {
2723             pline("\96ò\82Í\8bó\82Á\82Û\82¾\82Á\82½\81D");
2724         }
2725 #endif
2726         return;
2727     }
2728
2729     if (!Blind) {
2730 /*JP
2731         pline("In a cloud of smoke, %s emerges!", a_monnam(mtmp));
2732 */
2733         pline("\89\8c\82Ì\92\86\82©\82ç\81C%s\82ª\8c»\82í\82ê\82½\81I", a_monnam(mtmp));
2734 /*JP
2735         pline("%s speaks.", Monnam(mtmp));
2736 */
2737         pline("%s\82Í\98b\82µ\82©\82¯\82½\81D", Monnam(mtmp));
2738     } else {
2739 /*JP
2740         You("smell acrid fumes.");
2741 */
2742         You("\83c\83\93\82Æ\82·\82é\93õ\82¢\82ª\82µ\82½\81D");
2743 /*JP
2744         pline("%s speaks.", Something);
2745 */
2746         pline("%s\82ª\98b\82µ\82©\82¯\82½\81D", Something);
2747     }
2748
2749     chance = rn2(5);
2750     if (obj->blessed)
2751         chance = (chance == 4) ? rnd(4) : 0;
2752     else if (obj->cursed)
2753         chance = (chance == 0) ? rn2(4) : 4;
2754     /* 0,1,2,3,4:  b=80%,5,5,5,5; nc=20%,20,20,20,20; c=5%,5,5,5,80 */
2755
2756     switch (chance) {
2757     case 0:
2758 /*JP
2759         verbalize("I am in your debt.  I will grant one wish!");
2760 */
2761         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");
2762         /* give a wish and discard the monster (mtmp set to null) */
2763         mongrantswish(&mtmp);
2764         break;
2765     case 1:
2766 /*JP
2767         verbalize("Thank you for freeing me!");
2768 */
2769         verbalize("\8e\84\82ð\8f\95\82¯\82Ä\82­\82ê\82½\82±\82Æ\82ð\8a´\8eÓ\82·\82é\81I");
2770         (void) tamedog(mtmp, (struct obj *) 0);
2771         break;
2772     case 2:
2773 /*JP
2774         verbalize("You freed me!");
2775 */
2776         verbalize("\89ð\95ú\82µ\82Ä\82­\82ê\82½\82Ì\82Í\82¨\91O\82©\81I");
2777         mtmp->mpeaceful = TRUE;
2778         set_malign(mtmp);
2779         break;
2780     case 3:
2781 /*JP
2782         verbalize("It is about time!");
2783 */
2784         verbalize("\82³\82ç\82Î\82¾\81I");
2785         if (canspotmon(mtmp))
2786 /*JP
2787             pline("%s vanishes.", Monnam(mtmp));
2788 */
2789             pline("%s\82Í\8fÁ\82¦\82½\81D", Monnam(mtmp));
2790         mongone(mtmp);
2791         break;
2792     default:
2793 /*JP
2794         verbalize("You disturbed me, fool!");
2795 */
2796         verbalize("\82¨\82Ü\82¦\82Í\8e\84\82Ì\96°\82è\82ð\96W\82°\82½\81D\82¨\82ë\82©\82à\82Ì\82ß\81I");
2797         mtmp->mpeaceful = FALSE;
2798         set_malign(mtmp);
2799         break;
2800     }
2801 }
2802
2803 /* clone a gremlin or mold (2nd arg non-null implies heat as the trigger);
2804    hit points are cut in half (odd HP stays with original) */
2805 struct monst *
2806 split_mon(mon, mtmp)
2807 struct monst *mon,  /* monster being split */
2808              *mtmp; /* optional attacker whose heat triggered it */
2809 {
2810     struct monst *mtmp2;
2811     char reason[BUFSZ];
2812
2813     reason[0] = '\0';
2814     if (mtmp)
2815 #if 0 /*JP*/
2816         Sprintf(reason, " from %s heat",
2817                 (mtmp == &youmonst) ? the_your[1]
2818                                     : (const char *) s_suffix(mon_nam(mtmp)));
2819 #else
2820         Sprintf(reason, "%s\82Ì\94M\82Å",
2821                 (mtmp == &youmonst) ? the_your[1]
2822                                     : (const char *) s_suffix(mon_nam(mtmp)));
2823 #endif
2824
2825     if (mon == &youmonst) {
2826         mtmp2 = cloneu();
2827         if (mtmp2) {
2828             mtmp2->mhpmax = u.mhmax / 2;
2829             u.mhmax -= mtmp2->mhpmax;
2830             context.botl = 1;
2831 /*JP
2832             You("multiply%s!", reason);
2833 */
2834             You("%s\95ª\97ô\82µ\82½\81I", reason);
2835         }
2836     } else {
2837         mtmp2 = clone_mon(mon, 0, 0);
2838         if (mtmp2) {
2839             mtmp2->mhpmax = mon->mhpmax / 2;
2840             mon->mhpmax -= mtmp2->mhpmax;
2841             if (canspotmon(mon))
2842 /*JP
2843                 pline("%s multiplies%s!", Monnam(mon), reason);
2844 */
2845                 pline("%s\82Í%s\95ª\97ô\82µ\82½\81I", Monnam(mon), reason);
2846         }
2847     }
2848     return mtmp2;
2849 }
2850
2851 /*potion.c*/