confusion overrides teleport control
don't #sit on an object in a pit if you're only on the precipice
fix message when pushing a boulder into a pool while riding
+when you're teetering on the edge of a pit you can use '>' to enter the pit
Platform- and/or Interface-Specific Fixes
E boolean NDECL(lava_effects);
E void FDECL(blow_up_landmine, (struct trap *));
E int FDECL(launch_obj,(SHORT_P,int,int,int,int,int));
+E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
/* ### u_init.c ### */
#define NOWEBMSG 0x01 /* suppress stumble into web message */
#define FORCEBUNGLE 0x02 /* adjustments appropriate for bungling */
#define RECURSIVETRAP 0x04 /* trap changed into another type this same turn */
+#define TOOKPLUNGE 0x08 /* used '>' to enter pit below you */
/* Flags to control test_move in hack.c */
#define DO_MOVE 0 /* really doing the move */
}
water_damage(obj, FALSE, FALSE);
} else if (u.ux == x && u.uy == y &&
- (!u.utrap || u.utraptype != TT_PIT) &&
- (t = t_at(x,y)) != 0 && t->tseen &&
- (t->ttyp==PIT || t->ttyp==SPIKED_PIT)) {
- /* you escaped a pit and are standing on the precipice */
+ (t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) {
if (Blind && !Deaf)
You_hear("%s tumble downwards.",
the(xname(obj)));
return (0); /* didn't move */
}
if (!stairs_down && !ladder_down) {
- if (!(trap = t_at(u.ux,u.uy)) ||
- (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
- || !Can_fall_thru(&u.uz) || !trap->tseen) {
-
+ trap = t_at(u.ux,u.uy);
+ if (trap && uteetering_at_seen_pit(trap)) {
+ dotrap(trap, TOOKPLUNGE);
+ return(1);
+ } else if (!trap ||
+ (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE) ||
+ !Can_fall_thru(&u.uz) || !trap->tseen) {
if (flags.autodig && !context.nopick &&
uwep && is_pick(uwep)) {
return use_pick_axe2(uwep);
return(0);
}
- if (traphere && traphere->tseen) {
+ if (traphere && uteetering_at_seen_pit(traphere)) {
/* Allow pickup from holes and trap doors that you escaped from
* because that stuff is teetering on the edge just like you, but
* not pits, because there is an elevation discrepancy with stuff
* in pits.
*/
- if ((traphere->ttyp == PIT || traphere->ttyp == SPIKED_PIT) &&
- (!u.utrap || (u.utrap && u.utraptype != TT_PIT))) {
- You("cannot reach the bottom of the pit.");
- return(0);
- }
+ You("cannot reach the bottom of the pit.");
+ return(0);
}
return (pickup(-count));
read_engr_at(u.ux, u.uy);
return (0);
}
- if (ttmp && ttmp->tseen) {
+ if (ttmp && uteetering_at_seen_pit(ttmp)) {
/* Allow pickup from holes and trap doors that you escaped
* from because that stuff is teetering on the edge just
* like you, but not pits, because there is an elevation
* discrepancy with stuff in pits.
*/
- if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT) &&
- (!u.utrap || (u.utrap && u.utraptype != TT_PIT))) {
- read_engr_at(u.ux, u.uy);
- return(0);
- }
+ read_engr_at(u.ux, u.uy);
+ return(0);
}
/* multi && !context.run means they are in the middle of some other
* action, or possibly paralyzed, sleeping, etc.... and they just
boolean already_seen = trap->tseen;
boolean webmsgok = (!(trflags & NOWEBMSG));
boolean forcebungle = (trflags & FORCEBUNGLE);
+ boolean plunged = (trflags & TOOKPLUNGE);
nomul(0);
return;
}
if(!Fumbling && ttype != MAGIC_PORTAL &&
- ttype != ANTI_MAGIC && !forcebungle &&
+ ttype != ANTI_MAGIC && !forcebungle && !plunged &&
(!rn2(5) ||
((ttype == PIT || ttype == SPIKED_PIT) && is_clinger(youmonst.data)))) {
You("escape %s %s.",
"poor", SUPPRESS_SADDLE, FALSE));
} else
#endif
- Strcpy(verbbuf,"fall");
+ Strcpy(verbbuf, plunged ? "plunge" : "fall");
You("%s into %s pit!", verbbuf, a_your[trap->madeby_u]);
}
/* wumpus reference */
#endif
if (ttype == SPIKED_PIT) {
losehp(Maybe_Half_Phys(rnd(10)),
- "fell into a pit of iron spikes",
+ plunged ? "deliberately plunged into a pit of iron spikes" :
+ "fell into a pit of iron spikes",
NO_KILLER_PREFIX);
if (!rn2(6))
poisoned("spikes", A_STR, "fall onto poison spikes",
8, FALSE);
} else
- losehp(Maybe_Half_Phys(rnd(6)),"fell into a pit",
+ losehp(Maybe_Half_Phys(rnd(6)),
+ plunged ? "deliberately plunged into a pit" :
+ "fell into a pit",
NO_KILLER_PREFIX);
if (Punished && !carried(uball)) {
unplacebc();
dealloc_trap(trap);
}
+/*
+ * Returns TRUE if you escaped a pit and are standing on the precipice.
+ */
+boolean
+uteetering_at_seen_pit(trap)
+struct trap *trap;
+{
+ if (trap && trap->tseen &&
+ (!u.utrap || u.utraptype != TT_PIT) &&
+ (trap->ttyp==PIT || trap->ttyp==SPIKED_PIT))
+ return TRUE;
+ else
+ return FALSE;
+}
+
boolean
delfloortrap(ttmp)
register struct trap *ttmp;