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);
385 pline_The("sink transforms into %s!", (levl[u.ux][u.uy].typ == THRONE)
387 : an(surface(u.ux, u.uy)));
391 /* Teleports the sink at the player's position;
392 return True if sink teleported. */
405 eng = engr_at(cx, cy);
406 } while ((levl[cx][cy].typ != ROOM || trp || eng || cansee(cx, cy))
409 if (levl[cx][cy].typ == ROOM && !trp && !eng) {
410 /* create sink at new position */
411 levl[cx][cy].typ = SINK;
412 levl[cx][cy].looted = levl[u.ux][u.uy].looted;
414 /* remove old sink */
415 levl[u.ux][u.uy].typ = ROOM;
416 levl[u.ux][u.uy].looted = 0;
423 /* obj is a ring being dropped over a kitchen sink */
426 register struct obj *obj;
428 struct obj *otmp, *otmp2;
429 boolean ideed = TRUE;
430 boolean nosink = FALSE;
433 You("drop %s down the drain.", doname(obj));
435 You("%s
\82ð
\94r
\90\85\8cû
\82É
\97\8e\82µ
\82½
\81D", doname(obj));
436 obj->in_use = TRUE; /* block free identification via interrupt */
437 switch (obj->otyp) { /* effects that can be noticed without eyes */
440 You("thought %s got lost in the sink, but there it is!", yname(obj));
442 You("%s
\82ð
\8e¸
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\82ª
\81C
\8bC
\82Ì
\82¹
\82¢
\82¾
\82Á
\82½
\81I", yname(obj));
444 case RIN_SLOW_DIGESTION:
446 pline_The("ring is regurgitated!");
448 pline("
\8ew
\97Ö
\82Í
\8bt
\97¬
\82µ
\82½
\81I");
456 pline_The("sink quivers upward for a moment.");
458 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu
\81C
\8fã
\89º
\82É
\90k
\82¦
\82½
\81D");
460 case RIN_POISON_RESISTANCE:
462 You("smell rotten %s.", makeplural(fruitname(FALSE)));
464 pline("
\95\85\82Á
\82½%s
\82Ì
\82æ
\82¤
\82È
\93õ
\82¢
\82ª
\82µ
\82½
\81D", fruitname(FALSE));
466 case RIN_AGGRAVATE_MONSTER:
468 pline("Several %s buzz angrily around the sink.",
469 Hallucination ? makeplural(rndmonnam(NULL)) : "flies");
471 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",
472 Hallucination ? rndmonnam(NULL) : "
\83n
\83G");
475 case RIN_SHOCK_RESISTANCE:
477 pline("Static electricity surrounds the sink.");
479 pline("
\97¬
\82µ
\91ä
\82ª
\83s
\83\8a\83s
\83\8a\82µ
\82Í
\82¶
\82ß
\82½
\81D");
483 You_hear("loud noises coming from the drain.");
485 You_hear("
\94r
\90\85\8cû
\82©
\82ç
\82Ì
\91å
\82«
\82È
\89¹
\82ð
\95·
\82¢
\82½
\81D");
487 case RIN_SUSTAIN_ABILITY: /* KMH */
489 pline_The("water flow seems fixed.");
491 pline("
\90\85\82Ì
\97¬
\82ê
\82ª
\88ê
\92è
\82É
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D");
493 case RIN_GAIN_STRENGTH:
495 pline_The("water flow seems %ser now.",
496 (obj->spe < 0) ? "weak" : "strong");
498 pline("
\90\85\82Ì
\97¬
\82ê
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
499 (obj->spe<0) ? "
\8eã
\82" : "
\8b
\82");
502 case RIN_GAIN_CONSTITUTION:
504 pline_The("water flow seems %ser now.",
505 (obj->spe < 0) ? "less" : "great");
507 pline("
\97¬
\82ê
\82é
\90\85\82Ì
\97Ê
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
508 (obj->spe < 0) ? "
\8f
\82È
\82" : "
\91½
\82");
511 case RIN_INCREASE_ACCURACY: /* KMH */
513 pline_The("water flow %s the drain.",
514 (obj->spe < 0) ? "misses" : "hits");
516 pline_The("
\90\85\82ª
\94r
\90\85\8cû%s
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D",
517 (obj->spe < 0) ? "
\82©
\82ç
\94½
\82ê
\82é" : "
\82ß
\82ª
\82¯
\82Ä
\97¬
\82ê
\82é");
520 case RIN_INCREASE_DAMAGE:
522 pline_The("water's force seems %ser now.",
523 (obj->spe < 0) ? "small" : "great");
525 pline_The("
\90\85\82Ì
\90¨
\82¢
\82ª%s
\82È
\82Á
\82½
\82æ
\82¤
\82¾
\81D",
526 (obj->spe < 0) ? "
\8eã
\82" : "
\8b
\82");
531 for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp2) {
532 otmp2 = otmp->nexthere;
533 if (otmp != uball && otmp != uchain
534 && !obj_resists(otmp, 1, 99)) {
537 pline("Suddenly, %s %s from the sink!", doname(otmp),
538 otense(otmp, "vanish"));
540 pline("
\93Ë
\91R
\81C%s
\82Í
\97¬
\82µ
\91ä
\82©
\82ç
\8fÁ
\82¦
\82½
\81I", doname(otmp));
549 /* Not the same as aggravate monster; besides, it's obvious. */
551 pline("Several flies buzz around the sink.");
553 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");
559 if (!Blind && !ideed && obj->otyp != RIN_HUNGER) {
561 switch (obj->otyp) { /* effects that need eyes */
564 pline_The("faucets flash brightly for a moment.");
566 pline("
\8eÖ
\8cû
\82Í
\88ê
\8fu
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
568 case RIN_REGENERATION:
570 pline_The("sink looks as good as new.");
572 pline("
\97¬
\82µ
\91ä
\82ª
\90V
\95i
\82Ì
\82æ
\82¤
\82É
\82È
\82Á
\82½
\81D");
574 case RIN_INVISIBILITY:
576 You("don't see anything happen to the sink.");
578 pline("
\97¬
\82µ
\91ä
\82É
\89½
\82ª
\8bN
\82«
\82½
\82Ì
\82©
\8c©
\82¦
\82È
\82©
\82Á
\82½
\81D");
580 case RIN_FREE_ACTION:
582 You_see("the ring slide right down the drain!");
584 pline("
\8ew
\97Ö
\82ª
\94r
\90\85\8cû
\82ð
\82·
\82é
\82è
\82Æ
\94ð
\82¯
\82é
\82Ì
\82ð
\8c©
\82½
\81I");
586 case RIN_SEE_INVISIBLE:
588 You_see("some %s in the sink.",
589 Hallucination ? "oxygen molecules" : "air");
591 pline("
\97¬
\82µ
\91ä
\82Ì
\8fã
\82Ì%s
\82ª
\8c©
\82¦
\82½
\81D",
592 Hallucination ? "
\8e_
\91f
\95ª
\8eq" : "
\8bó
\8bC");
597 pline_The("sink seems to blend into the floor for a moment.");
599 pline("
\88ê
\8fu
\81C
\97¬
\82µ
\91ä
\82ª
\8f°
\82É
\97n
\82¯
\82±
\82ñ
\82¾
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
601 case RIN_FIRE_RESISTANCE:
603 pline_The("hot water faucet flashes brightly for a moment.");
605 pline("
\88ê
\8fu
\81C
\94M
\93\92\82Ì
\8eÖ
\8cû
\82ª
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
607 case RIN_COLD_RESISTANCE:
609 pline_The("cold water faucet flashes brightly for a moment.");
611 pline("
\88ê
\8fu
\81C
\97â
\90\85\82Ì
\8eÖ
\8cû
\82ª
\96¾
\82é
\82
\8bP
\82¢
\82½
\81D");
613 case RIN_PROTECTION_FROM_SHAPE_CHAN:
615 pline_The("sink looks nothing like a fountain.");
617 pline("
\97¬
\82µ
\91ä
\82Í
\90ò
\82Æ
\82Í
\82Ü
\82Á
\82½
\82
\88á
\82¤
\82à
\82Ì
\82Ì
\82æ
\82¤
\82É
\8c©
\82¦
\82½
\81D");
621 pline_The("sink glows %s for a moment.",
622 hcolor((obj->spe < 0) ? NH_BLACK : NH_SILVER));
624 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D",
625 jconj_adj(hcolor((obj->spe<0) ? NH_BLACK : NH_SILVER)));
630 pline_The("sink glows %s for a moment.", hcolor(NH_WHITE));
632 pline("
\97¬
\82µ
\91ä
\82Í
\88ê
\8fu%s
\8bP
\82¢
\82½
\81D", jconj_adj(hcolor(NH_WHITE)));
635 case RIN_TELEPORTATION:
636 nosink = teleport_sink();
638 pline_The("sink %svanishes.", nosink ? "" : "momentarily ");
640 pline_The("
\97¬
\82µ
\91ä
\82Í%s
\8fÁ
\82¦
\82½
\81D", nosink ? "" : "
\88ê
\8fu");
642 case RIN_TELEPORT_CONTROL:
643 /*JP: "beam aboard"
\82Í
\83X
\83^
\81[
\83g
\83\8c\83b
\83N
\82Ì
\81u
\93]
\91\97\81v*/
645 pline_The("sink looks like it is being beamed aboard somewhere.");
647 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");
653 case RIN_POLYMORPH_CONTROL:
656 "sink momentarily looks like a regularly erupting geyser.");
658 "
\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");
666 You_hear("the ring bouncing down the drainpipe.");
668 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");
670 if (!rn2(20) && !nosink) {
672 pline_The("sink backs up, leaving %s.", doname(obj));
674 pline("
\97¬
\82µ
\91ä
\82ª
\8bt
\97¬
\82µ
\82Ä
\81C%s
\82ª
\96ß
\82Á
\82Ä
\82«
\82½
\81D", doname(obj));
681 /* some common tests when trying to drop or throw items */
687 if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
690 Norep("You cannot %s %s you are wearing.", word, something);
692 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);
695 if (obj->otyp == LOADSTONE && obj->cursed) {
696 /* getobj() kludge sets corpsenm to user's specified count
697 when refusing to split a stack of cursed loadstones */
699 /* getobj() ignores a count for throwing since that is
700 implicitly forced to be 1; replicate its kludge... */
701 if (!strcmp(word, "throw") && obj->quan > 1L)
704 pline("For some reason, you cannot %s%s the stone%s!", word,
705 obj->corpsenm ? " any of" : "", plur(obj->quan));
707 pline("
\82Ç
\82¤
\82¢
\82¤
\82í
\82¯
\82©
\81C
\82 \82È
\82½
\82Í
\90Î
\82ð%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81I",
711 obj->corpsenm = 0; /* reset */
715 if (obj->otyp == LEASH && obj->leashmon != 0) {
718 pline_The("leash is tied around your %s.", body_part(HAND));
720 pline("
\95R
\82Í
\82 \82È
\82½
\82Ì%s
\82É
\8c\8b\82Ñ
\82Â
\82¯
\82ç
\82ê
\82Ä
\82¢
\82é
\81D", body_part(HAND));
723 if (obj->owornmask & W_SADDLE) {
726 You("cannot %s %s you are sitting on.", word, something);
728 You("
\8fæ
\82Á
\82Ä
\82¢
\82é
\8aÔ
\82Í%s
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81D", word);
736 register struct obj *obj;
741 if (!canletgo(obj, "drop"))
743 if (!canletgo(obj, "
\92u
\82"))
750 setuwep((struct obj *) 0);
752 if (obj == uquiver) {
753 setuqwep((struct obj *) 0);
755 if (obj == uswapwep) {
756 setuswapwep((struct obj *) 0);
760 /* barrier between you and the floor */
764 /* doname can call s_suffix, reusing its buffer */
765 Strcpy(buf, s_suffix(mon_nam(u.ustuck)));
767 You("drop %s into %s %s.", doname(obj), buf,
768 mbodypart(u.ustuck, STOMACH));
770 You("%s
\82ð%s
\82Ì%s
\82É
\92u
\82¢
\82½
\81D", doname(obj), buf,
771 mbodypart(u.ustuck, STOMACH));
775 if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING)
776 && IS_SINK(levl[u.ux][u.uy].typ)) {
780 if (!can_reach_floor(TRUE)) {
781 /* we might be levitating due to #invoke Heart of Ahriman;
782 if so, levitation would end during call to freeinv()
783 and we want hitfloor() to happen before float_down() */
784 boolean levhack = finesse_ahriman(obj);
787 ELevitation = W_ART; /* other than W_ARTI */
790 You("drop %s.", doname(obj));
792 You("%s
\82ð
\92u
\82¢
\82½
\81D", doname(obj));
793 /* Ensure update when we drop gold objects */
794 if (obj->oclass == COIN_CLASS)
799 float_down(I_SPECIAL | TIMEOUT, W_ARTI | W_ART);
802 if (!IS_ALTAR(levl[u.ux][u.uy].typ) && flags.verbose)
804 You("drop %s.", doname(obj));
806 You("%s
\82ð
\92u
\82¢
\82½
\81D", doname(obj));
812 /* dropx - take dropped item out of inventory;
813 called in several places - may produce output
814 (eg ship_object() and dropy() -> sellobj() both produce output) */
817 register struct obj *obj;
819 /* Ensure update when we drop gold objects */
820 if (obj->oclass == COIN_CLASS)
824 if (ship_object(obj, u.ux, u.uy, FALSE))
826 if (IS_ALTAR(levl[u.ux][u.uy].typ))
827 doaltarobj(obj); /* set bknown */
832 /* dropy - put dropped object at destination; called from lots of places */
840 /* dropz - really put dropped object at its destination... */
842 dropz(obj, with_impact)
847 setuwep((struct obj *) 0);
849 setuqwep((struct obj *) 0);
851 setuswapwep((struct obj *) 0);
854 if (!u.uswallow && flooreffects(obj, u.ux, u.uy, "drop"))
856 if (!u.uswallow && flooreffects(obj,u.ux,u.uy,"
\97\8e\82¿
\82é"))
858 /* uswallow check done by GAN 01/29/87 */
860 boolean could_petrify = FALSE;
861 boolean could_poly = FALSE;
862 boolean could_slime = FALSE;
863 boolean could_grow = FALSE;
864 boolean could_heal = FALSE;
866 if (obj != uball) { /* mon doesn't pick up ball */
867 if (obj->otyp == CORPSE) {
868 could_petrify = touch_petrifies(&mons[obj->corpsenm]);
869 could_poly = polyfodder(obj);
870 could_slime = (obj->corpsenm == PM_GREEN_SLIME);
871 could_grow = (obj->corpsenm == PM_WRAITH);
872 could_heal = (obj->corpsenm == PM_NURSE);
874 (void) mpickobj(u.ustuck, obj);
875 if (is_animal(u.ustuck->data)) {
876 if (could_poly || could_slime) {
877 (void) newcham(u.ustuck,
878 could_poly ? (struct permonst *) 0
879 : &mons[PM_GREEN_SLIME],
881 delobj(obj); /* corpse is digested */
882 } else if (could_petrify) {
883 minstapetrify(u.ustuck, TRUE);
884 /* Don't leave a cockatrice corpse in a statue */
887 } else if (could_grow) {
888 (void) grow_up(u.ustuck, (struct monst *) 0);
889 delobj(obj); /* corpse is digested */
890 } else if (could_heal) {
891 u.ustuck->mhp = u.ustuck->mhpmax;
892 delobj(obj); /* corpse is digested */
897 place_object(obj, u.ux, u.uy);
899 container_impact_dmg(obj, u.ux, u.uy);
901 drop_ball(u.ux, u.uy);
902 else if (level.flags.has_shop)
903 sellobj(obj, u.ux, u.uy);
905 if (Blind && Levitation)
907 newsym(u.ux, u.uy); /* remap location under self */
911 /* things that must change when not held; recurse into containers.
912 Called for both player and monsters */
914 obj_no_longer_held(obj)
919 } else if (Has_contents(obj)) {
920 struct obj *contents;
922 for (contents = obj->cobj; contents; contents = contents->nobj)
923 obj_no_longer_held(contents);
927 /* Normal crysknife reverts to worm tooth when not held by hero
928 * or monster; fixed crysknife has only 10% chance of reverting.
929 * When a stack of the latter is involved, it could be worthwhile
930 * to give each individual crysknife its own separate 10% chance,
931 * but we aren't in any position to handle stack splitting here.
933 if (!obj->oerodeproof || !rn2(10)) {
934 /* if monsters aren't moving, assume player is responsible */
935 if (!context.mon_moving && !program_state.gameover)
936 costly_alteration(obj, COST_DEGRD);
937 obj->otyp = WORM_TOOTH;
938 obj->oerodeproof = 0;
944 /* 'D' command: drop several things */
950 add_valid_menu_class(0); /* clear any classes already there */
952 sellobj_state(SELL_DELIBERATE);
953 if (flags.menu_style != MENU_TRADITIONAL
954 || (result = ggetobj("drop", drop, 0, FALSE, (unsigned *) 0)) < -1)
955 result = menu_drop(result);
957 sellobj_state(SELL_NORMAL);
963 /* Drop things from the hero's inventory, using a menu. */
968 int n, i, n_dropped = 0;
970 struct obj *otmp, *otmp2;
971 menu_item *pick_list;
972 boolean all_categories = TRUE;
973 boolean drop_everything = FALSE;
976 all_categories = (retry == -2);
977 } else if (flags.menu_style == MENU_FULL) {
978 all_categories = FALSE;
980 n = query_category("Drop what type of items?", invent,
982 n = query_category("
\82Ç
\82Ì
\8eí
\97Þ
\82Ì
\83A
\83C
\83e
\83\80\82ð
\92u
\82«
\82Ü
\82·
\82©
\81H", invent,
983 UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL | BUC_BLESSED
984 | BUC_CURSED | BUC_UNCURSED | BUC_UNKNOWN,
985 &pick_list, PICK_ANY);
988 for (i = 0; i < n; i++) {
989 if (pick_list[i].item.a_int == ALL_TYPES_SELECTED)
990 all_categories = TRUE;
991 else if (pick_list[i].item.a_int == 'A')
992 drop_everything = TRUE;
994 add_valid_menu_class(pick_list[i].item.a_int);
996 free((genericptr_t) pick_list);
997 } else if (flags.menu_style == MENU_COMBINATION) {
998 unsigned ggoresults = 0;
999 all_categories = FALSE;
1000 /* Gather valid classes via traditional NetHack method */
1001 i = ggetobj("drop", drop, 0, TRUE, &ggoresults);
1003 all_categories = TRUE;
1004 if (ggoresults & ALL_FINISHED) {
1010 if (drop_everything) {
1012 * Dropping a burning potion of oil while levitating can cause
1013 * an explosion which might destroy some of hero's inventory,
1015 * for (otmp = invent; otmp; otmp = otmp2) {
1016 * otmp2 = otmp->nobj;
1017 * n_dropped += drop(otmp);
1019 * was unreliable and could lead to an "object lost" panic.
1021 * Use the bypass bit to mark items already processed (hence
1022 * not droppable) and rescan inventory until no unbypassed
1025 bypass_objlist(invent, FALSE); /* clear bypass bit for invent */
1026 while ((otmp = nxt_unbypassed_obj(invent)) != 0)
1027 n_dropped += drop(otmp);
1028 /* we might not have dropped everything (worn armor, welded weapon,
1029 cursed loadstones), so reset any remaining inventory to normal */
1030 bypass_objlist(invent, FALSE);
1032 /* should coordinate with perm invent, maybe not show worn items */
1034 n = query_objlist("What would you like to drop?", invent,
1036 n = query_objlist("
\82Ç
\82ê
\82ð
\92u
\82«
\82Ü
\82·
\82©
\81H", invent,
1037 USE_INVLET | INVORDER_SORT, &pick_list, PICK_ANY,
1038 all_categories ? allow_all : allow_category);
1041 * picklist[] contains a set of pointers into inventory, but
1042 * as soon as something gets dropped, they might become stale
1043 * (see the drop_everything code above for an explanation).
1044 * Just checking to see whether one is still in the invent
1045 * chain is not sufficient validation since destroyed items
1046 * will be freed and items we've split here might have already
1047 * reused that memory and put the same pointer value back into
1048 * invent. Ditto for using invlet to validate. So we start
1049 * by setting bypass on all of invent, then check each pointer
1050 * to verify that it is in invent and has that bit set.
1052 bypass_objlist(invent, TRUE);
1053 for (i = 0; i < n; i++) {
1054 otmp = pick_list[i].item.a_obj;
1055 for (otmp2 = invent; otmp2; otmp2 = otmp2->nobj)
1058 if (!otmp2 || !otmp2->bypass)
1060 /* found next selected invent item */
1061 cnt = pick_list[i].count;
1062 if (cnt < otmp->quan) {
1065 } else if (otmp->otyp == LOADSTONE && otmp->cursed) {
1066 /* same kludge as getobj(), for canletgo()'s use */
1067 otmp->corpsenm = (int) cnt; /* don't split */
1069 otmp = splitobj(otmp, cnt);
1072 n_dropped += drop(otmp);
1074 bypass_objlist(invent, FALSE); /* reset invent to normal */
1075 free((genericptr_t) pick_list);
1083 /* on a ladder, used in goto_level */
1084 static NEARDATA boolean at_ladder = FALSE;
1086 /* the '>' command */
1090 struct trap *trap = 0;
1091 boolean stairs_down = ((u.ux == xdnstair && u.uy == ydnstair)
1092 || (u.ux == sstairs.sx && u.uy == sstairs.sy
1094 ladder_down = (u.ux == xdnladder && u.uy == ydnladder);
1099 if (stucksteed(TRUE)) {
1102 /* Levitation might be blocked, but player can still use '>' to
1103 turn off controlled levitation */
1104 if (HLevitation || ELevitation) {
1105 if ((HLevitation & I_SPECIAL) || (ELevitation & W_ARTI)) {
1106 /* end controlled levitation */
1107 if (ELevitation & W_ARTI) {
1110 for (obj = invent; obj; obj = obj->nobj) {
1112 && artifact_has_invprop(obj, LEVITATION)) {
1113 if (obj->age < monstermoves)
1114 obj->age = monstermoves;
1115 obj->age += rnz(100);
1119 if (float_down(I_SPECIAL | TIMEOUT, W_ARTI)) {
1120 return 1; /* came down, so moved */
1121 } else if (!HLevitation && !ELevitation) {
1122 Your("latent levitation ceases.");
1123 return 1; /* did something, effectively moved */
1127 ; /* weren't actually floating after all */
1129 /* Avoid alerting player to an unknown stair or ladder.
1130 * Changes the message for a covered, known staircase
1131 * too; staircase knowledge is not stored anywhere.
1135 (glyph_to_cmap(levl[u.ux][u.uy].glyph) == S_dnstair);
1136 else if (ladder_down)
1138 (glyph_to_cmap(levl[u.ux][u.uy].glyph) == S_dnladder);
1141 floating_above(stairs_down ? "stairs" : ladder_down
1143 : surface(u.ux, u.uy));
1145 floating_above(stairs_down ? "
\8aK
\92i" : ladder_down
1147 : surface(u.ux, u.uy));
1149 return 0; /* didn't move */
1151 if (!stairs_down && !ladder_down) {
1152 trap = t_at(u.ux, u.uy);
1153 if (trap && uteetering_at_seen_pit(trap)) {
1154 dotrap(trap, TOOKPLUNGE);
1156 } else if (!trap || (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
1157 || !Can_fall_thru(&u.uz) || !trap->tseen) {
1158 if (flags.autodig && !context.nopick && uwep && is_pick(uwep)) {
1159 return use_pick_axe2(uwep);
1162 You_cant("go down here.");
1164 pline("
\82±
\82±
\82Å
\82Í
\8d~
\82è
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
1171 You("are %s, and cannot go down.",
1172 !u.uswallow ? "being held" : is_animal(u.ustuck->data)
1176 You("%s
\8d~
\82è
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1177 !u.uswallow ? "
\82Â
\82©
\82Ü
\82¦
\82ç
\82ê
\82Ä
\82¢
\82Ä" : is_animal(u.ustuck->data)
1178 ? "
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä"
1179 : "
\8aª
\82«
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä");
1183 if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) {
1185 You("are standing at the gate to Gehennom.");
1187 You("
\83Q
\83w
\83i
\82Ì
\96å
\82Ì
\91O
\82É
\97§
\82Á
\82Ä
\82¢
\82é
\81D");
1189 pline("Unspeakable cruelty and harm lurk down there.");
1191 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");
1193 if (yn("Are you sure you want to enter?") != 'y')
1195 if (yn("
\96{
\93\96\82É
\93ü
\82è
\82Ü
\82·
\82©
\81H") != 'y')
1201 pline("
\82È
\82ç
\8dD
\82«
\82É
\82·
\82ê
\82Î
\82æ
\82¢
\81D");
1202 u.uevent.gehennom_entered = 1; /* don't ask again */
1207 You("are held back by your pet!");
1209 You("
\83y
\83b
\83g
\82É
\88ø
\82«
\82à
\82Ç
\82³
\82ê
\82½
\81I");
1215 You("%s %s.", Flying ? "fly" : locomotion(youmonst.data, "jump"),
1216 trap->ttyp == HOLE ? "down the hole" : "through the trap door");
1219 trap->ttyp == HOLE ? "
\8c\8a\82ð
\8d~
\82è
\82½" : "
\97\8e\82µ
\94à
\82ð
\92Ê
\82è
\94²
\82¯
\82½");
1222 if (trap && Is_stronghold(&u.uz)) {
1223 goto_hell(FALSE, TRUE);
1225 at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER);
1232 /* the '<' command */
1239 /* "up" to get out of a pit... */
1240 if (u.utrap && u.utraptype == TT_PIT) {
1245 if ((u.ux != xupstair || u.uy != yupstair)
1246 && (!xupladder || u.ux != xupladder || u.uy != yupladder)
1247 && (!sstairs.sx || u.ux != sstairs.sx || u.uy != sstairs.sy
1250 You_cant("go up here.");
1252 You("
\82±
\82±
\82Å
\82Í
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D");
1255 if (stucksteed(TRUE)) {
1260 You("are %s, and cannot go up.",
1261 !u.uswallow ? "being held" : is_animal(u.ustuck->data)
1265 You("%s
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1266 !u.uswallow ? "
\82Â
\82©
\82Ü
\82¦
\82ç
\82ê
\82Ä
\82¢
\82Ä" : is_animal(u.ustuck->data)
1267 ? "
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä"
1268 : "
\8aª
\82«
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82Ä");
1272 if (near_capacity() > SLT_ENCUMBER) {
1273 /* No levitation check; inv_weight() already allows for it */
1275 Your("load is too heavy to climb the %s.",
1276 levl[u.ux][u.uy].typ == STAIRS ? "stairs" : "ladder");
1278 You("
\95¨
\82ð
\8e\9d\82¿
\82·
\82¬
\82Ä%s
\82ð
\8fã
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È
\82¢
\81D",
1279 levl[u.ux][u.uy].typ == STAIRS ? "
\8aK
\92i" : "
\82Í
\82µ
\82²");
1283 if (ledger_no(&u.uz) == 1) {
1285 if (yn("Beware, there will be no return! Still climb?") != 'y')
1287 if (yn("
\8bC
\82ð
\82Â
\82¯
\82ë
\81C
\96ß
\82ê
\82È
\82¢
\82¼
\81I
\82»
\82ê
\82Å
\82à
\8fã
\82é
\81H") != 'y')
1292 You("are held back by your pet!");
1294 You("
\83y
\83b
\83g
\82É
\88ø
\82«
\82à
\82Ç
\82³
\82ê
\82½
\81I");
1297 at_ladder = (boolean) (levl[u.ux][u.uy].typ == LADDER);
1303 d_level save_dlevel = { 0, 0 };
1305 /* check that we can write out the current level */
1307 currentlevel_rewrite()
1312 /* since level change might be a bit slow, flush any buffered screen
1313 * output (like "you fall through a trap door") */
1316 fd = create_levelfile(ledger_no(&u.uz), whynot);
1319 * This is not quite impossible: e.g., we may have
1320 * exceeded our quota. If that is the case then we
1321 * cannot leave this level, and cannot save either.
1322 * Another possibility is that the directory was not
1330 if (!savelev(fd, ledger_no(&u.uz), COUNT_SAVE)) {
1332 delete_levelfile(ledger_no(&u.uz));
1334 pline("NetHack is out of disk space for making levels!");
1336 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");
1338 You("can save, quit, or continue playing.");
1340 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");
1353 if (flags.ins_chkpt) {
1354 /* write out just-attained level, with pets and everything */
1355 fd = currentlevel_rewrite();
1359 savelev(fd, ledger_no(&u.uz), WRITE_SAVE);
1363 /* write out non-level state */
1371 register xchar x, y;
1373 return (boolean) ((levl[x][y].typ != ROOM
1374 && levl[x][y].typ != AIR
1375 && levl[x][y].typ != CORR)
1381 goto_level(newlevel, at_stairs, falling, portal)
1383 boolean at_stairs, falling, portal;
1387 boolean cant_go_back, up = (depth(newlevel) < depth(&u.uz)),
1388 newdungeon = (u.uz.dnum != newlevel->dnum),
1389 was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz),
1391 boolean new = FALSE; /* made a new level? */
1396 if (dunlev(newlevel) > dunlevs_in_dungeon(newlevel))
1397 newlevel->dlevel = dunlevs_in_dungeon(newlevel);
1398 if (newdungeon && In_endgame(newlevel)) { /* 1st Endgame Level !!! */
1399 if (!u.uhave.amulet)
1400 return; /* must have the Amulet */
1401 if (!wizard) /* wizard ^V can bypass Earth level */
1402 assign_level(newlevel, &earth_level); /* (redundant) */
1404 new_ledger = ledger_no(newlevel);
1405 if (new_ledger <= 0)
1406 done(ESCAPED); /* in fact < 0 is impossible */
1408 /* If you have the amulet and are trying to get out of Gehennom,
1409 * going up a set of stairs sometimes does some very strange things!
1410 * Biased against law and towards chaos. (The chance to be sent
1411 * down multiple levels when attempting to go up are significantly
1412 * less than the corresponding comment in older versions indicated
1413 * due to overlooking the effect of the call to assign_rnd_lvl().)
1415 * Odds for making it to the next level up, or of being sent down:
1419 * -1 11.46 12.50 12.5
1423 if (Inhell && up && u.uhave.amulet && !newdungeon && !portal
1424 && (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz) - 3)) {
1426 int odds = 3 + (int) u.ualign.type, /* 2..4 */
1427 diff = odds <= 1 ? 0 : rn2(odds); /* paranoia */
1430 assign_rnd_level(newlevel, &u.uz, diff);
1431 /* if inside the tower, stay inside */
1432 if (was_in_W_tower && !On_W_tower_level(newlevel))
1436 assign_level(newlevel, &u.uz);
1438 new_ledger = ledger_no(newlevel);
1441 pline("A mysterious force momentarily surrounds you...");
1443 pline("
\88ê
\8fu
\8aï
\96
\82È
\97Í
\82ª
\82 \82È
\82½
\82ð
\95ï
\82ñ
\82¾
\81D
\81D
\81D");
1444 if (on_level(newlevel, &u.uz)) {
1445 (void) safe_teleds(FALSE);
1449 at_stairs = at_ladder = FALSE;
1453 /* Prevent the player from going past the first quest level unless
1454 * (s)he has been given the go-ahead by the leader.
1456 if (on_level(&u.uz, &qstart_level) && !newdungeon && !ok_to_quest()) {
1458 pline("A mysterious force prevents you from descending.");
1460 pline("
\8aï
\96
\82È
\97Í
\82ª
\82 \82È
\82½
\82ª
\8d~
\82è
\82é
\82Ì
\82ð
\96W
\82°
\82½
\81D");
1464 if (on_level(newlevel, &u.uz))
1465 return; /* this can happen */
1467 /* tethered movement makes level change while trapped feasible */
1468 if (u.utrap && u.utraptype == TT_BURIEDBALL)
1469 buried_ball_to_punishment(); /* (before we save/leave old level) */
1471 fd = currentlevel_rewrite();
1475 if (falling) /* assuming this is only trap door or hole */
1476 impact_drop((struct obj *) 0, u.ux, u.uy, newlevel->dlevel);
1478 check_special_room(TRUE); /* probably was a trap door */
1481 u.utrap = 0; /* needed in level_tele */
1482 fill_pit(u.ux, u.uy);
1483 u.ustuck = 0; /* idem */
1485 u.uundetected = 0; /* not hidden, even if means are available */
1487 if (u.uswallow) /* idem */
1488 u.uswldtim = u.uswallow = 0;
1489 recalc_mapseen(); /* recalculate map overview before we leave the level */
1491 * We no longer see anything on the level. Make sure that this
1492 * follows u.uswallow set to null since uswallow overrides all
1498 * Save the level we're leaving. If we're entering the endgame,
1499 * we can get rid of all existing levels because they cannot be
1500 * reached any more. We still need to use savelev()'s cleanup
1501 * for the level being left, to recover dynamic memory in use and
1502 * to avoid dangling timers and light sources.
1504 cant_go_back = (newdungeon && In_endgame(newlevel));
1505 if (!cant_go_back) {
1506 update_mlstmv(); /* current monsters are becoming inactive */
1507 bufon(fd); /* use buffered output */
1509 savelev(fd, ledger_no(&u.uz),
1510 cant_go_back ? FREE_SAVE : (WRITE_SAVE | FREE_SAVE));
1513 /* discard unreachable levels; keep #0 */
1514 for (l_idx = maxledgerno(); l_idx > 0; --l_idx)
1515 delete_levelfile(l_idx);
1516 /* mark #overview data for all dungeon branches as uninteresting */
1517 for (l_idx = 0; l_idx < n_dgns; ++l_idx)
1518 remdun_mapseen(l_idx);
1521 if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz))
1522 assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY);
1524 substitute_tiles(newlevel);
1526 /* record this level transition as a potential seen branch unless using
1527 * some non-standard means of transportation (level teleport).
1529 if ((at_stairs || falling || portal) && (u.uz.dnum != newlevel->dnum))
1530 recbranch_mapseen(&u.uz, newlevel);
1531 assign_level(&u.uz0, &u.uz);
1532 assign_level(&u.uz, newlevel);
1533 assign_level(&u.utolev, newlevel);
1535 if (!builds_up(&u.uz)) { /* usual case */
1536 if (dunlev(&u.uz) > dunlev_reached(&u.uz))
1537 dunlev_reached(&u.uz) = dunlev(&u.uz);
1539 if (dunlev_reached(&u.uz) == 0
1540 || dunlev(&u.uz) < dunlev_reached(&u.uz))
1541 dunlev_reached(&u.uz) = dunlev(&u.uz);
1543 reset_rndmonst(NON_PM); /* u.uz change affects monster generation */
1545 /* set default level change destination areas */
1546 /* the special level code may override these */
1547 (void) memset((genericptr_t) &updest, 0, sizeof updest);
1548 (void) memset((genericptr_t) &dndest, 0, sizeof dndest);
1550 if (!(level_info[new_ledger].flags & LFILE_EXISTS)) {
1551 /* entering this level for first time; make it now */
1552 if (level_info[new_ledger].flags & (FORGOTTEN | VISITED)) {
1553 impossible("goto_level: returning to discarded level?");
1554 level_info[new_ledger].flags &= ~(FORGOTTEN | VISITED);
1557 new = TRUE; /* made the level */
1559 /* returning to previously visited level; reload it */
1560 fd = open_levelfile(new_ledger, whynot);
1561 if (tricked_fileremoved(fd, whynot)) {
1562 /* we'll reach here if running in wizard mode */
1563 error("Cannot continue this game.");
1565 minit(); /* ZEROCOMP */
1566 getlev(fd, hackpid, new_ledger, FALSE);
1568 oinit(); /* reassign level dependent obj probabilities */
1571 /* do this prior to level-change pline messages */
1572 vision_reset(); /* clear old level's line-of-sight */
1573 vision_full_recalc = 0; /* don't let that reenable vision yet */
1574 flush_screen(-1); /* ensure all map flushes are postponed */
1576 if (portal && !In_endgame(&u.uz)) {
1577 /* find the portal on the new level */
1578 register struct trap *ttrap;
1580 for (ttrap = ftrap; ttrap; ttrap = ttrap->ntrap)
1581 if (ttrap->ttyp == MAGIC_PORTAL)
1585 panic("goto_level: no corresponding portal!");
1587 u_on_newpos(ttrap->tx, ttrap->ty);
1588 } else if (at_stairs && !In_endgame(&u.uz)) {
1591 u_on_newpos(xdnladder, ydnladder);
1592 else if (newdungeon)
1596 /* you climb up the {stairs|ladder};
1597 fly up the stairs; fly up along the ladder */
1599 pline("%s %s up%s the %s.",
1600 (Punished && !Levitation) ? "With great effort you" : "You",
1601 Flying ? "fly" : "climb",
1602 (Flying && at_ladder) ? " along" : "",
1603 at_ladder ? "ladder" : "stairs");
1605 pline("%s%s
\82ð
\8fã
\82Á
\82½
\81D",
1606 (Punished && !Levitation) ? "
\82â
\82Á
\82Æ
\82±
\82³" : "",
1607 at_ladder ? "
\82Í
\82µ
\82²" : "
\8aK
\92i");
1611 u_on_newpos(xupladder, yupladder);
1612 else if (newdungeon)
1617 ; /* stayed on same level? (no transit effects) */
1618 } else if (Flying) {
1622 at_ladder ? "along the ladder" : "the stairs");
1624 You("%s
\94ò
\82ñ
\82Å
\8d~
\82è
\82½
\81D",
1625 at_ladder ? "
\82Í
\82µ
\82²
\82É
\89\88\82Á
\82Ä" : "
\8aK
\92i
\82ð");
1627 } else if (near_capacity() > UNENCUMBERED || Punished
1630 You("fall down the %s.", at_ladder ? "ladder" : "stairs");
1632 You("%s
\82ð
\93]
\82°
\97\8e\82¿
\82½
\81D", at_ladder ? "
\82Í
\82µ
\82²" : "
\8aK
\92i");
1637 /* falling off steed has its own losehp() call */
1639 dismount_steed(DISMOUNT_FELL);
1641 losehp(Maybe_Half_Phys(rnd(3)),
1643 at_ladder ? "falling off a ladder"
1645 at_ladder ? "
\82Í
\82µ
\82²
\82©
\82ç
\97\8e\82¿
\82Ä"
1647 : "tumbling down a flight of stairs",
1649 : "
\8aK
\92i
\82ð
\93]
\82°
\97\8e\82¿
\82Ä",
1652 selftouch("Falling, you");
1654 selftouch("
\97\8e\82¿
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Í");
1655 } else { /* ordinary descent */
1658 You("%s.", at_ladder ? "climb down the ladder"
1659 : "descend the stairs");
1661 You("%s
\82ð
\8d~
\82è
\82½
\81D", at_ladder ? "
\82Í
\82µ
\82²"
1666 } else { /* trap door or level_tele or In_endgame */
1667 u_on_rndspot((up ? 1 : 0) | (was_in_W_tower ? 2 : 0));
1672 selftouch("Falling, you");
1674 selftouch("
\97\8e\82¿
\82È
\82ª
\82ç
\81C
\82 \82È
\82½
\82Í");
1680 obj_delivery(FALSE);
1682 kill_genocided_monsters(); /* for those wiped out while in limbo */
1684 * Expire all timers that have gone off while away. Must be
1685 * after migrating monsters and objects are delivered
1686 * (losedogs and obj_delivery).
1692 if ((mtmp = m_at(u.ux, u.uy)) != 0 && mtmp != u.usteed) {
1693 /* There's a monster at your target destination; it might be one
1694 which accompanied you--see mon_arrive(dogmove.c)--or perhaps
1695 it was already here. Randomly move you to an adjacent spot
1696 or else the monster to any nearby location. Prior to 3.3.0
1697 the latter was done unconditionally. */
1700 if (!rn2(2) && enexto(&cc, u.ux, u.uy, youmonst.data)
1701 && distu(cc.x, cc.y) <= 2)
1702 u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
1706 if ((mtmp = m_at(u.ux, u.uy)) != 0) {
1707 /* there was an unconditional impossible("mnearto failed")
1708 here, but it's not impossible and we're prepared to cope
1709 with the situation, so only say something when debugging */
1711 pline("(monster in hero's way)");
1712 if (!rloc(mtmp, TRUE))
1713 /* no room to move it; send it away, to return later */
1714 migrate_to_level(mtmp, ledger_no(&u.uz), MIGR_RANDOM,
1719 /* initial movement of bubbles just before vision_recalc */
1720 if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz))
1722 else if (Is_firelevel(&u.uz))
1725 if (level_info[new_ledger].flags & FORGOTTEN) {
1726 forget_map(ALL_MAP); /* forget the map */
1727 forget_traps(); /* forget all traps too */
1729 level_info[new_ledger].flags &= ~FORGOTTEN;
1732 /* Reset the screen. */
1733 vision_reset(); /* reset the blockages */
1734 docrt(); /* does a full vision recalc */
1738 * Move all plines beyond the screen reset.
1741 /* special levels can have a custom arrival message */
1742 deliver_splev_message();
1744 /* give room entrance message, if any */
1745 check_special_room(FALSE);
1747 /* deliver objects traveling with player */
1750 /* Check whether we just entered Gehennom. */
1751 if (!In_hell(&u.uz0) && Inhell) {
1752 if (Is_valley(&u.uz)) {
1754 You("arrive at the Valley of the Dead...");
1756 You("
\8e\80\82Ì
\92J
\82É
\93\9e\92B
\82µ
\82½
\81D
\81D
\81D");
1758 pline_The("odor of burnt flesh and decay pervades the air.");
1760 pline("
\8fÅ
\82°
\82é
\8e\80\93÷
\82â
\95\85\93÷
\82Ì
\88«
\8fL
\82ª
\82½
\82¾
\82æ
\82Á
\82Ä
\82¢
\82é
\81D");
1762 display_nhwindow(WIN_MESSAGE, FALSE);
1765 You_hear("groans and moans everywhere.");
1767 You_hear("
\82»
\82±
\82©
\82µ
\82±
\82©
\82ç
\82Ì
\82¤
\82ß
\82«
\90º
\82â
\82¤
\82È
\82è
\90º
\82ð
\95·
\82¢
\82½
\81D");
1770 pline("It is hot here. You smell smoke...");
1772 pline("
\82±
\82±
\82Í
\8f\8b\82¢
\81D
\89\8c\82Ì
\93õ
\82¢
\82ª
\82·
\82é
\81D
\81D
\81D");
1773 u.uachieve.enter_gehennom = 1;
1775 /* in case we've managed to bypass the Valley's stairway down */
1776 if (Inhell && !Is_valley(&u.uz))
1777 u.uevent.gehennom_entered = 1;
1780 static const char *const fam_msgs[4] = {
1782 "You have a sense of deja vu.",
1784 "
\8aù
\8e\8b\8a´
\82É
\82¨
\82»
\82í
\82ê
\82½
\81D",
1786 "You feel like you've been here before.",
1788 "
\91O
\82É
\82±
\82±
\82É
\97\88\82½
\82±
\82Æ
\82ª
\82 \82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81D",
1790 "This place %s familiar...", 0 /* no message */
1792 "
\82±
\82Ì
\8fê
\8f\8a\82Í
\89ù
\82©
\82µ
\82¢
\81D
\81D
\81D", 0 /* no message */
1795 static const char *const halu_fam_msgs[4] = {
1797 "Whoa! Everything %s different.",
1799 "
\83I
\83\8f\83b
\81I
\82Ü
\82Á
\82½
\82
\95Ï
\82í
\82Á
\82¿
\82Ü
\82Á
\82Ä
\82é
\81D",
1801 "You are surrounded by twisty little passages, all alike.",
1803 "
\82 \82È
\82½
\82Í
\82Ü
\82ª
\82è
\82
\82Ë
\82Á
\82½
\92Ê
\98H
\82É
\82©
\82±
\82Ü
\82ê
\82Ä
\82¢
\82½
\81D
\81D
\81D",
1805 "Gee, this %s like uncle Conan's place...", 0 /* no message */
1807 "
\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 */
1815 mesg = halu_fam_msgs[which];
1817 mesg = fam_msgs[which];
1818 #if 0 /*JP:
\93ú
\96{
\8cê
\82Å
\82Í
\82»
\82±
\82Ü
\82Å
\82µ
\82È
\82¢*/
1819 if (mesg && index(mesg, '%')) {
1820 Sprintf(buf, mesg, !Blind ? "looks" : "seems");
1828 /* special location arrival messages/events */
1829 if (In_endgame(&u.uz)) {
1830 if (new &&on_level(&u.uz, &astral_level))
1831 final_level(); /* guardian angel,&c */
1832 else if (newdungeon && u.uhave.amulet)
1833 resurrect(); /* force confrontation with Wizard */
1834 } else if (In_quest(&u.uz)) {
1835 onquest(); /* might be reaching locate|goal level */
1836 } else if (In_V_tower(&u.uz)) {
1837 if (newdungeon && In_hell(&u.uz0))
1839 pline_The("heat and smoke are gone.");
1841 pline("
\94M
\82Æ
\89\8c\82è
\82Í
\8fÁ
\82¦
\82³
\82Á
\82½
\81D");
1842 } else if (Is_knox(&u.uz)) {
1843 /* alarm stops working once Croesus has died */
1844 if (new || !mvitals[PM_CROESUS].died) {
1846 You("have penetrated a high security area!");
1848 You("
\8dÅ
\8d\82\8b@
\96§
\82Ì
\8fê
\8f\8a\82Ö
\93¥
\82Ý
\8d\9e\82ñ
\82¾
\81I");
1850 pline("An alarm sounds!");
1852 pline("
\8cx
\95ñ
\82ª
\82È
\82Á
\82½
\81I");
1853 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1854 if (DEADMONSTER(mtmp))
1856 mtmp->msleeping = 0;
1860 if (new && Is_rogue_level(&u.uz))
1862 You("enter what seems to be an older, more primitive world.");
1864 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");
1865 /* main dungeon message from your quest leader */
1867 if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest")
1869 if (!In_quest(&u.uz0) && at_dgn_entrance("
\83N
\83G
\83X
\83g")
1870 && !(u.uevent.qcompleted || u.uevent.qexpelled
1871 || quest_status.leader_is_dead)) {
1872 if (!u.uevent.qcalled) {
1873 u.uevent.qcalled = 1;
1874 com_pager(2); /* main "leader needs help" message */
1875 } else { /* reminder message */
1876 com_pager(Role_if(PM_ROGUE) ? 4 : 3);
1881 assign_level(&u.uz0, &u.uz); /* reset u.uz0 */
1883 save_currentstate();
1886 if ((annotation = get_annotation(&u.uz)))
1887 You("remember this level as %s.", annotation);
1889 /* assume this will always return TRUE when changing level */
1890 (void) in_out_region(u.ux, u.uy);
1892 context.polearm.hitmon = NULL;
1900 /* reset monster hostility relative to player */
1901 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1902 if (DEADMONSTER(mtmp))
1904 reset_hostility(mtmp);
1907 /* create some player-monsters */
1908 create_mplayers(rn1(4, 3), TRUE);
1910 /* create a guardian angel next to player, if worthy */
1911 gain_guardian_angel();
1914 static char *dfr_pre_msg = 0, /* pline() before level change */
1915 *dfr_post_msg = 0; /* pline() after level change */
1917 /* change levels at the end of this turn, after monsters finish moving */
1919 schedule_goto(tolev, at_stairs, falling, portal_flag, pre_msg, post_msg)
1921 boolean at_stairs, falling;
1923 const char *pre_msg, *post_msg;
1925 int typmask = 0100; /* non-zero triggers `deferred_goto' */
1927 /* destination flags (`goto_level' args) */
1934 if (portal_flag < 0)
1935 typmask |= 0200; /* flag for portal removal */
1936 u.utotype = typmask;
1937 /* destination level */
1938 assign_level(&u.utolev, tolev);
1941 dfr_pre_msg = dupstr(pre_msg);
1943 dfr_post_msg = dupstr(post_msg);
1946 /* handle something like portal ejection */
1950 if (!on_level(&u.uz, &u.utolev)) {
1952 int typmask = u.utotype; /* save it; goto_level zeroes u.utotype */
1954 assign_level(&dest, &u.utolev);
1956 pline1(dfr_pre_msg);
1957 goto_level(&dest, !!(typmask & 1), !!(typmask & 2), !!(typmask & 4));
1958 if (typmask & 0200) { /* remove portal */
1959 struct trap *t = t_at(u.ux, u.uy);
1967 pline1(dfr_post_msg);
1969 u.utotype = 0; /* our caller keys off of this */
1971 free((genericptr_t) dfr_pre_msg), dfr_pre_msg = 0;
1973 free((genericptr_t) dfr_post_msg), dfr_post_msg = 0;
1977 * Return TRUE if we created a monster for the corpse. If successful, the
1981 revive_corpse(corpse)
1984 struct monst *mtmp, *mcarry;
1985 boolean is_uwep, chewed;
1988 struct obj *container = (struct obj *) 0;
1989 int container_where = 0;
1991 where = corpse->where;
1992 is_uwep = (corpse == uwep);
1993 chewed = (corpse->oeaten != 0);
1996 corpse_xname(corpse, chewed ? "bite-covered" : (const char *) 0,
1998 corpse_xname(corpse, chewed ? "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½" : (const char *) 0,
2000 mcarry = (where == OBJ_MINVENT) ? corpse->ocarry : 0;
2002 if (where == OBJ_CONTAINED) {
2003 struct monst *mtmp2;
2005 container = corpse->ocontainer;
2007 get_container_location(container, &container_where, (int *) 0);
2008 /* container_where is the outermost container's location even if
2010 if (container_where == OBJ_MINVENT && mtmp2)
2013 mtmp = revive(corpse, FALSE); /* corpse is gone if successful */
2020 pline_The("%s writhes out of your grasp!", cname);
2022 pline_The("%s
\82Í
\82à
\82ª
\82¢
\82½
\81I", cname);
2025 You_feel("squirming in your backpack!");
2027 pline("
\94w
\95\89\82¢
\91Ü
\82Å
\89½
\82©
\82ª
\82à
\82ª
\82¢
\82Ä
\82¢
\82é
\82æ
\82¤
\82È
\8bC
\82ª
\82µ
\82½
\81I");
2031 if (cansee(mtmp->mx, mtmp->my))
2033 pline("%s rises from the dead!",
2034 chewed ? Adjmonnam(mtmp, "bite-covered")
2037 pline("%s
\82ª
\91h
\82Á
\82½
\81I",
2038 chewed ? Adjmonnam(mtmp, "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½")
2043 case OBJ_MINVENT: /* probably a nymph's */
2044 if (cansee(mtmp->mx, mtmp->my)) {
2045 if (canseemon(mcarry))
2047 pline("Startled, %s drops %s as it revives!",
2048 mon_nam(mcarry), an(cname));
2050 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",
2051 cname, mon_nam(mcarry), cname);
2055 pline("%s suddenly appears!",
2056 chewed ? Adjmonnam(mtmp, "bite-covered")
2059 pline("%s
\82ª
\93Ë
\91R
\8c»
\82í
\82ê
\82½
\81I",
2060 chewed ? Adjmonnam(mtmp, "
\8e\95\8c^
\82Ì
\82Â
\82¢
\82½")
2065 case OBJ_CONTAINED: {
2066 char sackname[BUFSZ];
2068 if (container_where == OBJ_MINVENT && cansee(mtmp->mx, mtmp->my)
2069 && mcarry && canseemon(mcarry) && container) {
2071 pline("%s writhes out of %s!", Amonnam(mtmp),
2073 pline("%s
\82Í%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\82à
\82ª
\82¢
\82½
\81I", Amonnam(mtmp),
2075 } else if (container_where == OBJ_INVENT && container) {
2076 Strcpy(sackname, an(xname(container)));
2078 pline("%s %s out of %s in your pack!",
2079 Blind ? Something : Amonnam(mtmp),
2080 locomotion(mtmp->data, "writhes"), sackname);
2082 pline("%s
\82Í
\91Ü
\82Ì
\92\86\82Å%s
\82©
\82ç
\93¦
\82ê
\82æ
\82¤
\82Æ
\82à
\82ª
\82¢
\82½
\81I",
2083 Blind ? Something : Amonnam(mtmp),
2086 } else if (container_where == OBJ_FLOOR && container
2087 && cansee(mtmp->mx, mtmp->my)) {
2088 Strcpy(sackname, an(xname(container)));
2090 pline("%s escapes from %s!", Amonnam(mtmp), sackname);
2092 pline("%s
\82Í%s
\82©
\82ç
\93¦
\82ê
\82½
\81I", Amonnam(mtmp), sackname);
2097 /* we should be able to handle the other cases... */
2098 impossible("revive_corpse: lost corpse @ %d", where);
2106 /* Revive the corpse via a timeout. */
2109 revive_mon(arg, timeout)
2111 long timeout UNUSED;
2113 struct obj *body = arg->a_obj;
2114 struct permonst *mptr = &mons[body->corpsenm];
2118 /* corpse will revive somewhere else if there is a monster in the way;
2119 Riders get a chance to try to bump the obstacle out of their way */
2120 if ((mptr->mflags3 & M3_DISPLACES) != 0 && body->where == OBJ_FLOOR
2121 && get_obj_location(body, &x, &y, 0) && (mtmp = m_at(x, y)) != 0) {
2122 boolean notice_it = canseemon(mtmp); /* before rloc() */
2123 char *monname = Monnam(mtmp);
2125 if (rloc(mtmp, TRUE)) {
2126 if (notice_it && !canseemon(mtmp))
2127 pline("%s vanishes.", monname);
2128 else if (!notice_it && canseemon(mtmp))
2129 pline("%s appears.", Monnam(mtmp)); /* not pre-rloc monname */
2130 else if (notice_it && dist2(mtmp->mx, mtmp->my, x, y) > 2)
2131 pline("%s teleports.", monname); /* saw it and still see it */
2135 /* if we succeed, the corpse is gone */
2136 if (!revive_corpse(body)) {
2140 if (is_rider(mptr) && rn2(99)) { /* Rider usually tries again */
2141 action = REVIVE_MON;
2142 for (when = 3L; when < 67L; when++)
2145 } else { /* rot this corpse away */
2147 You_feel("%sless hassled.", is_rider(mptr) ? "much " : "");
2149 You("
\94Y
\82Ý
\8e\96\82ª%s
\8c¸
\82Á
\82½
\8bC
\82ª
\82µ
\82½
\81D", is_rider(mptr) ? "
\82Æ
\82Ä
\82à" : "");
2150 action = ROT_CORPSE;
2151 when = 250L - (monstermoves - body->age);
2155 (void) start_timer(when, TIMER_OBJECT, action, arg);
2162 return 1; /* Do nothing, but let other things happen */
2178 pline("You've got the glop off.");
2180 You("%s
\82©
\82ç
\83l
\83o
\83l
\83o
\82ª
\82Æ
\82ê
\82½
\81D", body_part(FACE));
2182 if (!gulp_blnd_check()) {
2184 make_blinded(0L, TRUE);
2187 } else if (!u.ucreamed) {
2189 Your("%s feels clean now.", body_part(FACE));
2191 Your("%s
\82Í
\82«
\82ê
\82¢
\82É
\82È
\82Á
\82½
\81D", body_part(FACE));
2194 return 1; /* still busy */
2201 static NEARDATA char buf[39];
2204 Sprintf(buf, "wiping off your %s", body_part(FACE));
2206 Sprintf(buf, "%s
\82ð
\90@
\82¢
\82Ä
\82¢
\82é", body_part(FACE));
2207 set_occupation(wipeoff, buf, 0);
2208 /* Not totally correct; what if they change back after now
2209 * but before they're finished wiping?
2214 Your("%s is already clean.", body_part(FACE));
2216 Your("%s
\82Í
\89\98\82ê
\82Ä
\82¢
\82È
\82¢
\81D", body_part(FACE));
2221 set_wounded_legs(side, timex)
2226 * If you are riding, your steed gets the wounded legs instead.
2227 * You still call this function, but don't lose hp.
2228 * Caller is also responsible for adjusting messages.
2231 if (!Wounded_legs) {
2236 if (!Wounded_legs || (HWounded_legs & TIMEOUT))
2237 HWounded_legs = timex;
2238 EWounded_legs = side;
2239 (void) encumber_msg();
2246 if (ATEMP(A_DEX) < 0) {
2252 const char *legs = body_part(LEG);
2255 if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
2256 legs = makeplural(legs);
2257 /* this used to say "somewhat better" but that was
2258 misleading since legs are being fully healed */
2259 Your("%s %s better.", legs, vtense(legs, "feel"));
2261 Your("%s
\82Í
\89ñ
\95\9c\82µ
\82½
\81D", body_part(LEG));
2265 HWounded_legs = EWounded_legs = 0;
2267 /* Wounded_legs reduces carrying capacity, so we want
2268 an encumbrance check when they're healed. However,
2269 while dismounting, first steed's legs get healed,
2270 then hero is dropped to floor and a new encumbrance
2271 check is made [in dismount_steed()]. So don't give
2272 encumbrance feedback during the dismount stage
2273 because it could seem to be shown out of order and
2274 it might be immediately contradicted [able to carry
2275 more when steed becomes healthy, then possible floor
2276 feedback, then able to carry less when back on foot]. */
2277 if (!in_steed_dismounting)
2278 (void) encumber_msg();