OSDN Git Service

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