1 /* NetHack 3.6 do.c $NHDT-Date: 1446975464 2015/11/08 09:37:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.149 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* Contains code for 'd', 'D' (drop), '>', '<' (up, down) */
7 /* JNetHack Copyright */
8 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
9 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
10 /* JNetHack may be freely redistributed. See license for details. */
15 STATIC_DCL void FDECL(trycall, (struct obj *));
16 STATIC_DCL void NDECL(polymorph_sink);
17 STATIC_DCL boolean NDECL(teleport_sink);
18 STATIC_DCL void FDECL(dosinkring, (struct obj *));
19 STATIC_PTR int FDECL(drop, (struct obj *));
20 STATIC_PTR int NDECL(wipeoff);
21 STATIC_DCL int FDECL(menu_drop, (int));
22 STATIC_DCL int NDECL(currentlevel_rewrite);
23 STATIC_DCL void NDECL(final_level);
24 /* static boolean FDECL(badspot, (XCHAR_P,XCHAR_P)); */
26 extern int n_dgns; /* number of dungeons, from dungeon.c */
28 static NEARDATA const char drop_types[] = { ALLOW_COUNT, COIN_CLASS,
31 /* 'd' command: drop one inventory item */
35 int result, i = (invent) ? 0 : (SIZE(drop_types) - 1);
38 sellobj_state(SELL_DELIBERATE);
39 result = drop(getobj(&drop_types[i], "drop"));
41 sellobj_state(SELL_NORMAL);
47 /* Called when a boulder is dropped, thrown, or pushed. If it ends up
48 * in a pool, it either fills the pool up or sinks away. In either case,
49 * it's gone for good... If the destination is not a pool, returns FALSE.
52 boulder_hits_pool(otmp, rx, ry, pushing)
57 if (!otmp || otmp->otyp != BOULDER) {
58 impossible("Not a boulder?");
59 } else if (!Is_waterlevel(&u.uz) && is_pool_or_lava(rx, ry)) {
60 boolean lava = is_lava(rx, ry), fills_up;
61 const char *what = waterbody_name(rx, ry);
62 schar ltyp = levl[rx][ry].typ;
63 int chance = rn2(10); /* water: 90%; lava: 10% */
64 fills_up = lava ? chance == 0 : chance != 0;
67 struct trap *ttmp = t_at(rx, ry);
69 if (ltyp == DRAWBRIDGE_UP) {
70 levl[rx][ry].drawbridgemask &= ~DB_UNDER; /* clear lava */
71 levl[rx][ry].drawbridgemask |= DB_FLOOR;
73 levl[rx][ry].typ = ROOM;
76 (void) delfloortrap(ttmp);
84 Strcpy(whobuf, "you");
86 Strcpy(whobuf, "
\82 \82È
\82½");
88 Strcpy(whobuf, y_monnam(u.usteed));
90 pline("%s %s %s into the %s.", upstart(whobuf),
91 vtense(whobuf, "push"), the(xname(otmp)), what);
93 pline("%s
\82Í%s
\82ð%s
\82Ì
\92\86\82Ö
\89\9f\82µ
\82±
\82ñ
\82¾
\81D", whobuf,
96 if (flags.verbose && !Blind)
98 pline("Now you can cross it!");
100 pline("
\82³
\82\9f\93n
\82ê
\82é
\82¼
\81I");
101 /* no splashing in this case */
104 if (!fills_up || !pushing) { /* splashing occurs */
106 if (pushing ? !Blind : cansee(rx, ry)) {
108 There("is a large splash as %s %s the %s.",
109 the(xname(otmp)), fills_up ? "fills" : "falls into",
112 pline("%s
\82ð%s
\82É%s
\82Æ
\91å
\82«
\82È
\82µ
\82Ô
\82«
\82ª
\82 \82ª
\82Á
\82½
\81D",
114 fills_up ? "
\96\84\82ß
\8d\9e\82Þ" : "
\97\8e\82·" );
118 You_hear("a%s splash.", lava ? " sizzling" : "");
120 You_hear("%s
\82Æ
\8c¾
\82¤
\89¹
\82ð
\95·
\82¢
\82½
\81D",lava ? "
\83V
\83\85\81[
\83b" : "
\83p
\83V
\83\83\83b");
121 wake_nearto(rx, ry, 40);
124 if (fills_up && u.uinwater && distu(rx, ry) == 0) {
127 vision_full_recalc = 1;
129 You("find yourself on dry land again!");
131 You("
\82¢
\82Â
\82Ì
\82Ü
\82É
\82©
\8a£
\82¢
\82½
\8fê
\8f\8a\82É
\82¢
\82½
\81I");
132 } else if (lava && distu(rx, ry) <= 2) {
135 You("are hit by molten lava%c", Fire_resistance ? '.' : '!');
137 You("
\82Ç
\82ë
\82Ç
\82ë
\82Ì
\97n
\8aâ
\82Å
\83_
\83\81\81[
\83W
\82ð
\8eó
\82¯
\82½%s", Fire_resistance ? "
\81D" : "
\81I");
139 dmg = d((Fire_resistance ? 1 : 3), 6);
141 losehp(Maybe_Half_Phys(dmg), /* lava damage */
142 "molten lava", KILLED_BY);
144 losehp(Maybe_Half_Phys(dmg), /* lava damage */
145 "
\82Ç
\82ë
\82Ç
\82ë
\82Ì
\97n
\8aâ
\82Å", KILLED_BY);
147 } else if (!fills_up && flags.verbose
148 && (pushing ? !Blind : cansee(rx, ry)))
150 pline("It sinks without a trace!");
152 pline("
\82»
\82ê
\82Í
\82 \82Æ
\82©
\82½
\82à
\82È
\82
\92¾
\82ñ
\82¾
\81I");
155 /* boulder is now gone */
159 obfree(otmp, (struct obj *) 0);
165 /* Used for objects which sometimes do special things when dropped; must be
166 * called with the object not in any chain. Returns TRUE if the object goes
170 flooreffects(obj, x, y, verb)
175 #if 1 /*JP*//* trap.c */
176 extern const char *set_you[2];
182 if (obj->where != OBJ_FREE)
183 panic("flooreffects: obj not free");
185 /* make sure things like water_damage() have no pointers to follow */
186 obj->nobj = obj->nexthere = (struct obj *) 0;
188 if (obj->otyp == BOULDER && boulder_hits_pool(obj, x, y, FALSE)) {
190 } else if (obj->otyp == BOULDER && (t = t_at(x, y)) != 0
191 && (t->ttyp == PIT || t->ttyp == SPIKED_PIT
192 || t->ttyp == TRAPDOOR || t->ttyp == HOLE)) {
193 if (((mtmp = m_at(x, y)) && mtmp->mtrapped)
194 || (u.utrap && u.ux == x && u.uy == y)) {
197 pline_The("boulder %s into the pit%s.",
198 vtense((const char *) 0, verb),
199 (mtmp) ? "" : " with you");
201 pline("
\8aâ
\82Í%s
\97\8e\82µ
\8c\8a\82Ö%s
\81D",
202 (mtmp) ? "" : "
\82 \82È
\82½
\82Æ
\82¢
\82Á
\82µ
\82å
\82É",
206 if (!passes_walls(mtmp->data) && !throws_rocks(mtmp->data)) {
207 if (hmon(mtmp, obj, TRUE) && !is_whirly(mtmp->data))
208 return FALSE; /* still alive */
212 if (!Passes_walls && !throws_rocks(youmonst.data)) {
214 losehp(Maybe_Half_Phys(rnd(15)),
215 "squished under a boulder", NO_KILLER_PREFIX);
217 losehp(Maybe_Half_Phys(rnd(15)),
218 "
\8aâ
\82Ì
\89º
\82Å
\92×
\82³
\82ê
\82Ä", KILLED_BY);
220 return FALSE; /* player remains trapped */
226 if (Blind && (x == u.ux) && (y == u.uy)) {
228 You_hear("a CRASH! beneath you.");
230 You_hear("
\91«
\8c³
\82Å
\89½
\82©
\82ª
\8dÓ
\82¯
\82é
\89¹
\82ð
\95·
\82¢
\82½
\81D");
231 } else if (!Blind && cansee(x, y)) {
233 pline_The("boulder %s%s.", t->tseen ? "" : "triggers and ",
235 ? "plugs a trap door"
236 : t->ttyp == HOLE ? "plugs a hole"
239 pline_The("
\8aâ
\82Í%s%s
\81D", t->tseen ? "" : "ã©
\82ð
\8bN
\93®
\82µ
\82Ä
\81C",
240 t->ttyp == TRAPDOOR ? "
\97\8e\82µ
\94à
\82ð
\96\84\82ß
\82½" :
241 t->ttyp == HOLE ? "
\8c\8a\82ð
\96\84\82ß
\82½" :
242 "
\97\8e\82µ
\8c\8a\82ð
\96\84\82ß
\82½");
246 You_hear("a boulder %s.", verb);
248 You_hear("
\8aâ
\82ª%s
\89¹
\82ð
\95·
\82¢
\82½
\81D", verb);
256 } else if (is_lava(x, y)) {
257 return fire_damage(obj, FALSE, x, y);
258 } else if (is_pool(x, y)) {
259 /* Reasonably bulky objects (arbitrary) splash when dropped.
260 * If you're floating above the water even small things make
261 * noise. Stuff dropped near fountains always misses */
262 if ((Blind || (Levitation || Flying)) && !Deaf
263 && ((x == u.ux) && (y == u.uy))) {
265 if (weight(obj) > 9) {
269 pline("
\83o
\83V
\83\83\83b
\81I");
270 } else if (Levitation || Flying) {
274 pline("
\83|
\83`
\83\83\83\93\81I");
277 map_background(x, y, 0);
280 return water_damage(obj, NULL, FALSE) == ER_DESTROYED;
281 } else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0
282 && uteetering_at_seen_pit(t)) {
285 You_hear("%s tumble downwards.", the(xname(obj)));
287 You_hear("%s
\82ª
\89º
\82Ì
\95û
\82Ö
\93]
\82ª
\82Á
\82Ä
\82¢
\82
\89¹
\82ð
\95·
\82¢
\82½
\81D", xname(obj));
290 pline("%s %s into %s pit.", The(xname(obj)),
291 otense(obj, "tumble"), the_your[t->madeby_u]);
293 pline("%s
\82Í%s
\97\8e\82Æ
\82µ
\8c\8a\82É
\93]
\82ª
\82è
\82¨
\82¿
\82½
\81D", xname(obj),
294 set_you[t->madeby_u]);
296 } else if (obj->globby) {
297 /* Globby things like puddings might stick together */
299 && (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id))
300 != (struct obj *) 0) {
301 pudding_merge_message(obj, otmp);
302 /* intentionally not getting the melded object; obj_meld may set
304 (void) obj_meld(&obj, &otmp);
306 return (boolean) (obj == NULL);
311 /* obj is an object dropped on an altar */
314 register struct obj *obj;
319 if (obj->oclass != COIN_CLASS) {
321 u.uconduct.gnostic++;
323 /* coins don't have bless/curse status */
324 obj->blessed = obj->cursed = 0;
327 if (obj->blessed || obj->cursed) {
329 There("is %s flash as %s %s the altar.",
330 an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)), doname(obj),
333 pline("%s
\82ª
\8dÕ
\92d
\82É
\90G
\82ê
\82é
\82Æ%s
\8cõ
\82Á
\82½
\81D",
335 jconj_adj(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)));
341 pline("%s %s on the altar.", Doname2(obj), otense(obj, "land"));
343 pline("%s
\82ð
\8dÕ
\92d
\82Ì
\8fã
\82É
\92u
\82¢
\82½
\81D", Doname2(obj));
344 if (obj->oclass != COIN_CLASS)
351 register struct obj *obj;
353 if (!objects[obj->otyp].oc_name_known && !objects[obj->otyp].oc_uname)
357 /* Transforms the sink at the player's position into
358 a fountain, throne, altar or grave. */
362 if (levl[u.ux][u.uy].typ != SINK)
365 level.flags.nsinks--;
366 levl[u.ux][u.uy].doormask = 0;
370 levl[u.ux][u.uy].typ = FOUNTAIN;
371 level.flags.nfountains++;
374 levl[u.ux][u.uy].typ = THRONE;
377 levl[u.ux][u.uy].typ = ALTAR;
378 levl[u.ux][u.uy].altarmask = Align2amask(rn2((int) A_LAWFUL + 2) - 1);
381 levl[u.ux][u.uy].typ = ROOM;
382 make_grave(u.ux, u.uy, (char *) 0);
386 pline_The("sink transforms into %s!", (levl[u.ux][u.uy].typ == THRONE)
388 : an(surface(u.ux, u.uy)));
390 pline_The("
\97¬
\82µ
\91ä
\82Í%s
\82É
\95Ï
\89»
\82µ
\82½
\81I", (levl[u.ux][u.uy].typ == THRONE)
392 : an(surface(u.ux, u.uy)));
397 /* Teleports the sink at the player's position;
398 return True if sink teleported. */
411 eng = engr_at(cx, cy);
412 } while ((levl[cx][cy].typ != ROOM || trp || eng || cansee(cx, cy))
415 if (levl[cx][cy].typ == ROOM && !trp && !eng) {
416 /* create sink at new position */
417 levl[cx][cy].typ = SINK;
418 levl[cx][cy].looted = levl[u.ux][u.uy].looted;
420 /* remove old sink */
421 levl[u.ux][u.uy].typ = ROOM;
422 levl[u.ux][u.uy].looted = 0;
429 /* obj is a ring being dropped over a kitchen sink */
432 register struct obj *obj;
434 struct obj *otmp, *otmp2;
435 boolean ideed = TRUE;
436 boolean nosink = FALSE;
439 You("drop %s down the drain.", doname(obj));
441 You("%s
\82ð
\94r
\90\85\8cû
\82É
\97\8e\82µ
\82½
\81D", doname(obj));
442 obj->in_use = TRUE; /* block free identification via interrupt */
443 switch (obj->otyp) { /* effects that can be noticed without eyes */
446 You("thought %s got lost in the sink, but there it is!", yname(obj));
448 You("%s
\82ð
\8e¸
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\82ª
\81C
\8bC
\82Ì
\82¹
\82¢
\82¾
\82Á
\82½
\81I", yname(obj));
450 case RIN_SLOW_DIGESTION:
452 pline_The("ring is regurgitated!");
454 pline("
\8ew
\97Ö
\82Í
\8bt
\97¬
\82µ
\82½
\81I");
462 pline_The("sink quivers upward for a moment.");
464 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu
\81C
\8fã
\89º
\82É
\90k
\82¦
\82½
\81D");
466 case RIN_POISON_RESISTANCE:
468 You("smell rotten %s.", makeplural(fruitname(FALSE)));
470 pline("
\95\85\82Á
\82½%s
\82Ì
\82æ
\82¤
\82È
\93õ
\82¢
\82ª
\82µ
\82½
\81D", fruitname(FALSE));
472 case RIN_AGGRAVATE_MONSTER:
474 pline("Several %s buzz angrily around the sink.",
475 Hallucination ? makeplural(rndmonnam(NULL)) : "flies");
477 pline("
\90\94\95C
\82Ì%s
\82ª
\83u
\83\93\83u
\83\93\97¬
\82µ
\91ä
\82Ì
\89ñ
\82è
\82ð
\94ò
\82Ñ
\82Ü
\82í
\82Á
\82½
\81D",
478 Hallucination ? rndmonnam(NULL) : "
\83n
\83G");
481 case RIN_SHOCK_RESISTANCE:
483 pline("Static electricity surrounds the sink.");
485 pline("
\97¬
\82µ
\91ä
\82ª
\83s
\83\8a\83s
\83\8a\82µ
\82Í
\82¶
\82ß
\82½
\81D");
489 You_hear("loud noises coming from the drain.");
491 You_hear("
\94r
\90\85\8cû
\82©
\82ç
\82Ì
\91å
\82«
\82È
\89¹
\82ð
\95·
\82¢
\82½
\81D");
493 case RIN_SUSTAIN_ABILITY: /* KMH */
495 pline_The("water flow seems fixed.");
497 pline("
\90\85\82Ì
\97¬
\82ê
\82ª
\88ê
\92è
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
499 case RIN_GAIN_STRENGTH:
501 pline_The("water flow seems %ser now.",
502 (obj->spe < 0) ? "weak" : "strong");
504 pline("
\90\85\82Ì
\97¬
\82ê
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
505 (obj->spe<0) ? "
\8eã
\82" : "
\8b
\82");
508 case RIN_GAIN_CONSTITUTION:
510 pline_The("water flow seems %ser now.",
511 (obj->spe < 0) ? "less" : "great");
513 pline("
\97¬
\82ê
\82é
\90\85\82Ì
\97Ê
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
514 (obj->spe < 0) ? "
\8f
\82È
\82" : "
\91½
\82");
517 case RIN_INCREASE_ACCURACY: /* KMH */
519 pline_The("water flow %s the drain.",
520 (obj->spe < 0) ? "misses" : "hits");
522 pline_The("
\90\85\82ª
\94r
\90\85\8cû%s
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D",
523 (obj->spe < 0) ? "
\82©
\82ç
\94½
\82ê
\82é" : "
\82ß
\82ª
\82¯
\82Ä
\97¬
\82ê
\82é");
526 case RIN_INCREASE_DAMAGE:
528 pline_The("water's force seems %ser now.",
529 (obj->spe < 0) ? "small" : "great");
531 pline_The("
\90\85\82Ì
\90¨
\82¢
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
532 (obj->spe < 0) ? "
\8eã
\82" : "
\8b
\82");
537 for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp2) {
538 otmp2 = otmp->nexthere;
539 if (otmp != uball && otmp != uchain
540 && !obj_resists(otmp, 1, 99)) {
543 pline("Suddenly, %s %s from the sink!", doname(otmp),
544 otense(otmp, "vanish"));
546 pline("
\93Ë
\91R
\81C%s
\82Í
\97¬
\82µ
\91ä
\82©
\82ç
\8fÁ
\82¦
\82½
\81I", doname(otmp));
555 /* Not the same as aggravate monster; besides, it's obvious. */
557 pline("Several flies buzz around the sink.");
559 pline("
\90\94\95C
\82Ì
\83n
\83G
\82ª
\83u
\83\93\83u
\83\93\97¬
\82µ
\91ä
\82Ì
\89ñ
\82è
\82ð
\94ò
\82Ñ
\82Ü
\82í
\82Á
\82½
\81D");
565 if (!Blind && !ideed && obj->otyp != RIN_HUNGER) {
567 switch (obj->otyp) { /* effects that need eyes */
570 pline_The("faucets flash brightly for a moment.");
572 pline("
\8eÖ
\8cû
\82Í
\88ê
\8fu
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
574 case RIN_REGENERATION:
576 pline_The("sink looks as good as new.");
578 pline("
\97¬
\82µ
\91ä
\82ª
\90V
\95i
\82Ì
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
580 case RIN_INVISIBILITY:
582 You("don't see anything happen to the sink.");
584 pline("
\97¬
\82µ
\91ä
\82É
\89½
\82ª
\8bN
\82«
\82½
\82Ì
\82©
\8c©
\82¦
\82È
\82©
\82Á
\82½
\81D");
586 case RIN_FREE_ACTION:
588 You_see("the ring slide right down the drain!");
590 pline("
\8ew
\97Ö
\82ª
\94r
\90\85\8cû
\82ð
\82·
\82é
\82è
\82Æ
\94ð
\82¯
\82é
\82Ì
\82ð
\8c©
\82½
\81I");
592 case RIN_SEE_INVISIBLE:
594 You_see("some %s in the sink.",
595 Hallucination ? "oxygen molecules" : "air");
597 pline("
\97¬
\82µ
\91ä
\82Ì
\8fã
\82Ì%s
\82ª
\8c©
\82¦
\82½
\81D",
598 Hallucination ? "
\8e_
\91f
\95ª
\8eq" : "
\8bó
\8bC");
603 pline_The("sink seems to blend into the floor for a moment.");
605 pline("
\88ê
\8fu
\81C
\97¬
\82µ
\91ä
\82ª
\8f°
\82É
\97n
\82¯
\82±
\82ñ
\82¾
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
607 case RIN_FIRE_RESISTANCE:
609 pline_The("hot water faucet flashes brightly for a moment.");
611 pline("
\88ê
\8fu
\81C
\94M
\93\92\82Ì
\8eÖ
\8cû
\82ª
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
613 case RIN_COLD_RESISTANCE:
615 pline_The("cold water faucet flashes brightly for a moment.");
617 pline("
\88ê
\8fu
\81C
\97â
\90\85\82Ì
\8eÖ
\8cû
\82ª
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
619 case RIN_PROTECTION_FROM_SHAPE_CHAN:
621 pline_The("sink looks nothing like a fountain.");
623 pline("
\97¬
\82µ
\91ä
\82Í
\90ò
\82Æ
\82Í
\82Ü
\82Á
\82½
\82
\88á
\82¤
\82à
\82Ì
\82Ì
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
627 pline_The("sink glows %s for a moment.",
628 hcolor((obj->spe < 0) ? NH_BLACK : NH_SILVER));
630 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
631 jconj_adj(hcolor((obj->spe<0) ? NH_BLACK : NH_SILVER)));
636 pline_The("sink glows %s for a moment.", hcolor(NH_WHITE));
638 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D", jconj_adj(hcolor(NH_WHITE)));
641 case RIN_TELEPORTATION:
642 nosink = teleport_sink();
644 pline_The("sink %svanishes.", nosink ? "" : "momentarily ");
646 pline_The("
\97¬
\82µ
\91ä
\82Í%s
\8fÁ
\82¦
\82½
\81D", nosink ? "" : "
\88ê
\8fu");
648 case RIN_TELEPORT_CONTROL:
649 /*JP: "beam aboard"
\82Í
\83X
\83^
\81[
\83g
\83\8c\83b
\83N
\82Ì
\81u
\93]
\91\97\81v*/
651 pline_The("sink looks like it is being beamed aboard somewhere.");
653 pline("
\97¬
\82µ
\91ä
\82Í
\82Ç
\82±
\82©
\82É
\93]
\91\97\82³
\82ê
\82æ
\82¤
\82Æ
\82µ
\82Ä
\82¢
\82é
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
659 case RIN_POLYMORPH_CONTROL:
662 "sink momentarily looks like a regularly erupting geyser.");
664 "
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu
\8bK
\91¥
\90³
\82µ
\82
\95¬
\8fo
\82·
\82é
\8aÔ
\8c\87\90ò
\82Ì
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
672 You_hear("the ring bouncing down the drainpipe.");
674 You_hear("
\8ew
\97Ö
\82ª
\94r
\90\85\8cû
\82É
\93\96\82½
\82è
\82È
\82ª
\82ç
\97\8e\82¿
\82é
\89¹
\82ð
\95·
\82¢
\82½
\81D");
676 if (!rn2(20) && !nosink) {
678 pline_The("sink backs up, leaving %s.", doname(obj));
680 pline("
\97¬
\82µ
\91ä
\82ª
\8bt
\97¬
\82µ
\82Ä
\81C%s
\82ª
\96ß
\82Á
\82Ä
\82«
\82½
\81D", doname(obj));
687 /* some common tests when trying to drop or throw items */
693 if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
696 Norep("You cannot %s %s you are wearing.", word, something);
698 Norep("
\82 \82È
\82½
\82ª
\90g
\82É
\82Â
\82¯
\82Ä
\82¢
\82é
\82à
\82Ì
\82ð%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", word);
701 if (obj->otyp == LOADSTONE && obj->cursed) {
702 /* getobj() kludge sets corpsenm to user's specified count
703 when refusing to split a stack of cursed loadstones */
705 #if 0 /*JP*//*
\93ú
\96{
\8cê
\82Å
\82Í
\95s
\97v*/
706 /* getobj() ignores a count for throwing since that is
707 implicitly forced to be 1; replicate its kludge... */
708 if (!strcmp(word, "throw") && obj->quan > 1L)
712 pline("For some reason, you cannot %s%s the stone%s!", word,
713 obj->corpsenm ? " any of" : "", plur(obj->quan));
715 pline("
\82Ç
\82¤
\82¢
\82¤
\82í
\82¯
\82©
\81C
\82 \82È
\82½
\82Í
\90Î
\82ð%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81I",
719 obj->corpsenm = 0; /* reset */
723 if (obj->otyp == LEASH && obj->leashmon != 0) {
726 pline_The("leash is tied around your %s.", body_part(HAND));
728 pline("
\95R
\82Í
\82 \82È
\82½
\82Ì%s
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82ç
\82ê
\82Ä
\82¢
\82é
\81D", body_part(HAND));
731 if (obj->owornmask & W_SADDLE) {
734 You("cannot %s %s you are sitting on.", word, something);
736 You("
\8fæ
\82Á
\82Ä
\82¢
\82é
\8aÔ
\82Í%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", word);
744 register struct obj *obj;
749 if (!canletgo(obj, "drop"))
751 if (!canletgo(obj, "
\92u
\82"))
758 setuwep((struct obj *) 0);
760 if (obj == uquiver) {
761 setuqwep((struct obj *) 0);
763 if (obj == uswapwep) {
764 setuswapwep((struct obj *) 0);
768 /* barrier between you and the floor */
772 /* doname can call s_suffix, reusing its buffer */
773 Strcpy(buf, s_suffix(mon_nam(u.ustuck)));
775 You("drop %s into %s %s.", doname(obj), buf,
776 mbodypart(u.ustuck, STOMACH));
778 You("%s
\82ð%s
\82Ì%s
\82É
\92u
\82¢
\82½
\81D", doname(obj), buf,
779 mbodypart(u.ustuck, STOMACH));
783 if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING)
784 && IS_SINK(levl[u.ux][u.uy].typ)) {
788 if (!can_reach_floor(TRUE)) {
789 /* we might be levitating due to #invoke Heart of Ahriman;
790 if so, levitation would end during call to freeinv()
791 and we want hitfloor() to happen before float_down() */
792 boolean levhack = finesse_ahriman(obj);
795 ELevitation = W_ART; /* other than W_ARTI */
798 You("drop %s.", doname(obj));
800 You("%s
\82ð
\92u
\82¢
\82½
\81D", doname(obj));
801 /* Ensure update when we drop gold objects */
802 if (obj->oclass == COIN_CLASS)
807 float_down(I_SPECIAL | TIMEOUT, W_ARTI | W_ART);
810 if (!IS_ALTAR(levl[u.ux][u.uy].typ) && flags.verbose)
812 You("drop %s.", doname(obj));
814 You("%s
\82ð
\92u
\82¢
\82½
\81D", doname(obj));
820 /* dropx - take dropped item out of inventory;
821 called in several places - may produce output
822 (eg ship_object() and dropy() -> sellobj() both produce output) */
825 register struct obj *obj;
827 /* Ensure update when we drop gold objects */
828 if (obj->oclass == COIN_CLASS)
832 if (ship_object(obj, u.ux, u.uy, FALSE))
834 if (IS_ALTAR(levl[u.ux][u.uy].typ))
835 doaltarobj(obj); /* set bknown */
840 /* dropy - put dropped object at destination; called from lots of places */
848 /* dropz - really put dropped object at its destination... */
850 dropz(obj, with_impact)
855 setuwep((struct obj *) 0);
857 setuqwep((struct obj *) 0);
859 setuswapwep((struct obj *) 0);
862 if (!u.uswallow && flooreffects(obj, u.ux, u.uy, "drop"))
864 if (!u.uswallow && flooreffects(obj,u.ux,u.uy, "
\97\8e\82¿
\82é"))
866 /* uswallow check done by GAN 01/29/87 */
868 boolean could_petrify = FALSE;
869 boolean could_poly = FALSE;
870 boolean could_slime = FALSE;
871 boolean could_grow = FALSE;
872 boolean could_heal = FALSE;
874 if (obj != uball) { /* mon doesn't pick up ball */
875 if (obj->otyp == CORPSE) {
876 could_petrify = touch_petrifies(&mons[obj->corpsenm]);
877 could_poly = polyfodder(obj);
878 could_slime = (obj->corpsenm == PM_GREEN_SLIME);
879 could_grow = (obj->corpsenm == PM_WRAITH);
880 could_heal = (obj->corpsenm == PM_NURSE);
882 (void) mpickobj(u.ustuck, obj);
883 if (is_animal(u.ustuck->data)) {
884 if (could_poly || could_slime) {
885 (void) newcham(u.ustuck,
886 could_poly ? (struct permonst *) 0
887 : &mons[PM_GREEN_SLIME],
889 delobj(obj); /* corpse is digested */
890 } else if (could_petrify) {
891 minstapetrify(u.ustuck, TRUE);
892 /* Don't leave a cockatrice corpse in a statue */
895 } else if (could_grow) {
896 (void) grow_up(u.ustuck, (struct monst *) 0);
897 delobj(obj); /* corpse is digested */
898 } else if (could_heal) {
899 u.ustuck->mhp = u.ustuck->mhpmax;
900 delobj(obj); /* corpse is digested */
905 place_object(obj, u.ux, u.uy);
907 container_impact_dmg(obj, u.ux, u.uy);
909 drop_ball(u.ux, u.uy);
910 else if (level.flags.has_shop)
911 sellobj(obj, u.ux, u.uy);
913 if (Blind && Levitation)
915 newsym(u.ux, u.uy); /* remap location under self */
919 /* things that must change when not held; recurse into containers.
920 Called for both player and monsters */
922 obj_no_longer_held(obj)
927 } else if (Has_contents(obj)) {
928 struct obj *contents;
930 for (contents = obj->cobj; contents; contents = contents->nobj)
931 obj_no_longer_held(contents);
935 /* Normal crysknife reverts to worm tooth when not held by hero
936 * or monster; fixed crysknife has only 10% chance of reverting.
937 * When a stack of the latter is involved, it could be worthwhile
938 * to give each individual crysknife its own separate 10% chance,
939 * but we aren't in any position to handle stack splitting here.
941 if (!obj->oerodeproof || !rn2(10)) {
942 /* if monsters aren't moving, assume player is responsible */
943 if (!context.mon_moving && !program_state.gameover)
944 costly_alteration(obj, COST_DEGRD);
945 obj->otyp = WORM_TOOTH;
946 obj->oerodeproof = 0;
952 /* 'D' command: drop several things */
958 add_valid_menu_class(0); /* clear any classes already there */
960 sellobj_state(SELL_DELIBERATE);
961 if (flags.menu_style != MENU_TRADITIONAL
962 || (result = ggetobj("drop", drop, 0, FALSE, (unsigned *) 0)) < -1)
963 result = menu_drop(result);
965 sellobj_state(SELL_NORMAL);
971 /* Drop things from the hero's inventory, using a menu. */
976 int n, i, n_dropped = 0;
978 struct obj *otmp, *otmp2;
979 menu_item *pick_list;
980 boolean all_categories = TRUE;
981 boolean drop_everything = FALSE;
984 all_categories = (retry == -2);
985 } else if (flags.menu_style == MENU_FULL) {
986 all_categories = FALSE;
988 n = query_category("Drop what type of items?", invent,
990 n = query_category("
\82Ç
\82Ì
\8eí
\97Þ
\82Ì
\83A
\83C
\83e
\83\80\82ð
\92u
\82«
\82Ü
\82·
\82©
\81H", invent,
991 UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL | BUC_BLESSED
992 | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN,
993 &pick_list, PICK_ANY);
996 for (i = 0; i < n; i++) {
997 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
998 all_categories = TRUE;
999 else if (pick_list[i].item.a_int == 'A')
1000 drop_everything = TRUE;
1002 add_valid_menu_class(pick_list[i].item.a_int);
1004 free((genericptr_t) pick_list);
1005 } else if (flags.menu_style == MENU_COMBINATION) {
1006 unsigned ggoresults = 0;
1007 all_categories = FALSE;
1008 /* Gather valid classes via traditional NetHack method */
1009 i = ggetobj("drop", drop, 0, TRUE, &ggoresults);
1011 all_categories = TRUE;
1012 if (ggoresults & ALL_FINISHED) {
1018 if (drop_everything) {
1020 * Dropping a burning potion of oil while levitating can cause
1021 * an explosion which might destroy some of hero's inventory,
1023 * for (otmp = invent; otmp; otmp = otmp2) {
1024 * otmp2 = otmp->nobj;
1025 * n_dropped += drop(otmp);
1027 * was unreliable and could lead to an "object lost" panic.
1029 * Use the bypass bit to mark items already processed (hence
1030 * not droppable) and rescan inventory until no unbypassed
1033 bypass_objlist(invent, FALSE); /* clear bypass bit for invent */
1034 while ((otmp = nxt_unbypassed_obj(invent)) != 0)
1035 n_dropped += drop(otmp);
1036 /* we might not have dropped everything (worn armor, welded weapon,
1037 cursed loadstones), so reset any remaining inventory to normal */
1038 bypass_objlist(invent, FALSE);
1040 /* should coordinate with perm invent, maybe not show worn items */
1042 n = query_objlist("What would you like to drop?", invent,
1044 n = query_objlist("
\82Ç
\82ê
\82ð
\92u
\82«
\82Ü
\82·
\82©
\81H", invent,
1045 USE_INVLET | INVORDER_SORT, &pick_list, PICK_ANY,
1046 all_categories ? allow_all : allow_category);
1049 * picklist[] contains a set of pointers into inventory, but
1050 * as soon as something gets dropped, they might become stale
1051 * (see the drop_everything code above for an explanation).
1052 * Just checking to see whether one is still in the invent
1053 * chain is not sufficient validation since destroyed items
1054 * will be freed and items we've split here might have already
1055 * reused that memory and put the same pointer value back into
1056 * invent. Ditto for using invlet to validate. So we start
1057 * by setting bypass on all of invent, then check each pointer
1058 * to verify that it is in invent and has that bit set.
1060 bypass_objlist(invent, TRUE);
1061 for (i = 0; i < n; i++) {
1062 otmp = pick_list[i].item.a_obj;
1063 for (otmp2 = invent; otmp2; otmp2 = otmp2->nobj)
1066 if (!otmp2 || !otmp2->bypass)
1068 /* found next selected invent item */
1069 cnt = pick_list[i].count;
1070 if (cnt < otmp->quan) {
1073 } else if (otmp->otyp == LOADSTONE && otmp->cursed) {
1074 /* same kludge as getobj(), for canletgo()'s use */
1075 otmp->corpsenm = (int) cnt; /* don't split */
1077 otmp = splitobj(otmp, cnt);
1080 n_dropped += drop(otmp);
1082 bypass_objlist(invent, FALSE); /* reset invent to normal */
1083 free((genericptr_t) pick_list);
1091 /* on a ladder, used in goto_level */
1092 static NEARDATA boolean at_ladder = FALSE;
1094 /* the '>' command */
1098 struct trap *trap = 0;
1099 boolean stairs_down = ((u.ux == xdnstair && u.uy == ydnstair)
1100 || (u.ux == sstairs.sx && u.uy == sstairs.sy
1102 ladder_down = (u.ux == xdnladder && u.uy == ydnladder);
1107 if (stucksteed(TRUE)) {
1110 /* Levitation might be blocked, but player can still use '>' to
1111 turn off controlled levitation */
1112 if (HLevitation || ELevitation) {
1113 if ((HLevitation & I_SPECIAL) || (ELevitation & W_ARTI)) {
1114 /* end controlled levitation */
1115 if (ELevitation & W_ARTI) {
1118 for (obj = invent; obj; obj = obj->nobj) {
1120 && artifact_has_invprop(obj, LEVITATION)) {
1121 if (obj->age < monstermoves)
1122 obj->age = monstermoves;
1123 obj->age += rnz(100);
1127 if (float_down(I_SPECIAL | TIMEOUT, W_ARTI)) {
1128 return 1; /* came down, so moved */
1129 } else if (!HLevitation && !ELevitation) {
1131 Your("latent levitation ceases.");
1133 pline("
\90ö
\8dÝ
\93I
\82È
\95\82\97V
\94\
\97Í
\82ª
\92\86\92f
\82µ
\82½
\81D");
1134 return 1; /* did something, effectively moved */
1138 ; /* weren't actually floating after all */
1140 /* Avoid alerting player to an unknown stair or ladder.
1141 * Changes the message for a covered, known staircase
1142 * too; staircase knowledge is not stored anywhere.
1146 (glyph_to_cmap(levl[u.ux][u.uy].glyph) == S_dnstair);
1147 else if (ladder_down)
1149 (glyph_to_cmap(levl[u.ux][u.uy].glyph) == S_dnladder);
1152 floating_above(stairs_down ? "stairs" : ladder_down
1154 : surface(u.ux, u.uy));
1156 floating_above(stairs_down ? "
\8aK
\92i" : ladder_down
1158 : surface(u.ux, u.uy));
1160 return 0; /* didn't move */
1162 if (!stairs_down && !ladder_down) {
1163 trap = t_at(u.ux, u.uy);
1164 if (trap && uteetering_at_seen_pit(trap)) {
1165 dotrap(trap, TOOKPLUNGE);
1167 } else if (!trap || (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
1168 || !Can_fall_thru(&u.uz) || !trap->tseen) {
1169 if (flags.autodig && !context.nopick && uwep && is_pick(uwep)) {
1170 return use_pick_axe2(uwep);
1173 You_cant("go down here.");
1175 pline("
\82±
\82±
\82Å
\82Í
\8d~
\82è
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
1182 You("are %s, and cannot go down.",
1183 !u.uswallow ? "being held" : is_animal(u.ustuck->data)
1187 You("%s
\8d~
\82è
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1188 !u.uswallow ? "
\82Â
\82©
\82Ü
\82¦
\82ç
\82ê
\82Ä
\82¢
\82Ä" : is_animal(u.ustuck->data)
1189 ? "
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä"
1190 : "
\8aª
\82«
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä");
1194 if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) {
1196 You("are standing at the gate to Gehennom.");
1198 You("
\83Q
\83w
\83i
\82Ì
\96å
\82Ì
\91O
\82É
\97§
\82Á
\82Ä
\82¢
\82é
\81D");
1200 pline("Unspeakable cruelty and harm lurk down there.");
1202 pline("
\8c¾
\97t
\82É
\82·
\82ç
\82Å
\82«
\82È
\82¢
\8ec
\8bs
\82Æ
\8eS
\8e\96\82ª
\82±
\82Ì
\89º
\82É
\90ö
\82ñ
\82Å
\82¢
\82é
\81D");
1204 if (yn("Are you sure you want to enter?") != 'y')
1206 if (yn("
\96{
\93\96\82É
\93ü
\82è
\82Ü
\82·
\82©
\81H") != 'y')
1212 pline("
\82È
\82ç
\8dD
\82«
\82É
\82·
\82ê
\82Î
\82æ
\82¢
\81D");
1213 u.uevent.gehennom_entered = 1; /* don't ask again */
1218 You("are held back by your pet!");
1220 You("
\83y
\83b
\83g
\82É
\88ø
\82«
\82à
\82Ç
\82³
\82ê
\82½
\81I");
1226 You("%s %s.", Flying ? "fly" : locomotion(youmonst.data, "jump"),
1227 trap->ttyp == HOLE ? "down the hole" : "through the trap door");
1230 trap->ttyp == HOLE ? "
\8c\8a\82ð
\8d~
\82è
\82½" : "
\97\8e\82µ
\94à
\82ð
\92Ê
\82è
\94²
\82¯
\82½");
1233 if (trap && Is_stronghold(&u.uz)) {
1234 goto_hell(FALSE, TRUE);
1236 at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER);
1243 /* the '<' command */
1250 /* "up" to get out of a pit... */
1251 if (u.utrap && u.utraptype == TT_PIT) {
1256 if ((u.ux != xupstair || u.uy != yupstair)
1257 && (!xupladder || u.ux != xupladder || u.uy != yupladder)
1258 && (!sstairs.sx || u.ux != sstairs.sx || u.uy != sstairs.sy
1261 You_cant("go up here.");
1263 You("
\82±
\82±
\82Å
\82Í
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
1266 if (stucksteed(TRUE)) {
1271 You("are %s, and cannot go up.",
1272 !u.uswallow ? "being held" : is_animal(u.ustuck->data)
1276 You("%s
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1277 !u.uswallow ? "
\82Â
\82©
\82Ü
\82¦
\82ç
\82ê
\82Ä
\82¢
\82Ä" : is_animal(u.ustuck->data)
1278 ? "
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä"
1279 : "
\8aª
\82«
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä");
1283 if (near_capacity() > SLT_ENCUMBER) {
1284 /* No levitation check; inv_weight() already allows for it */
1286 Your("load is too heavy to climb the %s.",
1287 levl[u.ux][u.uy].typ == STAIRS ? "stairs" : "ladder");
1289 You("
\95¨
\82ð
\8e\9d\82¿
\82·
\82¬
\82Ä%s
\82ð
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1290 levl[u.ux][u.uy].typ == STAIRS ? "
\8aK
\92i" : "
\82Í
\82µ
\82²");
1294 if (ledger_no(&u.uz) == 1) {
1296 if (yn("Beware, there will be no return! Still climb?") != 'y')
1298 if (yn("
\8bC
\82ð
\82Â
\82¯
\82ë
\81C
\96ß
\82ê
\82È
\82¢
\82¼
\81I
\82»
\82ê
\82Å
\82à
\8fã
\82é
\81H") != 'y')
1303 You("are held back by your pet!");
1305 You("
\83y
\83b
\83g
\82É
\88ø
\82«
\82à
\82Ç
\82³
\82ê
\82½
\81I");
1308 at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER);
1314 d_level save_dlevel = { 0, 0 };
1316 /* check that we can write out the current level */
1318 currentlevel_rewrite()
1323 /* since level change might be a bit slow, flush any buffered screen
1324 * output (like "you fall through a trap door") */
1327 fd = create_levelfile(ledger_no(&u.uz), whynot);
1330 * This is not quite impossible: e.g., we may have
1331 * exceeded our quota. If that is the case then we
1332 * cannot leave this level, and cannot save either.
1333 * Another possibility is that the directory was not
1341 if (!savelev(fd, ledger_no(&u.uz), COUNT_SAVE)) {
1343 delete_levelfile(ledger_no(&u.uz));
1345 pline("NetHack is out of disk space for making levels!");
1347 pline("
\90V
\82µ
\82¢
\83\8c\83x
\83\8b\82ð
\8dì
\82é
\82½
\82ß
\82Ì
\83f
\83B
\83X
\83N
\97e
\97Ê
\82ª
\91«
\82è
\82È
\82¢
\81I");
1349 You("can save, quit, or continue playing.");
1351 You("
\83Z
\81[
\83u
\82·
\82é
\82©
\8fI
\97¹
\82·
\82é
\82©
\81C
\82 \82é
\82¢
\82Í
\83v
\83\8c\83C
\82ð
\91±
\8ds
\82Å
\82«
\82é
\81D");
1364 if (flags.ins_chkpt) {
1365 /* write out just-attained level, with pets and everything */
1366 fd = currentlevel_rewrite();
1370 savelev(fd, ledger_no(&u.uz), WRITE_SAVE);
1374 /* write out non-level state */
1382 register xchar x, y;
1384 return (boolean) ((levl[x][y].typ != ROOM
1385 && levl[x][y].typ != AIR
1386 && levl[x][y].typ != CORR)
1392 goto_level(newlevel, at_stairs, falling, portal)
1394 boolean at_stairs, falling, portal;
1398 boolean cant_go_back, up = (depth(newlevel) < depth(&u.uz)),
1399 newdungeon = (u.uz.dnum != newlevel->dnum),
1400 was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz),
1402 boolean new = FALSE; /* made a new level? */
1407 if (dunlev(newlevel) > dunlevs_in_dungeon(newlevel))
1408 newlevel->dlevel = dunlevs_in_dungeon(newlevel);
1409 if (newdungeon && In_endgame(newlevel)) { /* 1st Endgame Level !!! */
1410 if (!u.uhave.amulet)
1411 return; /* must have the Amulet */
1412 if (!wizard) /* wizard ^V can bypass Earth level */
1413 assign_level(newlevel, &earth_level); /* (redundant) */
1415 new_ledger = ledger_no(newlevel);
1416 if (new_ledger <= 0)
1417 done(ESCAPED); /* in fact < 0 is impossible */
1419 /* If you have the amulet and are trying to get out of Gehennom,
1420 * going up a set of stairs sometimes does some very strange things!
1421 * Biased against law and towards chaos. (The chance to be sent
1422 * down multiple levels when attempting to go up are significantly
1423 * less than the corresponding comment in older versions indicated
1424 * due to overlooking the effect of the call to assign_rnd_lvl().)
1426 * Odds for making it to the next level up, or of being sent down:
1430 * -1 11.46 12.50 12.5
1434 if (Inhell && up && u.uhave.amulet && !newdungeon && !portal
1435 && (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz) - 3)) {
1437 int odds = 3 + (int) u.ualign.type, /* 2..4 */
1438 diff = odds <= 1 ? 0 : rn2(odds); /* paranoia */
1441 assign_rnd_level(newlevel, &u.uz, diff);
1442 /* if inside the tower, stay inside */
1443 if (was_in_W_tower && !On_W_tower_level(newlevel))
1447 assign_level(newlevel, &u.uz);
1449 new_ledger = ledger_no(newlevel);
1452 pline("A mysterious force momentarily surrounds you...");
1454 pline("
\88ê
\8fu
\8aï
\96
\82È
\97Í
\82ª
\82 \82È
\82½
\82ð
\95ï
\82ñ
\82¾
\81D
\81D
\81D");
1455 if (on_level(newlevel, &u.uz)) {
1456 (void) safe_teleds(FALSE);
1460 at_stairs = at_ladder = FALSE;
1464 /* Prevent the player from going past the first quest level unless
1465 * (s)he has been given the go-ahead by the leader.
1467 if (on_level(&u.uz, &qstart_level) && !newdungeon && !ok_to_quest()) {
1469 pline("A mysterious force prevents you from descending.");
1471 pline("
\8aï
\96
\82È
\97Í
\82ª
\82 \82È
\82½
\82ª
\8d~
\82è
\82é
\82Ì
\82ð
\96W
\82°
\82½
\81D");
1475 if (on_level(newlevel, &u.uz))
1476 return; /* this can happen */
1478 /* tethered movement makes level change while trapped feasible */
1479 if (u.utrap && u.utraptype == TT_BURIEDBALL)
1480 buried_ball_to_punishment(); /* (before we save/leave old level) */
1482 fd = currentlevel_rewrite();
1486 if (falling) /* assuming this is only trap door or hole */
1487 impact_drop((struct obj *) 0, u.ux, u.uy, newlevel->dlevel);
1489 check_special_room(TRUE); /* probably was a trap door */
1492 u.utrap = 0; /* needed in level_tele */
1493 fill_pit(u.ux, u.uy);
1494 u.ustuck = 0; /* idem */
1496 u.uundetected = 0; /* not hidden, even if means are available */
1498 if (u.uswallow) /* idem */
1499 u.uswldtim = u.uswallow = 0;
1500 recalc_mapseen(); /* recalculate map overview before we leave the level */
1502 * We no longer see anything on the level. Make sure that this
1503 * follows u.uswallow set to null since uswallow overrides all
1509 * Save the level we're leaving. If we're entering the endgame,
1510 * we can get rid of all existing levels because they cannot be
1511 * reached any more. We still need to use savelev()'s cleanup
1512 * for the level being left, to recover dynamic memory in use and
1513 * to avoid dangling timers and light sources.
1515 cant_go_back = (newdungeon && In_endgame(newlevel));
1516 if (!cant_go_back) {
1517 update_mlstmv(); /* current monsters are becoming inactive */
1518 bufon(fd); /* use buffered output */
1520 savelev(fd, ledger_no(&u.uz),
1521 cant_go_back ? FREE_SAVE : (WRITE_SAVE | FREE_SAVE));
1524 /* discard unreachable levels; keep #0 */
1525 for (l_idx = maxledgerno(); l_idx > 0; --l_idx)
1526 delete_levelfile(l_idx);
1527 /* mark #overview data for all dungeon branches as uninteresting */
1528 for (l_idx = 0; l_idx < n_dgns; ++l_idx)
1529 remdun_mapseen(l_idx);
1532 if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz))
1533 assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY);
1535 substitute_tiles(newlevel);
1537 /* record this level transition as a potential seen branch unless using
1538 * some non-standard means of transportation (level teleport).
1540 if ((at_stairs || falling || portal) && (u.uz.dnum != newlevel->dnum))
1541 recbranch_mapseen(&u.uz, newlevel);
1542 assign_level(&u.uz0, &u.uz);
1543 assign_level(&u.uz, newlevel);
1544 assign_level(&u.utolev, newlevel);
1546 if (!builds_up(&u.uz)) { /* usual case */
1547 if (dunlev(&u.uz) > dunlev_reached(&u.uz))
1548 dunlev_reached(&u.uz) = dunlev(&u.uz);
1550 if (dunlev_reached(&u.uz) == 0
1551 || dunlev(&u.uz) < dunlev_reached(&u.uz))
1552 dunlev_reached(&u.uz) = dunlev(&u.uz);
1554 reset_rndmonst(NON_PM); /* u.uz change affects monster generation */
1556 /* set default level change destination areas */
1557 /* the special level code may override these */
1558 (void) memset((genericptr_t) &updest, 0, sizeof updest);
1559 (void) memset((genericptr_t) &dndest, 0, sizeof dndest);
1561 if (!(level_info[new_ledger].flags & LFILE_EXISTS)) {
1562 /* entering this level for first time; make it now */
1563 if (level_info[new_ledger].flags & (FORGOTTEN | VISITED)) {
1564 impossible("goto_level: returning to discarded level?");
1565 level_info[new_ledger].flags &= ~(FORGOTTEN | VISITED);
1568 new = TRUE; /* made the level */
1570 /* returning to previously visited level; reload it */
1571 fd = open_levelfile(new_ledger, whynot);
1572 if (tricked_fileremoved(fd, whynot)) {
1573 /* we'll reach here if running in wizard mode */
1574 error("Cannot continue this game.");
1576 minit(); /* ZEROCOMP */
1577 getlev(fd, hackpid, new_ledger, FALSE);
1579 oinit(); /* reassign level dependent obj probabilities */
1582 /* do this prior to level-change pline messages */
1583 vision_reset(); /* clear old level's line-of-sight */
1584 vision_full_recalc = 0; /* don't let that reenable vision yet */
1585 flush_screen(-1); /* ensure all map flushes are postponed */
1587 if (portal && !In_endgame(&u.uz)) {
1588 /* find the portal on the new level */
1589 register struct trap *ttrap;
1591 for (ttrap = ftrap; ttrap; ttrap = ttrap->ntrap)
1592 if (ttrap->ttyp == MAGIC_PORTAL)
1596 panic("goto_level: no corresponding portal!");
1598 u_on_newpos(ttrap->tx, ttrap->ty);
1599 } else if (at_stairs && !In_endgame(&u.uz)) {
1602 u_on_newpos(xdnladder, ydnladder);
1603 else if (newdungeon)
1607 /* you climb up the {stairs|ladder};
1608 fly up the stairs; fly up along the ladder */
1610 pline("%s %s up%s the %s.",
1611 (Punished && !Levitation) ? "With great effort you" : "You",
1612 Flying ? "fly" : "climb",
1613 (Flying && at_ladder) ? " along" : "",
1614 at_ladder ? "ladder" : "stairs");
1616 pline("%s%s
\82ð
\8fã
\82Á
\82½
\81D",
1617 (Punished && !Levitation) ? "
\82â
\82Á
\82Æ
\82±
\82³" : "",
1618 at_ladder ? "
\82Í
\82µ
\82²" : "
\8aK
\92i");
1622 u_on_newpos(xupladder, yupladder);
1623 else if (newdungeon)
1628 ; /* stayed on same level? (no transit effects) */
1629 } else if (Flying) {
1633 at_ladder ? "along the ladder" : "the stairs");
1635 You("%s
\94ò
\82ñ
\82Å
\8d~
\82è
\82½
\81D",
1636 at_ladder ? "
\82Í
\82µ
\82²
\82É
\89\88\82Á
\82Ä" : "
\8aK
\92i
\82ð");
1638 } else if (near_capacity() > UNENCUMBERED || Punished
1641 You("fall down the %s.", at_ladder ? "ladder" : "stairs");
1643 You("%s
\82ð
\93]
\82°
\97\8e\82¿
\82½
\81D", at_ladder ? "
\82Í
\82µ
\82²" : "
\8aK
\92i");
1648 /* falling off steed has its own losehp() call */
1650 dismount_steed(DISMOUNT_FELL);
1652 losehp(Maybe_Half_Phys(rnd(3)),
1654 at_ladder ? "falling off a ladder"
1656 at_ladder ? "
\82Í
\82µ
\82²
\82©
\82ç
\97\8e\82¿
\82Ä"
1658 : "tumbling down a flight of stairs",
1660 : "
\8aK
\92i
\82ð
\93]
\82°
\97\8e\82¿
\82Ä",
1663 selftouch("Falling, you");
1665 selftouch("
\97\8e\82¿
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Í");
1666 } else { /* ordinary descent */
1669 You("%s.", at_ladder ? "climb down the ladder"
1670 : "descend the stairs");
1672 You("%s
\82ð
\8d~
\82è
\82½
\81D", at_ladder ? "
\82Í
\82µ
\82²"
1677 } else { /* trap door or level_tele or In_endgame */
1678 u_on_rndspot((up ? 1 : 0) | (was_in_W_tower ? 2 : 0));
1683 selftouch("Falling, you");
1685 selftouch("
\97\8e\82¿
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Í");
1691 obj_delivery(FALSE);
1693 kill_genocided_monsters(); /* for those wiped out while in limbo */
1695 * Expire all timers that have gone off while away. Must be
1696 * after migrating monsters and objects are delivered
1697 * (losedogs and obj_delivery).
1703 if ((mtmp = m_at(u.ux, u.uy)) != 0 && mtmp != u.usteed) {
1704 /* There's a monster at your target destination; it might be one
1705 which accompanied you--see mon_arrive(dogmove.c)--or perhaps
1706 it was already here. Randomly move you to an adjacent spot
1707 or else the monster to any nearby location. Prior to 3.3.0
1708 the latter was done unconditionally. */
1711 if (!rn2(2) && enexto(&cc, u.ux, u.uy, youmonst.data)
1712 && distu(cc.x, cc.y) <= 2)
1713 u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
1717 if ((mtmp = m_at(u.ux, u.uy)) != 0) {
1718 /* there was an unconditional impossible("mnearto failed")
1719 here, but it's not impossible and we're prepared to cope
1720 with the situation, so only say something when debugging */
1722 pline("(monster in hero's way)");
1723 if (!rloc(mtmp, TRUE))
1724 /* no room to move it; send it away, to return later */
1725 migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_RANDOM,
1730 /* initial movement of bubbles just before vision_recalc */
1731 if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))
1733 else if (Is_firelevel(&u.uz))
1736 if (level_info[new_ledger].flags & FORGOTTEN) {
1737 forget_map(ALL_MAP); /* forget the map */
1738 forget_traps(); /* forget all traps too */
1740 level_info[new_ledger].flags &= ~FORGOTTEN;
1743 /* Reset the screen. */
1744 vision_reset(); /* reset the blockages */
1745 docrt(); /* does a full vision recalc */
1749 * Move all plines beyond the screen reset.
1752 /* special levels can have a custom arrival message */
1753 deliver_splev_message();
1755 /* give room entrance message, if any */
1756 check_special_room(FALSE);
1758 /* deliver objects traveling with player */
1761 /* Check whether we just entered Gehennom. */
1762 if (!In_hell(&u.uz0) && Inhell) {
1763 if (Is_valley(&u.uz)) {
1765 You("arrive at the Valley of the Dead...");
1767 You("
\8e\80\82Ì
\92J
\82É
\93\9e\92B
\82µ
\82½
\81D
\81D
\81D");
1769 pline_The("odor of burnt flesh and decay pervades the air.");
1771 pline("
\8fÅ
\82°
\82é
\8e\80\93÷
\82â
\95\85\93÷
\82Ì
\88«
\8fL
\82ª
\82½
\82¾
\82æ
\82Á
\82Ä
\82¢
\82é
\81D");
1773 display_nhwindow(WIN_MESSAGE, FALSE);
1776 You_hear("groans and moans everywhere.");
1778 You_hear("
\82»
\82±
\82©
\82µ
\82±
\82©
\82ç
\82Ì
\82¤
\82ß
\82«
\90º
\82â
\82¤
\82È
\82è
\90º
\82ð
\95·
\82¢
\82½
\81D");
1781 pline("It is hot here. You smell smoke...");
1783 pline("
\82±
\82±
\82Í
\8f\8b\82¢
\81D
\89\8c\82Ì
\93õ
\82¢
\82ª
\82·
\82é
\81D
\81D
\81D");
1784 u.uachieve.enter_gehennom = 1;
1786 /* in case we've managed to bypass the Valley's stairway down */
1787 if (Inhell && !Is_valley(&u.uz))
1788 u.uevent.gehennom_entered = 1;
1791 static const char *const fam_msgs[4] = {
1793 "You have a sense of deja vu.",
1795 "
\8aù
\8e\8b\8a´
\82É
\82¨
\82»
\82í
\82ê
\82½
\81D",
1797 "You feel like you've been here before.",
1799 "
\91O
\82É
\82±
\82±
\82É
\97\88\82½
\82±
\82Æ
\82ª
\82 \82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
1801 "This place %s familiar...", 0 /* no message */
1803 "
\82±
\82Ì
\8fê
\8f\8a\82Í
\89ù
\82©
\82µ
\82¢
\81D
\81D
\81D", 0 /* no message */
1806 static const char *const halu_fam_msgs[4] = {
1808 "Whoa! Everything %s different.",
1810 "
\83I
\83\8f\83b
\81I
\82Ü
\82Á
\82½
\82
\95Ï
\82í
\82Á
\82¿
\82Ü
\82Á
\82Ä
\82é
\81D",
1812 "You are surrounded by twisty little passages, all alike.",
1814 "
\82 \82È
\82½
\82Í
\82Ü
\82ª
\82è
\82
\82Ë
\82Á
\82½
\92Ê
\98H
\82É
\82©
\82±
\82Ü
\82ê
\82Ä
\82¢
\82½
\81D
\81D
\81D",
1816 "Gee, this %s like uncle Conan's place...", 0 /* no message */
1818 "
\83Q
\81[
\81I
\83R
\83i
\83\93\82¨
\82¶
\82³
\82ñ
\82Ì
\8fê
\8f\8a\82É
\8e\97\82Ä
\82¢
\82é
\81D
\81D
\81D", 0 /* no message */
1828 mesg = halu_fam_msgs[which];
1830 mesg = fam_msgs[which];
1831 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\82»
\82±
\82Ü
\82Å
\82µ
\82È
\82¢*/
1832 if (mesg && index(mesg, '%')) {
1833 Sprintf(buf, mesg, !Blind ? "looks" : "seems");
1841 /* special location arrival messages/events */
1842 if (In_endgame(&u.uz)) {
1843 if (new &&on_level(&u.uz, &astral_level))
1844 final_level(); /* guardian angel,&c */
1845 else if (newdungeon && u.uhave.amulet)
1846 resurrect(); /* force confrontation with Wizard */
1847 } else if (In_quest(&u.uz)) {
1848 onquest(); /* might be reaching locate|goal level */
1849 } else if (In_V_tower(&u.uz)) {
1850 if (newdungeon && In_hell(&u.uz0))
1852 pline_The("heat and smoke are gone.");
1854 pline("
\94M
\82Æ
\89\8c\82è
\82Í
\8fÁ
\82¦
\82³
\82Á
\82½
\81D");
1855 } else if (Is_knox(&u.uz)) {
1856 /* alarm stops working once Croesus has died */
1857 if (new || !mvitals[PM_CROESUS].died) {
1859 You("have penetrated a high security area!");
1861 You("
\8dÅ
\8d\82\8b@
\96§
\82Ì
\8fê
\8f\8a\82Ö
\93¥
\82Ý
\8d\9e\82ñ
\82¾
\81I");
1863 pline("An alarm sounds!");
1865 pline("
\8cx
\95ñ
\82ª
\82È
\82Á
\82½
\81I");
1866 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1867 if (DEADMONSTER(mtmp))
1869 mtmp->msleeping = 0;
1873 if (new && Is_rogue_level(&u.uz))
1875 You("enter what seems to be an older, more primitive world.");
1877 You("
\8cÃ
\82
\82³
\82
\81C
\82¸
\82¢
\82Ô
\82ñ
\92P
\8f\83\82È
\90¢
\8aE
\82É
\8c©
\82¦
\82é
\95\94\89®
\82É
\93ü
\82Á
\82½
\81D");
1878 /* main dungeon message from your quest leader */
1880 if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest")
1882 if (!In_quest(&u.uz0) && at_dgn_entrance("
\83N
\83G
\83X
\83g")
1883 && !(u.uevent.qcompleted || u.uevent.qexpelled
1884 || quest_status.leader_is_dead)) {
1885 if (!u.uevent.qcalled) {
1886 u.uevent.qcalled = 1;
1887 com_pager(2); /* main "leader needs help" message */
1888 } else { /* reminder message */
1889 com_pager(Role_if(PM_ROGUE) ? 4 : 3);
1894 assign_level(&u.uz0, &u.uz); /* reset u.uz0 */
1896 save_currentstate();
1899 if ((annotation = get_annotation(&u.uz)))
1901 You("remember this level as %s.", annotation);
1903 You("
\82±
\82Ì
\8aK
\82ª%s
\82Å
\82 \82é
\82±
\82Æ
\82ð
\8ev
\82¢
\8fo
\82µ
\82½
\81D", annotation);
1905 /* assume this will always return TRUE when changing level */
1906 (void) in_out_region(u.ux, u.uy);
1908 context.polearm.hitmon = NULL;
1916 /* reset monster hostility relative to player */
1917 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1918 if (DEADMONSTER(mtmp))
1920 reset_hostility(mtmp);
1923 /* create some player-monsters */
1924 create_mplayers(rn1(4, 3), TRUE);
1926 /* create a guardian angel next to player, if worthy */
1927 gain_guardian_angel();
1930 static char *dfr_pre_msg = 0, /* pline() before level change */
1931 *dfr_post_msg = 0; /* pline() after level change */
1933 /* change levels at the end of this turn, after monsters finish moving */
1935 schedule_goto(tolev, at_stairs, falling, portal_flag, pre_msg, post_msg)
1937 boolean at_stairs, falling;
1939 const char *pre_msg, *post_msg;
1941 int typmask = 0100; /* non-zero triggers `deferred_goto' */
1943 /* destination flags (`goto_level' args) */
1950 if (portal_flag < 0)
1951 typmask |= 0200; /* flag for portal removal */
1952 u.utotype = typmask;
1953 /* destination level */
1954 assign_level(&u.utolev, tolev);
1957 dfr_pre_msg = dupstr(pre_msg);
1959 dfr_post_msg = dupstr(post_msg);
1962 /* handle something like portal ejection */
1966 if (!on_level(&u.uz, &u.utolev)) {
1968 int typmask = u.utotype; /* save it; goto_level zeroes u.utotype */
1970 assign_level(&dest, &u.utolev);
1972 pline1(dfr_pre_msg);
1973 goto_level(&dest, !!(typmask & 1), !!(typmask & 2), !!(typmask & 4));
1974 if (typmask & 0200) { /* remove portal */
1975 struct trap *t = t_at(u.ux, u.uy);
1983 pline1(dfr_post_msg);
1985 u.utotype = 0; /* our caller keys off of this */
1987 free((genericptr_t) dfr_pre_msg), dfr_pre_msg = 0;
1989 free((genericptr_t) dfr_post_msg), dfr_post_msg = 0;
1993 * Return TRUE if we created a monster for the corpse. If successful, the
1997 revive_corpse(corpse)
2000 struct monst *mtmp, *mcarry;
2001 boolean is_uwep, chewed;
2004 struct obj *container = (struct obj *) 0;
2005 int container_where = 0;
2007 where = corpse->where;
2008 is_uwep = (corpse == uwep);
2009 chewed = (corpse->oeaten != 0);
2012 corpse_xname(corpse, chewed ? "bite-covered" : (const char *) 0,
2014 corpse_xname(corpse, chewed ? "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½" : (const char *) 0,
2016 mcarry = (where == OBJ_MINVENT) ? corpse->ocarry : 0;
2018 if (where == OBJ_CONTAINED) {
2019 struct monst *mtmp2;
2021 container = corpse->ocontainer;
2023 get_container_location(container, &container_where, (int *) 0);
2024 /* container_where is the outermost container's location even if
2026 if (container_where == OBJ_MINVENT && mtmp2)
2029 mtmp = revive(corpse, FALSE); /* corpse is gone if successful */
2036 pline_The("%s writhes out of your grasp!", cname);
2038 pline_The("%s
\82Í
\82à
\82ª
\82¢
\82½
\81I", cname);
2041 You_feel("squirming in your backpack!");
2043 pline("
\94w
\95\89\82¢
\91Ü
\82Å
\89½
\82©
\82ª
\82à
\82ª
\82¢
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81I");
2047 if (cansee(mtmp->mx, mtmp->my))
2049 pline("%s rises from the dead!",
2050 chewed ? Adjmonnam(mtmp, "bite-covered")
2053 pline("%s
\82ª
\91h
\82Á
\82½
\81I",
2054 chewed ? Adjmonnam(mtmp, "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½")
2059 case OBJ_MINVENT: /* probably a nymph's */
2060 if (cansee(mtmp->mx, mtmp->my)) {
2061 if (canseemon(mcarry))
2063 pline("Startled, %s drops %s as it revives!",
2064 mon_nam(mcarry), an(cname));
2066 pline("%s
\82ª
\90¶
\82«
\82©
\82¦
\82Á
\82½
\82Ì
\82É
\82Ñ
\82Á
\82
\82è
\82µ
\82Ä
\81C%s
\82Í%s
\82ð
\97\8e\82µ
\82½
\81I",
2067 cname, mon_nam(mcarry), cname);
2071 pline("%s suddenly appears!",
2072 chewed ? Adjmonnam(mtmp, "bite-covered")
2075 pline("%s
\82ª
\93Ë
\91R
\8c»
\82í
\82ê
\82½
\81I",
2076 chewed ? Adjmonnam(mtmp, "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½")
2081 case OBJ_CONTAINED: {
2082 char sackname[BUFSZ];
2084 if (container_where == OBJ_MINVENT && cansee(mtmp->mx, mtmp->my)
2085 && mcarry && canseemon(mcarry) && container) {
2087 pline("%s writhes out of %s!", Amonnam(mtmp),
2089 pline("%s
\82Í%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\82à
\82ª
\82¢
\82½
\81I", Amonnam(mtmp),
2091 } else if (container_where == OBJ_INVENT && container) {
2092 Strcpy(sackname, an(xname(container)));
2094 pline("%s %s out of %s in your pack!",
2095 Blind ? Something : Amonnam(mtmp),
2096 locomotion(mtmp->data, "writhes"), sackname);
2098 pline("%s
\82Í
\91Ü
\82Ì
\92\86\82Å%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\82à
\82ª
\82¢
\82½
\81I",
2099 Blind ? Something : Amonnam(mtmp),
2102 } else if (container_where == OBJ_FLOOR && container
2103 && cansee(mtmp->mx, mtmp->my)) {
2104 Strcpy(sackname, an(xname(container)));
2106 pline("%s escapes from %s!", Amonnam(mtmp), sackname);
2108 pline("%s
\82Í%s
\82©
\82ç
\93¦
\82ê
\82½
\81I", Amonnam(mtmp), sackname);
2113 /* we should be able to handle the other cases... */
2114 impossible("revive_corpse: lost corpse @ %d", where);
2122 /* Revive the corpse via a timeout. */
2125 revive_mon(arg, timeout)
2127 long timeout UNUSED;
2129 struct obj *body = arg->a_obj;
2130 struct permonst *mptr = &mons[body->corpsenm];
2134 /* corpse will revive somewhere else if there is a monster in the way;
2135 Riders get a chance to try to bump the obstacle out of their way */
2136 if ((mptr->mflags3 & M3_DISPLACES) != 0 && body->where == OBJ_FLOOR
2137 && get_obj_location(body, &x, &y, 0) && (mtmp = m_at(x, y)) != 0) {
2138 boolean notice_it = canseemon(mtmp); /* before rloc() */
2139 char *monname = Monnam(mtmp);
2141 if (rloc(mtmp, TRUE)) {
2142 if (notice_it && !canseemon(mtmp))
2144 pline("%s vanishes.", monname);
2146 pline("%s
\82Í
\8fÁ
\82¦
\82½
\81D", monname);
2147 else if (!notice_it && canseemon(mtmp))
2149 pline("%s appears.", Monnam(mtmp)); /* not pre-rloc monname */
2151 pline("%s
\82ª
\8c»
\82ê
\82½
\81D", Monnam(mtmp)); /* not pre-rloc monname */
2153 else if (notice_it && dist2(mtmp->mx, mtmp->my, x, y) > 2)
2155 pline("%s teleports.", monname); /* saw it and still see it */
2157 pline("%s
\82Í
\8fu
\8aÔ
\88Ú
\93®
\82µ
\82½
\81D", monname); /* saw it and still see it */
2162 /* if we succeed, the corpse is gone */
2163 if (!revive_corpse(body)) {
2167 if (is_rider(mptr) && rn2(99)) { /* Rider usually tries again */
2168 action = REVIVE_MON;
2169 for (when = 3L; when < 67L; when++)
2172 } else { /* rot this corpse away */
2174 You_feel("%sless hassled.", is_rider(mptr) ? "much " : "");
2176 You("
\94Y
\82Ý
\8e\96\82ª%s
\8c¸
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\81D", is_rider(mptr) ? "
\82Æ
\82Ä
\82à" : "");
2177 action = ROT_CORPSE;
2178 when = 250L - (monstermoves - body->age);
2182 (void) start_timer(when, TIMER_OBJECT, action, arg);
2189 return 1; /* Do nothing, but let other things happen */
2205 pline("You've got the glop off.");
2207 You("%s
\82©
\82ç
\83l
\83o
\83l
\83o
\82ª
\82Æ
\82ê
\82½
\81D", body_part(FACE));
2209 if (!gulp_blnd_check()) {
2211 make_blinded(0L, TRUE);
2214 } else if (!u.ucreamed) {
2216 Your("%s feels clean now.", body_part(FACE));
2218 Your("%s
\82Í
\82«
\82ê
\82¢
\82É
\82È
\82Á
\82½
\81D", body_part(FACE));
2221 return 1; /* still busy */
2228 static NEARDATA char buf[39];
2231 Sprintf(buf, "wiping off your %s", body_part(FACE));
2233 Sprintf(buf, "%s
\82ð
\90@
\82¢
\82Ä
\82¢
\82é", body_part(FACE));
2234 set_occupation(wipeoff, buf, 0);
2235 /* Not totally correct; what if they change back after now
2236 * but before they're finished wiping?
2241 Your("%s is already clean.", body_part(FACE));
2243 Your("%s
\82Í
\89\98\82ê
\82Ä
\82¢
\82È
\82¢
\81D", body_part(FACE));
2248 set_wounded_legs(side, timex)
2253 * If you are riding, your steed gets the wounded legs instead.
2254 * You still call this function, but don't lose hp.
2255 * Caller is also responsible for adjusting messages.
2258 if (!Wounded_legs) {
2263 if (!Wounded_legs || (HWounded_legs & TIMEOUT))
2264 HWounded_legs = timex;
2265 EWounded_legs = side;
2266 (void) encumber_msg();
2273 if (ATEMP(A_DEX) < 0) {
2279 const char *legs = body_part(LEG);
2282 if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
2283 legs = makeplural(legs);
2284 /* this used to say "somewhat better" but that was
2285 misleading since legs are being fully healed */
2286 Your("%s %s better.", legs, vtense(legs, "feel"));
2288 Your("%s
\82Í
\89ñ
\95\9c\82µ
\82½
\81D", body_part(LEG));
2292 HWounded_legs = EWounded_legs = 0;
2294 /* Wounded_legs reduces carrying capacity, so we want
2295 an encumbrance check when they're healed. However,
2296 while dismounting, first steed's legs get healed,
2297 then hero is dropped to floor and a new encumbrance
2298 check is made [in dismount_steed()]. So don't give
2299 encumbrance feedback during the dismount stage
2300 because it could seem to be shown out of order and
2301 it might be immediately contradicted [able to carry
2302 more when steed becomes healthy, then possible floor
2303 feedback, then able to carry less when back on foot]. */
2304 if (!in_steed_dismounting)
2305 (void) encumber_msg();