OSDN Git Service

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