1 /* NetHack 3.6 apply.c $NHDT-Date: 1519598527 2018/02/25 22:42:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.243 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2012. */
4 /* NetHack may be freely redistributed. See license for details. */
6 /* JNetHack Copyright */
7 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
8 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2018 */
9 /* JNetHack may be freely redistributed. See license for details. */
13 extern boolean notonhead; /* for long worms */
15 STATIC_DCL int FDECL(use_camera, (struct obj *));
16 STATIC_DCL int FDECL(use_towel, (struct obj *));
17 STATIC_DCL boolean FDECL(its_dead, (int, int, int *));
18 STATIC_DCL int FDECL(use_stethoscope, (struct obj *));
19 STATIC_DCL void FDECL(use_whistle, (struct obj *));
20 STATIC_DCL void FDECL(use_magic_whistle, (struct obj *));
21 STATIC_DCL int FDECL(use_leash, (struct obj *));
22 STATIC_DCL int FDECL(use_mirror, (struct obj *));
23 STATIC_DCL void FDECL(use_bell, (struct obj **));
24 STATIC_DCL void FDECL(use_candelabrum, (struct obj *));
25 STATIC_DCL void FDECL(use_candle, (struct obj **));
26 STATIC_DCL void FDECL(use_lamp, (struct obj *));
27 STATIC_DCL void FDECL(light_cocktail, (struct obj **));
28 STATIC_PTR void FDECL(display_jump_positions, (int));
29 STATIC_DCL void FDECL(use_tinning_kit, (struct obj *));
30 STATIC_DCL void FDECL(use_figurine, (struct obj **));
31 STATIC_DCL void FDECL(use_grease, (struct obj *));
32 STATIC_DCL void FDECL(use_trap, (struct obj *));
33 STATIC_DCL void FDECL(use_stone, (struct obj *));
34 STATIC_PTR int NDECL(set_trap); /* occupation callback */
35 STATIC_DCL int FDECL(use_whip, (struct obj *));
36 STATIC_PTR void FDECL(display_polearm_positions, (int));
37 STATIC_DCL int FDECL(use_pole, (struct obj *));
38 STATIC_DCL int FDECL(use_cream_pie, (struct obj *));
39 STATIC_DCL int FDECL(use_grapple, (struct obj *));
40 STATIC_DCL int FDECL(do_break_wand, (struct obj *));
41 STATIC_DCL boolean FDECL(figurine_location_checks, (struct obj *,
43 STATIC_DCL void FDECL(add_class, (char *, CHAR_P));
44 STATIC_DCL void FDECL(setapplyclasses, (char *));
45 STATIC_PTR boolean FDECL(check_jump, (genericptr_t, int, int));
46 STATIC_DCL boolean FDECL(is_valid_jump_pos, (int, int, int, BOOLEAN_P));
47 STATIC_DCL boolean FDECL(get_valid_jump_position, (int, int));
48 STATIC_DCL boolean FDECL(get_valid_polearm_position, (int, int));
49 STATIC_DCL boolean FDECL(find_poleable_mon, (coord *, int, int));
52 void FDECL(amii_speaker, (struct obj *, char *, int));
55 static const char no_elbow_room[] =
57 "don't have enough elbow-room to maneuver.";
59 "
\82»
\82ê
\82ð
\82·
\82é
\82¾
\82¯
\82Ì
\82ä
\82Æ
\82è
\82ª
\82È
\82¢
\81D";
69 pline("Using your camera underwater would void the warranty.");
71 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");
74 if (!getdir((char *) 0))
78 pline1(nothing_happens);
81 consume_obj_charge(obj, TRUE);
83 if (obj->cursed && !rn2(2)) {
84 (void) zapyourself(obj, TRUE);
85 } else if (u.uswallow) {
87 You("take a picture of %s %s.", s_suffix(mon_nam(u.ustuck)),
88 mbodypart(u.ustuck, STOMACH));
90 You("%s
\82Ì%s
\82Ì
\8eÊ
\90^
\82ð
\8eB
\82Á
\82½
\81D", mon_nam(u.ustuck),
91 mbodypart(u.ustuck, STOMACH));
95 You("take a picture of the %s.",
97 You("%s
\82Ì
\8eÊ
\90^
\82ð
\8eB
\82Á
\82½
\81D",
98 (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
99 } else if (!u.dx && !u.dy) {
100 (void) zapyourself(obj, TRUE);
101 } else if ((mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
102 (int FDECL((*), (MONST_P, OBJ_P))) 0,
103 (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj)) != 0) {
104 obj->ox = u.ux, obj->oy = u.uy;
105 (void) flash_hits_mon(mtmp, obj);
114 boolean drying_feedback = (obj == uwep);
118 You("have no free %s!", body_part(HAND));
120 You("%s
\82Ì
\8e©
\97R
\82ª
\8cø
\82©
\82È
\82¢
\81I", body_part(HAND));
122 } else if (obj == ublindf) {
124 You("cannot use it while you're wearing it!");
126 You("
\82»
\82ê
\82ð
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\82Ì
\82Å
\8eg
\97p
\82Å
\82«
\82È
\82¢
\81I");
128 } else if (obj->cursed) {
134 incr_itimeout(&Glib, rn1(10, 3));
136 Your("%s %s!", makeplural(body_part(HAND)),
137 (old ? "are filthier than ever" : "get slimy"));
139 Your("%s
\82Í%s
\81I", makeplural(body_part(HAND)),
140 (old ? "
\82Ü
\82·
\82Ü
\82·
\89\98\82È
\82
\82È
\82Á
\82½" : "
\82Ê
\82é
\82Ê
\82é
\82É
\82È
\82Á
\82½"));
142 if (is_wet_towel(obj))
143 dry_a_towel(obj, -1, drying_feedback);
148 u.ucreamed += rn1(10, 3);
150 pline("Yecch! Your %s %s gunk on it!", body_part(FACE),
151 (old ? "has more" : "now has"));
153 pline("
\83Q
\83F
\81[
\81I
\82 \82È
\82½
\82Ì%s
\82Í%s
\82×
\82Æ
\82×
\82Æ
\82É
\82È
\82Á
\82½
\81I", body_part(FACE),
154 (old ? "
\82à
\82Á
\82Æ" : ""));
156 make_blinded(Blinded + (long) u.ucreamed - old, TRUE);
161 what = (ublindf->otyp == LENSES)
163 : (obj->otyp == ublindf->otyp) ? "other towel"
166 what = (ublindf->otyp == LENSES)
168 : (obj->otyp == ublindf->otyp) ? "
\83^
\83I
\83\8b"
171 if (ublindf->cursed) {
173 You("push your %s %s.", what,
174 rn2(2) ? "cock-eyed" : "crooked");
176 pline("%s
\82ª%s
\81D", what,
177 rn2(2) ? "
\82¸
\82ê
\82½" : "
\82ä
\82ª
\82ñ
\82¾");
180 struct obj *saved_ublindf = ublindf;
182 You("push your %s off.", what);
184 pline("%s
\82ª
\82¸
\82è
\97\8e\82¿
\82½
\81D", what);
186 dropx(saved_ublindf);
189 if (is_wet_towel(obj))
190 dry_a_towel(obj, -1, drying_feedback);
200 You("wipe off your %s.", makeplural(body_part(HAND)));
202 You("%s
\82ð
\90@
\82¢
\82½
\81D", makeplural(body_part(HAND)));
203 if (is_wet_towel(obj))
204 dry_a_towel(obj, -1, drying_feedback);
206 } else if (u.ucreamed) {
207 Blinded -= u.ucreamed;
211 pline("You've got the glop off.");
213 You("
\82³
\82Á
\82Ï
\82è
\82µ
\82½
\81D");
214 if (!gulp_blnd_check()) {
216 make_blinded(0L, TRUE);
220 Your("%s feels clean now.", body_part(FACE));
222 pline("%s
\82Ì
\89\98\82ê
\82ð
\90@
\82«
\82Æ
\82Á
\82½
\81D", body_part(FACE));
224 if (is_wet_towel(obj))
225 dry_a_towel(obj, -1, drying_feedback);
230 Your("%s and %s are already clean.", body_part(FACE),
231 makeplural(body_part(HAND)));
233 Your("%s
\82â%s
\82Í
\89\98\82ê
\82Ä
\82¢
\82È
\82¢
\81D", body_part(FACE),
234 makeplural(body_part(HAND)));
240 /* maybe give a stethoscope message based on floor objects */
242 its_dead(rx, ry, resp)
246 boolean more_corpses;
248 struct permonst *mptr;
250 struct obj *corpse = sobj_at(CORPSE, rx, ry),
251 *statue = sobj_at(STATUE, rx, ry);
253 if (!can_reach_floor(TRUE)) { /* levitation or unskilled riding */
254 corpse = 0; /* can't reach corpse on floor */
255 /* you can't reach tiny statues (even though you can fight
256 tiny monsters while levitating--consistency, what's that?) */
257 while (statue && mons[statue->corpsenm].msize == MZ_TINY)
258 statue = nxtobj(statue, STATUE, TRUE);
260 /* when both corpse and statue are present, pick the uppermost one */
261 if (corpse && statue) {
262 if (nxtobj(statue, CORPSE, TRUE) == corpse)
263 corpse = 0; /* corpse follows statue; ignore it */
265 statue = 0; /* corpse precedes statue; ignore statue */
267 more_corpses = (corpse && nxtobj(corpse, CORPSE, TRUE));
269 /* additional stethoscope messages from jyoung@apanix.apana.org.au */
270 if (!corpse && !statue) {
271 ; /* nothing to do */
273 } else if (Hallucination) {
277 Strcpy(buf, "You're both stoned");
279 Strcpy(buf, "
\90Î
\82¾");
280 #if 0 /*JP*//*
\91ã
\96¼
\8e\8c\8f\88\97\9d\82Í
\95s
\97v*/
281 } else if (corpse->quan == 1L && !more_corpses) {
282 int gndr = 2; /* neuter: "it" */
283 struct monst *mtmp = get_mtraits(corpse, FALSE);
285 /* (most corpses don't retain the monster's sex, so
286 we're usually forced to use generic pronoun here) */
288 mptr = &mons[mtmp->mnum];
289 /* can't use mhe() here; it calls pronoun_gender() which
290 expects monster to be on the map (visibility check) */
291 if ((humanoid(mptr) || (mptr->geno & G_UNIQ)
292 || type_is_pname(mptr)) && !is_neuter(mptr))
293 gndr = (int) mtmp->female;
295 mptr = &mons[corpse->corpsenm];
298 else if (is_male(mptr))
301 Sprintf(buf, "%s's dead", genders[gndr].he); /* "he"/"she"/"it" */
302 buf[0] = highc(buf[0]);
304 } else { /* plural */
306 Strcpy(buf, "They're dead");
308 Strcpy(buf, "
\8e\80\82ñ
\82Å
\82é
\82º");
310 /* variations on "He's dead, Jim." (Star Trek's Dr McCoy) */
312 You_hear("a voice say, \"%s, Jim.\"", buf);
314 You_hear("
\81u
\82»
\82¢
\82Â
\82Í%s
\81C
\83W
\83\80\81v
\82Æ
\82¢
\82¤
\90º
\82ª
\95·
\82±
\82¦
\82½
\81D", buf);
319 boolean here = (rx == u.ux && ry == u.uy),
320 one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
321 int visglyph, corpseglyph;
323 visglyph = glyph_at(rx, ry);
324 corpseglyph = obj_to_glyph(corpse);
326 if (Blind && (visglyph != corpseglyph))
327 map_object(corpse, TRUE);
329 if (Role_if(PM_HEALER)) {
330 /* ok to reset `corpse' here; we're done with it */
332 if (obj_has_timer(corpse, REVIVE_MON))
335 corpse = nxtobj(corpse, CORPSE, TRUE);
336 } while (corpse && !reviver);
339 You("determine that %s unfortunate being%s %s%s dead.",
340 one ? (here ? "this" : "that") : (here ? "these" : "those"),
341 one ? "" : "s", one ? "is" : "are", reviver ? " mostly" : "");
343 You("%s
\95s
\8dK
\82È
\90¶
\82«
\95¨
\82Í%s
\8e\80\82ñ
\82Å
\82¢
\82é
\82Æ
\8c\8b\98_
\82µ
\82½
\81D",
344 here ? "
\82±
\82Ì" : "
\82»
\82Ì",
345 reviver ? "
\82Ù
\82Ú" : "");
349 } else { /* statue */
350 const char *what, *how;
353 mptr = &mons[statue->corpsenm];
354 if (Blind) { /* ignore statue->dknown; it'll always be set */
355 Sprintf(buf, "%s %s",
356 (rx == u.ux && ry == u.uy) ? "This" : "That",
357 humanoid(mptr) ? "person" : "creature");
361 if (!type_is_pname(mptr))
364 #else /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\83V
\83\93\83v
\83\8b\82É*/
365 if (Blind) { /* ignore statue->dknown; it'll always be set */
366 what = (rx == u.ux && ry == u.uy) ? "
\82±
\82ê" : "
\82 \82ê";
368 what = mons[statue->corpsenm].mname;
375 if (Role_if(PM_HEALER)) {
376 struct trap *ttmp = t_at(rx, ry);
378 if (ttmp && ttmp->ttyp == STATUE_TRAP)
380 how = "extraordinary";
382 how = "
\95À
\8aO
\82ê
\82½";
383 else if (Has_contents(statue))
387 how = "
\92\8d\96Ú
\82·
\82×
\82«";
391 pline("%s is in %s health for a statue.", what, how);
393 pline("
\92¤
\91\9c\82Æ
\82µ
\82Ä
\82Ì%s
\82Í%s
\8dì
\95i
\82¾
\81D", what, how);
396 return FALSE; /* no corpse or statue */
400 static const char hollow_str[] = "a hollow sound. This must be a secret %s!";
402 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";
404 /* Strictly speaking it makes no sense for usage of a stethoscope to
405 not take any time; however, unless it did, the stethoscope would be
406 almost useless. As a compromise, one use per turn is free, another
407 uses up the turn; this makes curse status have a tangible effect. */
410 register struct obj *obj;
415 boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
416 && !rn2(Role_if(PM_HEALER) ? 10 : 3));
418 if (nohands(youmonst.data)) {
420 You("have no hands!"); /* not `body_part(HAND)' */
422 pline("
\82 \82È
\82½
\82É
\82Í
\8eè
\82ª
\82È
\82¢
\81I");
427 You_cant("hear anything!");
429 You("
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81I");
431 } else if (!freehand()) {
433 You("have no free %s.", body_part(HAND));
435 You("%s
\82Ì
\8e©
\97R
\82ª
\8cø
\82©
\82È
\82¢
\81D", body_part(HAND));
438 if (!getdir((char *) 0))
441 res = (moves == context.stethoscope_move)
442 && (youmonst.movement == context.stethoscope_movement);
443 context.stethoscope_move = moves;
444 context.stethoscope_movement = youmonst.movement;
446 bhitpos.x = u.ux, bhitpos.y = u.uy; /* tentative, reset below */
447 notonhead = u.uswallow;
448 if (u.usteed && u.dz > 0) {
451 pline("%s interferes.", Monnam(u.ustuck));
453 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
454 mstatusline(u.ustuck);
456 mstatusline(u.usteed);
458 } else if (u.uswallow && (u.dx || u.dy || u.dz)) {
459 mstatusline(u.ustuck);
461 } else if (u.uswallow && interference) {
463 pline("%s interferes.", Monnam(u.ustuck));
465 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
466 mstatusline(u.ustuck);
471 You_hear("faint splashing.");
473 You_hear("
\82©
\82·
\82©
\82É
\83o
\83V
\83\83\83o
\83V
\83\83\82Æ
\82¢
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81D");
474 else if (u.dz < 0 || !can_reach_floor(TRUE))
475 cant_reach_floor(u.ux, u.uy, (u.dz < 0), TRUE);
476 else if (its_dead(u.ux, u.uy, &res))
477 ; /* message already given */
478 else if (Is_stronghold(&u.uz))
480 You_hear("the crackling of hellfire.");
482 You_hear("
\92n
\8d\96\82Ì
\89\8a\82ª
\83p
\83`
\83p
\83`
\94R
\82¦
\82Ä
\82¢
\82é
\89¹
\82ð
\95·
\82¢
\82½
\81D");
485 pline_The("%s seems healthy enough.", surface(u.ux, u.uy));
487 pline("%s
\82Í
\8f[
\95ª
\8c\92\8dN
\82Ì
\82æ
\82¤
\82¾
\81D", surface(u.ux,u.uy));
489 } else if (obj->cursed && !rn2(2)) {
491 You_hear("your heart beat.");
493 You_hear("
\8e©
\95ª
\82Ì
\90S
\91\9f\82Ì
\8cÛ
\93®
\82ð
\95·
\82¢
\82½
\81D");
496 if (Stunned || (Confusion && !rn2(5)))
498 if (!u.dx && !u.dy) {
506 You_hear("a faint typing noise.");
508 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");
511 if ((mtmp = m_at(rx, ry)) != 0) {
512 const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *) 0,
513 SUPPRESS_IT | SUPPRESS_INVISIBLE, FALSE);
515 /* bhitpos needed by mstatusline() iff mtmp is a long worm */
516 bhitpos.x = rx, bhitpos.y = ry;
517 notonhead = (mtmp->mx != rx || mtmp->my != ry);
519 if (mtmp->mundetected) {
520 if (!canspotmon(mtmp))
522 There("is %s hidden there.", mnm);
524 pline("
\82±
\82±
\82É%s
\82ª
\89B
\82ê
\82Ä
\82¢
\82é
\81D", mnm);
525 mtmp->mundetected = 0;
526 newsym(mtmp->mx, mtmp->my);
527 } else if (mtmp->mappearance) {
528 const char *what = "thing";
530 switch (mtmp->m_ap_type) {
532 what = simple_typename(mtmp->mappearance);
534 case M_AP_MONSTER: /* ignore Hallucination here */
535 what = mons[mtmp->mappearance].mname;
538 what = defsyms[mtmp->mappearance].explanation;
543 pline("That %s is really %s.", what, mnm);
545 pline("
\82±
\82Ì%s
\82Í
\8eÀ
\8dÛ
\82É
\82Í%s
\81D", what, mnm);
546 } else if (flags.verbose && !canspotmon(mtmp)) {
548 There("is %s there.", mnm);
550 pline("
\82±
\82±
\82É
\82Í%s
\82ª
\82¢
\82é
\81D", mnm);
554 if (!canspotmon(mtmp))
555 map_invisible(rx, ry);
558 if (unmap_invisible(rx,ry))
560 pline_The("invisible monster must have moved.");
562 pline_The("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82Í
\88Ú
\93®
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
568 You_hear(hollow_str, "door");
570 You_hear(hollow_str, "
\94à");
571 cvt_sdoor_to_door(lev); /* ->typ = DOOR */
576 You_hear(hollow_str, "passage");
578 You_hear(hollow_str, "
\92Ê
\98H");
580 unblock_point(rx, ry);
585 if (!its_dead(rx, ry, &res))
587 You("hear nothing special."); /* not You_hear() */
589 pline("
\93Á
\82É
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81D");
595 static const char whistle_str[] = "produce a %s whistling sound.";
597 static const char whistle_str[] = "
\93J
\82ð
\90\81\82¢
\82Ä%s
\89¹
\82ð
\82½
\82Ä
\82½
\81D";
603 if (!can_blow(&youmonst)) {
605 You("are incapable of using the whistle.");
607 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
608 } else if (Underwater) {
610 You("blow bubbles through %s.", yname(obj));
612 You("%s
\82ð
\92Ê
\82µ
\82Ä
\96A
\82ð
\8fo
\82µ
\82½
\81D", xname(obj));
616 You_feel("rushing air tickle your %s.",
619 You_feel("
\8bó
\8bC
\82Ì
\97¬
\82ê
\82ª%s
\82ð
\82
\82·
\82®
\82Á
\82½
\81D",
624 You(whistle_str, obj->cursed ? "shrill" : "high");
626 You(whistle_str, obj->cursed ? "
\95s
\8bC
\96¡
\82È" : "
\82©
\82ñ
\8d\82\82¢");
634 use_magic_whistle(obj)
637 register struct monst *mtmp, *nextmon;
639 if (!can_blow(&youmonst)) {
641 You("are incapable of using the whistle.");
643 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
644 } else if (obj->cursed && !rn2(2)) {
646 You("produce a %shigh-pitched humming noise.",
647 Underwater ? "very " : "");
649 You("%s
\8d\82\82¢
\92²
\8eq
\82Ì
\82¤
\82È
\82é
\82æ
\82¤
\82È
\89¹
\82ð
\82½
\82Ä
\82½
\81D",
650 Underwater ? "
\82Æ
\82Ä
\82à" : "");
654 int pet_cnt = 0, omx, omy;
656 /* it's magic! it works underwater too (at a higher pitch) */
659 Hallucination ? "normal" : Underwater ? "strange, high-pitched"
663 Hallucination ? "
\93J
\82Ì
\82æ
\82¤
\82È" : Underwater ? "
\95s
\8ev
\8bc
\82È
\8d\82\82¢
\92²
\8eq
\82Ì"
664 : "
\95s
\8ev
\8bc
\82È");
666 for (mtmp = fmon; mtmp; mtmp = nextmon) {
667 nextmon = mtmp->nmon; /* trap might kill mon */
668 if (DEADMONSTER(mtmp))
670 /* steed is already at your location, so not affected;
671 this avoids trap issues if you're on a trap location */
672 if (mtmp == u.usteed)
675 if (mtmp->mtrapped) {
676 /* no longer in previous trap (affects mintrap) */
678 fill_pit(mtmp->mx, mtmp->my);
680 /* mimic must be revealed before we know whether it
681 actually moves because line-of-sight may change */
684 omx = mtmp->mx, omy = mtmp->my;
686 if (mtmp->mx != omx || mtmp->my != omy) {
687 mtmp->mundetected = 0; /* reveal non-mimic hider */
688 if (canspotmon(mtmp))
690 if (mintrap(mtmp) == 2)
696 makeknown(obj->otyp);
704 return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
713 for (obj = invent; obj; obj = obj->nobj)
714 if (obj->otyp == LEASH && obj->leashmon != 0)
719 /* otmp is about to be destroyed or stolen */
722 register struct obj *otmp;
724 register struct monst *mtmp;
726 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
727 if (mtmp->m_id == (unsigned) otmp->leashmon)
732 /* mtmp is about to die, or become untame */
734 m_unleash(mtmp, feedback)
735 register struct monst *mtmp;
738 register struct obj *otmp;
743 pline("%s pulls free of %s leash!", Monnam(mtmp), mhis(mtmp));
745 pline("%s
\82Í
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82Ä
\93¦
\82ê
\82½
\81I", Monnam(mtmp));
748 Your("leash falls slack.");
750 Your("
\95R
\82ª
\82½
\82é
\82ñ
\82Å
\97\8e\82¿
\82½
\81D");
752 for (otmp = invent; otmp; otmp = otmp->nobj)
753 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
758 /* player is about to die (for bones) */
762 register struct obj *otmp;
763 register struct monst *mtmp;
765 for (otmp = invent; otmp; otmp = otmp->nobj)
766 if (otmp->otyp == LEASH)
768 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
775 * This ought to exclude various other things, such as lights and gas
776 * spore, is_whirly() critters, ethereal creatures, possibly others.
782 return (boolean) (mtmp->mnum != PM_LONG_WORM);
795 /* if the leash isn't in use, assume we're trying to leash
796 the engulfer; if it is use, distinguish between removing
797 it from the engulfer versus from some other creature
798 (note: the two in-use cases can't actually occur; all
799 leashes are released when the hero gets engulfed) */
801 You_cant((!obj->leashmon
802 ? "leash %s from inside."
803 : (obj->leashmon == (int) u.ustuck->m_id)
804 ? "unleash %s from inside."
805 : "unleash anything from inside %s."),
806 noit_mon_nam(u.ustuck));
808 You_cant((!obj->leashmon
809 ? "
\93à
\91¤
\82©
\82ç%s
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"
810 : (obj->leashmon == (int) u.ustuck->m_id)
811 ? "
\93à
\91¤
\82©
\82ç%s
\82ð
\8aO
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"
812 : "%s
\82Ì
\93à
\91¤
\82©
\82ç
\8aO
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"),
813 noit_mon_nam(u.ustuck));
817 if (!obj->leashmon && number_leashed() >= MAXLEASHED) {
819 You("cannot leash any more pets.");
821 You("
\82±
\82ê
\88È
\8fã
\83y
\83b
\83g
\82É
\95R
\82ð
\82©
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
825 if (!get_adjacent_loc((char *) 0, (char *) 0, u.ux, u.uy, &cc))
828 if (cc.x == u.ux && cc.y == u.uy) {
829 if (u.usteed && u.dz > 0) {
835 pline("Leash yourself? Very funny...");
837 pline("
\8e©
\95ª
\82ð
\94\9b\82é
\81H
\95Ï
\82È
\82Ì
\81D
\81D
\81D");
842 * From here on out, return value is 1 == a move is used.
845 if (!(mtmp = m_at(cc.x, cc.y))) {
847 There("is no creature there.");
849 pline("
\82»
\82±
\82É
\82Í
\90¶
\82«
\95¨
\82Í
\82¢
\82È
\82¢
\81D");
850 (void) unmap_invisible(cc.x, cc.y);
854 spotmon = canspotmon(mtmp);
857 if (!spotmon && !glyph_is_invisible(levl[cc.x][cc.y].glyph)) {
858 /* for the unleash case, we don't verify whether this unseen
859 monster is the creature attached to the current leash */
861 You("fail to %sleash something.", obj->leashmon ? "un" : "");
863 You("%s
\82Ì
\82É
\8e¸
\94s
\82µ
\82½
\81D", obj->leashmon ? "
\8aO
\82·" : "
\8c\8b\82Ñ
\82Â
\82¯
\82é");
864 /* trying again will work provided the monster is tame
865 (and also that it doesn't change location by retry time) */
866 map_invisible(cc.x, cc.y);
867 } else if (!mtmp->mtame) {
869 pline("%s %s leashed!", Monnam(mtmp),
870 (!obj->leashmon) ? "cannot be" : "is not");
872 pline("%s
\82Í
\95R
\82Å%s
\81I", Monnam(mtmp),
873 (!obj->leashmon) ? "
\8c\8b\82×
\82È
\82¢" : "
\8c\8b\82Î
\82ê
\82Ä
\82¢
\82È
\82¢");
875 } else if (!obj->leashmon) {
876 /* applying a leash which isn't currently in use */
877 if (mtmp->mleashed) {
879 pline("This %s is already leashed.",
880 spotmon ? l_monnam(mtmp) : "creature");
882 pline("%s
\82Í
\82·
\82Å
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82ç
\82ê
\82Ä
\82¢
\82é
\81D",
883 spotmon ? l_monnam(mtmp) : "
\89ö
\95¨");
885 } else if (!leashable(mtmp)) {
887 pline("The leash won't fit onto %s%s.", spotmon ? "your " : "",
890 pline("
\95R
\82Í%s
\82É
\8d\87\82í
\82È
\82¢
\81D",
895 You("slip the leash around %s%s.", spotmon ? "your " : "",
898 You("%s
\82ð
\95R
\82Å
\8c\8b\82Ñ
\82Â
\82¯
\82½
\81D",
902 obj->leashmon = (int) mtmp->m_id;
906 /* applying a leash which is currently in use */
907 if (obj->leashmon != (int) mtmp->m_id) {
909 pline("This leash is not attached to that creature.");
911 pline("
\82±
\82Ì
\95R
\82Í
\82»
\82ê
\82É
\82Í
\8c\8b\82Î
\82ê
\82Ä
\82¢
\82È
\82¢
\81D");
912 } else if (obj->cursed) {
914 pline_The("leash would not come off!");
916 pline("
\95R
\82ª
\82Í
\82¸
\82ê
\82È
\82¢
\81I");
922 You("remove the leash from %s%s.",
923 spotmon ? "your " : "", l_monnam(mtmp));
925 You("%s
\82©
\82ç
\95R
\82ð
\82Í
\82¸
\82µ
\82½
\81D",
933 /* assuming mtmp->mleashed has been checked */
942 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
946 return (struct obj *) 0;
952 register struct monst *mtmp;
953 register struct obj *otmp;
955 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
956 if (DEADMONSTER(mtmp))
958 if (mtmp->mleashed) {
959 if (distu(mtmp->mx, mtmp->my) > 2)
961 if (distu(mtmp->mx, mtmp->my) > 2) {
962 for (otmp = invent; otmp; otmp = otmp->nobj)
963 if (otmp->otyp == LEASH
964 && otmp->leashmon == (int) mtmp->m_id) {
968 You_feel("%s leash go slack.",
969 (number_leashed() > 1) ? "a" : "the");
971 You("
\95R
\82ª
\82½
\82é
\82ñ
\82¾
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
979 /* no pack mules for the Amulet */
980 if (u.usteed && mon_has_amulet(u.usteed))
989 register struct obj *otmp;
990 register struct monst *mtmp;
992 for (otmp = invent; otmp; otmp = otmp->nobj) {
993 if (otmp->otyp != LEASH || otmp->leashmon == 0)
995 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
996 if (DEADMONSTER(mtmp))
998 if ((int) mtmp->m_id == otmp->leashmon)
1002 impossible("leash in use isn't attached to anything?");
1006 if (dist2(u.ux, u.uy, mtmp->mx, mtmp->my)
1007 > dist2(x, y, mtmp->mx, mtmp->my)) {
1008 if (!um_dist(mtmp->mx, mtmp->my, 3)) {
1009 ; /* still close enough */
1010 } else if (otmp->cursed && !breathless(mtmp->data)) {
1011 if (um_dist(mtmp->mx, mtmp->my, 5)
1012 || (mtmp->mhp -= rnd(2)) <= 0) {
1013 long save_pacifism = u.uconduct.killer;
1016 Your("leash chokes %s to death!", mon_nam(mtmp));
1018 pline("%s
\82Í
\8di
\82ß
\8eE
\82³
\82ê
\82½
\81I",mon_nam(mtmp));
1019 /* hero might not have intended to kill pet, but
1020 that's the result of his actions; gain experience,
1021 lose pacifism, take alignment and luck hit, make
1022 corpse less likely to remain tame after revival */
1023 xkilled(mtmp, XKILL_NOMSG);
1024 /* life-saving doesn't ordinarily reset this */
1026 u.uconduct.killer = save_pacifism;
1029 pline("%s is choked by the leash!", Monnam(mtmp));
1031 pline("%s
\82Í
\95R
\82Å
\8eñ
\82ð
\8di
\82ß
\82ç
\82ê
\82½
\81I", Monnam(mtmp));
1032 /* tameness eventually drops to 1 here (never 0) */
1033 if (mtmp->mtame && rn2(mtmp->mtame))
1037 if (um_dist(mtmp->mx, mtmp->my, 5)) {
1039 pline("%s leash snaps loose!", s_suffix(Monnam(mtmp)));
1041 pline("%s
\82Ì
\95R
\82Í
\83p
\83`
\83\93\82Æ
\8aO
\82ê
\82½
\81I", Monnam(mtmp));
1042 m_unleash(mtmp, FALSE);
1045 You("pull on the leash.");
1047 You("
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82½
\81D");
1048 if (mtmp->data->msound != MS_SILENT)
1069 return ((ACURR(A_CHA) > 14)
1070 ? ((poly_gender() == 1)
1076 /*JP
\8cê
\8a²
\82Å
\8eg
\82¤ */
1084 static const char look_str[] = "look %s.";
1086 static const char look_str[] = "%s
\8c©
\82¦
\82é
\81D";
1092 const char *mirror, *uvisage;
1096 boolean vis, invis_mirror, useeit, monable;
1098 if (!getdir((char *) 0))
1100 invis_mirror = Invis;
1101 useeit = !Blind && (!invis_mirror || See_invisible);
1102 uvisage = beautiful();
1103 mirror = simpleonames(obj); /* "mirror" or "looking glass" */
1104 if (obj->cursed && !rn2(2)) {
1107 pline_The("%s fogs up and doesn't reflect!", mirror);
1109 pline("%s
\82Í
\93Ü
\82è
\81C
\89f
\82ç
\82È
\82
\82È
\82Á
\82½
\81I", mirror);
1112 if (!u.dx && !u.dy && !u.dz) {
1115 You_cant("see your %s %s.", uvisage, body_part(FACE));
1117 You_cant("
\8e©
\95ª
\82Ì%s
\82¢%s
\82ð
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", uvisage, body_part(FACE));
1119 if (u.umonnum == PM_FLOATING_EYE) {
1122 You("stiffen momentarily under your gaze.");
1124 pline("
\88ê
\8fu
\82 \82È
\82½
\82Ì
\82É
\82ç
\82Ý
\82Å
\8dd
\92¼
\82µ
\82½
\81D");
1128 pline("Yow! The %s stares back!", mirror);
1130 pline("
\82¨
\82ì
\81I%s
\82ª
\82 \82È
\82½
\82ð
\82É
\82ç
\82Ý
\95Ô
\82µ
\82½
\81I", mirror);
1133 pline("Yikes! You've frozen yourself!");
1135 pline("
\82¨
\82ì
\81I
\82 \82È
\82½
\82Í
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
1136 if (!Hallucination || !rn2(4)) {
1137 nomul(-rnd(MAXULEV + 6 - u.ulevel));
1139 multi_reason = "gazing into a mirror";
1141 multi_reason = "
\8b¾
\82É
\94½
\8eË
\82µ
\82½
\8e\8b\90ü
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8aÔ
\82É";
1143 nomovemsg = 0; /* default, "you can move again" */
1145 } else if (youmonst.data->mlet == S_VAMPIRE)
1147 You("don't have a reflection.");
1149 You("
\8b¾
\82É
\89f
\82ç
\82È
\82©
\82Á
\82½
\81D");
1150 else if (u.umonnum == PM_UMBER_HULK) {
1152 pline("Huh? That doesn't look like you!");
1154 pline("
\82Ù
\82¦
\81H
\8eÊ
\82Á
\82Ä
\82é
\82Ì
\82Í
\82 \82È
\82½
\82¶
\82á
\82È
\82¢
\82Ý
\82½
\82¢
\82¾
\81I");
1155 make_confused(HConfusion + d(3, 4), FALSE);
1156 } else if (Hallucination)
1157 You(look_str, hcolor((char *) 0));
1160 You(look_str, "peaked");
1162 You(look_str, "
\8aç
\90F
\82ª
\88«
\82");
1163 else if (u.uhs >= WEAK)
1165 You(look_str, "undernourished");
1167 You(look_str, "
\89h
\97{
\8e¸
\92²
\82Ì
\82æ
\82¤
\82É");
1170 You("look as %s as ever.", uvisage);
1172 You("
\82 \82¢
\82©
\82í
\82ç
\82¸%s
\82
\8c©
\82¦
\82é
\81D", uvisage);
1179 You("reflect %s %s.", s_suffix(mon_nam(u.ustuck)),
1180 mbodypart(u.ustuck, STOMACH));
1182 You("%s
\82Ì%s
\82ð
\89f
\82µ
\82½
\81D", mon_nam(u.ustuck),
1183 mbodypart(u.ustuck, STOMACH));
1190 You(Hallucination ? "give the fish a chance to fix their makeup."
1191 : "reflect the murky water.");
1193 You(Hallucination ? "
\8b\9b\82É
\89»
\8fÏ
\92¼
\82µ
\82Ì
\8b@
\89ï
\82ð
\97^
\82¦
\82½
\81D"
1194 : "
\82 \82È
\82½
\82Í
\97\84\82ñ
\82¾
\90\85\82ð
\89f
\82µ
\82½
\81D");
1201 You("reflect the %s.",
1203 You("%s
\82ð
\89f
\82µ
\82½
\81D",
1204 (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
1207 mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
1208 (int FDECL((*), (MONST_P, OBJ_P))) 0,
1209 (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
1210 if (!mtmp || !haseyes(mtmp->data) || notonhead)
1213 /* couldsee(mtmp->mx, mtmp->my) is implied by the fact that bhit()
1214 targetted it, so we can ignore possibility of X-ray vision */
1215 vis = canseemon(mtmp);
1216 /* ways to directly see monster (excludes X-ray vision, telepathy,
1217 extended detection, type-specific warning) */
1218 #define SEENMON (MONSEEN_NORMAL | MONSEEN_SEEINVIS | MONSEEN_INFRAVIS)
1219 how_seen = vis ? howmonseen(mtmp) : 0;
1220 /* whether monster is able to use its vision-based capabilities */
1221 monable = !mtmp->mcan && (!mtmp->minvis || perceives(mtmp->data));
1222 mlet = mtmp->data->mlet;
1223 if (mtmp->msleeping) {
1226 pline("%s is too tired to look at your %s.", Monnam(mtmp),
1228 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),
1230 } else if (!mtmp->mcansee) {
1233 pline("%s can't see anything right now.", Monnam(mtmp));
1235 pline("%s
\82Í
\8d¡
\82Ì
\82Æ
\82±
\82ë
\89½
\82à
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", Monnam(mtmp));
1236 } else if (invis_mirror && !perceives(mtmp->data)) {
1239 pline("%s fails to notice your %s.", Monnam(mtmp), mirror);
1241 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82É
\8bC
\95t
\82©
\82È
\82©
\82Á
\82½
\81D", Monnam(mtmp), mirror);
1242 /* infravision doesn't produce an image in the mirror */
1243 } else if ((how_seen & SEENMON) == MONSEEN_INFRAVIS) {
1244 if (vis) /* (redundant) */
1246 pline("%s is too far away to see %sself in the dark.",
1247 Monnam(mtmp), mhim(mtmp));
1249 pline("%s
\82Í
\88Ã
\88Å
\82Å
\8e©
\95ª
\8e©
\90g
\82ð
\8c©
\82é
\82É
\82Í
\89\93\82·
\82¬
\82é
\81D", Monnam(mtmp));
1251 /* some monsters do special things */
1252 } else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
1255 pline("%s doesn't have a reflection.", Monnam(mtmp));
1257 pline("%s
\82Í%s
\82É
\89f
\82ç
\82È
\82¢
\81D", Monnam(mtmp), mirror);
1258 } else if (monable && mtmp->data == &mons[PM_MEDUSA]) {
1260 if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
1262 if (mon_reflects(mtmp, "
\82É
\82ç
\82Ý
\82Í%s
\82Ì%s
\82Å
\94½
\8eË
\82µ
\82½
\81I"))
1266 pline("%s is turned to stone!", Monnam(mtmp));
1268 pline("%s
\82Í
\90Î
\82É
\82È
\82Á
\82½
\81I", Monnam(mtmp));
1271 } else if (monable && mtmp->data == &mons[PM_FLOATING_EYE]) {
1272 int tmp = d((int) mtmp->m_lev, (int) mtmp->data->mattk[0].damd);
1277 pline("%s is frozen by its reflection.", Monnam(mtmp));
1279 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\8c©
\82Ä
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D", Monnam(mtmp));
1282 You_hear("%s stop moving.", something);
1284 You_hear("
\89½
\82©
\82ª
\93®
\82«
\82ð
\82Æ
\82ß
\82½
\89¹
\82ð
\95·
\82¢
\82½
\81D");
1285 paralyze_monst(mtmp, (int) mtmp->mfrozen + tmp);
1286 } else if (monable && mtmp->data == &mons[PM_UMBER_HULK]) {
1289 pline("%s confuses itself!", Monnam(mtmp));
1291 pline("%s
\82Í
\8d¬
\97\90\82µ
\82½
\81I", Monnam(mtmp));
1293 } else if (monable && (mlet == S_NYMPH || mtmp->data == &mons[PM_SUCCUBUS]
1294 || mtmp->data == &mons[PM_INCUBUS])) {
1296 char buf[BUFSZ]; /* "She" or "He" */
1299 pline("%s admires %sself in your %s.", Monnam(mtmp), mhim(mtmp),
1302 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\82¤
\82Á
\82Æ
\82è
\82µ
\82½
\81D", Monnam(mtmp));
1305 pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
1307 pline("%s
\82Í
\82»
\82ê
\82ð
\92D
\82Á
\82½
\81I", upstart(strcpy(buf, mhe(mtmp))));
1310 pline("It steals your %s!", mirror);
1312 pline("
\89½
\8eÒ
\82©
\82ª
\82 \82È
\82½
\82Ì%s
\82ð
\93\90\82ñ
\82¾
\81I", mirror);
1313 setnotworn(obj); /* in case mirror was wielded */
1315 (void) mpickobj(mtmp, obj);
1316 if (!tele_restrict(mtmp))
1317 (void) rloc(mtmp, TRUE);
1318 } else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
1319 && (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
1322 pline("%s is frightened by its reflection.", Monnam(mtmp));
1324 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\8c©
\82Ä
\95|
\82ª
\82Á
\82½
\81D", Monnam(mtmp));
1325 monflee(mtmp, d(2, 4), FALSE, FALSE);
1326 } else if (!Blind) {
1327 if (mtmp->minvis && !See_invisible)
1329 else if ((mtmp->minvis && !perceives(mtmp->data))
1330 /* redundant: can't get here if these are true */
1331 || !haseyes(mtmp->data) || notonhead || !mtmp->mcansee)
1333 pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
1336 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\8bC
\82ª
\82Â
\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mtmp));
1340 pline("%s ignores %s reflection.", Monnam(mtmp), mhis(mtmp));
1342 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\96³
\8e\8b\82µ
\82½
\81D", Monnam(mtmp));
1351 register struct obj *obj = *optr;
1353 boolean wakem = FALSE, learno = FALSE,
1354 ordinary = (obj->otyp != BELL_OF_OPENING || !obj->spe),
1356 (obj->otyp == BELL_OF_OPENING && invocation_pos(u.ux, u.uy)
1357 && !On_stairs(u.ux, u.uy));
1360 You("ring %s.", the(xname(obj)));
1362 You("%s
\82ð
\96Â
\82ç
\82µ
\82½
\81D", the(xname(obj)));
1364 if (Underwater || (u.uswallow && ordinary)) {
1366 amii_speaker(obj, "AhDhGqEqDhEhAqDqFhGw", AMII_MUFFLED_VOLUME);
1369 pline("But the sound is muffled.");
1371 pline("
\82µ
\82©
\82µ
\89¹
\82Í
\82©
\82«
\8fÁ
\82³
\82ê
\82½
\81D");
1373 } else if (invoking && ordinary) {
1374 /* needs to be recharged... */
1376 pline("But it makes no sound.");
1378 pline("
\82µ
\82©
\82µ
\81C
\89¹
\82Í
\96Â
\82ç
\82È
\82©
\82Á
\82½
\81D");
1379 learno = TRUE; /* help player figure out why */
1381 } else if (ordinary) {
1383 amii_speaker(obj, "ahdhgqeqdhehaqdqfhgw", AMII_MUFFLED_VOLUME);
1385 if (obj->cursed && !rn2(4)
1386 /* note: once any of them are gone, we stop all of them */
1387 && !(mvitals[PM_WOOD_NYMPH].mvflags & G_GONE)
1388 && !(mvitals[PM_WATER_NYMPH].mvflags & G_GONE)
1389 && !(mvitals[PM_MOUNTAIN_NYMPH].mvflags & G_GONE)
1390 && (mtmp = makemon(mkclass(S_NYMPH, 0), u.ux, u.uy, NO_MINVENT))
1393 You("summon %s!", a_monnam(mtmp));
1395 You("%s
\82ð
\8f¢
\8a«
\82µ
\82½
\81I", a_monnam(mtmp));
1396 if (!obj_resists(obj, 93, 100)) {
1398 pline("%s shattered!", Tobjnam(obj, "have"));
1400 pline("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", xname(obj));
1408 mon_adjust_speed(mtmp, 2, (struct obj *) 0);
1410 case 2: /* no explanation; it just happens... */
1412 multi_reason = NULL;
1420 /* charged Bell of Opening */
1421 consume_obj_charge(obj, TRUE);
1427 pline1(nothing_happens);
1429 } else if (obj->cursed) {
1434 mkundead(&mm, FALSE, NO_MINVENT);
1437 } else if (invoking) {
1439 pline("%s an unsettling shrill sound...", Tobjnam(obj, "issue"));
1441 pline("%s
\82Í
\95s
\8bC
\96¡
\82È
\89s
\82¢
\89¹
\82ð
\8fo
\82µ
\82½
\81D
\81D
\81D", xname(obj));
1443 amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
1449 } else if (obj->blessed) {
1453 amii_speaker(obj, "ahahahDhEhCw", AMII_SOFT_VOLUME);
1458 } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1459 buried_ball_to_freedom();
1465 pline1(nothing_happens);
1469 pline("%s opens...", Something);
1471 pline("
\89½
\82©
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1476 pline("Things open around you...");
1478 pline("
\82Ü
\82í
\82è
\82Ì
\95¨
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1483 } else { /* uncursed */
1485 amii_speaker(obj, "AeFeaeFeAefegw", AMII_OKAY_VOLUME);
1490 pline1(nothing_happens);
1493 } /* charged BofO */
1496 makeknown(BELL_OF_OPENING);
1504 use_candelabrum(obj)
1505 register struct obj *obj;
1507 #if 0 /*JP*//* not used */
1508 const char *s = (obj->spe != 1) ? "candles" : "candle";
1513 You("snuff the %s.", s);
1515 You("
\82ë
\82¤
\82»
\82
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1516 end_burn(obj, TRUE);
1519 if (obj->spe <= 0) {
1521 pline("This %s has no %s.", xname(obj), s);
1523 pline("
\82±
\82Ì%s
\82É
\82Í
\82ë
\82¤
\82»
\82
\82ª
\82È
\82¢
\81D", xname(obj));
1528 You("cannot make fire under water.");
1530 You("
\90\85\92\86\82Å
\89Î
\82ð
\82¨
\82±
\82¹
\82È
\82¢
\81D");
1533 if (u.uswallow || obj->cursed) {
1536 pline_The("%s %s for a moment, then %s.", s, vtense(s, "flicker"),
1539 pline("
\82ë
\82¤
\82»
\82
\82Ì
\89\8a\82Í
\82µ
\82Î
\82ç
\82
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D");
1545 There("%s only %d %s in %s.", vtense(s, "are"), obj->spe, s,
1548 pline("%s
\82É
\82Í
\82½
\82Á
\82½%d
\96{
\82Ì
\82ë
\82¤
\82»
\82
\82µ
\82©
\82È
\82¢
\81D",
1549 xname(obj), obj->spe);
1553 pline("%s lit. %s dimly.", obj->spe == 1 ? "It is" : "They are",
1554 Tobjnam(obj, "shine"));
1556 pline("%s
\82É
\89Î
\82ð
\82Â
\82¯
\82½
\81D%s
\82Í
\82Ù
\82Ì
\82©
\82É
\8bP
\82¢
\82½
\81D",
1557 xname(obj), xname(obj));
1561 pline("%s's %s burn%s", The(xname(obj)), s,
1562 (Blind ? "." : " brightly!"));
1564 pline("%s
\82Ì
\82ë
\82¤
\82»
\82
\82Í%s
\94R
\82¦
\82 \82ª
\82Á
\82½
\81I", The(xname(obj)),
1565 (Blind ? "" : "
\96¾
\82é
\82"));
1568 if (!invocation_pos(u.ux, u.uy) || On_stairs(u.ux, u.uy)) {
1570 pline_The("%s %s being rapidly consumed!", s, vtense(s, "are"));
1572 pline("
\82ë
\82¤
\82»
\82
\82Í
\82·
\82²
\82¢
\91¬
\82³
\82Å
\94R
\82¦
\8en
\82ß
\82½
\81I");
1573 /* this used to be obj->age /= 2, rounding down; an age of
1574 1 would yield 0, confusing begin_burn() and producing an
1575 unlightable, unrefillable candelabrum; round up instead */
1576 obj->age = (obj->age + 1L) / 2L;
1578 if (obj->spe == 7) {
1581 pline("%s a strange warmth!", Tobjnam(obj, "radiate"));
1583 pline("
\8aï
\96
\82È
\92g
\82©
\82³
\82ð%s
\82É
\8a´
\82¶
\82½
\81I", xname(obj));
1586 pline("%s with a strange light!", Tobjnam(obj, "glow"));
1588 pline("%s
\82Í
\8aï
\96
\82È
\8cõ
\82ð
\94
\82µ
\82Ä
\82¢
\82é
\81I", xname(obj));
1592 begin_burn(obj, FALSE);
1599 register struct obj *obj = *optr;
1600 register struct obj *otmp;
1602 const char *s = (obj->quan != 1) ? "candles" : "candle";
1604 const char *s = "
\82ë
\82¤
\82»
\82";
1605 char qbuf[QBUFSZ], qsfx[QBUFSZ], *q;
1612 otmp = carrying(CANDELABRUM_OF_INVOCATION);
1613 if (!otmp || otmp->spe == 7) {
1618 /*JP:
\8dÅ
\8fI
\93I
\82É
\82Í
\81u
\82ë
\82¤
\82»
\82
\82ð
\90C
\91ä
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H
\81v*/
1619 /* first, minimal candelabrum suffix for formatting candles */
1621 Sprintf(qsfx, " to\033%s?", thesimpleoname(otmp));
1623 Sprintf(qsfx, "
\82ð\033%s
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H", thesimpleoname(otmp));
1624 /* next, format the candles as a prefix for the candelabrum */
1626 (void) safe_qbuf(qbuf, "Attach ", qsfx, obj, yname, thesimpleoname, s);
1628 (void) safe_qbuf(qbuf, "", qsfx, obj, xname, thesimpleoname, s);
1629 /*JP:
\81u(
\82ë
\82¤
\82»
\82)
\82ð\033
\90C
\91ä
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H
\81v*/
1630 /* strip temporary candelabrum suffix */
1632 if ((q = strstri(qbuf, " to\033")) != 0)
1635 if ((q = strchr(qbuf, '\033')) != 0)
1637 /*JP:
\81u(
\82ë
\82¤
\82»
\82)
\82ð
\81v*/
1639 /* last, format final "attach candles to candelabrum?" query */
1641 if (yn(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
1643 if (yn(safe_qbuf(qbuf, qbuf, "
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H", otmp, xname, thesimpleoname, "
\82»
\82ê"))
1648 if ((long) otmp->spe + obj->quan > 7L) {
1649 obj = splitobj(obj, 7L - (long) otmp->spe);
1650 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\95s
\97v*/
1651 /* avoid a grammatical error if obj->quan gets
1652 reduced to 1 candle from more than one */
1653 s = (obj->quan != 1) ? "candles" : "candle";
1658 You("attach %ld%s %s to %s.", obj->quan, !otmp->spe ? "" : " more", s,
1661 You("%ld
\96{
\82Ì
\82ë
\82¤
\82»
\82
\82ð%s%s
\82Ö
\8eæ
\82è
\82Â
\82¯
\82½
\81D",
1662 obj->quan, !otmp->spe ? "" : "
\82³
\82ç
\82É",
1665 if (!otmp->spe || otmp->age > obj->age)
1666 otmp->age = obj->age;
1667 otmp->spe += (int) obj->quan;
1668 if (otmp->lamplit && !obj->lamplit)
1670 pline_The("new %s magically %s!", s, vtense(s, "ignite"));
1672 pline("
\90V
\82µ
\82¢
\82ë
\82¤
\82»
\82
\82Í
\95s
\8ev
\8bc
\82È
\89\8a\82ð
\82 \82°
\82½
\81I");
1673 else if (!otmp->lamplit && obj->lamplit)
1675 pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
1677 pline("
\89\8a\82Í
\8fÁ
\82¦
\82½
\81D");
1680 verbalize("You %s %s, you bought %s!",
1681 otmp->lamplit ? "burn" : "use",
1682 (obj->quan > 1L) ? "them" : "it",
1683 (obj->quan > 1L) ? "them" : "it");
1685 verbalize("
\89Î
\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1687 if (obj->quan < 7L && otmp->spe == 7)
1689 pline("%s now has seven%s candles attached.", The(xname(otmp)),
1690 otmp->lamplit ? " lit" : "");
1692 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",
1693 The(xname(otmp)), otmp->lamplit ? "
\89Î
\82Ì
\82Â
\82¢
\82½" : "");
1695 /* candelabrum's light range might increase */
1697 obj_merge_light_sources(otmp, otmp);
1698 /* candles are no longer a separate light source */
1700 end_burn(obj, TRUE);
1701 /* candles are now gone */
1703 /* candelabrum's weight is changing */
1704 otmp->owt = weight(otmp);
1709 /* call in drop, throw, and put in box, etc. */
1714 boolean candle = Is_candle(otmp);
1716 if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
1720 #if 0 /*JP*//* not used */
1721 boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
1724 (void) get_obj_location(otmp, &x, &y, 0);
1725 if (otmp->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1727 pline("%s%scandle%s flame%s extinguished.", Shk_Your(buf, otmp),
1728 (candle ? "" : "candelabrum's "), (many ? "s'" : "'s"),
1729 (many ? "s are" : " is"));
1731 pline("%s%s
\82ë
\82¤
\82»
\82
\82Ì
\89\8a\82Í
\8fÁ
\82¦
\82½
\81D", Shk_Your(buf, otmp),
1732 candle ? "" : "
\90C
\91ä
\82Ì");
1734 end_burn(otmp, TRUE);
1740 /* called when lit lamp is hit by water or put into a container or
1741 you've been swallowed by a monster; obj might be in transit while
1742 being thrown or dropped so don't assume that its location is valid */
1750 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1751 || obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL) {
1752 (void) get_obj_location(obj, &x, &y, 0);
1753 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1755 pline("%s %s out!", Yname2(obj), otense(obj, "go"));
1757 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81I", Yname2(obj));
1758 end_burn(obj, TRUE);
1761 if (snuff_candle(obj))
1767 /* Called when potentially lightable object is affected by fire_damage().
1768 Return TRUE if object was lit and FALSE otherwise --ALI */
1775 if (!obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) {
1776 if ((obj->otyp == MAGIC_LAMP
1777 || obj->otyp == CANDELABRUM_OF_INVOCATION) && obj->spe == 0)
1779 else if (obj->otyp != MAGIC_LAMP && obj->age == 0)
1781 if (!get_obj_location(obj, &x, &y, 0))
1783 if (obj->otyp == CANDELABRUM_OF_INVOCATION && obj->cursed)
1785 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1786 || obj->otyp == BRASS_LANTERN) && obj->cursed && !rn2(2))
1788 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1790 pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
1792 pline("%s
\82Ì
\96¾
\82©
\82è
\82ª
\82Â
\82¢
\82½
\81I", Yname2(obj));
1793 if (obj->otyp == POT_OIL)
1794 makeknown(obj->otyp);
1795 if (carried(obj) && obj->unpaid && costly_spot(u.ux, u.uy)) {
1796 /* if it catches while you have it, then it's your tough luck */
1799 verbalize("That's in addition to the cost of %s %s, of course.",
1800 yname(obj), obj->quan == 1L ? "itself" : "themselves");
1802 verbalize("
\82±
\82ê
\82Í
\82à
\82¿
\82ë
\82ñ%s
\82Ì
\92l
\92i
\82Æ
\82Í
\95Ê
\82¾
\82æ
\81D", xname(obj));
1804 bill_dummy_object(obj);
1806 begin_burn(obj, FALSE);
1819 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1820 || obj->otyp == BRASS_LANTERN)
1822 pline("%slamp is now off.", Shk_Your(buf, obj));
1824 pline("%s
\83\89\83\93\83v
\82Ì
\93\94\82Í
\8fÁ
\82¦
\82½
\81D", Shk_Your(buf, obj));
1827 You("snuff out %s.", yname(obj));
1829 You("%s
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D", xname(obj));
1830 end_burn(obj, TRUE);
1835 pline(!Is_candle(obj) ? "This is not a diving lamp"
1836 : "Sorry, fire and water don't mix.");
1838 pline(!Is_candle(obj) ? "
\82±
\82ê
\82Í
\90ö
\90\85\97p
\82Ì
\83\89\83\93\83v
\82¶
\82á
\82È
\82¢
\81D"
1839 : "
\8ec
\94O
\82È
\82ª
\82ç
\81C
\89Î
\82Æ
\90\85\82Í
\82Ü
\82´
\82ç
\82È
\82¢
\81D");
1843 /* magic lamps with an spe == 0 (wished for) cannot be lit */
1844 if ((!Is_candle(obj) && obj->age == 0)
1845 || (obj->otyp == MAGIC_LAMP && obj->spe == 0)) {
1846 if (obj->otyp == BRASS_LANTERN)
1848 Your("lamp has run out of power.");
1850 Your("
\83\89\83\93\83v
\82Ì
\93d
\97Í
\82ð
\8eg
\82¢
\90Ø
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
1853 pline("This %s has no oil.", xname(obj));
1855 pline("
\82±
\82Ì%s
\82É
\82Í
\82à
\82¤
\83I
\83C
\83\8b\82ª
\82È
\82¢
\81D", xname(obj));
1858 if (obj->cursed && !rn2(2)) {
1861 pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
1862 otense(obj, "die"));
1864 pline("%s
\82Í
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D",
1868 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1869 || obj->otyp == BRASS_LANTERN) {
1872 pline("%slamp is now on.", Shk_Your(buf, obj));
1874 pline("%s
\83\89\83\93\83v
\82É
\93\94\82ª
\93\94\82Á
\82½
\81D", Shk_Your(buf, obj));
1875 } else { /* candle(s) */
1877 pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
1878 otense(obj, "burn"), Blind ? "." : " brightly!");
1880 pline("%s
\82Í%s
\94R
\82¦
\82 \82ª
\82Á
\82½
\81I",
1881 xname(obj), Blind ? "" : "
\96¾
\82é
\82");
1883 if (obj->unpaid && costly_spot(u.ux, u.uy)
1884 && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
1886 const char *ithem = (obj->quan > 1L) ? "them" : "it";
1888 verbalize("You burn %s, you bought %s!", ithem, ithem);
1890 verbalize("
\93\94\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1892 bill_dummy_object(obj);
1895 begin_burn(obj, FALSE);
1900 light_cocktail(optr)
1903 struct obj *obj = *optr; /* obj is a potion of oil */
1914 You("snuff the lit potion.");
1916 You("
\96û
\95r
\82Ì
\89Î
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1917 end_burn(obj, TRUE);
1919 * Free & add to re-merge potion. This will average the
1920 * age of the potions. Not exactly the best solution,
1924 *optr = addinv(obj);
1926 } else if (Underwater) {
1928 There("is not enough oxygen to sustain a fire.");
1930 pline("
\89Î
\82ð
\82Â
\82¯
\82é
\82Ì
\82É
\8f\
\95ª
\82È
\8e_
\91f
\82ª
\82È
\82¢
\81D");
1934 split1off = (obj->quan > 1L);
1936 obj = splitobj(obj, 1L);
1939 You("light %spotion.%s", shk_your(buf, obj),
1940 Blind ? "" : " It gives off a dim light.");
1942 You("%s
\96û
\95r
\82É
\89Î
\82ð
\82Â
\82¯
\82½
\81D%s", shk_your(buf, obj),
1943 Blind ? "" : "
\96û
\95r
\82Í
\88Ã
\82¢
\8cõ
\82ð
\82Í
\82È
\82Á
\82½
\81D");
1946 if (obj->unpaid && costly_spot(u.ux, u.uy)) {
1947 /* Normally, we shouldn't both partially and fully charge
1948 * for an item, but (Yendorian Fuel) Taxes are inevitable...
1952 verbalize("That's in addition to the cost of the potion, of course.");
1954 verbalize("
\82±
\82ê
\82Í
\82à
\82¿
\82ë
\82ñ
\96û
\95r
\82Ì
\92l
\92i
\82Æ
\82Í
\95Ê
\82¾
\82æ
\81D");
1955 bill_dummy_object(obj);
1957 makeknown(obj->otyp);
1959 begin_burn(obj, FALSE); /* after shop billing */
1961 obj_extract_self(obj); /* free from inv */
1964 obj = hold_another_object(obj, "You drop %s!", doname(obj),
1966 obj = hold_another_object(obj, "
\82 \82È
\82½
\82Í%s
\82ð
\97\8e\82µ
\82½
\81I", doname(obj),
1974 static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
1979 struct obj *obj = getobj(cuddly, "rub");
1981 if (obj && obj->oclass == GEM_CLASS) {
1982 if (is_graystone(obj)) {
1987 pline("Sorry, I don't know how to use that.");
1989 pline("
\8ec
\94O
\81D
\8eg
\82¢
\95û
\82ª
\82í
\82©
\82ç
\82È
\82¢
\81D");
1994 if (!obj || !wield_tool(obj, "rub"))
1997 /* now uwep is obj */
1998 if (uwep->otyp == MAGIC_LAMP) {
1999 if (uwep->spe > 0 && !rn2(3)) {
2000 check_unpaid_usage(uwep, TRUE); /* unusual item use */
2001 /* bones preparation: perform the lamp transformation
2002 before releasing the djinni in case the latter turns out
2003 to be fatal (a hostile djinni has no chance to attack yet,
2004 but an indebted one who grants a wish might bestow an
2005 artifact which blasts the hero with lethal results) */
2006 uwep->otyp = OIL_LAMP;
2007 uwep->spe = 0; /* for safety */
2008 uwep->age = rn1(500, 1000);
2010 begin_burn(uwep, TRUE);
2011 djinni_from_bottle(uwep);
2012 makeknown(MAGIC_LAMP);
2014 } else if (rn2(2)) {
2016 You("%s smoke.", !Blind ? "see a puff of" : "smell");
2018 pline("
\82¯
\82Þ
\82è%s
\81D", !Blind ? "
\82ª
\95\91\82¢
\82 \82ª
\82Á
\82½" : "
\82Ì
\93õ
\82¢
\82ª
\82µ
\82½");
2020 pline1(nothing_happens);
2021 } else if (obj->otyp == BRASS_LANTERN) {
2022 /* message from Adventure */
2024 pline("Rubbing the electric lamp is not particularly rewarding.");
2026 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");
2028 pline("Anyway, nothing exciting happens.");
2030 pline("
\82â
\82Á
\82Ï
\82è
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D");
2032 pline1(nothing_happens);
2043 enum jump_trajectory {
2044 jAny = 0, /* any direction => magical jump */
2047 jDiag = 3 /* jHorz|jVert */
2050 /* callback routine for walk_path() */
2052 check_jump(arg, x, y)
2056 int traj = *(int *) arg;
2057 struct rm *lev = &levl[x][y];
2061 if (IS_STWALL(lev->typ))
2063 if (IS_DOOR(lev->typ)) {
2064 if (closed_door(x, y))
2066 if ((lev->doormask & D_ISOPEN) != 0 && traj != jAny
2067 /* reject diagonal jump into or out-of or through open door */
2069 /* reject horizontal jump through horizontal open door
2070 and non-horizontal (ie, vertical) jump through
2071 non-horizontal (vertical) open door */
2072 || ((traj & jHorz) != 0) == (lev->horizontal != 0)))
2074 /* empty doorways aren't restricted */
2076 /* let giants jump over boulders (what about Flying?
2077 and is there really enough head room for giants to jump
2078 at all, let alone over something tall?) */
2079 if (sobj_at(BOULDER, x, y) && !throws_rocks(youmonst.data))
2085 is_valid_jump_pos(x, y, magic, showmsg)
2089 if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
2090 /* The Knight jumping restriction still applies when riding a
2091 * horse. After all, what shape is the knight piece in chess?
2095 pline("Illegal move!");
2097 pline("
\82»
\82Ì
\88Ú
\93®
\82Í
\8cj
\94n
\92µ
\82Ñ
\82¶
\82á
\82È
\82¢
\81I");
2099 } else if (distu(x, y) > (magic ? 6 + magic * 3 : 9)) {
2104 pline("
\89\93\82·
\82¬
\82é
\81I");
2106 } else if (!isok(x, y)) {
2109 You("cannot jump there!");
2111 You("
\82»
\82±
\82É
\82Í
\94ò
\82×
\82È
\82¢
\81I");
2113 } else if (!cansee(x, y)) {
2116 You("cannot see where to land!");
2118 You("
\92\85\92n
\93_
\82ª
\8c©
\82¦
\82È
\82¢
\81I");
2122 struct rm *lev = &levl[u.ux][u.uy];
2123 /* we want to categorize trajectory for use in determining
2124 passage through doorways: horizonal, vertical, or diagonal;
2125 since knight's jump and other irregular directions are
2126 possible, we flatten those out to simplify door checks */
2128 dx = x - u.ux, dy = y - u.uy,
2129 ax = abs(dx), ay = abs(dy);
2131 /* diag: any non-orthogonal destination classifed as diagonal */
2132 diag = (magic || Passes_walls || (!dx && !dy)) ? jAny
2133 : !dy ? jHorz : !dx ? jVert : jDiag;
2134 /* traj: flatten out the trajectory => some diagonals re-classified */
2137 else if (ay >= 2 * ax)
2139 traj = (magic || Passes_walls || (!ax && !ay)) ? jAny
2140 : !ay ? jHorz : !ax ? jVert : jDiag;
2141 /* walk_path doesn't process the starting spot;
2142 this is iffy: if you're starting on a closed door spot,
2143 you _can_ jump diagonally from doorway (without needing
2144 Passes_walls); that's intentional but is it correct? */
2145 if (diag == jDiag && IS_DOOR(lev->typ)
2146 && (lev->doormask & D_ISOPEN) != 0
2148 || ((traj & jHorz) != 0) == (lev->horizontal != 0))) {
2151 You_cant("jump diagonally out of a doorway.");
2153 You_cant("
\8fo
\93ü
\82è
\8cû
\82©
\82ç
\8eÎ
\82ß
\82É
\94ò
\82Ñ
\8fo
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2156 uc.x = u.ux, uc.y = u.uy;
2157 tc.x = x, tc.y = y; /* target */
2158 if (!walk_path(&uc, &tc, check_jump, (genericptr_t) &traj)) {
2161 There("is an obstacle preventing that jump.");
2163 pline("
\94ò
\82Ô
\82Ì
\82ð
\8e×
\96\82\82·
\82é
\89½
\82©
\82ª
\82 \82é
\81D");
2170 static int jumping_is_magic;
2173 get_valid_jump_position(x,y)
2177 && (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
2178 && is_valid_jump_pos(x, y, jumping_is_magic, FALSE));
2182 display_jump_positions(state)
2186 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
2187 } else if (state == 1) {
2190 for (dx = -4; dx <= 4; dx++)
2191 for (dy = -4; dy <= 4; dy++) {
2192 x = dx + (int) u.ux;
2193 y = dy + (int) u.uy;
2194 if (get_valid_jump_position(x, y))
2198 tmp_at(DISP_END, 0);
2204 int magic; /* 0=Physical, otherwise skill level */
2208 /* attempt "jumping" spell if hero has no innate jumping ability */
2209 if (!magic && !Jumping) {
2212 for (sp_no = 0; sp_no < MAXSPELL; ++sp_no)
2213 if (spl_book[sp_no].sp_id == NO_SPELL)
2215 else if (spl_book[sp_no].sp_id == SPE_JUMPING)
2216 return spelleffects(sp_no, FALSE);
2219 if (!magic && (nolimbs(youmonst.data) || slithy(youmonst.data))) {
2220 /* normally (nolimbs || slithy) implies !Jumping,
2221 but that isn't necessarily the case for knights */
2223 You_cant("jump; you have no legs!");
2225 pline("
\91«
\82ª
\96³
\82
\82Ä
\82Í
\92µ
\82×
\82È
\82¢
\81I");
2227 } else if (!magic && !Jumping) {
2229 You_cant("jump very far.");
2231 You_cant("
\82»
\82ñ
\82È
\89\93\82
\82Ü
\82Å
\92µ
\82×
\82È
\82¢
\81D");
2233 /* if steed is immobile, can't do physical jump but can do spell one */
2234 } else if (!magic && u.usteed && stucksteed(FALSE)) {
2235 /* stucksteed gave "<steed> won't move" message */
2237 } else if (u.uswallow) {
2240 You("bounce around a little.");
2242 pline("
\94½
\93®
\82ð
\82Â
\82¯
\82½
\81D");
2246 pline("You've got to be kidding!");
2248 pline("
\8fç
\92k
\82Í
\82æ
\82µ
\82±
\82³
\82ñ
\81I");
2250 } else if (u.uinwater) {
2253 You("swish around a little.");
2255 pline("
\83X
\83C
\83X
\83C
\82Æ
\89j
\82¢
\82¾
\81D");
2259 pline("This calls for swimming, not jumping!");
2261 pline("
\82»
\82ê
\82Í
\81w
\89j
\82®
\81x
\82Å
\82 \82Á
\82Ä
\81C
\81w
\92µ
\82Ô
\81x
\82¶
\82á
\82È
\82¢
\81I");
2263 } else if (u.ustuck) {
2264 if (u.ustuck->mtame && !Conflict && !u.ustuck->mconf) {
2266 You("pull free from %s.", mon_nam(u.ustuck));
2268 You("%s
\82©
\82ç
\97£
\82ê
\82½
\81D", mon_nam(u.ustuck));
2274 You("writhe a little in the grasp of %s!", mon_nam(u.ustuck));
2276 You("%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\83W
\83^
\83o
\83^
\82µ
\82½
\81I", mon_nam(u.ustuck));
2280 You("cannot escape from %s!", mon_nam(u.ustuck));
2282 You("%s
\82©
\82ç
\93¦
\82ê
\82ç
\82ê
\82È
\82¢
\81I", mon_nam(u.ustuck));
2284 } else if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
2287 You("flail around a little.");
2289 You("
\83o
\83^
\83o
\83^
\92µ
\82ñ
\82¾
\81D");
2293 You("don't have enough traction to jump.");
2295 You("
\92µ
\82Ô
\82½
\82ß
\82Ì
\94½
\93®
\82ª
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
2297 } else if (!magic && near_capacity() > UNENCUMBERED) {
2299 You("are carrying too much to jump!");
2301 You("
\82½
\82
\82³
\82ñ
\95¨
\82ð
\8e\9d\82¿
\82·
\82¬
\82Ä
\92µ
\82×
\82È
\82¢
\81I");
2303 } else if (!magic && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
2305 You("lack the strength to jump!");
2307 You("
\92µ
\82Ô
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I");
2309 } else if (!magic && Wounded_legs) {
2310 long wl = (Wounded_legs & BOTH_SIDES);
2311 const char *bp = body_part(LEG);
2313 if (wl == BOTH_SIDES)
2314 bp = makeplural(bp);
2317 pline("%s is in no shape for jumping.", Monnam(u.usteed));
2319 pline("%s
\82Í
\92µ
\82×
\82é
\8fó
\91Ô
\82Å
\82Í
\82È
\82¢
\81D", Monnam(u.usteed));
2322 Your("%s%s %s in no shape for jumping.",
2323 (wl == LEFT_SIDE) ? "left " : (wl == RIGHT_SIDE) ? "right "
2325 bp, (wl == BOTH_SIDES) ? "are" : "is");
2327 Your("%s%s
\82Í
\92µ
\82×
\82é
\8fó
\91Ô
\82Å
\82Í
\82È
\82¢
\81D",
2328 (wl == LEFT_SIDE) ? "
\8d¶" :
2329 (wl == RIGHT_SIDE) ? "
\89E" : "", bp);
2332 } else if (u.usteed && u.utrap) {
2334 pline("%s is stuck in a trap.", Monnam(u.usteed));
2336 pline("%s
\82Íã©
\82É
\82Ð
\82Á
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81D", Monnam(u.usteed));
2341 pline("Where do you want to jump?");
2343 pline("
\82Ç
\82±
\82É
\92µ
\82Ñ
\82Ü
\82·
\82©
\81H");
2346 jumping_is_magic = magic;
2347 getpos_sethilite(display_jump_positions, get_valid_jump_position);
2349 if (getpos(&cc, TRUE, "the desired position") < 0)
2351 if (getpos(&cc, TRUE, "
\92µ
\82Ñ
\82½
\82¢
\8fê
\8f\8a") < 0)
2352 return 0; /* user pressed ESC */
2353 if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) {
2360 switch (u.utraptype) {
2362 long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
2365 You("rip yourself free of the bear trap! Ouch!");
2367 You("
\8e©
\95ª
\82ð
\8cF
\82Ìã©
\82©
\82ç
\82Ð
\82«
\82Í
\82ª
\82µ
\82½
\81C
\82¢
\82Ä
\82Á
\81I");
2369 losehp(Maybe_Half_Phys(rnd(10)), "jumping out of a bear trap",
2371 losehp(Maybe_Half_Phys(rnd(10)), "
\8cF
\82Ìã©
\82©
\82ç
\94ò
\82Ñ
\8fo
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2373 set_wounded_legs(side, rn1(1000, 500));
2378 You("leap from the pit!");
2380 You("
\97\8e\82µ
\8c\8a\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I");
2384 You("tear the web apart as you pull yourself free!");
2386 You("
\82
\82à
\82Ì
\91\83\82ð
\88ø
\82«
\97ô
\82«
\81C
\8e©
\97R
\82É
\82È
\82Á
\82½
\81I");
2387 deltrap(t_at(u.ux, u.uy));
2391 You("pull yourself above the %s!", hliquid("lava"));
2393 You("%s
\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I", hliquid("
\97n
\8aâ"));
2399 You("strain your %s, but you're still %s.",
2400 makeplural(body_part(LEG)),
2401 (u.utraptype == TT_INFLOOR)
2402 ? "stuck in the floor"
2403 : "attached to the buried ball");
2405 You("%s
\82ð
\88ø
\82Á
\82Ï
\82Á
\82½
\82ª
\81C
\82 \82È
\82½
\82Í
\82Ü
\82¾%s
\81D",
2406 makeplural(body_part(LEG)),
2407 (u.utraptype == TT_INFLOOR)
2408 ? "
\8f°
\82É
\82¤
\82Ü
\82Á
\82Ä
\82¢
\82é"
2409 : "
\82¤
\82Ü
\82Á
\82½
\8b\85\82Æ
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é");
2411 set_wounded_legs(LEFT_SIDE, rn1(10, 11));
2412 set_wounded_legs(RIGHT_SIDE, rn1(10, 11));
2417 * Check the path from uc to cc, calling hurtle_step at each
2418 * location. The final position actually reached will be
2423 /* calculate max(abs(dx), abs(dy)) as the range */
2424 range = cc.x - uc.x;
2432 (void) walk_path(&uc, &cc, hurtle_jump, (genericptr_t) &range);
2433 /* hurtle_jump -> hurtle_step results in <u.ux,u.uy> == <cc.x,cc.y>
2434 * and usually moves the ball if punished, but does not handle all
2435 * the effects of landing on the final position.
2437 teleds(cc.x, cc.y, FALSE);
2441 multi_reason = "jumping around";
2443 multi_reason = "
\92µ
\82Ë
\89ñ
\82Á
\82Ä
\82¢
\82é
\8e\9e\82É";
2445 morehungry(rnd(25));
2456 if (!mons[corpse->corpsenm].cnutrit)
2462 use_tinning_kit(obj)
2465 struct obj *corpse, *can;
2467 /* This takes only 1 move. If this is to be changed to take many
2468 * moves, we've got to deal with decaying corpses...
2470 if (obj->spe <= 0) {
2472 You("seem to be out of tins.");
2474 pline("
\8aÊ
\8bl
\82ð
\8dì
\82é
\82½
\82ß
\82Ì
\8aÊ
\82ª
\90Ø
\82ê
\82½
\82æ
\82¤
\82¾
\81D");
2478 if (!(corpse = floorfood("tin", 2)))
2480 if (!(corpse = floorfood("
\8aÊ
\8bl
\82ß
\82É
\82·
\82é", 2)))
2482 if (corpse->oeaten) {
2484 You("cannot tin %s which is partly eaten.", something);
2486 You("
\90H
\82×
\82©
\82¯
\82Ì
\82à
\82Ì
\82ð
\8aÊ
\8bl
\82É
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2489 if (touch_petrifies(&mons[corpse->corpsenm]) && !Stone_resistance
2493 if (poly_when_stoned(youmonst.data))
2495 You("tin %s without wearing gloves.",
2496 an(mons[corpse->corpsenm].mname));
2498 You("
\8f¬
\8eè
\82È
\82µ
\82Å%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\81D",
2499 mons[corpse->corpsenm].mname);
2503 pline("Tinning %s without wearing gloves is a fatal mistake...",
2504 an(mons[corpse->corpsenm].mname));
2506 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",
2507 mons[corpse->corpsenm].mname);
2510 Sprintf(kbuf, "trying to tin %s without gloves",
2511 an(mons[corpse->corpsenm].mname));
2513 Sprintf(kbuf, "
\8f¬
\8eè
\82ð
\82Â
\82¯
\82¸
\82É%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2514 mons[corpse->corpsenm].mname);
2519 if (is_rider(&mons[corpse->corpsenm])) {
2520 if (revive_corpse(corpse))
2522 verbalize("Yes... But War does not preserve its enemies...");
2524 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");
2527 pline_The("corpse evades your grasp.");
2529 pline("
\8e\80\91Ì
\82Í
\82 \82È
\82½
\82Ì
\8eè
\82ð
\93¦
\82ê
\82½
\81D");
2532 if (mons[corpse->corpsenm].cnutrit == 0) {
2534 pline("That's too insubstantial to tin.");
2536 pline("
\8eÀ
\91Ì
\82ª
\82È
\82¢
\82Ì
\82Å
\8aÊ
\8bl
\82É
\82Å
\82«
\82È
\82¢
\81D");
2539 consume_obj_charge(obj, TRUE);
2541 if ((can = mksobj(TIN, FALSE, FALSE)) != 0) {
2543 static const char you_buy_it[] = "You tin it, you bought it!";
2545 static const char you_buy_it[] = "
\8aÊ
\8bl
\82É
\82µ
\82½
\82Ì
\82È
\82ç
\94\83\82Á
\82Ä
\82à
\82ç
\82¤
\82æ
\81I";
2547 can->corpsenm = corpse->corpsenm;
2548 can->cursed = obj->cursed;
2549 can->blessed = obj->blessed;
2550 can->owt = weight(can);
2552 /* Mark tinned tins. No spinach allowed... */
2553 set_tin_variety(can, HOMEMADE_TIN);
2554 if (carried(corpse)) {
2556 verbalize(you_buy_it);
2559 if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge)
2560 verbalize(you_buy_it);
2564 (void) hold_another_object(can, "You make, but cannot pick up, %s.",
2565 doname(can), (const char *) 0);
2567 (void) 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",
2568 doname(can), (const char *) 0);
2571 impossible("Tinning failed.");
2575 use_unicorn_horn(obj)
2578 #define PROP_COUNT 7 /* number of properties we're dealing with */
2579 #define ATTR_COUNT (A_MAX * 3) /* number of attribute points we might fix */
2580 int idx, val, val_limit, trouble_count, unfixable_trbl, did_prop,
2582 int trouble_list[PROP_COUNT + ATTR_COUNT];
2584 if (obj && obj->cursed) {
2585 long lcount = (long) rn1(90, 10);
2587 switch (rn2(13) / 2) { /* case 6 is half as likely as the others */
2589 make_sick((Sick & TIMEOUT) ? (Sick & TIMEOUT) / 3L + 1L
2590 : (long) rn1(ACURR(A_CON), 20),
2591 xname(obj), TRUE, SICK_NONVOMITABLE);
2594 make_blinded((Blinded & TIMEOUT) + lcount, TRUE);
2599 You("suddenly feel %s.",
2600 Hallucination ? "trippy" : "confused");
2602 You("
\93Ë
\91R%s
\81D",
2603 Hallucination ? "
\82Ö
\82ë
\82Ö
\82ë
\82É
\82È
\82Á
\82½" : "
\8d¬
\97\90\82µ
\82½");
2605 make_confused((HConfusion & TIMEOUT) + lcount, TRUE);
2608 make_stunned((HStun & TIMEOUT) + lcount, TRUE);
2611 (void) adjattrib(rn2(A_MAX), -1, FALSE);
2614 (void) make_hallucinated((HHallucination & TIMEOUT) + lcount,
2618 if (Deaf) /* make_deaf() won't give feedback when already deaf */
2620 pline("Nothing seems to happen.");
2622 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2623 make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
2624 context.botl = TRUE;
2631 * Entries in the trouble list use a very simple encoding scheme.
2633 #define prop2trbl(X) ((X) + A_MAX)
2634 #define attr2trbl(Y) (Y)
2635 #define prop_trouble(X) trouble_list[trouble_count++] = prop2trbl(X)
2636 #define attr_trouble(Y) trouble_list[trouble_count++] = attr2trbl(Y)
2637 #define TimedTrouble(P) (((P) && !((P) & ~TIMEOUT)) ? ((P) & TIMEOUT) : 0L)
2639 trouble_count = unfixable_trbl = did_prop = did_attr = 0;
2641 /* collect property troubles */
2642 if (TimedTrouble(Sick))
2644 if (TimedTrouble(Blinded) > (long) u.ucreamed
2646 && attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
2647 prop_trouble(BLINDED);
2648 if (TimedTrouble(HHallucination))
2649 prop_trouble(HALLUC);
2650 if (TimedTrouble(Vomiting))
2651 prop_trouble(VOMITING);
2652 if (TimedTrouble(HConfusion))
2653 prop_trouble(CONFUSION);
2654 if (TimedTrouble(HStun))
2655 prop_trouble(STUNNED);
2656 if (TimedTrouble(HDeaf))
2659 unfixable_trbl = unfixable_trouble_count(TRUE);
2661 /* collect attribute troubles */
2662 for (idx = 0; idx < A_MAX; idx++) {
2663 if (ABASE(idx) >= AMAX(idx))
2665 val_limit = AMAX(idx);
2666 /* this used to adjust 'val_limit' for A_STR when u.uhs was
2667 WEAK or worse, but that's handled via ATEMP(A_STR) now */
2669 /* potion/spell of restore ability override sustain ability
2670 intrinsic but unicorn horn usage doesn't */
2671 unfixable_trbl += val_limit - ABASE(idx);
2674 /* don't recover more than 3 points worth of any attribute */
2675 if (val_limit > ABASE(idx) + 3)
2676 val_limit = ABASE(idx) + 3;
2678 for (val = ABASE(idx); val < val_limit; val++)
2680 /* keep track of unfixed trouble, for message adjustment below */
2681 unfixable_trbl += (AMAX(idx) - val_limit);
2684 if (trouble_count == 0) {
2685 pline1(nothing_happens);
2687 } else if (trouble_count > 1) { /* shuffle */
2690 for (i = trouble_count - 1; i > 0; i--)
2691 if ((j = rn2(i + 1)) != i) {
2692 k = trouble_list[j];
2693 trouble_list[j] = trouble_list[i];
2694 trouble_list[i] = k;
2699 * Chances for number of troubles to be fixed
2701 * blessed: 22.7% 22.7% 19.5% 15.4% 10.7% 5.7% 2.6% 0.8%
2702 * uncursed: 35.4% 35.4% 22.9% 6.3% 0 0 0 0
2704 val_limit = rn2(d(2, (obj && obj->blessed) ? 4 : 2));
2705 if (val_limit > trouble_count)
2706 val_limit = trouble_count;
2708 /* fix [some of] the troubles */
2709 for (val = 0; val < val_limit; val++) {
2710 idx = trouble_list[val];
2713 case prop2trbl(SICK):
2714 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
2717 case prop2trbl(BLINDED):
2718 make_blinded((long) u.ucreamed, TRUE);
2721 case prop2trbl(HALLUC):
2722 (void) make_hallucinated(0L, TRUE, 0L);
2725 case prop2trbl(VOMITING):
2726 make_vomiting(0L, TRUE);
2729 case prop2trbl(CONFUSION):
2730 make_confused(0L, TRUE);
2733 case prop2trbl(STUNNED):
2734 make_stunned(0L, TRUE);
2737 case prop2trbl(DEAF):
2738 make_deaf(0L, TRUE);
2742 if (idx >= 0 && idx < A_MAX) {
2746 panic("use_unicorn_horn: bad trouble? (%d)", idx);
2753 pline("This makes you feel %s!",
2754 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2758 pline("
\8bC
\95ª
\82ª%s
\82æ
\82
\82È
\82Á
\82½
\81I",
2759 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2765 pline("Nothing seems to happen.");
2767 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2769 context.botl = (did_attr || did_prop);
2780 * Timer callback routine: turn figurine into monster
2783 fig_transform(arg, timeout)
2787 struct obj *figurine = arg->a_obj;
2790 boolean cansee_spot, silent, okay_spot;
2791 boolean redraw = FALSE;
2792 boolean suppress_see = FALSE;
2793 char monnambuf[BUFSZ], carriedby[BUFSZ];
2796 debugpline0("null figurine in fig_transform()");
2799 silent = (timeout != monstermoves); /* happened while away */
2800 okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
2801 if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
2802 okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
2803 if (!okay_spot || !figurine_location_checks(figurine, &cc, TRUE)) {
2804 /* reset the timer to try again later */
2805 (void) start_timer((long) rnd(5000), TIMER_OBJECT, FIG_TRANSFORM,
2806 obj_to_any(figurine));
2810 cansee_spot = cansee(cc.x, cc.y);
2811 mtmp = make_familiar(figurine, cc.x, cc.y, TRUE);
2813 char and_vanish[BUFSZ];
2814 struct obj *mshelter = level.objects[mtmp->mx][mtmp->my];
2816 /* [m_monnam() yields accurate mon type, overriding hallucination] */
2817 Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
2818 /*JP:TODO:and_vanish
\82Í
\96¢
\8f\88\97\9d*/
2819 and_vanish[0] = '\0';
2820 if ((mtmp->minvis && !See_invisible)
2821 || (mtmp->data->mlet == S_MIMIC
2822 && mtmp->m_ap_type != M_AP_NOTHING))
2823 suppress_see = TRUE;
2825 if (mtmp->mundetected) {
2826 if (hides_under(mtmp->data) && mshelter) {
2827 Sprintf(and_vanish, " and %s under %s",
2828 locomotion(mtmp->data, "crawl"), doname(mshelter));
2829 } else if (mtmp->data->mlet == S_MIMIC
2830 || mtmp->data->mlet == S_EEL) {
2831 suppress_see = TRUE;
2833 Strcpy(and_vanish, " and vanish");
2836 switch (figurine->where) {
2838 if (Blind || suppress_see)
2840 You_feel("%s %s from your pack!", something,
2841 locomotion(mtmp->data, "drop"));
2843 You_feel("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82æ
\82¤
\82¾
\81I", something,
2844 jpast(locomotion(mtmp->data, "
\97\8e\82¿
\82é")));
2848 You_see("%s %s out of your pack%s!", monnambuf,
2849 locomotion(mtmp->data, "drop"), and_vanish);
2851 You("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2852 jpast(locomotion(mtmp->data,"
\97\8e\82¿
\82é")));
2857 if (cansee_spot && !silent) {
2860 pline("%s suddenly vanishes!", an(xname(figurine)));
2862 pline("%s
\82Í
\93Ë
\91R
\8fÁ
\82¦
\82½
\81I", xname(figurine));
2865 You_see("a figurine transform into %s%s!", monnambuf,
2868 You("
\90l
\8c`
\82ª
\93Ë
\91R%s
\82É
\82È
\82Á
\82½
\82Ì
\82ð
\8c©
\82½
\81I",
2871 redraw = TRUE; /* update figurine's map location */
2876 if (cansee_spot && !silent && !suppress_see) {
2879 mon = figurine->ocarry;
2880 /* figurine carrying monster might be invisible */
2881 if (canseemon(figurine->ocarry)
2882 && (!mon->wormno || cansee(mon->mx, mon->my)))
2884 Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon)));
2886 Sprintf(carriedby, "%s
\82Ì
\8a\93", a_monnam(mon));
2887 else if (is_pool(mon->mx, mon->my))
2889 Strcpy(carriedby, "empty water");
2891 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\90\85\92\86");
2894 Strcpy(carriedby, "thin air");
2896 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\8bó
\92\86");
2898 You_see("%s %s out of %s%s!", monnambuf,
2899 locomotion(mtmp->data, "drop"), carriedby,
2902 You("%s
\82ª%s
\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2903 carriedby, locomotion(mtmp->data, "
\97\8e\82¿
\82é"));
2913 impossible("figurine came to life where? (%d)",
2914 (int) figurine->where);
2918 /* free figurine now */
2919 if (carried(figurine)) {
2922 obj_extract_self(figurine);
2923 obfree(figurine, (struct obj *) 0);
2930 figurine_location_checks(obj, cc, quietly)
2937 if (carried(obj) && u.uswallow) {
2940 You("don't have enough room in here.");
2942 pline("
\82±
\82±
\82É
\82Í
\8f\
\95ª
\82È
\8fê
\8f\8a\82ª
\82È
\82¢
\81D");
2945 x = cc ? cc->x : u.ux;
2946 y = cc ? cc->y : u.uy;
2950 You("cannot put the figurine there.");
2952 You("
\82±
\82±
\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81D");
2955 if (IS_ROCK(levl[x][y].typ)
2956 && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) {
2959 You("cannot place a figurine in %s!",
2960 IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock");
2962 You("%s
\82Ì
\92\86\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81I",
2963 IS_TREE(levl[x][y].typ) ? "
\96Ø" : "
\8cÅ
\82¢
\90Î");
2967 if (sobj_at(BOULDER, x, y) && !passes_walls(&mons[obj->corpsenm])
2968 && !throws_rocks(&mons[obj->corpsenm])) {
2971 You("cannot fit the figurine on the boulder.");
2973 You("
\8aâ
\82É
\90l
\8c`
\82ð
\89\9f\82µ
\8d\9e\82Þ
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2983 register struct obj *obj = *optr;
2988 /* can't activate a figurine while swallowed */
2989 if (!figurine_location_checks(obj, (coord *) 0, FALSE))
2992 if (!getdir((char *) 0)) {
2993 context.move = multi = 0;
3000 /* Passing FALSE arg here will result in messages displayed */
3001 if (!figurine_location_checks(obj, &cc, FALSE))
3004 You("%s and it transforms.",
3005 (u.dx || u.dy) ? "set the figurine beside you"
3006 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
3007 || is_pool(cc.x, cc.y))
3008 ? "release the figurine"
3009 : (u.dz < 0 ? "toss the figurine into the air"
3010 : "set the figurine on the ground"));
3012 You("%s
\81D
\82·
\82é
\82Æ
\82»
\82ê
\82Í
\95Ï
\8c`
\82µ
\82½
\81D",
3013 (u.dx || u.dy) ? "
\82»
\82Î
\82É
\90l
\8c`
\82ð
\92u
\82¢
\82½"
3014 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
3015 || is_pool(cc.x, cc.y))
3016 ? "
\90l
\8c`
\82ð
\95ú
\82Á
\82½"
3017 : (u.dz < 0 ? "
\90l
\8c`
\82ð
\8bó
\92\86\82É
\93\8a\82°
\82½"
3018 : "
\90l
\8c`
\82ð
\92n
\96Ê
\82É
\92u
\82¢
\82½"));
3020 (void) make_familiar(obj, cc.x, cc.y, FALSE);
3021 (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
3026 static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 };
3036 pline("%s from your %s.", Tobjnam(obj, "slip"),
3037 makeplural(body_part(FINGER)));
3039 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
3047 if ((obj->cursed || Fumbling) && !rn2(2)) {
3048 consume_obj_charge(obj, TRUE);
3051 pline("%s from your %s.", Tobjnam(obj, "slip"),
3052 makeplural(body_part(FINGER)));
3054 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
3060 otmp = getobj(lubricables, "grease");
3064 if (inaccessible_equipment(otmp, "grease", FALSE))
3066 if (inaccessible_equipment(otmp, "
\82É
\8e\89\82ð
\93h
\82é", FALSE))
3068 consume_obj_charge(obj, TRUE);
3070 if (otmp != &zeroobj) {
3072 You("cover %s with a thick layer of grease.", yname(otmp));
3074 You("%s
\82É
\8e\89\82ð
\92O
\94O
\82É
\93h
\82Á
\82½
\81D", xname(otmp));
3076 if (obj->cursed && !nohands(youmonst.data)) {
3077 incr_itimeout(&Glib, rnd(15));
3079 pline("Some of the grease gets all over your %s.",
3081 pline("
\8e\89\82ª
\8f
\82µ%s
\82É
\82Â
\82¢
\82½
\81D",
3082 makeplural(body_part(HAND)));
3085 incr_itimeout(&Glib, rnd(15));
3087 You("coat your %s with grease.", makeplural(body_part(FINGER)));
3089 You("%s
\82É
\8e\89\82ð
\93h
\82Á
\82½
\81D", makeplural(body_part(FINGER)));
3094 pline("%s empty.", Tobjnam(obj, "are"));
3096 pline("%s
\82Í
\8bó
\82Á
\82Û
\82¾
\81D", xname(obj));
3099 pline("%s to be empty.", Tobjnam(obj, "seem"));
3101 pline("%s
\82Í
\8bó
\82Á
\82Û
\82Ì
\82æ
\82¤
\82¾
\81D", xname(obj));
3106 /* touchstones - by Ken Arnold */
3113 const char *streak_color, *choices;
3114 char stonebuf[QBUFSZ];
3116 static const char scritch[] = "\"scritch, scritch\"";
3118 static const char scritch[] = "
\81u
\83S
\83V
\81C
\83S
\83V
\81v";
3119 static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
3120 static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
3122 /* in case it was acquired while blinded */
3125 /* when the touchstone is fully known, don't bother listing extra
3126 junk as likely candidates for rubbing */
3127 choices = (tstone->otyp == TOUCHSTONE && tstone->dknown
3128 && objects[TOUCHSTONE].oc_name_known)
3132 Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
3134 Sprintf(stonebuf, "rub on the stone");
3135 if ((obj = getobj(choices, stonebuf)) == 0)
3138 if (obj == tstone && obj->quan == 1L) {
3140 You_cant("rub %s on itself.", the(xname(obj)));
3142 You("%s
\82ð
\82»
\82ê
\8e©
\91Ì
\82Å
\82±
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", the(xname(obj)));
3146 if (tstone->otyp == TOUCHSTONE && tstone->cursed
3147 && obj->oclass == GEM_CLASS && !is_graystone(obj)
3148 && !obj_resists(obj, 80, 100)) {
3151 pline("You feel something shatter.");
3153 You("
\89½
\82©
\82ª
\95²
\81X
\82É
\82È
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D");
3154 else if (Hallucination)
3156 pline("Oh, wow, look at the pretty shards.");
3158 pline("
\83\8f\81[
\83H
\81I
\82È
\82ñ
\82Ä
\82«
\82ê
\82¢
\82È
\94j
\95Ð
\82È
\82ñ
\82¾
\81D");
3161 pline("A sharp crack shatters %s%s.",
3162 (obj->quan > 1L) ? "one of " : "", the(xname(obj)));
3164 pline("
\8b
\82
\82±
\82·
\82è
\82·
\82¬
\82Ä%s%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D",
3165 the(xname(obj)), (obj->quan > 1) ? "
\82Ì
\82Ð
\82Æ
\82Â" : "");
3174 } else if (Hallucination) {
3176 pline("Oh wow, man: Fractals!");
3178 pline("
\83\8f\81[
\83H
\81I
\83t
\83\89\83N
\83^
\83\8b\96Í
\97l
\82¾
\81I");
3186 switch (obj->oclass) {
3187 case GEM_CLASS: /* these have class-specific handling below */
3189 if (tstone->otyp != TOUCHSTONE) {
3191 } else if (obj->oclass == GEM_CLASS
3193 || (!tstone->cursed && (Role_if(PM_ARCHEOLOGIST)
3194 || Race_if(PM_GNOME))))) {
3195 makeknown(TOUCHSTONE);
3196 makeknown(obj->otyp);
3197 prinv((char *) 0, obj, 0L);
3200 /* either a ring or the touchstone was not effective */
3201 if (objects[obj->otyp].oc_material == GLASS) {
3206 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3207 break; /* gem or ring */
3210 switch (objects[obj->otyp].oc_material) {
3213 pline("%s a little more polished now.", Tobjnam(tstone, "look"));
3215 pline("%s
\82Í
\82³
\82ç
\82É
\82Â
\82â
\82ª
\8fo
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", xname(tstone));
3219 if (!obj->known) /* note: not "whetstone" */
3221 You("must think this is a wetstone, do you?");
3223 You("
\82±
\82ê
\82Í
\93u
\90Î
\82¾
\82Æ
\8ev
\82Á
\82½
\81H");
3227 pline("%s a little wetter now.", Tobjnam(tstone, "are"));
3229 pline("%s
\82Í
\8f
\82µ
\82Ê
\82ê
\82½
\81D", xname(tstone));
3234 streak_color = "waxy";
3236 streak_color = "
\8e\89\82Á
\82Û
\82¢";
3238 break; /* okay even if not touchstone */
3241 streak_color = "wooden";
3243 streak_color = "
\82¨
\82ª
\82
\82¸
\82Ì
\82æ
\82¤
\82È";
3245 break; /* okay even if not touchstone */
3247 do_scratch = TRUE; /* scratching and streaks */
3249 streak_color = "golden";
3251 streak_color = "
\8bà
\90F
\82Ì";
3255 do_scratch = TRUE; /* scratching and streaks */
3257 streak_color = "silvery";
3259 streak_color = "
\8bâ
\90F
\82Ì";
3263 /* Objects passing the is_flimsy() test will not
3264 scratch a stone. They will leave streaks on
3265 non-touchstones and touchstones alike. */
3267 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3269 do_scratch = (tstone->otyp != TOUCHSTONE);
3272 break; /* default oclass */
3275 #if 0 /*JP*//* not used */
3276 Sprintf(stonebuf, "stone%s", plur(tstone->quan));
3280 You("make %s%sscratch marks on the %s.",
3281 streak_color ? streak_color : (const char *) "",
3282 streak_color ? " " : "", stonebuf);
3284 You("%s
\82±
\82·
\82è
\90Õ
\82ð
\90Î
\82É
\82Â
\82¯
\82½
\81D",
3285 streak_color ? streak_color : (const char *)"");
3287 else if (streak_color)
3289 You_see("%s streaks on the %s.", streak_color, stonebuf);
3291 pline("
\90Î
\82É%s
\8bØ
\82ª
\82Â
\82¢
\82½
\81D", streak_color);
3297 static struct trapinfo {
3301 boolean force_bungle;
3308 trapinfo.force_bungle = 0;
3311 /* Place a landmine/bear trap. Helge Hafting */
3317 const char *what = (char *) 0;
3319 int levtyp = levl[u.ux][u.uy].typ;
3321 const char *occutext = "setting the trap";
3323 const char *occutext = "ã©
\82ð
\8ed
\8a|
\82¯
\82Ä
\82¢
\82é";
3326 if (nohands(youmonst.data))
3328 what = "without hands";
3330 what = "
\8eè
\82ª
\82È
\82¢
\82Ì
\82Å";
3333 what = "while stunned";
3335 what = "
\82
\82ç
\82
\82ç
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å";
3336 else if (u.uswallow)
3339 is_animal(u.ustuck->data) ? "while swallowed" : "while engulfed";
3341 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Í";
3342 else if (Underwater)
3344 what = "underwater";
3346 what = "
\90\85\96Ê
\89º
\82Å
\82Í";
3347 else if (Levitation)
3349 what = "while levitating";
3351 what = "
\95\82\82¢
\82Ä
\82¢
\82é
\8aÔ
\82Í";
3352 else if (is_pool(u.ux, u.uy))
3356 what = "
\90\85\92\86\82Å
\82Í";
3357 else if (is_lava(u.ux, u.uy))
3361 what = "
\97n
\8aâ
\82Ì
\92\86\82Å
\82Í";
3362 else if (On_stairs(u.ux, u.uy))
3364 what = (u.ux == xdnladder || u.ux == xupladder) ? "on the ladder"
3367 what = (u.ux == xdnladder || u.ux == xupladder) ? "
\82Í
\82µ
\82²
\82Ì
\8fã
\82Å
\82Í"
3368 : "
\8aK
\92i
\82Ì
\8fã
\82Å
\82Í";
3370 else if (IS_FURNITURE(levtyp) || IS_ROCK(levtyp)
3371 || closed_door(u.ux, u.uy) || t_at(u.ux, u.uy))
3375 what = "
\82±
\82±
\82Å
\82Í";
3376 else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
3378 what = (levtyp == AIR)
3382 : "in this place"; /* Air/Water Plane catch-all */
3384 what = (levtyp == AIR)
3385 ? "
\8bó
\92\86\82Å
\82Í"
3387 ? "
\89_
\82Ì
\92\86\82Å
\82Í"
3388 : "
\82±
\82±
\82Å
\82Í"; /* Air/Water Plane catch-all */
3392 You_cant("set a trap %s!", what);
3394 pline("%sã©
\82ð
\8ed
\8a|
\82¯
\82ç
\82ê
\82È
\82¢
\81I",what);
3398 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3399 if (otmp == trapinfo.tobj && u.ux == trapinfo.tx && u.uy == trapinfo.ty) {
3401 You("resume setting %s%s.", shk_your(buf, otmp),
3403 You("%s
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D",
3404 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3405 set_occupation(set_trap, occutext, 0);
3408 trapinfo.tobj = otmp;
3409 trapinfo.tx = u.ux, trapinfo.ty = u.uy;
3411 trapinfo.time_needed =
3412 (tmp > 17) ? 2 : (tmp > 12) ? 3 : (tmp > 7) ? 4 : 5;
3414 trapinfo.time_needed *= 2;
3416 if (ttyp == BEAR_TRAP && tmp < 18)
3417 trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4;
3418 /*[fumbling and/or confusion and/or cursed object check(s)
3419 should be incorporated here instead of in set_trap]*/
3420 if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
3423 if (Fumbling || otmp->cursed)
3424 chance = (rnl(10) > 3);
3426 chance = (rnl(10) > 5);
3428 You("aren't very skilled at reaching from %s.", mon_nam(u.usteed));
3430 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));
3432 Sprintf(buf, "Continue your attempt to set %s?",
3434 Sprintf(buf, "%s
\82Ì
\8ed
\8a|
\82¯
\82ð
\91±
\82¯
\82é
\81H",
3435 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3436 if (yn(buf) == 'y') {
3439 case LANDMINE: /* set it off */
3440 trapinfo.time_needed = 0;
3441 trapinfo.force_bungle = TRUE;
3443 case BEAR_TRAP: /* drop it without arming it */
3448 You("%s
\82ð
\97\8e\82Æ
\82µ
\82½
\81I",
3449 the(defsyms[trap_to_defsym(what_trap(ttyp))]
3461 You("begin setting %s%s.", shk_your(buf, otmp),
3463 You("%s%s
\82ð
\8ed
\8a|
\82¯
\82Í
\82¶
\82ß
\82½
\81D", shk_your(buf, otmp),
3464 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3465 set_occupation(set_trap, occutext, 0);
3473 struct obj *otmp = trapinfo.tobj;
3477 if (!otmp || !carried(otmp) || u.ux != trapinfo.tx
3478 || u.uy != trapinfo.ty) {
3484 if (--trapinfo.time_needed > 0)
3485 return 1; /* still busy */
3487 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3488 ttmp = maketrap(u.ux, u.uy, ttyp);
3492 if (*in_rooms(u.ux, u.uy, SHOPBASE)) {
3493 add_damage(u.ux, u.uy, 0L); /* schedule removal */
3495 if (!trapinfo.force_bungle)
3497 You("finish arming %s.",
3499 You("%s
\82ð
\8ed
\8a|
\82¯
\8fI
\82¦
\82½
\81D",
3500 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3501 if (((otmp->cursed || Fumbling) && (rnl(10) > 5))
3502 || trapinfo.force_bungle)
3504 (unsigned) (trapinfo.force_bungle ? FORCEBUNGLE : 0));
3506 /* this shouldn't happen */
3508 Your("trap setting attempt fails.");
3510 You("ã©
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82É
\8e¸
\94s
\82µ
\82½
\81D");
3524 int rx, ry, proficient, res = 0;
3526 const char *msg_slipsfree = "The bullwhip slips free.";
3528 const char *msg_slipsfree = "
\95Ú
\82Í
\82Ù
\82Ç
\82¯
\82½
\81D";
3530 const char *msg_snap = "Snap!";
3532 const char *msg_snap = "
\83s
\83V
\83b
\81I";
3535 if (!wield_tool(obj, "lash"))
3540 if (!getdir((char *) 0))
3548 if (Stunned || (Confusion && !rn2(5)))
3552 if (!isok(rx, ry)) {
3556 You("
\82Í
\82¸
\82µ
\82½
\81D");
3559 mtmp = m_at(rx, ry);
3562 /* fake some proficiency checks */
3564 if (Role_if(PM_ARCHEOLOGIST))
3566 if (ACURR(A_DEX) < 6)
3568 else if (ACURR(A_DEX) >= 14)
3569 proficient += (ACURR(A_DEX) - 14);
3577 if (u.uswallow && attack(u.ustuck)) {
3579 There("is not enough room to flick your bullwhip.");
3581 pline("
\95Ú
\82ð
\91Å
\82Â
\82Ù
\82Ç
\8dL
\82
\82È
\82¢
\81D");
3583 } else if (Underwater) {
3585 There("is too much resistance to flick your bullwhip.");
3587 pline("
\90\85\82Ì
\92ï
\8dR
\82ª
\82 \82è
\82·
\82¬
\82Ä
\95Ú
\82ð
\91Å
\82Â
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
3589 } else if (u.dz < 0) {
3591 You("flick a bug off of the %s.", ceiling(u.ux, u.uy));
3593 You("%s
\82Ì
\92\8e\82ð
\91Å
\82¿
\97\8e\82µ
\82½
\81D",ceiling(u.ux,u.uy));
3595 } else if ((!u.dx && !u.dy) || (u.dz > 0)) {
3598 /* Sometimes you hit your steed by mistake */
3599 if (u.usteed && !rn2(proficient + 2)) {
3601 You("whip %s!", mon_nam(u.usteed));
3603 You("%s
\82ð
\95Ú
\91Å
\82Á
\82½
\81I", mon_nam(u.usteed));
3607 if (Levitation || u.usteed) {
3608 /* Have a shot at snaring something on the floor */
3609 otmp = level.objects[u.ux][u.uy];
3610 if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) {
3612 pline("Why beat a dead horse?");
3614 pline("
\82Ç
\82¤
\82µ
\82Ä
\8e\80\82ñ
\82¾
\94n
\82ð
\95Ú
\91Å
\82Â
\82æ
\82¤
\82È
\82±
\82Æ
\82ð
\82·
\82é
\82Ì
\81H");
3617 if (otmp && proficient) {
3619 You("wrap your bullwhip around %s on the %s.",
3620 an(singular(otmp, xname)), surface(u.ux, u.uy));
3622 You("
\95Ú
\82ð%s
\82Ì
\8fã
\82Ì%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D",
3623 surface(u.ux, u.uy), an(singular(otmp, xname)));
3625 if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1)
3626 pline1(msg_slipsfree);
3630 dam = rnd(2) + dbon() + obj->spe;
3634 You("hit your %s with your bullwhip.", body_part(FOOT));
3636 You("
\8e©
\95ª
\82Ì%s
\82ð
\8e©
\95ª
\82Å
\91Å
\82¿
\82Â
\82¯
\82½
\81D", body_part(FOOT));
3638 Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
3639 losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
3641 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82ð
\95Ú
\91Å
\82Á
\82Ä");
3642 losehp(dam, buf, KILLED_BY);
3647 } else if ((Fumbling || Glib) && !rn2(5)) {
3649 pline_The("bullwhip slips out of your %s.", body_part(HAND));
3651 pline("
\95Ú
\82ª%s
\82©
\82ç
\82·
\82×
\82è
\97\8e\82¿
\82½
\81D", body_part(HAND));
3654 } else if (u.utrap && u.utraptype == TT_PIT) {
3658 * if you're in a pit
3659 * - you are attempting to get out of the pit
3660 * or, if you are applying it towards a small monster
3661 * - then it is assumed that you are trying to hit it
3662 * else if the monster is wielding a weapon
3663 * - you are attempting to disarm a monster
3665 * - you are attempting to hit the monster.
3667 * if you're confused (and thus off the mark)
3668 * - you only end up hitting.
3671 const char *wrapped_what = (char *) 0;
3674 if (bigmonst(mtmp->data)) {
3675 wrapped_what = strcpy(buf, mon_nam(mtmp));
3676 } else if (proficient) {
3683 if (!wrapped_what) {
3684 if (IS_FURNITURE(levl[rx][ry].typ))
3685 wrapped_what = something;
3686 else if (sobj_at(BOULDER, rx, ry))
3688 wrapped_what = "a boulder";
3690 wrapped_what = "
\8aâ";
3698 You("wrap your bullwhip around %s.", wrapped_what);
3700 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", wrapped_what);
3701 if (proficient && rn2(proficient + 2)) {
3702 if (!mtmp || enexto(&cc, rx, ry, youmonst.data)) {
3704 You("yank yourself out of the pit!");
3706 You("
\82®
\82¢
\82Æ
\88ø
\82Á
\82Ï
\82Á
\82Ä
\8c\8a\82©
\82ç
\94²
\82¯
\8fo
\82µ
\82½
\81I");
3707 teleds(cc.x, cc.y, TRUE);
3709 vision_full_recalc = 1;
3712 pline1(msg_slipsfree);
3720 if (!canspotmon(mtmp) && !glyph_is_invisible(levl[rx][ry].glyph)) {
3722 pline("A monster is there that you couldn't see.");
3724 pline("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82ª
\82¢
\82é
\81D");
3725 map_invisible(rx, ry);
3727 otmp = MON_WEP(mtmp); /* can be null */
3729 char onambuf[BUFSZ];
3730 const char *mon_hand;
3731 boolean gotit = proficient && (!Fumbling || !rn2(10));
3733 Strcpy(onambuf, cxname(otmp));
3735 mon_hand = mbodypart(mtmp, HAND);
3737 mon_hand = makeplural(mon_hand);
3739 mon_hand = 0; /* lint suppression */
3742 You("wrap your bullwhip around %s.", yname(otmp));
3744 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", xname(otmp));
3745 if (gotit && mwelded(otmp)) {
3747 pline("%s welded to %s %s%c",
3748 (otmp->quan == 1L) ? "It is" : "They are", mhis(mtmp),
3749 mon_hand, !otmp->bknown ? '!' : '.');
3751 pline("%s
\82Í%s
\82Ì%s
\82É
\82
\82Á
\82Â
\82¢
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é%s",
3753 mon_nam(mtmp), mon_hand,
3754 !otmp->bknown ? "
\81I" : "
\81D");
3757 gotit = FALSE; /* can't pull it free */
3760 obj_extract_self(otmp);
3761 possibly_unwield(mtmp, FALSE);
3762 setmnotwielded(mtmp, otmp);
3764 switch (rn2(proficient + 1)) {
3766 /* to floor near you */
3768 You("yank %s to the %s!", yname(otmp),
3770 You("%s
\82ð%s
\82É
\88ø
\82«
\97\8e\82µ
\82½
\81I", xname(otmp),
3771 surface(u.ux, u.uy));
3772 place_object(otmp, u.ux, u.uy);
3779 /* proficient with whip, but maybe not
3780 so proficient at catching weapons */
3783 hitvalu = 8 + otmp->spe;
3784 hitu = thitu(hitvalu, dmgval(otmp, &youmonst),
3788 pline_The("%s hits you as you try to snatch it!",
3790 pline_The("%s
\82ð
\92D
\82¨
\82¤
\82Æ
\82µ
\82½
\82ç
\82 \82È
\82½
\82É
\93\96\82½
\82Á
\82½
\81I",
3793 place_object(otmp, u.ux, u.uy);
3798 /* right into your inventory */
3800 You("snatch %s!", yname(otmp));
3802 You("%s
\82ð
\92D
\82Á
\82½
\81I", xname(otmp));
3803 if (otmp->otyp == CORPSE
3804 && touch_petrifies(&mons[otmp->corpsenm]) && !uarmg
3805 && !Stone_resistance
3806 && !(poly_when_stoned(youmonst.data)
3807 && polymon(PM_STONE_GOLEM))) {
3811 Sprintf(kbuf, "%s corpse",
3812 an(mons[otmp->corpsenm].mname));
3813 pline("Snatching %s is a fatal mistake.", kbuf);
3815 pline("%s
\82Ì
\8e\80\91Ì
\82ð
\92D
\82Á
\82½
\82Ì
\82Í
\92v
\96½
\93I
\82È
\8aÔ
\88á
\82¢
\82¾
\81D",
3816 mons[otmp->corpsenm].mname);
3817 Sprintf(kbuf, "%s
\82Ì
\8e\80\91Ì
\82É
\90G
\82ê
\82Ä",
3818 mons[otmp->corpsenm].mname);
3823 (void) hold_another_object(otmp, "You drop %s!",
3824 doname(otmp), (const char *) 0);
3826 (void) hold_another_object(otmp, "%s
\82ð
\97\8e\82µ
\82½
\81I",
3827 doname(otmp), (const char *) 0);
3831 /* to floor beneath mon */
3833 You("yank %s from %s %s!", the(onambuf),
3834 s_suffix(mon_nam(mtmp)), mon_hand);
3836 You("%s
\82ð%s
\82Ì%s
\82©
\82ç
\82Ð
\82Á
\82Ï
\82Á
\82½
\81I", the(xname(otmp)),
3837 mon_nam(mtmp), mon_hand);
3839 obj_no_longer_held(otmp);
3840 place_object(otmp, mtmp->mx, mtmp->my);
3845 pline1(msg_slipsfree);
3849 if (mtmp->m_ap_type && !Protection_from_shape_changers
3851 stumble_onto_mimic(mtmp);
3854 You("flick your bullwhip towards %s.", mon_nam(mtmp));
3856 You("%s
\82É
\8cü
\82Á
\82Ä
\95Ú
\82ð
\91Å
\82Á
\82½
\81D", mon_nam(mtmp));
3865 } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
3866 /* it must be air -- water checked above */
3868 You("snap your whip through thin air.");
3870 You("
\89½
\82à
\82È
\82¢
\82Æ
\82±
\82ë
\82Å
\95Ú
\82ð
\91Å
\82Á
\82½
\81D");
3880 not_enough_room[] = "There's not enough room here to use that.",
3882 not_enough_room[] = "
\82»
\82ê
\82ð
\8eg
\82¤
\82¾
\82¯
\82Ì
\8dL
\82³
\82ª
\82È
\82¢
\81D",
3884 where_to_hit[] = "Where do you want to hit?",
3886 where_to_hit[] = "
\82Ç
\82ê
\82ð
\91_
\82¤
\81H",
3888 cant_see_spot[] = "won't hit anything if you can't see that spot.",
3890 cant_see_spot[] = "
\8fê
\8f\8a\82ª
\8c©
\82¦
\82È
\82¯
\82ê
\82Î
\91_
\82¦
\82È
\82¢
\81D",
3892 cant_reach[] = "can't reach that spot from here.";
3894 cant_reach[] = "
\82±
\82±
\82©
\82ç
\82»
\82±
\82Ö
\82Í
\93Í
\82©
\82È
\82¢
\81D";
3896 /* find pos of monster in range, if only one monster */
3898 find_poleable_mon(pos, min_range, max_range)
3900 int min_range, max_range;
3903 struct monst *selmon = (struct monst *) 0;
3905 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
3906 if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
3907 && cansee(mtmp->mx, mtmp->my)
3908 && distu(mtmp->mx, mtmp->my) <= max_range
3909 && distu(mtmp->mx, mtmp->my) >= min_range) {
3916 pos->x = selmon->mx;
3917 pos->y = selmon->my;
3921 static int polearm_range_min = -1;
3922 static int polearm_range_max = -1;
3925 get_valid_polearm_position(x,y)
3928 return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
3929 && distu(x, y) >= polearm_range_min
3930 && distu(x, y) <= polearm_range_max);
3934 display_polearm_positions(state)
3938 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
3939 } else if (state == 1) {
3942 for (dx = -4; dx <= 4; dx++)
3943 for (dy = -4; dy <= 4; dy++) {
3944 x = dx + (int) u.ux;
3945 y = dy + (int) u.uy;
3946 if (get_valid_polearm_position(x, y)) {
3951 tmp_at(DISP_END, 0);
3955 /* Distance attacks by pole-weapons */
3960 int res = 0, typ, max_range, min_range, glyph;
3963 struct monst *hitm = context.polearm.hitmon;
3965 /* Are you allowed to use the pole? */
3967 pline(not_enough_room);
3971 if (!wield_tool(obj, "swing"))
3976 /* assert(obj == uwep); */
3979 * Calculate allowable range (pole's reach is always 2 steps):
3980 * unskilled and basic: orthogonal direction, 4..4;
3981 * skilled: as basic, plus knight's jump position, 4..5;
3982 * expert: as skilled, plus diagonal, 4..8.
3990 * (Note: no roles in nethack can become expert or better
3991 * for polearm skill; Yeoman in slash'em can become expert.)
3994 typ = uwep_skill_type();
3995 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
3997 else if (P_SKILL(typ) == P_SKILLED)
4000 max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
4002 polearm_range_min = min_range;
4003 polearm_range_max = max_range;
4005 /* Prompt for a location */
4006 pline(where_to_hit);
4009 if (!find_poleable_mon(&cc, min_range, max_range) && hitm
4010 && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)
4011 && distu(hitm->mx, hitm->my) <= max_range
4012 && distu(hitm->mx, hitm->my) >= min_range) {
4016 getpos_sethilite(display_polearm_positions, get_valid_polearm_position);
4018 if (getpos(&cc, TRUE, "the spot to hit") < 0)
4020 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
4021 return res; /* ESC; uses turn iff polearm became wielded */
4023 glyph = glyph_at(cc.x, cc.y);
4024 if (distu(cc.x, cc.y) > max_range) {
4028 pline("
\89\93\82·
\82¬
\82é
\81I");
4030 } else if (distu(cc.x, cc.y) < min_range) {
4032 pline("Too close!");
4034 pline("
\8bß
\82·
\82¬
\82é
\81I");
4036 } else if (!cansee(cc.x, cc.y) && !glyph_is_monster(glyph)
4037 && !glyph_is_invisible(glyph) && !glyph_is_statue(glyph)) {
4040 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4045 context.polearm.hitmon = NULL;
4046 /* Attack the monster there */
4048 if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
4049 if (attack_checks(mtmp, uwep))
4052 return 1; /* burn nutrition; maybe pass out */
4053 context.polearm.hitmon = mtmp;
4054 check_caitiff(mtmp);
4055 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4056 (void) thitmonst(mtmp, uwep);
4057 } else if (glyph_is_statue(glyph) /* might be hallucinatory */
4058 && sobj_at(STATUE, bhitpos.x, bhitpos.y)) {
4059 struct trap *t = t_at(bhitpos.x, bhitpos.y);
4061 if (t && t->ttyp == STATUE_TRAP
4062 && activate_statue_trap(t, t->tx, t->ty, FALSE)) {
4063 ; /* feedback has been give by animate_statue() */
4065 /* Since statues look like monsters now, we say something
4066 different from "you miss" or "there's nobody there".
4067 Note: we only do this when a statue is displayed here,
4068 because the player is probably attempting to attack it;
4069 other statues obscured by anything are just ignored. */
4071 pline("Thump! Your blow bounces harmlessly off the statue.");
4073 pline("
\83S
\83c
\83\93\81I
\92¤
\91\9c\82Í
\8f\9d\82Â
\82©
\82È
\82©
\82Á
\82½
\81D");
4074 wake_nearto(bhitpos.x, bhitpos.y, 25);
4077 /* no monster here and no statue seen or remembered here */
4078 (void) unmap_invisible(bhitpos.x, bhitpos.y);
4080 You("miss; there is no one there to hit.");
4082 You("
\8aO
\82ê
\82½
\81D
\82»
\82±
\82É
\82Í
\89½
\82à
\82È
\82¢
\81D");
4084 u_wipe_engr(2); /* same as for melee or throwing */
4092 boolean wasblind = Blind;
4093 boolean wascreamed = u.ucreamed;
4094 boolean several = FALSE;
4096 if (obj->quan > 1L) {
4098 obj = splitobj(obj, 1L);
4102 You("give yourself a facial.");
4104 You("
\83N
\83\8a\81[
\83\80\83p
\83b
\83N
\82ð
\82µ
\82½
\81D");
4107 pline("You immerse your %s in %s%s.", body_part(FACE),
4108 several ? "one of " : "",
4109 several ? makeplural(the(xname(obj))) : the(xname(obj)));
4111 pline("%s%s
\82É%s
\82ð
\92¾
\82ß
\82½
\81D",
4113 several ? "
\82Ì
\82Ð
\82Æ
\82Â" : "", body_part(FACE));
4115 if (can_blnd((struct monst *) 0, &youmonst, AT_WEAP, obj)) {
4116 int blindinc = rnd(25);
4117 u.ucreamed += blindinc;
4118 make_blinded(Blinded + (long) blindinc, FALSE);
4119 if (!Blind || (Blind && wasblind))
4121 pline("There's %ssticky goop all over your %s.",
4122 wascreamed ? "more " : "", body_part(FACE));
4124 pline("
\82â
\82Á
\82©
\82¢
\82È
\82Ë
\82Î
\82Ë
\82Î
\82ª%s
\91S
\91Ì
\82É%s
\82Â
\82¢
\82½
\81D",
4125 body_part(FACE), wascreamed ? "
\82³
\82ç
\82É" : "");
4127 else /* Blind && !wasblind */
4129 You_cant("see through all the sticky goop on your %s.",
4131 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",
4136 /* useup() is appropriate, but we want costly_alteration()'s message */
4137 costly_alteration(obj, COST_SPLAT);
4138 obj_extract_self(obj);
4147 int res = 0, typ, max_range = 4, tohit;
4148 boolean save_confirm;
4153 /* Are you allowed to use the hook? */
4155 pline(not_enough_room);
4159 if (!wield_tool(obj, "cast"))
4164 /* assert(obj == uwep); */
4166 /* Prompt for a location */
4167 pline(where_to_hit);
4171 if (getpos(&cc, TRUE, "the spot to hit") < 0)
4173 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
4174 return res; /* ESC; uses turn iff grapnel became wielded */
4176 /* Calculate range; unlike use_pole(), there's no minimum for range */
4177 typ = uwep_skill_type();
4178 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
4180 else if (P_SKILL(typ) == P_SKILLED)
4184 if (distu(cc.x, cc.y) > max_range) {
4188 pline("
\89\93\82·
\82¬
\82é
\81I");
4190 } else if (!cansee(cc.x, cc.y)) {
4193 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4198 /* What do you want to hit? */
4200 if (typ != P_NONE && P_SKILL(typ) >= P_SKILLED) {
4201 winid tmpwin = create_nhwindow(NHW_MENU);
4204 menu_item *selected;
4206 any = zeroany; /* set all bits to zero */
4207 any.a_int = 1; /* use index+1 (cant use 0) as identifier */
4211 Sprintf(buf, "an object on the %s", surface(cc.x, cc.y));
4213 Sprintf(buf, "%s
\82É
\82 \82é
\95¨
\91Ì", surface(cc.x, cc.y));
4214 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4218 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "a monster",
4221 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "
\89ö
\95¨",
4226 Sprintf(buf, "the %s", surface(cc.x, cc.y));
4228 Sprintf(buf, "%s", surface(cc.x, cc.y));
4229 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4232 end_menu(tmpwin, "Aim for what?");
4234 end_menu(tmpwin, "
\89½
\82ð
\91_
\82¤
\81H");
4236 if (select_menu(tmpwin, PICK_ONE, &selected) > 0
4237 && rn2(P_SKILL(typ) > P_SKILLED ? 20 : 2))
4238 tohit = selected[0].item.a_int - 1;
4239 free((genericptr_t) selected);
4240 destroy_nhwindow(tmpwin);
4243 /* possibly scuff engraving at your feet;
4244 any engraving at the target location is unaffected */
4245 if (tohit == 2 || !rn2(2))
4246 u_wipe_engr(rnd(2));
4248 /* What did you hit? */
4251 /* FIXME -- untrap needs to deal with non-adjacent traps */
4253 case 1: /* Object */
4254 if ((otmp = level.objects[cc.x][cc.y]) != 0) {
4256 You("snag an object from the %s!", surface(cc.x, cc.y));
4258 You("%s
\82Ì
\82à
\82Ì
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I", surface(cc.x, cc.y));
4259 (void) pickup_object(otmp, 1L, FALSE);
4260 /* If pickup fails, leave it alone */
4265 case 2: /* Monster */
4267 if ((mtmp = m_at(cc.x, cc.y)) == (struct monst *) 0)
4269 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4270 save_confirm = flags.confirm;
4271 if (verysmall(mtmp->data) && !rn2(4)
4272 && enexto(&cc, u.ux, u.uy, (struct permonst *) 0)) {
4273 flags.confirm = FALSE;
4274 (void) attack_checks(mtmp, uwep);
4275 flags.confirm = save_confirm;
4276 check_caitiff(mtmp); /* despite fact there's no damage */
4278 You("pull in %s!", mon_nam(mtmp));
4280 You("%s
\82ð
\88ø
\82Á
\92£
\82Á
\82½
\81I", mon_nam(mtmp));
4281 mtmp->mundetected = 0;
4282 rloc_to(mtmp, cc.x, cc.y);
4284 } else if ((!bigmonst(mtmp->data) && !strongmonst(mtmp->data))
4286 flags.confirm = FALSE;
4287 (void) attack_checks(mtmp, uwep);
4288 flags.confirm = save_confirm;
4289 check_caitiff(mtmp);
4290 (void) thitmonst(mtmp, uwep);
4294 case 3: /* Surface */
4295 if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
4297 pline_The("hook slices through the %s.", surface(cc.x, cc.y));
4299 pline("
\83t
\83b
\83N
\82Í%s
\82ð
\82³
\82Á
\82Æ
\90Ø
\82Á
\82½
\81D", surface(cc.x, cc.y));
4302 You("are yanked toward the %s!", surface(cc.x, cc.y));
4304 You("%s
\82Ö
\88ø
\82Á
\82Ï
\82ç
\82ê
\82½
\81I", surface(cc.x, cc.y));
4305 hurtle(sgn(cc.x - u.ux), sgn(cc.y - u.uy), 1, FALSE);
4309 default: /* Yourself (oops!) */
4310 if (P_SKILL(typ) <= P_BASIC) {
4312 You("hook yourself!");
4314 You("
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I");
4316 losehp(Maybe_Half_Phys(rn1(10, 10)), "a grappling hook",
4318 losehp(Maybe_Half_Phys(rn1(10, 10)), "
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82Ä",
4324 pline1(nothing_happens);
4328 #define BY_OBJECT ((struct monst *) 0)
4330 /* return 1 if the wand is broken, hence some time elapsed */
4336 static const char nothing_else_happens[] = "But nothing else happens...";
4338 static const char nothing_else_happens[] = "
\82µ
\82©
\82µ
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D
\81D
\81D";
4339 register int i, x, y;
4340 register struct monst *mon;
4342 boolean affects_objects;
4343 boolean shop_damage = FALSE;
4344 boolean fillmsg = FALSE;
4345 int expltype = EXPL_MAGICAL;
4346 char confirm[QBUFSZ], buf[BUFSZ];
4348 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa"));
4350 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "
\83o
\83\8b\83T
\82Ì
\8fñ"));
4353 if (!paranoid_query(ParanoidBreakwand,
4355 "Are you really sure you want to break ",
4356 "?", obj, yname, ysimple_name, "the wand")))
4358 if (!paranoid_query(ParanoidBreakwand,
4360 "
\96{
\93\96\82É", "
\82ð
\89ó
\82·
\82Ì
\81H",
4361 obj, xname, ysimple_name, "
\8fñ")))
4365 if (nohands(youmonst.data)) {
4367 You_cant("break %s without hands!", yname(obj));
4369 You("
\8eè
\82ª
\96³
\82¢
\82Ì
\82Å%s
\82ð
\89ó
\82¹
\82È
\82¢
\81I", xname(obj));
4371 } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) {
4373 You("don't have the strength to break %s!", yname(obj));
4375 You("%s
\82ð
\89ó
\82·
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I", xname(obj));
4379 pline("Raising %s high above your %s, you %s it in two!", yname(obj),
4380 body_part(HEAD), is_fragile ? "snap" : "break");
4382 pline("%s
\82ð%s
\82Ì
\8fã
\82É
\8d\82\82
\8cf
\82°
\81C
\93ñ
\82Â
\82É
\82Ö
\82µ
\90Ü
\82Á
\82½
\81I", yname(obj),
4386 /* [ALI] Do this first so that wand is removed from bill. Otherwise,
4387 * the freeinv() below also hides it from setpaid() which causes problems.
4390 check_unpaid(obj); /* Extra charge for use */
4391 costly_alteration(obj, COST_DSTROY);
4394 current_wand = obj; /* destroy_item might reset this */
4395 freeinv(obj); /* hide it from destroy_item instead... */
4396 setnotworn(obj); /* so we need to do this ourselves */
4398 if (!zappable(obj)) {
4399 pline(nothing_else_happens);
4400 goto discard_broken_wand;
4402 /* successful call to zappable() consumes a charge; put it back */
4404 /* might have "wrested" a final charge, taking it from 0 to -1;
4405 if so, we just brought it back up to 0, which wouldn't do much
4406 below so give it 1..3 charges now, usually making it stronger
4407 than an ordinary last charge (the wand is already gone from
4408 inventory, so perm_invent can't accidentally reveal this) */
4415 affects_objects = FALSE;
4417 switch (obj->otyp) {
4422 case WAN_ENLIGHTENMENT:
4424 case WAN_SECRET_DOOR_DETECTION:
4425 pline(nothing_else_happens);
4426 goto discard_broken_wand;
4432 expltype = EXPL_FIERY;
4435 if (expltype == EXPL_MAGICAL)
4436 expltype = EXPL_FROSTY;
4439 case WAN_MAGIC_MISSILE:
4441 explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
4442 makeknown(obj->otyp); /* explode describes the effect */
4443 goto discard_broken_wand;
4445 /* we want this before the explosion instead of at the very end */
4447 pline("A wall of force smashes down around you!");
4449 pline("
\82 \82È
\82½
\82Í
\96\82\97Í
\82Ì
\95Ç
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81I");
4450 dmg = d(1 + obj->spe, 6); /* normally 2d12 */
4452 case WAN_CANCELLATION:
4454 case WAN_TELEPORTATION:
4455 case WAN_UNDEAD_TURNING:
4456 affects_objects = TRUE;
4462 /* magical explosion and its visual effect occur before specific effects
4464 /* [TODO? This really ought to prevent the explosion from being
4465 fatal so that we never leave a bones file where none of the
4466 surrounding targets (or underlying objects) got affected yet.] */
4467 explode(obj->ox, obj->oy, -(obj->otyp), rnd(dmg), WAND_CLASS,
4470 /* prepare for potential feedback from polymorph... */
4473 /* this makes it hit us last, so that we can see the action first */
4474 for (i = 0; i <= 8; i++) {
4475 bhitpos.x = x = obj->ox + xdir[i];
4476 bhitpos.y = y = obj->oy + ydir[i];
4480 if (obj->otyp == WAN_DIGGING) {
4483 if (dig_check(BY_OBJECT, FALSE, x, y)) {
4484 if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
4485 /* normally, pits and holes don't anger guards, but they
4486 * do if it's a wall or door that's being dug */
4487 watch_dig((struct monst *) 0, x, y, TRUE);
4488 if (*in_rooms(x, y, SHOPBASE))
4492 * Let liquid flow into the newly created pits.
4493 * Adjust corresponding code in music.c for
4494 * drum of earthquake if you alter this sequence.
4496 typ = fillholetyp(x, y, FALSE);
4498 levl[x][y].typ = typ;
4499 liquid_flow(x, y, typ, t_at(x, y),
4503 : "Some holes are quickly filled with %s!");
4505 : "
\8c\8a\82Í
\82·
\82®
\82É%s
\82Å
\96\84\82Ü
\82Á
\82½
\81I");
4508 digactualhole(x, y, BY_OBJECT, (rn2(obj->spe) < 3
4509 || (!Can_dig_down(&u.uz)
4510 && !levl[x][y].candig))
4515 } else if (obj->otyp == WAN_CREATE_MONSTER) {
4516 /* u.ux,u.uy creates it near you--x,y might create it in rock */
4517 (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
4519 } else if (x != u.ux || y != u.uy) {
4521 * Wand breakage is targetting a square adjacent to the hero,
4522 * which might contain a monster or a pile of objects or both.
4523 * Handle objects last; avoids having undead turning raise an
4524 * undead's corpse and then attack resulting undead monster.
4525 * obj->bypass in bhitm() prevents the polymorphing of items
4526 * dropped due to monster's polymorph and prevents undead
4527 * turning that kills an undead from raising resulting corpse.
4529 if ((mon = m_at(x, y)) != 0) {
4530 (void) bhitm(mon, obj);
4531 /* if (context.botl) bot(); */
4533 if (affects_objects && level.objects[x][y]) {
4534 (void) bhitpile(obj, bhito, x, y, 0);
4536 bot(); /* potion effects */
4540 * Wand breakage is targetting the hero. Using xdir[]+ydir[]
4541 * deltas for location selection causes this case to happen
4542 * after all the surrounding squares have been handled.
4543 * Process objects first, in case damage is fatal and leaves
4544 * bones, or teleportation sends one or more of the objects to
4545 * same destination as hero (lookhere/autopickup); also avoids
4546 * the polymorphing of gear dropped due to hero's transformation.
4547 * (Unlike with monsters being hit by zaps, we can't rely on use
4548 * of obj->bypass in the zap code to accomplish that last case
4549 * since it's also used by retouch_equipment() for polyself.)
4551 if (affects_objects && level.objects[x][y]) {
4552 (void) bhitpile(obj, bhito, x, y, 0);
4554 bot(); /* potion effects */
4556 damage = zapyourself(obj, FALSE);
4559 Sprintf(buf, "killed %sself by breaking a wand", uhim());
4560 losehp(Maybe_Half_Phys(damage), buf, NO_KILLER_PREFIX);
4562 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82Å
\8fñ
\82ð
\89ó
\82µ
\82Ä
\83_
\83\81\81[
\83W
\82ð
\8eó
\82¯");
4563 losehp(Maybe_Half_Phys(damage), buf, KILLED_BY);
4567 bot(); /* blindness */
4571 /* potentially give post zap/break feedback */
4574 /* Note: if player fell thru, this call is a no-op.
4575 Damage is handled in digactualhole in that case */
4578 pay_for_damage("dig into", FALSE);
4580 pay_for_damage("
\8c\8a\82ð
\82 \82¯
\82é", FALSE);
4582 if (obj->otyp == WAN_LIGHT)
4583 litroom(TRUE, obj); /* only needs to be done once */
4585 discard_broken_wand:
4586 obj = current_wand; /* [see dozap() and destroy_item()] */
4595 add_class(cl, class)
4606 static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
4608 /* augment tools[] if various items are carried */
4610 setapplyclasses(class_list)
4613 register struct obj *otmp;
4615 boolean knowoil, knowtouchstone, addpotions, addstones, addfood;
4617 knowoil = objects[POT_OIL].oc_name_known;
4618 knowtouchstone = objects[TOUCHSTONE].oc_name_known;
4619 addpotions = addstones = addfood = FALSE;
4620 for (otmp = invent; otmp; otmp = otmp->nobj) {
4623 || (otmp->oclass == POTION_CLASS
4625 || (!knowoil && !objects[otyp].oc_name_known))))
4627 if (otyp == TOUCHSTONE
4628 || (is_graystone(otmp)
4630 || (!knowtouchstone && !objects[otyp].oc_name_known))))
4632 if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF)
4636 class_list[0] = '\0';
4637 if (addpotions || addstones)
4638 add_class(class_list, ALL_CLASSES);
4639 Strcat(class_list, tools);
4641 add_class(class_list, POTION_CLASS);
4643 add_class(class_list, GEM_CLASS);
4645 add_class(class_list, FOOD_CLASS);
4648 /* the 'a' command */
4653 register int res = 1;
4654 char class_list[MAXOCLASSES + 2];
4656 if (check_capacity((char *) 0))
4659 setapplyclasses(class_list); /* tools[] */
4660 obj = getobj(class_list, "use or apply");
4664 if (!retouch_object(&obj, FALSE))
4665 return 1; /* evading your grasp costs a turn; just be
4666 grateful that you don't drop it as well */
4668 if (obj->oclass == WAND_CLASS)
4669 return do_break_wand(obj);
4671 switch (obj->otyp) {
4674 if (obj == ublindf) {
4677 } else if (!ublindf) {
4681 You("are already %s.", ublindf->otyp == TOWEL
4682 ? "covered by a towel"
4683 : ublindf->otyp == BLINDFOLD
4684 ? "wearing a blindfold"
4685 : "wearing lenses");
4687 You("
\82à
\82¤%s
\82Ä
\82¢
\82é
\81D", ublindf->otyp == TOWEL
4688 ? "
\83^
\83I
\83\8b\82ð
\8aª
\82¢"
4689 : ublindf->otyp == BLINDFOLD
4690 ? "
\96Ú
\89B
\82µ
\82ð
\82Â
\82¯"
4691 : "
\83\8c\83\93\83Y
\82ð
\82Â
\82¯");
4696 res = use_cream_pie(obj);
4699 res = use_whip(obj);
4701 case GRAPPLING_HOOK:
4702 res = use_grapple(obj);
4708 case BAG_OF_HOLDING:
4710 res = use_container(&obj, 1, FALSE);
4713 (void) bagotricks(obj, FALSE, (int *) 0);
4721 res = (pick_lock(obj) != 0);
4724 case DWARVISH_MATTOCK:
4725 res = use_pick_axe(obj);
4728 use_tinning_kit(obj);
4731 res = use_leash(obj);
4734 res = use_saddle(obj);
4737 use_magic_whistle(obj);
4742 case EUCALYPTUS_LEAF:
4743 /* MRKR: Every Australian knows that a gum leaf makes an excellent
4744 * whistle, especially if your pet is a tame kangaroo named Skippy.
4747 use_magic_whistle(obj);
4748 /* sometimes the blessing will be worn off */
4752 pline("%s %s.", Yobjnam2(obj, "glow"), hcolor("brown"));
4754 pline("%s
\82Í%s
\8bP
\82¢
\82½
\81D", xname(obj), jconj_adj(hcolor("
\92\83\90F
\82Ì")));
4764 res = use_stethoscope(obj);
4767 res = use_mirror(obj);
4770 case BELL_OF_OPENING:
4773 case CANDELABRUM_OF_INVOCATION:
4774 use_candelabrum(obj);
4786 light_cocktail(&obj);
4788 case EXPENSIVE_CAMERA:
4789 res = use_camera(obj);
4792 res = use_towel(obj);
4795 use_crystal_ball(&obj);
4801 res = use_tin_opener(obj);
4807 use_unicorn_horn(obj);
4818 case DRUM_OF_EARTHQUAKE:
4819 res = do_play_instrument(obj);
4821 case HORN_OF_PLENTY: /* not a musical instrument */
4822 (void) hornoplenty(obj, FALSE);
4835 /* Pole-weapons can strike at a distance */
4837 res = use_pole(obj);
4839 } else if (is_pick(obj) || is_axe(obj)) {
4840 res = use_pick_axe(obj);
4844 pline("Sorry, I don't know how to use that.");
4846 pline("
\82»
\82ê
\82ð
\82Ç
\82¤
\82â
\82Á
\82Ä
\8eg
\82¤
\82ñ
\82¾
\82¢
\81H");
4850 if (res && obj && obj->oartifact)
4856 /* Keep track of unfixable troubles for purposes of messages saying you feel
4860 unfixable_trouble_count(is_horn)
4863 int unfixable_trbl = 0;
4869 if (Wounded_legs && !u.usteed)
4873 /* lycanthropy is undesirable, but it doesn't actually make you feel bad */
4875 if (!is_horn || (Confusion & ~TIMEOUT))
4877 if (!is_horn || (Sick & ~TIMEOUT))
4879 if (!is_horn || (HHallucination & ~TIMEOUT))
4881 if (!is_horn || (Vomiting & ~TIMEOUT))
4883 if (!is_horn || (HStun & ~TIMEOUT))
4885 if (!is_horn || (HDeaf & ~TIMEOUT))
4888 return unfixable_trbl;