OSDN Git Service

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