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. */
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. */
12 extern boolean notonhead; /* for long worms */
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 *,
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));
48 void FDECL(amii_speaker, (struct obj *, char *, int));
51 static const char no_elbow_room[] =
53 "don't have enough elbow-room to maneuver.";
55 "
\82»
\82ê
\82ð
\82·
\82é
\82¾
\82¯
\82Ì
\82ä
\82Æ
\82è
\82ª
\82È
\82¢
\81D";
65 pline("Using your camera underwater would void the warranty.");
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");
70 if (!getdir((char *) 0))
74 pline1(nothing_happens);
77 consume_obj_charge(obj, TRUE);
79 if (obj->cursed && !rn2(2)) {
80 (void) zapyourself(obj, TRUE);
81 } else if (u.uswallow) {
83 You("take a picture of %s %s.", s_suffix(mon_nam(u.ustuck)),
84 mbodypart(u.ustuck, STOMACH));
86 You("%s
\82Ì%s
\82Ì
\8eÊ
\90^
\82ð
\8eB
\82Á
\82½
\81D", mon_nam(u.ustuck),
87 mbodypart(u.ustuck, STOMACH));
91 You("take a picture of the %s.",
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);
110 boolean drying_feedback = (obj == uwep);
114 You("have no free %s!", body_part(HAND));
116 You("%s
\82Ì
\8e©
\97R
\82ª
\8cø
\82©
\82È
\82¢
\81I", body_part(HAND));
118 } else if (obj == ublindf) {
120 You("cannot use it while you're wearing it!");
122 You("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\82Ì
\82Å
\8eg
\97p
\82Å
\82«
\82È
\82¢
\81I");
124 } else if (obj->cursed) {
130 incr_itimeout(&Glib, rn1(10, 3));
132 Your("%s %s!", makeplural(body_part(HAND)),
133 (old ? "are filthier than ever" : "get slimy"));
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½"));
138 if (is_wet_towel(obj))
139 dry_a_towel(obj, -1, drying_feedback);
144 u.ucreamed += rn1(10, 3);
146 pline("Yecch! Your %s %s gunk on it!", body_part(FACE),
147 (old ? "has more" : "now has"));
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Æ" : ""));
152 make_blinded(Blinded + (long) u.ucreamed - old, TRUE);
157 what = (ublindf->otyp == LENSES)
159 : (obj->otyp == ublindf->otyp) ? "other towel"
162 what = (ublindf->otyp == LENSES)
164 : (obj->otyp == ublindf->otyp) ? "
\83^
\83I
\83\8b"
167 if (ublindf->cursed) {
169 You("push your %s %s.", what,
170 rn2(2) ? "cock-eyed" : "crooked");
172 pline("%s
\82ª%s
\81D", what,
173 rn2(2) ? "
\82¸
\82ê
\82½" : "
\82ä
\82ª
\82ñ
\82¾");
176 struct obj *saved_ublindf = ublindf;
178 You("push your %s off.", what);
180 pline("%s
\82ª
\82¸
\82è
\97\8e\82¿
\82½
\81D", what);
182 dropx(saved_ublindf);
185 if (is_wet_towel(obj))
186 dry_a_towel(obj, -1, drying_feedback);
196 You("wipe off your %s.", makeplural(body_part(HAND)));
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);
202 } else if (u.ucreamed) {
203 Blinded -= u.ucreamed;
207 pline("You've got the glop off.");
209 You("
\82³
\82Á
\82Ï
\82è
\82µ
\82½
\81D");
210 if (!gulp_blnd_check()) {
212 make_blinded(0L, TRUE);
216 Your("%s feels clean now.", body_part(FACE));
218 pline("%s
\82Ì
\89\98\82ê
\82ð
\90@
\82«
\82Æ
\82Á
\82½
\81D", body_part(FACE));
220 if (is_wet_towel(obj))
221 dry_a_towel(obj, -1, drying_feedback);
226 Your("%s and %s are already clean.", body_part(FACE),
227 makeplural(body_part(HAND)));
229 Your("%s
\82â%s
\82Í
\89\98\82ê
\82Ä
\82¢
\82È
\82¢
\81D", body_part(FACE),
230 makeplural(body_part(HAND)));
236 /* maybe give a stethoscope message based on floor objects */
238 its_dead(rx, ry, resp)
242 boolean more_corpses;
243 struct permonst *mptr;
244 struct obj *corpse = sobj_at(CORPSE, rx, ry),
245 *statue = sobj_at(STATUE, rx, ry);
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);
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 */
259 statue = 0; /* corpse precedes statue; ignore statue */
261 more_corpses = (corpse && nxtobj(corpse, CORPSE, TRUE));
263 /* additional stethoscope messages from jyoung@apanix.apana.org.au */
264 if (!corpse && !statue) {
265 ; /* nothing to do */
267 } else if (Hallucination) {
271 Strcpy(buf, "You're both stoned");
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);
279 /* (most corpses don't retain the monster's sex, so
280 we're usually forced to use generic pronoun here) */
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;
289 mptr = &mons[corpse->corpsenm];
292 else if (is_male(mptr))
295 Sprintf(buf, "%s's dead", genders[gndr].he); /* "he"/"she"/"it" */
296 buf[0] = highc(buf[0]);
298 } else { /* plural */
300 Strcpy(buf, "They're dead");
302 Strcpy(buf, "
\8e\80\82ñ
\82Å
\82é
\82º");
304 /* variations on "He's dead, Jim." (Star Trek's Dr McCoy) */
306 You_hear("a voice say, \"%s, Jim.\"", buf);
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);
313 boolean here = (rx == u.ux && ry == u.uy),
314 one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
316 if (Role_if(PM_HEALER)) {
317 /* ok to reset `corpse' here; we're done with it */
319 if (obj_has_timer(corpse, REVIVE_MON))
322 corpse = nxtobj(corpse, CORPSE, TRUE);
323 } while (corpse && !reviver);
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" : "");
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Ú" : "");
336 } else { /* statue */
337 const char *what, *how;
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");
348 if (!type_is_pname(mptr))
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ê";
355 what = mons[statue->corpsenm].mname;
362 if (Role_if(PM_HEALER)) {
363 struct trap *ttmp = t_at(rx, ry);
365 if (ttmp && ttmp->ttyp == STATUE_TRAP)
367 how = "extraordinary";
369 how = "
\95À
\8aO
\82ê
\82½";
370 else if (Has_contents(statue))
374 how = "
\92\8d\96Ú
\82·
\82×
\82«";
378 pline("%s is in %s health for a statue.", what, how);
380 pline("
\92¤
\91\9c\82Æ
\82µ
\82Ä
\82Ì%s
\82Í%s
\8dì
\95i
\82¾
\81D", what, how);
383 return FALSE; /* no corpse or statue */
387 static const char hollow_str[] = "a hollow sound. This must be a secret %s!";
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";
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. */
397 register struct obj *obj;
402 boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
403 && !rn2(Role_if(PM_HEALER) ? 10 : 3));
405 if (nohands(youmonst.data)) {
407 You("have no hands!"); /* not `body_part(HAND)' */
409 pline("
\82 \82È
\82½
\82É
\82Í
\8eè
\82ª
\82È
\82¢
\81I");
414 You_cant("hear anything!");
416 You("
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81I");
418 } else if (!freehand()) {
420 You("have no free %s.", body_part(HAND));
422 You("%s
\82Ì
\8e©
\97R
\82ª
\8cø
\82©
\82È
\82¢
\81D", body_part(HAND));
425 if (!getdir((char *) 0))
428 res = (moves == context.stethoscope_move)
429 && (youmonst.movement == context.stethoscope_movement);
430 context.stethoscope_move = moves;
431 context.stethoscope_movement = youmonst.movement;
433 if (u.usteed && u.dz > 0) {
436 pline("%s interferes.", Monnam(u.ustuck));
438 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
439 mstatusline(u.ustuck);
441 mstatusline(u.usteed);
443 } else if (u.uswallow && (u.dx || u.dy || u.dz)) {
444 mstatusline(u.ustuck);
446 } else if (u.uswallow && interference) {
448 pline("%s interferes.", Monnam(u.ustuck));
450 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
451 mstatusline(u.ustuck);
456 You_hear("faint splashing.");
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))
465 You_hear("the crackling of hellfire.");
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");
470 pline_The("%s seems healthy enough.", surface(u.ux, u.uy));
472 pline("%s
\82Í
\8f[
\95ª
\8c\92\8dN
\82Ì
\82æ
\82¤
\82¾
\81D", surface(u.ux,u.uy));
474 } else if (obj->cursed && !rn2(2)) {
476 You_hear("your heart beat.");
478 You_hear("
\8e©
\95ª
\82Ì
\90S
\91\9f\82Ì
\8cÛ
\93®
\82ð
\95·
\82¢
\82½
\81D");
481 if (Stunned || (Confusion && !rn2(5)))
483 if (!u.dx && !u.dy) {
491 You_hear("a faint typing noise.");
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");
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);
500 if (mtmp->mundetected) {
501 if (!canspotmon(mtmp))
503 There("is %s hidden there.", mnm);
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";
511 switch (mtmp->m_ap_type) {
513 what = simple_typename(mtmp->mappearance);
515 case M_AP_MONSTER: /* ignore Hallucination here */
516 what = mons[mtmp->mappearance].mname;
519 what = defsyms[mtmp->mappearance].explanation;
524 pline("That %s is really %s", what, mnm);
526 pline("
\82±
\82Ì%s
\82Í
\8eÀ
\8dÛ
\82É
\82Í%s
\81D", what, mnm);
527 } else if (flags.verbose && !canspotmon(mtmp)) {
529 There("is %s there.", mnm);
531 pline("
\82±
\82±
\82É
\82Í%s
\82ª
\82¢
\82é
\81D", mnm);
534 if (!canspotmon(mtmp))
535 map_invisible(rx, ry);
538 if (glyph_is_invisible(levl[rx][ry].glyph)) {
539 unmap_object(rx, ry);
542 pline_The("invisible monster must have moved.");
544 pline_The("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82Í
\88Ú
\93®
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
550 You_hear(hollow_str, "door");
552 You_hear(hollow_str, "
\94à");
553 cvt_sdoor_to_door(lev); /* ->typ = DOOR */
558 You_hear(hollow_str, "passage");
560 You_hear(hollow_str, "
\92Ê
\98H");
562 unblock_point(rx, ry);
567 if (!its_dead(rx, ry, &res))
569 You("hear nothing special."); /* not You_hear() */
571 pline("
\93Á
\82É
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81D");
577 static const char whistle_str[] = "produce a %s whistling sound.";
579 static const char whistle_str[] = "
\93J
\82ð
\90\81\82¢
\82Ä%s
\89¹
\82ð
\82½
\82Ä
\82½
\81D";
585 if (!can_blow(&youmonst)) {
587 You("are incapable of using the whistle.");
589 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
590 } else if (Underwater) {
592 You("blow bubbles through %s.", yname(obj));
594 You("%s
\82ð
\92Ê
\82µ
\82Ä
\96A
\82ð
\8fo
\82µ
\82½
\81D", xname(obj));
597 You(whistle_str, obj->cursed ? "shrill" : "high");
599 You(whistle_str, obj->cursed ? "
\95s
\8bC
\96¡
\82È" : "
\82©
\82ñ
\8d\82\82¢");
605 use_magic_whistle(obj)
608 register struct monst *mtmp, *nextmon;
610 if (!can_blow(&youmonst)) {
612 You("are incapable of using the whistle.");
614 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
615 } else if (obj->cursed && !rn2(2)) {
617 You("produce a %shigh-pitched humming noise.",
618 Underwater ? "very " : "");
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à" : "");
625 int pet_cnt = 0, omx, omy;
627 /* it's magic! it works underwater too (at a higher pitch) */
630 Hallucination ? "normal" : Underwater ? "strange, high-pitched"
634 Hallucination ? "
\93J
\82Ì
\82æ
\82¤
\82È" : Underwater ? "
\95s
\8ev
\8bc
\82È
\8d\82\82¢
\92²
\8eq
\82Ì"
635 : "
\95s
\8ev
\8bc
\82È");
637 for (mtmp = fmon; mtmp; mtmp = nextmon) {
638 nextmon = mtmp->nmon; /* trap might kill mon */
639 if (DEADMONSTER(mtmp))
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)
646 if (mtmp->mtrapped) {
647 /* no longer in previous trap (affects mintrap) */
649 fill_pit(mtmp->mx, mtmp->my);
651 /* mimic must be revealed before we know whether it
652 actually moves because line-of-sight may change */
655 omx = mtmp->mx, omy = mtmp->my;
657 if (mtmp->mx != omx || mtmp->my != omy) {
658 mtmp->mundetected = 0; /* reveal non-mimic hider */
659 if (canspotmon(mtmp))
661 if (mintrap(mtmp) == 2)
667 makeknown(obj->otyp);
675 return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
684 for (obj = invent; obj; obj = obj->nobj)
685 if (obj->otyp == LEASH && obj->leashmon != 0)
690 /* otmp is about to be destroyed or stolen */
693 register struct obj *otmp;
695 register struct monst *mtmp;
697 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
698 if (mtmp->m_id == (unsigned) otmp->leashmon)
703 /* mtmp is about to die, or become untame */
705 m_unleash(mtmp, feedback)
706 register struct monst *mtmp;
709 register struct obj *otmp;
714 pline("%s pulls free of %s leash!", Monnam(mtmp), mhis(mtmp));
716 pline("%s
\82Í
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82Ä
\93¦
\82ê
\82½
\81I", Monnam(mtmp));
719 Your("leash falls slack.");
721 Your("
\95R
\82ª
\82½
\82é
\82ñ
\82Å
\97\8e\82¿
\82½
\81D");
723 for (otmp = invent; otmp; otmp = otmp->nobj)
724 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
729 /* player is about to die (for bones) */
733 register struct obj *otmp;
734 register struct monst *mtmp;
736 for (otmp = invent; otmp; otmp = otmp->nobj)
737 if (otmp->otyp == LEASH)
739 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
749 return (boolean) (mtmp->mnum != PM_LONG_WORM);
758 register struct monst *mtmp;
761 if (!obj->leashmon && number_leashed() >= MAXLEASHED) {
763 You("cannot leash any more pets.");
765 You("
\82±
\82ê
\88È
\8fã
\83y
\83b
\83g
\82É
\95R
\82ð
\82©
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
769 if (!get_adjacent_loc((char *) 0, (char *) 0, u.ux, u.uy, &cc))
772 if ((cc.x == u.ux) && (cc.y == u.uy)) {
773 if (u.usteed && u.dz > 0) {
779 pline("Leash yourself? Very funny...");
781 pline("
\8e©
\95ª
\82ð
\94\9b\82é
\81H
\95Ï
\82È
\82Ì
\81D
\81D
\81D");
785 if (!(mtmp = m_at(cc.x, cc.y))) {
787 There("is no creature there.");
789 pline("
\82»
\82±
\82É
\82Í
\90¶
\82«
\95¨
\82Í
\82¢
\82È
\82¢
\81D");
793 spotmon = canspotmon(mtmp);
799 There("is no creature there.");
801 pline("
\82»
\82±
\82É
\82Í
\90¶
\82«
\95¨
\82Í
\82¢
\82È
\82¢
\81D");
804 pline("%s %s leashed!", Monnam(mtmp),
805 (!obj->leashmon) ? "cannot be" : "is not");
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¢");
812 if (!obj->leashmon) {
813 if (mtmp->mleashed) {
815 pline("This %s is already leashed.",
816 spotmon ? l_monnam(mtmp) : "monster");
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¨");
823 if (!leashable(mtmp)) {
825 pline("The leash won't fit onto %s%s.", spotmon ? "your " : "",
828 pline("
\95R
\82Í%s
\82É
\8d\87\82í
\82È
\82¢
\81D",
835 You("slip the leash around %s%s.", spotmon ? "your " : "",
838 You("%s
\82ð
\95R
\82Å
\8c\8b\82Ñ
\82Â
\82¯
\82½
\81D",
842 obj->leashmon = (int) mtmp->m_id;
846 if (obj->leashmon != (int) mtmp->m_id) {
848 pline("This leash is not attached to that creature.");
850 pline("
\82±
\82Ì
\95R
\82Í
\82»
\82ê
\82É
\82Í
\8c\8b\82Î
\82ê
\82Ä
\82¢
\82È
\82¢
\81D");
855 pline_The("leash would not come off!");
857 pline("
\95R
\82ª
\82Í
\82¸
\82ê
\82È
\82¢
\81I");
864 You("remove the leash from %s%s.", spotmon ? "your " : "",
867 You("%s
\82©
\82ç
\95R
\82ð
\82Í
\82¸
\82µ
\82½
\81D",
874 /* assuming mtmp->mleashed has been checked */
883 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
887 return (struct obj *) 0;
893 register struct monst *mtmp;
894 register struct obj *otmp;
896 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
897 if (DEADMONSTER(mtmp))
899 if (mtmp->mleashed) {
900 if (distu(mtmp->mx, mtmp->my) > 2)
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) {
909 You_feel("%s leash go slack.",
910 (number_leashed() > 1) ? "a" : "the");
912 You("
\95R
\82ª
\82½
\82é
\82ñ
\82¾
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
920 /* no pack mules for the Amulet */
921 if (u.usteed && mon_has_amulet(u.usteed))
930 register struct obj *otmp;
931 register struct monst *mtmp;
933 for (otmp = invent; otmp; otmp = otmp->nobj) {
934 if (otmp->otyp != LEASH || otmp->leashmon == 0)
936 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
937 if (DEADMONSTER(mtmp))
939 if ((int) mtmp->m_id == otmp->leashmon)
943 impossible("leash in use isn't attached to anything?");
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;
957 Your("leash chokes %s to death!", mon_nam(mtmp));
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 */
967 u.uconduct.killer = save_pacifism;
970 pline("%s is choked by the leash!", Monnam(mtmp));
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))
978 if (um_dist(mtmp->mx, mtmp->my, 5)) {
980 pline("%s leash snaps loose!", s_suffix(Monnam(mtmp)));
982 pline("%s
\82Ì
\95R
\82Í
\83p
\83`
\83\93\82Æ
\8aO
\82ê
\82½
\81I", Monnam(mtmp));
983 m_unleash(mtmp, FALSE);
986 You("pull on the leash.");
988 You("
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82½
\81D");
989 if (mtmp->data->msound != MS_SILENT)
1010 return ((ACURR(A_CHA) > 14)
1011 ? ((poly_gender() == 1)
1017 /*JP
\8cê
\8a²
\82Å
\8eg
\82¤ */
1024 #define WEAK 3 /* from eat.c */
1027 static const char look_str[] = "look %s.";
1029 static const char look_str[] = "%s
\8c©
\82¦
\82é
\81D";
1035 const char *mirror, *uvisage;
1039 boolean vis, invis_mirror, useeit, monable;
1041 if (!getdir((char *) 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)) {
1050 pline_The("%s fogs up and doesn't reflect!", mirror);
1052 pline("%s
\82Í
\93Ü
\82è
\81C
\89f
\82ç
\82È
\82
\82È
\82Á
\82½
\81I", mirror);
1055 if (!u.dx && !u.dy && !u.dz) {
1058 You_cant("see your %s %s.", uvisage, body_part(FACE));
1060 You_cant("
\8e©
\95ª
\82Ì%s
\82¢%s
\82ð
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", uvisage, body_part(FACE));
1062 if (u.umonnum == PM_FLOATING_EYE) {
1065 You("stiffen momentarily under your gaze.");
1067 pline("
\88ê
\8fu
\82 \82È
\82½
\82Ì
\82É
\82ç
\82Ý
\82Å
\8dd
\92¼
\82µ
\82½
\81D");
1071 pline("Yow! The %s stares back!", mirror);
1073 pline("
\82¨
\82ì
\81I%s
\82ª
\82 \82È
\82½
\82ð
\82É
\82ç
\82Ý
\95Ô
\82µ
\82½
\81I", mirror);
1076 pline("Yikes! You've frozen yourself!");
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";
1083 nomovemsg = 0; /* default, "you can move again" */
1085 } else if (youmonst.data->mlet == S_VAMPIRE)
1087 You("don't have a reflection.");
1089 You("
\8b¾
\82É
\89f
\82ç
\82È
\82©
\82Á
\82½
\81D");
1090 else if (u.umonnum == PM_UMBER_HULK) {
1092 pline("Huh? That doesn't look like you!");
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));
1100 You(look_str, "peaked");
1102 You(look_str, "
\8aç
\90F
\82ª
\88«
\82");
1103 else if (u.uhs >= WEAK)
1105 You(look_str, "undernourished");
1107 You(look_str, "
\89h
\97{
\8e¸
\92²
\82Ì
\82æ
\82¤
\82É");
1110 You("look as %s as ever.", uvisage);
1112 You("
\82 \82¢
\82©
\82í
\82ç
\82¸%s
\82
\8c©
\82¦
\82é
\81D", uvisage);
1118 You("reflect %s %s.", s_suffix(mon_nam(u.ustuck)),
1119 mbodypart(u.ustuck, STOMACH));
1125 You(Hallucination ? "give the fish a chance to fix their makeup."
1126 : "reflect the murky water.");
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");
1136 You("reflect the %s.",
1138 You("%s
\82ð
\89f
\82µ
\82½
\81D",
1139 (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
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)
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) {
1161 pline("%s is too tired to look at your %s.", Monnam(mtmp),
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),
1165 } else if (!mtmp->mcansee) {
1168 pline("%s can't see anything right now.", Monnam(mtmp));
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)) {
1174 pline("%s fails to notice your %s.", Monnam(mtmp), mirror);
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) */
1181 pline("%s is too far away to see %sself in the dark.",
1182 Monnam(mtmp), mhim(mtmp));
1184 pline("%s
\82Í
\88Ã
\88Å
\82Å
\8e©
\95ª
\8e©
\90g
\82ð
\8c©
\82é
\82É
\82Í
\89\93\82·
\82¬
\82é
\81D", Monnam(mtmp));
1186 /* some monsters do special things */
1187 } else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
1190 pline("%s doesn't have a reflection.", Monnam(mtmp));
1192 pline("%s
\82Í%s
\82É
\89f
\82ç
\82È
\82¢
\81D", Monnam(mtmp), mirror);
1193 } else if (monable && mtmp->data == &mons[PM_MEDUSA]) {
1195 if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
1197 if (mon_reflects(mtmp, "
\82É
\82ç
\82Ý
\82Í%s
\82Ì%s
\82Å
\94½
\8eË
\82µ
\82½
\81I"))
1201 pline("%s is turned to stone!", Monnam(mtmp));
1203 pline("%s
\82Í
\90Î
\82É
\82È
\82Á
\82½
\81I", Monnam(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);
1212 pline("%s is frozen by its reflection.", Monnam(mtmp));
1214 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\8c©
\82Ä
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D", Monnam(mtmp));
1217 You_hear("%s stop moving.", something);
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]) {
1224 pline("%s confuses itself!", Monnam(mtmp));
1226 pline("%s
\82Í
\8d¬
\97\90\82µ
\82½
\81I", Monnam(mtmp));
1228 } else if (monable && (mlet == S_NYMPH || mtmp->data == &mons[PM_SUCCUBUS]
1229 || mtmp->data == &mons[PM_INCUBUS])) {
1231 char buf[BUFSZ]; /* "She" or "He" */
1234 pline("%s admires %sself in your %s.", Monnam(mtmp), mhim(mtmp),
1237 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\82¤
\82Á
\82Æ
\82è
\82µ
\82½
\81D", Monnam(mtmp));
1240 pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
1242 pline("%s
\82Í
\82»
\82ê
\82ð
\92D
\82Á
\82½
\81I", upstart(strcpy(buf, mhe(mtmp))));
1245 pline("It steals your %s!", mirror);
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 */
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)) {
1257 pline("%s is frightened by its reflection.", Monnam(mtmp));
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)
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)
1268 pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
1271 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\8bC
\82ª
\82Â
\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mtmp));
1275 pline("%s ignores %s reflection.", Monnam(mtmp), mhis(mtmp));
1277 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\96³
\8e\8b\82µ
\82½
\81D", Monnam(mtmp));
1286 register struct obj *obj = *optr;
1288 boolean wakem = FALSE, learno = FALSE,
1289 ordinary = (obj->otyp != BELL_OF_OPENING || !obj->spe),
1291 (obj->otyp == BELL_OF_OPENING && invocation_pos(u.ux, u.uy)
1292 && !On_stairs(u.ux, u.uy));
1295 You("ring %s.", the(xname(obj)));
1297 You("%s
\82ð
\96Â
\82ç
\82µ
\82½
\81D", the(xname(obj)));
1299 if (Underwater || (u.uswallow && ordinary)) {
1301 amii_speaker(obj, "AhDhGqEqDhEhAqDqFhGw", AMII_MUFFLED_VOLUME);
1304 pline("But the sound is muffled.");
1306 pline("
\82µ
\82©
\82µ
\89¹
\82Í
\82©
\82«
\8fÁ
\82³
\82ê
\82½
\81D");
1308 } else if (invoking && ordinary) {
1309 /* needs to be recharged... */
1311 pline("But it makes no sound.");
1313 pline("
\82µ
\82©
\82µ
\81C
\89¹
\82Í
\96Â
\82ç
\82È
\82©
\82Á
\82½
\81D");
1314 learno = TRUE; /* help player figure out why */
1316 } else if (ordinary) {
1318 amii_speaker(obj, "ahdhgqeqdhehaqdqfhgw", AMII_MUFFLED_VOLUME);
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))
1328 You("summon %s!", a_monnam(mtmp));
1330 You("%s
\82ð
\8f¢
\8a«
\82µ
\82½
\81I", a_monnam(mtmp));
1331 if (!obj_resists(obj, 93, 100)) {
1333 pline("%s shattered!", Tobjnam(obj, "have"));
1335 pline("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", xname(obj));
1343 mon_adjust_speed(mtmp, 2, (struct obj *) 0);
1345 case 2: /* no explanation; it just happens... */
1347 multi_reason = NULL;
1355 /* charged Bell of Opening */
1356 consume_obj_charge(obj, TRUE);
1362 pline1(nothing_happens);
1364 } else if (obj->cursed) {
1369 mkundead(&mm, FALSE, NO_MINVENT);
1372 } else if (invoking) {
1374 pline("%s an unsettling shrill sound...", Tobjnam(obj, "issue"));
1376 pline("%s
\82Í
\95s
\8bC
\96¡
\82È
\89s
\82¢
\89¹
\82ð
\8fo
\82µ
\82½
\81D
\81D
\81D", xname(obj));
1378 amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
1384 } else if (obj->blessed) {
1388 amii_speaker(obj, "ahahahDhEhCw", AMII_SOFT_VOLUME);
1393 } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1394 buried_ball_to_freedom();
1400 pline1(nothing_happens);
1404 pline("%s opens...", Something);
1406 pline("
\89½
\82©
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1411 pline("Things open around you...");
1413 pline("
\82Ü
\82í
\82è
\82Ì
\95¨
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1418 } else { /* uncursed */
1420 amii_speaker(obj, "AeFeaeFeAefegw", AMII_OKAY_VOLUME);
1425 pline1(nothing_happens);
1428 } /* charged BofO */
1431 makeknown(BELL_OF_OPENING);
1439 use_candelabrum(obj)
1440 register struct obj *obj;
1442 #if 0 /*JP*//* not used */
1443 const char *s = (obj->spe != 1) ? "candles" : "candle";
1448 You("snuff the %s.", s);
1450 You("
\82ë
\82¤
\82»
\82
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1451 end_burn(obj, TRUE);
1454 if (obj->spe <= 0) {
1456 pline("This %s has no %s.", xname(obj), s);
1458 pline("
\82±
\82Ì%s
\82É
\82Í
\82ë
\82¤
\82»
\82
\82ª
\82È
\82¢
\81D", xname(obj));
1463 You("cannot make fire under water.");
1465 You("
\90\85\92\86\82Å
\89Î
\82ð
\82¨
\82±
\82¹
\82È
\82¢
\81D");
1468 if (u.uswallow || obj->cursed) {
1471 pline_The("%s %s for a moment, then %s.", s, vtense(s, "flicker"),
1474 pline("
\82ë
\82¤
\82»
\82
\82Ì
\89\8a\82Í
\82µ
\82Î
\82ç
\82
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D");
1480 There("%s only %d %s in %s.", vtense(s, "are"), obj->spe, s,
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);
1488 pline("%s lit. %s dimly.", obj->spe == 1 ? "It is" : "They are",
1489 Tobjnam(obj, "shine"));
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));
1496 pline("%s's %s burn%s", The(xname(obj)), s,
1497 (Blind ? "." : " brightly!"));
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"));
1503 if (!invocation_pos(u.ux, u.uy) || On_stairs(u.ux, u.uy)) {
1505 pline_The("%s %s being rapidly consumed!", s, vtense(s, "are"));
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;
1513 if (obj->spe == 7) {
1516 pline("%s a strange warmth!", Tobjnam(obj, "radiate"));
1518 pline("
\8aï
\96
\82È
\92g
\82©
\82³
\82ð%s
\82É
\8a´
\82¶
\82½
\81I", xname(obj));
1521 pline("%s with a strange light!", Tobjnam(obj, "glow"));
1523 pline("%s
\82Í
\8aï
\96
\82È
\8cõ
\82ð
\94
\82µ
\82Ä
\82¢
\82é
\81I", xname(obj));
1527 begin_burn(obj, FALSE);
1534 register struct obj *obj = *optr;
1535 register struct obj *otmp;
1537 const char *s = (obj->quan != 1) ? "candles" : "candle";
1539 const char *s = "
\82ë
\82¤
\82»
\82";
1540 char qbuf[QBUFSZ], qsfx[QBUFSZ], *q;
1547 otmp = carrying(CANDELABRUM_OF_INVOCATION);
1548 if (!otmp || otmp->spe == 7) {
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 */
1556 Sprintf(qsfx, " to\033%s?", thesimpleoname(otmp));
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 */
1561 (void) safe_qbuf(qbuf, "Attach ", qsfx, obj, yname, thesimpleoname, s);
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 */
1567 if ((q = strstri(qbuf, " to\033")) != 0)
1570 if ((q = strchr(qbuf, '\033')) != 0)
1572 /*JP:
\81u(
\82ë
\82¤
\82»
\82)
\82ð
\81v*/
1574 /* last, format final "attach candles to candelabrum?" query */
1576 if (yn(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
1578 if (yn(safe_qbuf(qbuf, qbuf, "
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H", otmp, xname, thesimpleoname, "
\82»
\82ê"))
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";
1593 You("attach %ld%s %s to %s.", obj->quan, !otmp->spe ? "" : " more", s,
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É",
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)
1605 pline_The("new %s magically %s!", s, vtense(s, "ignite"));
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)
1610 pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
1612 pline("
\89\8a\82Í
\8fÁ
\82¦
\82½
\81D");
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");
1620 verbalize("
\89Î
\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1622 if (obj->quan < 7L && otmp->spe == 7)
1624 pline("%s now has seven%s candles attached.", The(xname(otmp)),
1625 otmp->lamplit ? " lit" : "");
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½" : "");
1630 /* candelabrum's light range might increase */
1632 obj_merge_light_sources(otmp, otmp);
1633 /* candles are no longer a separate light source */
1635 end_burn(obj, TRUE);
1636 /* candles are now gone */
1641 /* call in drop, throw, and put in box, etc. */
1646 boolean candle = Is_candle(otmp);
1648 if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
1652 #if 0 /*JP*//* not used */
1653 boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
1656 (void) get_obj_location(otmp, &x, &y, 0);
1657 if (otmp->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1659 pline("%s%scandle%s flame%s extinguished.", Shk_Your(buf, otmp),
1660 (candle ? "" : "candelabrum's "), (many ? "s'" : "'s"),
1661 (many ? "s are" : " is"));
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Ì");
1666 end_burn(otmp, TRUE);
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 */
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)
1687 pline("%s %s out!", Yname2(obj), otense(obj, "go"));
1689 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81I", Yname2(obj));
1690 end_burn(obj, TRUE);
1693 if (snuff_candle(obj))
1699 /* Called when potentially lightable object is affected by fire_damage().
1700 Return TRUE if object was lit and FALSE otherwise --ALI */
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)
1711 else if (obj->otyp != MAGIC_LAMP && obj->age == 0)
1713 if (!get_obj_location(obj, &x, &y, 0))
1715 if (obj->otyp == CANDELABRUM_OF_INVOCATION && obj->cursed)
1717 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1718 || obj->otyp == BRASS_LANTERN) && obj->cursed && !rn2(2))
1720 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1722 pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
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 */
1731 verbalize("That's in addition to the cost of %s %s, of course.",
1732 yname(obj), obj->quan == 1L ? "itself" : "themselves");
1734 verbalize("
\82±
\82ê
\82Í
\82à
\82¿
\82ë
\82ñ%s
\82Ì
\92l
\92i
\82Æ
\82Í
\95Ê
\82¾
\82æ
\81D", xname(obj));
1736 bill_dummy_object(obj);
1738 begin_burn(obj, FALSE);
1751 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1752 || obj->otyp == BRASS_LANTERN)
1754 pline("%slamp is now off.", Shk_Your(buf, obj));
1756 pline("%s
\83\89\83\93\83v
\82Ì
\93\94\82Í
\8fÁ
\82¦
\82½
\81D", Shk_Your(buf, obj));
1759 You("snuff out %s.", yname(obj));
1761 You("%s
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D", xname(obj));
1762 end_burn(obj, TRUE);
1767 pline(!Is_candle(obj) ? "This is not a diving lamp"
1768 : "Sorry, fire and water don't mix.");
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");
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)
1780 Your("lamp has run out of power.");
1782 Your("
\83\89\83\93\83v
\82Ì
\93d
\97Í
\82ð
\8eg
\82¢
\90Ø
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
1785 pline("This %s has no oil.", xname(obj));
1787 pline("
\82±
\82Ì%s
\82É
\82Í
\82à
\82¤
\83I
\83C
\83\8b\82ª
\82È
\82¢
\81D", xname(obj));
1790 if (obj->cursed && !rn2(2)) {
1793 pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
1794 otense(obj, "die"));
1796 pline("%s
\82Í
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D",
1800 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1801 || obj->otyp == BRASS_LANTERN) {
1804 pline("%slamp is now on.", Shk_Your(buf, obj));
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) */
1809 pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
1810 otense(obj, "burn"), Blind ? "." : " brightly!");
1812 pline("%s
\82Í%s
\94R
\82¦
\82 \82ª
\82Á
\82½
\81I",
1813 xname(obj), Blind ? "" : "
\96¾
\82é
\82");
1815 if (obj->unpaid && costly_spot(u.ux, u.uy)
1816 && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
1818 const char *ithem = (obj->quan > 1L) ? "them" : "it";
1820 verbalize("You burn %s, you bought %s!", ithem, ithem);
1822 verbalize("
\93\94\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1824 bill_dummy_object(obj);
1827 begin_burn(obj, FALSE);
1833 struct obj *obj; /* obj is a potion of oil */
1845 You("snuff the lit potion.");
1847 You("
\96û
\95r
\82Ì
\89Î
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1848 end_burn(obj, TRUE);
1850 * Free & add to re-merge potion. This will average the
1851 * age of the potions. Not exactly the best solution,
1857 } else if (Underwater) {
1859 There("is not enough oxygen to sustain a fire.");
1861 pline("
\89Î
\82ð
\82Â
\82¯
\82é
\82Ì
\82É
\8f\
\95ª
\82È
\8e_
\91f
\82ª
\82È
\82¢
\81D");
1865 split1off = (obj->quan > 1L);
1867 obj = splitobj(obj, 1L);
1870 You("light %spotion.%s", shk_your(buf, obj),
1871 Blind ? "" : " It gives off a dim light.");
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");
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...
1883 verbalize("That's in addition to the cost of the potion, of course.");
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);
1888 makeknown(obj->otyp);
1890 begin_burn(obj, FALSE); /* after shop billing */
1892 obj_extract_self(obj); /* free from inv */
1895 obj = hold_another_object(obj, "You drop %s!", doname(obj),
1897 obj = hold_another_object(obj, "
\82 \82È
\82½
\82Í%s
\82ð
\97\8e\82µ
\82½
\81I", doname(obj),
1904 static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
1909 struct obj *obj = getobj(cuddly, "rub");
1911 if (obj && obj->oclass == GEM_CLASS) {
1912 if (is_graystone(obj)) {
1917 pline("Sorry, I don't know how to use that.");
1919 pline("
\8ec
\94O
\81D
\8eg
\82¢
\95û
\82ª
\82í
\82©
\82ç
\82È
\82¢
\81D");
1924 if (!obj || !wield_tool(obj, "rub"))
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);
1940 begin_burn(uwep, TRUE);
1941 djinni_from_bottle(uwep);
1942 makeknown(MAGIC_LAMP);
1944 } else if (rn2(2)) {
1946 You("%s smoke.", !Blind ? "see a puff of" : "smell");
1948 pline("
\82¯
\82Þ
\82è%s
\81D", !Blind ? "
\82ª
\95\91\82¢
\82 \82ª
\82Á
\82½" : "
\82Ì
\93õ
\82¢
\82ª
\82µ
\82½");
1950 pline1(nothing_happens);
1951 } else if (obj->otyp == BRASS_LANTERN) {
1952 /* message from Adventure */
1954 pline("Rubbing the electric lamp is not particularly rewarding.");
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");
1958 pline("Anyway, nothing exciting happens.");
1960 pline("
\82â
\82Á
\82Ï
\82è
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D");
1962 pline1(nothing_happens);
1974 is_valid_jump_pos(x, y, magic, showmsg)
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?
1984 pline("Illegal move!");
1986 pline("
\82»
\82Ì
\88Ú
\93®
\82Í
\8cj
\94n
\92µ
\82Ñ
\82¶
\82á
\82È
\82¢
\81I");
1988 } else if (distu(x, y) > (magic ? 6 + magic * 3 : 9)) {
1993 pline("
\89\93\82·
\82¬
\82é
\81I");
1995 } else if (!cansee(x, y)) {
1998 You("cannot see where to land!");
2000 You("
\92\85\92n
\93_
\82ª
\8c©
\82¦
\82È
\82¢
\81I");
2002 } else if (!isok(x, y)) {
2005 You("cannot jump there!");
2007 You("
\82»
\82±
\82É
\82Í
\94ò
\82×
\82È
\82¢
\81I");
2013 static int jumping_is_magic;
2016 display_jump_positions(state)
2020 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
2021 } else if (state == 1) {
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))
2033 tmp_at(DISP_END, 0);
2039 int magic; /* 0=Physical, otherwise skill level */
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 */
2047 You_cant("jump; you have no legs!");
2049 pline("
\91«
\82ª
\96³
\82
\82Ä
\82Í
\92µ
\82×
\82È
\82¢
\81I");
2051 } else if (!magic && !Jumping) {
2053 You_cant("jump very far.");
2055 You_cant("
\82»
\82ñ
\82È
\89\93\82
\82Ü
\82Å
\92µ
\82×
\82È
\82¢
\81D");
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 */
2061 } else if (u.uswallow) {
2064 You("bounce around a little.");
2066 pline("
\94½
\93®
\82ð
\82Â
\82¯
\82½
\81D");
2070 pline("You've got to be kidding!");
2072 pline("
\8fç
\92k
\82Í
\82æ
\82µ
\82±
\82³
\82ñ
\81I");
2074 } else if (u.uinwater) {
2077 You("swish around a little.");
2079 pline("
\83X
\83C
\83X
\83C
\82Æ
\89j
\82¢
\82¾
\81D");
2083 pline("This calls for swimming, not jumping!");
2085 pline("
\82»
\82ê
\82Í
\81w
\89j
\82®
\81x
\82Å
\82 \82Á
\82Ä
\81C
\81w
\92µ
\82Ô
\81x
\82¶
\82á
\82È
\82¢
\81I");
2087 } else if (u.ustuck) {
2088 if (u.ustuck->mtame && !Conflict && !u.ustuck->mconf) {
2090 You("pull free from %s.", mon_nam(u.ustuck));
2092 You("%s
\82©
\82ç
\97£
\82ê
\82½
\81D", mon_nam(u.ustuck));
2098 You("writhe a little in the grasp of %s!", mon_nam(u.ustuck));
2100 You("%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\83W
\83^
\83o
\83^
\82µ
\82½
\81I", mon_nam(u.ustuck));
2104 You("cannot escape from %s!", mon_nam(u.ustuck));
2106 You("%s
\82©
\82ç
\93¦
\82ê
\82ç
\82ê
\82È
\82¢
\81I", mon_nam(u.ustuck));
2108 } else if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
2111 You("flail around a little.");
2113 You("
\83o
\83^
\83o
\83^
\92µ
\82ñ
\82¾
\81D");
2117 You("don't have enough traction to jump.");
2119 You("
\92µ
\82Ô
\82½
\82ß
\82Ì
\94½
\93®
\82ª
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
2121 } else if (!magic && near_capacity() > UNENCUMBERED) {
2123 You("are carrying too much to jump!");
2125 You("
\82½
\82
\82³
\82ñ
\95¨
\82ð
\8e\9d\82¿
\82·
\82¬
\82Ä
\92µ
\82×
\82È
\82¢
\81I");
2127 } else if (!magic && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
2129 You("lack the strength to jump!");
2131 You("
\92µ
\82Ô
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I");
2133 } else if (!magic && Wounded_legs) {
2134 long wl = (Wounded_legs & BOTH_SIDES);
2135 const char *bp = body_part(LEG);
2137 if (wl == BOTH_SIDES)
2138 bp = makeplural(bp);
2141 pline("%s is in no shape for jumping.", Monnam(u.usteed));
2143 pline("%s
\82Í
\92µ
\82×
\82é
\8fó
\91Ô
\82Å
\82Í
\82È
\82¢
\81D", Monnam(u.usteed));
2146 Your("%s%s %s in no shape for jumping.",
2147 (wl == LEFT_SIDE) ? "left " : (wl == RIGHT_SIDE) ? "right "
2149 bp, (wl == BOTH_SIDES) ? "are" : "is");
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);
2156 } else if (u.usteed && u.utrap) {
2158 pline("%s is stuck in a trap.", Monnam(u.usteed));
2160 pline("%s
\82Íã©
\82É
\82Ð
\82Á
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81D", Monnam(u.usteed));
2165 pline("Where do you want to jump?");
2167 pline("
\82Ç
\82±
\82É
\92µ
\82Ñ
\82Ü
\82·
\82©
\81H");
2170 jumping_is_magic = magic;
2171 getpos_sethilite(display_jump_positions);
2173 if (getpos(&cc, TRUE, "the desired position") < 0)
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)) {
2184 switch (u.utraptype) {
2186 long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
2189 You("rip yourself free of the bear trap! Ouch!");
2191 You("
\8e©
\95ª
\82ð
\8cF
\82Ìã©
\82©
\82ç
\82Ð
\82«
\82Í
\82ª
\82µ
\82½
\81C
\82¢
\82Ä
\82Á
\81I");
2193 losehp(Maybe_Half_Phys(rnd(10)), "jumping out of a bear trap",
2195 losehp(Maybe_Half_Phys(rnd(10)), "
\8cF
\82Ìã©
\82©
\82ç
\94ò
\82Ñ
\8fo
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2197 set_wounded_legs(side, rn1(1000, 500));
2202 You("leap from the pit!");
2204 You("
\97\8e\82µ
\8c\8a\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I");
2208 You("tear the web apart as you pull yourself free!");
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));
2215 You("pull yourself above the lava!");
2217 You("
\97n
\8aâ
\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I");
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");
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é");
2235 set_wounded_legs(LEFT_SIDE, rn1(10, 11));
2236 set_wounded_legs(RIGHT_SIDE, rn1(10, 11));
2241 * Check the path from uc to cc, calling hurtle_step at each
2242 * location. The final position actually reached will be
2247 /* calculate max(abs(dx), abs(dy)) as the range */
2248 range = cc.x - uc.x;
2256 (void) walk_path(&uc, &cc, hurtle_step, (genericptr_t) &range);
2257 teleds(cc.x, cc.y, TRUE);
2260 multi_reason = "jumping around";
2262 morehungry(rnd(25));
2273 if (!mons[corpse->corpsenm].cnutrit)
2279 use_tinning_kit(obj)
2282 struct obj *corpse, *can;
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...
2287 if (obj->spe <= 0) {
2289 You("seem to be out of tins.");
2291 pline("
\8aÊ
\8bl
\82ð
\8dì
\82é
\82½
\82ß
\82Ì
\8aÊ
\82ª
\90Ø
\82ê
\82½
\82æ
\82¤
\82¾
\81D");
2294 if (!(corpse = floorfood("tin", 2)))
2296 if (corpse->oeaten) {
2298 You("cannot tin %s which is partly eaten.", something);
2300 You("
\90H
\82×
\82©
\82¯
\82Ì
\82à
\82Ì
\82ð
\8aÊ
\8bl
\82É
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2303 if (touch_petrifies(&mons[corpse->corpsenm]) && !Stone_resistance
2307 if (poly_when_stoned(youmonst.data))
2309 You("tin %s without wearing gloves.",
2310 an(mons[corpse->corpsenm].mname));
2312 You("
\8f¬
\8eè
\82È
\82µ
\82Å%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\81D",
2313 mons[corpse->corpsenm].mname);
2317 pline("Tinning %s without wearing gloves is a fatal mistake...",
2318 an(mons[corpse->corpsenm].mname));
2320 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",
2321 mons[corpse->corpsenm].mname);
2324 Sprintf(kbuf, "trying to tin %s without gloves",
2325 an(mons[corpse->corpsenm].mname));
2327 Sprintf(kbuf, "
\8f¬
\8eè
\82ð
\82Â
\82¯
\82¸
\82É%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2328 mons[corpse->corpsenm].mname);
2333 if (is_rider(&mons[corpse->corpsenm])) {
2334 if (revive_corpse(corpse))
2336 verbalize("Yes... But War does not preserve its enemies...");
2338 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");
2341 pline_The("corpse evades your grasp.");
2343 pline("
\8e\80\91Ì
\82Í
\82 \82È
\82½
\82Ì
\8eè
\82ð
\93¦
\82ê
\82½
\81D");
2346 if (mons[corpse->corpsenm].cnutrit == 0) {
2348 pline("That's too insubstantial to tin.");
2350 pline("
\8eÀ
\91Ì
\82ª
\82È
\82¢
\82Ì
\82Å
\8aÊ
\8bl
\82É
\82Å
\82«
\82È
\82¢
\81D");
2353 consume_obj_charge(obj, TRUE);
2355 if ((can = mksobj(TIN, FALSE, FALSE)) != 0) {
2357 static const char you_buy_it[] = "You tin it, you bought it!";
2359 static const char you_buy_it[] = "
\8aÊ
\8bl
\82É
\82µ
\82½
\82Ì
\82È
\82ç
\94\83\82Á
\82Ä
\82à
\82ç
\82¤
\82æ
\81I";
2361 can->corpsenm = corpse->corpsenm;
2362 can->cursed = obj->cursed;
2363 can->blessed = obj->blessed;
2364 can->owt = weight(can);
2366 /* Mark tinned tins. No spinach allowed... */
2367 set_tin_variety(can, HOMEMADE_TIN);
2368 if (carried(corpse)) {
2370 verbalize(you_buy_it);
2373 if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge)
2374 verbalize(you_buy_it);
2378 can = hold_another_object(can, "You make, but cannot pick up, %s.",
2380 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",
2381 doname(can), (const char *) 0);
2383 impossible("Tinning failed.");
2387 use_unicorn_horn(obj)
2390 #define PROP_COUNT 7 /* number of properties we're dealing with */
2391 #define ATTR_COUNT (A_MAX * 3) /* number of attribute points we might fix */
2392 int idx, val, val_limit, trouble_count, unfixable_trbl, did_prop,
2394 int trouble_list[PROP_COUNT + ATTR_COUNT];
2396 if (obj && obj->cursed) {
2397 long lcount = (long) rn1(90, 10);
2399 switch (rn2(13) / 2) { /* case 6 is half as likely as the others */
2401 make_sick((Sick & TIMEOUT) ? (Sick & TIMEOUT) / 3L + 1L
2402 : (long) rn1(ACURR(A_CON), 20),
2403 xname(obj), TRUE, SICK_NONVOMITABLE);
2406 make_blinded((Blinded & TIMEOUT) + lcount, TRUE);
2411 You("suddenly feel %s.",
2412 Hallucination ? "trippy" : "confused");
2414 You("
\93Ë
\91R%s
\81D",
2415 Hallucination ? "
\82Ö
\82ë
\82Ö
\82ë
\82É
\82È
\82Á
\82½" : "
\8d¬
\97\90\82µ
\82½");
2417 make_confused((HConfusion & TIMEOUT) + lcount, TRUE);
2420 make_stunned((HStun & TIMEOUT) + lcount, TRUE);
2423 (void) adjattrib(rn2(A_MAX), -1, FALSE);
2426 (void) make_hallucinated((HHallucination & TIMEOUT) + lcount,
2430 if (Deaf) /* make_deaf() won't give feedback when already deaf */
2432 pline("Nothing seems to happen.");
2434 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2435 make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
2442 * Entries in the trouble list use a very simple encoding scheme.
2444 #define prop2trbl(X) ((X) + A_MAX)
2445 #define attr2trbl(Y) (Y)
2446 #define prop_trouble(X) trouble_list[trouble_count++] = prop2trbl(X)
2447 #define attr_trouble(Y) trouble_list[trouble_count++] = attr2trbl(Y)
2448 #define TimedTrouble(P) (((P) && !((P) & ~TIMEOUT)) ? ((P) & TIMEOUT) : 0L)
2450 trouble_count = unfixable_trbl = did_prop = did_attr = 0;
2452 /* collect property troubles */
2453 if (TimedTrouble(Sick))
2455 if (TimedTrouble(Blinded) > (long) u.ucreamed
2457 && attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
2458 prop_trouble(BLINDED);
2459 if (TimedTrouble(HHallucination))
2460 prop_trouble(HALLUC);
2461 if (TimedTrouble(Vomiting))
2462 prop_trouble(VOMITING);
2463 if (TimedTrouble(HConfusion))
2464 prop_trouble(CONFUSION);
2465 if (TimedTrouble(HStun))
2466 prop_trouble(STUNNED);
2467 if (TimedTrouble(HDeaf))
2470 unfixable_trbl = unfixable_trouble_count(TRUE);
2472 /* collect attribute troubles */
2473 for (idx = 0; idx < A_MAX; idx++) {
2474 if (ABASE(idx) >= AMAX(idx))
2476 val_limit = AMAX(idx);
2477 /* don't recover strength lost from hunger */
2478 if (idx == A_STR && u.uhs >= WEAK)
2481 /* potion/spell of restore ability override sustain ability
2482 intrinsic but unicorn horn usage doesn't */
2483 unfixable_trbl += val_limit - ABASE(idx);
2486 /* don't recover more than 3 points worth of any attribute */
2487 if (val_limit > ABASE(idx) + 3)
2488 val_limit = ABASE(idx) + 3;
2490 for (val = ABASE(idx); val < val_limit; val++)
2492 /* keep track of unfixed trouble, for message adjustment below */
2493 unfixable_trbl += (AMAX(idx) - val_limit);
2496 if (trouble_count == 0) {
2497 pline1(nothing_happens);
2499 } else if (trouble_count > 1) { /* shuffle */
2502 for (i = trouble_count - 1; i > 0; i--)
2503 if ((j = rn2(i + 1)) != i) {
2504 k = trouble_list[j];
2505 trouble_list[j] = trouble_list[i];
2506 trouble_list[i] = k;
2511 * Chances for number of troubles to be fixed
2513 * blessed: 22.7% 22.7% 19.5% 15.4% 10.7% 5.7% 2.6% 0.8%
2514 * uncursed: 35.4% 35.4% 22.9% 6.3% 0 0 0 0
2516 val_limit = rn2(d(2, (obj && obj->blessed) ? 4 : 2));
2517 if (val_limit > trouble_count)
2518 val_limit = trouble_count;
2520 /* fix [some of] the troubles */
2521 for (val = 0; val < val_limit; val++) {
2522 idx = trouble_list[val];
2525 case prop2trbl(SICK):
2526 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
2529 case prop2trbl(BLINDED):
2530 make_blinded((long) u.ucreamed, TRUE);
2533 case prop2trbl(HALLUC):
2534 (void) make_hallucinated(0L, TRUE, 0L);
2537 case prop2trbl(VOMITING):
2538 make_vomiting(0L, TRUE);
2541 case prop2trbl(CONFUSION):
2542 make_confused(0L, TRUE);
2545 case prop2trbl(STUNNED):
2546 make_stunned(0L, TRUE);
2549 case prop2trbl(DEAF):
2550 make_deaf(0L, TRUE);
2554 if (idx >= 0 && idx < A_MAX) {
2558 panic("use_unicorn_horn: bad trouble? (%d)", idx);
2565 pline("This makes you feel %s!",
2566 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2570 pline("
\8bC
\95ª
\82ª%s
\82æ
\82
\82È
\82Á
\82½
\81I",
2571 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2577 pline("Nothing seems to happen.");
2579 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2581 context.botl = (did_attr || did_prop);
2592 * Timer callback routine: turn figurine into monster
2595 fig_transform(arg, timeout)
2599 struct obj *figurine = arg->a_obj;
2602 boolean cansee_spot, silent, okay_spot;
2603 boolean redraw = FALSE;
2604 boolean suppress_see = FALSE;
2605 char monnambuf[BUFSZ], carriedby[BUFSZ];
2608 debugpline0("null figurine in fig_transform()");
2611 silent = (timeout != monstermoves); /* happened while away */
2612 okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
2613 if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
2614 okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
2615 if (!okay_spot || !figurine_location_checks(figurine, &cc, TRUE)) {
2616 /* reset the timer to try again later */
2617 (void) start_timer((long) rnd(5000), TIMER_OBJECT, FIG_TRANSFORM,
2618 obj_to_any(figurine));
2622 cansee_spot = cansee(cc.x, cc.y);
2623 mtmp = make_familiar(figurine, cc.x, cc.y, TRUE);
2625 char and_vanish[BUFSZ];
2626 struct obj *mshelter = level.objects[mtmp->mx][mtmp->my];
2627 Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
2629 /*JP:TODO:and_vanish
\82Í
\96¢
\8f\88\97\9d*/
2630 and_vanish[0] = '\0';
2631 if ((mtmp->minvis && !See_invisible)
2632 || (mtmp->data->mlet == S_MIMIC
2633 && mtmp->m_ap_type != M_AP_NOTHING))
2634 suppress_see = TRUE;
2636 if (mtmp->mundetected) {
2637 if (hides_under(mtmp->data) && mshelter) {
2638 Sprintf(and_vanish, " and %s under %s",
2639 locomotion(mtmp->data, "crawl"), doname(mshelter));
2640 } else if (mtmp->data->mlet == S_MIMIC
2641 || mtmp->data->mlet == S_EEL) {
2642 suppress_see = TRUE;
2644 Strcpy(and_vanish, " and vanish");
2647 switch (figurine->where) {
2649 if (Blind || suppress_see)
2651 You_feel("%s %s from your pack!", something,
2652 locomotion(mtmp->data, "drop"));
2654 You_feel("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82æ
\82¤
\82¾
\81I", something,
2655 jpast(locomotion(mtmp->data, "
\97\8e\82¿
\82é")));
2659 You_see("%s %s out of your pack%s!", monnambuf,
2660 locomotion(mtmp->data, "drop"), and_vanish);
2662 You("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2663 jpast(locomotion(mtmp->data,"
\97\8e\82¿
\82é")));
2668 if (cansee_spot && !silent) {
2671 pline("%s suddenly vanishes!", an(xname(figurine)));
2673 pline("%s
\82Í
\93Ë
\91R
\8fÁ
\82¦
\82½
\81I", xname(figurine));
2676 You_see("a figurine transform into %s%s!", monnambuf,
2679 You("
\90l
\8c`
\82ª
\93Ë
\91R%s
\82É
\82È
\82Á
\82½
\82Ì
\82ð
\8c©
\82½
\81I",
2682 redraw = TRUE; /* update figurine's map location */
2687 if (cansee_spot && !silent && !suppress_see) {
2689 mon = figurine->ocarry;
2690 /* figurine carrying monster might be invisible */
2691 if (canseemon(figurine->ocarry)) {
2693 Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon)));
2695 Sprintf(carriedby, "%s
\82Ì
\8a\93", s_suffix(a_monnam(mon)));
2696 } else if (is_pool(mon->mx, mon->my))
2698 Strcpy(carriedby, "empty water");
2700 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\90\85\92\86");
2703 Strcpy(carriedby, "thin air");
2705 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\8bó
\92\86");
2707 You_see("%s %s out of %s%s!", monnambuf,
2708 locomotion(mtmp->data, "drop"), carriedby,
2711 You("%s
\82ª%s
\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2712 carriedby, locomotion(mtmp->data, "
\97\8e\82¿
\82é"));
2722 impossible("figurine came to life where? (%d)",
2723 (int) figurine->where);
2727 /* free figurine now */
2728 if (carried(figurine)) {
2731 obj_extract_self(figurine);
2732 obfree(figurine, (struct obj *) 0);
2739 figurine_location_checks(obj, cc, quietly)
2746 if (carried(obj) && u.uswallow) {
2749 You("don't have enough room in here.");
2751 pline("
\82±
\82±
\82É
\82Í
\8f\
\95ª
\82È
\8fê
\8f\8a\82ª
\82È
\82¢
\81D");
2754 x = cc ? cc->x : u.ux;
2755 y = cc ? cc->y : u.uy;
2759 You("cannot put the figurine there.");
2761 You("
\82±
\82±
\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81D");
2764 if (IS_ROCK(levl[x][y].typ)
2765 && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) {
2768 You("cannot place a figurine in %s!",
2769 IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock");
2771 You("%s
\82Ì
\92\86\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81I",
2772 IS_TREE(levl[x][y].typ) ? "
\96Ø" : "
\8cÅ
\82¢
\90Î");
2776 if (sobj_at(BOULDER, x, y) && !passes_walls(&mons[obj->corpsenm])
2777 && !throws_rocks(&mons[obj->corpsenm])) {
2780 You("cannot fit the figurine on the boulder.");
2782 You("
\8aâ
\82É
\90l
\8c`
\82ð
\89\9f\82µ
\8d\9e\82Þ
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2792 register struct obj *obj = *optr;
2797 /* can't activate a figurine while swallowed */
2798 if (!figurine_location_checks(obj, (coord *) 0, FALSE))
2801 if (!getdir((char *) 0)) {
2802 context.move = multi = 0;
2809 /* Passing FALSE arg here will result in messages displayed */
2810 if (!figurine_location_checks(obj, &cc, FALSE))
2813 You("%s and it transforms.",
2814 (u.dx || u.dy) ? "set the figurine beside you"
2815 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
2816 || is_pool(cc.x, cc.y))
2817 ? "release the figurine"
2818 : (u.dz < 0 ? "toss the figurine into the air"
2819 : "set the figurine on the ground"));
2821 You("%s
\81D
\82·
\82é
\82Æ
\82»
\82ê
\82Í
\95Ï
\8c`
\82µ
\82½
\81D",
2822 (u.dx || u.dy) ? "
\82»
\82Î
\82É
\90l
\8c`
\82ð
\92u
\82¢
\82½"
2823 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
2824 || is_pool(cc.x, cc.y))
2825 ? "
\90l
\8c`
\82ð
\95ú
\82Á
\82½"
2826 : (u.dz < 0 ? "
\90l
\8c`
\82ð
\8bó
\92\86\82É
\93\8a\82°
\82½"
2827 : "
\90l
\8c`
\82ð
\92n
\96Ê
\82É
\92u
\82¢
\82½"));
2829 (void) make_familiar(obj, cc.x, cc.y, FALSE);
2830 (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
2835 static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 };
2845 pline("%s from your %s.", Tobjnam(obj, "slip"),
2846 makeplural(body_part(FINGER)));
2848 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
2856 if ((obj->cursed || Fumbling) && !rn2(2)) {
2857 consume_obj_charge(obj, TRUE);
2860 pline("%s from your %s.", Tobjnam(obj, "slip"),
2861 makeplural(body_part(FINGER)));
2863 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
2869 otmp = getobj(lubricables, "grease");
2873 if (inaccessible_equipment(otmp, "grease", FALSE))
2875 if (inaccessible_equipment(otmp, "
\82É
\8e\89\82ð
\93h
\82é", FALSE))
2877 consume_obj_charge(obj, TRUE);
2879 if (otmp != &zeroobj) {
2881 You("cover %s with a thick layer of grease.", yname(otmp));
2883 You("%s
\82É
\8e\89\82ð
\92O
\94O
\82É
\93h
\82Á
\82½
\81D", xname(otmp));
2885 if (obj->cursed && !nohands(youmonst.data)) {
2886 incr_itimeout(&Glib, rnd(15));
2888 pline("Some of the grease gets all over your %s.",
2890 pline("
\8e\89\82ª
\8f
\82µ%s
\82É
\82Â
\82¢
\82½
\81D",
2891 makeplural(body_part(HAND)));
2894 incr_itimeout(&Glib, rnd(15));
2896 You("coat your %s with grease.", makeplural(body_part(FINGER)));
2898 You("%s
\82É
\8e\89\82ð
\93h
\82Á
\82½
\81D", makeplural(body_part(FINGER)));
2903 pline("%s empty.", Tobjnam(obj, "are"));
2905 pline("%s
\82Í
\8bó
\82Á
\82Û
\82¾
\81D", xname(obj));
2908 pline("%s to be empty.", Tobjnam(obj, "seem"));
2910 pline("%s
\82Í
\8bó
\82Á
\82Û
\82Ì
\82æ
\82¤
\82¾
\81D", xname(obj));
2915 static struct trapinfo {
2919 boolean force_bungle;
2926 trapinfo.force_bungle = 0;
2929 /* touchstones - by Ken Arnold */
2936 const char *streak_color, *choices;
2937 char stonebuf[QBUFSZ];
2939 static const char scritch[] = "\"scritch, scritch\"";
2941 static const char scritch[] = "
\81u
\83S
\83V
\81C
\83S
\83V
\81v";
2942 static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
2943 static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
2945 /* in case it was acquired while blinded */
2948 /* when the touchstone is fully known, don't bother listing extra
2949 junk as likely candidates for rubbing */
2950 choices = (tstone->otyp == TOUCHSTONE && tstone->dknown
2951 && objects[TOUCHSTONE].oc_name_known)
2955 Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
2957 Sprintf(stonebuf, "rub on the stone");
2958 if ((obj = getobj(choices, stonebuf)) == 0)
2961 if (obj == tstone && obj->quan == 1L) {
2963 You_cant("rub %s on itself.", the(xname(obj)));
2965 You("%s
\82ð
\82»
\82ê
\8e©
\91Ì
\82Å
\82±
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", the(xname(obj)));
2969 if (tstone->otyp == TOUCHSTONE && tstone->cursed
2970 && obj->oclass == GEM_CLASS && !is_graystone(obj)
2971 && !obj_resists(obj, 80, 100)) {
2974 pline("You feel something shatter.");
2976 You("
\89½
\82©
\82ª
\95²
\81X
\82É
\82È
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D");
2977 else if (Hallucination)
2979 pline("Oh, wow, look at the pretty shards.");
2981 pline("
\83\8f\81[
\83H
\81I
\82È
\82ñ
\82Ä
\82«
\82ê
\82¢
\82È
\94j
\95Ð
\82È
\82ñ
\82¾
\81D");
2984 pline("A sharp crack shatters %s%s.",
2985 (obj->quan > 1L) ? "one of " : "", the(xname(obj)));
2987 pline("
\8b
\82
\82±
\82·
\82è
\82·
\82¬
\82Ä%s%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D",
2988 the(xname(obj)), (obj->quan > 1) ? "
\82Ì
\82Ð
\82Æ
\82Â" : "");
2997 } else if (Hallucination) {
2999 pline("Oh wow, man: Fractals!");
3001 pline("
\83\8f\81[
\83H
\81I
\83t
\83\89\83N
\83^
\83\8b\96Í
\97l
\82¾
\81I");
3009 switch (obj->oclass) {
3010 case GEM_CLASS: /* these have class-specific handling below */
3012 if (tstone->otyp != TOUCHSTONE) {
3014 } else if (obj->oclass == GEM_CLASS
3016 || (!tstone->cursed && (Role_if(PM_ARCHEOLOGIST)
3017 || Race_if(PM_GNOME))))) {
3018 makeknown(TOUCHSTONE);
3019 makeknown(obj->otyp);
3020 prinv((char *) 0, obj, 0L);
3023 /* either a ring or the touchstone was not effective */
3024 if (objects[obj->otyp].oc_material == GLASS) {
3029 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3030 break; /* gem or ring */
3033 switch (objects[obj->otyp].oc_material) {
3036 pline("%s a little more polished now.", Tobjnam(tstone, "look"));
3038 pline("%s
\82Í
\82³
\82ç
\82É
\82Â
\82â
\82ª
\8fo
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", xname(tstone));
3042 if (!obj->known) /* note: not "whetstone" */
3044 You("must think this is a wetstone, do you?");
3046 You("
\82±
\82ê
\82Í
\93u
\90Î
\82¾
\82Æ
\8ev
\82Á
\82½
\81H");
3050 pline("%s a little wetter now.", Tobjnam(tstone, "are"));
3052 pline("%s
\82Í
\8f
\82µ
\82Ê
\82ê
\82½
\81D", xname(tstone));
3057 streak_color = "waxy";
3059 streak_color = "
\8e\89\82Á
\82Û
\82¢";
3061 break; /* okay even if not touchstone */
3064 streak_color = "wooden";
3066 streak_color = "
\82¨
\82ª
\82
\82¸
\82Ì
\82æ
\82¤
\82È";
3068 break; /* okay even if not touchstone */
3070 do_scratch = TRUE; /* scratching and streaks */
3072 streak_color = "golden";
3074 streak_color = "
\8bà
\90F
\82Ì";
3078 do_scratch = TRUE; /* scratching and streaks */
3080 streak_color = "silvery";
3082 streak_color = "
\8bâ
\90F
\82Ì";
3086 /* Objects passing the is_flimsy() test will not
3087 scratch a stone. They will leave streaks on
3088 non-touchstones and touchstones alike. */
3090 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3092 do_scratch = (tstone->otyp != TOUCHSTONE);
3095 break; /* default oclass */
3098 #if 0 /*JP*//* not used */
3099 Sprintf(stonebuf, "stone%s", plur(tstone->quan));
3103 You("make %s%sscratch marks on the %s.",
3104 streak_color ? streak_color : (const char *) "",
3105 streak_color ? " " : "", stonebuf);
3107 You("%s
\82±
\82·
\82è
\90Õ
\82ð
\90Î
\82É
\82Â
\82¯
\82½
\81D",
3108 streak_color ? streak_color : (const char *)"");
3110 else if (streak_color)
3112 You_see("%s streaks on the %s.", streak_color, stonebuf);
3114 pline("
\90Î
\82É%s
\8bØ
\82ª
\82Â
\82¢
\82½
\81D", streak_color);
3120 /* Place a landmine/bear trap. Helge Hafting */
3126 const char *what = (char *) 0;
3128 int levtyp = levl[u.ux][u.uy].typ;
3130 const char *occutext = "setting the trap";
3132 const char *occutext = "ã©
\82ð
\8ed
\8a|
\82¯
\82Ä
\82¢
\82é";
3135 if (nohands(youmonst.data))
3137 what = "without hands";
3139 what = "
\8eè
\82ª
\82È
\82¢
\82Ì
\82Å";
3142 what = "while stunned";
3144 what = "
\82
\82ç
\82
\82ç
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å";
3145 else if (u.uswallow)
3148 is_animal(u.ustuck->data) ? "while swallowed" : "while engulfed";
3150 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Í";
3151 else if (Underwater)
3153 what = "underwater";
3155 what = "
\90\85\96Ê
\89º
\82Å
\82Í";
3156 else if (Levitation)
3158 what = "while levitating";
3160 what = "
\95\82\82¢
\82Ä
\82¢
\82é
\8aÔ
\82Í";
3161 else if (is_pool(u.ux, u.uy))
3165 what = "
\90\85\92\86\82Å
\82Í";
3166 else if (is_lava(u.ux, u.uy))
3170 what = "
\97n
\8aâ
\82Ì
\92\86\82Å
\82Í";
3171 else if (On_stairs(u.ux, u.uy))
3173 what = (u.ux == xdnladder || u.ux == xupladder) ? "on the ladder"
3176 what = (u.ux == xdnladder || u.ux == xupladder) ? "
\82Í
\82µ
\82²
\82Ì
\8fã
\82Å
\82Í"
3177 : "
\8aK
\92i
\82Ì
\8fã
\82Å
\82Í";
3179 else if (IS_FURNITURE(levtyp) || IS_ROCK(levtyp)
3180 || closed_door(u.ux, u.uy) || t_at(u.ux, u.uy))
3184 what = "
\82±
\82±
\82Å
\82Í";
3185 else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
3187 what = (levtyp == AIR)
3191 : "in this place"; /* Air/Water Plane catch-all */
3193 what = (levtyp == AIR)
3194 ? "
\8bó
\92\86\82Å
\82Í"
3196 ? "
\89_
\82Ì
\92\86\82Å
\82Í"
3197 : "
\82±
\82±
\82Å
\82Í"; /* Air/Water Plane catch-all */
3201 You_cant("set a trap %s!", what);
3203 pline("%sã©
\82ð
\8ed
\8a|
\82¯
\82ç
\82ê
\82È
\82¢
\81I",what);
3207 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3208 if (otmp == trapinfo.tobj && u.ux == trapinfo.tx && u.uy == trapinfo.ty) {
3210 You("resume setting %s%s.", shk_your(buf, otmp),
3212 You("%s
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D",
3213 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3214 set_occupation(set_trap, occutext, 0);
3217 trapinfo.tobj = otmp;
3218 trapinfo.tx = u.ux, trapinfo.ty = u.uy;
3220 trapinfo.time_needed =
3221 (tmp > 17) ? 2 : (tmp > 12) ? 3 : (tmp > 7) ? 4 : 5;
3223 trapinfo.time_needed *= 2;
3225 if (ttyp == BEAR_TRAP && tmp < 18)
3226 trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4;
3227 /*[fumbling and/or confusion and/or cursed object check(s)
3228 should be incorporated here instead of in set_trap]*/
3229 if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
3232 if (Fumbling || otmp->cursed)
3233 chance = (rnl(10) > 3);
3235 chance = (rnl(10) > 5);
3237 You("aren't very skilled at reaching from %s.", mon_nam(u.usteed));
3239 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));
3241 Sprintf(buf, "Continue your attempt to set %s?",
3243 Sprintf(buf, "%s
\82Ì
\8ed
\8a|
\82¯
\82ð
\91±
\82¯
\82é
\81H",
3244 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3245 if (yn(buf) == 'y') {
3248 case LANDMINE: /* set it off */
3249 trapinfo.time_needed = 0;
3250 trapinfo.force_bungle = TRUE;
3252 case BEAR_TRAP: /* drop it without arming it */
3257 You("%s
\82ð
\97\8e\82Æ
\82µ
\82½
\81I",
3258 the(defsyms[trap_to_defsym(what_trap(ttyp))]
3270 You("begin setting %s%s.", shk_your(buf, otmp),
3272 You("%s%s
\82ð
\8ed
\8a|
\82¯
\82Í
\82¶
\82ß
\82½
\81D", shk_your(buf, otmp),
3273 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3274 set_occupation(set_trap, occutext, 0);
3282 struct obj *otmp = trapinfo.tobj;
3286 if (!otmp || !carried(otmp) || u.ux != trapinfo.tx
3287 || u.uy != trapinfo.ty) {
3293 if (--trapinfo.time_needed > 0)
3294 return 1; /* still busy */
3296 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3297 ttmp = maketrap(u.ux, u.uy, ttyp);
3301 if (*in_rooms(u.ux, u.uy, SHOPBASE)) {
3302 add_damage(u.ux, u.uy, 0L); /* schedule removal */
3304 if (!trapinfo.force_bungle)
3306 You("finish arming %s.",
3308 You("%s
\82ð
\8ed
\8a|
\82¯
\8fI
\82¦
\82½
\81D",
3309 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3310 if (((otmp->cursed || Fumbling) && (rnl(10) > 5))
3311 || trapinfo.force_bungle)
3313 (unsigned) (trapinfo.force_bungle ? FORCEBUNGLE : 0));
3315 /* this shouldn't happen */
3317 Your("trap setting attempt fails.");
3319 You("ã©
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82É
\8e¸
\94s
\82µ
\82½
\81D");
3333 int rx, ry, proficient, res = 0;
3335 const char *msg_slipsfree = "The bullwhip slips free.";
3337 const char *msg_slipsfree = "
\95Ú
\82Í
\82Ù
\82Ç
\82¯
\82½
\81D";
3339 const char *msg_snap = "Snap!";
3341 const char *msg_snap = "
\83s
\83V
\83b
\81I";
3344 if (!wield_tool(obj, "lash"))
3349 if (!getdir((char *) 0))
3357 if (Stunned || (Confusion && !rn2(5)))
3361 if (!isok(rx, ry)) {
3365 You("
\82Í
\82¸
\82µ
\82½
\81D");
3368 mtmp = m_at(rx, ry);
3371 /* fake some proficiency checks */
3373 if (Role_if(PM_ARCHEOLOGIST))
3375 if (ACURR(A_DEX) < 6)
3377 else if (ACURR(A_DEX) >= 14)
3378 proficient += (ACURR(A_DEX) - 14);
3386 if (u.uswallow && attack(u.ustuck)) {
3388 There("is not enough room to flick your bullwhip.");
3390 pline("
\95Ú
\82ð
\91Å
\82Â
\82Ù
\82Ç
\8dL
\82
\82È
\82¢
\81D");
3392 } else if (Underwater) {
3394 There("is too much resistance to flick your bullwhip.");
3396 pline("
\90\85\82Ì
\92ï
\8dR
\82ª
\82 \82è
\82·
\82¬
\82Ä
\95Ú
\82ð
\91Å
\82Â
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
3398 } else if (u.dz < 0) {
3400 You("flick a bug off of the %s.", ceiling(u.ux, u.uy));
3402 You("%s
\82Ì
\92\8e\82ð
\91Å
\82¿
\97\8e\82µ
\82½
\81D",ceiling(u.ux,u.uy));
3404 } else if ((!u.dx && !u.dy) || (u.dz > 0)) {
3407 /* Sometimes you hit your steed by mistake */
3408 if (u.usteed && !rn2(proficient + 2)) {
3410 You("whip %s!", mon_nam(u.usteed));
3412 You("%s
\82ð
\95Ú
\91Å
\82Á
\82½
\81I", mon_nam(u.usteed));
3416 if (Levitation || u.usteed) {
3417 /* Have a shot at snaring something on the floor */
3418 otmp = level.objects[u.ux][u.uy];
3419 if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) {
3421 pline("Why beat a dead horse?");
3423 pline("
\82Ç
\82¤
\82µ
\82Ä
\8e\80\82ñ
\82¾
\94n
\82ð
\95Ú
\91Å
\82Â
\82æ
\82¤
\82È
\82±
\82Æ
\82ð
\82·
\82é
\82Ì
\81H");
3426 if (otmp && proficient) {
3428 You("wrap your bullwhip around %s on the %s.",
3429 an(singular(otmp, xname)), surface(u.ux, u.uy));
3431 You("
\95Ú
\82ð%s
\82Ì
\8fã
\82Ì%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D",
3432 surface(u.ux, u.uy), an(singular(otmp, xname)));
3434 if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1)
3435 pline1(msg_slipsfree);
3439 dam = rnd(2) + dbon() + obj->spe;
3443 You("hit your %s with your bullwhip.", body_part(FOOT));
3445 You("
\8e©
\95ª
\82Ì%s
\82ð
\8e©
\95ª
\82Å
\91Å
\82¿
\82Â
\82¯
\82½
\81D", body_part(FOOT));
3447 Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
3448 losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
3450 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82ð
\95Ú
\91Å
\82Á
\82Ä");
3451 losehp(dam, buf, KILLED_BY);
3456 } else if ((Fumbling || Glib) && !rn2(5)) {
3458 pline_The("bullwhip slips out of your %s.", body_part(HAND));
3460 pline("
\95Ú
\82ª%s
\82©
\82ç
\82·
\82×
\82è
\97\8e\82¿
\82½
\81D", body_part(HAND));
3463 } else if (u.utrap && u.utraptype == TT_PIT) {
3467 * if you're in a pit
3468 * - you are attempting to get out of the pit
3469 * or, if you are applying it towards a small monster
3470 * - then it is assumed that you are trying to hit it
3471 * else if the monster is wielding a weapon
3472 * - you are attempting to disarm a monster
3474 * - you are attempting to hit the monster.
3476 * if you're confused (and thus off the mark)
3477 * - you only end up hitting.
3480 const char *wrapped_what = (char *) 0;
3483 if (bigmonst(mtmp->data)) {
3484 wrapped_what = strcpy(buf, mon_nam(mtmp));
3485 } else if (proficient) {
3492 if (!wrapped_what) {
3493 if (IS_FURNITURE(levl[rx][ry].typ))
3494 wrapped_what = something;
3495 else if (sobj_at(BOULDER, rx, ry))
3497 wrapped_what = "a boulder";
3499 wrapped_what = "
\8aâ";
3507 You("wrap your bullwhip around %s.", wrapped_what);
3509 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", wrapped_what);
3510 if (proficient && rn2(proficient + 2)) {
3511 if (!mtmp || enexto(&cc, rx, ry, youmonst.data)) {
3513 You("yank yourself out of the pit!");
3515 You("
\82®
\82¢
\82Æ
\88ø
\82Á
\82Ï
\82Á
\82Ä
\8c\8a\82©
\82ç
\94²
\82¯
\8fo
\82µ
\82½
\81I");
3516 teleds(cc.x, cc.y, TRUE);
3518 vision_full_recalc = 1;
3521 pline1(msg_slipsfree);
3529 if (!canspotmon(mtmp) && !glyph_is_invisible(levl[rx][ry].glyph)) {
3531 pline("A monster is there that you couldn't see.");
3533 pline("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82ª
\82¢
\82é
\81D");
3534 map_invisible(rx, ry);
3536 otmp = MON_WEP(mtmp); /* can be null */
3538 char onambuf[BUFSZ];
3539 const char *mon_hand;
3540 boolean gotit = proficient && (!Fumbling || !rn2(10));
3542 Strcpy(onambuf, cxname(otmp));
3544 mon_hand = mbodypart(mtmp, HAND);
3546 mon_hand = makeplural(mon_hand);
3548 mon_hand = 0; /* lint suppression */
3551 You("wrap your bullwhip around %s.", yname(otmp));
3553 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", xname(otmp));
3554 if (gotit && mwelded(otmp)) {
3556 pline("%s welded to %s %s%c",
3557 (otmp->quan == 1L) ? "It is" : "They are", mhis(mtmp),
3558 mon_hand, !otmp->bknown ? '!' : '.');
3560 pline("%s
\82Í%s
\82Ì%s
\82É
\82
\82Á
\82Â
\82¢
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é%s",
3562 mon_nam(mtmp), mon_hand,
3563 !otmp->bknown ? "
\81I" : "
\81D");
3566 gotit = FALSE; /* can't pull it free */
3569 obj_extract_self(otmp);
3570 possibly_unwield(mtmp, FALSE);
3571 setmnotwielded(mtmp, otmp);
3573 switch (rn2(proficient + 1)) {
3575 /* to floor near you */
3577 You("yank %s to the %s!", yname(otmp),
3579 You("%s
\82ð%s
\82É
\88ø
\82«
\97\8e\82µ
\82½
\81I", xname(otmp),
3580 surface(u.ux, u.uy));
3581 place_object(otmp, u.ux, u.uy);
3588 /* proficient with whip, but maybe not
3589 so proficient at catching weapons */
3592 hitvalu = 8 + otmp->spe;
3593 hitu = thitu(hitvalu,
3594 dmgval(otmp, &youmonst),
3598 pline_The("%s hits you as you try to snatch it!",
3600 pline_The("%s
\82ð
\92D
\82¨
\82¤
\82Æ
\82µ
\82½
\82ç
\82 \82È
\82½
\82É
\93\96\82½
\82Á
\82½
\81I",
3603 place_object(otmp, u.ux, u.uy);
3608 /* right into your inventory */
3610 You("snatch %s!", yname(otmp));
3612 You("%s
\82ð
\92D
\82Á
\82½
\81I", xname(otmp));
3613 if (otmp->otyp == CORPSE
3614 && touch_petrifies(&mons[otmp->corpsenm]) && !uarmg
3615 && !Stone_resistance
3616 && !(poly_when_stoned(youmonst.data)
3617 && polymon(PM_STONE_GOLEM))) {
3621 Sprintf(kbuf, "%s corpse",
3622 an(mons[otmp->corpsenm].mname));
3623 pline("Snatching %s is a fatal mistake.", kbuf);
3625 pline("%s
\82Ì
\8e\80\91Ì
\82ð
\92D
\82Á
\82½
\82Ì
\82Í
\92v
\96½
\93I
\82È
\8aÔ
\88á
\82¢
\82¾
\81D",
3626 mons[otmp->corpsenm].mname);
3627 Sprintf(kbuf, "%s
\82Ì
\8e\80\91Ì
\82É
\90G
\82ê
\82Ä",
3628 mons[otmp->corpsenm].mname);
3632 otmp = hold_another_object(
3634 otmp, "You drop %s!", doname(otmp), (const char *) 0);
3636 otmp, "%s
\82ð
\97\8e\82µ
\82½
\81I", doname(otmp), (const char *) 0);
3639 /* to floor beneath mon */
3641 You("yank %s from %s %s!", the(onambuf),
3643 You("%s
\82ð%s
\82Ì%s
\82©
\82ç
\82Ð
\82Á
\82Ï
\82Á
\82½
\81I", the(xname(otmp)),
3644 s_suffix(mon_nam(mtmp)), mon_hand);
3645 obj_no_longer_held(otmp);
3646 place_object(otmp, mtmp->mx, mtmp->my);
3651 pline1(msg_slipsfree);
3655 if (mtmp->m_ap_type && !Protection_from_shape_changers
3657 stumble_onto_mimic(mtmp);
3660 You("flick your bullwhip towards %s.", mon_nam(mtmp));
3662 You("%s
\82É
\8cü
\82Á
\82Ä
\95Ú
\82ð
\91Å
\82Á
\82½
\81D", mon_nam(mtmp));
3671 } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
3672 /* it must be air -- water checked above */
3674 You("snap your whip through thin air.");
3676 You("
\89½
\82à
\82È
\82¢
\82Æ
\82±
\82ë
\82Å
\95Ú
\82ð
\91Å
\82Á
\82½
\81D");
3686 not_enough_room[] = "There's not enough room here to use that.",
3688 not_enough_room[] = "
\82»
\82ê
\82ð
\8eg
\82¤
\82¾
\82¯
\82Ì
\8dL
\82³
\82ª
\82È
\82¢
\81D",
3690 where_to_hit[] = "Where do you want to hit?",
3692 where_to_hit[] = "
\82Ç
\82ê
\82ð
\91_
\82¤
\81H",
3694 cant_see_spot[] = "won't hit anything if you can't see that spot.",
3696 cant_see_spot[] = "
\8fê
\8f\8a\82ª
\8c©
\82¦
\82È
\82¯
\82ê
\82Î
\91_
\82¦
\82È
\82¢
\81D",
3698 cant_reach[] = "can't reach that spot from here.";
3700 cant_reach[] = "
\82±
\82±
\82©
\82ç
\82»
\82±
\82Ö
\82Í
\93Í
\82©
\82È
\82¢
\81D";
3702 /* find pos of monster in range, if only one monster */
3704 find_poleable_mon(pos, min_range, max_range)
3706 int min_range, max_range;
3709 struct monst *selmon = (struct monst *) 0;
3711 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
3712 if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
3713 && cansee(mtmp->mx, mtmp->my)
3714 && distu(mtmp->mx, mtmp->my) <= max_range
3715 && distu(mtmp->mx, mtmp->my) >= min_range) {
3722 pos->x = selmon->mx;
3723 pos->y = selmon->my;
3727 static int polearm_range_min = -1;
3728 static int polearm_range_max = -1;
3731 display_polearm_positions(state)
3735 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
3736 } else if (state == 1) {
3739 for (dx = -4; dx <= 4; dx++)
3740 for (dy = -4; dy <= 4; dy++) {
3741 x = dx + (int) u.ux;
3742 y = dy + (int) u.uy;
3743 if (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
3744 && distu(x, y) >= polearm_range_min
3745 && distu(x, y) <= polearm_range_max) {
3750 tmp_at(DISP_END, 0);
3754 /* Distance attacks by pole-weapons */
3759 int res = 0, typ, max_range, min_range, glyph;
3762 struct monst *hitm = context.polearm.hitmon;
3764 /* Are you allowed to use the pole? */
3766 pline(not_enough_room);
3770 if (!wield_tool(obj, "swing"))
3775 /* assert(obj == uwep); */
3778 * Calculate allowable range (pole's reach is always 2 steps):
3779 * unskilled and basic: orthogonal direction, 4..4;
3780 * skilled: as basic, plus knight's jump position, 4..5;
3781 * expert: as skilled, plus diagonal, 4..8.
3789 * (Note: no roles in nethack can become expert or better
3790 * for polearm skill; Yeoman in slash'em can become expert.)
3793 typ = uwep_skill_type();
3794 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3796 else if (P_SKILL(typ) == P_SKILLED)
3799 max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
3801 polearm_range_min = min_range;
3802 polearm_range_max = max_range;
3804 /* Prompt for a location */
3805 pline(where_to_hit);
3808 if (!find_poleable_mon(&cc, min_range, max_range) && hitm
3809 && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)
3810 && distu(hitm->mx, hitm->my) <= max_range
3811 && distu(hitm->mx, hitm->my) >= min_range) {
3815 getpos_sethilite(display_polearm_positions);
3817 if (getpos(&cc, TRUE, "the spot to hit") < 0)
3819 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
3820 return res; /* ESC; uses turn iff polearm became wielded */
3822 glyph = glyph_at(cc.x, cc.y);
3823 if (distu(cc.x, cc.y) > max_range) {
3827 pline("
\89\93\82·
\82¬
\82é
\81I");
3829 } else if (distu(cc.x, cc.y) < min_range) {
3831 pline("Too close!");
3833 pline("
\8bß
\82·
\82¬
\82é
\81I");
3835 } else if (!cansee(cc.x, cc.y) && !glyph_is_monster(glyph)
3836 && !glyph_is_invisible(glyph) && !glyph_is_statue(glyph)) {
3839 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
3844 context.polearm.hitmon = NULL;
3845 /* Attack the monster there */
3847 if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
3848 if (attack_checks(mtmp, uwep))
3851 return 1; /* burn nutrition; maybe pass out */
3852 context.polearm.hitmon = mtmp;
3853 check_caitiff(mtmp);
3854 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
3855 (void) thitmonst(mtmp, uwep);
3856 } else if (glyph_is_statue(glyph) /* might be hallucinatory */
3857 && sobj_at(STATUE, bhitpos.x, bhitpos.y)) {
3858 struct trap *t = t_at(bhitpos.x, bhitpos.y);
3860 if (t && t->ttyp == STATUE_TRAP
3861 && activate_statue_trap(t, t->tx, t->ty, FALSE)) {
3862 ; /* feedback has been give by animate_statue() */
3864 /* Since statues look like monsters now, we say something
3865 different from "you miss" or "there's nobody there".
3866 Note: we only do this when a statue is displayed here,
3867 because the player is probably attempting to attack it;
3868 other statues obscured by anything are just ignored. */
3870 pline("Thump! Your blow bounces harmlessly off the statue.");
3872 pline("
\83S
\83c
\83\93\81I
\92¤
\91\9c\82Í
\8f\9d\82Â
\82©
\82È
\82©
\82Á
\82½
\81D");
3873 wake_nearto(bhitpos.x, bhitpos.y, 25);
3876 /* no monster here and no statue seen or remembered here */
3877 if (glyph_is_invisible(glyph)) {
3878 /* now you know that nothing is there... */
3879 unmap_object(bhitpos.x, bhitpos.y);
3880 newsym(bhitpos.x, bhitpos.y);
3883 You("miss; there is no one there to hit.");
3885 You("
\8aO
\82ê
\82½
\81D
\82»
\82±
\82É
\82Í
\89½
\82à
\82È
\82¢
\81D");
3887 u_wipe_engr(2); /* same as for melee or throwing */
3895 boolean wasblind = Blind;
3896 boolean wascreamed = u.ucreamed;
3897 boolean several = FALSE;
3899 if (obj->quan > 1L) {
3901 obj = splitobj(obj, 1L);
3905 You("give yourself a facial.");
3907 You("
\83N
\83\8a\81[
\83\80\83p
\83b
\83N
\82ð
\82µ
\82½
\81D");
3910 pline("You immerse your %s in %s%s.", body_part(FACE),
3911 several ? "one of " : "",
3912 several ? makeplural(the(xname(obj))) : the(xname(obj)));
3914 pline("%s%s
\82É%s
\82ð
\92¾
\82ß
\82½
\81D",
3916 several ? "
\82Ì
\82Ð
\82Æ
\82Â" : "", body_part(FACE));
3918 if (can_blnd((struct monst *) 0, &youmonst, AT_WEAP, obj)) {
3919 int blindinc = rnd(25);
3920 u.ucreamed += blindinc;
3921 make_blinded(Blinded + (long) blindinc, FALSE);
3922 if (!Blind || (Blind && wasblind))
3924 pline("There's %ssticky goop all over your %s.",
3925 wascreamed ? "more " : "", body_part(FACE));
3927 pline("
\82â
\82Á
\82©
\82¢
\82È
\82Ë
\82Î
\82Ë
\82Î
\82ª%s
\91S
\91Ì
\82É%s
\82Â
\82¢
\82½
\81D",
3928 body_part(FACE), wascreamed ? "
\82³
\82ç
\82É" : "");
3930 else /* Blind && !wasblind */
3932 You_cant("see through all the sticky goop on your %s.",
3934 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",
3939 /* useup() is appropriate, but we want costly_alteration()'s message */
3940 costly_alteration(obj, COST_SPLAT);
3941 obj_extract_self(obj);
3950 int res = 0, typ, max_range = 4, tohit;
3951 boolean save_confirm;
3956 /* Are you allowed to use the hook? */
3958 pline(not_enough_room);
3962 if (!wield_tool(obj, "cast"))
3967 /* assert(obj == uwep); */
3969 /* Prompt for a location */
3970 pline(where_to_hit);
3974 if (getpos(&cc, TRUE, "the spot to hit") < 0)
3976 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
3977 return res; /* ESC; uses turn iff grapnel became wielded */
3979 /* Calculate range; unlike use_pole(), there's no minimum for range */
3980 typ = uwep_skill_type();
3981 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3983 else if (P_SKILL(typ) == P_SKILLED)
3987 if (distu(cc.x, cc.y) > max_range) {
3991 pline("
\89\93\82·
\82¬
\82é
\81I");
3993 } else if (!cansee(cc.x, cc.y)) {
3996 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4001 /* What do you want to hit? */
4003 if (typ != P_NONE && P_SKILL(typ) >= P_SKILLED) {
4004 winid tmpwin = create_nhwindow(NHW_MENU);
4007 menu_item *selected;
4009 any = zeroany; /* set all bits to zero */
4010 any.a_int = 1; /* use index+1 (cant use 0) as identifier */
4014 Sprintf(buf, "an object on the %s", surface(cc.x, cc.y));
4016 Sprintf(buf, "%s
\82É
\82 \82é
\95¨
\91Ì", surface(cc.x, cc.y));
4017 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4021 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "a monster",
4024 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "
\89ö
\95¨",
4029 Sprintf(buf, "the %s", surface(cc.x, cc.y));
4031 Sprintf(buf, "%s", surface(cc.x, cc.y));
4032 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4035 end_menu(tmpwin, "Aim for what?");
4037 end_menu(tmpwin, "
\89½
\82ð
\91_
\82¤
\81H");
4039 if (select_menu(tmpwin, PICK_ONE, &selected) > 0
4040 && rn2(P_SKILL(typ) > P_SKILLED ? 20 : 2))
4041 tohit = selected[0].item.a_int - 1;
4042 free((genericptr_t) selected);
4043 destroy_nhwindow(tmpwin);
4046 /* possibly scuff engraving at your feet;
4047 any engraving at the target location is unaffected */
4048 if (tohit == 2 || !rn2(2))
4049 u_wipe_engr(rnd(2));
4051 /* What did you hit? */
4054 /* FIXME -- untrap needs to deal with non-adjacent traps */
4056 case 1: /* Object */
4057 if ((otmp = level.objects[cc.x][cc.y]) != 0) {
4059 You("snag an object from the %s!", surface(cc.x, cc.y));
4061 You("%s
\82Ì
\82à
\82Ì
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I", surface(cc.x, cc.y));
4062 (void) pickup_object(otmp, 1L, FALSE);
4063 /* If pickup fails, leave it alone */
4068 case 2: /* Monster */
4070 if ((mtmp = m_at(cc.x, cc.y)) == (struct monst *) 0)
4072 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4073 save_confirm = flags.confirm;
4074 if (verysmall(mtmp->data) && !rn2(4)
4075 && enexto(&cc, u.ux, u.uy, (struct permonst *) 0)) {
4076 flags.confirm = FALSE;
4077 (void) attack_checks(mtmp, uwep);
4078 flags.confirm = save_confirm;
4079 check_caitiff(mtmp); /* despite fact there's no damage */
4081 You("pull in %s!", mon_nam(mtmp));
4083 You("%s
\82ð
\88ø
\82Á
\92£
\82Á
\82½
\81I", mon_nam(mtmp));
4084 mtmp->mundetected = 0;
4085 rloc_to(mtmp, cc.x, cc.y);
4087 } else if ((!bigmonst(mtmp->data) && !strongmonst(mtmp->data))
4089 flags.confirm = FALSE;
4090 (void) attack_checks(mtmp, uwep);
4091 flags.confirm = save_confirm;
4092 check_caitiff(mtmp);
4093 (void) thitmonst(mtmp, uwep);
4097 case 3: /* Surface */
4098 if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
4100 pline_The("hook slices through the %s.", surface(cc.x, cc.y));
4102 pline("
\83t
\83b
\83N
\82Í%s
\82ð
\82³
\82Á
\82Æ
\90Ø
\82Á
\82½
\81D", surface(cc.x, cc.y));
4105 You("are yanked toward the %s!", surface(cc.x, cc.y));
4107 You("%s
\82Ö
\88ø
\82Á
\82Ï
\82ç
\82ê
\82½
\81I", surface(cc.x, cc.y));
4108 hurtle(sgn(cc.x - u.ux), sgn(cc.y - u.uy), 1, FALSE);
4112 default: /* Yourself (oops!) */
4113 if (P_SKILL(typ) <= P_BASIC) {
4115 You("hook yourself!");
4117 You("
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I");
4119 losehp(Maybe_Half_Phys(rn1(10, 10)), "a grappling hook",
4121 losehp(Maybe_Half_Phys(rn1(10, 10)), "
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82Ä",
4127 pline1(nothing_happens);
4131 #define BY_OBJECT ((struct monst *) 0)
4133 /* return 1 if the wand is broken, hence some time elapsed */
4139 static const char nothing_else_happens[] = "But nothing else happens...";
4141 static const char nothing_else_happens[] = "
\82µ
\82©
\82µ
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D
\81D
\81D";
4142 register int i, x, y;
4143 register struct monst *mon;
4145 boolean affects_objects;
4146 boolean shop_damage = FALSE;
4147 boolean fillmsg = FALSE;
4148 int expltype = EXPL_MAGICAL;
4149 char confirm[QBUFSZ], buf[BUFSZ];
4151 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa"));
4153 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "
\83o
\83\8b\83T
\82Ì
\8fñ"));
4156 if (!paranoid_query(ParanoidBreakwand,
4158 "Are you really sure you want to break ",
4159 "?", obj, yname, ysimple_name, "the wand")))
4161 if (!paranoid_query(ParanoidBreakwand,
4163 "
\96{
\93\96\82É", "
\82ð
\89ó
\82·
\82Ì
\81H",
4164 obj, xname, ysimple_name, "
\8fñ")))
4168 if (nohands(youmonst.data)) {
4170 You_cant("break %s without hands!", yname(obj));
4172 You("
\8eè
\82ª
\96³
\82¢
\82Ì
\82Å%s
\82ð
\89ó
\82¹
\82È
\82¢
\81I", xname(obj));
4174 } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) {
4176 You("don't have the strength to break %s!", yname(obj));
4178 You("%s
\82ð
\89ó
\82·
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I", xname(obj));
4182 pline("Raising %s high above your %s, you break it in two!", yname(obj),
4184 You("%s
\82ð%s
\82Ì
\8fã
\82É
\8d\82\82
\8cf
\82°
\81C
\93ñ
\82Â
\82É
\82Ö
\82µ
\90Ü
\82Á
\82½
\81I", xname(obj),
4187 /* [ALI] Do this first so that wand is removed from bill. Otherwise,
4188 * the freeinv() below also hides it from setpaid() which causes problems.
4191 check_unpaid(obj); /* Extra charge for use */
4192 costly_alteration(obj, COST_DSTROY);
4195 current_wand = obj; /* destroy_item might reset this */
4196 freeinv(obj); /* hide it from destroy_item instead... */
4197 setnotworn(obj); /* so we need to do this ourselves */
4199 if (!zappable(obj)) {
4200 pline(nothing_else_happens);
4201 goto discard_broken_wand;
4203 /* successful call to zappable() consumes a charge; put it back */
4205 /* might have "wrested" a final charge, taking it from 0 to -1;
4206 if so, we just brought it back up to 0, which wouldn't do much
4207 below so give it 1..3 charges now, usually making it stronger
4208 than an ordinary last charge (the wand is already gone from
4209 inventory, so perm_invent can't accidentally reveal this) */
4216 affects_objects = FALSE;
4218 switch (obj->otyp) {
4223 case WAN_ENLIGHTENMENT:
4225 case WAN_SECRET_DOOR_DETECTION:
4226 pline(nothing_else_happens);
4227 goto discard_broken_wand;
4233 expltype = EXPL_FIERY;
4235 if (expltype == EXPL_MAGICAL)
4236 expltype = EXPL_FROSTY;
4238 case WAN_MAGIC_MISSILE:
4240 explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
4241 makeknown(obj->otyp); /* explode describes the effect */
4242 goto discard_broken_wand;
4244 /* we want this before the explosion instead of at the very end */
4246 pline("A wall of force smashes down around you!");
4248 pline("
\82 \82È
\82½
\82Í
\96\82\97Í
\82Ì
\95Ç
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81I");
4249 dmg = d(1 + obj->spe, 6); /* normally 2d12 */
4251 case WAN_CANCELLATION:
4253 case WAN_TELEPORTATION:
4254 case WAN_UNDEAD_TURNING:
4255 affects_objects = TRUE;
4261 /* magical explosion and its visual effect occur before specific effects
4263 /* [TODO? This really ought to prevent the explosion from being
4264 fatal so that we never leave a bones file where none of the
4265 surrounding targets (or underlying objects) got affected yet.] */
4266 explode(obj->ox, obj->oy, -(obj->otyp), rnd(dmg), WAND_CLASS,
4269 /* prepare for potential feedback from polymorph... */
4272 /* this makes it hit us last, so that we can see the action first */
4273 for (i = 0; i <= 8; i++) {
4274 bhitpos.x = x = obj->ox + xdir[i];
4275 bhitpos.y = y = obj->oy + ydir[i];
4279 if (obj->otyp == WAN_DIGGING) {
4282 if (dig_check(BY_OBJECT, FALSE, x, y)) {
4283 if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
4284 /* normally, pits and holes don't anger guards, but they
4285 * do if it's a wall or door that's being dug */
4286 watch_dig((struct monst *) 0, x, y, TRUE);
4287 if (*in_rooms(x, y, SHOPBASE))
4291 * Let liquid flow into the newly created pits.
4292 * Adjust corresponding code in music.c for
4293 * drum of earthquake if you alter this sequence.
4295 typ = fillholetyp(x, y, FALSE);
4297 levl[x][y].typ = typ;
4298 liquid_flow(x, y, typ, t_at(x, y),
4302 : "Some holes are quickly filled with %s!");
4304 : "
\8c\8a\82Í
\82·
\82®
\82É%s
\82Å
\96\84\82Ü
\82Á
\82½
\81I");
4307 digactualhole(x, y, BY_OBJECT, (rn2(obj->spe) < 3
4308 || (!Can_dig_down(&u.uz)
4309 && !levl[x][y].candig))
4314 } else if (obj->otyp == WAN_CREATE_MONSTER) {
4315 /* u.ux,u.uy creates it near you--x,y might create it in rock */
4316 (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
4318 } else if (x != u.ux || y != u.uy) {
4320 * Wand breakage is targetting a square adjacent to the hero,
4321 * which might contain a monster or a pile of objects or both.
4322 * Handle objects last; avoids having undead turning raise an
4323 * undead's corpse and then attack resulting undead monster.
4324 * obj->bypass in bhitm() prevents the polymorphing of items
4325 * dropped due to monster's polymorph and prevents undead
4326 * turning that kills an undead from raising resulting corpse.
4328 if ((mon = m_at(x, y)) != 0) {
4329 (void) bhitm(mon, obj);
4330 /* if (context.botl) bot(); */
4332 if (affects_objects && level.objects[x][y]) {
4333 (void) bhitpile(obj, bhito, x, y, 0);
4335 bot(); /* potion effects */
4339 * Wand breakage is targetting the hero. Using xdir[]+ydir[]
4340 * deltas for location selection causes this case to happen
4341 * after all the surrounding squares have been handled.
4342 * Process objects first, in case damage is fatal and leaves
4343 * bones, or teleportation sends one or more of the objects to
4344 * same destination as hero (lookhere/autopickup); also avoids
4345 * the polymorphing of gear dropped due to hero's transformation.
4346 * (Unlike with monsters being hit by zaps, we can't rely on use
4347 * of obj->bypass in the zap code to accomplish that last case
4348 * since it's also used by retouch_equipment() for polyself.)
4350 if (affects_objects && level.objects[x][y]) {
4351 (void) bhitpile(obj, bhito, x, y, 0);
4353 bot(); /* potion effects */
4355 damage = zapyourself(obj, FALSE);
4358 Sprintf(buf, "killed %sself by breaking a wand", uhim());
4359 losehp(Maybe_Half_Phys(damage), buf, NO_KILLER_PREFIX);
4361 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82Å
\8fñ
\82ð
\89ó
\82µ
\82Ä
\83_
\83\81\81[
\83W
\82ð
\8eó
\82¯");
4362 losehp(Maybe_Half_Phys(damage), buf, KILLED_BY);
4366 bot(); /* blindness */
4370 /* potentially give post zap/break feedback */
4373 /* Note: if player fell thru, this call is a no-op.
4374 Damage is handled in digactualhole in that case */
4377 pay_for_damage("dig into", FALSE);
4379 pay_for_damage("
\8c\8a\82ð
\82 \82¯
\82é", FALSE);
4381 if (obj->otyp == WAN_LIGHT)
4382 litroom(TRUE, obj); /* only needs to be done once */
4384 discard_broken_wand:
4385 obj = current_wand; /* [see dozap() and destroy_item()] */
4394 add_class(cl, class)
4405 static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
4407 /* augment tools[] if various items are carried */
4409 setapplyclasses(class_list)
4412 register struct obj *otmp;
4414 boolean knowoil, knowtouchstone, addpotions, addstones, addfood;
4416 knowoil = objects[POT_OIL].oc_name_known;
4417 knowtouchstone = objects[TOUCHSTONE].oc_name_known;
4418 addpotions = addstones = addfood = FALSE;
4419 for (otmp = invent; otmp; otmp = otmp->nobj) {
4422 || (otmp->oclass == POTION_CLASS
4424 || (!knowoil && !objects[otyp].oc_name_known))))
4426 if (otyp == TOUCHSTONE
4427 || (is_graystone(otmp)
4429 || (!knowtouchstone && !objects[otyp].oc_name_known))))
4431 if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF)
4435 class_list[0] = '\0';
4436 if (addpotions || addstones)
4437 add_class(class_list, ALL_CLASSES);
4438 Strcat(class_list, tools);
4440 add_class(class_list, POTION_CLASS);
4442 add_class(class_list, GEM_CLASS);
4444 add_class(class_list, FOOD_CLASS);
4447 /* the 'a' command */
4452 register int res = 1;
4453 char class_list[MAXOCLASSES + 2];
4455 if (check_capacity((char *) 0))
4458 setapplyclasses(class_list); /* tools[] */
4459 obj = getobj(class_list, "use or apply");
4463 if (!retouch_object(&obj, FALSE))
4464 return 1; /* evading your grasp costs a turn; just be
4465 grateful that you don't drop it as well */
4467 if (obj->oclass == WAND_CLASS)
4468 return do_break_wand(obj);
4470 switch (obj->otyp) {
4473 if (obj == ublindf) {
4476 } else if (!ublindf) {
4480 You("are already %s.", ublindf->otyp == TOWEL
4481 ? "covered by a towel"
4482 : ublindf->otyp == BLINDFOLD
4483 ? "wearing a blindfold"
4484 : "wearing lenses");
4486 You("
\82à
\82¤%s
\82Ä
\82¢
\82é
\81D", ublindf->otyp == TOWEL
4487 ? "
\83^
\83I
\83\8b\82ð
\8aª
\82¢"
4488 : ublindf->otyp == BLINDFOLD
4489 ? "
\96Ú
\89B
\82µ
\82ð
\82Â
\82¯"
4490 : "
\83\8c\83\93\83Y
\82ð
\82Â
\82¯");
4495 res = use_cream_pie(obj);
4498 res = use_whip(obj);
4500 case GRAPPLING_HOOK:
4501 res = use_grapple(obj);
4507 case BAG_OF_HOLDING:
4509 res = use_container(&obj, 1);
4512 (void) bagotricks(obj, FALSE, (int *) 0);
4520 res = (pick_lock(obj) != 0);
4523 case DWARVISH_MATTOCK:
4524 res = use_pick_axe(obj);
4527 use_tinning_kit(obj);
4533 res = use_saddle(obj);
4536 use_magic_whistle(obj);
4541 case EUCALYPTUS_LEAF:
4542 /* MRKR: Every Australian knows that a gum leaf makes an excellent
4543 * whistle, especially if your pet is a tame kangaroo named Skippy.
4546 use_magic_whistle(obj);
4547 /* sometimes the blessing will be worn off */
4551 pline("%s %s.", Yobjnam2(obj, "glow"), hcolor("brown"));
4553 pline("%s
\82Í%s
\8bP
\82¢
\82½
\81D", xname(obj), jconj_adj(hcolor("
\92\83\90F
\82Ì")));
4563 res = use_stethoscope(obj);
4566 res = use_mirror(obj);
4569 case BELL_OF_OPENING:
4572 case CANDELABRUM_OF_INVOCATION:
4573 use_candelabrum(obj);
4585 light_cocktail(obj);
4587 case EXPENSIVE_CAMERA:
4588 res = use_camera(obj);
4591 res = use_towel(obj);
4594 use_crystal_ball(&obj);
4600 if (!carrying(TIN)) {
4602 You("have no tin to open.");
4604 You("
\8aÊ
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82È
\82¢
\81D");
4608 You("cannot open a tin without eating or discarding its contents.");
4610 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");
4613 pline("In order to eat, use the 'e' command.");
4615 pline("
\90H
\82×
\82é
\82É
\82Í
\81C'e'
\83R
\83}
\83\93\83h
\82ð
\8eg
\82¦
\82Î
\82æ
\82¢
\81D");
4619 "Opening the tin will be much easier if you wield the tin opener.");
4621 "
\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");
4628 use_unicorn_horn(obj);
4639 case DRUM_OF_EARTHQUAKE:
4640 res = do_play_instrument(obj);
4642 case HORN_OF_PLENTY: /* not a musical instrument */
4643 (void) hornoplenty(obj, FALSE);
4656 /* Pole-weapons can strike at a distance */
4658 res = use_pole(obj);
4660 } else if (is_pick(obj) || is_axe(obj)) {
4661 res = use_pick_axe(obj);
4665 pline("Sorry, I don't know how to use that.");
4667 pline("
\82»
\82ê
\82ð
\82Ç
\82¤
\82â
\82Á
\82Ä
\8eg
\82¤
\82ñ
\82¾
\82¢
\81H");
4672 if (res && obj && obj->oartifact)
4678 /* Keep track of unfixable troubles for purposes of messages saying you feel
4682 unfixable_trouble_count(is_horn)
4685 int unfixable_trbl = 0;
4691 if (Wounded_legs && !u.usteed)
4695 /* lycanthropy is undesirable, but it doesn't actually make you feel bad */
4697 if (!is_horn || (Confusion & ~TIMEOUT))
4699 if (!is_horn || (Sick & ~TIMEOUT))
4701 if (!is_horn || (HHallucination & ~TIMEOUT))
4703 if (!is_horn || (Vomiting & ~TIMEOUT))
4705 if (!is_horn || (HStun & ~TIMEOUT))
4707 if (!is_horn || (HDeaf & ~TIMEOUT))
4710 return unfixable_trbl;