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-2019 */
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)
247 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 */
268 more_corpses = (corpse && nxtobj(corpse, CORPSE, TRUE));
271 /* additional stethoscope messages from jyoung@apanix.apana.org.au */
272 if (!corpse && !statue) {
273 ; /* nothing to do */
275 } else if (Hallucination) {
279 Strcpy(buf, "You're both stoned");
281 Strcpy(buf, "
\90Î
\82¾");
282 #if 0 /*JP*//*
\91ã
\96¼
\8e\8c\8f\88\97\9d\82Í
\95s
\97v*/
283 } else if (corpse->quan == 1L && !more_corpses) {
284 int gndr = 2; /* neuter: "it" */
285 struct monst *mtmp = get_mtraits(corpse, FALSE);
287 /* (most corpses don't retain the monster's sex, so
288 we're usually forced to use generic pronoun here) */
290 mptr = &mons[mtmp->mnum];
291 /* can't use mhe() here; it calls pronoun_gender() which
292 expects monster to be on the map (visibility check) */
293 if ((humanoid(mptr) || (mptr->geno & G_UNIQ)
294 || type_is_pname(mptr)) && !is_neuter(mptr))
295 gndr = (int) mtmp->female;
297 mptr = &mons[corpse->corpsenm];
300 else if (is_male(mptr))
303 Sprintf(buf, "%s's dead", genders[gndr].he); /* "he"/"she"/"it" */
304 buf[0] = highc(buf[0]);
306 } else { /* plural */
308 Strcpy(buf, "They're dead");
310 Strcpy(buf, "
\8e\80\82ñ
\82Å
\82é
\82º");
312 /* variations on "He's dead, Jim." (Star Trek's Dr McCoy) */
314 You_hear("a voice say, \"%s, Jim.\"", buf);
316 You_hear("
\81u
\82»
\82¢
\82Â
\82Í%s
\81C
\83W
\83\80\81v
\82Æ
\82¢
\82¤
\90º
\82ª
\95·
\82±
\82¦
\82½
\81D", buf);
322 boolean here = (rx == u.ux && ry == u.uy),
323 one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
325 boolean here = (rx == u.ux && ry == u.uy), reviver = FALSE;
327 int visglyph, corpseglyph;
329 visglyph = glyph_at(rx, ry);
330 corpseglyph = obj_to_glyph(corpse);
332 if (Blind && (visglyph != corpseglyph))
333 map_object(corpse, TRUE);
335 if (Role_if(PM_HEALER)) {
336 /* ok to reset `corpse' here; we're done with it */
338 if (obj_has_timer(corpse, REVIVE_MON))
341 corpse = nxtobj(corpse, CORPSE, TRUE);
342 } while (corpse && !reviver);
345 You("determine that %s unfortunate being%s %s%s dead.",
346 one ? (here ? "this" : "that") : (here ? "these" : "those"),
347 one ? "" : "s", one ? "is" : "are", reviver ? " mostly" : "");
349 You("%s
\95s
\8dK
\82È
\90¶
\82«
\95¨
\82Í%s
\8e\80\82ñ
\82Å
\82¢
\82é
\82Æ
\8c\8b\98_
\82µ
\82½
\81D",
350 here ? "
\82±
\82Ì" : "
\82»
\82Ì",
351 reviver ? "
\82Ù
\82Ú" : "");
355 } else { /* statue */
356 const char *what, *how;
359 mptr = &mons[statue->corpsenm];
360 if (Blind) { /* ignore statue->dknown; it'll always be set */
361 Sprintf(buf, "%s %s",
362 (rx == u.ux && ry == u.uy) ? "This" : "That",
363 humanoid(mptr) ? "person" : "creature");
367 if (!type_is_pname(mptr))
370 #else /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\83V
\83\93\83v
\83\8b\82É*/
371 if (Blind) { /* ignore statue->dknown; it'll always be set */
372 what = (rx == u.ux && ry == u.uy) ? "
\82±
\82ê" : "
\82 \82ê";
374 what = mons[statue->corpsenm].mname;
381 if (Role_if(PM_HEALER)) {
382 struct trap *ttmp = t_at(rx, ry);
384 if (ttmp && ttmp->ttyp == STATUE_TRAP)
386 how = "extraordinary";
388 how = "
\95À
\8aO
\82ê
\82½";
389 else if (Has_contents(statue))
393 how = "
\92\8d\96Ú
\82·
\82×
\82«";
397 pline("%s is in %s health for a statue.", what, how);
399 pline("
\92¤
\91\9c\82Æ
\82µ
\82Ä
\82Ì%s
\82Í%s
\8dì
\95i
\82¾
\81D", what, how);
402 return FALSE; /* no corpse or statue */
406 static const char hollow_str[] = "a hollow sound. This must be a secret %s!";
408 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";
410 /* Strictly speaking it makes no sense for usage of a stethoscope to
411 not take any time; however, unless it did, the stethoscope would be
412 almost useless. As a compromise, one use per turn is free, another
413 uses up the turn; this makes curse status have a tangible effect. */
416 register struct obj *obj;
421 boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
422 && !rn2(Role_if(PM_HEALER) ? 10 : 3));
424 if (nohands(youmonst.data)) {
426 You("have no hands!"); /* not `body_part(HAND)' */
428 pline("
\82 \82È
\82½
\82É
\82Í
\8eè
\82ª
\82È
\82¢
\81I");
433 You_cant("hear anything!");
435 You("
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81I");
437 } else if (!freehand()) {
439 You("have no free %s.", body_part(HAND));
441 You("%s
\82Ì
\8e©
\97R
\82ª
\8cø
\82©
\82È
\82¢
\81D", body_part(HAND));
444 if (!getdir((char *) 0))
447 res = (moves == context.stethoscope_move)
448 && (youmonst.movement == context.stethoscope_movement);
449 context.stethoscope_move = moves;
450 context.stethoscope_movement = youmonst.movement;
452 bhitpos.x = u.ux, bhitpos.y = u.uy; /* tentative, reset below */
453 notonhead = u.uswallow;
454 if (u.usteed && u.dz > 0) {
457 pline("%s interferes.", Monnam(u.ustuck));
459 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
460 mstatusline(u.ustuck);
462 mstatusline(u.usteed);
464 } else if (u.uswallow && (u.dx || u.dy || u.dz)) {
465 mstatusline(u.ustuck);
467 } else if (u.uswallow && interference) {
469 pline("%s interferes.", Monnam(u.ustuck));
471 pline("%s
\82ª
\82¶
\82á
\82Ü
\82ð
\82µ
\82½
\81D", Monnam(u.ustuck));
472 mstatusline(u.ustuck);
477 You_hear("faint splashing.");
479 You_hear("
\82©
\82·
\82©
\82É
\83o
\83V
\83\83\83o
\83V
\83\83\82Æ
\82¢
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81D");
480 else if (u.dz < 0 || !can_reach_floor(TRUE))
481 cant_reach_floor(u.ux, u.uy, (u.dz < 0), TRUE);
482 else if (its_dead(u.ux, u.uy, &res))
483 ; /* message already given */
484 else if (Is_stronghold(&u.uz))
486 You_hear("the crackling of hellfire.");
488 You_hear("
\92n
\8d\96\82Ì
\89\8a\82ª
\83p
\83`
\83p
\83`
\94R
\82¦
\82Ä
\82¢
\82é
\89¹
\82ð
\95·
\82¢
\82½
\81D");
491 pline_The("%s seems healthy enough.", surface(u.ux, u.uy));
493 pline("%s
\82Í
\8f[
\95ª
\8c\92\8dN
\82Ì
\82æ
\82¤
\82¾
\81D", surface(u.ux,u.uy));
495 } else if (obj->cursed && !rn2(2)) {
497 You_hear("your heart beat.");
499 You_hear("
\8e©
\95ª
\82Ì
\90S
\91\9f\82Ì
\8cÛ
\93®
\82ð
\95·
\82¢
\82½
\81D");
502 if (Stunned || (Confusion && !rn2(5)))
504 if (!u.dx && !u.dy) {
512 You_hear("a faint typing noise.");
514 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");
517 if ((mtmp = m_at(rx, ry)) != 0) {
518 const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *) 0,
519 SUPPRESS_IT | SUPPRESS_INVISIBLE, FALSE);
521 /* bhitpos needed by mstatusline() iff mtmp is a long worm */
522 bhitpos.x = rx, bhitpos.y = ry;
523 notonhead = (mtmp->mx != rx || mtmp->my != ry);
525 if (mtmp->mundetected) {
526 if (!canspotmon(mtmp))
528 There("is %s hidden there.", mnm);
530 pline("
\82±
\82±
\82É%s
\82ª
\89B
\82ê
\82Ä
\82¢
\82é
\81D", mnm);
531 mtmp->mundetected = 0;
532 newsym(mtmp->mx, mtmp->my);
533 } else if (mtmp->mappearance) {
534 const char *what = "thing";
536 switch (mtmp->m_ap_type) {
538 what = simple_typename(mtmp->mappearance);
540 case M_AP_MONSTER: /* ignore Hallucination here */
541 what = mons[mtmp->mappearance].mname;
544 what = defsyms[mtmp->mappearance].explanation;
549 pline("That %s is really %s.", what, mnm);
551 pline("
\82±
\82Ì%s
\82Í
\8eÀ
\8dÛ
\82É
\82Í%s
\81D", what, mnm);
552 } else if (flags.verbose && !canspotmon(mtmp)) {
554 There("is %s there.", mnm);
556 pline("
\82±
\82±
\82É
\82Í%s
\82ª
\82¢
\82é
\81D", mnm);
560 if (!canspotmon(mtmp))
561 map_invisible(rx, ry);
564 if (unmap_invisible(rx,ry))
566 pline_The("invisible monster must have moved.");
568 pline_The("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82Í
\88Ú
\93®
\82µ
\82Ä
\82µ
\82Ü
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
574 You_hear(hollow_str, "door");
576 You_hear(hollow_str, "
\94à");
577 cvt_sdoor_to_door(lev); /* ->typ = DOOR */
582 You_hear(hollow_str, "passage");
584 You_hear(hollow_str, "
\92Ê
\98H");
586 unblock_point(rx, ry);
591 if (!its_dead(rx, ry, &res))
593 You("hear nothing special."); /* not You_hear() */
595 pline("
\93Á
\82É
\89½
\82à
\95·
\82±
\82¦
\82È
\82¢
\81D");
601 static const char whistle_str[] = "produce a %s whistling sound.";
603 static const char whistle_str[] = "
\93J
\82ð
\90\81\82¢
\82Ä%s
\89¹
\82ð
\82½
\82Ä
\82½
\81D";
609 if (!can_blow(&youmonst)) {
611 You("are incapable of using the whistle.");
613 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
614 } else if (Underwater) {
616 You("blow bubbles through %s.", yname(obj));
618 You("%s
\82ð
\92Ê
\82µ
\82Ä
\96A
\82ð
\8fo
\82µ
\82½
\81D", xname(obj));
622 You_feel("rushing air tickle your %s.",
625 You_feel("
\8bó
\8bC
\82Ì
\97¬
\82ê
\82ª%s
\82ð
\82
\82·
\82®
\82Á
\82½
\81D",
630 You(whistle_str, obj->cursed ? "shrill" : "high");
632 You(whistle_str, obj->cursed ? "
\95s
\8bC
\96¡
\82È" : "
\82©
\82ñ
\8d\82\82¢");
640 use_magic_whistle(obj)
643 register struct monst *mtmp, *nextmon;
645 if (!can_blow(&youmonst)) {
647 You("are incapable of using the whistle.");
649 You("
\93J
\82ð
\8eg
\82¤
\94\
\97Í
\82ª
\82È
\82¢
\81D");
650 } else if (obj->cursed && !rn2(2)) {
652 You("produce a %shigh-pitched humming noise.",
653 Underwater ? "very " : "");
655 You("%s
\8d\82\82¢
\92²
\8eq
\82Ì
\82¤
\82È
\82é
\82æ
\82¤
\82È
\89¹
\82ð
\82½
\82Ä
\82½
\81D",
656 Underwater ? "
\82Æ
\82Ä
\82à" : "");
660 int pet_cnt = 0, omx, omy;
662 /* it's magic! it works underwater too (at a higher pitch) */
665 Hallucination ? "normal" : Underwater ? "strange, high-pitched"
669 Hallucination ? "
\93J
\82Ì
\82æ
\82¤
\82È" : Underwater ? "
\95s
\8ev
\8bc
\82È
\8d\82\82¢
\92²
\8eq
\82Ì"
670 : "
\95s
\8ev
\8bc
\82È");
672 for (mtmp = fmon; mtmp; mtmp = nextmon) {
673 nextmon = mtmp->nmon; /* trap might kill mon */
674 if (DEADMONSTER(mtmp))
676 /* steed is already at your location, so not affected;
677 this avoids trap issues if you're on a trap location */
678 if (mtmp == u.usteed)
681 if (mtmp->mtrapped) {
682 /* no longer in previous trap (affects mintrap) */
684 fill_pit(mtmp->mx, mtmp->my);
686 /* mimic must be revealed before we know whether it
687 actually moves because line-of-sight may change */
690 omx = mtmp->mx, omy = mtmp->my;
692 if (mtmp->mx != omx || mtmp->my != omy) {
693 mtmp->mundetected = 0; /* reveal non-mimic hider */
694 if (canspotmon(mtmp))
696 if (mintrap(mtmp) == 2)
702 makeknown(obj->otyp);
710 return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
719 for (obj = invent; obj; obj = obj->nobj)
720 if (obj->otyp == LEASH && obj->leashmon != 0)
725 /* otmp is about to be destroyed or stolen */
728 register struct obj *otmp;
730 register struct monst *mtmp;
732 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
733 if (mtmp->m_id == (unsigned) otmp->leashmon)
738 /* mtmp is about to die, or become untame */
740 m_unleash(mtmp, feedback)
741 register struct monst *mtmp;
744 register struct obj *otmp;
749 pline("%s pulls free of %s leash!", Monnam(mtmp), mhis(mtmp));
751 pline("%s
\82Í
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82Ä
\93¦
\82ê
\82½
\81I", Monnam(mtmp));
754 Your("leash falls slack.");
756 Your("
\95R
\82ª
\82½
\82é
\82ñ
\82Å
\97\8e\82¿
\82½
\81D");
758 for (otmp = invent; otmp; otmp = otmp->nobj)
759 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
764 /* player is about to die (for bones) */
768 register struct obj *otmp;
769 register struct monst *mtmp;
771 for (otmp = invent; otmp; otmp = otmp->nobj)
772 if (otmp->otyp == LEASH)
774 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
781 * This ought to exclude various other things, such as lights and gas
782 * spore, is_whirly() critters, ethereal creatures, possibly others.
788 return (boolean) (mtmp->mnum != PM_LONG_WORM);
801 /* if the leash isn't in use, assume we're trying to leash
802 the engulfer; if it is use, distinguish between removing
803 it from the engulfer versus from some other creature
804 (note: the two in-use cases can't actually occur; all
805 leashes are released when the hero gets engulfed) */
807 You_cant((!obj->leashmon
808 ? "leash %s from inside."
809 : (obj->leashmon == (int) u.ustuck->m_id)
810 ? "unleash %s from inside."
811 : "unleash anything from inside %s."),
812 noit_mon_nam(u.ustuck));
814 You_cant((!obj->leashmon
815 ? "
\93à
\91¤
\82©
\82ç%s
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"
816 : (obj->leashmon == (int) u.ustuck->m_id)
817 ? "
\93à
\91¤
\82©
\82ç%s
\82ð
\8aO
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"
818 : "%s
\82Ì
\93à
\91¤
\82©
\82ç
\8aO
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D"),
819 noit_mon_nam(u.ustuck));
823 if (!obj->leashmon && number_leashed() >= MAXLEASHED) {
825 You("cannot leash any more pets.");
827 You("
\82±
\82ê
\88È
\8fã
\83y
\83b
\83g
\82É
\95R
\82ð
\82©
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
831 if (!get_adjacent_loc((char *) 0, (char *) 0, u.ux, u.uy, &cc))
834 if (cc.x == u.ux && cc.y == u.uy) {
835 if (u.usteed && u.dz > 0) {
841 pline("Leash yourself? Very funny...");
843 pline("
\8e©
\95ª
\82ð
\94\9b\82é
\81H
\95Ï
\82È
\82Ì
\81D
\81D
\81D");
848 * From here on out, return value is 1 == a move is used.
851 if (!(mtmp = m_at(cc.x, cc.y))) {
853 There("is no creature there.");
855 pline("
\82»
\82±
\82É
\82Í
\90¶
\82«
\95¨
\82Í
\82¢
\82È
\82¢
\81D");
856 (void) unmap_invisible(cc.x, cc.y);
860 spotmon = canspotmon(mtmp);
863 if (!spotmon && !glyph_is_invisible(levl[cc.x][cc.y].glyph)) {
864 /* for the unleash case, we don't verify whether this unseen
865 monster is the creature attached to the current leash */
867 You("fail to %sleash something.", obj->leashmon ? "un" : "");
869 You("%s
\82Ì
\82É
\8e¸
\94s
\82µ
\82½
\81D", obj->leashmon ? "
\8aO
\82·" : "
\8c\8b\82Ñ
\82Â
\82¯
\82é");
870 /* trying again will work provided the monster is tame
871 (and also that it doesn't change location by retry time) */
872 map_invisible(cc.x, cc.y);
873 } else if (!mtmp->mtame) {
875 pline("%s %s leashed!", Monnam(mtmp),
876 (!obj->leashmon) ? "cannot be" : "is not");
878 pline("%s
\82Í
\95R
\82Å%s
\81I", Monnam(mtmp),
879 (!obj->leashmon) ? "
\8c\8b\82×
\82È
\82¢" : "
\8c\8b\82Î
\82ê
\82Ä
\82¢
\82È
\82¢");
881 } else if (!obj->leashmon) {
882 /* applying a leash which isn't currently in use */
883 if (mtmp->mleashed) {
885 pline("This %s is already leashed.",
886 spotmon ? l_monnam(mtmp) : "creature");
888 pline("%s
\82Í
\82·
\82Å
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82ç
\82ê
\82Ä
\82¢
\82é
\81D",
889 spotmon ? l_monnam(mtmp) : "
\89ö
\95¨");
891 } else if (!leashable(mtmp)) {
893 pline("The leash won't fit onto %s%s.", spotmon ? "your " : "",
896 pline("
\95R
\82Í%s
\82É
\8d\87\82í
\82È
\82¢
\81D",
901 You("slip the leash around %s%s.", spotmon ? "your " : "",
904 You("%s
\82ð
\95R
\82Å
\8c\8b\82Ñ
\82Â
\82¯
\82½
\81D",
908 obj->leashmon = (int) mtmp->m_id;
912 /* applying a leash which is currently in use */
913 if (obj->leashmon != (int) mtmp->m_id) {
915 pline("This leash is not attached to that creature.");
917 pline("
\82±
\82Ì
\95R
\82Í
\82»
\82ê
\82É
\82Í
\8c\8b\82Î
\82ê
\82Ä
\82¢
\82È
\82¢
\81D");
918 } else if (obj->cursed) {
920 pline_The("leash would not come off!");
922 pline("
\95R
\82ª
\82Í
\82¸
\82ê
\82È
\82¢
\81I");
928 You("remove the leash from %s%s.",
929 spotmon ? "your " : "", l_monnam(mtmp));
931 You("%s
\82©
\82ç
\95R
\82ð
\82Í
\82¸
\82µ
\82½
\81D",
939 /* assuming mtmp->mleashed has been checked */
948 if (otmp->otyp == LEASH && otmp->leashmon == (int) mtmp->m_id)
952 return (struct obj *) 0;
958 register struct monst *mtmp;
959 register struct obj *otmp;
961 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
962 if (DEADMONSTER(mtmp))
964 if (mtmp->mleashed) {
965 if (distu(mtmp->mx, mtmp->my) > 2)
967 if (distu(mtmp->mx, mtmp->my) > 2) {
968 for (otmp = invent; otmp; otmp = otmp->nobj)
969 if (otmp->otyp == LEASH
970 && otmp->leashmon == (int) mtmp->m_id) {
974 You_feel("%s leash go slack.",
975 (number_leashed() > 1) ? "a" : "the");
977 You("
\95R
\82ª
\82½
\82é
\82ñ
\82¾
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D");
985 /* no pack mules for the Amulet */
986 if (u.usteed && mon_has_amulet(u.usteed))
995 register struct obj *otmp;
996 register struct monst *mtmp;
998 for (otmp = invent; otmp; otmp = otmp->nobj) {
999 if (otmp->otyp != LEASH || otmp->leashmon == 0)
1001 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1002 if (DEADMONSTER(mtmp))
1004 if ((int) mtmp->m_id == otmp->leashmon)
1008 impossible("leash in use isn't attached to anything?");
1012 if (dist2(u.ux, u.uy, mtmp->mx, mtmp->my)
1013 > dist2(x, y, mtmp->mx, mtmp->my)) {
1014 if (!um_dist(mtmp->mx, mtmp->my, 3)) {
1015 ; /* still close enough */
1016 } else if (otmp->cursed && !breathless(mtmp->data)) {
1017 if (um_dist(mtmp->mx, mtmp->my, 5)
1018 || (mtmp->mhp -= rnd(2)) <= 0) {
1019 long save_pacifism = u.uconduct.killer;
1022 Your("leash chokes %s to death!", mon_nam(mtmp));
1024 pline("%s
\82Í
\8di
\82ß
\8eE
\82³
\82ê
\82½
\81I",mon_nam(mtmp));
1025 /* hero might not have intended to kill pet, but
1026 that's the result of his actions; gain experience,
1027 lose pacifism, take alignment and luck hit, make
1028 corpse less likely to remain tame after revival */
1029 xkilled(mtmp, XKILL_NOMSG);
1030 /* life-saving doesn't ordinarily reset this */
1032 u.uconduct.killer = save_pacifism;
1035 pline("%s is choked by the leash!", Monnam(mtmp));
1037 pline("%s
\82Í
\95R
\82Å
\8eñ
\82ð
\8di
\82ß
\82ç
\82ê
\82½
\81I", Monnam(mtmp));
1038 /* tameness eventually drops to 1 here (never 0) */
1039 if (mtmp->mtame && rn2(mtmp->mtame))
1043 if (um_dist(mtmp->mx, mtmp->my, 5)) {
1045 pline("%s leash snaps loose!", s_suffix(Monnam(mtmp)));
1047 pline("%s
\82Ì
\95R
\82Í
\83p
\83`
\83\93\82Æ
\8aO
\82ê
\82½
\81I", Monnam(mtmp));
1048 m_unleash(mtmp, FALSE);
1051 You("pull on the leash.");
1053 You("
\95R
\82ð
\88ø
\82Á
\82Ï
\82Á
\82½
\81D");
1054 if (mtmp->data->msound != MS_SILENT)
1075 return ((ACURR(A_CHA) > 14)
1076 ? ((poly_gender() == 1)
1082 /*JP
\8cê
\8a²
\82Å
\8eg
\82¤ */
1090 static const char look_str[] = "look %s.";
1092 static const char look_str[] = "%s
\8c©
\82¦
\82é
\81D";
1098 const char *mirror, *uvisage;
1102 boolean vis, invis_mirror, useeit, monable;
1104 if (!getdir((char *) 0))
1106 invis_mirror = Invis;
1107 useeit = !Blind && (!invis_mirror || See_invisible);
1108 uvisage = beautiful();
1109 mirror = simpleonames(obj); /* "mirror" or "looking glass" */
1110 if (obj->cursed && !rn2(2)) {
1113 pline_The("%s fogs up and doesn't reflect!", mirror);
1115 pline("%s
\82Í
\93Ü
\82è
\81C
\89f
\82ç
\82È
\82
\82È
\82Á
\82½
\81I", mirror);
1118 if (!u.dx && !u.dy && !u.dz) {
1121 You_cant("see your %s %s.", uvisage, body_part(FACE));
1123 You_cant("
\8e©
\95ª
\82Ì%s
\82¢%s
\82ð
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", uvisage, body_part(FACE));
1125 if (u.umonnum == PM_FLOATING_EYE) {
1128 You("stiffen momentarily under your gaze.");
1130 pline("
\88ê
\8fu
\82 \82È
\82½
\82Ì
\82É
\82ç
\82Ý
\82Å
\8dd
\92¼
\82µ
\82½
\81D");
1134 pline("Yow! The %s stares back!", mirror);
1136 pline("
\82¨
\82ì
\81I%s
\82ª
\82 \82È
\82½
\82ð
\82É
\82ç
\82Ý
\95Ô
\82µ
\82½
\81I", mirror);
1139 pline("Yikes! You've frozen yourself!");
1141 pline("
\82¨
\82ì
\81I
\82 \82È
\82½
\82Í
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81I");
1142 if (!Hallucination || !rn2(4)) {
1143 nomul(-rnd(MAXULEV + 6 - u.ulevel));
1145 multi_reason = "gazing into a mirror";
1147 multi_reason = "
\8b¾
\82É
\94½
\8eË
\82µ
\82½
\8e\8b\90ü
\82Å
\8dd
\92¼
\82µ
\82Ä
\82¢
\82é
\8aÔ
\82É";
1149 nomovemsg = 0; /* default, "you can move again" */
1151 } else if (youmonst.data->mlet == S_VAMPIRE)
1153 You("don't have a reflection.");
1155 You("
\8b¾
\82É
\89f
\82ç
\82È
\82©
\82Á
\82½
\81D");
1156 else if (u.umonnum == PM_UMBER_HULK) {
1158 pline("Huh? That doesn't look like you!");
1160 pline("
\82Ù
\82¦
\81H
\8eÊ
\82Á
\82Ä
\82é
\82Ì
\82Í
\82 \82È
\82½
\82¶
\82á
\82È
\82¢
\82Ý
\82½
\82¢
\82¾
\81I");
1161 make_confused(HConfusion + d(3, 4), FALSE);
1162 } else if (Hallucination)
1163 You(look_str, hcolor((char *) 0));
1166 You(look_str, "peaked");
1168 You(look_str, "
\8aç
\90F
\82ª
\88«
\82");
1169 else if (u.uhs >= WEAK)
1171 You(look_str, "undernourished");
1173 You(look_str, "
\89h
\97{
\8e¸
\92²
\82Ì
\82æ
\82¤
\82É");
1176 You("look as %s as ever.", uvisage);
1178 You("
\82 \82¢
\82©
\82í
\82ç
\82¸%s
\82
\8c©
\82¦
\82é
\81D", uvisage);
1185 You("reflect %s %s.", s_suffix(mon_nam(u.ustuck)),
1186 mbodypart(u.ustuck, STOMACH));
1188 You("%s
\82Ì%s
\82ð
\89f
\82µ
\82½
\81D", mon_nam(u.ustuck),
1189 mbodypart(u.ustuck, STOMACH));
1196 You(Hallucination ? "give the fish a chance to fix their makeup."
1197 : "reflect the murky water.");
1199 You(Hallucination ? "
\8b\9b\82É
\89»
\8fÏ
\92¼
\82µ
\82Ì
\8b@
\89ï
\82ð
\97^
\82¦
\82½
\81D"
1200 : "
\82 \82È
\82½
\82Í
\97\84\82ñ
\82¾
\90\85\82ð
\89f
\82µ
\82½
\81D");
1207 You("reflect the %s.",
1209 You("%s
\82ð
\89f
\82µ
\82½
\81D",
1210 (u.dz > 0) ? surface(u.ux, u.uy) : ceiling(u.ux, u.uy));
1213 mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
1214 (int FDECL((*), (MONST_P, OBJ_P))) 0,
1215 (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
1216 if (!mtmp || !haseyes(mtmp->data) || notonhead)
1219 /* couldsee(mtmp->mx, mtmp->my) is implied by the fact that bhit()
1220 targetted it, so we can ignore possibility of X-ray vision */
1221 vis = canseemon(mtmp);
1222 /* ways to directly see monster (excludes X-ray vision, telepathy,
1223 extended detection, type-specific warning) */
1224 #define SEENMON (MONSEEN_NORMAL | MONSEEN_SEEINVIS | MONSEEN_INFRAVIS)
1225 how_seen = vis ? howmonseen(mtmp) : 0;
1226 /* whether monster is able to use its vision-based capabilities */
1227 monable = !mtmp->mcan && (!mtmp->minvis || perceives(mtmp->data));
1228 mlet = mtmp->data->mlet;
1229 if (mtmp->msleeping) {
1232 pline("%s is too tired to look at your %s.", Monnam(mtmp),
1234 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),
1236 } else if (!mtmp->mcansee) {
1239 pline("%s can't see anything right now.", Monnam(mtmp));
1241 pline("%s
\82Í
\8d¡
\82Ì
\82Æ
\82±
\82ë
\89½
\82à
\8c©
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D", Monnam(mtmp));
1242 } else if (invis_mirror && !perceives(mtmp->data)) {
1245 pline("%s fails to notice your %s.", Monnam(mtmp), mirror);
1247 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82É
\8bC
\95t
\82©
\82È
\82©
\82Á
\82½
\81D", Monnam(mtmp), mirror);
1248 /* infravision doesn't produce an image in the mirror */
1249 } else if ((how_seen & SEENMON) == MONSEEN_INFRAVIS) {
1250 if (vis) /* (redundant) */
1252 pline("%s is too far away to see %sself in the dark.",
1253 Monnam(mtmp), mhim(mtmp));
1255 pline("%s
\82Í
\88Ã
\88Å
\82Å
\8e©
\95ª
\8e©
\90g
\82ð
\8c©
\82é
\82É
\82Í
\89\93\82·
\82¬
\82é
\81D", Monnam(mtmp));
1257 /* some monsters do special things */
1258 } else if (mlet == S_VAMPIRE || mlet == S_GHOST || is_vampshifter(mtmp)) {
1261 pline("%s doesn't have a reflection.", Monnam(mtmp));
1263 pline("%s
\82Í%s
\82É
\89f
\82ç
\82È
\82¢
\81D", Monnam(mtmp), mirror);
1264 } else if (monable && mtmp->data == &mons[PM_MEDUSA]) {
1266 if (mon_reflects(mtmp, "The gaze is reflected away by %s %s!"))
1268 if (mon_reflects(mtmp, "
\82É
\82ç
\82Ý
\82Í%s
\82Ì%s
\82Å
\94½
\8eË
\82µ
\82½
\81I"))
1272 pline("%s is turned to stone!", Monnam(mtmp));
1274 pline("%s
\82Í
\90Î
\82É
\82È
\82Á
\82½
\81I", Monnam(mtmp));
1277 } else if (monable && mtmp->data == &mons[PM_FLOATING_EYE]) {
1278 int tmp = d((int) mtmp->m_lev, (int) mtmp->data->mattk[0].damd);
1283 pline("%s is frozen by its reflection.", Monnam(mtmp));
1285 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\8c©
\82Ä
\93®
\82¯
\82È
\82
\82È
\82Á
\82½
\81D", Monnam(mtmp));
1288 You_hear("%s stop moving.", something);
1290 You_hear("
\89½
\82©
\82ª
\93®
\82«
\82ð
\82Æ
\82ß
\82½
\89¹
\82ð
\95·
\82¢
\82½
\81D");
1291 paralyze_monst(mtmp, (int) mtmp->mfrozen + tmp);
1292 } else if (monable && mtmp->data == &mons[PM_UMBER_HULK]) {
1295 pline("%s confuses itself!", Monnam(mtmp));
1297 pline("%s
\82Í
\8d¬
\97\90\82µ
\82½
\81I", Monnam(mtmp));
1299 } else if (monable && (mlet == S_NYMPH || mtmp->data == &mons[PM_SUCCUBUS]
1300 || mtmp->data == &mons[PM_INCUBUS])) {
1302 char buf[BUFSZ]; /* "She" or "He" */
1305 pline("%s admires %sself in your %s.", Monnam(mtmp), mhim(mtmp),
1308 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\82¤
\82Á
\82Æ
\82è
\82µ
\82½
\81D", Monnam(mtmp));
1311 pline("%s takes it!", upstart(strcpy(buf, mhe(mtmp))));
1313 pline("%s
\82Í
\82»
\82ê
\82ð
\92D
\82Á
\82½
\81I", upstart(strcpy(buf, mhe(mtmp))));
1316 pline("It steals your %s!", mirror);
1318 pline("
\89½
\8eÒ
\82©
\82ª
\82 \82È
\82½
\82Ì%s
\82ð
\93\90\82ñ
\82¾
\81I", mirror);
1319 setnotworn(obj); /* in case mirror was wielded */
1321 (void) mpickobj(mtmp, obj);
1322 if (!tele_restrict(mtmp))
1323 (void) rloc(mtmp, TRUE);
1324 } else if (!is_unicorn(mtmp->data) && !humanoid(mtmp->data)
1325 && (!mtmp->minvis || perceives(mtmp->data)) && rn2(5)) {
1328 pline("%s is frightened by its reflection.", Monnam(mtmp));
1330 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\8c©
\82Ä
\95|
\82ª
\82Á
\82½
\81D", Monnam(mtmp));
1331 monflee(mtmp, d(2, 4), FALSE, FALSE);
1332 } else if (!Blind) {
1333 if (mtmp->minvis && !See_invisible)
1335 else if ((mtmp->minvis && !perceives(mtmp->data))
1336 /* redundant: can't get here if these are true */
1337 || !haseyes(mtmp->data) || notonhead || !mtmp->mcansee)
1339 pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
1342 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82É
\8bC
\82ª
\82Â
\82¢
\82Ä
\82È
\82¢
\82æ
\82¤
\82¾
\81D", Monnam(mtmp));
1346 pline("%s ignores %s reflection.", Monnam(mtmp), mhis(mtmp));
1348 pline("%s
\82Í
\8e©
\95ª
\82Ì
\8ep
\82ð
\96³
\8e\8b\82µ
\82½
\81D", Monnam(mtmp));
1357 register struct obj *obj = *optr;
1359 boolean wakem = FALSE, learno = FALSE,
1360 ordinary = (obj->otyp != BELL_OF_OPENING || !obj->spe),
1362 (obj->otyp == BELL_OF_OPENING && invocation_pos(u.ux, u.uy)
1363 && !On_stairs(u.ux, u.uy));
1366 You("ring %s.", the(xname(obj)));
1368 You("%s
\82ð
\96Â
\82ç
\82µ
\82½
\81D", the(xname(obj)));
1370 if (Underwater || (u.uswallow && ordinary)) {
1372 amii_speaker(obj, "AhDhGqEqDhEhAqDqFhGw", AMII_MUFFLED_VOLUME);
1375 pline("But the sound is muffled.");
1377 pline("
\82µ
\82©
\82µ
\89¹
\82Í
\82©
\82«
\8fÁ
\82³
\82ê
\82½
\81D");
1379 } else if (invoking && ordinary) {
1380 /* needs to be recharged... */
1382 pline("But it makes no sound.");
1384 pline("
\82µ
\82©
\82µ
\81C
\89¹
\82Í
\96Â
\82ç
\82È
\82©
\82Á
\82½
\81D");
1385 learno = TRUE; /* help player figure out why */
1387 } else if (ordinary) {
1389 amii_speaker(obj, "ahdhgqeqdhehaqdqfhgw", AMII_MUFFLED_VOLUME);
1391 if (obj->cursed && !rn2(4)
1392 /* note: once any of them are gone, we stop all of them */
1393 && !(mvitals[PM_WOOD_NYMPH].mvflags & G_GONE)
1394 && !(mvitals[PM_WATER_NYMPH].mvflags & G_GONE)
1395 && !(mvitals[PM_MOUNTAIN_NYMPH].mvflags & G_GONE)
1396 && (mtmp = makemon(mkclass(S_NYMPH, 0), u.ux, u.uy, NO_MINVENT))
1399 You("summon %s!", a_monnam(mtmp));
1401 You("%s
\82ð
\8f¢
\8a«
\82µ
\82½
\81I", a_monnam(mtmp));
1402 if (!obj_resists(obj, 93, 100)) {
1404 pline("%s shattered!", Tobjnam(obj, "have"));
1406 pline("%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82½
\81I", xname(obj));
1414 mon_adjust_speed(mtmp, 2, (struct obj *) 0);
1416 case 2: /* no explanation; it just happens... */
1418 multi_reason = NULL;
1426 /* charged Bell of Opening */
1427 consume_obj_charge(obj, TRUE);
1433 pline1(nothing_happens);
1435 } else if (obj->cursed) {
1440 mkundead(&mm, FALSE, NO_MINVENT);
1443 } else if (invoking) {
1445 pline("%s an unsettling shrill sound...", Tobjnam(obj, "issue"));
1447 pline("%s
\82Í
\95s
\8bC
\96¡
\82È
\89s
\82¢
\89¹
\82ð
\8fo
\82µ
\82½
\81D
\81D
\81D", xname(obj));
1449 amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
1455 } else if (obj->blessed) {
1459 amii_speaker(obj, "ahahahDhEhCw", AMII_SOFT_VOLUME);
1464 } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1465 buried_ball_to_freedom();
1471 pline1(nothing_happens);
1475 pline("%s opens...", Something);
1477 pline("
\89½
\82©
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1482 pline("Things open around you...");
1484 pline("
\82Ü
\82í
\82è
\82Ì
\95¨
\82ª
\8aJ
\82¢
\82½
\81D
\81D
\81D");
1489 } else { /* uncursed */
1491 amii_speaker(obj, "AeFeaeFeAefegw", AMII_OKAY_VOLUME);
1496 pline1(nothing_happens);
1499 } /* charged BofO */
1502 makeknown(BELL_OF_OPENING);
1510 use_candelabrum(obj)
1511 register struct obj *obj;
1513 #if 0 /*JP*//* not used */
1514 const char *s = (obj->spe != 1) ? "candles" : "candle";
1519 You("snuff the %s.", s);
1521 You("
\82ë
\82¤
\82»
\82
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1522 end_burn(obj, TRUE);
1525 if (obj->spe <= 0) {
1527 pline("This %s has no %s.", xname(obj), s);
1529 pline("
\82±
\82Ì%s
\82É
\82Í
\82ë
\82¤
\82»
\82
\82ª
\82È
\82¢
\81D", xname(obj));
1534 You("cannot make fire under water.");
1536 You("
\90\85\92\86\82Å
\89Î
\82ð
\82¨
\82±
\82¹
\82È
\82¢
\81D");
1539 if (u.uswallow || obj->cursed) {
1542 pline_The("%s %s for a moment, then %s.", s, vtense(s, "flicker"),
1545 pline("
\82ë
\82¤
\82»
\82
\82Ì
\89\8a\82Í
\82µ
\82Î
\82ç
\82
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D");
1551 There("%s only %d %s in %s.", vtense(s, "are"), obj->spe, s,
1554 pline("%s
\82É
\82Í
\82½
\82Á
\82½%d
\96{
\82Ì
\82ë
\82¤
\82»
\82
\82µ
\82©
\82È
\82¢
\81D",
1555 xname(obj), obj->spe);
1559 pline("%s lit. %s dimly.", obj->spe == 1 ? "It is" : "They are",
1560 Tobjnam(obj, "shine"));
1562 pline("%s
\82É
\89Î
\82ð
\82Â
\82¯
\82½
\81D%s
\82Í
\82Ù
\82Ì
\82©
\82É
\8bP
\82¢
\82½
\81D",
1563 xname(obj), xname(obj));
1567 pline("%s's %s burn%s", The(xname(obj)), s,
1568 (Blind ? "." : " brightly!"));
1570 pline("%s
\82Ì
\82ë
\82¤
\82»
\82
\82Í%s
\94R
\82¦
\82 \82ª
\82Á
\82½
\81I", The(xname(obj)),
1571 (Blind ? "" : "
\96¾
\82é
\82"));
1574 if (!invocation_pos(u.ux, u.uy) || On_stairs(u.ux, u.uy)) {
1576 pline_The("%s %s being rapidly consumed!", s, vtense(s, "are"));
1578 pline("
\82ë
\82¤
\82»
\82
\82Í
\82·
\82²
\82¢
\91¬
\82³
\82Å
\94R
\82¦
\8en
\82ß
\82½
\81I");
1579 /* this used to be obj->age /= 2, rounding down; an age of
1580 1 would yield 0, confusing begin_burn() and producing an
1581 unlightable, unrefillable candelabrum; round up instead */
1582 obj->age = (obj->age + 1L) / 2L;
1584 if (obj->spe == 7) {
1587 pline("%s a strange warmth!", Tobjnam(obj, "radiate"));
1589 pline("
\8aï
\96
\82È
\92g
\82©
\82³
\82ð%s
\82É
\8a´
\82¶
\82½
\81I", xname(obj));
1592 pline("%s with a strange light!", Tobjnam(obj, "glow"));
1594 pline("%s
\82Í
\8aï
\96
\82È
\8cõ
\82ð
\94
\82µ
\82Ä
\82¢
\82é
\81I", xname(obj));
1598 begin_burn(obj, FALSE);
1605 register struct obj *obj = *optr;
1606 register struct obj *otmp;
1608 const char *s = (obj->quan != 1) ? "candles" : "candle";
1610 const char *s = "
\82ë
\82¤
\82»
\82";
1611 char qbuf[QBUFSZ], qsfx[QBUFSZ], *q;
1618 otmp = carrying(CANDELABRUM_OF_INVOCATION);
1619 if (!otmp || otmp->spe == 7) {
1624 /*JP:
\8dÅ
\8fI
\93I
\82É
\82Í
\81u
\82ë
\82¤
\82»
\82
\82ð
\90C
\91ä
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H
\81v*/
1625 /* first, minimal candelabrum suffix for formatting candles */
1627 Sprintf(qsfx, " to\033%s?", thesimpleoname(otmp));
1629 Sprintf(qsfx, "
\82ð\033%s
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H", thesimpleoname(otmp));
1630 /* next, format the candles as a prefix for the candelabrum */
1632 (void) safe_qbuf(qbuf, "Attach ", qsfx, obj, yname, thesimpleoname, s);
1634 (void) safe_qbuf(qbuf, "", qsfx, obj, xname, thesimpleoname, s);
1635 /*JP:
\81u(
\82ë
\82¤
\82»
\82)
\82ð\033
\90C
\91ä
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H
\81v*/
1636 /* strip temporary candelabrum suffix */
1638 if ((q = strstri(qbuf, " to\033")) != 0)
1641 if ((q = strchr(qbuf, '\033')) != 0)
1643 /*JP:
\81u(
\82ë
\82¤
\82»
\82)
\82ð
\81v*/
1645 /* last, format final "attach candles to candelabrum?" query */
1647 if (yn(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
1649 if (yn(safe_qbuf(qbuf, qbuf, "
\82É
\8eæ
\82è
\82Â
\82¯
\82Ü
\82·
\82©
\81H", otmp, xname, thesimpleoname, "
\82»
\82ê"))
1654 if ((long) otmp->spe + obj->quan > 7L) {
1655 obj = splitobj(obj, 7L - (long) otmp->spe);
1656 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\95s
\97v*/
1657 /* avoid a grammatical error if obj->quan gets
1658 reduced to 1 candle from more than one */
1659 s = (obj->quan != 1) ? "candles" : "candle";
1664 You("attach %ld%s %s to %s.", obj->quan, !otmp->spe ? "" : " more", s,
1667 You("%ld
\96{
\82Ì
\82ë
\82¤
\82»
\82
\82ð%s%s
\82Ö
\8eæ
\82è
\82Â
\82¯
\82½
\81D",
1668 obj->quan, !otmp->spe ? "" : "
\82³
\82ç
\82É",
1671 if (!otmp->spe || otmp->age > obj->age)
1672 otmp->age = obj->age;
1673 otmp->spe += (int) obj->quan;
1674 if (otmp->lamplit && !obj->lamplit)
1676 pline_The("new %s magically %s!", s, vtense(s, "ignite"));
1678 pline("
\90V
\82µ
\82¢
\82ë
\82¤
\82»
\82
\82Í
\95s
\8ev
\8bc
\82È
\89\8a\82ð
\82 \82°
\82½
\81I");
1679 else if (!otmp->lamplit && obj->lamplit)
1681 pline("%s out.", (obj->quan > 1L) ? "They go" : "It goes");
1683 pline("
\89\8a\82Í
\8fÁ
\82¦
\82½
\81D");
1686 verbalize("You %s %s, you bought %s!",
1687 otmp->lamplit ? "burn" : "use",
1688 (obj->quan > 1L) ? "them" : "it",
1689 (obj->quan > 1L) ? "them" : "it");
1691 verbalize("
\89Î
\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1693 if (obj->quan < 7L && otmp->spe == 7)
1695 pline("%s now has seven%s candles attached.", The(xname(otmp)),
1696 otmp->lamplit ? " lit" : "");
1698 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",
1699 The(xname(otmp)), otmp->lamplit ? "
\89Î
\82Ì
\82Â
\82¢
\82½" : "");
1701 /* candelabrum's light range might increase */
1703 obj_merge_light_sources(otmp, otmp);
1704 /* candles are no longer a separate light source */
1706 end_burn(obj, TRUE);
1707 /* candles are now gone */
1709 /* candelabrum's weight is changing */
1710 otmp->owt = weight(otmp);
1715 /* call in drop, throw, and put in box, etc. */
1720 boolean candle = Is_candle(otmp);
1722 if ((candle || otmp->otyp == CANDELABRUM_OF_INVOCATION)
1726 #if 0 /*JP*//* not used */
1727 boolean many = candle ? (otmp->quan > 1L) : (otmp->spe > 1);
1730 (void) get_obj_location(otmp, &x, &y, 0);
1731 if (otmp->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1733 pline("%s%scandle%s flame%s extinguished.", Shk_Your(buf, otmp),
1734 (candle ? "" : "candelabrum's "), (many ? "s'" : "'s"),
1735 (many ? "s are" : " is"));
1737 pline("%s%s
\82ë
\82¤
\82»
\82
\82Ì
\89\8a\82Í
\8fÁ
\82¦
\82½
\81D", Shk_Your(buf, otmp),
1738 candle ? "" : "
\90C
\91ä
\82Ì");
1740 end_burn(otmp, TRUE);
1746 /* called when lit lamp is hit by water or put into a container or
1747 you've been swallowed by a monster; obj might be in transit while
1748 being thrown or dropped so don't assume that its location is valid */
1756 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1757 || obj->otyp == BRASS_LANTERN || obj->otyp == POT_OIL) {
1758 (void) get_obj_location(obj, &x, &y, 0);
1759 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1761 pline("%s %s out!", Yname2(obj), otense(obj, "go"));
1763 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81I", Yname2(obj));
1764 end_burn(obj, TRUE);
1767 if (snuff_candle(obj))
1773 /* Called when potentially lightable object is affected by fire_damage().
1774 Return TRUE if object was lit and FALSE otherwise --ALI */
1781 if (!obj->lamplit && (obj->otyp == MAGIC_LAMP || ignitable(obj))) {
1782 if ((obj->otyp == MAGIC_LAMP
1783 || obj->otyp == CANDELABRUM_OF_INVOCATION) && obj->spe == 0)
1785 else if (obj->otyp != MAGIC_LAMP && obj->age == 0)
1787 if (!get_obj_location(obj, &x, &y, 0))
1789 if (obj->otyp == CANDELABRUM_OF_INVOCATION && obj->cursed)
1791 if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1792 || obj->otyp == BRASS_LANTERN) && obj->cursed && !rn2(2))
1794 if (obj->where == OBJ_MINVENT ? cansee(x, y) : !Blind)
1796 pline("%s %s light!", Yname2(obj), otense(obj, "catch"));
1798 pline("%s
\82Ì
\96¾
\82©
\82è
\82ª
\82Â
\82¢
\82½
\81I", Yname2(obj));
1799 if (obj->otyp == POT_OIL)
1800 makeknown(obj->otyp);
1801 if (carried(obj) && obj->unpaid && costly_spot(u.ux, u.uy)) {
1802 /* if it catches while you have it, then it's your tough luck */
1805 verbalize("That's in addition to the cost of %s %s, of course.",
1806 yname(obj), obj->quan == 1L ? "itself" : "themselves");
1808 verbalize("
\82±
\82ê
\82Í
\82à
\82¿
\82ë
\82ñ%s
\82Ì
\92l
\92i
\82Æ
\82Í
\95Ê
\82¾
\82æ
\81D", xname(obj));
1810 bill_dummy_object(obj);
1812 begin_burn(obj, FALSE);
1825 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1826 || obj->otyp == BRASS_LANTERN)
1828 pline("%slamp is now off.", Shk_Your(buf, obj));
1830 pline("%s
\83\89\83\93\83v
\82Ì
\93\94\82Í
\8fÁ
\82¦
\82½
\81D", Shk_Your(buf, obj));
1833 You("snuff out %s.", yname(obj));
1835 You("%s
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D", xname(obj));
1836 end_burn(obj, TRUE);
1841 pline(!Is_candle(obj) ? "This is not a diving lamp"
1842 : "Sorry, fire and water don't mix.");
1844 pline(!Is_candle(obj) ? "
\82±
\82ê
\82Í
\90ö
\90\85\97p
\82Ì
\83\89\83\93\83v
\82¶
\82á
\82È
\82¢
\81D"
1845 : "
\8ec
\94O
\82È
\82ª
\82ç
\81C
\89Î
\82Æ
\90\85\82Í
\82Ü
\82´
\82ç
\82È
\82¢
\81D");
1849 /* magic lamps with an spe == 0 (wished for) cannot be lit */
1850 if ((!Is_candle(obj) && obj->age == 0)
1851 || (obj->otyp == MAGIC_LAMP && obj->spe == 0)) {
1852 if (obj->otyp == BRASS_LANTERN)
1854 Your("lamp has run out of power.");
1856 Your("
\83\89\83\93\83v
\82Ì
\93d
\97Í
\82ð
\8eg
\82¢
\90Ø
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D");
1859 pline("This %s has no oil.", xname(obj));
1861 pline("
\82±
\82Ì%s
\82É
\82Í
\82à
\82¤
\83I
\83C
\83\8b\82ª
\82È
\82¢
\81D", xname(obj));
1864 if (obj->cursed && !rn2(2)) {
1867 pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
1868 otense(obj, "die"));
1870 pline("%s
\82Í
\82µ
\82Î
\82ç
\82
\82Ì
\8aÔ
\93_
\96Å
\82µ
\81C
\8fÁ
\82¦
\82½
\81D",
1874 if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
1875 || obj->otyp == BRASS_LANTERN) {
1878 pline("%slamp is now on.", Shk_Your(buf, obj));
1880 pline("%s
\83\89\83\93\83v
\82É
\93\94\82ª
\93\94\82Á
\82½
\81D", Shk_Your(buf, obj));
1881 } else { /* candle(s) */
1883 pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
1884 otense(obj, "burn"), Blind ? "." : " brightly!");
1886 pline("%s
\82Í%s
\94R
\82¦
\82 \82ª
\82Á
\82½
\81I",
1887 xname(obj), Blind ? "" : "
\96¾
\82é
\82");
1889 if (obj->unpaid && costly_spot(u.ux, u.uy)
1890 && obj->age == 20L * (long) objects[obj->otyp].oc_cost) {
1892 const char *ithem = (obj->quan > 1L) ? "them" : "it";
1894 verbalize("You burn %s, you bought %s!", ithem, ithem);
1896 verbalize("
\93\94\82ð
\82Â
\82¯
\82½
\82È
\82ç
\81C
\94\83\82Á
\82Ä
\82à
\82ç
\82¨
\82¤
\81I");
1898 bill_dummy_object(obj);
1901 begin_burn(obj, FALSE);
1906 light_cocktail(optr)
1909 struct obj *obj = *optr; /* obj is a potion of oil */
1920 You("snuff the lit potion.");
1922 You("
\96û
\95r
\82Ì
\89Î
\82ð
\90\81\82«
\8fÁ
\82µ
\82½
\81D");
1923 end_burn(obj, TRUE);
1925 * Free & add to re-merge potion. This will average the
1926 * age of the potions. Not exactly the best solution,
1930 *optr = addinv(obj);
1932 } else if (Underwater) {
1934 There("is not enough oxygen to sustain a fire.");
1936 pline("
\89Î
\82ð
\82Â
\82¯
\82é
\82Ì
\82É
\8f\
\95ª
\82È
\8e_
\91f
\82ª
\82È
\82¢
\81D");
1940 split1off = (obj->quan > 1L);
1942 obj = splitobj(obj, 1L);
1945 You("light %spotion.%s", shk_your(buf, obj),
1946 Blind ? "" : " It gives off a dim light.");
1948 You("%s
\96û
\95r
\82É
\89Î
\82ð
\82Â
\82¯
\82½
\81D%s", shk_your(buf, obj),
1949 Blind ? "" : "
\96û
\95r
\82Í
\88Ã
\82¢
\8cõ
\82ð
\82Í
\82È
\82Á
\82½
\81D");
1952 if (obj->unpaid && costly_spot(u.ux, u.uy)) {
1953 /* Normally, we shouldn't both partially and fully charge
1954 * for an item, but (Yendorian Fuel) Taxes are inevitable...
1958 verbalize("That's in addition to the cost of the potion, of course.");
1960 verbalize("
\82±
\82ê
\82Í
\82à
\82¿
\82ë
\82ñ
\96û
\95r
\82Ì
\92l
\92i
\82Æ
\82Í
\95Ê
\82¾
\82æ
\81D");
1961 bill_dummy_object(obj);
1963 makeknown(obj->otyp);
1965 begin_burn(obj, FALSE); /* after shop billing */
1967 obj_extract_self(obj); /* free from inv */
1970 obj = hold_another_object(obj, "You drop %s!", doname(obj),
1972 obj = hold_another_object(obj, "
\82 \82È
\82½
\82Í%s
\82ð
\97\8e\82µ
\82½
\81I", doname(obj),
1980 static NEARDATA const char cuddly[] = { TOOL_CLASS, GEM_CLASS, 0 };
1985 struct obj *obj = getobj(cuddly, "rub");
1987 if (obj && obj->oclass == GEM_CLASS) {
1988 if (is_graystone(obj)) {
1993 pline("Sorry, I don't know how to use that.");
1995 pline("
\8ec
\94O
\81D
\8eg
\82¢
\95û
\82ª
\82í
\82©
\82ç
\82È
\82¢
\81D");
2000 if (!obj || !wield_tool(obj, "rub"))
2003 /* now uwep is obj */
2004 if (uwep->otyp == MAGIC_LAMP) {
2005 if (uwep->spe > 0 && !rn2(3)) {
2006 check_unpaid_usage(uwep, TRUE); /* unusual item use */
2007 /* bones preparation: perform the lamp transformation
2008 before releasing the djinni in case the latter turns out
2009 to be fatal (a hostile djinni has no chance to attack yet,
2010 but an indebted one who grants a wish might bestow an
2011 artifact which blasts the hero with lethal results) */
2012 uwep->otyp = OIL_LAMP;
2013 uwep->spe = 0; /* for safety */
2014 uwep->age = rn1(500, 1000);
2016 begin_burn(uwep, TRUE);
2017 djinni_from_bottle(uwep);
2018 makeknown(MAGIC_LAMP);
2020 } else if (rn2(2)) {
2022 You("%s smoke.", !Blind ? "see a puff of" : "smell");
2024 pline("
\82¯
\82Þ
\82è%s
\81D", !Blind ? "
\82ª
\95\91\82¢
\82 \82ª
\82Á
\82½" : "
\82Ì
\93õ
\82¢
\82ª
\82µ
\82½");
2026 pline1(nothing_happens);
2027 } else if (obj->otyp == BRASS_LANTERN) {
2028 /* message from Adventure */
2030 pline("Rubbing the electric lamp is not particularly rewarding.");
2032 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");
2034 pline("Anyway, nothing exciting happens.");
2036 pline("
\82â
\82Á
\82Ï
\82è
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D");
2038 pline1(nothing_happens);
2049 enum jump_trajectory {
2050 jAny = 0, /* any direction => magical jump */
2053 jDiag = 3 /* jHorz|jVert */
2056 /* callback routine for walk_path() */
2058 check_jump(arg, x, y)
2062 int traj = *(int *) arg;
2063 struct rm *lev = &levl[x][y];
2067 if (IS_STWALL(lev->typ))
2069 if (IS_DOOR(lev->typ)) {
2070 if (closed_door(x, y))
2072 if ((lev->doormask & D_ISOPEN) != 0 && traj != jAny
2073 /* reject diagonal jump into or out-of or through open door */
2075 /* reject horizontal jump through horizontal open door
2076 and non-horizontal (ie, vertical) jump through
2077 non-horizontal (vertical) open door */
2078 || ((traj & jHorz) != 0) == (lev->horizontal != 0)))
2080 /* empty doorways aren't restricted */
2082 /* let giants jump over boulders (what about Flying?
2083 and is there really enough head room for giants to jump
2084 at all, let alone over something tall?) */
2085 if (sobj_at(BOULDER, x, y) && !throws_rocks(youmonst.data))
2091 is_valid_jump_pos(x, y, magic, showmsg)
2095 if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
2096 /* The Knight jumping restriction still applies when riding a
2097 * horse. After all, what shape is the knight piece in chess?
2101 pline("Illegal move!");
2103 pline("
\82»
\82Ì
\88Ú
\93®
\82Í
\8cj
\94n
\92µ
\82Ñ
\82¶
\82á
\82È
\82¢
\81I");
2105 } else if (distu(x, y) > (magic ? 6 + magic * 3 : 9)) {
2110 pline("
\89\93\82·
\82¬
\82é
\81I");
2112 } else if (!isok(x, y)) {
2115 You("cannot jump there!");
2117 You("
\82»
\82±
\82É
\82Í
\94ò
\82×
\82È
\82¢
\81I");
2119 } else if (!cansee(x, y)) {
2122 You("cannot see where to land!");
2124 You("
\92\85\92n
\93_
\82ª
\8c©
\82¦
\82È
\82¢
\81I");
2128 struct rm *lev = &levl[u.ux][u.uy];
2129 /* we want to categorize trajectory for use in determining
2130 passage through doorways: horizonal, vertical, or diagonal;
2131 since knight's jump and other irregular directions are
2132 possible, we flatten those out to simplify door checks */
2134 dx = x - u.ux, dy = y - u.uy,
2135 ax = abs(dx), ay = abs(dy);
2137 /* diag: any non-orthogonal destination classifed as diagonal */
2138 diag = (magic || Passes_walls || (!dx && !dy)) ? jAny
2139 : !dy ? jHorz : !dx ? jVert : jDiag;
2140 /* traj: flatten out the trajectory => some diagonals re-classified */
2143 else if (ay >= 2 * ax)
2145 traj = (magic || Passes_walls || (!ax && !ay)) ? jAny
2146 : !ay ? jHorz : !ax ? jVert : jDiag;
2147 /* walk_path doesn't process the starting spot;
2148 this is iffy: if you're starting on a closed door spot,
2149 you _can_ jump diagonally from doorway (without needing
2150 Passes_walls); that's intentional but is it correct? */
2151 if (diag == jDiag && IS_DOOR(lev->typ)
2152 && (lev->doormask & D_ISOPEN) != 0
2154 || ((traj & jHorz) != 0) == (lev->horizontal != 0))) {
2157 You_cant("jump diagonally out of a doorway.");
2159 You_cant("
\8fo
\93ü
\82è
\8cû
\82©
\82ç
\8eÎ
\82ß
\82É
\94ò
\82Ñ
\8fo
\82·
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2162 uc.x = u.ux, uc.y = u.uy;
2163 tc.x = x, tc.y = y; /* target */
2164 if (!walk_path(&uc, &tc, check_jump, (genericptr_t) &traj)) {
2167 There("is an obstacle preventing that jump.");
2169 pline("
\94ò
\82Ô
\82Ì
\82ð
\8e×
\96\82\82·
\82é
\89½
\82©
\82ª
\82 \82é
\81D");
2176 static int jumping_is_magic;
2179 get_valid_jump_position(x,y)
2183 && (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
2184 && is_valid_jump_pos(x, y, jumping_is_magic, FALSE));
2188 display_jump_positions(state)
2192 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
2193 } else if (state == 1) {
2196 for (dx = -4; dx <= 4; dx++)
2197 for (dy = -4; dy <= 4; dy++) {
2198 x = dx + (int) u.ux;
2199 y = dy + (int) u.uy;
2200 if (get_valid_jump_position(x, y))
2204 tmp_at(DISP_END, 0);
2210 int magic; /* 0=Physical, otherwise skill level */
2214 /* attempt "jumping" spell if hero has no innate jumping ability */
2215 if (!magic && !Jumping) {
2218 for (sp_no = 0; sp_no < MAXSPELL; ++sp_no)
2219 if (spl_book[sp_no].sp_id == NO_SPELL)
2221 else if (spl_book[sp_no].sp_id == SPE_JUMPING)
2222 return spelleffects(sp_no, FALSE);
2225 if (!magic && (nolimbs(youmonst.data) || slithy(youmonst.data))) {
2226 /* normally (nolimbs || slithy) implies !Jumping,
2227 but that isn't necessarily the case for knights */
2229 You_cant("jump; you have no legs!");
2231 pline("
\91«
\82ª
\96³
\82
\82Ä
\82Í
\92µ
\82×
\82È
\82¢
\81I");
2233 } else if (!magic && !Jumping) {
2235 You_cant("jump very far.");
2237 You_cant("
\82»
\82ñ
\82È
\89\93\82
\82Ü
\82Å
\92µ
\82×
\82È
\82¢
\81D");
2239 /* if steed is immobile, can't do physical jump but can do spell one */
2240 } else if (!magic && u.usteed && stucksteed(FALSE)) {
2241 /* stucksteed gave "<steed> won't move" message */
2243 } else if (u.uswallow) {
2246 You("bounce around a little.");
2248 pline("
\94½
\93®
\82ð
\82Â
\82¯
\82½
\81D");
2252 pline("You've got to be kidding!");
2254 pline("
\8fç
\92k
\82Í
\82æ
\82µ
\82±
\82³
\82ñ
\81I");
2256 } else if (u.uinwater) {
2259 You("swish around a little.");
2261 pline("
\83X
\83C
\83X
\83C
\82Æ
\89j
\82¢
\82¾
\81D");
2265 pline("This calls for swimming, not jumping!");
2267 pline("
\82»
\82ê
\82Í
\81w
\89j
\82®
\81x
\82Å
\82 \82Á
\82Ä
\81C
\81w
\92µ
\82Ô
\81x
\82¶
\82á
\82È
\82¢
\81I");
2269 } else if (u.ustuck) {
2270 if (u.ustuck->mtame && !Conflict && !u.ustuck->mconf) {
2272 You("pull free from %s.", mon_nam(u.ustuck));
2274 You("%s
\82©
\82ç
\97£
\82ê
\82½
\81D", mon_nam(u.ustuck));
2280 You("writhe a little in the grasp of %s!", mon_nam(u.ustuck));
2282 You("%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\83W
\83^
\83o
\83^
\82µ
\82½
\81I", mon_nam(u.ustuck));
2286 You("cannot escape from %s!", mon_nam(u.ustuck));
2288 You("%s
\82©
\82ç
\93¦
\82ê
\82ç
\82ê
\82È
\82¢
\81I", mon_nam(u.ustuck));
2290 } else if (Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
2293 You("flail around a little.");
2295 You("
\83o
\83^
\83o
\83^
\92µ
\82ñ
\82¾
\81D");
2299 You("don't have enough traction to jump.");
2301 You("
\92µ
\82Ô
\82½
\82ß
\82Ì
\94½
\93®
\82ª
\82Â
\82¯
\82ç
\82ê
\82È
\82¢
\81D");
2303 } else if (!magic && near_capacity() > UNENCUMBERED) {
2305 You("are carrying too much to jump!");
2307 You("
\82½
\82
\82³
\82ñ
\95¨
\82ð
\8e\9d\82¿
\82·
\82¬
\82Ä
\92µ
\82×
\82È
\82¢
\81I");
2309 } else if (!magic && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
2311 You("lack the strength to jump!");
2313 You("
\92µ
\82Ô
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I");
2315 } else if (!magic && Wounded_legs) {
2316 long wl = (Wounded_legs & BOTH_SIDES);
2317 const char *bp = body_part(LEG);
2319 if (wl == BOTH_SIDES)
2320 bp = makeplural(bp);
2323 pline("%s is in no shape for jumping.", Monnam(u.usteed));
2325 pline("%s
\82Í
\92µ
\82×
\82é
\8fó
\91Ô
\82Å
\82Í
\82È
\82¢
\81D", Monnam(u.usteed));
2328 Your("%s%s %s in no shape for jumping.",
2329 (wl == LEFT_SIDE) ? "left " : (wl == RIGHT_SIDE) ? "right "
2331 bp, (wl == BOTH_SIDES) ? "are" : "is");
2333 Your("%s%s
\82Í
\92µ
\82×
\82é
\8fó
\91Ô
\82Å
\82Í
\82È
\82¢
\81D",
2334 (wl == LEFT_SIDE) ? "
\8d¶" :
2335 (wl == RIGHT_SIDE) ? "
\89E" : "", bp);
2338 } else if (u.usteed && u.utrap) {
2340 pline("%s is stuck in a trap.", Monnam(u.usteed));
2342 pline("%s
\82Íã©
\82É
\82Ð
\82Á
\82©
\82©
\82Á
\82Ä
\82¢
\82é
\81D", Monnam(u.usteed));
2347 pline("Where do you want to jump?");
2349 pline("
\82Ç
\82±
\82É
\92µ
\82Ñ
\82Ü
\82·
\82©
\81H");
2352 jumping_is_magic = magic;
2353 getpos_sethilite(display_jump_positions, get_valid_jump_position);
2355 if (getpos(&cc, TRUE, "the desired position") < 0)
2357 if (getpos(&cc, TRUE, "
\92µ
\82Ñ
\82½
\82¢
\8fê
\8f\8a") < 0)
2358 return 0; /* user pressed ESC */
2359 if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) {
2366 switch (u.utraptype) {
2368 long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
2371 You("rip yourself free of the bear trap! Ouch!");
2373 You("
\8e©
\95ª
\82ð
\8cF
\82Ìã©
\82©
\82ç
\82Ð
\82«
\82Í
\82ª
\82µ
\82½
\81C
\82¢
\82Ä
\82Á
\81I");
2375 losehp(Maybe_Half_Phys(rnd(10)), "jumping out of a bear trap",
2377 losehp(Maybe_Half_Phys(rnd(10)), "
\8cF
\82Ìã©
\82©
\82ç
\94ò
\82Ñ
\8fo
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2379 set_wounded_legs(side, rn1(1000, 500));
2384 You("leap from the pit!");
2386 You("
\97\8e\82µ
\8c\8a\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I");
2390 You("tear the web apart as you pull yourself free!");
2392 You("
\82
\82à
\82Ì
\91\83\82ð
\88ø
\82«
\97ô
\82«
\81C
\8e©
\97R
\82É
\82È
\82Á
\82½
\81I");
2393 deltrap(t_at(u.ux, u.uy));
2397 You("pull yourself above the %s!", hliquid("lava"));
2399 You("%s
\82©
\82ç
\94ò
\82Ñ
\8fo
\82½
\81I", hliquid("
\97n
\8aâ"));
2405 You("strain your %s, but you're still %s.",
2406 makeplural(body_part(LEG)),
2407 (u.utraptype == TT_INFLOOR)
2408 ? "stuck in the floor"
2409 : "attached to the buried ball");
2411 You("%s
\82ð
\88ø
\82Á
\82Ï
\82Á
\82½
\82ª
\81C
\82 \82È
\82½
\82Í
\82Ü
\82¾%s
\81D",
2412 makeplural(body_part(LEG)),
2413 (u.utraptype == TT_INFLOOR)
2414 ? "
\8f°
\82É
\82¤
\82Ü
\82Á
\82Ä
\82¢
\82é"
2415 : "
\82¤
\82Ü
\82Á
\82½
\8b\85\82Æ
\82Â
\82È
\82ª
\82Á
\82Ä
\82¢
\82é");
2417 set_wounded_legs(LEFT_SIDE, rn1(10, 11));
2418 set_wounded_legs(RIGHT_SIDE, rn1(10, 11));
2423 * Check the path from uc to cc, calling hurtle_step at each
2424 * location. The final position actually reached will be
2429 /* calculate max(abs(dx), abs(dy)) as the range */
2430 range = cc.x - uc.x;
2438 (void) walk_path(&uc, &cc, hurtle_jump, (genericptr_t) &range);
2439 /* hurtle_jump -> hurtle_step results in <u.ux,u.uy> == <cc.x,cc.y>
2440 * and usually moves the ball if punished, but does not handle all
2441 * the effects of landing on the final position.
2443 teleds(cc.x, cc.y, FALSE);
2447 multi_reason = "jumping around";
2449 multi_reason = "
\92µ
\82Ë
\89ñ
\82Á
\82Ä
\82¢
\82é
\8e\9e\82É";
2451 morehungry(rnd(25));
2462 if (!mons[corpse->corpsenm].cnutrit)
2468 use_tinning_kit(obj)
2471 struct obj *corpse, *can;
2473 /* This takes only 1 move. If this is to be changed to take many
2474 * moves, we've got to deal with decaying corpses...
2476 if (obj->spe <= 0) {
2478 You("seem to be out of tins.");
2480 pline("
\8aÊ
\8bl
\82ð
\8dì
\82é
\82½
\82ß
\82Ì
\8aÊ
\82ª
\90Ø
\82ê
\82½
\82æ
\82¤
\82¾
\81D");
2483 if (!(corpse = floorfood("tin", 2)))
2485 if (corpse->oeaten) {
2487 You("cannot tin %s which is partly eaten.", something);
2489 You("
\90H
\82×
\82©
\82¯
\82Ì
\82à
\82Ì
\82ð
\8aÊ
\8bl
\82É
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2492 if (touch_petrifies(&mons[corpse->corpsenm]) && !Stone_resistance
2496 if (poly_when_stoned(youmonst.data))
2498 You("tin %s without wearing gloves.",
2499 an(mons[corpse->corpsenm].mname));
2501 You("
\8f¬
\8eè
\82È
\82µ
\82Å%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82½
\81D",
2502 mons[corpse->corpsenm].mname);
2506 pline("Tinning %s without wearing gloves is a fatal mistake...",
2507 an(mons[corpse->corpsenm].mname));
2509 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",
2510 mons[corpse->corpsenm].mname);
2513 Sprintf(kbuf, "trying to tin %s without gloves",
2514 an(mons[corpse->corpsenm].mname));
2516 Sprintf(kbuf, "
\8f¬
\8eè
\82ð
\82Â
\82¯
\82¸
\82É%s
\82ð
\8aÊ
\8bl
\82É
\82µ
\82æ
\82¤
\82Æ
\82µ
\82Ä",
2517 mons[corpse->corpsenm].mname);
2522 if (is_rider(&mons[corpse->corpsenm])) {
2523 if (revive_corpse(corpse))
2525 verbalize("Yes... But War does not preserve its enemies...");
2527 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");
2530 pline_The("corpse evades your grasp.");
2532 pline("
\8e\80\91Ì
\82Í
\82 \82È
\82½
\82Ì
\8eè
\82ð
\93¦
\82ê
\82½
\81D");
2535 if (mons[corpse->corpsenm].cnutrit == 0) {
2537 pline("That's too insubstantial to tin.");
2539 pline("
\8eÀ
\91Ì
\82ª
\82È
\82¢
\82Ì
\82Å
\8aÊ
\8bl
\82É
\82Å
\82«
\82È
\82¢
\81D");
2542 consume_obj_charge(obj, TRUE);
2544 if ((can = mksobj(TIN, FALSE, FALSE)) != 0) {
2546 static const char you_buy_it[] = "You tin it, you bought it!";
2548 static const char you_buy_it[] = "
\8aÊ
\8bl
\82É
\82µ
\82½
\82Ì
\82È
\82ç
\94\83\82Á
\82Ä
\82à
\82ç
\82¤
\82æ
\81I";
2550 can->corpsenm = corpse->corpsenm;
2551 can->cursed = obj->cursed;
2552 can->blessed = obj->blessed;
2553 can->owt = weight(can);
2555 /* Mark tinned tins. No spinach allowed... */
2556 set_tin_variety(can, HOMEMADE_TIN);
2557 if (carried(corpse)) {
2559 verbalize(you_buy_it);
2562 if (costly_spot(corpse->ox, corpse->oy) && !corpse->no_charge)
2563 verbalize(you_buy_it);
2567 (void) hold_another_object(can, "You make, but cannot pick up, %s.",
2568 doname(can), (const char *) 0);
2570 (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",
2571 doname(can), (const char *) 0);
2574 impossible("Tinning failed.");
2578 use_unicorn_horn(obj)
2581 #define PROP_COUNT 7 /* number of properties we're dealing with */
2582 #define ATTR_COUNT (A_MAX * 3) /* number of attribute points we might fix */
2583 int idx, val, val_limit, trouble_count, unfixable_trbl, did_prop,
2585 int trouble_list[PROP_COUNT + ATTR_COUNT];
2587 if (obj && obj->cursed) {
2588 long lcount = (long) rn1(90, 10);
2590 switch (rn2(13) / 2) { /* case 6 is half as likely as the others */
2592 make_sick((Sick & TIMEOUT) ? (Sick & TIMEOUT) / 3L + 1L
2593 : (long) rn1(ACURR(A_CON), 20),
2594 xname(obj), TRUE, SICK_NONVOMITABLE);
2597 make_blinded((Blinded & TIMEOUT) + lcount, TRUE);
2602 You("suddenly feel %s.",
2603 Hallucination ? "trippy" : "confused");
2605 You("
\93Ë
\91R%s
\81D",
2606 Hallucination ? "
\82Ö
\82ë
\82Ö
\82ë
\82É
\82È
\82Á
\82½" : "
\8d¬
\97\90\82µ
\82½");
2608 make_confused((HConfusion & TIMEOUT) + lcount, TRUE);
2611 make_stunned((HStun & TIMEOUT) + lcount, TRUE);
2614 (void) adjattrib(rn2(A_MAX), -1, FALSE);
2617 (void) make_hallucinated((HHallucination & TIMEOUT) + lcount,
2621 if (Deaf) /* make_deaf() won't give feedback when already deaf */
2623 pline("Nothing seems to happen.");
2625 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2626 make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
2627 context.botl = TRUE;
2634 * Entries in the trouble list use a very simple encoding scheme.
2636 #define prop2trbl(X) ((X) + A_MAX)
2637 #define attr2trbl(Y) (Y)
2638 #define prop_trouble(X) trouble_list[trouble_count++] = prop2trbl(X)
2639 #define attr_trouble(Y) trouble_list[trouble_count++] = attr2trbl(Y)
2640 #define TimedTrouble(P) (((P) && !((P) & ~TIMEOUT)) ? ((P) & TIMEOUT) : 0L)
2642 trouble_count = unfixable_trbl = did_prop = did_attr = 0;
2644 /* collect property troubles */
2645 if (TimedTrouble(Sick))
2647 if (TimedTrouble(Blinded) > (long) u.ucreamed
2649 && attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
2650 prop_trouble(BLINDED);
2651 if (TimedTrouble(HHallucination))
2652 prop_trouble(HALLUC);
2653 if (TimedTrouble(Vomiting))
2654 prop_trouble(VOMITING);
2655 if (TimedTrouble(HConfusion))
2656 prop_trouble(CONFUSION);
2657 if (TimedTrouble(HStun))
2658 prop_trouble(STUNNED);
2659 if (TimedTrouble(HDeaf))
2662 unfixable_trbl = unfixable_trouble_count(TRUE);
2664 /* collect attribute troubles */
2665 for (idx = 0; idx < A_MAX; idx++) {
2666 if (ABASE(idx) >= AMAX(idx))
2668 val_limit = AMAX(idx);
2669 /* this used to adjust 'val_limit' for A_STR when u.uhs was
2670 WEAK or worse, but that's handled via ATEMP(A_STR) now */
2672 /* potion/spell of restore ability override sustain ability
2673 intrinsic but unicorn horn usage doesn't */
2674 unfixable_trbl += val_limit - ABASE(idx);
2677 /* don't recover more than 3 points worth of any attribute */
2678 if (val_limit > ABASE(idx) + 3)
2679 val_limit = ABASE(idx) + 3;
2681 for (val = ABASE(idx); val < val_limit; val++)
2683 /* keep track of unfixed trouble, for message adjustment below */
2684 unfixable_trbl += (AMAX(idx) - val_limit);
2687 if (trouble_count == 0) {
2688 pline1(nothing_happens);
2690 } else if (trouble_count > 1) { /* shuffle */
2693 for (i = trouble_count - 1; i > 0; i--)
2694 if ((j = rn2(i + 1)) != i) {
2695 k = trouble_list[j];
2696 trouble_list[j] = trouble_list[i];
2697 trouble_list[i] = k;
2702 * Chances for number of troubles to be fixed
2704 * blessed: 22.7% 22.7% 19.5% 15.4% 10.7% 5.7% 2.6% 0.8%
2705 * uncursed: 35.4% 35.4% 22.9% 6.3% 0 0 0 0
2707 val_limit = rn2(d(2, (obj && obj->blessed) ? 4 : 2));
2708 if (val_limit > trouble_count)
2709 val_limit = trouble_count;
2711 /* fix [some of] the troubles */
2712 for (val = 0; val < val_limit; val++) {
2713 idx = trouble_list[val];
2716 case prop2trbl(SICK):
2717 make_sick(0L, (char *) 0, TRUE, SICK_ALL);
2720 case prop2trbl(BLINDED):
2721 make_blinded((long) u.ucreamed, TRUE);
2724 case prop2trbl(HALLUC):
2725 (void) make_hallucinated(0L, TRUE, 0L);
2728 case prop2trbl(VOMITING):
2729 make_vomiting(0L, TRUE);
2732 case prop2trbl(CONFUSION):
2733 make_confused(0L, TRUE);
2736 case prop2trbl(STUNNED):
2737 make_stunned(0L, TRUE);
2740 case prop2trbl(DEAF):
2741 make_deaf(0L, TRUE);
2745 if (idx >= 0 && idx < A_MAX) {
2749 panic("use_unicorn_horn: bad trouble? (%d)", idx);
2756 pline("This makes you feel %s!",
2757 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2761 pline("
\8bC
\95ª
\82ª%s
\82æ
\82
\82È
\82Á
\82½
\81I",
2762 (did_prop + did_attr) == (trouble_count + unfixable_trbl)
2768 pline("Nothing seems to happen.");
2770 pline("
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
2772 context.botl = (did_attr || did_prop);
2783 * Timer callback routine: turn figurine into monster
2786 fig_transform(arg, timeout)
2790 struct obj *figurine = arg->a_obj;
2793 boolean cansee_spot, silent, okay_spot;
2794 boolean redraw = FALSE;
2795 boolean suppress_see = FALSE;
2796 char monnambuf[BUFSZ], carriedby[BUFSZ];
2799 debugpline0("null figurine in fig_transform()");
2802 silent = (timeout != monstermoves); /* happened while away */
2803 okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
2804 if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
2805 okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
2806 if (!okay_spot || !figurine_location_checks(figurine, &cc, TRUE)) {
2807 /* reset the timer to try again later */
2808 (void) start_timer((long) rnd(5000), TIMER_OBJECT, FIG_TRANSFORM,
2809 obj_to_any(figurine));
2813 cansee_spot = cansee(cc.x, cc.y);
2814 mtmp = make_familiar(figurine, cc.x, cc.y, TRUE);
2816 char and_vanish[BUFSZ];
2817 struct obj *mshelter = level.objects[mtmp->mx][mtmp->my];
2819 /* [m_monnam() yields accurate mon type, overriding hallucination] */
2820 Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
2821 /*JP:TODO:and_vanish
\82Í
\96¢
\8f\88\97\9d*/
2822 and_vanish[0] = '\0';
2823 if ((mtmp->minvis && !See_invisible)
2824 || (mtmp->data->mlet == S_MIMIC
2825 && mtmp->m_ap_type != M_AP_NOTHING))
2826 suppress_see = TRUE;
2828 if (mtmp->mundetected) {
2829 if (hides_under(mtmp->data) && mshelter) {
2830 Sprintf(and_vanish, " and %s under %s",
2831 locomotion(mtmp->data, "crawl"), doname(mshelter));
2832 } else if (mtmp->data->mlet == S_MIMIC
2833 || mtmp->data->mlet == S_EEL) {
2834 suppress_see = TRUE;
2836 Strcpy(and_vanish, " and vanish");
2839 switch (figurine->where) {
2841 if (Blind || suppress_see)
2843 You_feel("%s %s from your pack!", something,
2844 locomotion(mtmp->data, "drop"));
2846 You_feel("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82æ
\82¤
\82¾
\81I", something,
2847 jpast(locomotion(mtmp->data, "
\97\8e\82¿
\82é")));
2851 You_see("%s %s out of your pack%s!", monnambuf,
2852 locomotion(mtmp->data, "drop"), and_vanish);
2854 You("%s
\82ª
\82 \82È
\82½
\82Ì
\8a\93\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2855 jpast(locomotion(mtmp->data,"
\97\8e\82¿
\82é")));
2860 if (cansee_spot && !silent) {
2863 pline("%s suddenly vanishes!", an(xname(figurine)));
2865 pline("%s
\82Í
\93Ë
\91R
\8fÁ
\82¦
\82½
\81I", xname(figurine));
2868 You_see("a figurine transform into %s%s!", monnambuf,
2871 You("
\90l
\8c`
\82ª
\93Ë
\91R%s
\82É
\82È
\82Á
\82½
\82Ì
\82ð
\8c©
\82½
\81I",
2874 redraw = TRUE; /* update figurine's map location */
2879 if (cansee_spot && !silent && !suppress_see) {
2882 mon = figurine->ocarry;
2883 /* figurine carrying monster might be invisible */
2884 if (canseemon(figurine->ocarry)
2885 && (!mon->wormno || cansee(mon->mx, mon->my)))
2887 Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon)));
2889 Sprintf(carriedby, "%s
\82Ì
\8a\93", a_monnam(mon));
2890 else if (is_pool(mon->mx, mon->my))
2892 Strcpy(carriedby, "empty water");
2894 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\90\85\92\86");
2897 Strcpy(carriedby, "thin air");
2899 Strcpy(carriedby, "
\89½
\82à
\82È
\82¢
\8bó
\92\86");
2901 You_see("%s %s out of %s%s!", monnambuf,
2902 locomotion(mtmp->data, "drop"), carriedby,
2905 You("%s
\82ª%s
\82©
\82ç%s
\82Ì
\82ð
\8c©
\82½
\81I", monnambuf,
2906 carriedby, locomotion(mtmp->data, "
\97\8e\82¿
\82é"));
2916 impossible("figurine came to life where? (%d)",
2917 (int) figurine->where);
2921 /* free figurine now */
2922 if (carried(figurine)) {
2925 obj_extract_self(figurine);
2926 obfree(figurine, (struct obj *) 0);
2933 figurine_location_checks(obj, cc, quietly)
2940 if (carried(obj) && u.uswallow) {
2943 You("don't have enough room in here.");
2945 pline("
\82±
\82±
\82É
\82Í
\8f\
\95ª
\82È
\8fê
\8f\8a\82ª
\82È
\82¢
\81D");
2948 x = cc ? cc->x : u.ux;
2949 y = cc ? cc->y : u.uy;
2953 You("cannot put the figurine there.");
2955 You("
\82±
\82±
\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81D");
2958 if (IS_ROCK(levl[x][y].typ)
2959 && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) {
2962 You("cannot place a figurine in %s!",
2963 IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock");
2965 You("%s
\82Ì
\92\86\82É
\82Í
\90l
\8c`
\82ð
\92u
\82¯
\82È
\82¢
\81I",
2966 IS_TREE(levl[x][y].typ) ? "
\96Ø" : "
\8cÅ
\82¢
\90Î");
2970 if (sobj_at(BOULDER, x, y) && !passes_walls(&mons[obj->corpsenm])
2971 && !throws_rocks(&mons[obj->corpsenm])) {
2974 You("cannot fit the figurine on the boulder.");
2976 You("
\8aâ
\82É
\90l
\8c`
\82ð
\89\9f\82µ
\8d\9e\82Þ
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D");
2986 register struct obj *obj = *optr;
2991 /* can't activate a figurine while swallowed */
2992 if (!figurine_location_checks(obj, (coord *) 0, FALSE))
2995 if (!getdir((char *) 0)) {
2996 context.move = multi = 0;
3003 /* Passing FALSE arg here will result in messages displayed */
3004 if (!figurine_location_checks(obj, &cc, FALSE))
3007 You("%s and it transforms.",
3008 (u.dx || u.dy) ? "set the figurine beside you"
3009 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
3010 || is_pool(cc.x, cc.y))
3011 ? "release the figurine"
3012 : (u.dz < 0 ? "toss the figurine into the air"
3013 : "set the figurine on the ground"));
3015 You("%s
\81D
\82·
\82é
\82Æ
\82»
\82ê
\82Í
\95Ï
\8c`
\82µ
\82½
\81D",
3016 (u.dx || u.dy) ? "
\82»
\82Î
\82É
\90l
\8c`
\82ð
\92u
\82¢
\82½"
3017 : (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
3018 || is_pool(cc.x, cc.y))
3019 ? "
\90l
\8c`
\82ð
\95ú
\82Á
\82½"
3020 : (u.dz < 0 ? "
\90l
\8c`
\82ð
\8bó
\92\86\82É
\93\8a\82°
\82½"
3021 : "
\90l
\8c`
\82ð
\92n
\96Ê
\82É
\92u
\82¢
\82½"));
3023 (void) make_familiar(obj, cc.x, cc.y, FALSE);
3024 (void) stop_timer(FIG_TRANSFORM, obj_to_any(obj));
3029 static NEARDATA const char lubricables[] = { ALL_CLASSES, ALLOW_NONE, 0 };
3039 pline("%s from your %s.", Tobjnam(obj, "slip"),
3040 makeplural(body_part(FINGER)));
3042 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
3050 if ((obj->cursed || Fumbling) && !rn2(2)) {
3051 consume_obj_charge(obj, TRUE);
3054 pline("%s from your %s.", Tobjnam(obj, "slip"),
3055 makeplural(body_part(FINGER)));
3057 pline("%s
\82Í
\82 \82È
\82½
\82Ì%s
\82©
\82ç
\8a\8a\82è
\97\8e\82¿
\82½
\81D", xname(obj),
3063 otmp = getobj(lubricables, "grease");
3067 if (inaccessible_equipment(otmp, "grease", FALSE))
3069 if (inaccessible_equipment(otmp, "
\82É
\8e\89\82ð
\93h
\82é", FALSE))
3071 consume_obj_charge(obj, TRUE);
3073 if (otmp != &zeroobj) {
3075 You("cover %s with a thick layer of grease.", yname(otmp));
3077 You("%s
\82É
\8e\89\82ð
\92O
\94O
\82É
\93h
\82Á
\82½
\81D", xname(otmp));
3079 if (obj->cursed && !nohands(youmonst.data)) {
3080 incr_itimeout(&Glib, rnd(15));
3082 pline("Some of the grease gets all over your %s.",
3084 pline("
\8e\89\82ª
\8f
\82µ%s
\82É
\82Â
\82¢
\82½
\81D",
3085 makeplural(body_part(HAND)));
3088 incr_itimeout(&Glib, rnd(15));
3090 You("coat your %s with grease.", makeplural(body_part(FINGER)));
3092 You("%s
\82É
\8e\89\82ð
\93h
\82Á
\82½
\81D", makeplural(body_part(FINGER)));
3097 pline("%s empty.", Tobjnam(obj, "are"));
3099 pline("%s
\82Í
\8bó
\82Á
\82Û
\82¾
\81D", xname(obj));
3102 pline("%s to be empty.", Tobjnam(obj, "seem"));
3104 pline("%s
\82Í
\8bó
\82Á
\82Û
\82Ì
\82æ
\82¤
\82¾
\81D", xname(obj));
3109 /* touchstones - by Ken Arnold */
3116 const char *streak_color, *choices;
3117 char stonebuf[QBUFSZ];
3119 static const char scritch[] = "\"scritch, scritch\"";
3121 static const char scritch[] = "
\81u
\83S
\83V
\81C
\83S
\83V
\81v";
3122 static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
3123 static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
3125 /* in case it was acquired while blinded */
3128 /* when the touchstone is fully known, don't bother listing extra
3129 junk as likely candidates for rubbing */
3130 choices = (tstone->otyp == TOUCHSTONE && tstone->dknown
3131 && objects[TOUCHSTONE].oc_name_known)
3135 Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan));
3137 Sprintf(stonebuf, "rub on the stone");
3138 if ((obj = getobj(choices, stonebuf)) == 0)
3141 if (obj == tstone && obj->quan == 1L) {
3143 You_cant("rub %s on itself.", the(xname(obj)));
3145 You("%s
\82ð
\82»
\82ê
\8e©
\91Ì
\82Å
\82±
\82·
\82é
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", the(xname(obj)));
3149 if (tstone->otyp == TOUCHSTONE && tstone->cursed
3150 && obj->oclass == GEM_CLASS && !is_graystone(obj)
3151 && !obj_resists(obj, 80, 100)) {
3154 pline("You feel something shatter.");
3156 You("
\89½
\82©
\82ª
\95²
\81X
\82É
\82È
\82é
\82Ì
\82ð
\8a´
\82¶
\82½
\81D");
3157 else if (Hallucination)
3159 pline("Oh, wow, look at the pretty shards.");
3161 pline("
\83\8f\81[
\83H
\81I
\82È
\82ñ
\82Ä
\82«
\82ê
\82¢
\82È
\94j
\95Ð
\82È
\82ñ
\82¾
\81D");
3164 pline("A sharp crack shatters %s%s.",
3165 (obj->quan > 1L) ? "one of " : "", the(xname(obj)));
3167 pline("
\8b
\82
\82±
\82·
\82è
\82·
\82¬
\82Ä%s%s
\82Í
\95²
\81X
\82É
\82È
\82Á
\82Ä
\82µ
\82Ü
\82Á
\82½
\81D",
3168 the(xname(obj)), (obj->quan > 1) ? "
\82Ì
\82Ð
\82Æ
\82Â" : "");
3177 } else if (Hallucination) {
3179 pline("Oh wow, man: Fractals!");
3181 pline("
\83\8f\81[
\83H
\81I
\83t
\83\89\83N
\83^
\83\8b\96Í
\97l
\82¾
\81I");
3189 switch (obj->oclass) {
3190 case GEM_CLASS: /* these have class-specific handling below */
3192 if (tstone->otyp != TOUCHSTONE) {
3194 } else if (obj->oclass == GEM_CLASS
3196 || (!tstone->cursed && (Role_if(PM_ARCHEOLOGIST)
3197 || Race_if(PM_GNOME))))) {
3198 makeknown(TOUCHSTONE);
3199 makeknown(obj->otyp);
3200 prinv((char *) 0, obj, 0L);
3203 /* either a ring or the touchstone was not effective */
3204 if (objects[obj->otyp].oc_material == GLASS) {
3209 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3210 break; /* gem or ring */
3213 switch (objects[obj->otyp].oc_material) {
3216 pline("%s a little more polished now.", Tobjnam(tstone, "look"));
3218 pline("%s
\82Í
\82³
\82ç
\82É
\82Â
\82â
\82ª
\8fo
\82½
\82æ
\82¤
\82É
\8c©
\82¦
\82é
\81D", xname(tstone));
3222 if (!obj->known) /* note: not "whetstone" */
3224 You("must think this is a wetstone, do you?");
3226 You("
\82±
\82ê
\82Í
\93u
\90Î
\82¾
\82Æ
\8ev
\82Á
\82½
\81H");
3230 pline("%s a little wetter now.", Tobjnam(tstone, "are"));
3232 pline("%s
\82Í
\8f
\82µ
\82Ê
\82ê
\82½
\81D", xname(tstone));
3237 streak_color = "waxy";
3239 streak_color = "
\8e\89\82Á
\82Û
\82¢";
3241 break; /* okay even if not touchstone */
3244 streak_color = "wooden";
3246 streak_color = "
\82¨
\82ª
\82
\82¸
\82Ì
\82æ
\82¤
\82È";
3248 break; /* okay even if not touchstone */
3250 do_scratch = TRUE; /* scratching and streaks */
3252 streak_color = "golden";
3254 streak_color = "
\8bà
\90F
\82Ì";
3258 do_scratch = TRUE; /* scratching and streaks */
3260 streak_color = "silvery";
3262 streak_color = "
\8bâ
\90F
\82Ì";
3266 /* Objects passing the is_flimsy() test will not
3267 scratch a stone. They will leave streaks on
3268 non-touchstones and touchstones alike. */
3270 streak_color = c_obj_colors[objects[obj->otyp].oc_color];
3272 do_scratch = (tstone->otyp != TOUCHSTONE);
3275 break; /* default oclass */
3278 #if 0 /*JP*//* not used */
3279 Sprintf(stonebuf, "stone%s", plur(tstone->quan));
3283 You("make %s%sscratch marks on the %s.",
3284 streak_color ? streak_color : (const char *) "",
3285 streak_color ? " " : "", stonebuf);
3287 You("%s
\82±
\82·
\82è
\90Õ
\82ð
\90Î
\82É
\82Â
\82¯
\82½
\81D",
3288 streak_color ? streak_color : (const char *)"");
3290 else if (streak_color)
3292 You_see("%s streaks on the %s.", streak_color, stonebuf);
3294 pline("
\90Î
\82É%s
\8bØ
\82ª
\82Â
\82¢
\82½
\81D", streak_color);
3300 static struct trapinfo {
3304 boolean force_bungle;
3311 trapinfo.force_bungle = 0;
3314 /* Place a landmine/bear trap. Helge Hafting */
3320 const char *what = (char *) 0;
3322 int levtyp = levl[u.ux][u.uy].typ;
3324 const char *occutext = "setting the trap";
3326 const char *occutext = "ã©
\82ð
\8ed
\8a|
\82¯
\82Ä
\82¢
\82é";
3329 if (nohands(youmonst.data))
3331 what = "without hands";
3333 what = "
\8eè
\82ª
\82È
\82¢
\82Ì
\82Å";
3336 what = "while stunned";
3338 what = "
\82
\82ç
\82
\82ç
\82µ
\82Ä
\82¢
\82é
\82Ì
\82Å";
3339 else if (u.uswallow)
3342 is_animal(u.ustuck->data) ? "while swallowed" : "while engulfed";
3344 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Í";
3345 else if (Underwater)
3347 what = "underwater";
3349 what = "
\90\85\96Ê
\89º
\82Å
\82Í";
3350 else if (Levitation)
3352 what = "while levitating";
3354 what = "
\95\82\82¢
\82Ä
\82¢
\82é
\8aÔ
\82Í";
3355 else if (is_pool(u.ux, u.uy))
3359 what = "
\90\85\92\86\82Å
\82Í";
3360 else if (is_lava(u.ux, u.uy))
3364 what = "
\97n
\8aâ
\82Ì
\92\86\82Å
\82Í";
3365 else if (On_stairs(u.ux, u.uy))
3367 what = (u.ux == xdnladder || u.ux == xupladder) ? "on the ladder"
3370 what = (u.ux == xdnladder || u.ux == xupladder) ? "
\82Í
\82µ
\82²
\82Ì
\8fã
\82Å
\82Í"
3371 : "
\8aK
\92i
\82Ì
\8fã
\82Å
\82Í";
3373 else if (IS_FURNITURE(levtyp) || IS_ROCK(levtyp)
3374 || closed_door(u.ux, u.uy) || t_at(u.ux, u.uy))
3378 what = "
\82±
\82±
\82Å
\82Í";
3379 else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))
3381 what = (levtyp == AIR)
3385 : "in this place"; /* Air/Water Plane catch-all */
3387 what = (levtyp == AIR)
3388 ? "
\8bó
\92\86\82Å
\82Í"
3390 ? "
\89_
\82Ì
\92\86\82Å
\82Í"
3391 : "
\82±
\82±
\82Å
\82Í"; /* Air/Water Plane catch-all */
3395 You_cant("set a trap %s!", what);
3397 pline("%sã©
\82ð
\8ed
\8a|
\82¯
\82ç
\82ê
\82È
\82¢
\81I",what);
3401 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3402 if (otmp == trapinfo.tobj && u.ux == trapinfo.tx && u.uy == trapinfo.ty) {
3404 You("resume setting %s%s.", shk_your(buf, otmp),
3406 You("%s
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82ð
\8dÄ
\8aJ
\82µ
\82½
\81D",
3407 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3408 set_occupation(set_trap, occutext, 0);
3411 trapinfo.tobj = otmp;
3412 trapinfo.tx = u.ux, trapinfo.ty = u.uy;
3414 trapinfo.time_needed =
3415 (tmp > 17) ? 2 : (tmp > 12) ? 3 : (tmp > 7) ? 4 : 5;
3417 trapinfo.time_needed *= 2;
3419 if (ttyp == BEAR_TRAP && tmp < 18)
3420 trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4;
3421 /*[fumbling and/or confusion and/or cursed object check(s)
3422 should be incorporated here instead of in set_trap]*/
3423 if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
3426 if (Fumbling || otmp->cursed)
3427 chance = (rnl(10) > 3);
3429 chance = (rnl(10) > 5);
3431 You("aren't very skilled at reaching from %s.", mon_nam(u.usteed));
3433 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));
3435 Sprintf(buf, "Continue your attempt to set %s?",
3437 Sprintf(buf, "%s
\82Ì
\8ed
\8a|
\82¯
\82ð
\91±
\82¯
\82é
\81H",
3438 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3439 if (yn(buf) == 'y') {
3442 case LANDMINE: /* set it off */
3443 trapinfo.time_needed = 0;
3444 trapinfo.force_bungle = TRUE;
3446 case BEAR_TRAP: /* drop it without arming it */
3451 You("%s
\82ð
\97\8e\82Æ
\82µ
\82½
\81I",
3452 the(defsyms[trap_to_defsym(what_trap(ttyp))]
3464 You("begin setting %s%s.", shk_your(buf, otmp),
3466 You("%s%s
\82ð
\8ed
\8a|
\82¯
\82Í
\82¶
\82ß
\82½
\81D", shk_your(buf, otmp),
3467 defsyms[trap_to_defsym(what_trap(ttyp))].explanation);
3468 set_occupation(set_trap, occutext, 0);
3476 struct obj *otmp = trapinfo.tobj;
3480 if (!otmp || !carried(otmp) || u.ux != trapinfo.tx
3481 || u.uy != trapinfo.ty) {
3487 if (--trapinfo.time_needed > 0)
3488 return 1; /* still busy */
3490 ttyp = (otmp->otyp == LAND_MINE) ? LANDMINE : BEAR_TRAP;
3491 ttmp = maketrap(u.ux, u.uy, ttyp);
3495 if (*in_rooms(u.ux, u.uy, SHOPBASE)) {
3496 add_damage(u.ux, u.uy, 0L); /* schedule removal */
3498 if (!trapinfo.force_bungle)
3500 You("finish arming %s.",
3502 You("%s
\82ð
\8ed
\8a|
\82¯
\8fI
\82¦
\82½
\81D",
3503 the(defsyms[trap_to_defsym(what_trap(ttyp))].explanation));
3504 if (((otmp->cursed || Fumbling) && (rnl(10) > 5))
3505 || trapinfo.force_bungle)
3507 (unsigned) (trapinfo.force_bungle ? FORCEBUNGLE : 0));
3509 /* this shouldn't happen */
3511 Your("trap setting attempt fails.");
3513 You("ã©
\82ð
\8ed
\8a|
\82¯
\82é
\82Ì
\82É
\8e¸
\94s
\82µ
\82½
\81D");
3527 int rx, ry, proficient, res = 0;
3529 const char *msg_slipsfree = "The bullwhip slips free.";
3531 const char *msg_slipsfree = "
\95Ú
\82Í
\82Ù
\82Ç
\82¯
\82½
\81D";
3533 const char *msg_snap = "Snap!";
3535 const char *msg_snap = "
\83s
\83V
\83b
\81I";
3538 if (!wield_tool(obj, "lash"))
3543 if (!getdir((char *) 0))
3551 if (Stunned || (Confusion && !rn2(5)))
3555 if (!isok(rx, ry)) {
3559 You("
\82Í
\82¸
\82µ
\82½
\81D");
3562 mtmp = m_at(rx, ry);
3565 /* fake some proficiency checks */
3567 if (Role_if(PM_ARCHEOLOGIST))
3569 if (ACURR(A_DEX) < 6)
3571 else if (ACURR(A_DEX) >= 14)
3572 proficient += (ACURR(A_DEX) - 14);
3580 if (u.uswallow && attack(u.ustuck)) {
3582 There("is not enough room to flick your bullwhip.");
3584 pline("
\95Ú
\82ð
\91Å
\82Â
\82Ù
\82Ç
\8dL
\82
\82È
\82¢
\81D");
3586 } else if (Underwater) {
3588 There("is too much resistance to flick your bullwhip.");
3590 pline("
\90\85\82Ì
\92ï
\8dR
\82ª
\82 \82è
\82·
\82¬
\82Ä
\95Ú
\82ð
\91Å
\82Â
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
3592 } else if (u.dz < 0) {
3594 You("flick a bug off of the %s.", ceiling(u.ux, u.uy));
3596 You("%s
\82Ì
\92\8e\82ð
\91Å
\82¿
\97\8e\82µ
\82½
\81D",ceiling(u.ux,u.uy));
3598 } else if ((!u.dx && !u.dy) || (u.dz > 0)) {
3601 /* Sometimes you hit your steed by mistake */
3602 if (u.usteed && !rn2(proficient + 2)) {
3604 You("whip %s!", mon_nam(u.usteed));
3606 You("%s
\82ð
\95Ú
\91Å
\82Á
\82½
\81I", mon_nam(u.usteed));
3610 if (Levitation || u.usteed) {
3611 /* Have a shot at snaring something on the floor */
3612 otmp = level.objects[u.ux][u.uy];
3613 if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) {
3615 pline("Why beat a dead horse?");
3617 pline("
\82Ç
\82¤
\82µ
\82Ä
\8e\80\82ñ
\82¾
\94n
\82ð
\95Ú
\91Å
\82Â
\82æ
\82¤
\82È
\82±
\82Æ
\82ð
\82·
\82é
\82Ì
\81H");
3620 if (otmp && proficient) {
3622 You("wrap your bullwhip around %s on the %s.",
3623 an(singular(otmp, xname)), surface(u.ux, u.uy));
3625 You("
\95Ú
\82ð%s
\82Ì
\8fã
\82Ì%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D",
3626 surface(u.ux, u.uy), an(singular(otmp, xname)));
3628 if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1)
3629 pline1(msg_slipsfree);
3633 dam = rnd(2) + dbon() + obj->spe;
3637 You("hit your %s with your bullwhip.", body_part(FOOT));
3639 You("
\8e©
\95ª
\82Ì%s
\82ð
\8e©
\95ª
\82Å
\91Å
\82¿
\82Â
\82¯
\82½
\81D", body_part(FOOT));
3641 Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
3642 losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
3644 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82ð
\95Ú
\91Å
\82Á
\82Ä");
3645 losehp(dam, buf, KILLED_BY);
3650 } else if ((Fumbling || Glib) && !rn2(5)) {
3652 pline_The("bullwhip slips out of your %s.", body_part(HAND));
3654 pline("
\95Ú
\82ª%s
\82©
\82ç
\82·
\82×
\82è
\97\8e\82¿
\82½
\81D", body_part(HAND));
3657 } else if (u.utrap && u.utraptype == TT_PIT) {
3661 * if you're in a pit
3662 * - you are attempting to get out of the pit
3663 * or, if you are applying it towards a small monster
3664 * - then it is assumed that you are trying to hit it
3665 * else if the monster is wielding a weapon
3666 * - you are attempting to disarm a monster
3668 * - you are attempting to hit the monster.
3670 * if you're confused (and thus off the mark)
3671 * - you only end up hitting.
3674 const char *wrapped_what = (char *) 0;
3677 if (bigmonst(mtmp->data)) {
3678 wrapped_what = strcpy(buf, mon_nam(mtmp));
3679 } else if (proficient) {
3686 if (!wrapped_what) {
3687 if (IS_FURNITURE(levl[rx][ry].typ))
3688 wrapped_what = something;
3689 else if (sobj_at(BOULDER, rx, ry))
3691 wrapped_what = "a boulder";
3693 wrapped_what = "
\8aâ";
3701 You("wrap your bullwhip around %s.", wrapped_what);
3703 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", wrapped_what);
3704 if (proficient && rn2(proficient + 2)) {
3705 if (!mtmp || enexto(&cc, rx, ry, youmonst.data)) {
3707 You("yank yourself out of the pit!");
3709 You("
\82®
\82¢
\82Æ
\88ø
\82Á
\82Ï
\82Á
\82Ä
\8c\8a\82©
\82ç
\94²
\82¯
\8fo
\82µ
\82½
\81I");
3710 teleds(cc.x, cc.y, TRUE);
3712 vision_full_recalc = 1;
3715 pline1(msg_slipsfree);
3723 if (!canspotmon(mtmp) && !glyph_is_invisible(levl[rx][ry].glyph)) {
3725 pline("A monster is there that you couldn't see.");
3727 pline("
\8c©
\82¦
\82È
\82¢
\89ö
\95¨
\82ª
\82¢
\82é
\81D");
3728 map_invisible(rx, ry);
3730 otmp = MON_WEP(mtmp); /* can be null */
3732 char onambuf[BUFSZ];
3733 const char *mon_hand;
3734 boolean gotit = proficient && (!Fumbling || !rn2(10));
3736 Strcpy(onambuf, cxname(otmp));
3738 mon_hand = mbodypart(mtmp, HAND);
3740 mon_hand = makeplural(mon_hand);
3742 mon_hand = 0; /* lint suppression */
3745 You("wrap your bullwhip around %s.", yname(otmp));
3747 You("
\95Ú
\82ð%s
\82É
\82©
\82ç
\82Ü
\82¹
\82½
\81D", xname(otmp));
3748 if (gotit && mwelded(otmp)) {
3750 pline("%s welded to %s %s%c",
3751 (otmp->quan == 1L) ? "It is" : "They are", mhis(mtmp),
3752 mon_hand, !otmp->bknown ? '!' : '.');
3754 pline("%s
\82Í%s
\82Ì%s
\82É
\82
\82Á
\82Â
\82¢
\82Ä
\82µ
\82Ü
\82Á
\82Ä
\82¢
\82é%s",
3756 mon_nam(mtmp), mon_hand,
3757 !otmp->bknown ? "
\81I" : "
\81D");
3760 gotit = FALSE; /* can't pull it free */
3763 obj_extract_self(otmp);
3764 possibly_unwield(mtmp, FALSE);
3765 setmnotwielded(mtmp, otmp);
3767 switch (rn2(proficient + 1)) {
3769 /* to floor near you */
3771 You("yank %s to the %s!", yname(otmp),
3773 You("%s
\82ð%s
\82É
\88ø
\82«
\97\8e\82µ
\82½
\81I", xname(otmp),
3774 surface(u.ux, u.uy));
3775 place_object(otmp, u.ux, u.uy);
3782 /* proficient with whip, but maybe not
3783 so proficient at catching weapons */
3786 hitvalu = 8 + otmp->spe;
3787 hitu = thitu(hitvalu, dmgval(otmp, &youmonst),
3791 pline_The("%s hits you as you try to snatch it!",
3793 pline_The("%s
\82ð
\92D
\82¨
\82¤
\82Æ
\82µ
\82½
\82ç
\82 \82È
\82½
\82É
\93\96\82½
\82Á
\82½
\81I",
3796 place_object(otmp, u.ux, u.uy);
3801 /* right into your inventory */
3803 You("snatch %s!", yname(otmp));
3805 You("%s
\82ð
\92D
\82Á
\82½
\81I", xname(otmp));
3806 if (otmp->otyp == CORPSE
3807 && touch_petrifies(&mons[otmp->corpsenm]) && !uarmg
3808 && !Stone_resistance
3809 && !(poly_when_stoned(youmonst.data)
3810 && polymon(PM_STONE_GOLEM))) {
3814 Sprintf(kbuf, "%s corpse",
3815 an(mons[otmp->corpsenm].mname));
3816 pline("Snatching %s is a fatal mistake.", kbuf);
3818 pline("%s
\82Ì
\8e\80\91Ì
\82ð
\92D
\82Á
\82½
\82Ì
\82Í
\92v
\96½
\93I
\82È
\8aÔ
\88á
\82¢
\82¾
\81D",
3819 mons[otmp->corpsenm].mname);
3820 Sprintf(kbuf, "%s
\82Ì
\8e\80\91Ì
\82É
\90G
\82ê
\82Ä",
3821 mons[otmp->corpsenm].mname);
3826 (void) hold_another_object(otmp, "You drop %s!",
3827 doname(otmp), (const char *) 0);
3829 (void) hold_another_object(otmp, "%s
\82ð
\97\8e\82µ
\82½
\81I",
3830 doname(otmp), (const char *) 0);
3834 /* to floor beneath mon */
3836 You("yank %s from %s %s!", the(onambuf),
3837 s_suffix(mon_nam(mtmp)), mon_hand);
3839 You("%s
\82ð%s
\82Ì%s
\82©
\82ç
\82Ð
\82Á
\82Ï
\82Á
\82½
\81I", the(xname(otmp)),
3840 mon_nam(mtmp), mon_hand);
3842 obj_no_longer_held(otmp);
3843 place_object(otmp, mtmp->mx, mtmp->my);
3848 pline1(msg_slipsfree);
3852 if (mtmp->m_ap_type && !Protection_from_shape_changers
3854 stumble_onto_mimic(mtmp);
3857 You("flick your bullwhip towards %s.", mon_nam(mtmp));
3859 You("%s
\82É
\8cü
\82Á
\82Ä
\95Ú
\82ð
\91Å
\82Á
\82½
\81D", mon_nam(mtmp));
3868 } else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) {
3869 /* it must be air -- water checked above */
3871 You("snap your whip through thin air.");
3873 You("
\89½
\82à
\82È
\82¢
\82Æ
\82±
\82ë
\82Å
\95Ú
\82ð
\91Å
\82Á
\82½
\81D");
3883 not_enough_room[] = "There's not enough room here to use that.",
3885 not_enough_room[] = "
\82»
\82ê
\82ð
\8eg
\82¤
\82¾
\82¯
\82Ì
\8dL
\82³
\82ª
\82È
\82¢
\81D",
3887 where_to_hit[] = "Where do you want to hit?",
3889 where_to_hit[] = "
\82Ç
\82ê
\82ð
\91_
\82¤
\81H",
3891 cant_see_spot[] = "won't hit anything if you can't see that spot.",
3893 cant_see_spot[] = "
\8fê
\8f\8a\82ª
\8c©
\82¦
\82È
\82¯
\82ê
\82Î
\91_
\82¦
\82È
\82¢
\81D",
3895 cant_reach[] = "can't reach that spot from here.";
3897 cant_reach[] = "
\82±
\82±
\82©
\82ç
\82»
\82±
\82Ö
\82Í
\93Í
\82©
\82È
\82¢
\81D";
3899 /* find pos of monster in range, if only one monster */
3901 find_poleable_mon(pos, min_range, max_range)
3903 int min_range, max_range;
3906 struct monst *selmon = (struct monst *) 0;
3908 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
3909 if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
3910 && cansee(mtmp->mx, mtmp->my)
3911 && distu(mtmp->mx, mtmp->my) <= max_range
3912 && distu(mtmp->mx, mtmp->my) >= min_range) {
3919 pos->x = selmon->mx;
3920 pos->y = selmon->my;
3924 static int polearm_range_min = -1;
3925 static int polearm_range_max = -1;
3928 get_valid_polearm_position(x,y)
3931 return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
3932 && distu(x, y) >= polearm_range_min
3933 && distu(x, y) <= polearm_range_max);
3937 display_polearm_positions(state)
3941 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
3942 } else if (state == 1) {
3945 for (dx = -4; dx <= 4; dx++)
3946 for (dy = -4; dy <= 4; dy++) {
3947 x = dx + (int) u.ux;
3948 y = dy + (int) u.uy;
3949 if (get_valid_polearm_position(x, y)) {
3954 tmp_at(DISP_END, 0);
3958 /* Distance attacks by pole-weapons */
3963 int res = 0, typ, max_range, min_range, glyph;
3966 struct monst *hitm = context.polearm.hitmon;
3968 /* Are you allowed to use the pole? */
3970 pline(not_enough_room);
3974 if (!wield_tool(obj, "swing"))
3979 /* assert(obj == uwep); */
3982 * Calculate allowable range (pole's reach is always 2 steps):
3983 * unskilled and basic: orthogonal direction, 4..4;
3984 * skilled: as basic, plus knight's jump position, 4..5;
3985 * expert: as skilled, plus diagonal, 4..8.
3993 * (Note: no roles in nethack can become expert or better
3994 * for polearm skill; Yeoman in slash'em can become expert.)
3997 typ = uwep_skill_type();
3998 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
4000 else if (P_SKILL(typ) == P_SKILLED)
4003 max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
4005 polearm_range_min = min_range;
4006 polearm_range_max = max_range;
4008 /* Prompt for a location */
4009 pline(where_to_hit);
4012 if (!find_poleable_mon(&cc, min_range, max_range) && hitm
4013 && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)
4014 && distu(hitm->mx, hitm->my) <= max_range
4015 && distu(hitm->mx, hitm->my) >= min_range) {
4019 getpos_sethilite(display_polearm_positions, get_valid_polearm_position);
4021 if (getpos(&cc, TRUE, "the spot to hit") < 0)
4023 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
4024 return res; /* ESC; uses turn iff polearm became wielded */
4026 glyph = glyph_at(cc.x, cc.y);
4027 if (distu(cc.x, cc.y) > max_range) {
4031 pline("
\89\93\82·
\82¬
\82é
\81I");
4033 } else if (distu(cc.x, cc.y) < min_range) {
4035 pline("Too close!");
4037 pline("
\8bß
\82·
\82¬
\82é
\81I");
4039 } else if (!cansee(cc.x, cc.y) && !glyph_is_monster(glyph)
4040 && !glyph_is_invisible(glyph) && !glyph_is_statue(glyph)) {
4043 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4048 context.polearm.hitmon = NULL;
4049 /* Attack the monster there */
4051 if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
4052 if (attack_checks(mtmp, uwep))
4055 return 1; /* burn nutrition; maybe pass out */
4056 context.polearm.hitmon = mtmp;
4057 check_caitiff(mtmp);
4058 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4059 (void) thitmonst(mtmp, uwep);
4060 } else if (glyph_is_statue(glyph) /* might be hallucinatory */
4061 && sobj_at(STATUE, bhitpos.x, bhitpos.y)) {
4062 struct trap *t = t_at(bhitpos.x, bhitpos.y);
4064 if (t && t->ttyp == STATUE_TRAP
4065 && activate_statue_trap(t, t->tx, t->ty, FALSE)) {
4066 ; /* feedback has been give by animate_statue() */
4068 /* Since statues look like monsters now, we say something
4069 different from "you miss" or "there's nobody there".
4070 Note: we only do this when a statue is displayed here,
4071 because the player is probably attempting to attack it;
4072 other statues obscured by anything are just ignored. */
4074 pline("Thump! Your blow bounces harmlessly off the statue.");
4076 pline("
\83S
\83c
\83\93\81I
\92¤
\91\9c\82Í
\8f\9d\82Â
\82©
\82È
\82©
\82Á
\82½
\81D");
4077 wake_nearto(bhitpos.x, bhitpos.y, 25);
4080 /* no monster here and no statue seen or remembered here */
4081 (void) unmap_invisible(bhitpos.x, bhitpos.y);
4083 You("miss; there is no one there to hit.");
4085 You("
\8aO
\82ê
\82½
\81D
\82»
\82±
\82É
\82Í
\89½
\82à
\82È
\82¢
\81D");
4087 u_wipe_engr(2); /* same as for melee or throwing */
4095 boolean wasblind = Blind;
4096 boolean wascreamed = u.ucreamed;
4097 boolean several = FALSE;
4099 if (obj->quan > 1L) {
4101 obj = splitobj(obj, 1L);
4105 You("give yourself a facial.");
4107 You("
\83N
\83\8a\81[
\83\80\83p
\83b
\83N
\82ð
\82µ
\82½
\81D");
4110 pline("You immerse your %s in %s%s.", body_part(FACE),
4111 several ? "one of " : "",
4112 several ? makeplural(the(xname(obj))) : the(xname(obj)));
4114 pline("%s%s
\82É%s
\82ð
\92¾
\82ß
\82½
\81D",
4116 several ? "
\82Ì
\82Ð
\82Æ
\82Â" : "", body_part(FACE));
4118 if (can_blnd((struct monst *) 0, &youmonst, AT_WEAP, obj)) {
4119 int blindinc = rnd(25);
4120 u.ucreamed += blindinc;
4121 make_blinded(Blinded + (long) blindinc, FALSE);
4122 if (!Blind || (Blind && wasblind))
4124 pline("There's %ssticky goop all over your %s.",
4125 wascreamed ? "more " : "", body_part(FACE));
4127 pline("
\82â
\82Á
\82©
\82¢
\82È
\82Ë
\82Î
\82Ë
\82Î
\82ª%s
\91S
\91Ì
\82É%s
\82Â
\82¢
\82½
\81D",
4128 body_part(FACE), wascreamed ? "
\82³
\82ç
\82É" : "");
4130 else /* Blind && !wasblind */
4132 You_cant("see through all the sticky goop on your %s.",
4134 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",
4139 /* useup() is appropriate, but we want costly_alteration()'s message */
4140 costly_alteration(obj, COST_SPLAT);
4141 obj_extract_self(obj);
4150 int res = 0, typ, max_range = 4, tohit;
4151 boolean save_confirm;
4156 /* Are you allowed to use the hook? */
4158 pline(not_enough_room);
4162 if (!wield_tool(obj, "cast"))
4167 /* assert(obj == uwep); */
4169 /* Prompt for a location */
4170 pline(where_to_hit);
4174 if (getpos(&cc, TRUE, "the spot to hit") < 0)
4176 if (getpos(&cc, TRUE, "
\91_
\82¤
\8fê
\8f\8a") < 0)
4177 return res; /* ESC; uses turn iff grapnel became wielded */
4179 /* Calculate range; unlike use_pole(), there's no minimum for range */
4180 typ = uwep_skill_type();
4181 if (typ == P_NONE || P_SKILL(typ) <= P_BASIC)
4183 else if (P_SKILL(typ) == P_SKILLED)
4187 if (distu(cc.x, cc.y) > max_range) {
4191 pline("
\89\93\82·
\82¬
\82é
\81I");
4193 } else if (!cansee(cc.x, cc.y)) {
4196 } else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
4201 /* What do you want to hit? */
4203 if (typ != P_NONE && P_SKILL(typ) >= P_SKILLED) {
4204 winid tmpwin = create_nhwindow(NHW_MENU);
4207 menu_item *selected;
4209 any = zeroany; /* set all bits to zero */
4210 any.a_int = 1; /* use index+1 (cant use 0) as identifier */
4214 Sprintf(buf, "an object on the %s", surface(cc.x, cc.y));
4216 Sprintf(buf, "%s
\82É
\82 \82é
\95¨
\91Ì", surface(cc.x, cc.y));
4217 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4221 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "a monster",
4224 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "
\89ö
\95¨",
4229 Sprintf(buf, "the %s", surface(cc.x, cc.y));
4231 Sprintf(buf, "%s", surface(cc.x, cc.y));
4232 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
4235 end_menu(tmpwin, "Aim for what?");
4237 end_menu(tmpwin, "
\89½
\82ð
\91_
\82¤
\81H");
4239 if (select_menu(tmpwin, PICK_ONE, &selected) > 0
4240 && rn2(P_SKILL(typ) > P_SKILLED ? 20 : 2))
4241 tohit = selected[0].item.a_int - 1;
4242 free((genericptr_t) selected);
4243 destroy_nhwindow(tmpwin);
4246 /* possibly scuff engraving at your feet;
4247 any engraving at the target location is unaffected */
4248 if (tohit == 2 || !rn2(2))
4249 u_wipe_engr(rnd(2));
4251 /* What did you hit? */
4254 /* FIXME -- untrap needs to deal with non-adjacent traps */
4256 case 1: /* Object */
4257 if ((otmp = level.objects[cc.x][cc.y]) != 0) {
4259 You("snag an object from the %s!", surface(cc.x, cc.y));
4261 You("%s
\82Ì
\82à
\82Ì
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I", surface(cc.x, cc.y));
4262 (void) pickup_object(otmp, 1L, FALSE);
4263 /* If pickup fails, leave it alone */
4268 case 2: /* Monster */
4270 if ((mtmp = m_at(cc.x, cc.y)) == (struct monst *) 0)
4272 notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
4273 save_confirm = flags.confirm;
4274 if (verysmall(mtmp->data) && !rn2(4)
4275 && enexto(&cc, u.ux, u.uy, (struct permonst *) 0)) {
4276 flags.confirm = FALSE;
4277 (void) attack_checks(mtmp, uwep);
4278 flags.confirm = save_confirm;
4279 check_caitiff(mtmp); /* despite fact there's no damage */
4281 You("pull in %s!", mon_nam(mtmp));
4283 You("%s
\82ð
\88ø
\82Á
\92£
\82Á
\82½
\81I", mon_nam(mtmp));
4284 mtmp->mundetected = 0;
4285 rloc_to(mtmp, cc.x, cc.y);
4287 } else if ((!bigmonst(mtmp->data) && !strongmonst(mtmp->data))
4289 flags.confirm = FALSE;
4290 (void) attack_checks(mtmp, uwep);
4291 flags.confirm = save_confirm;
4292 check_caitiff(mtmp);
4293 (void) thitmonst(mtmp, uwep);
4297 case 3: /* Surface */
4298 if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
4300 pline_The("hook slices through the %s.", surface(cc.x, cc.y));
4302 pline("
\83t
\83b
\83N
\82Í%s
\82ð
\82³
\82Á
\82Æ
\90Ø
\82Á
\82½
\81D", surface(cc.x, cc.y));
4305 You("are yanked toward the %s!", surface(cc.x, cc.y));
4307 You("%s
\82Ö
\88ø
\82Á
\82Ï
\82ç
\82ê
\82½
\81I", surface(cc.x, cc.y));
4308 hurtle(sgn(cc.x - u.ux), sgn(cc.y - u.uy), 1, FALSE);
4312 default: /* Yourself (oops!) */
4313 if (P_SKILL(typ) <= P_BASIC) {
4315 You("hook yourself!");
4317 You("
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82½
\81I");
4319 losehp(Maybe_Half_Phys(rn1(10, 10)), "a grappling hook",
4321 losehp(Maybe_Half_Phys(rn1(10, 10)), "
\8e©
\95ª
\8e©
\90g
\82ð
\88ø
\82Á
\8a|
\82¯
\82Ä",
4327 pline1(nothing_happens);
4331 #define BY_OBJECT ((struct monst *) 0)
4333 /* return 1 if the wand is broken, hence some time elapsed */
4339 static const char nothing_else_happens[] = "But nothing else happens...";
4341 static const char nothing_else_happens[] = "
\82µ
\82©
\82µ
\81C
\89½
\82à
\8bN
\82«
\82È
\82©
\82Á
\82½
\81D
\81D
\81D";
4342 register int i, x, y;
4343 register struct monst *mon;
4345 boolean affects_objects;
4346 boolean shop_damage = FALSE;
4347 boolean fillmsg = FALSE;
4348 int expltype = EXPL_MAGICAL;
4349 char confirm[QBUFSZ], buf[BUFSZ];
4351 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa"));
4353 boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "
\83o
\83\8b\83T
\82Ì
\8fñ"));
4356 if (!paranoid_query(ParanoidBreakwand,
4358 "Are you really sure you want to break ",
4359 "?", obj, yname, ysimple_name, "the wand")))
4361 if (!paranoid_query(ParanoidBreakwand,
4363 "
\96{
\93\96\82É", "
\82ð
\89ó
\82·
\82Ì
\81H",
4364 obj, xname, ysimple_name, "
\8fñ")))
4368 if (nohands(youmonst.data)) {
4370 You_cant("break %s without hands!", yname(obj));
4372 You("
\8eè
\82ª
\96³
\82¢
\82Ì
\82Å%s
\82ð
\89ó
\82¹
\82È
\82¢
\81I", xname(obj));
4374 } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) {
4376 You("don't have the strength to break %s!", yname(obj));
4378 You("%s
\82ð
\89ó
\82·
\82¾
\82¯
\82Ì
\97Í
\82ª
\82È
\82¢
\81I", xname(obj));
4382 pline("Raising %s high above your %s, you %s it in two!", yname(obj),
4383 body_part(HEAD), is_fragile ? "snap" : "break");
4385 pline("%s
\82ð%s
\82Ì
\8fã
\82É
\8d\82\82
\8cf
\82°
\81C
\93ñ
\82Â
\82É
\82Ö
\82µ
\90Ü
\82Á
\82½
\81I", yname(obj),
4389 /* [ALI] Do this first so that wand is removed from bill. Otherwise,
4390 * the freeinv() below also hides it from setpaid() which causes problems.
4393 check_unpaid(obj); /* Extra charge for use */
4394 costly_alteration(obj, COST_DSTROY);
4397 current_wand = obj; /* destroy_item might reset this */
4398 freeinv(obj); /* hide it from destroy_item instead... */
4399 setnotworn(obj); /* so we need to do this ourselves */
4401 if (!zappable(obj)) {
4402 pline(nothing_else_happens);
4403 goto discard_broken_wand;
4405 /* successful call to zappable() consumes a charge; put it back */
4407 /* might have "wrested" a final charge, taking it from 0 to -1;
4408 if so, we just brought it back up to 0, which wouldn't do much
4409 below so give it 1..3 charges now, usually making it stronger
4410 than an ordinary last charge (the wand is already gone from
4411 inventory, so perm_invent can't accidentally reveal this) */
4418 affects_objects = FALSE;
4420 switch (obj->otyp) {
4425 case WAN_ENLIGHTENMENT:
4427 case WAN_SECRET_DOOR_DETECTION:
4428 pline(nothing_else_happens);
4429 goto discard_broken_wand;
4435 expltype = EXPL_FIERY;
4438 if (expltype == EXPL_MAGICAL)
4439 expltype = EXPL_FROSTY;
4442 case WAN_MAGIC_MISSILE:
4444 explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
4445 makeknown(obj->otyp); /* explode describes the effect */
4446 goto discard_broken_wand;
4448 /* we want this before the explosion instead of at the very end */
4450 pline("A wall of force smashes down around you!");
4452 pline("
\82 \82È
\82½
\82Í
\96\82\97Í
\82Ì
\95Ç
\82É
\82Â
\82Â
\82Ü
\82ê
\82½
\81I");
4453 dmg = d(1 + obj->spe, 6); /* normally 2d12 */
4455 case WAN_CANCELLATION:
4457 case WAN_TELEPORTATION:
4458 case WAN_UNDEAD_TURNING:
4459 affects_objects = TRUE;
4465 /* magical explosion and its visual effect occur before specific effects
4467 /* [TODO? This really ought to prevent the explosion from being
4468 fatal so that we never leave a bones file where none of the
4469 surrounding targets (or underlying objects) got affected yet.] */
4470 explode(obj->ox, obj->oy, -(obj->otyp), rnd(dmg), WAND_CLASS,
4473 /* prepare for potential feedback from polymorph... */
4476 /* this makes it hit us last, so that we can see the action first */
4477 for (i = 0; i <= 8; i++) {
4478 bhitpos.x = x = obj->ox + xdir[i];
4479 bhitpos.y = y = obj->oy + ydir[i];
4483 if (obj->otyp == WAN_DIGGING) {
4486 if (dig_check(BY_OBJECT, FALSE, x, y)) {
4487 if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
4488 /* normally, pits and holes don't anger guards, but they
4489 * do if it's a wall or door that's being dug */
4490 watch_dig((struct monst *) 0, x, y, TRUE);
4491 if (*in_rooms(x, y, SHOPBASE))
4495 * Let liquid flow into the newly created pits.
4496 * Adjust corresponding code in music.c for
4497 * drum of earthquake if you alter this sequence.
4499 typ = fillholetyp(x, y, FALSE);
4501 levl[x][y].typ = typ;
4502 liquid_flow(x, y, typ, t_at(x, y),
4506 : "Some holes are quickly filled with %s!");
4508 : "
\8c\8a\82Í
\82·
\82®
\82É%s
\82Å
\96\84\82Ü
\82Á
\82½
\81I");
4511 digactualhole(x, y, BY_OBJECT, (rn2(obj->spe) < 3
4512 || (!Can_dig_down(&u.uz)
4513 && !levl[x][y].candig))
4518 } else if (obj->otyp == WAN_CREATE_MONSTER) {
4519 /* u.ux,u.uy creates it near you--x,y might create it in rock */
4520 (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS);
4522 } else if (x != u.ux || y != u.uy) {
4524 * Wand breakage is targetting a square adjacent to the hero,
4525 * which might contain a monster or a pile of objects or both.
4526 * Handle objects last; avoids having undead turning raise an
4527 * undead's corpse and then attack resulting undead monster.
4528 * obj->bypass in bhitm() prevents the polymorphing of items
4529 * dropped due to monster's polymorph and prevents undead
4530 * turning that kills an undead from raising resulting corpse.
4532 if ((mon = m_at(x, y)) != 0) {
4533 (void) bhitm(mon, obj);
4534 /* if (context.botl) bot(); */
4536 if (affects_objects && level.objects[x][y]) {
4537 (void) bhitpile(obj, bhito, x, y, 0);
4539 bot(); /* potion effects */
4543 * Wand breakage is targetting the hero. Using xdir[]+ydir[]
4544 * deltas for location selection causes this case to happen
4545 * after all the surrounding squares have been handled.
4546 * Process objects first, in case damage is fatal and leaves
4547 * bones, or teleportation sends one or more of the objects to
4548 * same destination as hero (lookhere/autopickup); also avoids
4549 * the polymorphing of gear dropped due to hero's transformation.
4550 * (Unlike with monsters being hit by zaps, we can't rely on use
4551 * of obj->bypass in the zap code to accomplish that last case
4552 * since it's also used by retouch_equipment() for polyself.)
4554 if (affects_objects && level.objects[x][y]) {
4555 (void) bhitpile(obj, bhito, x, y, 0);
4557 bot(); /* potion effects */
4559 damage = zapyourself(obj, FALSE);
4562 Sprintf(buf, "killed %sself by breaking a wand", uhim());
4563 losehp(Maybe_Half_Phys(damage), buf, NO_KILLER_PREFIX);
4565 Strcpy(buf, "
\8e©
\95ª
\8e©
\90g
\82Å
\8fñ
\82ð
\89ó
\82µ
\82Ä
\83_
\83\81\81[
\83W
\82ð
\8eó
\82¯");
4566 losehp(Maybe_Half_Phys(damage), buf, KILLED_BY);
4570 bot(); /* blindness */
4574 /* potentially give post zap/break feedback */
4577 /* Note: if player fell thru, this call is a no-op.
4578 Damage is handled in digactualhole in that case */
4581 pay_for_damage("dig into", FALSE);
4583 pay_for_damage("
\8c\8a\82ð
\82 \82¯
\82é", FALSE);
4585 if (obj->otyp == WAN_LIGHT)
4586 litroom(TRUE, obj); /* only needs to be done once */
4588 discard_broken_wand:
4589 obj = current_wand; /* [see dozap() and destroy_item()] */
4598 add_class(cl, class)
4609 static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
4611 /* augment tools[] if various items are carried */
4613 setapplyclasses(class_list)
4616 register struct obj *otmp;
4618 boolean knowoil, knowtouchstone, addpotions, addstones, addfood;
4620 knowoil = objects[POT_OIL].oc_name_known;
4621 knowtouchstone = objects[TOUCHSTONE].oc_name_known;
4622 addpotions = addstones = addfood = FALSE;
4623 for (otmp = invent; otmp; otmp = otmp->nobj) {
4626 || (otmp->oclass == POTION_CLASS
4628 || (!knowoil && !objects[otyp].oc_name_known))))
4630 if (otyp == TOUCHSTONE
4631 || (is_graystone(otmp)
4633 || (!knowtouchstone && !objects[otyp].oc_name_known))))
4635 if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF)
4639 class_list[0] = '\0';
4640 if (addpotions || addstones)
4641 add_class(class_list, ALL_CLASSES);
4642 Strcat(class_list, tools);
4644 add_class(class_list, POTION_CLASS);
4646 add_class(class_list, GEM_CLASS);
4648 add_class(class_list, FOOD_CLASS);
4651 /* the 'a' command */
4656 register int res = 1;
4657 char class_list[MAXOCLASSES + 2];
4659 if (check_capacity((char *) 0))
4662 setapplyclasses(class_list); /* tools[] */
4663 obj = getobj(class_list, "use or apply");
4667 if (!retouch_object(&obj, FALSE))
4668 return 1; /* evading your grasp costs a turn; just be
4669 grateful that you don't drop it as well */
4671 if (obj->oclass == WAND_CLASS)
4672 return do_break_wand(obj);
4674 switch (obj->otyp) {
4677 if (obj == ublindf) {
4680 } else if (!ublindf) {
4684 You("are already %s.", ublindf->otyp == TOWEL
4685 ? "covered by a towel"
4686 : ublindf->otyp == BLINDFOLD
4687 ? "wearing a blindfold"
4688 : "wearing lenses");
4690 You("
\82à
\82¤%s
\82Ä
\82¢
\82é
\81D", ublindf->otyp == TOWEL
4691 ? "
\83^
\83I
\83\8b\82ð
\8aª
\82¢"
4692 : ublindf->otyp == BLINDFOLD
4693 ? "
\96Ú
\89B
\82µ
\82ð
\82Â
\82¯"
4694 : "
\83\8c\83\93\83Y
\82ð
\82Â
\82¯");
4699 res = use_cream_pie(obj);
4702 res = use_whip(obj);
4704 case GRAPPLING_HOOK:
4705 res = use_grapple(obj);
4711 case BAG_OF_HOLDING:
4713 res = use_container(&obj, 1, FALSE);
4716 (void) bagotricks(obj, FALSE, (int *) 0);
4724 res = (pick_lock(obj) != 0);
4727 case DWARVISH_MATTOCK:
4728 res = use_pick_axe(obj);
4731 use_tinning_kit(obj);
4734 res = use_leash(obj);
4737 res = use_saddle(obj);
4740 use_magic_whistle(obj);
4745 case EUCALYPTUS_LEAF:
4746 /* MRKR: Every Australian knows that a gum leaf makes an excellent
4747 * whistle, especially if your pet is a tame kangaroo named Skippy.
4750 use_magic_whistle(obj);
4751 /* sometimes the blessing will be worn off */
4755 pline("%s %s.", Yobjnam2(obj, "glow"), hcolor("brown"));
4757 pline("%s
\82Í%s
\8bP
\82¢
\82½
\81D", xname(obj), jconj_adj(hcolor("
\92\83\90F
\82Ì")));
4767 res = use_stethoscope(obj);
4770 res = use_mirror(obj);
4773 case BELL_OF_OPENING:
4776 case CANDELABRUM_OF_INVOCATION:
4777 use_candelabrum(obj);
4789 light_cocktail(&obj);
4791 case EXPENSIVE_CAMERA:
4792 res = use_camera(obj);
4795 res = use_towel(obj);
4798 use_crystal_ball(&obj);
4804 res = use_tin_opener(obj);
4810 use_unicorn_horn(obj);
4821 case DRUM_OF_EARTHQUAKE:
4822 res = do_play_instrument(obj);
4824 case HORN_OF_PLENTY: /* not a musical instrument */
4825 (void) hornoplenty(obj, FALSE);
4838 /* Pole-weapons can strike at a distance */
4840 res = use_pole(obj);
4842 } else if (is_pick(obj) || is_axe(obj)) {
4843 res = use_pick_axe(obj);
4847 pline("Sorry, I don't know how to use that.");
4849 pline("
\82»
\82ê
\82ð
\82Ç
\82¤
\82â
\82Á
\82Ä
\8eg
\82¤
\82ñ
\82¾
\82¢
\81H");
4853 if (res && obj && obj->oartifact)
4859 /* Keep track of unfixable troubles for purposes of messages saying you feel
4863 unfixable_trouble_count(is_horn)
4866 int unfixable_trbl = 0;
4872 if (Wounded_legs && !u.usteed)
4876 /* lycanthropy is undesirable, but it doesn't actually make you feel bad */
4878 if (!is_horn || (Confusion & ~TIMEOUT))
4880 if (!is_horn || (Sick & ~TIMEOUT))
4882 if (!is_horn || (HHallucination & ~TIMEOUT))
4884 if (!is_horn || (Vomiting & ~TIMEOUT))
4886 if (!is_horn || (HStun & ~TIMEOUT))
4888 if (!is_horn || (HDeaf & ~TIMEOUT))
4891 return unfixable_trbl;