more things considered when you're on the brink
This commit is contained in:
@@ -241,6 +241,7 @@ check for whether a monster was entering a region (gas cloud) erroneously
|
|||||||
all Is_*_level tests during early startup would test as true until
|
all Is_*_level tests during early startup would test as true until
|
||||||
dungeon_topology was initialized in a new game or restored from
|
dungeon_topology was initialized in a new game or restored from
|
||||||
a save file
|
a save file
|
||||||
|
take holes that you avoided into consideration when you're on the brink
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
@@ -2550,6 +2550,7 @@ E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int));
|
|||||||
E boolean NDECL(launch_in_progress);
|
E boolean NDECL(launch_in_progress);
|
||||||
E void NDECL(force_launch_placement);
|
E void NDECL(force_launch_placement);
|
||||||
E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
|
E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
|
||||||
|
E boolean FDECL(uescaped_shaft, (struct trap *));
|
||||||
E boolean NDECL(lava_effects);
|
E boolean NDECL(lava_effects);
|
||||||
E void NDECL(sink_into_lava);
|
E void NDECL(sink_into_lava);
|
||||||
E void NDECL(sokoban_guilt);
|
E void NDECL(sokoban_guilt);
|
||||||
|
|||||||
@@ -1169,7 +1169,7 @@ struct obj *obj;
|
|||||||
You("cannot stay under%s long enough.",
|
You("cannot stay under%s long enough.",
|
||||||
is_pool(u.ux, u.uy) ? "water" : " the lava");
|
is_pool(u.ux, u.uy) ? "water" : " the lava");
|
||||||
} else if ((trap = t_at(u.ux, u.uy)) != 0
|
} else if ((trap = t_at(u.ux, u.uy)) != 0
|
||||||
&& uteetering_at_seen_pit(trap)) {
|
&& (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
|
||||||
dotrap(trap, FORCEBUNGLE);
|
dotrap(trap, FORCEBUNGLE);
|
||||||
/* might escape trap and still be teetering at brink */
|
/* might escape trap and still be teetering at brink */
|
||||||
if (!u.utrap)
|
if (!u.utrap)
|
||||||
|
|||||||
9
src/do.c
9
src/do.c
@@ -246,12 +246,13 @@ const char *verb;
|
|||||||
}
|
}
|
||||||
return water_damage(obj, NULL, FALSE) == ER_DESTROYED;
|
return water_damage(obj, NULL, FALSE) == ER_DESTROYED;
|
||||||
} else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0
|
} else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0
|
||||||
&& uteetering_at_seen_pit(t)) {
|
&& (uteetering_at_seen_pit(t) || uescaped_shaft(t))) {
|
||||||
if (Blind && !Deaf)
|
if (Blind && !Deaf)
|
||||||
You_hear("%s tumble downwards.", the(xname(obj)));
|
You_hear("%s tumble downwards.", the(xname(obj)));
|
||||||
else
|
else
|
||||||
pline("%s %s into %s pit.", The(xname(obj)),
|
pline("%s %s into %s %s.", The(xname(obj)),
|
||||||
otense(obj, "tumble"), the_your[t->madeby_u]);
|
otense(obj, "tumble"), the_your[t->madeby_u],
|
||||||
|
is_pit(t->ttyp) ? "pit" : "hole");
|
||||||
} else if (obj->globby) {
|
} else if (obj->globby) {
|
||||||
/* Globby things like puddings might stick together */
|
/* Globby things like puddings might stick together */
|
||||||
while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) {
|
while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) {
|
||||||
@@ -1001,7 +1002,7 @@ dodown()
|
|||||||
}
|
}
|
||||||
if (!stairs_down && !ladder_down) {
|
if (!stairs_down && !ladder_down) {
|
||||||
trap = t_at(u.ux, u.uy);
|
trap = t_at(u.ux, u.uy);
|
||||||
if (trap && uteetering_at_seen_pit(trap)) {
|
if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft)) {
|
||||||
dotrap(trap, TOOKPLUNGE);
|
dotrap(trap, TOOKPLUNGE);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (!trap || !is_hole(trap->ttyp)
|
} else if (!trap || !is_hole(trap->ttyp)
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ boolean check_pit;
|
|||||||
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
|
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (check_pit && !Flying
|
if (check_pit && !Flying
|
||||||
&& (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t))
|
&& (t = t_at(u.ux, u.uy)) != 0
|
||||||
|
&& (uteetering_at_seen_pit(t) || uescaped_shaft(t)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return (boolean) ((!Levitation || Is_airlevel(&u.uz)
|
return (boolean) ((!Levitation || Is_airlevel(&u.uz)
|
||||||
|
|||||||
@@ -2635,8 +2635,10 @@ pickup_checks()
|
|||||||
}
|
}
|
||||||
if (!can_reach_floor(TRUE)) {
|
if (!can_reach_floor(TRUE)) {
|
||||||
struct trap *traphere = t_at(u.ux, u.uy);
|
struct trap *traphere = t_at(u.ux, u.uy);
|
||||||
if (traphere && uteetering_at_seen_pit(traphere))
|
if (traphere
|
||||||
You("cannot reach the bottom of the pit.");
|
&& (uteetering_at_seen_pit(traphere) || uescaped_shaft(traphere)))
|
||||||
|
You("cannot reach the bottom of the %s.",
|
||||||
|
is_pit(traphere->ttyp) ? "pit" : "abyss");
|
||||||
else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
|
else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
|
||||||
rider_cant_reach();
|
rider_cant_reach();
|
||||||
else if (Blind && !can_reach_floor(TRUE))
|
else if (Blind && !can_reach_floor(TRUE))
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ int what; /* should be a long */
|
|||||||
if (!can_reach_floor(TRUE)) {
|
if (!can_reach_floor(TRUE)) {
|
||||||
if ((multi && !context.run) || (autopickup && !flags.pickup)
|
if ((multi && !context.run) || (autopickup && !flags.pickup)
|
||||||
|| ((ttmp = t_at(u.ux, u.uy)) != 0
|
|| ((ttmp = t_at(u.ux, u.uy)) != 0
|
||||||
&& uteetering_at_seen_pit(ttmp)))
|
&& (uteetering_at_seen_pit(ttmp) || uescaped_shaft(ttmp))))
|
||||||
read_engr_at(u.ux, u.uy);
|
read_engr_at(u.ux, u.uy);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ dosit()
|
|||||||
|
|
||||||
if (OBJ_AT(u.ux, u.uy)
|
if (OBJ_AT(u.ux, u.uy)
|
||||||
/* ensure we're not standing on the precipice */
|
/* ensure we're not standing on the precipice */
|
||||||
&& !uteetering_at_seen_pit(trap)) {
|
&& !(uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
|
||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
|
|
||||||
obj = level.objects[u.ux][u.uy];
|
obj = level.objects[u.ux][u.uy];
|
||||||
|
|||||||
20
src/trap.c
20
src/trap.c
@@ -5104,11 +5104,21 @@ boolean
|
|||||||
uteetering_at_seen_pit(trap)
|
uteetering_at_seen_pit(trap)
|
||||||
struct trap *trap;
|
struct trap *trap;
|
||||||
{
|
{
|
||||||
if (trap && trap->tseen && (!u.utrap || u.utraptype != TT_PIT)
|
return (trap && is_pit(trap->ttyp) && trap->tseen
|
||||||
&& is_pit(trap->ttyp))
|
&& trap->tx == u.ux && trap->ty == u.uy
|
||||||
return TRUE;
|
&& !(u.utrap && u.utraptype == TT_PIT));
|
||||||
else
|
}
|
||||||
return FALSE;
|
|
||||||
|
/*
|
||||||
|
* 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. */
|
/* Destroy a trap that emanates from the floor. */
|
||||||
|
|||||||
Reference in New Issue
Block a user