OSDN Git Service

fix #36370
[jnethack/source.git] / src / apply.c
1 /* NetHack 3.6  apply.c $NHDT-Date: 1446808436 2015/11/06 11:13:56 $  $NHDT-Branch: master $:$NHDT-Revision: 1.210 $ */
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 extern boolean notonhead; /* for long worms */
13
14 STATIC_DCL int FDECL(use_camera, (struct obj *));
15 STATIC_DCL int FDECL(use_towel, (struct obj *));
16 STATIC_DCL boolean FDECL(its_dead, (int, int, int *));
17 STATIC_DCL int FDECL(use_stethoscope, (struct obj *));
18 STATIC_DCL void FDECL(use_whistle, (struct obj *));
19 STATIC_DCL void FDECL(use_magic_whistle, (struct obj *));
20 STATIC_DCL void FDECL(use_leash, (struct obj *));
21 STATIC_DCL int FDECL(use_mirror, (struct obj *));
22 STATIC_DCL void FDECL(use_bell, (struct obj **));
23 STATIC_DCL void FDECL(use_candelabrum, (struct obj *));
24 STATIC_DCL void FDECL(use_candle, (struct obj **));
25 STATIC_DCL void FDECL(use_lamp, (struct obj *));
26 STATIC_DCL void FDECL(light_cocktail, (struct obj *));
27 STATIC_PTR void FDECL(display_jump_positions, (int));
28 STATIC_DCL void FDECL(use_tinning_kit, (struct obj *));
29 STATIC_DCL void FDECL(use_figurine, (struct obj **));
30 STATIC_DCL void FDECL(use_grease, (struct obj *));
31 STATIC_DCL void FDECL(use_trap, (struct obj *));
32 STATIC_DCL void FDECL(use_stone, (struct obj *));
33 STATIC_PTR int NDECL(set_trap); /* occupation callback */
34 STATIC_DCL int FDECL(use_whip, (struct obj *));
35 STATIC_PTR void FDECL(display_polearm_positions, (int));
36 STATIC_DCL int FDECL(use_pole, (struct obj *));
37 STATIC_DCL int FDECL(use_cream_pie, (struct obj *));
38 STATIC_DCL int FDECL(use_grapple, (struct obj *));
39 STATIC_DCL int FDECL(do_break_wand, (struct obj *));
40 STATIC_DCL boolean FDECL(figurine_location_checks, (struct obj *,
41                                                     coord *, BOOLEAN_P));
42 STATIC_DCL void FDECL(add_class, (char *, CHAR_P));
43 STATIC_DCL void FDECL(setapplyclasses, (char *));
44 STATIC_DCL boolean FDECL(is_valid_jump_pos, (int, int, int, BOOLEAN_P));
45 STATIC_DCL boolean FDECL(find_poleable_mon, (coord *, int, int));
46
47 #ifdef AMIGA
48 void FDECL(amii_speaker, (struct obj *, char *, int));
49 #endif
50
51 static const char no_elbow_room[] =
52 /*JP
53     "don't have enough elbow-room to maneuver.";
54 */
55     "\82»\82ê\82ð\82·\82é\82¾\82¯\82Ì\82ä\82Æ\82è\82ª\82È\82¢\81D";
56
57 STATIC_OVL int
58 use_camera(obj)
59 struct obj *obj;
60 {
61     struct monst *mtmp;
62
63     if (Underwater) {
64 /*JP
65         pline("Using your camera underwater would void the warranty.");
66 */
67         pline("\90\85\96Ê\89º\82Å\82Ì\83J\83\81\83\89\82Ì\8eg\97p\82Í\95Û\8fØ\82Ì\91Î\8fÛ\8aO\82Å\82·\81D");
68         return 0;
69     }
70     if (!getdir((char *) 0))
71         return 0;
72
73     if (obj->spe <= 0) {
74         pline1(nothing_happens);
75         return 1;
76     }
77     consume_obj_charge(obj, TRUE);
78
79     if (obj->cursed && !rn2(2)) {
80         (void) zapyourself(obj, TRUE);
81     } else if (u.uswallow) {
82 #if 0 /*JP*/
83         You("take a picture of %s %s.", s_suffix(mon_nam(u.ustuck)),
84             mbodypart(u.ustuck, STOMACH));
85 #else
86         You("%s\82Ì%s\82Ì\8eÊ\90^\82ð\8eB\82Á\82½\81D", mon_nam(u.ustuck),
87             mbodypart(u.ustuck, STOMACH));
88 #endif
89     } else if (u.dz) {
90 /*JP
91         You("take a picture of the %s.",
92 */
93         You("%s\82Ì\8eÊ\90^\82ð\8eB\82Á\82½\81D",
94             (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
95     } else if (!u.dx && !u.dy) {
96         (void) zapyourself(obj, TRUE);
97     } else if ((mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
98                             (int FDECL((*), (MONST_P, OBJ_P))) 0,
99                             (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj)) != 0) {
100         obj->ox = u.ux, obj->oy = u.uy;
101         (void) flash_hits_mon(mtmp, obj);
102     }
103     return 1;
104 }
105
106 STATIC_OVL int
107 use_towel(obj)
108 struct obj *obj;
109 {
110     boolean drying_feedback = (obj == uwep);
111
112     if (!freehand()) {
113 /*JP
114         You("have no free %s!", body_part(HAND));
115 */
116         You("%s\82Ì\8e©\97R\82ª\8cø\82©\82È\82¢\81I", body_part(HAND));
117         return 0;
118     } else if (obj == ublindf) {
119 /*JP
120         You("cannot use it while you're wearing it!");
121 */
122         You("\82»\82ê\82ð\90g\82É\82Â\82¯\82Ä\82¢\82é\82Ì\82Å\8eg\97p\82Å\82«\82È\82¢\81I");
123         return 0;
124     } else if (obj->cursed) {
125         long old;
126
127         switch (rn2(3)) {
128         case 2:
129             old = Glib;
130             incr_itimeout(&Glib, rn1(10, 3));
131 #if 0 /*JP*/
132             Your("%s %s!", makeplural(body_part(HAND)),
133                  (old ? "are filthier than ever" : "get slimy"));
134 #else
135             Your("%s\82Í%s\81I", makeplural(body_part(HAND)),
136                  (old ? "\82Ü\82·\82Ü\82·\89\98\82È\82­\82È\82Á\82½" : "\82Ê\82é\82Ê\82é\82É\82È\82Á\82½"));
137 #endif
138             if (is_wet_towel(obj))
139                 dry_a_towel(obj, -1, drying_feedback);
140             return 1;
141         case 1:
142             if (!ublindf) {
143                 old = u.ucreamed;
144                 u.ucreamed += rn1(10, 3);
145 #if 0 /*JP*/
146                 pline("Yecch! Your %s %s gunk on it!", body_part(FACE),
147                       (old ? "has more" : "now has"));
148 #else
149                 pline("\83Q\83F\81[\81I\82 \82È\82½\82Ì%s\82Í%s\82×\82Æ\82×\82Æ\82É\82È\82Á\82½\81I", body_part(FACE),
150                       (old ? "\82à\82Á\82Æ" : ""));
151 #endif
152                 make_blinded(Blinded + (long) u.ucreamed - old, TRUE);
153             } else {
154                 const char *what;
155
156 #if 0 /*JP*/
157                 what = (ublindf->otyp == LENSES)
158                            ? "lenses"
159                            : (obj->otyp == ublindf->otyp) ? "other towel"
160                                                           : "blindfold";
161 #else
162                 what = (ublindf->otyp == LENSES)
163                            ? "\83\8c\83\93\83Y"
164                            : (obj->otyp == ublindf->otyp) ? "\83^\83I\83\8b"
165                                                           : "\96Ú\89B\82µ";
166 #endif
167                 if (ublindf->cursed) {
168 #if 0 /*JP*/
169                     You("push your %s %s.", what,
170                         rn2(2) ? "cock-eyed" : "crooked");
171 #else
172                     pline("%s\82ª%s\81D", what,
173                         rn2(2) ? "\82¸\82ê\82½" : "\82ä\82ª\82ñ\82¾");
174 #endif
175                 } else {
176                     struct obj *saved_ublindf = ublindf;
177 /*JP
178                     You("push your %s off.", what);
179 */
180                     pline("%s\82ª\82¸\82è\97\8e\82¿\82½\81D", what);
181                     Blindf_off(ublindf);
182                     dropx(saved_ublindf);
183                 }
184             }
185             if (is_wet_towel(obj))
186                 dry_a_towel(obj, -1, drying_feedback);
187             return 1;
188         case 0:
189             break;
190         }
191     }
192
193     if (Glib) {
194         Glib = 0;
195 /*JP
196         You("wipe off your %s.", makeplural(body_part(HAND)));
197 */
198         You("%s\82ð\90@\82¢\82½\81D", makeplural(body_part(HAND)));
199         if (is_wet_towel(obj))
200             dry_a_towel(obj, -1, drying_feedback);
201         return 1;
202     } else if (u.ucreamed) {
203         Blinded -= u.ucreamed;
204         u.ucreamed = 0;
205         if (!Blinded) {
206 /*JP
207             pline("You've got the glop off.");
208 */
209             You("\82³\82Á\82Ï\82è\82µ\82½\81D");
210             if (!gulp_blnd_check()) {
211                 Blinded = 1;
212                 make_blinded(0L, TRUE);
213             }
214         } else {
215 /*JP
216             Your("%s feels clean now.", body_part(FACE));
217 */
218             pline("%s\82Ì\89\98\82ê\82ð\90@\82«\82Æ\82Á\82½\81D", body_part(FACE));
219         }
220         if (is_wet_towel(obj))
221             dry_a_towel(obj, -1, drying_feedback);
222         return 1;
223     }
224
225 #if 0 /*JP*/
226     Your("%s and %s are already clean.", body_part(FACE),
227          makeplural(body_part(HAND)));
228 #else
229     Your("%s\82â%s\82Í\89\98\82ê\82Ä\82¢\82È\82¢\81D", body_part(FACE),
230          makeplural(body_part(HAND)));
231 #endif
232
233     return 0;
234 }
235
236 /* maybe give a stethoscope message based on floor objects */
237 STATIC_OVL boolean
238 its_dead(rx, ry, resp)
239 int rx, ry, *resp;
240 {
241     char buf[BUFSZ];
242     boolean more_corpses;
243     struct permonst *mptr;
244     struct obj *corpse = sobj_at(CORPSE, rx, ry),
245                *statue = sobj_at(STATUE, rx, ry);
246
247     if (!can_reach_floor(TRUE)) { /* levitation or unskilled riding */
248         corpse = 0;               /* can't reach corpse on floor */
249         /* you can't reach tiny statues (even though you can fight
250            tiny monsters while levitating--consistency, what's that?) */
251         while (statue && mons[statue->corpsenm].msize == MZ_TINY)
252             statue = nxtobj(statue, STATUE, TRUE);
253     }
254     /* when both corpse and statue are present, pick the uppermost one */
255     if (corpse && statue) {
256         if (nxtobj(statue, CORPSE, TRUE) == corpse)
257             corpse = 0; /* corpse follows statue; ignore it */
258         else
259             statue = 0; /* corpse precedes statue; ignore statue */
260     }
261     more_corpses = (corpse && nxtobj(corpse, CORPSE, TRUE));
262
263     /* additional stethoscope messages from jyoung@apanix.apana.org.au */
264     if (!corpse && !statue) {
265         ; /* nothing to do */
266
267     } else if (Hallucination) {
268         if (!corpse) {
269             /* it's a statue */
270 /*JP
271             Strcpy(buf, "You're both stoned");
272 */
273             Strcpy(buf, "\90Î\82¾");
274 #if 0 /*JP*//*\91ã\96¼\8e\8c\8f\88\97\9d\82Í\95s\97v*/
275         } else if (corpse->quan == 1L && !more_corpses) {
276             int gndr = 2; /* neuter: "it" */
277             struct monst *mtmp = get_mtraits(corpse, FALSE);
278
279             /* (most corpses don't retain the monster's sex, so
280                we're usually forced to use generic pronoun here) */
281             if (mtmp) {
282                 mptr = &mons[mtmp->mnum];
283                 /* can't use mhe() here; it calls pronoun_gender() which
284                    expects monster to be on the map (visibility check) */
285                 if ((humanoid(mptr) || (mptr->geno & G_UNIQ)
286                      || type_is_pname(mptr)) && !is_neuter(mptr))
287                     gndr = (int) mtmp->female;
288             } else {
289                 mptr = &mons[corpse->corpsenm];
290                 if (is_female(mptr))
291                     gndr = 1;
292                 else if (is_male(mptr))
293                     gndr = 0;
294             }
295             Sprintf(buf, "%s's dead", genders[gndr].he); /* "he"/"she"/"it" */
296             buf[0] = highc(buf[0]);
297 #endif
298         } else { /* plural */
299 /*JP
300             Strcpy(buf, "They're dead");
301 */
302             Strcpy(buf, "\8e\80\82ñ\82Å\82é\82º");
303         }
304         /* variations on "He's dead, Jim." (Star Trek's Dr McCoy) */
305 /*JP
306         You_hear("a voice say, \"%s, Jim.\"", buf);
307 */
308         You_hear("\81u\82»\82¢\82Â\82Í%s\81C\83W\83\80\81v\82Æ\82¢\82¤\90º\82ª\95·\82±\82¦\82½\81D", buf);
309         *resp = 1;
310         return TRUE;
311
312     } else if (corpse) {
313         boolean here = (rx == u.ux && ry == u.uy),
314                 one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
315
316         if (Role_if(PM_HEALER)) {
317             /* ok to reset `corpse' here; we're done with it */
318             do {
319                 if (obj_has_timer(corpse, REVIVE_MON))
320                     reviver = TRUE;
321                 else
322                     corpse = nxtobj(corpse, CORPSE, TRUE);
323             } while (corpse && !reviver);
324         }
325 #if 0 /*JP*/
326         You("determine that %s unfortunate being%s %s%s dead.",
327             one ? (here ? "this" : "that") : (here ? "these" : "those"),
328             one ? "" : "s", one ? "is" : "are", reviver ? " mostly" : "");
329 #else
330         You("%s\95s\8dK\82È\90\82«\95¨\82Í%s\8e\80\82ñ\82Å\82¢\82é\82Æ\8c\8b\98_\82µ\82½\81D",
331             here ? "\82±\82Ì" : "\82»\82Ì",
332             reviver ? "\82Ù\82Ú" : "");
333 #endif
334         return TRUE;
335
336     } else { /* statue */
337         const char *what, *how;
338
339 #if 0 /*JP*/
340         mptr = &mons[statue->corpsenm];
341         if (Blind) { /* ignore statue->dknown; it'll always be set */
342             Sprintf(buf, "%s %s",
343                     (rx == u.ux && ry == u.uy) ? "This" : "That",
344                     humanoid(mptr) ? "person" : "creature");
345             what = buf;
346         } else {
347             what = mptr->mname;
348             if (!type_is_pname(mptr))
349                 what = The(what);
350         }
351 #else /*JP:\93ú\96{\8cê\82Å\82Í\83V\83\93\83v\83\8b\82É*/
352         if (Blind) { /* ignore statue->dknown; it'll always be set */
353             what = (rx == u.ux && ry == u.uy) ? "\82±\82ê" : "\82 \82ê";
354         } else {
355             what = mons[statue->corpsenm].mname;
356         }
357 #endif
358 /*JP
359         how = "fine";
360 */
361         how = "\82æ\82¢";
362         if (Role_if(PM_HEALER)) {
363             struct trap *ttmp = t_at(rx, ry);
364
365             if (ttmp && ttmp->ttyp == STATUE_TRAP)
366 /*JP
367                 how = "extraordinary";
368 */
369                 how = "\95À\8aO\82ê\82½";
370             else if (Has_contents(statue))
371 /*JP
372                 how = "remarkable";
373 */
374                 how = "\92\8d\96Ú\82·\82×\82«";
375         }
376
377 /*JP
378         pline("%s is in %s health for a statue.", what, how);
379 */
380         pline("\92¤\91\9c\82Æ\82µ\82Ä\82Ì%s\82Í%s\8dì\95i\82¾\81D", what, how);
381         return TRUE;
382     }
383     return FALSE; /* no corpse or statue */
384 }
385
386 /*JP
387 static const char hollow_str[] = "a hollow sound.  This must be a secret %s!";
388 */
389 static const char hollow_str[] = "\82¤\82Â\82ë\82È\89¹\82ð\95·\82¢\82½\81D\94é\96§\82Ì%s\82É\88á\82¢\82È\82¢\81I";
390
391 /* Strictly speaking it makes no sense for usage of a stethoscope to
392    not take any time; however, unless it did, the stethoscope would be
393    almost useless.  As a compromise, one use per turn is free, another
394    uses up the turn; this makes curse status have a tangible effect. */
395 STATIC_OVL int
396 use_stethoscope(obj)
397 register struct obj *obj;
398 {
399     struct monst *mtmp;
400     struct rm *lev;
401     int rx, ry, res;
402     boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
403                             && !rn2(Role_if(PM_HEALER) ? 10 : 3));
404
405     if (nohands(youmonst.data)) {
406 #if 0 /*JP*/
407         You("have no hands!"); /* not `body_part(HAND)' */
408 #else
409         pline("\82 \82È\82½\82É\82Í\8eè\82ª\82È\82¢\81I");
410 #endif
411         return 0;
412     } else if (Deaf) {
413 /*JP
414         You_cant("hear anything!");
415 */
416         You("\89½\82à\95·\82±\82¦\82È\82¢\81I");
417         return 0;
418     } else if (!freehand()) {
419 /*JP
420         You("have no free %s.", body_part(HAND));
421 */
422         You("%s\82Ì\8e©\97R\82ª\8cø\82©\82È\82¢\81D", body_part(HAND));
423         return 0;
424     }
425     if (!getdir((char *) 0))
426         return 0;
427
428     res = (moves == context.stethoscope_move)
429           && (youmonst.movement == context.stethoscope_movement);
430     context.stethoscope_move = moves;
431     context.stethoscope_movement = youmonst.movement;
432
433     if (u.usteed && u.dz > 0) {
434         if (interference) {
435 /*JP
436             pline("%s interferes.", Monnam(u.ustuck));
437 */
438             pline("%s\82ª\82\82á\82Ü\82ð\82µ\82½\81D", Monnam(u.ustuck));
439             mstatusline(u.ustuck);
440         } else
441             mstatusline(u.usteed);
442         return res;
443     } else if (u.uswallow && (u.dx || u.dy || u.dz)) {
444         mstatusline(u.ustuck);
445         return res;
446     } else if (u.uswallow && interference) {
447 /*JP
448         pline("%s interferes.", Monnam(u.ustuck));
449 */
450         pline("%s\82ª\82\82á\82Ü\82ð\82µ\82½\81D", Monnam(u.ustuck));
451         mstatusline(u.ustuck);
452         return res;
453     } else if (u.dz) {
454         if (Underwater)
455 /*JP
456             You_hear("faint splashing.");
457 */
458             You_hear("\82©\82·\82©\82É\83o\83V\83\83\83o\83V\83\83\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D");
459         else if (u.dz < 0 || !can_reach_floor(TRUE))
460             cant_reach_floor(u.ux, u.uy, (u.dz < 0), TRUE);
461         else if (its_dead(u.ux, u.uy, &res))
462             ; /* message already given */
463         else if (Is_stronghold(&u.uz))
464 /*JP
465             You_hear("the crackling of hellfire.");
466 */
467           You_hear("\92n\8d\96\82Ì\89\8a\82ª\83p\83`\83p\83`\94R\82¦\82Ä\82¢\82é\89¹\82ð\95·\82¢\82½\81D");
468         else
469 /*JP
470             pline_The("%s seems healthy enough.", surface(u.ux, u.uy));
471 */
472             pline("%s\82Í\8f[\95ª\8c\92\8dN\82Ì\82æ\82¤\82¾\81D", surface(u.ux,u.uy));
473         return res;
474     } else if (obj->cursed && !rn2(2)) {
475 /*JP
476         You_hear("your heart beat.");
477 */
478         You_hear("\8e©\95ª\82Ì\90S\91\9f\82Ì\8cÛ\93®\82ð\95·\82¢\82½\81D");
479         return res;
480     }
481     if (Stunned || (Confusion && !rn2(5)))
482         confdir();
483     if (!u.dx && !u.dy) {
484         ustatusline();
485         return res;
486     }
487     rx = u.ux + u.dx;
488     ry = u.uy + u.dy;
489     if (!isok(rx, ry)) {
490 /*JP
491         You_hear("a faint typing noise.");
492 */
493         You_hear("\82©\82·\82©\82É\82¾\82ê\82©\82ª\83^\83C\83s\83\93\83O\82µ\82Ä\82¢\82é\89¹\82ð\95·\82¢\82½\81D");
494         return 0;
495     }
496     if ((mtmp = m_at(rx, ry)) != 0) {
497         const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *) 0,
498                                    SUPPRESS_IT | SUPPRESS_INVISIBLE, FALSE);
499
500         if (mtmp->mundetected) {
501             if (!canspotmon(mtmp))
502 /*JP
503                 There("is %s hidden there.", mnm);
504 */
505                 pline("\82±\82±\82É%s\82ª\89B\82ê\82Ä\82¢\82é\81D", mnm);
506             mtmp->mundetected = 0;
507             newsym(mtmp->mx, mtmp->my);
508         } else if (mtmp->mappearance) {
509             const char *what = "thing";
510
511             switch (mtmp->m_ap_type) {
512             case M_AP_OBJECT:
513                 what = simple_typename(mtmp->mappearance);
514                 break;
515             case M_AP_MONSTER: /* ignore Hallucination here */
516                 what = mons[mtmp->mappearance].mname;
517                 break;
518             case M_AP_FURNITURE:
519                 what = defsyms[mtmp->mappearance].explanation;
520                 break;
521             }
522             seemimic(mtmp);
523 /*JP
524             pline("That %s is really %s", what, mnm);
525 */
526             pline("\82±\82Ì%s\82Í\8eÀ\8dÛ\82É\82Í%s\81D", what, mnm);
527         } else if (flags.verbose && !canspotmon(mtmp)) {
528 /*JP
529             There("is %s there.", mnm);
530 */
531             pline("\82±\82±\82É\82Í%s\82ª\82¢\82é\81D", mnm);
532         }
533         mstatusline(mtmp);
534         if (!canspotmon(mtmp))
535             map_invisible(rx, ry);
536         return res;
537     }
538     if (glyph_is_invisible(levl[rx][ry].glyph)) {
539         unmap_object(rx, ry);
540         newsym(rx, ry);
541 /*JP
542         pline_The("invisible monster must have moved.");
543 */
544         pline_The("\8c©\82¦\82È\82¢\89ö\95¨\82Í\88Ú\93®\82µ\82Ä\82µ\82Ü\82Á\82½\82æ\82¤\82¾\81D");
545     }
546     lev = &levl[rx][ry];
547     switch (lev->typ) {
548     case SDOOR:
549 /*JP
550         You_hear(hollow_str, "door");
551 */
552         You_hear(hollow_str, "\94à");
553         cvt_sdoor_to_door(lev); /* ->typ = DOOR */
554         feel_newsym(rx, ry);
555         return res;
556     case SCORR:
557 /*JP
558         You_hear(hollow_str, "passage");
559 */
560         You_hear(hollow_str, "\92Ê\98H");
561         lev->typ = CORR;
562         unblock_point(rx, ry);
563         feel_newsym(rx, ry);
564         return res;
565     }
566
567     if (!its_dead(rx, ry, &res))
568 #if 0 /*JP*/
569         You("hear nothing special."); /* not You_hear()  */
570 #else
571         pline("\93Á\82É\89½\82à\95·\82±\82¦\82È\82¢\81D");
572 #endif
573     return res;
574 }
575
576 /*JP
577 static const char whistle_str[] = "produce a %s whistling sound.";
578 */
579 static const char whistle_str[] = "\93J\82ð\90\81\82¢\82Ä%s\89¹\82ð\82½\82Ä\82½\81D";
580
581 STATIC_OVL void
582 use_whistle(obj)
583 struct obj *obj;
584 {
585     if (!can_blow(&youmonst)) {
586 /*JP
587         You("are incapable of using the whistle.");
588 */
589         You("\93J\82ð\8eg\82¤\94\\97Í\82ª\82È\82¢\81D");
590     } else if (Underwater) {
591 /*JP
592         You("blow bubbles through %s.", yname(obj));
593 */
594         You("%s\82ð\92Ê\82µ\82Ä\96A\82ð\8fo\82µ\82½\81D", xname(obj));
595     } else {
596 /*JP
597         You(whistle_str, obj->cursed ? "shrill" : "high");
598 */
599         You(whistle_str, obj->cursed ? "\95s\8bC\96¡\82È" : "\82©\82ñ\8d\82\82¢");
600         wake_nearby();
601     }
602 }
603
604 STATIC_OVL void
605 use_magic_whistle(obj)
606 struct obj *obj;
607 {
608     register struct monst *mtmp, *nextmon;
609
610     if (!can_blow(&youmonst)) {
611 /*JP
612         You("are incapable of using the whistle.");
613 */
614         You("\93J\82ð\8eg\82¤\94\\97Í\82ª\82È\82¢\81D");
615     } else if (obj->cursed && !rn2(2)) {
616 #if 0 /*JP*/
617         You("produce a %shigh-pitched humming noise.",
618             Underwater ? "very " : "");
619 #else
620         You("%s\8d\82\82¢\92²\8eq\82Ì\82¤\82È\82é\82æ\82¤\82È\89¹\82ð\82½\82Ä\82½\81D",
621             Underwater ? "\82Æ\82Ä\82à" : "");
622 #endif
623         wake_nearby();
624     } else {
625         int pet_cnt = 0, omx, omy;
626
627         /* it's magic!  it works underwater too (at a higher pitch) */
628 #if 0 /*JP*/
629         You(whistle_str,
630             Hallucination ? "normal" : Underwater ? "strange, high-pitched"
631                                                   : "strange");
632 #else
633         You(whistle_str,
634             Hallucination ? "\93J\82Ì\82æ\82¤\82È" : Underwater ? "\95s\8ev\8bc\82È\8d\82\82¢\92²\8eq\82Ì"
635                                                   : "\95s\8ev\8bc\82È");
636 #endif
637         for (mtmp = fmon; mtmp; mtmp = nextmon) {
638             nextmon = mtmp->nmon; /* trap might kill mon */
639             if (DEADMONSTER(mtmp))
640                 continue;
641             /* steed is already at your location, so not affected;
642                this avoids trap issues if you're on a trap location */
643             if (mtmp == u.usteed)
644                 continue;
645             if (mtmp->mtame) {
646                 if (mtmp->mtrapped) {
647                     /* no longer in previous trap (affects mintrap) */
648                     mtmp->mtrapped = 0;
649                     fill_pit(mtmp->mx, mtmp->my);
650                 }
651                 /* mimic must be revealed before we know whether it
652                    actually moves because line-of-sight may change */
653                 if (mtmp->m_ap_type)
654                     seemimic(mtmp);
655                 omx = mtmp->mx, omy = mtmp->my;
656                 mnexto(mtmp);
657                 if (mtmp->mx != omx || mtmp->my != omy) {
658                     mtmp->mundetected = 0; /* reveal non-mimic hider */
659                     if (canspotmon(mtmp))
660                         ++pet_cnt;
661                     if (mintrap(mtmp) == 2)
662                         change_luck(-1);
663                 }
664             }
665         }
666         if (pet_cnt > 0)
667             makeknown(obj->otyp);
668     }
669 }
670
671 boolean
672 um_dist(x, y, n)
673 xchar x, y, n;
674 {
675     return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
676 }
677
678 int
679 number_leashed()
680 {
681     int i = 0;
682     struct obj *obj;
683
684     for (obj = invent; obj; obj = obj->nobj)
685         if (obj->otyp == LEASH && obj->leashmon != 0)
686             i++;
687     return i;
688 }
689
690 /* otmp is about to be destroyed or stolen */
691 void
692 o_unleash(otmp)
693 register struct obj *otmp;
694 {
695     register struct monst *mtmp;
696
697     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
698         if (mtmp->m_id == (unsigned) otmp->leashmon)
699             mtmp->mleashed = 0;
700     otmp->leashmon = 0;
701 }
702
703 /* mtmp is about to die, or become untame */
704 void
705 m_unleash(mtmp, feedback)
706 register struct monst *mtmp;
707 boolean feedback;
708 {
709     register struct obj *otmp;
710
711     if (feedback) {
712         if (canseemon(mtmp))
713 /*JP
714             pline("%s pulls free of %s leash!", Monnam(mtmp), mhis(mtmp));
715 */
716             pline("%s\82Í\95R\82ð\88ø\82Á\82Ï\82Á\82Ä\93¦\82ê\82½\81I", Monnam(mtmp));
717         else
718 /*JP
719             Your("leash falls slack.");
720 */
721             Your("\95R\82ª\82½\82é\82ñ\82Å\97\8e\82¿\82½\81D");
722     }
723     for (otmp = invent; otmp; otmp = otmp->nobj)
724         if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
725             otmp->leashmon = 0;
726     mtmp->mleashed = 0;
727 }
728
729 /* player is about to die (for bones) */
730 void
731 unleash_all()
732 {
733     register struct obj *otmp;
734     register struct monst *mtmp;
735
736     for (otmp = invent; otmp; otmp = otmp->nobj)
737         if (otmp->otyp == LEASH)
738             otmp->leashmon = 0;
739     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
740         mtmp->mleashed = 0;
741 }
742
743 #define MAXLEASHED 2
744
745 static boolean
746 leashable(mtmp)
747 struct monst *mtmp;
748 {
749     return (boolean) (mtmp->mnum != PM_LONG_WORM);
750 }
751
752 /* ARGSUSED */
753 STATIC_OVL void
754 use_leash(obj)
755 struct obj *obj;
756 {
757     coord cc;
758     register struct monst *mtmp;
759     int spotmon;
760
761     if (!obj->leashmon && number_leashed() >= MAXLEASHED) {
762 /*JP
763         You("cannot leash any more pets.");
764 */
765         You("\82±\82ê\88È\8fã\83y\83b\83g\82É\95R\82ð\82©\82¯\82ç\82ê\82È\82¢\81D");
766         return;
767     }
768
769     if (!get_adjacent_loc((char *) 0, (char *) 0, u.ux, u.uy, &cc))
770         return;
771
772     if ((cc.x == u.ux) && (cc.y == u.uy)) {
773         if (u.usteed && u.dz > 0) {
774             mtmp = u.usteed;
775             spotmon = 1;
776             goto got_target;
777         }
778 /*JP
779         pline("Leash yourself?  Very funny...");
780 */
781         pline("\8e©\95ª\82ð\94\9b\82é\81H\95Ï\82È\82Ì\81D\81D\81D");
782         return;
783     }
784
785     if (!(mtmp = m_at(cc.x, cc.y))) {
786 /*JP
787         There("is no creature there.");
788 */
789         pline("\82»\82±\82É\82Í\90\82«\95¨\82Í\82¢\82È\82¢\81D");
790         return;
791     }
792
793     spotmon = canspotmon(mtmp);
794 got_target:
795
796     if (!mtmp->mtame) {
797         if (!spotmon)
798 /*JP
799             There("is no creature there.");
800 */
801             pline("\82»\82±\82É\82Í\90\82«\95¨\82Í\82¢\82È\82¢\81D");
802         else
803 #if 0 /*JP*/
804             pline("%s %s leashed!", Monnam(mtmp),
805                   (!obj->leashmon) ? "cannot be" : "is not");
806 #else
807           pline("%s\82Í\95R\82Å%s\81I", Monnam(mtmp),
808                   (!obj->leashmon) ? "\8c\8b\82×\82È\82¢" : "\8c\8b\82Î\82ê\82Ä\82¢\82È\82¢");
809 #endif
810         return;
811     }
812     if (!obj->leashmon) {
813         if (mtmp->mleashed) {
814 #if 0 /*JP*/
815             pline("This %s is already leashed.",
816                   spotmon ? l_monnam(mtmp) : "monster");
817 #else
818             pline("%s\82Í\82·\82Å\82É\8c\8b\82Ñ\82Â\82¯\82ç\82ê\82Ä\82¢\82é\81D",
819                   spotmon ? l_monnam(mtmp) : "\89ö\95¨");
820 #endif
821             return;
822         }
823         if (!leashable(mtmp)) {
824 #if 0 /*JP*/
825             pline("The leash won't fit onto %s%s.", spotmon ? "your " : "",
826                   l_monnam(mtmp));
827 #else
828             pline("\95R\82Í%s\82É\8d\87\82í\82È\82¢\81D",
829                   l_monnam(mtmp));
830 #endif
831             return;
832         }
833
834 #if 0 /*JP*/
835         You("slip the leash around %s%s.", spotmon ? "your " : "",
836             l_monnam(mtmp));
837 #else
838         You("%s\82ð\95R\82Å\8c\8b\82Ñ\82Â\82¯\82½\81D",
839             l_monnam(mtmp));
840 #endif
841         mtmp->mleashed = 1;
842         obj->leashmon = (int) mtmp->m_id;
843         mtmp->msleeping = 0;
844         return;
845     }
846     if (obj->leashmon != (int) mtmp->m_id) {
847 /*JP
848         pline("This leash is not attached to that creature.");
849 */
850         pline("\82±\82Ì\95R\82Í\82»\82ê\82É\82Í\8c\8b\82Î\82ê\82Ä\82¢\82È\82¢\81D");
851         return;
852     } else {
853         if (obj->cursed) {
854 /*JP
855             pline_The("leash would not come off!");
856 */
857             pline("\95R\82ª\82Í\82¸\82ê\82È\82¢\81I");
858             obj->bknown = TRUE;
859             return;
860         }
861         mtmp->mleashed = 0;
862         obj->leashmon = 0;
863 #if 0 /*JP*/
864         You("remove the leash from %s%s.", spotmon ? "your " : "",
865             l_monnam(mtmp));
866 #else
867         You("%s\82©\82ç\95R\82ð\82Í\82¸\82µ\82½\81D",
868             l_monnam(mtmp));
869 #endif
870     }
871     return;
872 }
873
874 /* assuming mtmp->mleashed has been checked */
875 struct obj *
876 get_mleash(mtmp)
877 struct monst *mtmp;
878 {
879     struct obj *otmp;
880
881     otmp = invent;
882     while (otmp) {
883         if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
884             return otmp;
885         otmp = otmp->nobj;
886     }
887     return (struct obj *) 0;
888 }
889
890 boolean
891 next_to_u()
892 {
893     register struct monst *mtmp;
894     register struct obj *otmp;
895
896     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
897         if (DEADMONSTER(mtmp))
898             continue;
899         if (mtmp->mleashed) {
900             if (distu(mtmp->mx, mtmp->my) > 2)
901                 mnexto(mtmp);
902             if (distu(mtmp->mx, mtmp->my) > 2) {
903                 for (otmp = invent; otmp; otmp = otmp->nobj)
904                     if (otmp->otyp == LEASH
905                         && otmp->leashmon == (int) mtmp->m_id) {
906                         if (otmp->cursed)
907                             return FALSE;
908 #if 0 /*JP*/
909                         You_feel("%s leash go slack.",
910                                  (number_leashed() > 1) ? "a" : "the");
911 #else
912                         You("\95R\82ª\82½\82é\82ñ\82¾\82æ\82¤\82È\8bC\82ª\82µ\82½\81D");
913 #endif
914                         mtmp->mleashed = 0;
915                         otmp->leashmon = 0;
916                     }
917             }
918         }
919     }
920     /* no pack mules for the Amulet */
921     if (u.usteed && mon_has_amulet(u.usteed))
922         return FALSE;
923     return TRUE;
924 }
925
926 void
927 check_leash(x, y)
928 register xchar x, y;
929 {
930     register struct obj *otmp;
931     register struct monst *mtmp;
932
933     for (otmp = invent; otmp; otmp = otmp->nobj) {
934         if (otmp->otyp != LEASH || otmp->leashmon == 0)
935             continue;
936         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
937             if (DEADMONSTER(mtmp))
938                 continue;
939             if ((int) mtmp->m_id == otmp->leashmon)
940                 break;
941         }
942         if (!mtmp) {
943             impossible("leash in use isn't attached to anything?");
944             otmp->leashmon = 0;
945             continue;
946         }
947         if (dist2(u.ux, u.uy, mtmp->mx, mtmp->my)
948             > dist2(x, y, mtmp->mx, mtmp->my)) {
949             if (!um_dist(mtmp->mx, mtmp->my, 3)) {
950                 ; /* still close enough */
951             } else if (otmp->cursed && !breathless(mtmp->data)) {
952                 if (um_dist(mtmp->mx, mtmp->my, 5)
953                     || (mtmp->mhp -= rnd(2)) <= 0) {
954                     long save_pacifism = u.uconduct.killer;
955
956 /*JP
957                     Your("leash chokes %s to death!", mon_nam(mtmp));
958 */
959                     pline("%s\82Í\8di\82ß\8eE\82³\82ê\82½\81I",mon_nam(mtmp));
960                     /* hero might not have intended to kill pet, but
961                        that's the result of his actions; gain experience,
962                        lose pacifism, take alignment and luck hit, make
963                        corpse less likely to remain tame after revival */
964                     xkilled(mtmp, 0); /* no "you kill it" message */
965                     /* life-saving doesn't ordinarily reset this */
966                     if (mtmp->mhp > 0)
967                         u.uconduct.killer = save_pacifism;
968                 } else {
969 /*JP
970                     pline("%s is choked by the leash!", Monnam(mtmp));
971 */
972                     pline("%s\82Í\95R\82Å\8eñ\82ð\8di\82ß\82ç\82ê\82½\81I", Monnam(mtmp));
973                     /* tameness eventually drops to 1 here (never 0) */
974                     if (mtmp->mtame && rn2(mtmp->mtame))
975                         mtmp->mtame--;
976                 }
977             } else {
978                 if (um_dist(mtmp->mx, mtmp->my, 5)) {
979 /*JP
980                     pline("%s leash snaps loose!", s_suffix(Monnam(mtmp)));
981 */
982                     pline("%s\82Ì\95R\82Í\83p\83`\83\93\82Æ\8aO\82ê\82½\81I", Monnam(mtmp));
983                     m_unleash(mtmp, FALSE);
984                 } else {
985 /*JP
986                     You("pull on the leash.");
987 */
988                     You("\95R\82ð\88ø\82Á\82Ï\82Á\82½\81D");
989                     if (mtmp->data->msound != MS_SILENT)
990                         switch (rn2(3)) {
991                         case 0:
992                             growl(mtmp);
993                             break;
994                         case 1:
995                             yelp(mtmp);
996                             break;
997                         default:
998                             whimper(mtmp);
999                             break;
1000                         }
1001                 }
1002             }
1003         }
1004     }
1005 }
1006
1007 const char *
1008 beautiful()
1009 {
1010     return ((ACURR(A_CHA) > 14)
1011                ? ((poly_gender() == 1)
1012 #if 0 /*JP*/
1013                      ? "beautiful"
1014                      : "handsome")
1015                : "ugly");
1016 #else
1017 /*JP \8cê\8a²\82Å\8eg\82¤ */
1018                      ? "\94ü\82µ"
1019                      : "\82è\82è\82µ")
1020                : "\8fX");
1021 #endif
1022 }
1023
1024 #define WEAK 3 /* from eat.c */
1025
1026 /*JP
1027 static const char look_str[] = "look %s.";
1028 */
1029 static const char look_str[] = "%s\8c©\82¦\82é\81D";
1030
1031 STATIC_OVL int
1032 use_mirror(obj)
1033 struct obj *obj;
1034 {
1035     const char *mirror, *uvisage;
1036     struct monst *mtmp;
1037     unsigned how_seen;
1038     char mlet;
1039     boolean vis, invis_mirror, useeit, monable;
1040
1041     if (!getdir((char *) 0))
1042         return 0;
1043     invis_mirror = Invis;
1044     useeit = !Blind && (!invis_mirror || See_invisible);
1045     uvisage = beautiful();
1046     mirror = simpleonames(obj); /* "mirror" or "looking glass" */
1047     if (obj->cursed && !rn2(2)) {
1048         if (!Blind)
1049 /*JP
1050             pline_The("%s fogs up and doesn't reflect!", mirror);
1051 */
1052             pline("%s\82Í\93Ü\82è\81C\89f\82ç\82È\82­\82È\82Á\82½\81I", mirror);
1053         return 1;
1054     }
1055     if (!u.dx && !u.dy && !u.dz) {
1056         if (!useeit) {
1057 /*JP
1058             You_cant("see your %s %s.", uvisage, body_part(FACE));
1059 */
1060             You_cant("\8e©\95ª\82Ì%s\82¢%s\82ð\8c©\82é\82±\82Æ\82ª\82Å\82«\82È\82¢\81D", uvisage, body_part(FACE));
1061         } else {
1062             if (u.umonnum == PM_FLOATING_EYE) {
1063                 if (Free_action) {
1064 /*JP
1065                     You("stiffen momentarily under your gaze.");
1066 */
1067                     pline("\88ê\8fu\82 \82È\82½\82Ì\82É\82ç\82Ý\82Å\8dd\92¼\82µ\82½\81D");
1068                 } else {
1069                     if (Hallucination)
1070 /*JP
1071                         pline("Yow!  The %s stares back!", mirror);
1072 */
1073                         pline("\82¨\82ì\81I%s\82ª\82 \82È\82½\82ð\82É\82ç\82Ý\95Ô\82µ\82½\81I", mirror);
1074                     else
1075 /*JP
1076                         pline("Yikes!  You've frozen yourself!");
1077 */
1078                         pline("\82¨\82ì\81I\82 \82È\82½\82Í\93®\82¯\82È\82­\82È\82Á\82½\81I");
1079                     if (!Hallucination || !rn2(4)) {
1080                         nomul(-rnd(MAXULEV + 6 - u.ulevel));
1081 /*JP
1082                         multi_reason = "gazing into a mirror";
1083 */
1084                         multi_reason = "\8b¾\82É\94½\8eË\82µ\82½\8e\8b\90ü\82Å\8dd\92¼\82µ\82Ä\82¢\82é\8aÔ\82É";
1085                     }
1086                     nomovemsg = 0; /* default, "you can move again" */
1087                 }
1088             } else if (youmonst.data->mlet == S_VAMPIRE)
1089 /*JP
1090                 You("don't have a reflection.");
1091 */
1092                 You("\8b¾\82É\89f\82ç\82È\82©\82Á\82½\81D");
1093             else if (u.umonnum == PM_UMBER_HULK) {
1094 /*JP
1095                 pline("Huh?  That doesn't look like you!");
1096 */
1097                 pline("\82Ù\82¦\81H\8eÊ\82Á\82Ä\82é\82Ì\82Í\82 \82È\82½\82\82á\82È\82¢\82Ý\82½\82¢\82¾\81I");
1098                 make_confused(HConfusion + d(3, 4), FALSE);
1099             } else if (Hallucination)
1100                 You(look_str, hcolor((char *) 0));
1101             else if (Sick)
1102 /*JP
1103                 You(look_str, "peaked");
1104 */
1105                 You(look_str, "\8aç\90F\82ª\88«\82­");
1106             else if (u.uhs >= WEAK)
1107 /*JP
1108                 You(look_str, "undernourished");
1109 */
1110                 You(look_str, "\89h\97{\8e¸\92²\82Ì\82æ\82¤\82É");
1111             else
1112 /*JP
1113                 You("look as %s as ever.", uvisage);
1114 */
1115                 You("\82 \82¢\82©\82í\82ç\82¸%s\82­\8c©\82¦\82é\81D", uvisage);
1116         }
1117         return 1;
1118     }
1119     if (u.uswallow) {
1120         if (useeit)
1121             You("reflect %s %s.", s_suffix(mon_nam(u.ustuck)),
1122                 mbodypart(u.ustuck, STOMACH));
1123         return 1;
1124     }
1125     if (Underwater) {
1126         if (useeit)
1127 #if 0 /*JP*/
1128             You(Hallucination ? "give the fish a chance to fix their makeup."
1129                               : "reflect the murky water.");
1130 #else
1131             You(Hallucination ? "\8b\9b\82É\89»\8fÏ\92¼\82µ\82Ì\8b@\89ï\82ð\97^\82¦\82½\81D"
1132                               : "\82 \82È\82½\82Í\97\84\82ñ\82¾\90\85\82ð\89f\82µ\82½\81D");
1133 #endif
1134         return 1;
1135     }
1136     if (u.dz) {
1137         if (useeit)
1138 /*JP
1139             You("reflect the %s.",
1140 */
1141             You("%s\82ð\89f\82µ\82½\81D",
1142                 (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
1143         return 1;
1144     }
1145     mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
1146                 (int FDECL((*), (MONST_P, OBJ_P))) 0,
1147                 (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
1148     if (!mtmp || !haseyes(mtmp->data) || notonhead)
1149         return 1;
1150
1151     /* couldsee(mtmp->mx, mtmp->my) is implied by the fact that bhit()
1152        targetted it, so we can ignore possibility of X-ray vision */
1153     vis = canseemon(mtmp);
1154 /* ways to directly see monster (excludes X-ray vision, telepathy,
1155    extended detection, type-specific warning) */
1156 #define SEENMON (MONSEEN_NORMAL | MONSEEN_SEEINVIS | MONSEEN_INFRAVIS)
1157     how_seen = vis ? howmonseen(mtmp) : 0;
1158     /* whether monster is able to use its vision-based capabilities */
1159     monable = !mtmp->mcan && (!mtmp->minvis || perceives(mtmp->data));
1160     mlet = mtmp->data->mlet;
1161     if (mtmp->msleeping) {
1162         if (vis)
1163 /*JP
1164             pline("%s is too tired to look at your %s.", Monnam(mtmp),
1165 */
1166             pline("%s\82Í\82Æ\82Ä\82à\94æ\82ê\82Ä\82¢\82Ä%s\82ð\8c©\82é\82Ç\82±\82ë\82\82á\82È\82¢\81D", Monnam(mtmp),
1167                   mirror);
1168     } else if (!mtmp->mcansee) {
1169         if (vis)
1170 /*JP
1171             pline("%s can't see anything right now.", Monnam(mtmp));
1172 */
1173             pline("%s\82Í\8d¡\82Ì\82Æ\82±\82ë\89½\82à\8c©\82é\82±\82Æ\82ª\82Å\82«\82È\82¢\81D", Monnam(mtmp));
1174     } else if (invis_mirror && !perceives(mtmp->data)) {
1175         if (vis)
1176 /*JP
1177             pline("%s fails to notice your %s.", Monnam(mtmp), mirror);
1178 */
1179             pline("%s\82Í\82 \82È\82½\82Ì%s\82É\8bC\95t\82©\82È\82©\82Á\82½\81D", Monnam(mtmp), mirror);
1180         /* infravision doesn't produce an image in the mirror */
1181     } else if ((how_seen & SEENMON) == MONSEEN_INFRAVIS) {
1182         if (vis) /* (redundant) */
1183 #if 0 /*JP*/
1184             pline("%s is too far away to see %sself in the dark.",
1185                   Monnam(mtmp), mhim(mtmp));
1186 #else
1187             pline("%s\82Í\88Ã\88Å\82Å\8e©\95ª\8e©\90g\82ð\8c©\82é\82É\82Í\89\93\82·\82¬\82é\81D", Monnam(mtmp));
1188 #endif
1189         /* some monsters do special things */
1190     } else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
1191         if (vis)
1192 /*JP
1193             pline("%s doesn't have a reflection.", Monnam(mtmp));
1194 */
1195             pline("%s\82Í%s\82É\89f\82ç\82È\82¢\81D", Monnam(mtmp), mirror);
1196     } else if (monable && mtmp->data == &mons[PM_MEDUSA]) {
1197 /*JP
1198         if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
1199 */
1200         if (mon_reflects(mtmp, "\82É\82ç\82Ý\82Í%s\82Ì%s\82Å\94½\8eË\82µ\82½\81I"))
1201             return 1;
1202         if (vis)
1203 /*JP
1204             pline("%s is turned to stone!", Monnam(mtmp));
1205 */
1206             pline("%s\82Í\90Î\82É\82È\82Á\82½\81I", Monnam(mtmp));
1207         stoned = TRUE;
1208         killed(mtmp);
1209     } else if (monable && mtmp->data == &mons[PM_FLOATING_EYE]) {
1210         int tmp = d((int) mtmp->m_lev, (int) mtmp->data->mattk[0].damd);
1211         if (!rn2(4))
1212             tmp = 120;
1213         if (vis)
1214 /*JP
1215             pline("%s is frozen by its reflection.", Monnam(mtmp));
1216 */
1217             pline("%s\82Í\8e©\95ª\82Ì\8ep\82ð\8c©\82Ä\93®\82¯\82È\82­\82È\82Á\82½\81D", Monnam(mtmp));
1218         else
1219 /*JP
1220             You_hear("%s stop moving.", something);
1221 */
1222             You_hear("\89½\82©\82ª\93®\82«\82ð\82Æ\82ß\82½\89¹\82ð\95·\82¢\82½\81D");
1223         paralyze_monst(mtmp, (int) mtmp->mfrozen + tmp);
1224     } else if (monable && mtmp->data == &mons[PM_UMBER_HULK]) {
1225         if (vis)
1226 /*JP
1227             pline("%s confuses itself!", Monnam(mtmp));
1228 */
1229             pline("%s\82Í\8d¬\97\90\82µ\82½\81I", Monnam(mtmp));
1230         mtmp->mconf = 1;
1231     } else if (monable && (mlet == S_NYMPH || mtmp->data == &mons[PM_SUCCUBUS]
1232                            || mtmp->data == &mons[PM_INCUBUS])) {
1233         if (vis) {
1234             char buf[BUFSZ]; /* "She" or "He" */
1235
1236 #if 0 /*JP*/
1237             pline("%s admires %sself in your %s.", Monnam(mtmp), mhim(mtmp),
1238                   mirror);
1239 #else
1240             pline("%s\82Í\8e©\95ª\82Ì\8ep\82É\82¤\82Á\82Æ\82è\82µ\82½\81D", Monnam(mtmp));
1241 #endif
1242 /*JP
1243             pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
1244 */
1245             pline("%s\82Í\82»\82ê\82ð\92D\82Á\82½\81I", upstart(strcpy(buf, mhe(mtmp))));
1246         } else
1247 /*JP
1248             pline("It steals your %s!", mirror);
1249 */
1250             pline("\89½\8eÒ\82©\82ª\82 \82È\82½\82Ì%s\82ð\93\90\82ñ\82¾\81I", mirror);
1251         setnotworn(obj); /* in case mirror was wielded */
1252         freeinv(obj);
1253         (void) mpickobj(mtmp, obj);
1254         if (!tele_restrict(mtmp))
1255             (void) rloc(mtmp, TRUE);
1256     } else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
1257                && (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
1258         if (vis)
1259 /*JP
1260             pline("%s is frightened by its reflection.", Monnam(mtmp));
1261 */
1262             pline("%s\82Í\8e©\95ª\82Ì\8ep\82ð\8c©\82Ä\95|\82ª\82Á\82½\81D", Monnam(mtmp));
1263         monflee(mtmp, d(2, 4), FALSE, FALSE);
1264     } else if (!Blind) {
1265         if (mtmp->minvis && !See_invisible)
1266             ;
1267         else if ((mtmp->minvis && !perceives(mtmp->data))
1268                  /* redundant: can't get here if these are true */
1269                  || !haseyes(mtmp->data) || notonhead || !mtmp->mcansee)
1270 #if 0 /*JP*/
1271             pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
1272                   mhis(mtmp));
1273 #else
1274             pline("%s\82Í\8e©\95ª\82Ì\8ep\82É\8bC\82ª\82Â\82¢\82Ä\82È\82¢\82æ\82¤\82¾\81D", Monnam(mtmp));
1275 #endif
1276         else
1277 /*JP
1278             pline("%s ignores %s reflection.", Monnam(mtmp), mhis(mtmp));
1279 */
1280             pline("%s\82Í\8e©\95ª\82Ì\8ep\82ð\96³\8e\8b\82µ\82½\81D", Monnam(mtmp));
1281     }
1282     return 1;
1283 }
1284
1285 STATIC_OVL void
1286 use_bell(optr)
1287 struct obj **optr;
1288 {
1289     register struct obj *obj = *optr;
1290     struct monst *mtmp;
1291     boolean wakem = FALSE, learno = FALSE,
1292             ordinary = (obj->otyp != BELL_OF_OPENING || !obj->spe),
1293             invoking =
1294                 (obj->otyp == BELL_OF_OPENING && invocation_pos(u.ux, u.uy)
1295                  && !On_stairs(u.ux, u.uy));
1296
1297 /*JP
1298     You("ring %s.", the(xname(obj)));
1299 */
1300     You("%s\82ð\96Â\82ç\82µ\82½\81D", the(xname(obj)));
1301
1302     if (Underwater || (u.uswallow && ordinary)) {
1303 #ifdef AMIGA
1304         amii_speaker(obj, "AhDhGqEqDhEhAqDqFhGw", AMII_MUFFLED_VOLUME);
1305 #endif
1306 /*JP
1307         pline("But the sound is muffled.");
1308 */
1309         pline("\82µ\82©\82µ\89¹\82Í\82©\82«\8fÁ\82³\82ê\82½\81D");
1310
1311     } else if (invoking && ordinary) {
1312         /* needs to be recharged... */
1313 /*JP
1314         pline("But it makes no sound.");
1315 */
1316         pline("\82µ\82©\82µ\81C\89¹\82Í\96Â\82ç\82È\82©\82Á\82½\81D");
1317         learno = TRUE; /* help player figure out why */
1318
1319     } else if (ordinary) {
1320 #ifdef AMIGA
1321         amii_speaker(obj, "ahdhgqeqdhehaqdqfhgw", AMII_MUFFLED_VOLUME);
1322 #endif
1323         if (obj->cursed && !rn2(4)
1324             /* note: once any of them are gone, we stop all of them */
1325             && !(mvitals[PM_WOOD_NYMPH].mvflags & G_GONE)
1326             && !(mvitals[PM_WATER_NYMPH].mvflags & G_GONE)
1327             && !(mvitals[PM_MOUNTAIN_NYMPH].mvflags & G_GONE)
1328             && (mtmp = makemon(mkclass(S_NYMPH, 0), u.ux, u.uy, NO_MINVENT))
1329                    != 0) {
1330 /*JP
1331             You("summon %s!", a_monnam(mtmp));
1332 */
1333             You("%s\82ð\8f¢\8a«\82µ\82½\81I", a_monnam(mtmp));
1334             if (!obj_resists(obj, 93, 100)) {
1335 /*JP
1336                 pline("%s shattered!", Tobjnam(obj, "have"));
1337 */
1338                 pline("%s\82Í\95²\81X\82É\82È\82Á\82½\81I", xname(obj));
1339                 useup(obj);
1340                 *optr = 0;
1341             } else
1342                 switch (rn2(3)) {
1343                 default:
1344                     break;
1345                 case 1:
1346                     mon_adjust_speed(mtmp, 2, (struct obj *) 0);
1347                     break;
1348                 case 2: /* no explanation; it just happens... */
1349                     nomovemsg = "";
1350                     multi_reason = NULL;
1351                     nomul(-rnd(2));
1352                     break;
1353                 }
1354         }
1355         wakem = TRUE;
1356
1357     } else {
1358         /* charged Bell of Opening */
1359         consume_obj_charge(obj, TRUE);
1360
1361         if (u.uswallow) {
1362             if (!obj->cursed)
1363                 (void) openit();
1364             else
1365                 pline1(nothing_happens);
1366
1367         } else if (obj->cursed) {
1368             coord mm;
1369
1370             mm.x = u.ux;
1371             mm.y = u.uy;
1372             mkundead(&mm, FALSE, NO_MINVENT);
1373             wakem = TRUE;
1374
1375         } else if (invoking) {
1376 /*JP
1377             pline("%s an unsettling shrill sound...", Tobjnam(obj, "issue"));
1378 */
1379             pline("%s\82Í\95s\8bC\96¡\82È\89s\82¢\89¹\82ð\8fo\82µ\82½\81D\81D\81D", xname(obj));
1380 #ifdef AMIGA
1381             amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
1382 #endif
1383             obj->age = moves;
1384             learno = TRUE;
1385             wakem = TRUE;
1386
1387         } else if (obj->blessed) {
1388             int res = 0;
1389
1390 #ifdef AMIGA
1391             amii_speaker(obj, "ahahahDhEhCw", AMII_SOFT_VOLUME);
1392 #endif
1393             if (uchain) {
1394                 unpunish();
1395                 res = 1;
1396             } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1397                 buried_ball_to_freedom();
1398                 res = 1;
1399             }
1400             res += openit();
1401             switch (res) {
1402             case 0:
1403                 pline1(nothing_happens);
1404                 break;
1405             case 1:
1406 /*JP
1407                 pline("%s opens...", Something);
1408 */
1409                 pline("\89½\82©\82ª\8aJ\82¢\82½\81D\81D\81D");
1410                 learno = TRUE;
1411                 break;
1412             default:
1413 /*JP
1414                 pline("Things open around you...");
1415 */
1416                 pline("\82Ü\82í\82è\82Ì\95¨\82ª\8aJ\82¢\82½\81D\81D\81D");
1417                 learno = TRUE;
1418                 break;
1419             }
1420
1421         } else { /* uncursed */
1422 #ifdef AMIGA
1423             amii_speaker(obj, "AeFeaeFeAefegw", AMII_OKAY_VOLUME);
1424 #endif
1425             if (findit() != 0)
1426                 learno = TRUE;
1427             else
1428                 pline1(nothing_happens);
1429         }
1430
1431     } /* charged BofO */
1432
1433     if (learno) {
1434         makeknown(BELL_OF_OPENING);
1435         obj->known = 1;
1436     }
1437     if (wakem)
1438         wake_nearby();
1439 }
1440
1441 STATIC_OVL void
1442 use_candelabrum(obj)
1443 register struct obj *obj;
1444 {
1445 #if 0 /*JP*//* not used */
1446     const char *s = (obj->spe != 1) ? "candles" : "candle";
1447 #endif
1448
1449     if (obj->lamplit) {
1450 /*JP
1451         You("snuff the %s.", s);
1452 */
1453         You("\82ë\82¤\82»\82­\82ð\90\81\82«\8fÁ\82µ\82½\81D");
1454         end_burn(obj, TRUE);
1455         return;
1456     }
1457     if (obj->spe <= 0) {
1458 /*JP
1459         pline("This %s has no %s.", xname(obj), s);
1460 */
1461         pline("\82±\82Ì%s\82É\82Í\82ë\82¤\82»\82­\82ª\82È\82¢\81D", xname(obj));
1462         return;
1463     }
1464     if (Underwater) {
1465 /*JP
1466         You("cannot make fire under water.");
1467 */
1468         You("\90\85\92\86\82Å\89Î\82ð\82¨\82±\82¹\82È\82¢\81D");
1469         return;
1470     }
1471     if (u.uswallow || obj->cursed) {
1472         if (!Blind)
1473 #if 0 /*JP*/
1474             pline_The("%s %s for a moment, then %s.", s, vtense(s, "flicker"),
1475                       vtense(s, "die"));
1476 #else
1477             pline("\82ë\82¤\82»\82­\82Ì\89\8a\82Í\82µ\82Î\82ç\82­\93_\96Å\82µ\81C\8fÁ\82¦\82½\81D");
1478 #endif
1479         return;
1480     }
1481     if (obj->spe < 7) {
1482 #if 0 /*JP*/
1483         There("%s only %d %s in %s.", vtense(s, "are"), obj->spe, s,
1484               the(xname(obj)));
1485 #else
1486         pline("%s\82É\82Í\82½\82Á\82½%d\96{\82Ì\82ë\82¤\82»\82­\82µ\82©\82È\82¢\81D",
1487               xname(obj), obj->spe);
1488 #endif
1489         if (!Blind)
1490 #if 0 /*JP*/
1491             pline("%s lit.  %s dimly.", obj->spe == 1 ? "It is" : "They are",
1492                   Tobjnam(obj, "shine"));
1493 #else
1494             pline("%s\82É\89Î\82ð\82Â\82¯\82½\81D%s\82Í\82Ù\82Ì\82©\82É\8bP\82¢\82½\81D",
1495                   xname(obj), xname(obj));
1496 #endif
1497     } else {
1498 #if 0 /*JP*/
1499         pline("%s's %s burn%s", The(xname(obj)), s,
1500               (Blind ? "." : " brightly!"));
1501 #else
1502         pline("%s\82Ì\82ë\82¤\82»\82­\82Í%s\94R\82¦\82 \82ª\82Á\82½\81I", The(xname(obj)),
1503               (Blind ? "" : "\96¾\82é\82­"));
1504 #endif
1505     }
1506     if (!invocation_pos(u.ux, u.uy) || On_stairs(u.ux, u.uy)) {
1507 /*JP
1508         pline_The("%s %s being rapidly consumed!", s, vtense(s, "are"));
1509 */
1510         pline("\82ë\82¤\82»\82­\82Í\82·\82²\82¢\91¬\82³\82Å\94R\82¦\8en\82ß\82½\81I");
1511         /* this used to be obj->age /= 2, rounding down; an age of
1512            1 would yield 0, confusing begin_burn() and producing an
1513            unlightable, unrefillable candelabrum; round up instead */
1514         obj->age = (obj->age + 1L) / 2L;
1515     } else {
1516         if (obj->spe == 7) {
1517             if (Blind)
1518 /*JP
1519                 pline("%s a strange warmth!", Tobjnam(obj, "radiate"));
1520 */
1521                 pline("\8aï\96­\82È\92g\82©\82³\82ð%s\82É\8a´\82\82½\81I", xname(obj));
1522             else
1523 /*JP
1524                 pline("%s with a strange light!", Tobjnam(obj, "glow"));
1525 */
1526                 pline("%s\82Í\8aï\96­\82È\8cõ\82ð\94­\82µ\82Ä\82¢\82é\81I", xname(obj));
1527         }
1528         obj->known = 1;
1529     }
1530     begin_burn(obj, FALSE);
1531 }
1532
1533 STATIC_OVL void
1534 use_candle(optr)
1535 struct obj **optr;
1536 {
1537     register struct obj *obj = *optr;
1538     register struct obj *otmp;
1539 /*JP
1540     const char *s = (obj->quan != 1) ? "candles" : "candle";
1541 */
1542     const char *s = "\82ë\82¤\82»\82­";
1543     char qbuf[QBUFSZ], qsfx[QBUFSZ], *q;
1544
1545     if (u.uswallow) {
1546         You(no_elbow_room);
1547         return;
1548     }
1549
1550     otmp = carrying(CANDELABRUM_OF_INVOCATION);
1551     if (!otmp || otmp->spe == 7) {
1552         use_lamp(obj);
1553         return;
1554     }
1555
1556     /*JP:\8dÅ\8fI\93I\82É\82Í\81u\82ë\82¤\82»\82­\82ð\90C\91ä\82É\8eæ\82è\82Â\82¯\82Ü\82·\82©\81H\81v*/
1557     /* first, minimal candelabrum suffix for formatting candles */
1558 /*JP
1559     Sprintf(qsfx, " to\033%s?", thesimpleoname(otmp));
1560 */
1561     Sprintf(qsfx, "\82ð\033%s\82É\8eæ\82è\82Â\82¯\82Ü\82·\82©\81H", thesimpleoname(otmp));
1562     /* next, format the candles as a prefix for the candelabrum */
1563 /*JP
1564     (void) safe_qbuf(qbuf, "Attach ", qsfx, obj, yname, thesimpleoname, s);
1565 */
1566     (void) safe_qbuf(qbuf, "", qsfx, obj, xname, thesimpleoname, s);
1567     /*JP:\81u(\82ë\82¤\82»\82­)\82ð\033\90C\91ä\82É\8eæ\82è\82Â\82¯\82Ü\82·\82©\81H\81v*/
1568     /* strip temporary candelabrum suffix */
1569 #if 0 /*JP*/
1570     if ((q = strstri(qbuf, " to\033")) != 0)
1571         Strcpy(q, " to ");
1572 #else
1573     if ((q = strchr(qbuf, '\033')) != 0)
1574         *q = '\0';
1575     /*JP:\81u(\82ë\82¤\82»\82­)\82ð\81v*/
1576 #endif
1577     /* last, format final "attach candles to candelabrum?" query */
1578 /*JP
1579     if (yn(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
1580 */
1581     if (yn(safe_qbuf(qbuf, qbuf, "\82É\8eæ\82è\82Â\82¯\82Ü\82·\82©\81H", otmp, xname, thesimpleoname, "\82»\82ê"))
1582         == 'n') {
1583         use_lamp(obj);
1584         return;
1585     } else {
1586         if ((long) otmp->spe + obj->quan > 7L) {
1587             obj = splitobj(obj, 7L - (long) otmp->spe);
1588 #if 0 /*JP:\93ú\96{\8cê\82Å\82Í\95s\97v*/
1589             /* avoid a grammatical error if obj->quan gets
1590                reduced to 1 candle from more than one */
1591             s = (obj->quan != 1) ? "candles" : "candle";
1592 #endif
1593         } else
1594             *optr = 0;
1595 #if 0 /*JP*/
1596         You("attach %ld%s %s to %s.", obj->quan, !otmp->spe ? "" : " more", s,
1597             the(xname(otmp)));
1598 #else
1599         You("%ld\96{\82Ì\82ë\82¤\82»\82­\82ð%s%s\82Ö\8eæ\82è\82Â\82¯\82½\81D",
1600             obj->quan, !otmp->spe ? "" : "\82³\82ç\82É",
1601             xname(otmp));
1602 #endif
1603         if (!otmp->spe || otmp->age > obj->age)
1604             otmp->age = obj->age;
1605         otmp->spe += (int) obj->quan;
1606         if (otmp->lamplit && !obj->lamplit)
1607 /*JP
1608             pline_The("new %s magically %s!", s, vtense(s, "ignite"));
1609 */
1610             pline("\90V\82µ\82¢\82ë\82¤\82»\82­\82Í\95s\8ev\8bc\82È\89\8a\82ð\82 \82°\82½\81I");
1611         else if (!otmp->lamplit && obj->lamplit)
1612 /*JP
1613             pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
1614 */
1615             pline("\89\8a\82Í\8fÁ\82¦\82½\81D");
1616         if (obj->unpaid)
1617 #if 0 /*JP*/
1618             verbalize("You %s %s, you bought %s!",
1619                       otmp->lamplit ? "burn" : "use",
1620                       (obj->quan > 1L) ? "them" : "it",
1621                       (obj->quan > 1L) ? "them" : "it");
1622 #else
1623             verbalize("\89Î\82ð\82Â\82¯\82½\82È\82ç\81C\94\83\82Á\82Ä\82à\82ç\82¨\82¤\81I");
1624 #endif
1625         if (obj->quan < 7L && otmp->spe == 7)
1626 #if 0 /*JP*/
1627             pline("%s now has seven%s candles attached.", The(xname(otmp)),
1628                   otmp->lamplit ? " lit" : "");
1629 #else
1630             pline("%s\82É\82Í\82·\82Å\82É7\96{\82Ì%s\82ë\82¤\82»\82­\82ª\8eæ\82è\82Â\82¯\82ç\82ê\82Ä\82¢\82é\81D",
1631                   The(xname(otmp)), otmp->lamplit ? "\89Î\82Ì\82Â\82¢\82½" : "");
1632 #endif
1633         /* candelabrum's light range might increase */
1634         if (otmp->lamplit)
1635             obj_merge_light_sources(otmp, otmp);
1636         /* candles are no longer a separate light source */
1637         if (obj->lamplit)
1638             end_burn(obj, TRUE);
1639         /* candles are now gone */
1640         useupall(obj);
1641     }
1642 }
1643
1644 /* call in drop, throw, and put in box, etc. */
1645 boolean
1646 snuff_candle(otmp)
1647 struct obj *otmp;
1648 {
1649     boolean candle = Is_candle(otmp);
1650
1651     if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
1652         && otmp->lamplit) {
1653         char buf[BUFSZ];
1654         xchar x, y;
1655 #if 0 /*JP*//* not used */
1656         boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
1657 #endif
1658
1659         (void) get_obj_location(otmp, &x, &y, 0);
1660         if (otmp->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1661 #if 0 /*JP*/
1662             pline("%s%scandle%s flame%s extinguished.", Shk_Your(buf, otmp),
1663                   (candle ? "" : "candelabrum's "), (many ? "s'" : "'s"),
1664                   (many ? "s are" : " is"));
1665 #else
1666             pline("%s%s\82ë\82¤\82»\82­\82Ì\89\8a\82Í\8fÁ\82¦\82½\81D", Shk_Your(buf, otmp),
1667                   candle ? "" : "\90C\91ä\82Ì");
1668 #endif
1669         end_burn(otmp, TRUE);
1670         return TRUE;
1671     }
1672     return FALSE;
1673 }
1674
1675 /* called when lit lamp is hit by water or put into a container or
1676    you've been swallowed by a monster; obj might be in transit while
1677    being thrown or dropped so don't assume that its location is valid */
1678 boolean
1679 snuff_lit(obj)
1680 struct obj *obj;
1681 {
1682     xchar x, y;
1683
1684     if (obj->lamplit) {
1685         if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1686             || obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL) {
1687             (void) get_obj_location(obj, &x, &y, 0);
1688             if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1689 /*JP
1690                 pline("%s %s out!", Yname2(obj), otense(obj, "go"));
1691 */
1692                 pline("%s\82Í\8fÁ\82¦\82½\81I", Yname2(obj));
1693             end_burn(obj, TRUE);
1694             return TRUE;
1695         }
1696         if (snuff_candle(obj))
1697             return TRUE;
1698     }
1699     return FALSE;
1700 }
1701
1702 /* Called when potentially lightable object is affected by fire_damage().
1703    Return TRUE if object was lit and FALSE otherwise --ALI */
1704 boolean
1705 catch_lit(obj)
1706 struct obj *obj;
1707 {
1708     xchar x, y;
1709
1710     if (!obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) {
1711         if ((obj->otyp == MAGIC_LAMP
1712              || obj->otyp == CANDELABRUM_OF_INVOCATION) && obj->spe == 0)
1713             return FALSE;
1714         else if (obj->otyp != MAGIC_LAMP && obj->age == 0)
1715             return FALSE;
1716         if (!get_obj_location(obj, &x, &y, 0))
1717             return FALSE;
1718         if (obj->otyp == CANDELABRUM_OF_INVOCATION && obj->cursed)
1719             return FALSE;
1720         if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1721              || obj->otyp == BRASS_LANTERN) && obj->cursed && !rn2(2))
1722             return FALSE;
1723         if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1724 /*JP
1725             pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
1726 */
1727             pline("%s\82Ì\96¾\82©\82è\82ª\82Â\82¢\82½\81I", Yname2(obj));
1728         if (obj->otyp == POT_OIL)
1729             makeknown(obj->otyp);
1730         if (carried(obj) && obj->unpaid && costly_spot(u.ux, u.uy)) {
1731             /* if it catches while you have it, then it's your tough luck */
1732             check_unpaid(obj);
1733 #if 0 /*JP:T*/
1734             verbalize("That's in addition to the cost of %s %s, of course.",
1735                       yname(obj), obj->quan == 1L ? "itself" : "themselves");
1736 #else
1737             verbalize("\82±\82ê\82Í\82à\82¿\82ë\82ñ%s\82Ì\92l\92i\82Æ\82Í\95Ê\82¾\82æ\81D", xname(obj));
1738 #endif
1739             bill_dummy_object(obj);
1740         }
1741         begin_burn(obj, FALSE);
1742         return TRUE;
1743     }
1744     return FALSE;
1745 }
1746
1747 STATIC_OVL void
1748 use_lamp(obj)
1749 struct obj *obj;
1750 {
1751     char buf[BUFSZ];
1752
1753     if (obj->lamplit) {
1754         if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1755             || obj->otyp == BRASS_LANTERN)
1756 /*JP
1757             pline("%slamp is now off.", Shk_Your(buf, obj));
1758 */
1759             pline("%s\83\89\83\93\83v\82Ì\93\94\82Í\8fÁ\82¦\82½\81D", Shk_Your(buf, obj));
1760         else
1761 /*JP
1762             You("snuff out %s.", yname(obj));
1763 */
1764             You("%s\82ð\90\81\82«\8fÁ\82µ\82½\81D", xname(obj));
1765         end_burn(obj, TRUE);
1766         return;
1767     }
1768     if (Underwater) {
1769 #if 0 /*JP*/
1770         pline(!Is_candle(obj) ? "This is not a diving lamp"
1771                               : "Sorry, fire and water don't mix.");
1772 #else
1773         pline(!Is_candle(obj) ? "\82±\82ê\82Í\90ö\90\85\97p\82Ì\83\89\83\93\83v\82\82á\82È\82¢\81D"
1774                               : "\8ec\94O\82È\82ª\82ç\81C\89Î\82Æ\90\85\82Í\82Ü\82´\82ç\82È\82¢\81D");
1775 #endif
1776         return;
1777     }
1778     /* magic lamps with an spe == 0 (wished for) cannot be lit */
1779     if ((!Is_candle(obj) && obj->age == 0)
1780         || (obj->otyp == MAGIC_LAMP && obj->spe == 0)) {
1781         if (obj->otyp == BRASS_LANTERN)
1782 /*JP
1783             Your("lamp has run out of power.");
1784 */
1785             Your("\83\89\83\93\83v\82Ì\93d\97Í\82ð\8eg\82¢\90Ø\82Á\82Ä\82µ\82Ü\82Á\82½\81D");
1786         else
1787 /*JP
1788             pline("This %s has no oil.", xname(obj));
1789 */
1790             pline("\82±\82Ì%s\82É\82Í\82à\82¤\83I\83C\83\8b\82ª\82È\82¢\81D", xname(obj));
1791         return;
1792     }
1793     if (obj->cursed && !rn2(2)) {
1794         if (!Blind)
1795 #if 0 /*JP*/
1796             pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
1797                   otense(obj, "die"));
1798 #else
1799             pline("%s\82Í\82µ\82Î\82ç\82­\82Ì\8aÔ\93_\96Å\82µ\81C\8fÁ\82¦\82½\81D",
1800                   xname(obj));
1801 #endif
1802     } else {
1803         if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1804             || obj->otyp == BRASS_LANTERN) {
1805             check_unpaid(obj);
1806 /*JP
1807             pline("%slamp is now on.", Shk_Your(buf, obj));
1808 */
1809             pline("%s\83\89\83\93\83v\82É\93\94\82ª\93\94\82Á\82½\81D", Shk_Your(buf, obj));
1810         } else { /* candle(s) */
1811 #if 0 /*JP*/
1812             pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
1813                   otense(obj, "burn"), Blind ? "." : " brightly!");
1814 #else
1815             pline("%s\82Í%s\94R\82¦\82 \82ª\82Á\82½\81I",
1816                   xname(obj), Blind ? "" : "\96¾\82é\82­");
1817 #endif
1818             if (obj->unpaid && costly_spot(u.ux, u.uy)
1819                 && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
1820 #if 0 /*JP*/
1821                 const char *ithem = (obj->quan > 1L) ? "them" : "it";
1822
1823                 verbalize("You burn %s, you bought %s!", ithem, ithem);
1824 #else
1825                 verbalize("\93\94\82ð\82Â\82¯\82½\82È\82ç\81C\94\83\82Á\82Ä\82à\82ç\82¨\82¤\81I");
1826 #endif
1827                 bill_dummy_object(obj);
1828             }
1829         }
1830         begin_burn(obj, FALSE);
1831     }
1832 }
1833
1834 STATIC_OVL void
1835 light_cocktail(obj)
1836 struct obj *obj; /* obj is a potion of oil */
1837 {
1838     char buf[BUFSZ];
1839     boolean split1off;
1840
1841     if (u.uswallow) {
1842         You(no_elbow_room);
1843         return;
1844     }
1845
1846     if (obj->lamplit) {
1847 /*JP
1848         You("snuff the lit potion.");
1849 */
1850         You("\96û\95r\82Ì\89Î\82ð\90\81\82«\8fÁ\82µ\82½\81D");
1851         end_burn(obj, TRUE);
1852         /*
1853          * Free & add to re-merge potion.  This will average the
1854          * age of the potions.  Not exactly the best solution,
1855          * but its easy.
1856          */
1857         freeinv(obj);
1858         (void) addinv(obj);
1859         return;
1860     } else if (Underwater) {
1861 /*JP
1862         There("is not enough oxygen to sustain a fire.");
1863 */
1864         pline("\89Î\82ð\82Â\82¯\82é\82Ì\82É\8f\\95ª\82È\8e_\91f\82ª\82È\82¢\81D");
1865         return;
1866     }
1867
1868     split1off = (obj->quan > 1L);
1869     if (split1off)
1870         obj = splitobj(obj, 1L);
1871
1872 #if 0 /*JP*/
1873     You("light %spotion.%s", shk_your(buf, obj),
1874         Blind ? "" : "  It gives off a dim light.");
1875 #else
1876     You("%s\96û\95r\82É\89Î\82ð\82Â\82¯\82½\81D%s", shk_your(buf, obj),
1877         Blind ? "" : "\96û\95r\82Í\88Ã\82¢\8cõ\82ð\82Í\82È\82Á\82½\81D");
1878 #endif
1879
1880     if (obj->unpaid && costly_spot(u.ux, u.uy)) {
1881         /* Normally, we shouldn't both partially and fully charge
1882          * for an item, but (Yendorian Fuel) Taxes are inevitable...
1883          */
1884         check_unpaid(obj);
1885 /*JP
1886         verbalize("That's in addition to the cost of the potion, of course.");
1887 */
1888         verbalize("\82±\82ê\82Í\82à\82¿\82ë\82ñ\96û\95r\82Ì\92l\92i\82Æ\82Í\95Ê\82¾\82æ\81D");
1889         bill_dummy_object(obj);
1890     }
1891     makeknown(obj->otyp);
1892
1893     begin_burn(obj, FALSE); /* after shop billing */
1894     if (split1off) {
1895         obj_extract_self(obj); /* free from inv */
1896         obj->nomerge = 1;
1897 /*JP
1898         obj = hold_another_object(obj, "You drop %s!", doname(obj),
1899 */
1900         obj = hold_another_object(obj, "\82 \82È\82½\82Í%s\82ð\97\8e\82µ\82½\81I", doname(obj),
1901                                   (const char *) 0);
1902         if (obj)
1903             obj->nomerge = 0;
1904     }
1905 }
1906
1907 static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
1908
1909 int
1910 dorub()
1911 {
1912     struct obj *obj = getobj(cuddly, "rub");
1913
1914     if (obj && obj->oclass == GEM_CLASS) {
1915         if (is_graystone(obj)) {
1916             use_stone(obj);
1917             return 1;
1918         } else {
1919 /*JP
1920             pline("Sorry, I don't know how to use that.");
1921 */
1922             pline("\8ec\94O\81D\8eg\82¢\95û\82ª\82í\82©\82ç\82È\82¢\81D");
1923             return 0;
1924         }
1925     }
1926
1927     if (!obj || !wield_tool(obj, "rub"))
1928         return 0;
1929
1930     /* now uwep is obj */
1931     if (uwep->otyp == MAGIC_LAMP) {
1932         if (uwep->spe > 0 && !rn2(3)) {
1933             check_unpaid_usage(uwep, TRUE); /* unusual item use */
1934             /* bones preparation:  perform the lamp transformation
1935                before releasing the djinni in case the latter turns out
1936                to be fatal (a hostile djinni has no chance to attack yet,
1937                but an indebted one who grants a wish might bestow an
1938                artifact which blasts the hero with lethal results) */
1939             uwep->otyp = OIL_LAMP;
1940             uwep->spe = 0; /* for safety */
1941             uwep->age = rn1(500, 1000);
1942             if (uwep->lamplit)
1943                 begin_burn(uwep, TRUE);
1944             djinni_from_bottle(uwep);
1945             makeknown(MAGIC_LAMP);
1946             update_inventory();
1947         } else if (rn2(2)) {
1948 /*JP
1949             You("%s smoke.", !Blind ? "see a puff of" : "smell");
1950 */
1951             pline("\82¯\82Þ\82è%s\81D", !Blind ? "\82ª\95\91\82¢\82 \82ª\82Á\82½" : "\82Ì\93õ\82¢\82ª\82µ\82½");
1952         } else
1953             pline1(nothing_happens);
1954     } else if (obj->otyp == BRASS_LANTERN) {
1955         /* message from Adventure */
1956 /*JP
1957         pline("Rubbing the electric lamp is not particularly rewarding.");
1958 */
1959         pline("\93d\8bC\83\89\83\93\83v\82ð\82±\82·\82Á\82Ä\82à\88Ó\96¡\82Í\82È\82¢\82Æ\8ev\82¤\82ª\81D\81D\81D");
1960 /*JP
1961         pline("Anyway, nothing exciting happens.");
1962 */
1963         pline("\82â\82Á\82Ï\82è\81C\89½\82à\8bN\82«\82È\82©\82Á\82½\81D");
1964     } else
1965         pline1(nothing_happens);
1966     return 1;
1967 }
1968
1969 int
1970 dojump()
1971 {
1972     /* Physical jump */
1973     return jump(0);
1974 }
1975
1976 boolean
1977 is_valid_jump_pos(x, y, magic, showmsg)
1978 int x, y, magic;
1979 boolean showmsg;
1980 {
1981     if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
1982         /* The Knight jumping restriction still applies when riding a
1983          * horse.  After all, what shape is the knight piece in chess?
1984          */
1985         if (showmsg)
1986 /*JP
1987             pline("Illegal move!");
1988 */
1989             pline("\82»\82Ì\88Ú\93®\82Í\8cj\94n\92µ\82Ñ\82\82á\82È\82¢\81I");
1990         return FALSE;
1991     } else if (distu(x, y) > (magic ? 6 + magic * 3 : 9)) {
1992         if (showmsg)
1993 /*JP
1994             pline("Too far!");
1995 */
1996             pline("\89\93\82·\82¬\82é\81I");
1997         return FALSE;
1998     } else if (!cansee(x, y)) {
1999         if (showmsg)
2000 /*JP
2001             You("cannot see where to land!");
2002 */
2003             You("\92\85\92n\93_\82ª\8c©\82¦\82È\82¢\81I");
2004         return FALSE;
2005     } else if (!isok(x, y)) {
2006         if (showmsg)
2007 /*JP
2008             You("cannot jump there!");
2009 */
2010             You("\82»\82±\82É\82Í\94ò\82×\82È\82¢\81I");
2011         return FALSE;
2012     }
2013     return TRUE;
2014 }
2015
2016 static int jumping_is_magic;
2017
2018 void
2019 display_jump_positions(state)
2020 int state;
2021 {
2022     if (state == 0) {
2023         tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
2024     } else if (state == 1) {
2025         int x, y, dx, dy;
2026
2027         for (dx = -4; dx <= 4; dx++)
2028             for (dy = -4; dy <= 4; dy++) {
2029                 x = dx + (int) u.ux;
2030                 y = dy + (int) u.uy;
2031                 if (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
2032                     && is_valid_jump_pos(x, y, jumping_is_magic, FALSE))
2033                     tmp_at(x, y);
2034             }
2035     } else {
2036         tmp_at(DISP_END, 0);
2037     }
2038 }
2039
2040 int
2041 jump(magic)
2042 int magic; /* 0=Physical, otherwise skill level */
2043 {
2044     coord cc;
2045
2046     if (!magic && (nolimbs(youmonst.data) || slithy(youmonst.data))) {
2047         /* normally (nolimbs || slithy) implies !Jumping,
2048            but that isn't necessarily the case for knights */
2049 /*JP
2050         You_cant("jump; you have no legs!");
2051 */
2052         pline("\91«\82ª\96³\82­\82Ä\82Í\92µ\82×\82È\82¢\81I");
2053         return 0;
2054     } else if (!magic && !Jumping) {
2055 /*JP
2056         You_cant("jump very far.");
2057 */
2058         You_cant("\82»\82ñ\82È\89\93\82­\82Ü\82Å\92µ\82×\82È\82¢\81D");
2059         return 0;
2060     /* if steed is immobile, can't do physical jump but can do spell one */
2061     } else if (!magic && u.usteed && stucksteed(FALSE)) {
2062         /* stucksteed gave "<steed> won't move" message */
2063         return 0;
2064     } else if (u.uswallow) {
2065         if (magic) {
2066 /*JP
2067             You("bounce around a little.");
2068 */
2069             pline("\94½\93®\82ð\82Â\82¯\82½\81D");
2070             return 1;
2071         }
2072 /*JP
2073         pline("You've got to be kidding!");
2074 */
2075         pline("\8fç\92k\82Í\82æ\82µ\82±\82³\82ñ\81I");
2076         return 0;
2077     } else if (u.uinwater) {
2078         if (magic) {
2079 /*JP
2080             You("swish around a little.");
2081 */
2082             pline("\83X\83C\83X\83C\82Æ\89j\82¢\82¾\81D");
2083             return 1;
2084         }
2085 /*JP
2086         pline("This calls for swimming, not jumping!");
2087 */
2088         pline("\82»\82ê\82Í\81w\89j\82®\81x\82Å\82 \82Á\82Ä\81C\81w\92µ\82Ô\81x\82\82á\82È\82¢\81I");
2089         return 0;
2090     } else if (u.ustuck) {
2091         if (u.ustuck->mtame && !Conflict && !u.ustuck->mconf) {
2092 /*JP
2093             You("pull free from %s.", mon_nam(u.ustuck));
2094 */
2095             You("%s\82©\82ç\97£\82ê\82½\81D", mon_nam(u.ustuck));
2096             u.ustuck = 0;
2097             return 1;
2098         }
2099         if (magic) {
2100 /*JP
2101             You("writhe a little in the grasp of %s!", mon_nam(u.ustuck));
2102 */
2103             You("%s\82©\82ç\93¦\82ê\82æ\82¤\82Æ\83W\83^\83o\83^\82µ\82½\81I", mon_nam(u.ustuck));
2104             return 1;
2105         }
2106 /*JP
2107         You("cannot escape from %s!", mon_nam(u.ustuck));
2108 */
2109         You("%s\82©\82ç\93¦\82ê\82ç\82ê\82È\82¢\81I", mon_nam(u.ustuck));
2110         return 0;
2111     } else if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
2112         if (magic) {
2113 /*JP
2114             You("flail around a little.");
2115 */
2116             You("\83o\83^\83o\83^\92µ\82ñ\82¾\81D");
2117             return 1;
2118         }
2119 /*JP
2120         You("don't have enough traction to jump.");
2121 */
2122         You("\92µ\82Ô\82½\82ß\82Ì\94½\93®\82ª\82Â\82¯\82ç\82ê\82È\82¢\81D");
2123         return 0;
2124     } else if (!magic && near_capacity() > UNENCUMBERED) {
2125 /*JP
2126         You("are carrying too much to jump!");
2127 */
2128         You("\82½\82­\82³\82ñ\95¨\82ð\8e\9d\82¿\82·\82¬\82Ä\92µ\82×\82È\82¢\81I");
2129         return 0;
2130     } else if (!magic && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
2131 /*JP
2132         You("lack the strength to jump!");
2133 */
2134         You("\92µ\82Ô\82¾\82¯\82Ì\97Í\82ª\82È\82¢\81I");
2135         return 0;
2136     } else if (!magic && Wounded_legs) {
2137         long wl = (Wounded_legs & BOTH_SIDES);
2138         const char *bp = body_part(LEG);
2139
2140         if (wl == BOTH_SIDES)
2141             bp = makeplural(bp);
2142         if (u.usteed)
2143 /*JP
2144             pline("%s is in no shape for jumping.", Monnam(u.usteed));
2145 */
2146             pline("%s\82Í\92µ\82×\82é\8fó\91Ô\82Å\82Í\82È\82¢\81D", Monnam(u.usteed));
2147         else
2148 #if 0 /*JP*/
2149             Your("%s%s %s in no shape for jumping.",
2150                  (wl == LEFT_SIDE) ? "left " : (wl == RIGHT_SIDE) ? "right "
2151                                                                   : "",
2152                  bp, (wl == BOTH_SIDES) ? "are" : "is");
2153 #else
2154           Your("%s%s\82Í\92µ\82×\82é\8fó\91Ô\82Å\82Í\82È\82¢\81D",
2155                  (wl == LEFT_SIDE) ? "\8d¶" :
2156                  (wl == RIGHT_SIDE) ? "\89E" : "", bp);
2157 #endif
2158         return 0;
2159     } else if (u.usteed && u.utrap) {
2160 /*JP
2161         pline("%s is stuck in a trap.", Monnam(u.usteed));
2162 */
2163         pline("%s\82Íã©\82É\82Ð\82Á\82©\82©\82Á\82Ä\82¢\82é\81D", Monnam(u.usteed));
2164         return 0;
2165     }
2166
2167 /*JP
2168     pline("Where do you want to jump?");
2169 */
2170     pline("\82Ç\82±\82É\92µ\82Ñ\82Ü\82·\82©\81H");
2171     cc.x = u.ux;
2172     cc.y = u.uy;
2173     jumping_is_magic = magic;
2174     getpos_sethilite(display_jump_positions);
2175 /*JP
2176     if (getpos(&cc, TRUE, "the desired position") < 0)
2177 */
2178     if (getpos(&cc, TRUE, "\92µ\82Ñ\82½\82¢\8fê\8f\8a") < 0)
2179         return 0; /* user pressed ESC */
2180     if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) {
2181         return 0;
2182     } else {
2183         coord uc;
2184         int range, temp;
2185
2186         if (u.utrap)
2187             switch (u.utraptype) {
2188             case TT_BEARTRAP: {
2189                 long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
2190
2191 /*JP
2192                 You("rip yourself free of the bear trap!  Ouch!");
2193 */
2194                 You("\8e©\95ª\82ð\8cF\82Ìã©\82©\82ç\82Ð\82«\82Í\82ª\82µ\82½\81C\82¢\82Ä\82Á\81I");
2195 /*JP
2196                 losehp(Maybe_Half_Phys(rnd(10)), "jumping out of a bear trap",
2197 */
2198                 losehp(Maybe_Half_Phys(rnd(10)), "\8cF\82Ìã©\82©\82ç\94ò\82Ñ\8fo\82æ\82¤\82Æ\82µ\82Ä",
2199                        KILLED_BY);
2200                 set_wounded_legs(side, rn1(1000, 500));
2201                 break;
2202             }
2203             case TT_PIT:
2204 /*JP
2205                 You("leap from the pit!");
2206 */
2207                 You("\97\8e\82µ\8c\8a\82©\82ç\94ò\82Ñ\8fo\82½\81I");
2208                 break;
2209             case TT_WEB:
2210 /*JP
2211                 You("tear the web apart as you pull yourself free!");
2212 */
2213                 You("\82­\82à\82Ì\91\83\82ð\88ø\82«\97ô\82«\81C\8e©\97R\82É\82È\82Á\82½\81I");
2214                 deltrap(t_at(u.ux, u.uy));
2215                 break;
2216             case TT_LAVA:
2217 /*JP
2218                 You("pull yourself above the lava!");
2219 */
2220                 You("\97n\8aâ\82©\82ç\94ò\82Ñ\8fo\82½\81I");
2221                 u.utrap = 0;
2222                 return 1;
2223             case TT_BURIEDBALL:
2224             case TT_INFLOOR:
2225 #if 0 /*JP*/
2226                 You("strain your %s, but you're still %s.",
2227                     makeplural(body_part(LEG)),
2228                     (u.utraptype == TT_INFLOOR)
2229                         ? "stuck in the floor"
2230                         : "attached to the buried ball");
2231 #else
2232                 You("%s\82ð\88ø\82Á\82Ï\82Á\82½\82ª\81C\82 \82È\82½\82Í\82Ü\82¾%s\81D",
2233                     makeplural(body_part(LEG)),
2234                     (u.utraptype == TT_INFLOOR)
2235                         ? "\8f°\82É\82¤\82Ü\82Á\82Ä\82¢\82é"
2236                         : "\82¤\82Ü\82Á\82½\8b\85\82Æ\82Â\82È\82ª\82Á\82Ä\82¢\82é");
2237 #endif
2238                 set_wounded_legs(LEFT_SIDE, rn1(10, 11));
2239                 set_wounded_legs(RIGHT_SIDE, rn1(10, 11));
2240                 return 1;
2241             }
2242
2243         /*
2244          * Check the path from uc to cc, calling hurtle_step at each
2245          * location.  The final position actually reached will be
2246          * in cc.
2247          */
2248         uc.x = u.ux;
2249         uc.y = u.uy;
2250         /* calculate max(abs(dx), abs(dy)) as the range */
2251         range = cc.x - uc.x;
2252         if (range < 0)
2253             range = -range;
2254         temp = cc.y - uc.y;
2255         if (temp < 0)
2256             temp = -temp;
2257         if (range < temp)
2258             range = temp;
2259         (void) walk_path(&uc, &cc, hurtle_step, (genericptr_t) &range);
2260         teleds(cc.x, cc.y, TRUE);
2261         sokoban_guilt();
2262         nomul(-1);
2263 /*JP
2264         multi_reason = "jumping around";
2265 */
2266         multi_reason = "\92µ\82Ë\89ñ\82Á\82Ä\82¢\82é\8e\9e\82É";
2267         nomovemsg = "";
2268         morehungry(rnd(25));
2269         return 1;
2270     }
2271 }
2272
2273 boolean
2274 tinnable(corpse)
2275 struct obj *corpse;
2276 {
2277     if (corpse->oeaten)
2278         return 0;
2279     if (!mons[corpse->corpsenm].cnutrit)
2280         return 0;
2281     return 1;
2282 }
2283
2284 STATIC_OVL void
2285 use_tinning_kit(obj)
2286 struct obj *obj;
2287 {
2288     struct obj *corpse, *can;
2289
2290     /* This takes only 1 move.  If this is to be changed to take many
2291      * moves, we've got to deal with decaying corpses...
2292      */
2293     if (obj->spe <= 0) {
2294 /*JP
2295         You("seem to be out of tins.");
2296 */
2297         pline("\8aÊ\8bl\82ð\8dì\82é\82½\82ß\82Ì\8aÊ\82ª\90Ø\82ê\82½\82æ\82¤\82¾\81D");
2298         return;
2299     }
2300 /*JP
2301     if (!(corpse = floorfood("tin", 2)))
2302 */
2303     if (!(corpse = floorfood("\8aÊ\8bl\82ß\82É\82·\82é", 2)))
2304         return;
2305     if (corpse->oeaten) {
2306 /*JP
2307         You("cannot tin %s which is partly eaten.", something);
2308 */
2309         You("\90H\82×\82©\82¯\82Ì\82à\82Ì\82ð\8aÊ\8bl\82É\82·\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
2310         return;
2311     }
2312     if (touch_petrifies(&mons[corpse->corpsenm]) && !Stone_resistance
2313         && !uarmg) {
2314         char kbuf[BUFSZ];
2315
2316         if (poly_when_stoned(youmonst.data))
2317 #if 0 /*JP*/
2318             You("tin %s without wearing gloves.",
2319                 an(mons[corpse->corpsenm].mname));
2320 #else
2321             You("\8f¬\8eè\82È\82µ\82Å%s\82ð\8aÊ\8bl\82É\82µ\82æ\82¤\82Æ\82µ\82½\81D",
2322                 mons[corpse->corpsenm].mname);
2323 #endif
2324         else {
2325 #if 0 /*JP*/
2326             pline("Tinning %s without wearing gloves is a fatal mistake...",
2327                   an(mons[corpse->corpsenm].mname));
2328 #else
2329             pline("%s\82ð\8f¬\8eè\82È\82µ\82Å\8aÊ\8bl\82É\82·\82é\82Ì\82Í\92v\96½\93I\82È\8aÔ\88á\82¢\82¾\81D\81D\81D",
2330                   mons[corpse->corpsenm].mname);
2331 #endif
2332 #if 0 /*JP*/
2333             Sprintf(kbuf, "trying to tin %s without gloves",
2334                     an(mons[corpse->corpsenm].mname));
2335 #else
2336             Sprintf(kbuf, "\8f¬\8eè\82ð\82Â\82¯\82¸\82É%s\82ð\8aÊ\8bl\82É\82µ\82æ\82¤\82Æ\82µ\82Ä",
2337                     mons[corpse->corpsenm].mname);
2338 #endif
2339         }
2340         instapetrify(kbuf);
2341     }
2342     if (is_rider(&mons[corpse->corpsenm])) {
2343         if (revive_corpse(corpse))
2344 /*JP
2345             verbalize("Yes...  But War does not preserve its enemies...");
2346 */
2347             verbalize("\82»\82¤\82¾\81D\81D\81D\82µ\82©\82µ\81u\90í\91\88\81v\82Í\93G\82É\88À\82ç\82¬\82ð\97^\82¦\82Ê\81D\81D\81D");
2348         else
2349 /*JP
2350             pline_The("corpse evades your grasp.");
2351 */
2352             pline("\8e\80\91Ì\82Í\82 \82È\82½\82Ì\8eè\82ð\93¦\82ê\82½\81D");
2353         return;
2354     }
2355     if (mons[corpse->corpsenm].cnutrit == 0) {
2356 /*JP
2357         pline("That's too insubstantial to tin.");
2358 */
2359         pline("\8eÀ\91Ì\82ª\82È\82¢\82Ì\82Å\8aÊ\8bl\82É\82Å\82«\82È\82¢\81D");
2360         return;
2361     }
2362     consume_obj_charge(obj, TRUE);
2363
2364     if ((can = mksobj(TIN, FALSE, FALSE)) != 0) {
2365 /*JP
2366         static const char you_buy_it[] = "You tin it, you bought it!";
2367 */
2368         static const char you_buy_it[] = "\8aÊ\8bl\82É\82µ\82½\82Ì\82È\82ç\94\83\82Á\82Ä\82à\82ç\82¤\82æ\81I";
2369
2370         can->corpsenm = corpse->corpsenm;
2371         can->cursed = obj->cursed;
2372         can->blessed = obj->blessed;
2373         can->owt = weight(can);
2374         can->known = 1;
2375         /* Mark tinned tins. No spinach allowed... */
2376         set_tin_variety(can, HOMEMADE_TIN);
2377         if (carried(corpse)) {
2378             if (corpse->unpaid)
2379                 verbalize(you_buy_it);
2380             useup(corpse);
2381         } else {
2382             if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge)
2383                 verbalize(you_buy_it);
2384             useupf(corpse, 1L);
2385         }
2386 /*JP
2387         can = hold_another_object(can, "You make, but cannot pick up, %s.",
2388 */
2389         can = hold_another_object(can, "\8aÊ\8bl\82É\82Å\82«\82½\82ª\81C%s\82ð\8e\9d\82Â\82±\82Æ\82ª\82Å\82«\82È\82¢\81D",
2390                                   doname(can), (const char *) 0);
2391     } else
2392         impossible("Tinning failed.");
2393 }
2394
2395 void
2396 use_unicorn_horn(obj)
2397 struct obj *obj;
2398 {
2399 #define PROP_COUNT 7           /* number of properties we're dealing with */
2400 #define ATTR_COUNT (A_MAX * 3) /* number of attribute points we might fix */
2401     int idx, val, val_limit, trouble_count, unfixable_trbl, did_prop,
2402         did_attr;
2403     int trouble_list[PROP_COUNT + ATTR_COUNT];
2404
2405     if (obj && obj->cursed) {
2406         long lcount = (long) rn1(90, 10);
2407
2408         switch (rn2(13) / 2) { /* case 6 is half as likely as the others */
2409         case 0:
2410             make_sick((Sick & TIMEOUT) ? (Sick & TIMEOUT) / 3L + 1L
2411                                        : (long) rn1(ACURR(A_CON), 20),
2412                       xname(obj), TRUE, SICK_NONVOMITABLE);
2413             break;
2414         case 1:
2415             make_blinded((Blinded & TIMEOUT) + lcount, TRUE);
2416             break;
2417         case 2:
2418             if (!Confusion)
2419 #if 0 /*JP*/
2420                 You("suddenly feel %s.",
2421                     Hallucination ? "trippy" : "confused");
2422 #else
2423                 You("\93Ë\91R%s\81D",
2424                     Hallucination ? "\82Ö\82ë\82Ö\82ë\82É\82È\82Á\82½" : "\8d¬\97\90\82µ\82½");
2425 #endif
2426             make_confused((HConfusion & TIMEOUT) + lcount, TRUE);
2427             break;
2428         case 3:
2429             make_stunned((HStun & TIMEOUT) + lcount, TRUE);
2430             break;
2431         case 4:
2432             (void) adjattrib(rn2(A_MAX), -1, FALSE);
2433             break;
2434         case 5:
2435             (void) make_hallucinated((HHallucination & TIMEOUT) + lcount,
2436                                      TRUE, 0L);
2437             break;
2438         case 6:
2439             if (Deaf) /* make_deaf() won't give feedback when already deaf */
2440 /*JP
2441                 pline("Nothing seems to happen.");
2442 */
2443                 pline("\89½\82à\8bN\82«\82È\82©\82Á\82½\82æ\82¤\82¾\81D");
2444             make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
2445             break;
2446         }
2447         return;
2448     }
2449
2450 /*
2451  * Entries in the trouble list use a very simple encoding scheme.
2452  */
2453 #define prop2trbl(X) ((X) + A_MAX)
2454 #define attr2trbl(Y) (Y)
2455 #define prop_trouble(X) trouble_list[trouble_count++] = prop2trbl(X)
2456 #define attr_trouble(Y) trouble_list[trouble_count++] = attr2trbl(Y)
2457 #define TimedTrouble(P) (((P) && !((P) & ~TIMEOUT)) ? ((P) & TIMEOUT) : 0L)
2458
2459     trouble_count = unfixable_trbl = did_prop = did_attr = 0;
2460
2461     /* collect property troubles */
2462     if (TimedTrouble(Sick))
2463         prop_trouble(SICK);
2464     if (TimedTrouble(Blinded) > (long) u.ucreamed
2465         && !(u.uswallow
2466              && attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
2467         prop_trouble(BLINDED);
2468     if (TimedTrouble(HHallucination))
2469         prop_trouble(HALLUC);
2470     if (TimedTrouble(Vomiting))
2471         prop_trouble(VOMITING);
2472     if (TimedTrouble(HConfusion))
2473         prop_trouble(CONFUSION);
2474     if (TimedTrouble(HStun))
2475         prop_trouble(STUNNED);
2476     if (TimedTrouble(HDeaf))
2477         prop_trouble(DEAF);
2478
2479     unfixable_trbl = unfixable_trouble_count(TRUE);
2480
2481     /* collect attribute troubles */
2482     for (idx = 0; idx < A_MAX; idx++) {
2483         if (ABASE(idx) >= AMAX(idx))
2484             continue;
2485         val_limit = AMAX(idx);
2486         /* don't recover strength lost from hunger */
2487         if (idx == A_STR && u.uhs >= WEAK)
2488             val_limit--;
2489         if (Fixed_abil) {
2490             /* potion/spell of restore ability override sustain ability
2491                intrinsic but unicorn horn usage doesn't */
2492             unfixable_trbl += val_limit - ABASE(idx);
2493             continue;
2494         }
2495         /* don't recover more than 3 points worth of any attribute */
2496         if (val_limit > ABASE(idx) + 3)
2497             val_limit = ABASE(idx) + 3;
2498
2499         for (val = ABASE(idx); val < val_limit; val++)
2500             attr_trouble(idx);
2501         /* keep track of unfixed trouble, for message adjustment below */
2502         unfixable_trbl += (AMAX(idx) - val_limit);
2503     }
2504
2505     if (trouble_count == 0) {
2506         pline1(nothing_happens);
2507         return;
2508     } else if (trouble_count > 1) { /* shuffle */
2509         int i, j, k;
2510
2511         for (i = trouble_count - 1; i > 0; i--)
2512             if ((j = rn2(i + 1)) != i) {
2513                 k = trouble_list[j];
2514                 trouble_list[j] = trouble_list[i];
2515                 trouble_list[i] = k;
2516             }
2517     }
2518
2519     /*
2520      *  Chances for number of troubles to be fixed
2521      *               0      1      2      3      4      5      6      7
2522      *   blessed:  22.7%  22.7%  19.5%  15.4%  10.7%   5.7%   2.6%   0.8%
2523      *  uncursed:  35.4%  35.4%  22.9%   6.3%    0      0      0      0
2524      */
2525     val_limit = rn2(d(2, (obj && obj->blessed) ? 4 : 2));
2526     if (val_limit > trouble_count)
2527         val_limit = trouble_count;
2528
2529     /* fix [some of] the troubles */
2530     for (val = 0; val < val_limit; val++) {
2531         idx = trouble_list[val];
2532
2533         switch (idx) {
2534         case prop2trbl(SICK):
2535             make_sick(0L, (char *) 0, TRUE, SICK_ALL);
2536             did_prop++;
2537             break;
2538         case prop2trbl(BLINDED):
2539             make_blinded((long) u.ucreamed, TRUE);
2540             did_prop++;
2541             break;
2542         case prop2trbl(HALLUC):
2543             (void) make_hallucinated(0L, TRUE, 0L);
2544             did_prop++;
2545             break;
2546         case prop2trbl(VOMITING):
2547             make_vomiting(0L, TRUE);
2548             did_prop++;
2549             break;
2550         case prop2trbl(CONFUSION):
2551             make_confused(0L, TRUE);
2552             did_prop++;
2553             break;
2554         case prop2trbl(STUNNED):
2555             make_stunned(0L, TRUE);
2556             did_prop++;
2557             break;
2558         case prop2trbl(DEAF):
2559             make_deaf(0L, TRUE);
2560             did_prop++;
2561             break;
2562         default:
2563             if (idx >= 0 && idx < A_MAX) {
2564                 ABASE(idx) += 1;
2565                 did_attr++;
2566             } else
2567                 panic("use_unicorn_horn: bad trouble? (%d)", idx);
2568             break;
2569         }
2570     }
2571
2572     if (did_attr)
2573 #if 0 /*JP*/
2574         pline("This makes you feel %s!",
2575               (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2576                   ? "great"
2577                   : "better");
2578 #else
2579         pline("\8bC\95ª\82ª%s\82æ\82­\82È\82Á\82½\81I",
2580               (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2581                   ? "\82Æ\82Ä\82à"
2582                   : "\82æ\82è");
2583 #endif
2584     else if (!did_prop)
2585 /*JP
2586         pline("Nothing seems to happen.");
2587 */
2588         pline("\89½\82à\8bN\82«\82È\82©\82Á\82½\82æ\82¤\82¾\81D");
2589
2590     context.botl = (did_attr || did_prop);
2591 #undef PROP_COUNT
2592 #undef ATTR_COUNT
2593 #undef prop2trbl
2594 #undef attr2trbl
2595 #undef prop_trouble
2596 #undef attr_trouble
2597 #undef TimedTrouble
2598 }
2599
2600 /*
2601  * Timer callback routine: turn figurine into monster
2602  */
2603 void
2604 fig_transform(arg, timeout)
2605 anything *arg;
2606 long timeout;
2607 {
2608     struct obj *figurine = arg->a_obj;
2609     struct monst *mtmp;
2610     coord cc;
2611     boolean cansee_spot, silent, okay_spot;
2612     boolean redraw = FALSE;
2613     boolean suppress_see = FALSE;
2614     char monnambuf[BUFSZ], carriedby[BUFSZ];
2615
2616     if (!figurine) {
2617         debugpline0("null figurine in fig_transform()");
2618         return;
2619     }
2620     silent = (timeout != monstermoves); /* happened while away */
2621     okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
2622     if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
2623         okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
2624     if (!okay_spot || !figurine_location_checks(figurine, &cc, TRUE)) {
2625         /* reset the timer to try again later */
2626         (void) start_timer((long) rnd(5000), TIMER_OBJECT, FIG_TRANSFORM,
2627                            obj_to_any(figurine));
2628         return;
2629     }
2630
2631     cansee_spot = cansee(cc.x, cc.y);
2632     mtmp = make_familiar(figurine, cc.x, cc.y, TRUE);
2633     if (mtmp) {
2634         char and_vanish[BUFSZ];
2635         struct obj *mshelter = level.objects[mtmp->mx][mtmp->my];
2636         Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
2637
2638         /*JP:TODO:and_vanish\82Í\96¢\8f\88\97\9d*/
2639         and_vanish[0] = '\0';
2640         if ((mtmp->minvis && !See_invisible)
2641             || (mtmp->data->mlet == S_MIMIC
2642                 && mtmp->m_ap_type != M_AP_NOTHING))
2643             suppress_see = TRUE;
2644
2645         if (mtmp->mundetected) {
2646             if (hides_under(mtmp->data) && mshelter) {
2647                 Sprintf(and_vanish, " and %s under %s",
2648                         locomotion(mtmp->data, "crawl"), doname(mshelter));
2649             } else if (mtmp->data->mlet == S_MIMIC
2650                        || mtmp->data->mlet == S_EEL) {
2651                 suppress_see = TRUE;
2652             } else
2653                 Strcpy(and_vanish, " and vanish");
2654         }
2655
2656         switch (figurine->where) {
2657         case OBJ_INVENT:
2658             if (Blind || suppress_see)
2659 #if 0 /*JP*/
2660                 You_feel("%s %s from your pack!", something,
2661                          locomotion(mtmp->data, "drop"));
2662 #else
2663                 You_feel("%s\82ª\82 \82È\82½\82Ì\8a\93\82©\82ç%s\82æ\82¤\82¾\81I", something,
2664                          jpast(locomotion(mtmp->data, "\97\8e\82¿\82é")));
2665 #endif
2666             else
2667 #if 0 /*JP*/
2668                 You_see("%s %s out of your pack%s!", monnambuf,
2669                         locomotion(mtmp->data, "drop"), and_vanish);
2670 #else
2671                 You("%s\82ª\82 \82È\82½\82Ì\8a\93\82©\82ç%s\82Ì\82ð\8c©\82½\81I", monnambuf,
2672                         jpast(locomotion(mtmp->data,"\97\8e\82¿\82é")));
2673 #endif
2674             break;
2675
2676         case OBJ_FLOOR:
2677             if (cansee_spot && !silent) {
2678                 if (suppress_see)
2679 /*JP
2680                     pline("%s suddenly vanishes!", an(xname(figurine)));
2681 */
2682                     pline("%s\82Í\93Ë\91R\8fÁ\82¦\82½\81I", xname(figurine));
2683                 else
2684 #if 0 /*JP*/
2685                     You_see("a figurine transform into %s%s!", monnambuf,
2686                             and_vanish);
2687 #else
2688                     You("\90l\8c`\82ª\93Ë\91R%s\82É\82È\82Á\82½\82Ì\82ð\8c©\82½\81I",
2689                             monnambuf);
2690 #endif
2691                 redraw = TRUE; /* update figurine's map location */
2692             }
2693             break;
2694
2695         case OBJ_MINVENT:
2696             if (cansee_spot && !silent && !suppress_see) {
2697                 struct monst *mon;
2698                 mon = figurine->ocarry;
2699                 /* figurine carrying monster might be invisible */
2700                 if (canseemon(figurine->ocarry)) {
2701 /*JP
2702                     Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon)));
2703 */
2704                     Sprintf(carriedby, "%s\82Ì\8a\93", s_suffix(a_monnam(mon)));
2705                 } else if (is_pool(mon->mx, mon->my))
2706 /*JP
2707                     Strcpy(carriedby, "empty water");
2708 */
2709                     Strcpy(carriedby, "\89½\82à\82È\82¢\90\85\92\86");
2710                 else
2711 /*JP
2712                     Strcpy(carriedby, "thin air");
2713 */
2714                     Strcpy(carriedby, "\89½\82à\82È\82¢\8bó\92\86");
2715 #if 0 /*JP*/
2716                 You_see("%s %s out of %s%s!", monnambuf,
2717                         locomotion(mtmp->data, "drop"), carriedby,
2718                         and_vanish);
2719 #else
2720                 You("%s\82ª%s\82©\82ç%s\82Ì\82ð\8c©\82½\81I", monnambuf,
2721                         carriedby, locomotion(mtmp->data, "\97\8e\82¿\82é"));
2722 #endif
2723             }
2724             break;
2725 #if 0
2726         case OBJ_MIGRATING:
2727             break;
2728 #endif
2729
2730         default:
2731             impossible("figurine came to life where? (%d)",
2732                        (int) figurine->where);
2733             break;
2734         }
2735     }
2736     /* free figurine now */
2737     if (carried(figurine)) {
2738         useup(figurine);
2739     } else {
2740         obj_extract_self(figurine);
2741         obfree(figurine, (struct obj *) 0);
2742     }
2743     if (redraw)
2744         newsym(cc.x, cc.y);
2745 }
2746
2747 STATIC_OVL boolean
2748 figurine_location_checks(obj, cc, quietly)
2749 struct obj *obj;
2750 coord *cc;
2751 boolean quietly;
2752 {
2753     xchar x, y;
2754
2755     if (carried(obj) && u.uswallow) {
2756         if (!quietly)
2757 /*JP
2758             You("don't have enough room in here.");
2759 */
2760             pline("\82±\82±\82É\82Í\8f\\95ª\82È\8fê\8f\8a\82ª\82È\82¢\81D");
2761         return FALSE;
2762     }
2763     x = cc ? cc->x : u.ux;
2764     y = cc ? cc->y : u.uy;
2765     if (!isok(x, y)) {
2766         if (!quietly)
2767 /*JP
2768             You("cannot put the figurine there.");
2769 */
2770             You("\82±\82±\82É\82Í\90l\8c`\82ð\92u\82¯\82È\82¢\81D");
2771         return FALSE;
2772     }
2773     if (IS_ROCK(levl[x][y].typ)
2774         && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) {
2775         if (!quietly)
2776 #if 0 /*JP*/
2777             You("cannot place a figurine in %s!",
2778                 IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock");
2779 #else
2780             You("%s\82Ì\92\86\82É\82Í\90l\8c`\82ð\92u\82¯\82È\82¢\81I",
2781                 IS_TREE(levl[x][y].typ) ? "\96Ø" : "\8cÅ\82¢\90Î");
2782 #endif
2783         return FALSE;
2784     }
2785     if (sobj_at(BOULDER, x, y) && !passes_walls(&mons[obj->corpsenm])
2786         && !throws_rocks(&mons[obj->corpsenm])) {
2787         if (!quietly)
2788 /*JP
2789             You("cannot fit the figurine on the boulder.");
2790 */
2791             You("\8aâ\82É\90l\8c`\82ð\89\9f\82µ\8d\9e\82Þ\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
2792         return FALSE;
2793     }
2794     return TRUE;
2795 }
2796
2797 STATIC_OVL void
2798 use_figurine(optr)
2799 struct obj **optr;
2800 {
2801     register struct obj *obj = *optr;
2802     xchar x, y;
2803     coord cc;
2804
2805     if (u.uswallow) {
2806         /* can't activate a figurine while swallowed */
2807         if (!figurine_location_checks(obj, (coord *) 0, FALSE))
2808             return;
2809     }
2810     if (!getdir((char *) 0)) {
2811         context.move = multi = 0;
2812         return;
2813     }
2814     x = u.ux + u.dx;
2815     y = u.uy + u.dy;
2816     cc.x = x;
2817     cc.y = y;
2818     /* Passing FALSE arg here will result in messages displayed */
2819     if (!figurine_location_checks(obj, &cc, FALSE))
2820         return;
2821 #if 0 /*JP*/
2822     You("%s and it transforms.",
2823         (u.dx || u.dy) ? "set the figurine beside you"
2824                        : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
2825                           || is_pool(cc.x, cc.y))
2826                              ? "release the figurine"
2827                              : (u.dz < 0 ? "toss the figurine into the air"
2828                                          : "set the figurine on the ground"));
2829 #else
2830     You("%s\81D\82·\82é\82Æ\82»\82ê\82Í\95Ï\8c`\82µ\82½\81D",
2831         (u.dx || u.dy) ? "\82»\82Î\82É\90l\8c`\82ð\92u\82¢\82½"
2832                        : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
2833                           || is_pool(cc.x, cc.y))
2834                              ? "\90l\8c`\82ð\95ú\82Á\82½"
2835                              : (u.dz < 0 ?  "\90l\8c`\82ð\8bó\92\86\82É\93\8a\82°\82½"
2836                              : "\90l\8c`\82ð\92n\96Ê\82É\92u\82¢\82½"));
2837 #endif
2838     (void) make_familiar(obj, cc.x, cc.y, FALSE);
2839     (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
2840     useup(obj);
2841     *optr = 0;
2842 }
2843
2844 static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 };
2845
2846 STATIC_OVL void
2847 use_grease(obj)
2848 struct obj *obj;
2849 {
2850     struct obj *otmp;
2851
2852     if (Glib) {
2853 #if 0 /*JP*/
2854         pline("%s from your %s.", Tobjnam(obj, "slip"),
2855               makeplural(body_part(FINGER)));
2856 #else
2857         pline("%s\82Í\82 \82È\82½\82Ì%s\82©\82ç\8a\8a\82è\97\8e\82¿\82½\81D", xname(obj),
2858               body_part(FINGER));
2859 #endif
2860         dropx(obj);
2861         return;
2862     }
2863
2864     if (obj->spe > 0) {
2865         if ((obj->cursed || Fumbling) && !rn2(2)) {
2866             consume_obj_charge(obj, TRUE);
2867
2868 #if 0 /*JP*/
2869             pline("%s from your %s.", Tobjnam(obj, "slip"),
2870                   makeplural(body_part(FINGER)));
2871 #else
2872             pline("%s\82Í\82 \82È\82½\82Ì%s\82©\82ç\8a\8a\82è\97\8e\82¿\82½\81D", xname(obj),
2873                   body_part(FINGER));
2874 #endif
2875             dropx(obj);
2876             return;
2877         }
2878         otmp = getobj(lubricables, "grease");
2879         if (!otmp)
2880             return;
2881 /*JP
2882         if (inaccessible_equipment(otmp, "grease", FALSE))
2883 */
2884         if (inaccessible_equipment(otmp, "\82É\8e\89\82ð\93h\82é", FALSE))
2885             return;
2886         consume_obj_charge(obj, TRUE);
2887
2888         if (otmp != &zeroobj) {
2889 /*JP
2890             You("cover %s with a thick layer of grease.", yname(otmp));
2891 */
2892             You("%s\82É\8e\89\82ð\92O\94O\82É\93h\82Á\82½\81D", xname(otmp));
2893             otmp->greased = 1;
2894             if (obj->cursed && !nohands(youmonst.data)) {
2895                 incr_itimeout(&Glib, rnd(15));
2896 /*JP
2897                 pline("Some of the grease gets all over your %s.",
2898 */
2899                 pline("\8e\89\82ª\8f­\82µ%s\82É\82Â\82¢\82½\81D",
2900                       makeplural(body_part(HAND)));
2901             }
2902         } else {
2903             incr_itimeout(&Glib, rnd(15));
2904 /*JP
2905             You("coat your %s with grease.", makeplural(body_part(FINGER)));
2906 */
2907             You("%s\82É\8e\89\82ð\93h\82Á\82½\81D", makeplural(body_part(FINGER)));
2908         }
2909     } else {
2910         if (obj->known)
2911 /*JP
2912             pline("%s empty.", Tobjnam(obj, "are"));
2913 */
2914             pline("%s\82Í\8bó\82Á\82Û\82¾\81D", xname(obj));
2915         else
2916 /*JP
2917             pline("%s to be empty.", Tobjnam(obj, "seem"));
2918 */
2919             pline("%s\82Í\8bó\82Á\82Û\82Ì\82æ\82¤\82¾\81D", xname(obj));
2920     }
2921     update_inventory();
2922 }
2923
2924 static struct trapinfo {
2925     struct obj *tobj;
2926     xchar tx, ty;
2927     int time_needed;
2928     boolean force_bungle;
2929 } trapinfo;
2930
2931 void
2932 reset_trapset()
2933 {
2934     trapinfo.tobj = 0;
2935     trapinfo.force_bungle = 0;
2936 }
2937
2938 /* touchstones - by Ken Arnold */
2939 STATIC_OVL void
2940 use_stone(tstone)
2941 struct obj *tstone;
2942 {
2943     struct obj *obj;
2944     boolean do_scratch;
2945     const char *streak_color, *choices;
2946     char stonebuf[QBUFSZ];
2947 /*JP
2948     static const char scritch[] = "\"scritch, scritch\"";
2949 */
2950     static const char scritch[] = "\81u\83S\83V\81C\83S\83V\81v";
2951     static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
2952     static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
2953
2954     /* in case it was acquired while blinded */
2955     if (!Blind)
2956         tstone->dknown = 1;
2957     /* when the touchstone is fully known, don't bother listing extra
2958        junk as likely candidates for rubbing */
2959     choices = (tstone->otyp == TOUCHSTONE && tstone->dknown
2960                && objects[TOUCHSTONE].oc_name_known)
2961                   ? coins_gems
2962                   : allowall;
2963 /*JP
2964     Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
2965 */
2966     Sprintf(stonebuf, "rub on the stone");
2967     if ((obj = getobj(choices, stonebuf)) == 0)
2968         return;
2969
2970     if (obj == tstone && obj->quan == 1L) {
2971 /*JP
2972         You_cant("rub %s on itself.", the(xname(obj)));
2973 */
2974         You("%s\82ð\82»\82ê\8e©\91Ì\82Å\82±\82·\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D", the(xname(obj)));
2975         return;
2976     }
2977
2978     if (tstone->otyp == TOUCHSTONE && tstone->cursed
2979         && obj->oclass == GEM_CLASS && !is_graystone(obj)
2980         && !obj_resists(obj, 80, 100)) {
2981         if (Blind)
2982 /*JP
2983             pline("You feel something shatter.");
2984 */
2985             You("\89½\82©\82ª\95²\81X\82É\82È\82é\82Ì\82ð\8a´\82\82½\81D");
2986         else if (Hallucination)
2987 /*JP
2988             pline("Oh, wow, look at the pretty shards.");
2989 */
2990             pline("\83\8f\81[\83H\81I\82È\82ñ\82Ä\82«\82ê\82¢\82È\94j\95Ð\82È\82ñ\82¾\81D");
2991         else
2992 #if 0 /*JP*/
2993             pline("A sharp crack shatters %s%s.",
2994                   (obj->quan > 1L) ? "one of " : "", the(xname(obj)));
2995 #else
2996             pline("\8b­\82­\82±\82·\82è\82·\82¬\82Ä%s%s\82Í\95²\81X\82É\82È\82Á\82Ä\82µ\82Ü\82Á\82½\81D",
2997                   the(xname(obj)), (obj->quan > 1) ? "\82Ì\82Ð\82Æ\82Â" : "");
2998 #endif
2999         useup(obj);
3000         return;
3001     }
3002
3003     if (Blind) {
3004         pline(scritch);
3005         return;
3006     } else if (Hallucination) {
3007 #if 0 /*JP*/
3008         pline("Oh wow, man: Fractals!");
3009 #else
3010         pline("\83\8f\81[\83H\81I\83t\83\89\83N\83^\83\8b\96Í\97l\82¾\81I");
3011 #endif
3012         return;
3013     }
3014
3015     do_scratch = FALSE;
3016     streak_color = 0;
3017
3018     switch (obj->oclass) {
3019     case GEM_CLASS: /* these have class-specific handling below */
3020     case RING_CLASS:
3021         if (tstone->otyp != TOUCHSTONE) {
3022             do_scratch = TRUE;
3023         } else if (obj->oclass == GEM_CLASS
3024                    && (tstone->blessed
3025                        || (!tstone->cursed && (Role_if(PM_ARCHEOLOGIST)
3026                                                || Race_if(PM_GNOME))))) {
3027             makeknown(TOUCHSTONE);
3028             makeknown(obj->otyp);
3029             prinv((char *) 0, obj, 0L);
3030             return;
3031         } else {
3032             /* either a ring or the touchstone was not effective */
3033             if (objects[obj->otyp].oc_material == GLASS) {
3034                 do_scratch = TRUE;
3035                 break;
3036             }
3037         }
3038         streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3039         break; /* gem or ring */
3040
3041     default:
3042         switch (objects[obj->otyp].oc_material) {
3043         case CLOTH:
3044 #if 0 /*JP*/
3045             pline("%s a little more polished now.", Tobjnam(tstone, "look"));
3046 #else
3047             pline("%s\82Í\82³\82ç\82É\82Â\82â\82ª\8fo\82½\82æ\82¤\82É\8c©\82¦\82é\81D", xname(tstone));
3048 #endif
3049             return;
3050         case LIQUID:
3051             if (!obj->known) /* note: not "whetstone" */
3052 #if 0 /*JP*/
3053                 You("must think this is a wetstone, do you?");
3054 #else
3055                 You("\82±\82ê\82Í\93u\90Î\82¾\82Æ\8ev\82Á\82½\81H");
3056 #endif
3057             else
3058 #if 0 /*JP*/
3059                 pline("%s a little wetter now.", Tobjnam(tstone, "are"));
3060 #else
3061                 pline("%s\82Í\8f­\82µ\82Ê\82ê\82½\81D", xname(tstone));
3062 #endif
3063             return;
3064         case WAX:
3065 #if 0 /*JP*/
3066             streak_color = "waxy";
3067 #else
3068             streak_color = "\8e\89\82Á\82Û\82¢";
3069 #endif
3070             break; /* okay even if not touchstone */
3071         case WOOD:
3072 #if 0 /*JP*/
3073             streak_color = "wooden";
3074 #else
3075             streak_color = "\82¨\82ª\82­\82¸\82Ì\82æ\82¤\82È";
3076 #endif
3077             break; /* okay even if not touchstone */
3078         case GOLD:
3079             do_scratch = TRUE; /* scratching and streaks */
3080 #if 0 /*JP*/
3081             streak_color = "golden";
3082 #else
3083             streak_color = "\8bà\90F\82Ì";
3084 #endif
3085             break;
3086         case SILVER:
3087             do_scratch = TRUE; /* scratching and streaks */
3088 #if 0 /*JP*/
3089             streak_color = "silvery";
3090 #else
3091             streak_color = "\8bâ\90F\82Ì";
3092 #endif
3093             break;
3094         default:
3095             /* Objects passing the is_flimsy() test will not
3096                scratch a stone.  They will leave streaks on
3097                non-touchstones and touchstones alike. */
3098             if (is_flimsy(obj))
3099                 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3100             else
3101                 do_scratch = (tstone->otyp != TOUCHSTONE);
3102             break;
3103         }
3104         break; /* default oclass */
3105     }
3106
3107 #if 0 /*JP*//* not used */
3108     Sprintf(stonebuf, "stone%s", plur(tstone->quan));
3109 #endif
3110     if (do_scratch)
3111 #if 0 /*JP*/
3112         You("make %s%sscratch marks on the %s.",
3113             streak_color ? streak_color : (const char *) "",
3114             streak_color ? " " : "", stonebuf);
3115 #else
3116         You("%s\82±\82·\82è\90Õ\82ð\90Î\82É\82Â\82¯\82½\81D",
3117             streak_color ? streak_color : (const char *)"");
3118 #endif
3119     else if (streak_color)
3120 /*JP
3121         You_see("%s streaks on the %s.", streak_color, stonebuf);
3122 */
3123         pline("\90Î\82É%s\8bØ\82ª\82Â\82¢\82½\81D", streak_color);
3124     else
3125         pline(scritch);
3126     return;
3127 }
3128
3129 /* Place a landmine/bear trap.  Helge Hafting */
3130 STATIC_OVL void
3131 use_trap(otmp)
3132 struct obj *otmp;
3133 {
3134     int ttyp, tmp;
3135     const char *what = (char *) 0;
3136     char buf[BUFSZ];
3137     int levtyp = levl[u.ux][u.uy].typ;
3138 #if 0 /*JP*/
3139     const char *occutext = "setting the trap";
3140 #else
3141     const char *occutext = "ã©\82ð\8ed\8a|\82¯\82Ä\82¢\82é";
3142 #endif
3143
3144     if (nohands(youmonst.data))
3145 /*JP
3146         what = "without hands";
3147 */
3148         what = "\8eè\82ª\82È\82¢\82Ì\82Å";
3149     else if (Stunned)
3150 /*JP
3151         what = "while stunned";
3152 */
3153         what = "\82­\82ç\82­\82ç\82µ\82Ä\82¢\82é\82Ì\82Å";
3154     else if (u.uswallow)
3155         what =
3156 /*JP
3157             is_animal(u.ustuck->data) ? "while swallowed" : "while engulfed";
3158 */
3159             is_animal(u.ustuck->data) ? "\88ù\82Ý\8d\9e\82Ü\82ê\82Ä\82¢\82é\8aÔ\82Í" : "\8aª\82«\8d\9e\82Ü\82ê\82Ä\82¢\82é\8aÔ\82Í";
3160     else if (Underwater)
3161 /*JP
3162         what = "underwater";
3163 */
3164         what = "\90\85\96Ê\89º\82Å\82Í";
3165     else if (Levitation)
3166 /*JP
3167         what = "while levitating";
3168 */
3169         what = "\95\82\82¢\82Ä\82¢\82é\8aÔ\82Í";
3170     else if (is_pool(u.ux, u.uy))
3171 /*JP
3172         what = "in water";
3173 */
3174         what = "\90\85\92\86\82Å\82Í";
3175     else if (is_lava(u.ux, u.uy))
3176 /*JP
3177         what = "in lava";
3178 */
3179         what = "\97n\8aâ\82Ì\92\86\82Å\82Í";
3180     else if (On_stairs(u.ux, u.uy))
3181 #if 0 /*JP*/
3182         what = (u.ux == xdnladder || u.ux == xupladder) ? "on the ladder"
3183                                                         : "on the stairs";
3184 #else
3185         what = (u.ux == xdnladder || u.ux == xupladder) ? "\82Í\82µ\82²\82Ì\8fã\82Å\82Í"
3186                                                         : "\8aK\92i\82Ì\8fã\82Å\82Í";
3187 #endif
3188     else if (IS_FURNITURE(levtyp) || IS_ROCK(levtyp)
3189              || closed_door(u.ux, u.uy) || t_at(u.ux, u.uy))
3190 /*JP
3191         what = "here";
3192 */
3193         what = "\82±\82±\82Å\82Í";
3194     else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
3195 #if 0 /*JP*/
3196         what = (levtyp == AIR)
3197                    ? "in midair"
3198                    : (levtyp == CLOUD)
3199                          ? "in a cloud"
3200                          : "in this place"; /* Air/Water Plane catch-all */
3201 #else
3202         what = (levtyp == AIR)
3203                    ? "\8bó\92\86\82Å\82Í"
3204                    : (levtyp == CLOUD)
3205                          ? "\89_\82Ì\92\86\82Å\82Í"
3206                          : "\82±\82±\82Å\82Í"; /* Air/Water Plane catch-all */
3207 #endif
3208     if (what) {
3209 /*JP
3210         You_cant("set a trap %s!", what);
3211 */
3212         pline("%sã©\82ð\8ed\8a|\82¯\82ç\82ê\82È\82¢\81I",what);
3213         reset_trapset();
3214         return;
3215     }
3216     ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3217     if (otmp == trapinfo.tobj && u.ux == trapinfo.tx && u.uy == trapinfo.ty) {
3218 /*JP
3219         You("resume setting %s%s.", shk_your(buf, otmp),
3220 */
3221         You("%s\82ð\8ed\8a|\82¯\82é\82Ì\82ð\8dÄ\8aJ\82µ\82½\81D",
3222             defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3223         set_occupation(set_trap, occutext, 0);
3224         return;
3225     }
3226     trapinfo.tobj = otmp;
3227     trapinfo.tx = u.ux, trapinfo.ty = u.uy;
3228     tmp = ACURR(A_DEX);
3229     trapinfo.time_needed =
3230         (tmp > 17) ? 2 : (tmp > 12) ? 3 : (tmp > 7) ? 4 : 5;
3231     if (Blind)
3232         trapinfo.time_needed *= 2;
3233     tmp = ACURR(A_STR);
3234     if (ttyp == BEAR_TRAP && tmp < 18)
3235         trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4;
3236     /*[fumbling and/or confusion and/or cursed object check(s)
3237        should be incorporated here instead of in set_trap]*/
3238     if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
3239         boolean chance;
3240
3241         if (Fumbling || otmp->cursed)
3242             chance = (rnl(10) > 3);
3243         else
3244             chance = (rnl(10) > 5);
3245 /*JP
3246         You("aren't very skilled at reaching from %s.", mon_nam(u.usteed));
3247 */
3248         pline("%s\82Ì\8fã\82©\82ç\82Å\82Í\82¤\82Ü\82­\8ed\8a|\82¯\82ç\82ê\82È\82¢\82©\82à\82µ\82ê\82È\82¢\81D", mon_nam(u.usteed));
3249 /*JP
3250         Sprintf(buf, "Continue your attempt to set %s?",
3251 */
3252         Sprintf(buf, "%s\82Ì\8ed\8a|\82¯\82ð\91±\82¯\82é\81H",
3253                 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3254         if (yn(buf) == 'y') {
3255             if (chance) {
3256                 switch (ttyp) {
3257                 case LANDMINE: /* set it off */
3258                     trapinfo.time_needed = 0;
3259                     trapinfo.force_bungle = TRUE;
3260                     break;
3261                 case BEAR_TRAP: /* drop it without arming it */
3262                     reset_trapset();
3263 /*JP
3264                     You("drop %s!",
3265 */
3266                     You("%s\82ð\97\8e\82Æ\82µ\82½\81I",
3267                         the(defsyms[trap_to_defsym(what_trap(ttyp))]
3268                                 .explanation));
3269                     dropx(otmp);
3270                     return;
3271                 }
3272             }
3273         } else {
3274             reset_trapset();
3275             return;
3276         }
3277     }
3278 /*JP
3279     You("begin setting %s%s.", shk_your(buf, otmp),
3280 */
3281     You("%s%s\82ð\8ed\8a|\82¯\82Í\82\82ß\82½\81D", shk_your(buf, otmp),
3282         defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3283     set_occupation(set_trap, occutext, 0);
3284     return;
3285 }
3286
3287 STATIC_PTR
3288 int
3289 set_trap()
3290 {
3291     struct obj *otmp = trapinfo.tobj;
3292     struct trap *ttmp;
3293     int ttyp;
3294
3295     if (!otmp || !carried(otmp) || u.ux != trapinfo.tx
3296         || u.uy != trapinfo.ty) {
3297         /* ?? */
3298         reset_trapset();
3299         return 0;
3300     }
3301
3302     if (--trapinfo.time_needed > 0)
3303         return 1; /* still busy */
3304
3305     ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3306     ttmp = maketrap(u.ux, u.uy, ttyp);
3307     if (ttmp) {
3308         ttmp->madeby_u = 1;
3309         feeltrap(ttmp);
3310         if (*in_rooms(u.ux, u.uy, SHOPBASE)) {
3311             add_damage(u.ux, u.uy, 0L); /* schedule removal */
3312         }
3313         if (!trapinfo.force_bungle)
3314 /*JP
3315             You("finish arming %s.",
3316 */
3317             You("%s\82ð\8ed\8a|\82¯\8fI\82¦\82½\81D",
3318                 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3319         if (((otmp->cursed || Fumbling) && (rnl(10) > 5))
3320             || trapinfo.force_bungle)
3321             dotrap(ttmp,
3322                    (unsigned) (trapinfo.force_bungle ? FORCEBUNGLE : 0));
3323     } else {
3324         /* this shouldn't happen */
3325 /*JP
3326         Your("trap setting attempt fails.");
3327 */
3328         You("ã©\82ð\8ed\8a|\82¯\82é\82Ì\82É\8e¸\94s\82µ\82½\81D");
3329     }
3330     useup(otmp);
3331     reset_trapset();
3332     return 0;
3333 }
3334
3335 STATIC_OVL int
3336 use_whip(obj)
3337 struct obj *obj;
3338 {
3339     char buf[BUFSZ];
3340     struct monst *mtmp;
3341     struct obj *otmp;
3342     int rx, ry, proficient, res = 0;
3343 /*JP
3344     const char *msg_slipsfree = "The bullwhip slips free.";
3345 */
3346     const char *msg_slipsfree = "\95Ú\82Í\82Ù\82Ç\82¯\82½\81D";
3347 /*JP
3348     const char *msg_snap = "Snap!";
3349 */
3350     const char *msg_snap = "\83s\83V\83b\81I";
3351
3352     if (obj != uwep) {
3353         if (!wield_tool(obj, "lash"))
3354             return 0;
3355         else
3356             res = 1;
3357     }
3358     if (!getdir((char *) 0))
3359         return res;
3360
3361     if (u.uswallow) {
3362         mtmp = u.ustuck;
3363         rx = mtmp->mx;
3364         ry = mtmp->my;
3365     } else {
3366         if (Stunned || (Confusion && !rn2(5)))
3367             confdir();
3368         rx = u.ux + u.dx;
3369         ry = u.uy + u.dy;
3370         if (!isok(rx, ry)) {
3371 /*JP
3372             You("miss.");
3373 */
3374             You("\82Í\82¸\82µ\82½\81D");
3375             return res;
3376         }
3377         mtmp = m_at(rx, ry);
3378     }
3379
3380     /* fake some proficiency checks */
3381     proficient = 0;
3382     if (Role_if(PM_ARCHEOLOGIST))
3383         ++proficient;
3384     if (ACURR(A_DEX) < 6)
3385         proficient--;
3386     else if (ACURR(A_DEX) >= 14)
3387         proficient += (ACURR(A_DEX) - 14);
3388     if (Fumbling)
3389         --proficient;
3390     if (proficient > 3)
3391         proficient = 3;
3392     if (proficient < 0)
3393         proficient = 0;
3394
3395     if (u.uswallow && attack(u.ustuck)) {
3396 /*JP
3397         There("is not enough room to flick your bullwhip.");
3398 */
3399         pline("\95Ú\82ð\91Å\82Â\82Ù\82Ç\8dL\82­\82È\82¢\81D");
3400
3401     } else if (Underwater) {
3402 /*JP
3403         There("is too much resistance to flick your bullwhip.");
3404 */
3405         pline("\90\85\82Ì\92ï\8dR\82ª\82 \82è\82·\82¬\82Ä\95Ú\82ð\91Å\82Â\82±\82Æ\82ª\82Å\82«\82È\82¢\81D");
3406
3407     } else if (u.dz < 0) {
3408 /*JP
3409         You("flick a bug off of the %s.", ceiling(u.ux, u.uy));
3410 */
3411         You("%s\82Ì\92\8e\82ð\91Å\82¿\97\8e\82µ\82½\81D",ceiling(u.ux,u.uy));
3412
3413     } else if ((!u.dx && !u.dy) || (u.dz > 0)) {
3414         int dam;
3415
3416         /* Sometimes you hit your steed by mistake */
3417         if (u.usteed && !rn2(proficient + 2)) {
3418 /*JP
3419             You("whip %s!", mon_nam(u.usteed));
3420 */
3421             You("%s\82ð\95Ú\91Å\82Á\82½\81I", mon_nam(u.usteed));
3422             kick_steed();
3423             return 1;
3424         }
3425         if (Levitation || u.usteed) {
3426             /* Have a shot at snaring something on the floor */
3427             otmp = level.objects[u.ux][u.uy];
3428             if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) {
3429 /*JP
3430                 pline("Why beat a dead horse?");
3431 */
3432                 pline("\82Ç\82¤\82µ\82Ä\8e\80\82ñ\82¾\94n\82ð\95Ú\91Å\82Â\82æ\82¤\82È\82±\82Æ\82ð\82·\82é\82Ì\81H");
3433                 return 1;
3434             }
3435             if (otmp && proficient) {
3436 #if 0 /*JP*/
3437                 You("wrap your bullwhip around %s on the %s.",
3438                     an(singular(otmp, xname)), surface(u.ux, u.uy));
3439 #else
3440                 You("\95Ú\82ð%s\82Ì\8fã\82Ì%s\82É\82©\82ç\82Ü\82¹\82½\81D",
3441                     surface(u.ux, u.uy), an(singular(otmp, xname)));
3442 #endif
3443                 if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1)
3444                     pline1(msg_slipsfree);
3445                 return 1;
3446             }
3447         }
3448         dam = rnd(2) + dbon() + obj->spe;
3449         if (dam <= 0)
3450             dam = 1;
3451 /*JP
3452         You("hit your %s with your bullwhip.", body_part(FOOT));
3453 */
3454         You("\8e©\95ª\82Ì%s\82ð\8e©\95ª\82Å\91Å\82¿\82Â\82¯\82½\81D", body_part(FOOT));
3455 #if 0 /*JP*/
3456         Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
3457         losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
3458 #else
3459         Strcpy(buf, "\8e©\95ª\8e©\90g\82ð\95Ú\91Å\82Á\82Ä");
3460         losehp(dam, buf, KILLED_BY);
3461 #endif
3462         context.botl = 1;
3463         return 1;
3464
3465     } else if ((Fumbling || Glib) && !rn2(5)) {
3466 /*JP
3467         pline_The("bullwhip slips out of your %s.", body_part(HAND));
3468 */
3469         pline("\95Ú\82ª%s\82©\82ç\82·\82×\82è\97\8e\82¿\82½\81D", body_part(HAND));
3470         dropx(obj);
3471
3472     } else if (u.utrap && u.utraptype == TT_PIT) {
3473         /*
3474          * Assumptions:
3475          *
3476          * if you're in a pit
3477          *    - you are attempting to get out of the pit
3478          * or, if you are applying it towards a small monster
3479          *    - then it is assumed that you are trying to hit it
3480          * else if the monster is wielding a weapon
3481          *    - you are attempting to disarm a monster
3482          * else
3483          *    - you are attempting to hit the monster.
3484          *
3485          * if you're confused (and thus off the mark)
3486          *    - you only end up hitting.
3487          *
3488          */
3489         const char *wrapped_what = (char *) 0;
3490
3491         if (mtmp) {
3492             if (bigmonst(mtmp->data)) {
3493                 wrapped_what = strcpy(buf, mon_nam(mtmp));
3494             } else if (proficient) {
3495                 if (attack(mtmp))
3496                     return 1;
3497                 else
3498                     pline1(msg_snap);
3499             }
3500         }
3501         if (!wrapped_what) {
3502             if (IS_FURNITURE(levl[rx][ry].typ))
3503                 wrapped_what = something;
3504             else if (sobj_at(BOULDER, rx, ry))
3505 /*JP
3506                 wrapped_what = "a boulder";
3507 */
3508                 wrapped_what = "\8aâ";
3509         }
3510         if (wrapped_what) {
3511             coord cc;
3512
3513             cc.x = rx;
3514             cc.y = ry;
3515 /*JP
3516             You("wrap your bullwhip around %s.", wrapped_what);
3517 */
3518             You("\95Ú\82ð%s\82É\82©\82ç\82Ü\82¹\82½\81D", wrapped_what);
3519             if (proficient && rn2(proficient + 2)) {
3520                 if (!mtmp || enexto(&cc, rx, ry, youmonst.data)) {
3521 /*JP
3522                     You("yank yourself out of the pit!");
3523 */
3524                     You("\82®\82¢\82Æ\88ø\82Á\82Ï\82Á\82Ä\8c\8a\82©\82ç\94²\82¯\8fo\82µ\82½\81I");
3525                     teleds(cc.x, cc.y, TRUE);
3526                     u.utrap = 0;
3527                     vision_full_recalc = 1;
3528                 }
3529             } else {
3530                 pline1(msg_slipsfree);
3531             }
3532             if (mtmp)
3533                 wakeup(mtmp);
3534         } else
3535             pline1(msg_snap);
3536
3537     } else if (mtmp) {
3538         if (!canspotmon(mtmp) && !glyph_is_invisible(levl[rx][ry].glyph)) {
3539 /*JP
3540             pline("A monster is there that you couldn't see.");
3541 */
3542             pline("\8c©\82¦\82È\82¢\89ö\95¨\82ª\82¢\82é\81D");
3543             map_invisible(rx, ry);
3544         }
3545         otmp = MON_WEP(mtmp); /* can be null */
3546         if (otmp) {
3547             char onambuf[BUFSZ];
3548             const char *mon_hand;
3549             boolean gotit = proficient && (!Fumbling || !rn2(10));
3550
3551             Strcpy(onambuf, cxname(otmp));
3552             if (gotit) {
3553                 mon_hand = mbodypart(mtmp, HAND);
3554                 if (bimanual(otmp))
3555                     mon_hand = makeplural(mon_hand);
3556             } else
3557                 mon_hand = 0; /* lint suppression */
3558
3559 /*JP
3560             You("wrap your bullwhip around %s.", yname(otmp));
3561 */
3562             You("\95Ú\82ð%s\82É\82©\82ç\82Ü\82¹\82½\81D", xname(otmp));
3563             if (gotit && mwelded(otmp)) {
3564 #if 0 /*JP*/
3565                 pline("%s welded to %s %s%c",
3566                       (otmp->quan == 1L) ? "It is" : "They are", mhis(mtmp),
3567                       mon_hand, !otmp->bknown ? '!' : '.');
3568 #else
3569                 pline("%s\82Í%s\82Ì%s\82É\82­\82Á\82Â\82¢\82Ä\82µ\82Ü\82Á\82Ä\82¢\82é%s",
3570                       onambuf,
3571                       mon_nam(mtmp), mon_hand,
3572                       !otmp->bknown ? "\81I" : "\81D");
3573 #endif
3574                 otmp->bknown = 1;
3575                 gotit = FALSE; /* can't pull it free */
3576             }
3577             if (gotit) {
3578                 obj_extract_self(otmp);
3579                 possibly_unwield(mtmp, FALSE);
3580                 setmnotwielded(mtmp, otmp);
3581
3582                 switch (rn2(proficient + 1)) {
3583                 case 2:
3584                     /* to floor near you */
3585 /*JP
3586                     You("yank %s to the %s!", yname(otmp),
3587 */
3588                     You("%s\82ð%s\82É\88ø\82«\97\8e\82µ\82½\81I", xname(otmp),
3589                         surface(u.ux, u.uy));
3590                     place_object(otmp, u.ux, u.uy);
3591                     stackobj(otmp);
3592                     break;
3593                 case 3:
3594 #if 0
3595                     /* right to you */
3596                     if (!rn2(25)) {
3597                         /* proficient with whip, but maybe not
3598                            so proficient at catching weapons */
3599                         int hitu, hitvalu;
3600
3601                         hitvalu = 8 + otmp->spe;
3602                         hitu = thitu(hitvalu,
3603                                      dmgval(otmp, &youmonst),
3604                                      otmp, (char *)0);
3605                         if (hitu) {
3606 /*JP
3607                             pline_The("%s hits you as you try to snatch it!",
3608 */
3609                             pline_The("%s\82ð\92D\82¨\82¤\82Æ\82µ\82½\82ç\82 \82È\82½\82É\93\96\82½\82Á\82½\81I",
3610                                       the(onambuf));
3611                         }
3612                         place_object(otmp, u.ux, u.uy);
3613                         stackobj(otmp);
3614                         break;
3615                     }
3616 #endif /* 0 */
3617                     /* right into your inventory */
3618 /*JP
3619                     You("snatch %s!", yname(otmp));
3620 */
3621                     You("%s\82ð\92D\82Á\82½\81I", xname(otmp));
3622                     if (otmp->otyp == CORPSE
3623                         && touch_petrifies(&mons[otmp->corpsenm]) && !uarmg
3624                         && !Stone_resistance
3625                         && !(poly_when_stoned(youmonst.data)
3626                              && polymon(PM_STONE_GOLEM))) {
3627                         char kbuf[BUFSZ];
3628
3629 #if 0 /*JP*/
3630                         Sprintf(kbuf, "%s corpse",
3631                                 an(mons[otmp->corpsenm].mname));
3632                         pline("Snatching %s is a fatal mistake.", kbuf);
3633 #else
3634                         pline("%s\82Ì\8e\80\91Ì\82ð\92D\82Á\82½\82Ì\82Í\92v\96½\93I\82È\8aÔ\88á\82¢\82¾\81D",
3635                                 mons[otmp->corpsenm].mname);
3636                         Sprintf(kbuf, "%s\82Ì\8e\80\91Ì\82É\90G\82ê\82Ä",
3637                                 mons[otmp->corpsenm].mname);
3638 #endif
3639                         instapetrify(kbuf);
3640                     }
3641                     otmp = hold_another_object(
3642 /*JP
3643                         otmp, "You drop %s!", doname(otmp), (const char *) 0);
3644 */
3645                         otmp, "%s\82ð\97\8e\82µ\82½\81I", doname(otmp), (const char *) 0);
3646                     break;
3647                 default:
3648                     /* to floor beneath mon */
3649 /*JP
3650                     You("yank %s from %s %s!", the(onambuf),
3651 */
3652                     You("%s\82ð%s\82Ì%s\82©\82ç\82Ð\82Á\82Ï\82Á\82½\81I", the(xname(otmp)),
3653                         s_suffix(mon_nam(mtmp)), mon_hand);
3654                     obj_no_longer_held(otmp);
3655                     place_object(otmp, mtmp->mx, mtmp->my);
3656                     stackobj(otmp);
3657                     break;
3658                 }
3659             } else {
3660                 pline1(msg_slipsfree);
3661             }
3662             wakeup(mtmp);
3663         } else {
3664             if (mtmp->m_ap_type && !Protection_from_shape_changers
3665                 && !sensemon(mtmp))
3666                 stumble_onto_mimic(mtmp);
3667             else
3668 /*JP
3669                 You("flick your bullwhip towards %s.", mon_nam(mtmp));
3670 */
3671                 You("%s\82É\8cü\82Á\82Ä\95Ú\82ð\91Å\82Á\82½\81D", mon_nam(mtmp));
3672             if (proficient) {
3673                 if (attack(mtmp))
3674                     return 1;
3675                 else
3676                     pline1(msg_snap);
3677             }
3678         }
3679
3680     } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
3681         /* it must be air -- water checked above */
3682 /*JP
3683         You("snap your whip through thin air.");
3684 */
3685         You("\89½\82à\82È\82¢\82Æ\82±\82ë\82Å\95Ú\82ð\91Å\82Á\82½\81D");
3686
3687     } else {
3688         pline1(msg_snap);
3689     }
3690     return 1;
3691 }
3692
3693 static const char
3694 /*JP
3695     not_enough_room[] = "There's not enough room here to use that.",
3696 */
3697     not_enough_room[] = "\82»\82ê\82ð\8eg\82¤\82¾\82¯\82Ì\8dL\82³\82ª\82È\82¢\81D",
3698 /*JP
3699     where_to_hit[] = "Where do you want to hit?",
3700 */
3701     where_to_hit[] = "\82Ç\82ê\82ð\91_\82¤\81H",
3702 /*JP
3703     cant_see_spot[] = "won't hit anything if you can't see that spot.",
3704 */
3705     cant_see_spot[] = "\8fê\8f\8a\82ª\8c©\82¦\82È\82¯\82ê\82Î\91_\82¦\82È\82¢\81D",
3706 /*JP
3707     cant_reach[] = "can't reach that spot from here.";
3708 */
3709     cant_reach[] = "\82±\82±\82©\82ç\82»\82±\82Ö\82Í\93Í\82©\82È\82¢\81D";
3710
3711 /* find pos of monster in range, if only one monster */
3712 boolean
3713 find_poleable_mon(pos, min_range, max_range)
3714 coord *pos;
3715 int min_range, max_range;
3716 {
3717     struct monst *mtmp;
3718     struct monst *selmon = (struct monst *) 0;
3719
3720     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
3721         if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
3722             && cansee(mtmp->mx, mtmp->my)
3723             && distu(mtmp->mx, mtmp->my) <= max_range
3724             && distu(mtmp->mx, mtmp->my) >= min_range) {
3725             if (selmon)
3726                 return FALSE;
3727             selmon = mtmp;
3728         }
3729     if (!selmon)
3730         return FALSE;
3731     pos->x = selmon->mx;
3732     pos->y = selmon->my;
3733     return TRUE;
3734 }
3735
3736 static int polearm_range_min = -1;
3737 static int polearm_range_max = -1;
3738
3739 void
3740 display_polearm_positions(state)
3741 int state;
3742 {
3743     if (state == 0) {
3744         tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
3745     } else if (state == 1) {
3746         int x, y, dx, dy;
3747
3748         for (dx = -4; dx <= 4; dx++)
3749             for (dy = -4; dy <= 4; dy++) {
3750                 x = dx + (int) u.ux;
3751                 y = dy + (int) u.uy;
3752                 if (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
3753                     && distu(x, y) >= polearm_range_min
3754                     && distu(x, y) <= polearm_range_max) {
3755                     tmp_at(x, y);
3756                 }
3757             }
3758     } else {
3759         tmp_at(DISP_END, 0);
3760     }
3761 }
3762
3763 /* Distance attacks by pole-weapons */
3764 STATIC_OVL int
3765 use_pole(obj)
3766 struct obj *obj;
3767 {
3768     int res = 0, typ, max_range, min_range, glyph;
3769     coord cc;
3770     struct monst *mtmp;
3771     struct monst *hitm = context.polearm.hitmon;
3772
3773     /* Are you allowed to use the pole? */
3774     if (u.uswallow) {
3775         pline(not_enough_room);
3776         return 0;
3777     }
3778     if (obj != uwep) {
3779         if (!wield_tool(obj, "swing"))
3780             return 0;
3781         else
3782             res = 1;
3783     }
3784     /* assert(obj == uwep); */
3785
3786     /*
3787      * Calculate allowable range (pole's reach is always 2 steps):
3788      *  unskilled and basic: orthogonal direction, 4..4;
3789      *  skilled: as basic, plus knight's jump position, 4..5;
3790      *  expert: as skilled, plus diagonal, 4..8.
3791      *      ...9...
3792      *      .85458.
3793      *      .52125.
3794      *      9410149
3795      *      .52125.
3796      *      .85458.
3797      *      ...9...
3798      *  (Note: no roles in nethack can become expert or better
3799      *  for polearm skill; Yeoman in slash'em can become expert.)
3800      */
3801     min_range = 4;
3802     typ = uwep_skill_type();
3803     if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3804         max_range = 4;
3805     else if (P_SKILL(typ) == P_SKILLED)
3806         max_range = 5;
3807     else
3808         max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
3809
3810     polearm_range_min = min_range;
3811     polearm_range_max = max_range;
3812
3813     /* Prompt for a location */
3814     pline(where_to_hit);
3815     cc.x = u.ux;
3816     cc.y = u.uy;
3817     if (!find_poleable_mon(&cc, min_range, max_range) && hitm
3818         && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)
3819         && distu(hitm->mx, hitm->my) <= max_range
3820         && distu(hitm->mx, hitm->my) >= min_range) {
3821         cc.x = hitm->mx;
3822         cc.y = hitm->my;
3823     }
3824     getpos_sethilite(display_polearm_positions);
3825 /*JP
3826     if (getpos(&cc, TRUE, "the spot to hit") < 0)
3827 */
3828     if (getpos(&cc, TRUE, "\91_\82¤\8fê\8f\8a") < 0)
3829         return res; /* ESC; uses turn iff polearm became wielded */
3830
3831     glyph = glyph_at(cc.x, cc.y);
3832     if (distu(cc.x, cc.y) > max_range) {
3833 /*JP
3834         pline("Too far!");
3835 */
3836         pline("\89\93\82·\82¬\82é\81I");
3837         return res;
3838     } else if (distu(cc.x, cc.y) < min_range) {
3839 /*JP
3840         pline("Too close!");
3841 */
3842         pline("\8bß\82·\82¬\82é\81I");
3843         return res;
3844     } else if (!cansee(cc.x, cc.y) && !glyph_is_monster(glyph)
3845                && !glyph_is_invisible(glyph) && !glyph_is_statue(glyph)) {
3846         You(cant_see_spot);
3847         return res;
3848     } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
3849         You(cant_reach);
3850         return res;
3851     }
3852
3853     context.polearm.hitmon = NULL;
3854     /* Attack the monster there */
3855     bhitpos = cc;
3856     if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
3857         if (attack_checks(mtmp, uwep))
3858             return res;
3859         if (overexertion())
3860             return 1; /* burn nutrition; maybe pass out */
3861         context.polearm.hitmon = mtmp;
3862         check_caitiff(mtmp);
3863         notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
3864         (void) thitmonst(mtmp, uwep);
3865     } else if (glyph_is_statue(glyph) /* might be hallucinatory */
3866                && sobj_at(STATUE, bhitpos.x, bhitpos.y)) {
3867         struct trap *t = t_at(bhitpos.x, bhitpos.y);
3868
3869         if (t && t->ttyp == STATUE_TRAP
3870             && activate_statue_trap(t, t->tx, t->ty, FALSE)) {
3871             ; /* feedback has been give by animate_statue() */
3872         } else {
3873             /* Since statues look like monsters now, we say something
3874                different from "you miss" or "there's nobody there".
3875                Note:  we only do this when a statue is displayed here,
3876                because the player is probably attempting to attack it;
3877                other statues obscured by anything are just ignored. */
3878 /*JP
3879             pline("Thump!  Your blow bounces harmlessly off the statue.");
3880 */
3881             pline("\83S\83c\83\93\81I\92¤\91\9c\82Í\8f\9d\82Â\82©\82È\82©\82Á\82½\81D");
3882             wake_nearto(bhitpos.x, bhitpos.y, 25);
3883         }
3884     } else {
3885         /* no monster here and no statue seen or remembered here */
3886         if (glyph_is_invisible(glyph)) {
3887             /* now you know that nothing is there... */
3888             unmap_object(bhitpos.x, bhitpos.y);
3889             newsym(bhitpos.x, bhitpos.y);
3890         }
3891 /*JP
3892         You("miss; there is no one there to hit.");
3893 */
3894         You("\8aO\82ê\82½\81D\82»\82±\82É\82Í\89½\82à\82È\82¢\81D");
3895     }
3896     u_wipe_engr(2); /* same as for melee or throwing */
3897     return 1;
3898 }
3899
3900 STATIC_OVL int
3901 use_cream_pie(obj)
3902 struct obj *obj;
3903 {
3904     boolean wasblind = Blind;
3905     boolean wascreamed = u.ucreamed;
3906     boolean several = FALSE;
3907
3908     if (obj->quan > 1L) {
3909         several = TRUE;
3910         obj = splitobj(obj, 1L);
3911     }
3912     if (Hallucination)
3913 /*JP
3914         You("give yourself a facial.");
3915 */
3916         You("\83N\83\8a\81[\83\80\83p\83b\83N\82ð\82µ\82½\81D");
3917     else
3918 #if 0 /*JP*/
3919         pline("You immerse your %s in %s%s.", body_part(FACE),
3920               several ? "one of " : "",
3921               several ? makeplural(the(xname(obj))) : the(xname(obj)));
3922 #else
3923         pline("%s%s\82É%s\82ð\92¾\82ß\82½\81D",
3924               xname(obj),
3925               several ? "\82Ì\82Ð\82Æ\82Â" : "", body_part(FACE));
3926 #endif
3927     if (can_blnd((struct monst *) 0, &youmonst, AT_WEAP, obj)) {
3928         int blindinc = rnd(25);
3929         u.ucreamed += blindinc;
3930         make_blinded(Blinded + (long) blindinc, FALSE);
3931         if (!Blind || (Blind && wasblind))
3932 #if 0 /*JP*/
3933             pline("There's %ssticky goop all over your %s.",
3934                   wascreamed ? "more " : "", body_part(FACE));
3935 #else
3936             pline("\82â\82Á\82©\82¢\82È\82Ë\82Î\82Ë\82Î\82ª%s\91S\91Ì\82É%s\82Â\82¢\82½\81D",
3937                   body_part(FACE), wascreamed ? "\82³\82ç\82É" : "");
3938 #endif
3939         else /* Blind  && !wasblind */
3940 /*JP
3941             You_cant("see through all the sticky goop on your %s.",
3942 */
3943             pline("\82â\82Á\82©\82¢\82È\82Ë\82Î\82Ë\82Î\82ª%s\91S\91Ì\82É\82Â\82¢\82Ä\89½\82à\8c©\82¦\82È\82­\82È\82Á\82½\81D",
3944                      body_part(FACE));
3945     }
3946
3947     setnotworn(obj);
3948     /* useup() is appropriate, but we want costly_alteration()'s message */
3949     costly_alteration(obj, COST_SPLAT);
3950     obj_extract_self(obj);
3951     delobj(obj);
3952     return 0;
3953 }
3954
3955 STATIC_OVL int
3956 use_grapple(obj)
3957 struct obj *obj;
3958 {
3959     int res = 0, typ, max_range = 4, tohit;
3960     boolean save_confirm;
3961     coord cc;
3962     struct monst *mtmp;
3963     struct obj *otmp;
3964
3965     /* Are you allowed to use the hook? */
3966     if (u.uswallow) {
3967         pline(not_enough_room);
3968         return 0;
3969     }
3970     if (obj != uwep) {
3971         if (!wield_tool(obj, "cast"))
3972             return 0;
3973         else
3974             res = 1;
3975     }
3976     /* assert(obj == uwep); */
3977
3978     /* Prompt for a location */
3979     pline(where_to_hit);
3980     cc.x = u.ux;
3981     cc.y = u.uy;
3982 /*JP
3983     if (getpos(&cc, TRUE, "the spot to hit") < 0)
3984 */
3985     if (getpos(&cc, TRUE, "\91_\82¤\8fê\8f\8a") < 0)
3986         return res; /* ESC; uses turn iff grapnel became wielded */
3987
3988     /* Calculate range; unlike use_pole(), there's no minimum for range */
3989     typ = uwep_skill_type();
3990     if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3991         max_range = 4;
3992     else if (P_SKILL(typ) == P_SKILLED)
3993         max_range = 5;
3994     else
3995         max_range = 8;
3996     if (distu(cc.x, cc.y) > max_range) {
3997 /*JP
3998         pline("Too far!");
3999 */
4000         pline("\89\93\82·\82¬\82é\81I");
4001         return res;
4002     } else if (!cansee(cc.x, cc.y)) {
4003         You(cant_see_spot);
4004         return res;
4005     } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4006         You(cant_reach);
4007         return res;
4008     }
4009
4010     /* What do you want to hit? */
4011     tohit = rn2(5);
4012     if (typ != P_NONE && P_SKILL(typ) >= P_SKILLED) {
4013         winid tmpwin = create_nhwindow(NHW_MENU);
4014         anything any;
4015         char buf[BUFSZ];
4016         menu_item *selected;
4017
4018         any = zeroany; /* set all bits to zero */
4019         any.a_int = 1; /* use index+1 (cant use 0) as identifier */
4020         start_menu(tmpwin);
4021         any.a_int++;
4022 /*JP
4023         Sprintf(buf, "an object on the %s", surface(cc.x, cc.y));
4024 */
4025         Sprintf(buf, "%s\82É\82 \82é\95¨\91Ì", surface(cc.x, cc.y));
4026         add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4027                  MENU_UNSELECTED);
4028         any.a_int++;
4029 #if 0 /*JP*/
4030         add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "a monster",
4031                  MENU_UNSELECTED);
4032 #else
4033         add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "\89ö\95¨",
4034                  MENU_UNSELECTED);
4035 #endif
4036         any.a_int++;
4037 /*JP
4038         Sprintf(buf, "the %s", surface(cc.x, cc.y));
4039 */
4040         Sprintf(buf, "%s", surface(cc.x, cc.y));
4041         add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4042                  MENU_UNSELECTED);
4043 /*JP
4044         end_menu(tmpwin, "Aim for what?");
4045 */
4046         end_menu(tmpwin, "\89½\82ð\91_\82¤\81H");
4047         tohit = rn2(4);
4048         if (select_menu(tmpwin, PICK_ONE, &selected) > 0
4049             && rn2(P_SKILL(typ) > P_SKILLED ? 20 : 2))
4050             tohit = selected[0].item.a_int - 1;
4051         free((genericptr_t) selected);
4052         destroy_nhwindow(tmpwin);
4053     }
4054
4055     /* possibly scuff engraving at your feet;
4056        any engraving at the target location is unaffected */
4057     if (tohit == 2 || !rn2(2))
4058         u_wipe_engr(rnd(2));
4059
4060     /* What did you hit? */
4061     switch (tohit) {
4062     case 0: /* Trap */
4063         /* FIXME -- untrap needs to deal with non-adjacent traps */
4064         break;
4065     case 1: /* Object */
4066         if ((otmp = level.objects[cc.x][cc.y]) != 0) {
4067 /*JP
4068             You("snag an object from the %s!", surface(cc.x, cc.y));
4069 */
4070             You("%s\82Ì\82à\82Ì\82ð\88ø\82Á\8a|\82¯\82½\81I", surface(cc.x, cc.y));
4071             (void) pickup_object(otmp, 1L, FALSE);
4072             /* If pickup fails, leave it alone */
4073             newsym(cc.x, cc.y);
4074             return 1;
4075         }
4076         break;
4077     case 2: /* Monster */
4078         bhitpos = cc;
4079         if ((mtmp = m_at(cc.x, cc.y)) == (struct monst *) 0)
4080             break;
4081         notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4082         save_confirm = flags.confirm;
4083         if (verysmall(mtmp->data) && !rn2(4)
4084             && enexto(&cc, u.ux, u.uy, (struct permonst *) 0)) {
4085             flags.confirm = FALSE;
4086             (void) attack_checks(mtmp, uwep);
4087             flags.confirm = save_confirm;
4088             check_caitiff(mtmp); /* despite fact there's no damage */
4089 /*JP
4090             You("pull in %s!", mon_nam(mtmp));
4091 */
4092             You("%s\82ð\88ø\82Á\92£\82Á\82½\81I", mon_nam(mtmp));
4093             mtmp->mundetected = 0;
4094             rloc_to(mtmp, cc.x, cc.y);
4095             return 1;
4096         } else if ((!bigmonst(mtmp->data) && !strongmonst(mtmp->data))
4097                    || rn2(4)) {
4098             flags.confirm = FALSE;
4099             (void) attack_checks(mtmp, uwep);
4100             flags.confirm = save_confirm;
4101             check_caitiff(mtmp);
4102             (void) thitmonst(mtmp, uwep);
4103             return 1;
4104         }
4105     /* FALL THROUGH */
4106     case 3: /* Surface */
4107         if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
4108 /*JP
4109             pline_The("hook slices through the %s.", surface(cc.x, cc.y));
4110 */
4111             pline("\83t\83b\83N\82Í%s\82ð\82³\82Á\82Æ\90Ø\82Á\82½\81D", surface(cc.x, cc.y));
4112         else {
4113 /*JP
4114             You("are yanked toward the %s!", surface(cc.x, cc.y));
4115 */
4116             You("%s\82Ö\88ø\82Á\82Ï\82ç\82ê\82½\81I", surface(cc.x, cc.y));
4117             hurtle(sgn(cc.x - u.ux), sgn(cc.y - u.uy), 1, FALSE);
4118             spoteffects(TRUE);
4119         }
4120         return 1;
4121     default: /* Yourself (oops!) */
4122         if (P_SKILL(typ) <= P_BASIC) {
4123 /*JP
4124             You("hook yourself!");
4125 */
4126             You("\8e©\95ª\8e©\90g\82ð\88ø\82Á\8a|\82¯\82½\81I");
4127 /*JP
4128             losehp(Maybe_Half_Phys(rn1(10, 10)), "a grappling hook",
4129 */
4130             losehp(Maybe_Half_Phys(rn1(10, 10)), "\8e©\95ª\8e©\90g\82ð\88ø\82Á\8a|\82¯\82Ä",
4131                    KILLED_BY);
4132             return 1;
4133         }
4134         break;
4135     }
4136     pline1(nothing_happens);
4137     return 1;
4138 }
4139
4140 #define BY_OBJECT ((struct monst *) 0)
4141
4142 /* return 1 if the wand is broken, hence some time elapsed */
4143 STATIC_OVL int
4144 do_break_wand(obj)
4145 struct obj *obj;
4146 {
4147 /*JP
4148     static const char nothing_else_happens[] = "But nothing else happens...";
4149 */
4150     static const char nothing_else_happens[] = "\82µ\82©\82µ\81C\89½\82à\8bN\82«\82È\82©\82Á\82½\81D\81D\81D";
4151     register int i, x, y;
4152     register struct monst *mon;
4153     int dmg, damage;
4154     boolean affects_objects;
4155     boolean shop_damage = FALSE;
4156     boolean fillmsg = FALSE;
4157     int expltype = EXPL_MAGICAL;
4158     char confirm[QBUFSZ], buf[BUFSZ];
4159 /*JP
4160     boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa"));
4161 */
4162     boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "\83o\83\8b\83T\82Ì\8fñ"));
4163
4164 #if 0 /*JP*/
4165     if (!paranoid_query(ParanoidBreakwand,
4166                        safe_qbuf(confirm,
4167                                  "Are you really sure you want to break ",
4168                                  "?", obj, yname, ysimple_name, "the wand")))
4169 #else
4170     if (!paranoid_query(ParanoidBreakwand,
4171                        safe_qbuf(confirm,
4172                                  "\96{\93\96\82É", "\82ð\89ó\82·\82Ì\81H",
4173                                  obj, xname, ysimple_name, "\8fñ")))
4174 #endif
4175         return 0;
4176
4177     if (nohands(youmonst.data)) {
4178 /*JP
4179         You_cant("break %s without hands!", yname(obj));
4180 */
4181         You("\8eè\82ª\96³\82¢\82Ì\82Å%s\82ð\89ó\82¹\82È\82¢\81I", xname(obj));
4182         return 0;
4183     } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) {
4184 /*JP
4185         You("don't have the strength to break %s!", yname(obj));
4186 */
4187         You("%s\82ð\89ó\82·\82¾\82¯\82Ì\97Í\82ª\82È\82¢\81I", xname(obj));
4188         return 0;
4189     }
4190 /*JP
4191     pline("Raising %s high above your %s, you break it in two!", yname(obj),
4192 */
4193     You("%s\82ð%s\82Ì\8fã\82É\8d\82\82­\8cf\82°\81C\93ñ\82Â\82É\82Ö\82µ\90Ü\82Á\82½\81I", xname(obj),
4194           body_part(HEAD));
4195
4196     /* [ALI] Do this first so that wand is removed from bill. Otherwise,
4197      * the freeinv() below also hides it from setpaid() which causes problems.
4198      */
4199     if (obj->unpaid) {
4200         check_unpaid(obj); /* Extra charge for use */
4201         costly_alteration(obj, COST_DSTROY);
4202     }
4203
4204     current_wand = obj; /* destroy_item might reset this */
4205     freeinv(obj);       /* hide it from destroy_item instead... */
4206     setnotworn(obj);    /* so we need to do this ourselves */
4207
4208     if (!zappable(obj)) {
4209         pline(nothing_else_happens);
4210         goto discard_broken_wand;
4211     }
4212     /* successful call to zappable() consumes a charge; put it back */
4213     obj->spe++;
4214     /* might have "wrested" a final charge, taking it from 0 to -1;
4215        if so, we just brought it back up to 0, which wouldn't do much
4216        below so give it 1..3 charges now, usually making it stronger
4217        than an ordinary last charge (the wand is already gone from
4218        inventory, so perm_invent can't accidentally reveal this) */
4219     if (!obj->spe)
4220         obj->spe = rnd(3);
4221
4222     obj->ox = u.ux;
4223     obj->oy = u.uy;
4224     dmg = obj->spe * 4;
4225     affects_objects = FALSE;
4226
4227     switch (obj->otyp) {
4228     case WAN_WISHING:
4229     case WAN_NOTHING:
4230     case WAN_LOCKING:
4231     case WAN_PROBING:
4232     case WAN_ENLIGHTENMENT:
4233     case WAN_OPENING:
4234     case WAN_SECRET_DOOR_DETECTION:
4235         pline(nothing_else_happens);
4236         goto discard_broken_wand;
4237     case WAN_DEATH:
4238     case WAN_LIGHTNING:
4239         dmg *= 4;
4240         goto wanexpl;
4241     case WAN_FIRE:
4242         expltype = EXPL_FIERY;
4243     case WAN_COLD:
4244         if (expltype == EXPL_MAGICAL)
4245             expltype = EXPL_FROSTY;
4246         dmg *= 2;
4247     case WAN_MAGIC_MISSILE:
4248     wanexpl:
4249         explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
4250         makeknown(obj->otyp); /* explode describes the effect */
4251         goto discard_broken_wand;
4252     case WAN_STRIKING:
4253         /* we want this before the explosion instead of at the very end */
4254 /*JP
4255         pline("A wall of force smashes down around you!");
4256 */
4257         pline("\82 \82È\82½\82Í\96\82\97Í\82Ì\95Ç\82É\82Â\82Â\82Ü\82ê\82½\81I");
4258         dmg = d(1 + obj->spe, 6); /* normally 2d12 */
4259         /*FALLTHRU*/
4260     case WAN_CANCELLATION:
4261     case WAN_POLYMORPH:
4262     case WAN_TELEPORTATION:
4263     case WAN_UNDEAD_TURNING:
4264         affects_objects = TRUE;
4265         break;
4266     default:
4267         break;
4268     }
4269
4270     /* magical explosion and its visual effect occur before specific effects
4271      */
4272     /* [TODO?  This really ought to prevent the explosion from being
4273        fatal so that we never leave a bones file where none of the
4274        surrounding targets (or underlying objects) got affected yet.] */
4275     explode(obj->ox, obj->oy, -(obj->otyp), rnd(dmg), WAND_CLASS,
4276             EXPL_MAGICAL);
4277
4278     /* prepare for potential feedback from polymorph... */
4279     zapsetup();
4280
4281     /* this makes it hit us last, so that we can see the action first */
4282     for (i = 0; i <= 8; i++) {
4283         bhitpos.x = x = obj->ox + xdir[i];
4284         bhitpos.y = y = obj->oy + ydir[i];
4285         if (!isok(x, y))
4286             continue;
4287
4288         if (obj->otyp == WAN_DIGGING) {
4289             schar typ;
4290
4291             if (dig_check(BY_OBJECT, FALSE, x, y)) {
4292                 if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
4293                     /* normally, pits and holes don't anger guards, but they
4294                      * do if it's a wall or door that's being dug */
4295                     watch_dig((struct monst *) 0, x, y, TRUE);
4296                     if (*in_rooms(x, y, SHOPBASE))
4297                         shop_damage = TRUE;
4298                 }
4299                 /*
4300                  * Let liquid flow into the newly created pits.
4301                  * Adjust corresponding code in music.c for
4302                  * drum of earthquake if you alter this sequence.
4303                  */
4304                 typ = fillholetyp(x, y, FALSE);
4305                 if (typ != ROOM) {
4306                     levl[x][y].typ = typ;
4307                     liquid_flow(x, y, typ, t_at(x, y),
4308                                 fillmsg
4309                                   ? (char *) 0
4310 /*JP
4311                                   : "Some holes are quickly filled with %s!");
4312 */
4313                                   : "\8c\8a\82Í\82·\82®\82É%s\82Å\96\84\82Ü\82Á\82½\81I");
4314                     fillmsg = TRUE;
4315                 } else
4316                     digactualhole(x, y, BY_OBJECT, (rn2(obj->spe) < 3
4317                                                     || (!Can_dig_down(&u.uz)
4318                                                         && !levl[x][y].candig))
4319                                                       ? PIT
4320                                                       : HOLE);
4321             }
4322             continue;
4323         } else if (obj->otyp == WAN_CREATE_MONSTER) {
4324             /* u.ux,u.uy creates it near you--x,y might create it in rock */
4325             (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
4326             continue;
4327         } else if (x != u.ux || y != u.uy) {
4328             /*
4329              * Wand breakage is targetting a square adjacent to the hero,
4330              * which might contain a monster or a pile of objects or both.
4331              * Handle objects last; avoids having undead turning raise an
4332              * undead's corpse and then attack resulting undead monster.
4333              * obj->bypass in bhitm() prevents the polymorphing of items
4334              * dropped due to monster's polymorph and prevents undead
4335              * turning that kills an undead from raising resulting corpse.
4336              */
4337             if ((mon = m_at(x, y)) != 0) {
4338                 (void) bhitm(mon, obj);
4339                 /* if (context.botl) bot(); */
4340             }
4341             if (affects_objects && level.objects[x][y]) {
4342                 (void) bhitpile(obj, bhito, x, y, 0);
4343                 if (context.botl)
4344                     bot(); /* potion effects */
4345             }
4346         } else {
4347             /*
4348              * Wand breakage is targetting the hero.  Using xdir[]+ydir[]
4349              * deltas for location selection causes this case to happen
4350              * after all the surrounding squares have been handled.
4351              * Process objects first, in case damage is fatal and leaves
4352              * bones, or teleportation sends one or more of the objects to
4353              * same destination as hero (lookhere/autopickup); also avoids
4354              * the polymorphing of gear dropped due to hero's transformation.
4355              * (Unlike with monsters being hit by zaps, we can't rely on use
4356              * of obj->bypass in the zap code to accomplish that last case
4357              * since it's also used by retouch_equipment() for polyself.)
4358              */
4359             if (affects_objects && level.objects[x][y]) {
4360                 (void) bhitpile(obj, bhito, x, y, 0);
4361                 if (context.botl)
4362                     bot(); /* potion effects */
4363             }
4364             damage = zapyourself(obj, FALSE);
4365             if (damage) {
4366 #if 0 /*JP:T*/
4367                 Sprintf(buf, "killed %sself by breaking a wand", uhim());
4368                 losehp(Maybe_Half_Phys(damage), buf, NO_KILLER_PREFIX);
4369 #else
4370                 Strcpy(buf, "\8e©\95ª\8e©\90g\82Å\8fñ\82ð\89ó\82µ\82Ä\83_\83\81\81[\83W\82ð\8eó\82¯");
4371                 losehp(Maybe_Half_Phys(damage), buf, KILLED_BY);
4372 #endif
4373             }
4374             if (context.botl)
4375                 bot(); /* blindness */
4376         }
4377     }
4378
4379     /* potentially give post zap/break feedback */
4380     zapwrapup();
4381
4382     /* Note: if player fell thru, this call is a no-op.
4383        Damage is handled in digactualhole in that case */
4384     if (shop_damage)
4385 /*JP
4386         pay_for_damage("dig into", FALSE);
4387 */
4388         pay_for_damage("\8c\8a\82ð\82 \82¯\82é", FALSE);
4389
4390     if (obj->otyp == WAN_LIGHT)
4391         litroom(TRUE, obj); /* only needs to be done once */
4392
4393 discard_broken_wand:
4394     obj = current_wand; /* [see dozap() and destroy_item()] */
4395     current_wand = 0;
4396     if (obj)
4397         delobj(obj);
4398     nomul(0);
4399     return 1;
4400 }
4401
4402 STATIC_OVL void
4403 add_class(cl, class)
4404 char *cl;
4405 char class;
4406 {
4407     char tmp[2];
4408
4409     tmp[0] = class;
4410     tmp[1] = '\0';
4411     Strcat(cl, tmp);
4412 }
4413
4414 static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
4415
4416 /* augment tools[] if various items are carried */
4417 STATIC_OVL void
4418 setapplyclasses(class_list)
4419 char class_list[];
4420 {
4421     register struct obj *otmp;
4422     int otyp;
4423     boolean knowoil, knowtouchstone, addpotions, addstones, addfood;
4424
4425     knowoil = objects[POT_OIL].oc_name_known;
4426     knowtouchstone = objects[TOUCHSTONE].oc_name_known;
4427     addpotions = addstones = addfood = FALSE;
4428     for (otmp = invent; otmp; otmp = otmp->nobj) {
4429         otyp = otmp->otyp;
4430         if (otyp == POT_OIL
4431             || (otmp->oclass == POTION_CLASS
4432                 && (!otmp->dknown
4433                     || (!knowoil && !objects[otyp].oc_name_known))))
4434             addpotions = TRUE;
4435         if (otyp == TOUCHSTONE
4436             || (is_graystone(otmp)
4437                 && (!otmp->dknown
4438                     || (!knowtouchstone && !objects[otyp].oc_name_known))))
4439             addstones = TRUE;
4440         if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF)
4441             addfood = TRUE;
4442     }
4443
4444     class_list[0] = '\0';
4445     if (addpotions || addstones)
4446         add_class(class_list, ALL_CLASSES);
4447     Strcat(class_list, tools);
4448     if (addpotions)
4449         add_class(class_list, POTION_CLASS);
4450     if (addstones)
4451         add_class(class_list, GEM_CLASS);
4452     if (addfood)
4453         add_class(class_list, FOOD_CLASS);
4454 }
4455
4456 /* the 'a' command */
4457 int
4458 doapply()
4459 {
4460     struct obj *obj;
4461     register int res = 1;
4462     char class_list[MAXOCLASSES + 2];
4463
4464     if (check_capacity((char *) 0))
4465         return 0;
4466
4467     setapplyclasses(class_list); /* tools[] */
4468     obj = getobj(class_list, "use or apply");
4469     if (!obj)
4470         return 0;
4471
4472     if (!retouch_object(&obj, FALSE))
4473         return 1; /* evading your grasp costs a turn; just be
4474                      grateful that you don't drop it as well */
4475
4476     if (obj->oclass == WAND_CLASS)
4477         return do_break_wand(obj);
4478
4479     switch (obj->otyp) {
4480     case BLINDFOLD:
4481     case LENSES:
4482         if (obj == ublindf) {
4483             if (!cursed(obj))
4484                 Blindf_off(obj);
4485         } else if (!ublindf) {
4486             Blindf_on(obj);
4487         } else {
4488 #if 0 /*JP*/
4489             You("are already %s.", ublindf->otyp == TOWEL
4490                                        ? "covered by a towel"
4491                                        : ublindf->otyp == BLINDFOLD
4492                                              ? "wearing a blindfold"
4493                                              : "wearing lenses");
4494 #else
4495             You("\82à\82¤%s\82Ä\82¢\82é\81D", ublindf->otyp == TOWEL
4496                                       ? "\83^\83I\83\8b\82ð\8aª\82¢"
4497                                       : ublindf->otyp == BLINDFOLD
4498                                             ? "\96Ú\89B\82µ\82ð\82Â\82¯"
4499                                             : "\83\8c\83\93\83Y\82ð\82Â\82¯");
4500 #endif
4501         }
4502         break;
4503     case CREAM_PIE:
4504         res = use_cream_pie(obj);
4505         break;
4506     case BULLWHIP:
4507         res = use_whip(obj);
4508         break;
4509     case GRAPPLING_HOOK:
4510         res = use_grapple(obj);
4511         break;
4512     case LARGE_BOX:
4513     case CHEST:
4514     case ICE_BOX:
4515     case SACK:
4516     case BAG_OF_HOLDING:
4517     case OILSKIN_SACK:
4518         res = use_container(&obj, 1);
4519         break;
4520     case BAG_OF_TRICKS:
4521         (void) bagotricks(obj, FALSE, (int *) 0);
4522         break;
4523     case CAN_OF_GREASE:
4524         use_grease(obj);
4525         break;
4526     case LOCK_PICK:
4527     case CREDIT_CARD:
4528     case SKELETON_KEY:
4529         res = (pick_lock(obj) != 0);
4530         break;
4531     case PICK_AXE:
4532     case DWARVISH_MATTOCK:
4533         res = use_pick_axe(obj);
4534         break;
4535     case TINNING_KIT:
4536         use_tinning_kit(obj);
4537         break;
4538     case LEASH:
4539         use_leash(obj);
4540         break;
4541     case SADDLE:
4542         res = use_saddle(obj);
4543         break;
4544     case MAGIC_WHISTLE:
4545         use_magic_whistle(obj);
4546         break;
4547     case TIN_WHISTLE:
4548         use_whistle(obj);
4549         break;
4550     case EUCALYPTUS_LEAF:
4551         /* MRKR: Every Australian knows that a gum leaf makes an excellent
4552          * whistle, especially if your pet is a tame kangaroo named Skippy.
4553          */
4554         if (obj->blessed) {
4555             use_magic_whistle(obj);
4556             /* sometimes the blessing will be worn off */
4557             if (!rn2(49)) {
4558                 if (!Blind) {
4559 /*JP
4560                     pline("%s %s.", Yobjnam2(obj, "glow"), hcolor("brown"));
4561 */
4562                     pline("%s\82Í%s\8bP\82¢\82½\81D", xname(obj), jconj_adj(hcolor("\92\83\90F\82Ì")));
4563                     obj->bknown = 1;
4564                 }
4565                 unbless(obj);
4566             }
4567         } else {
4568             use_whistle(obj);
4569         }
4570         break;
4571     case STETHOSCOPE:
4572         res = use_stethoscope(obj);
4573         break;
4574     case MIRROR:
4575         res = use_mirror(obj);
4576         break;
4577     case BELL:
4578     case BELL_OF_OPENING:
4579         use_bell(&obj);
4580         break;
4581     case CANDELABRUM_OF_INVOCATION:
4582         use_candelabrum(obj);
4583         break;
4584     case WAX_CANDLE:
4585     case TALLOW_CANDLE:
4586         use_candle(&obj);
4587         break;
4588     case OIL_LAMP:
4589     case MAGIC_LAMP:
4590     case BRASS_LANTERN:
4591         use_lamp(obj);
4592         break;
4593     case POT_OIL:
4594         light_cocktail(obj);
4595         break;
4596     case EXPENSIVE_CAMERA:
4597         res = use_camera(obj);
4598         break;
4599     case TOWEL:
4600         res = use_towel(obj);
4601         break;
4602     case CRYSTAL_BALL:
4603         use_crystal_ball(&obj);
4604         break;
4605     case MAGIC_MARKER:
4606         res = dowrite(obj);
4607         break;
4608     case TIN_OPENER:
4609         if (!carrying(TIN)) {
4610 /*JP
4611             You("have no tin to open.");
4612 */
4613             You("\8aÊ\82ð\8e\9d\82Á\82Ä\82¢\82È\82¢\81D");
4614             goto xit;
4615         }
4616 /*JP
4617         You("cannot open a tin without eating or discarding its contents.");
4618 */
4619         pline("\92\86\90g\82ð\90H\82×\82é\82©\81C\8eÌ\82Ä\82é\82©\82µ\82È\82¢\82Æ\8aÊ\82ð\8aJ\82¯\82ç\82ê\82È\82¢\81D");
4620         if (flags.verbose)
4621 /*JP
4622             pline("In order to eat, use the 'e' command.");
4623 */
4624             pline("\90H\82×\82é\82É\82Í\81C'e'\83R\83}\83\93\83h\82ð\8eg\82¦\82Î\82æ\82¢\81D");
4625         if (obj != uwep)
4626             pline(
4627 /*JP
4628           "Opening the tin will be much easier if you wield the tin opener.");
4629 */
4630           "\8aÊ\90Ø\82è\82ð\91\95\94õ\82µ\82Ä\82¢\82ê\82Î\81C\82¸\82Á\82Æ\8aÈ\92P\82É\8aJ\82¯\82é\82±\82Æ\82ª\82Å\82«\82é\81D");
4631         goto xit;
4632
4633     case FIGURINE:
4634         use_figurine(&obj);
4635         break;
4636     case UNICORN_HORN:
4637         use_unicorn_horn(obj);
4638         break;
4639     case WOODEN_FLUTE:
4640     case MAGIC_FLUTE:
4641     case TOOLED_HORN:
4642     case FROST_HORN:
4643     case FIRE_HORN:
4644     case WOODEN_HARP:
4645     case MAGIC_HARP:
4646     case BUGLE:
4647     case LEATHER_DRUM:
4648     case DRUM_OF_EARTHQUAKE:
4649         res = do_play_instrument(obj);
4650         break;
4651     case HORN_OF_PLENTY: /* not a musical instrument */
4652         (void) hornoplenty(obj, FALSE);
4653         break;
4654     case LAND_MINE:
4655     case BEARTRAP:
4656         use_trap(obj);
4657         break;
4658     case FLINT:
4659     case LUCKSTONE:
4660     case LOADSTONE:
4661     case TOUCHSTONE:
4662         use_stone(obj);
4663         break;
4664     default:
4665         /* Pole-weapons can strike at a distance */
4666         if (is_pole(obj)) {
4667             res = use_pole(obj);
4668             break;
4669         } else if (is_pick(obj) || is_axe(obj)) {
4670             res = use_pick_axe(obj);
4671             break;
4672         }
4673 /*JP
4674         pline("Sorry, I don't know how to use that.");
4675 */
4676         pline("\82»\82ê\82ð\82Ç\82¤\82â\82Á\82Ä\8eg\82¤\82ñ\82¾\82¢\81H");
4677     xit:
4678         nomul(0);
4679         return 0;
4680     }
4681     if (res && obj && obj->oartifact)
4682         arti_speak(obj);
4683     nomul(0);
4684     return res;
4685 }
4686
4687 /* Keep track of unfixable troubles for purposes of messages saying you feel
4688  * great.
4689  */
4690 int
4691 unfixable_trouble_count(is_horn)
4692 boolean is_horn;
4693 {
4694     int unfixable_trbl = 0;
4695
4696     if (Stoned)
4697         unfixable_trbl++;
4698     if (Strangled)
4699         unfixable_trbl++;
4700     if (Wounded_legs && !u.usteed)
4701         unfixable_trbl++;
4702     if (Slimed)
4703         unfixable_trbl++;
4704     /* lycanthropy is undesirable, but it doesn't actually make you feel bad */
4705
4706     if (!is_horn || (Confusion & ~TIMEOUT))
4707         unfixable_trbl++;
4708     if (!is_horn || (Sick & ~TIMEOUT))
4709         unfixable_trbl++;
4710     if (!is_horn || (HHallucination & ~TIMEOUT))
4711         unfixable_trbl++;
4712     if (!is_horn || (Vomiting & ~TIMEOUT))
4713         unfixable_trbl++;
4714     if (!is_horn || (HStun & ~TIMEOUT))
4715         unfixable_trbl++;
4716     if (!is_horn || (HDeaf & ~TIMEOUT))
4717         unfixable_trbl++;
4718
4719     return unfixable_trbl;
4720 }
4721
4722 /*apply.c*/