-/* NetHack 3.6 trap.c $NHDT-Date: 1545259936 2018/12/19 22:52:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.313 $ */
+/* NetHack 3.6 trap.c $NHDT-Date: 1576638501 2019/12/18 03:08:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.329 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/* JNetHack Copyright */
/* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
-/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2020 */
/* JNetHack may be freely redistributed. See license for details. */
#include "hack.h"
STATIC_VAR const char tower_of_flame[] = "tower of flame";
STATIC_VAR const char *const A_gush_of_water_hits = "A gush of water hits";
#endif
-#if 0 /*JP*/
+#if 0 /*JP:T*/
STATIC_VAR const char *const blindgas[6] = { "humid", "odorless",
"pungent", "chilling",
"acrid", "biting" };
item = hitting_u ? uarmh : which_armor(victim, W_ARMH);
if (item) {
mat_idx = objects[item->otyp].oc_material;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf, "%s %s", materialnm[mat_idx],
helm_simple_name(item));
#else
return ER_NOTHING;
} else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) {
if (flags.verbose && print && (uvictim || vismon))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s not affected by %s.",
uvictim ? "Your" : s_suffix(Monnam(victim)),
ostr, vtense(ostr, "are"), bythe[type]);
} else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) {
if (flags.verbose && (print || otmp->oerodeproof)
&& (uvictim || vismon || visobj))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Somehow, %s %s %s not affected by the %s.",
uvictim ? "your"
: !vismon ? "the" /* visobj */
#endif
if (uvictim || vismon || visobj)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s%s!",
uvictim ? "Your"
: !vismon ? "The" /* visobj */
return ER_DAMAGED;
} else if (ef_flags & EF_DESTROY) {
if (uvictim || vismon || visobj)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s away!",
uvictim ? "Your"
: !vismon ? "The" /* visobj */
} else {
if (flags.verbose && print) {
if (uvictim)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Your("%s %s completely %s.",
ostr, vtense(ostr, Blind ? "feel" : "look"), msg[type]);
#else
ostr, msg[type], Blind ? "\82æ\82¤\82¾" : "");
#endif
else if (vismon || visobj)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s completely %s.",
!vismon ? "The" : s_suffix(Monnam(victim)),
ostr, vtense(ostr, "look"), msg[type]);
*/
Your("%s\82Í%s", ostr, txt);
else if (vismon)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s's %s %s %s", Monnam(victim),
ostr, vtense(ostr, "are"), txt);
#else
}
void
-fall_through(td)
+fall_through(td, ftflags)
boolean td; /* td == TRUE : trap door or hole */
+unsigned ftflags;
{
d_level dtmp;
char msgbuf[BUFSZ];
const char *dont_fall = 0;
int newlevel, bottom;
+ struct trap *t = (struct trap *) 0;
/* we'll fall even while levitating in Sokoban; otherwise, if we
won't fall and won't be told that we aren't falling, give up now */
} while (!rn2(4) && newlevel < bottom);
if (td) {
- struct trap *t = t_at(u.ux, u.uy);
-
+ t = t_at(u.ux, u.uy);
feeltrap(t);
- if (!Sokoban) {
+ if (!Sokoban && !(ftflags & TOOKPLUNGE)) {
if (t->ttyp == TRAPDOOR)
/*JP
pline("A trap door opens up under you!");
if (Sokoban && Can_fall_thru(&u.uz))
; /* KMH -- You can't escape the Sokoban level traps */
else if (Levitation || u.ustuck
- || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig) || Flying
- || is_clinger(youmonst.data)
+ || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig)
+ || ((Flying || is_clinger(youmonst.data)
+ || (ceiling_hider(youmonst.data) && u.uundetected))
+ && !(ftflags & TOOKPLUNGE))
|| (Inhell && !u.uevent.invoked && newlevel == bottom)) {
/*JP
dont_fall = "don't fall in.";
}
return;
}
+ if ((Flying || is_clinger(youmonst.data))
+ && (ftflags & TOOKPLUNGE) && td && t)
+#if 0 /*JP:T*/
+ You("%s down %s!",
+ Flying ? "swoop" : "deliberately drop",
+ (t->ttyp == TRAPDOOR)
+ ? "through the trap door"
+ : "into the gaping hole");
+#else
+ You("%s\82É%s\81I",
+ (t->ttyp == TRAPDOOR)
+ ? "\97\8e\82µ\94à"
+ : "\8c\8a",
+ Flying ? "\8b}\8d~\89º\82µ\82½" : "\82í\82´\82Æ\97\8e\82¿\82½");
+#endif
if (*u.ushops)
shopdig(1);
dtmp.dnum = u.uz.dnum;
dtmp.dlevel = newlevel;
if (dist > 1)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("fall down a %s%sshaft!", dist > 3 ? "very " : "",
dist > 2 ? "deep " : "");
#else
set_malign(mon);
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
comes_to_life = !canspotmon(mon)
? "disappears"
: golem_xform
if ((x == u.ux && y == u.uy) || cause == ANIMATE_SPELL) {
/* "the|your|Manlobbi's statue [of a wombat]" */
shkp = shop_keeper(*in_rooms(mon->mx, mon->my, SHOPBASE));
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(statuename, "%s%s", shk_your(tmpbuf, statue),
(cause == ANIMATE_SPELL
/* avoid "of a shopkeeper" if it's Manlobbi himself
Strcpy(statuename, "a statue");
*/
Strcpy(statuename, "\92¤\91\9c");
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Instead of shattering, %s suddenly %s!", statuename,
comes_to_life);
#else
if (flaming(mptr) || acidic(mptr)) {
if (domsg) {
if (isyou)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s %s spider web!",
(flaming(mptr)) ? "burn" : "dissolve",
a_your[trap->madeby_u]);
(flaming(mptr)) ? "\8fÄ\82¢\82½" : "\82±\82È\82²\82È\82É\82µ\82½");
#endif
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s spider web!", Monnam(mtmp),
(flaming(mptr)) ? "burns" : "dissolves",
a_your[trap->madeby_u]);
*/
You("%s\82\82à\82Ì\91\83\82ð\82·\82é\82è\82Æ\92Ê\82è\94²\82¯\82½\81D", web_you[trap->madeby_u]);
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s flows through %s spider web.", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
* reason why the player cannot escape the trap with a dexterity
* check, clinging to the ceiling, etc.
*/
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Air currents pull you down into %s %s!",
a_your[trap->madeby_u],
defsyms[trap_to_defsym(ttype)].explanation);
} else if (already_seen && !forcetrap) {
if ((Levitation || (Flying && !plunged))
&& (is_pit(ttype) || ttype == HOLE || ttype == BEAR_TRAP)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s over %s %s.", Levitation ? "float" : "fly",
a_your[trap->madeby_u],
defsyms[trap_to_defsym(ttype)].explanation);
&& !conj_pit && !adj_pit
&& (!rn2(5) || (is_pit(ttype)
&& is_clinger(youmonst.data)))) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("escape %s %s.", (ttype == ARROW_TRAP && !trap->madeby_u)
? "an"
: a_your[trap->madeby_u],
oldumort = u.umortality;
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) {
; /* nothing */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
} else if (thitu(7, dmgval(otmp, &youmonst), &otmp, "little dart")) {
#else
} else if (thitu(7, dmgval(otmp, &youmonst), &otmp, "\93\8a\82°\96î")) {
otmp = t_missile(ROCK, trap);
place_object(otmp, u.ux, u.uy);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("A trap door in %s opens and %s falls on your %s!",
the(ceiling(u.ux, u.uy)), an(xname(otmp)), body_part(HEAD));
#else
feeltrap(trap);
if (amorphous(youmonst.data) || is_whirly(youmonst.data)
|| unsolid(youmonst.data)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s bear trap closes harmlessly through you.",
A_Your[trap->madeby_u]);
#else
break;
}
if (!u.usteed && youmonst.data->msize <= MZ_SMALL) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s bear trap closes harmlessly over you.",
A_Your[trap->madeby_u]);
#else
}
set_utrap((unsigned) rn1(4, 4), TT_BEARTRAP);
if (u.usteed) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s bear trap closes on %s %s!", A_Your[trap->madeby_u],
s_suffix(mon_nam(u.usteed)), mbodypart(u.usteed, FOOT));
#else
if (thitm(0, u.usteed, (struct obj *) 0, dmg, FALSE))
reset_utrap(TRUE); /* steed died, hero not trapped */
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s bear trap closes on your %s!", A_Your[trap->madeby_u],
body_part(FOOT));
#else
feeltrap(trap);
if (!Sokoban && is_clinger(youmonst.data) && !plunged) {
if (trap->tseen) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_see("%s %spit below you.", a_your[trap->madeby_u],
ttype == SPIKED_PIT ? "spiked " : "");
#else
ttype == SPIKED_PIT ? "\83g\83Q\82¾\82ç\82¯\82Ì" : "");
#endif
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s pit %sopens up under you!", A_Your[trap->madeby_u],
ttype == SPIKED_PIT ? "full of spikes " : "");
#else
x_monnam(u.usteed, steed_article, (char *) 0,
SUPPRESS_SADDLE, FALSE));
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(verbbuf, "lead %s",
x_monnam(u.usteed, steed_article, "poor",
SUPPRESS_SADDLE, FALSE));
!rn2(5) ? "\97\8e\82µ\8c\8a\82Ì" : "");
#endif
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Strcpy(verbbuf,
!plunged ? "fall" : (Flying ? "dive" : "plunge"));
#else
defsyms[trap_to_defsym(ttype)].explanation);
break; /* don't activate it after all */
}
- fall_through(TRUE);
+ fall_through(TRUE, (trflags & TOOKPLUNGE));
break;
case TELEP_TRAP:
break;
if (webmaker(youmonst.data)) {
if (webmsgok)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline(trap->madeby_u ? "You take a walk on your web."
: "There is a spider web here.");
#else
if (Passes_walls)
dmgval2 = (dmgval2 + 3) / 4;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel((dmgval2 >= hp) ? "unbearably torpid!"
: (dmgval2 >= hp / 4) ? "very lethargic."
: "sluggish.");
#endif
if (already_seen && rn2(3))
break;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("KAABLAMM!!! %s %s%s off!",
forcebungle ? "Your inept attempt sets"
: "The air currents set",
if (recursive_mine)
break;
feeltrap(trap);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("KAABLAMM!!! You triggered %s land mine!",
a_your[trap->madeby_u]);
#else
{
static char tnbuf[12];
const char *tn,
-#if 0 /*JP*/
+#if 0 /*JP:T*/
*tnnames[12] = { "C note", "D flat", "D note", "E flat",
"E note", "F note", "F sharp", "G note",
"G sharp", "A note", "B flat", "B note" };
switch (tt) {
case ARROW_TRAP:
if (!otmp) {
- impossible("steed hit by non-existant arrow?");
+ impossible("steed hit by non-existent arrow?");
return 0;
}
trapkilled = thitm(8, steed, otmp, 0, FALSE);
break;
case DART_TRAP:
if (!otmp) {
- impossible("steed hit by non-existant dart?");
+ impossible("steed hit by non-existent dart?");
return 0;
}
trapkilled = thitm(7, steed, otmp, 0, FALSE);
break;
case POLY_TRAP:
if (!resists_magm(steed) && !resist(steed, WAND_CLASS, 0, NOTELL)) {
+ struct permonst *mdat = steed->data;
+
(void) newcham(steed, (struct permonst *) 0, FALSE, FALSE);
- if (!can_saddle(steed) || !can_ride(steed))
+ if (!can_saddle(steed) || !can_ride(steed)) {
dismount_steed(DISMOUNT_POLY);
- else
+ } else {
+ char buf[BUFSZ];
+
+ Strcpy(buf, x_monnam(steed, ARTICLE_YOUR, (char *) 0,
+ SUPPRESS_SADDLE, FALSE));
+ if (mdat != steed->data)
+ (void) strsubst(buf, "your ", "your new ");
/*JP
- You("have to adjust yourself in the saddle on %s.",
+ You("adjust yourself in the saddle on %s.", buf);
*/
- You("%s\82Ì\88Æ\82Ì\8fã\82Å\8dÀ\82è\82È\82¨\82µ\82½\81D",
- x_monnam(steed, ARTICLE_A, (char *) 0, SUPPRESS_SADDLE,
- FALSE));
+ You("%s\82Ì\88Æ\82Ì\8fã\82Å\8dÀ\82è\82È\82¨\82µ\82½\81D", buf);
+ }
}
steedhit = TRUE;
break;
switch (style) {
case ROLL | LAUNCH_UNSEEN:
if (otyp == BOULDER) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_hear(Hallucination ? "someone bowling."
: "rumbling in the distance.");
#else
bhitpos.x += dx;
bhitpos.y += dy;
- t = t_at(bhitpos.x, bhitpos.y);
if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != 0) {
if (otyp == BOULDER && throws_rocks(mtmp->data)) {
if (rn2(3)) {
if (cansee(bhitpos.x, bhitpos.y))
/*JP
- pline("%s snatches the boulder.", Monnam(mtmp));
+ pline("%s snatches the boulder.", Monnam(mtmp));
*/
- pline("%s\82Í\8aâ\82ð\82Â\82©\82Ý\8eæ\82Á\82½\81D", Monnam(mtmp));
+ pline("%s\82Í\8aâ\82ð\82Â\82©\82Ý\8eæ\82Á\82½\81D", Monnam(mtmp));
singleobj->otrapped = 0;
(void) mpickobj(mtmp, singleobj);
used_up = TRUE;
break;
}
}
- if (t && otyp == BOULDER) {
+ if ((t = t_at(bhitpos.x, bhitpos.y)) != 0 && otyp == BOULDER) {
switch (t->ttyp) {
case LANDMINE:
if (rn2(10) > 2) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline(
"KAABLAMM!!!%s",
cansee(bhitpos.x, bhitpos.y)
inescapable = force_mintrap || ((tt == HOLE || tt == PIT)
&& Sokoban && !trap->madeby_u);
const char *fallverb;
+ xchar tx = trap->tx, ty = trap->ty;
/* true when called from dotrap, inescapable is not an option */
if (mtmp == u.usteed)
/* stepped on a squeaky board */
if (in_sight) {
if (!Deaf) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("A board beneath %s squeaks %s loudly.",
mon_nam(mtmp), trapnote(trap, 0));
#else
int range = couldsee(mtmp->mx, mtmp->my) /* 9 or 5 */
? (BOLT_LIM + 1) : (BOLT_LIM - 3);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_hear("a %s squeak %s.", trapnote(trap, 1),
(distu(mtmp->mx, mtmp->my) <= range * range)
? "nearby" : "in the distance");
&& !is_whirly(mptr) && !unsolid(mptr)) {
mtmp->mtrapped = 1;
if (in_sight) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s is caught in %s bear trap!", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
}
} else if (force_mintrap) {
if (in_sight) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s evades %s bear trap!", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
switch (rn2(5)) {
case 0:
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s on the %s!", A_gush_of_water_hits,
mon_nam(mtmp), mbodypart(mtmp, HEAD));
#else
break;
case 1:
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s's left %s!", A_gush_of_water_hits,
mon_nam(mtmp), mbodypart(mtmp, ARM));
#else
break;
case 2:
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s's right %s!", A_gush_of_water_hits,
mon_nam(mtmp), mbodypart(mtmp, ARM));
#else
case FIRE_TRAP:
mfiretrap:
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("A %s erupts from the %s under %s!", tower_of_flame,
surface(mtmp->mx, mtmp->my), mon_nam(mtmp));
#else
mon_nam(mtmp), surface(mtmp->mx,mtmp->my));
#endif
else if (see_it) /* evidently `mtmp' is invisible */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_see("a %s erupt from the %s!", tower_of_flame,
surface(mtmp->mx, mtmp->my));
#else
}
if (!inescapable)
break; /* avoids trap */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
fallverb = "is dragged"; /* sokoban pit */
#else
fallverb = "\82¸\82è\97\8e\82¿\82½"; /* sokoban pit */
if (!passes_walls(mptr))
mtmp->mtrapped = 1;
if (in_sight) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s into %s pit!", Monnam(mtmp), fallverb,
a_your[trap->madeby_u]);
#else
|| (mtmp->wormno && count_wsegs(mtmp) > 5)) {
tear_web = TRUE;
} else if (in_sight) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s is caught in %s spider web.", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
}
if (tear_web) {
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s tears through %s spider web!", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
newsym(mtmp->mx, mtmp->my);
} else if (force_mintrap && !mtmp->mtrapped) {
if (in_sight) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s avoids %s spider web!", Monnam(mtmp),
a_your[trap->madeby_u]);
#else
break;
if (in_sight) {
newsym(mtmp->mx, mtmp->my);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline_The("air currents set %s off!",
already_seen ? "a land mine" : "it");
#else
}
} else if (in_sight) {
newsym(mtmp->mx, mtmp->my);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s%s triggers %s land mine!",
!Deaf ? "KAABLAMM!!! " : "", Monnam(mtmp),
a_your[trap->madeby_u]);
#endif
}
if (!in_sight && !Deaf)
-/*JP
- pline("Kaablamm! You hear an explosion in the distance!");
-*/
+#if 0 /*JP*/
+ pline("Kaablamm! %s an explosion in the distance!",
+ "You hear"); /* Deaf-aware */
+#else
+ /*JP:TODO:Deaf\91Î\89\9e*/
pline("\82¿\82ã\82Ç\81[\82ñ\81I\82 \82È\82½\82Í\89\93\95û\82Ì\94\9a\94\89¹\82ð\95·\82¢\82½\81I");
+#endif
blow_up_landmine(trap);
/* explosion might have destroyed a drawbridge; don't
dish out more damage if monster is already dead */
trapkilled = TRUE;
}
/* a boulder may fill the new pit, crushing monster */
- fill_pit(trap->tx, trap->ty);
+ fill_pit(tx, ty); /* thitm may have already destroyed the trap */
if (DEADMONSTER(mtmp))
trapkilled = TRUE;
if (unconscious()) {
newsym(mtmp->mx, mtmp->my);
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Click! %s triggers %s.", Monnam(mtmp),
trap->tseen ? "a rolling boulder trap" : something);
#else
if (mwep && mwep->otyp == CORPSE && touch_petrifies(&mons[mwep->corpsenm])
&& !resists_ston(mon)) {
if (cansee(mon->mx, mon->my)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s%s touches %s.", arg ? arg : "",
arg ? mon_nam(mon) : Monnam(mon),
corpse_xname(mwep, (const char *) 0, CXN_PFX_THE));
(void) buried_ball(&cc);
/* being chained to the floor blocks levitation from floating
above that floor but not from enhancing carrying capacity */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("feel lighter, but your %s is still chained to the %s.",
body_part(LEG),
IS_ROOM(levl[cc.x][cc.y].typ) ? "floor" : "ground");
} else if (u.uinwater) {
spoteffects(TRUE);
} else if (u.uswallow) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You(is_animal(u.ustuck->data) ? "float away from the %s."
: "spiral up into %s.",
is_animal(u.ustuck->data) ? surface(u.ux, u.uy)
float_vs_flight();
if (trapped && u.utrap) /* u.utrap => paranoia */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are no longer trying to float up from the %s.",
(u.utraptype == TT_BEARTRAP) ? "trap's jaws"
: (u.utraptype == TT_WEB) ? "web"
}
}
if (u.uswallow) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("float down, but you are still %s.",
is_animal(u.ustuck->data) ? "swallowed" : "engulfed");
#else
*/
You("\82æ\82è\82µ\82Á\82©\82è\82Æ\88Æ\82É\94[\82Ü\82Á\82½\81D");
} else if (Hallucination) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Bummer! You've %s.",
is_pool(u.ux, u.uy)
? "splashed down"
losehp(rnd(3), "\95¦\93«\82µ\82½\90\85\82Å", KILLED_BY);
return;
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("A %s %s from %s!", tower_of_flame, box ? "bursts" : "erupts",
the(box ? xname(box) : surface(u.ux, u.uy)));
#else
*/
You("\8f\9d\82Â\82©\82È\82¢\81D");
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
losehp(num, tower_of_flame, KILLED_BY_AN); /* fire damage */
#else
losehp(num, "\89Î\92\8c\82Å", KILLED_BY_AN); /* fire damage */
pline("\90k\82¦\82ª\82 \82È\82½\82Ì%s\82ð\91\96\82Á\82½\81I", body_part(SPINE));
break;
case 14:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_hear(Hallucination ? "the moon howling at you."
: "distant howling.");
#else
break;
case 15:
if (on_level(&u.uz, &qstart_level))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel(
"%slike the prodigal son.",
(flags.female || (Upolyd && is_neuter(youmonst.data)))
? "oddly "
: "");
-#else /*JP \90¹\8f\91\82Ì\83\8b\83J\93`\82æ\82è */
+#else
+ /*JP \90¹\8f\91\82Ì\83\8b\83J\93`\82æ\82è */
You("%s\95ú\93 \91§\8eq\82Ì\82æ\82¤\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D",
(flags.female || (Upolyd && is_neuter(youmonst.data)))
? "\88Ù\8fí\82É"
: "");
#endif
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("suddenly yearn for %s.",
Hallucination
? "Cleveland"
}
dindx = (obj->oclass == SCROLL_CLASS) ? 3 : 4;
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", Yname2(obj),
destroy_strings[dindx][(obj->quan > 1L)]);
#else
} else if (obj->oclass == POTION_CLASS) {
dindx = (obj->otyp != POT_OIL) ? 1 : 2;
if (in_sight)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", Yname2(obj),
destroy_strings[dindx][(obj->quan > 1L)]);
#else
when former contents of a burned container get here via
flooreffects() */
if (obj == thrownobj || obj == kickedobj)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s up!", is_plural(obj) ? "They" : "It",
otense(obj, "burn"));
#else
*/
pline("%s\82Ì\95¶\8e\9a\82Í\94\96\82ê\82½\81D", xname(obj));
else if (vismon)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", s_suffix(Monnam(victim)),
aobjnam(obj, "fade"));
#else
* variant.
*/
bufp = simpleonames(obj);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s %s!", /* "A potion explodes!" */
!exploded ? (one ? "A" : "Some")
: (one ? "Another" : "More"),
boolean inpool_ok = FALSE, crawl_ok;
int i, x, y;
+ feel_newsym(u.ux, u.uy); /* in case Blind, map the water here */
/* happily wading in the same contiguous pool */
if (u.uinwater && is_pool(u.ux - u.dx, u.uy - u.dy)
&& (Swimming || Amphibious)) {
return FALSE;
if ((i = number_leashed()) > 0) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline_The("leash%s slip%s loose.", (i > 1) ? "es" : "",
(i > 1) ? "" : "s");
#else
}
if ((Teleportation || can_teleport(youmonst.data)) && !Unaware
&& (Teleport_control || rn2(3) < Luck + 2)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("attempt a teleport spell."); /* utcsri!carroll */
#else
You("\8fu\8aÔ\88Ú\93®\82Ì\8eô\95¶\82ð\8f¥\82¦\82Ä\82Ý\82½\81D");
}
if (u.uinwater) {
u.uinwater = 0;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("find yourself back %s.",
Is_waterlevel(&u.uz) ? "in an air bubble" : "on land");
#else
if ((invent && (inv_weight() + weight_cap() > 600))
|| bigmonst(youmonst.data)) {
/* don't allow untrap if they can't get thru to it */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are unable to reach the %s!",
defsyms[trap_to_defsym(ttype)].explanation);
#else
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
rider_cant_reach();
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are unable to reach the %s!",
defsyms[trap_to_defsym(ttype)].explanation);
#else
move_into_trap(ttmp);
}
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s is difficult to %s.",
ttmp->madeby_u ? "Your" : under_u ? "This" : "That",
defsyms[trap_to_defsym(ttype)].explanation,
There's no need for a cockatrice test, only the trap is touched */
if ((mtmp = m_at(ttmp->tx, ttmp->ty)) != 0) {
mtmp->mtrapped = 0;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("remove %s %s from %s.", the_your[ttmp->madeby_u],
(ttmp->ttyp == BEAR_TRAP) ? "bear trap" : "webbing",
mon_nam(mtmp));
useup(obj); /* oil */
makeknown(POT_OIL);
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("repair the squeaky board."); /* no madeby_u */
#else
You("\82«\82µ\82Þ\94Â\82ð\8fC\97\9d\82µ\82½\81D"); /* no madeby_u */
int wc = weight_cap();
if (((wt * 2) / wc) >= HVY_ENCUMBER) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s is %s for you to lift.", Monnam(mtmp),
stuff ? "carrying too much" : "too heavy");
#else
/* Will our hero succeed? */
if ((uprob = untrap_prob(ttmp)) && !mtmp->msleeping && mtmp->mcanmove) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("try to reach out your %s, but %s backs away skeptically.",
makeplural(body_part(ARM)), mon_nam(mtmp));
#else
/* is it a cockatrice?... */
if (touch_petrifies(mtmp->data) && !uarmg && !Stone_resistance) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("grab the trapped %s using your bare %s.", mtmp->data->mname,
makeplural(body_part(HAND)));
#else
} else {
char kbuf[BUFSZ];
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(kbuf, "trying to help %s out of a pit",
an(mtmp->data->mname));
#else
return 1;
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("reach out your %s and grab %s.", makeplural(body_part(ARM)),
mon_nam(mtmp));
#else
*/
You("%s\82ð\97\8e\82µ\8c\8a\82©\82ç\82Ð\82Á\82Ï\82Á\82½\81D", mon_nam(mtmp));
mtmp->mtrapped = 0;
- fill_pit(mtmp->mx, mtmp->my);
reward_untrap(ttmp, mtmp);
+ fill_pit(mtmp->mx, mtmp->my);
return 1;
}
#endif
/* note: boxcnt and useplural will always be 0 for !here case */
if (ttmp || boxcnt)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
There("%s %s %s but you can't reach %s%s.",
useplural ? "are" : "is", the_trap, here ? "here" : "there",
useplural ? "them" : "it",
if (boxcnt) {
for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
if (Is_box(otmp)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
(void) safe_qbuf(qbuf, "There is ",
" here. Check it for traps?", otmp,
doname, ansimpleoname, "a box");
}
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You(trap_skipped ? "find no other traps here."
: "know of no traps here.");
#else
t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my);
if (ishero && u.utrap) { /* all u.utraptype values are holding traps */
- which = "";
+ which = the_your[(!t || !t->tseen || !t->madeby_u) ? 0 : 1];
switch (u.utraptype) {
case TT_LAVA:
/*JP
trapdescr = "your anchor";
*/
trapdescr = "\82\82³\82Ñ";
+ which = "";
break;
case TT_BEARTRAP:
case TT_PIT:
*noticed = TRUE;
if (u.usteed)
/*JP
- Sprintf(buf, "%s is", noit_Monnam(u.usteed));
+ Sprintf(buf, "%s is", noit_Monnam(u.usteed));
*/
- Strcpy(buf, noit_Monnam(u.usteed));
+ Strcpy(buf, noit_Monnam(u.usteed));
else
/*JP
- Strcpy(buf, "You are");
+ Strcpy(buf, "You are");
*/
- Strcpy(buf, "\82 \82È\82½");
+ Strcpy(buf, "\82 \82È\82½");
+ reset_utrap(TRUE);
+ vision_full_recalc = 1; /* vision limits can change (pit escape) */
/*JP
pline("%s released from %s%s.", buf, which, trapdescr);
*/
pline("%s\82Í%s%s\82©\82ç\89ð\95ú\82³\82ê\82½\81D", buf, which, trapdescr);
- reset_utrap(TRUE);
} else {
if (!mon->mtrapped)
return FALSE;
mon->mtrapped = 0;
if (canspotmon(mon)) {
*noticed = TRUE;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s is released from %s%s.", Monnam(mon), which,
trapdescr);
#else
exercise(A_STR, FALSE);
if (costly && loss) {
if (insider)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("owe %ld %s for objects destroyed.", loss,
currency(loss));
#else
currency(loss));
#endif
else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("caused %ld %s worth of damage!", loss,
currency(loss));
#else
case 2:
case 1:
case 0:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("A cloud of %s gas billows from %s.",
Blind ? blindgas[rn2(SIZE(blindgas))] : rndcolor(),
the(xname(obj)));
*/
pline("\82È\82ñ\82Ä\91f\93G\82È\82ñ\82¾\81I");
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s%s...", stagger(youmonst.data, "stagger"),
Halluc_resistance ? ""
: Blind ? " and get dizzy"
uteetering_at_seen_pit(trap)
struct trap *trap;
{
- if (trap && trap->tseen && (!u.utrap || u.utraptype != TT_PIT)
- && is_pit(trap->ttyp))
- return TRUE;
- else
- return FALSE;
+ return (trap && is_pit(trap->ttyp) && trap->tseen
+ && trap->tx == u.ux && trap->ty == u.uy
+ && !(u.utrap && u.utraptype == TT_PIT));
+}
+
+/*
+ * Returns TRUE if you didn't fall through a hole or didn't
+ * release a trap door
+ */
+boolean
+uescaped_shaft(trap)
+struct trap *trap;
+{
+ return (trap && is_hole(trap->ttyp) && trap->tseen
+ && trap->tx == u.ux && trap->ty == u.uy);
}
/* Destroy a trap that emanates from the floor. */
if (multi >= 0)
return FALSE;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
return (boolean) (u.usleep
|| (nomovemsg
&& (!strncmp(nomovemsg, "You awake", 9)
int dmg = d(6, 6); /* only applicable for water walking */
boolean usurvive, boil_away;
+ feel_newsym(u.ux, u.uy); /* in case Blind, map the lava here */
burn_away_slime();
if (likes_lava(youmonst.data))
return FALSE;
/* above, we set in_use for objects which are to be destroyed */
if (obj->otyp == SPE_BOOK_OF_THE_DEAD && !Blind) {
if (usurvive)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s glows a strange %s, but remains intact.",
The(xname(obj)), hcolor("dark red"));
#else
static const char sink_deeper[] = "\82 \82È\82½\82Í\82æ\82è\90[\82\97n\8aâ\82É\92¾\82ñ\82¾\81D";
if (!u.utrap || u.utraptype != TT_LAVA) {
- ; /* do nothing; this shouldn't happen */
+ ; /* do nothing; this usually won't happen but could after
+ * polymorphing from a flier into a ceiling hider and then hiding;
+ * allmain() only checks whether the hero is at a lava location,
+ * not whether he or she is currently sinking */
} else if (!is_lava(u.ux, u.uy)) {
reset_utrap(FALSE); /* this shouldn't happen either */
} else if (!u.uinvulnerable) {