fix #H6925 - being trapped vs Levitation/Flying
Make being trapped in/on/over floor block Levitation and Flying, the way that being inside solid rock already does, and the way levitating blocks flight. Blocked levitation still provides enhanced carrying capacity since magic is attempting to make the hero's body be bouyant. I think that that is appropriate but am not completely convinced. One thing that almost certainly needs fixing is digging a hole when trapped in the floor or tethered to a buried iron ball, where the first part of digactualhole() releases the hero from being trapped. If being released re-enables blocked levitation, the further stages of digging might not make sense in some circumstances. I recently realized that being held by a grabbing monster is similar to being trapped so should also interfere with levitation and flying. Nothing here attempts to address that. Save files change, but in a compatible fashion unless trapped at the time of saving. If someone saves while trapped prior to this patch, then applies it and restores, the game will behave as if the patch wasn't in place--until escape from trap is achieved. (Not verified.)
This commit is contained in:
14
src/ball.c
14
src/ball.c
@@ -703,11 +703,12 @@ xchar x, y;
|
||||
}
|
||||
|
||||
if (x != u.ux || y != u.uy) {
|
||||
static const char *pullmsg = "The ball pulls you out of the %s!";
|
||||
struct trap *t;
|
||||
const char *pullmsg = "The ball pulls you out of the %s!";
|
||||
long side;
|
||||
|
||||
if (u.utrap && u.utraptype != TT_INFLOOR
|
||||
&& u.utraptype != TT_BURIEDBALL) {
|
||||
if (u.utrap
|
||||
&& u.utraptype != TT_INFLOOR && u.utraptype != TT_BURIEDBALL) {
|
||||
switch (u.utraptype) {
|
||||
case TT_PIT:
|
||||
pline(pullmsg, "pit");
|
||||
@@ -720,8 +721,8 @@ xchar x, y;
|
||||
case TT_LAVA:
|
||||
pline(pullmsg, hliquid("lava"));
|
||||
break;
|
||||
case TT_BEARTRAP: {
|
||||
register long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
|
||||
case TT_BEARTRAP:
|
||||
side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
|
||||
pline(pullmsg, "bear trap");
|
||||
set_wounded_legs(side, rn1(1000, 500));
|
||||
if (!u.usteed) {
|
||||
@@ -734,8 +735,7 @@ xchar x, y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
u.utrap = 0;
|
||||
reset_utrap(TRUE);
|
||||
fill_pit(u.ux, u.uy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user