U846 - xorns and pits

Change pit behavior to always mark a non-flying poly'd player as trapped in
a pit, even when Passes_walls is set.  This allows players polymorphed into
xorns to descend into pits and pick things up.  In this case, any attempt
to move out of the pit now takes a turn but always succeeds.  Also fixed
a related bug (w/o ID) that a player could become trapped as if in a pit
when leaving xorn form because u.utrap wasn't checked, and simplified the
code since the extra Passes_walls checks are no longer needed.  Also
updated code in sit.c that duplicated uteetering_at_seen_pit.
This commit is contained in:
cohrs
2004-01-27 19:35:09 +00:00
parent 7ab2bb967a
commit b661f86e67
7 changed files with 23 additions and 22 deletions

View File

@@ -36,7 +36,6 @@ const char *fmt, *arg;
{
boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT);
boolean could_pass_walls = Passes_walls;
boolean was_blind = !!Blind;
if (Upolyd) {
@@ -86,10 +85,8 @@ const char *fmt, *arg;
if (u.twoweap && !could_twoweap(youmonst.data))
untwoweapon();
if (u.utraptype == TT_PIT) {
if (could_pass_walls) { /* player forms cannot pass walls */
u.utrap = rn1(6,2);
}
if (u.utraptype == TT_PIT && u.utrap) {
u.utrap = rn1(6,2); /* time to escape resets */
}
if (was_blind && !Blind) { /* reverting from eyeless */
Blinded = 1L;
@@ -340,7 +337,6 @@ int mntmp;
{
boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
was_blind = !!Blind, dochange = FALSE;
boolean could_pass_walls = Passes_walls;
int mlvl;
if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
@@ -464,12 +460,8 @@ int mntmp;
drop_weapon(1);
(void) hideunder(&youmonst);
if (u.utraptype == TT_PIT) {
if (could_pass_walls && !Passes_walls) {
u.utrap = rn1(6,2);
} else if (!could_pass_walls && Passes_walls) {
u.utrap = 0;
}
if (u.utraptype == TT_PIT && u.utrap) {
u.utrap = rn1(6,2); /* time to escape resets */
}
if (was_blind && !Blind) { /* previous form was eyeless */
Blinded = 1L;