boulders vs vault walls
Noticed when testing the "wall_angle: unknown" fix, if there is a boulder rather than a door in the breach in a vault's walls at the spot where the guard arrives, the guard would walk onto it, tell the hero to drop any gold and follow, then move back. The boulder would remain in the hero's way and couldn't be pushed because the guard was in the boulder's way. Have the guard smash any such boulder(s) into rocks when arriving (with no explanation for how that is accomplished, just a message about seeing or hearing boulder(s) shatter). Later when repairing the walls, delete any rocks or boulders at all vault wall locations (even when no gap-to-wall repair is needed).
This commit is contained in:
@@ -645,7 +645,12 @@ can now use m<dir> to try to move to an adjacent boulder's spot without
|
|||||||
breaching a shop wall, using locking magic to put a door there, then unlocking
|
breaching a shop wall, using locking magic to put a door there, then unlocking
|
||||||
that door yielded a situation where subsequent shop damage repair
|
that door yielded a situation where subsequent shop damage repair
|
||||||
produced invalid map data which resulted in an impossible() warning
|
produced invalid map data which resulted in an impossible() warning
|
||||||
about "wall_angle: unknown" during map display
|
about "wall_angle: unknown" during map display; similar for a vault
|
||||||
|
wall if it's the spot where the guard arrives to lead hero out
|
||||||
|
if vault guard arrives on a boulder in a breach in the vault wall when coming
|
||||||
|
to lead the hero out, smash that boulder into rocks so that the hero
|
||||||
|
won't try--and fail, because the guard will be in its way--to push it
|
||||||
|
when vault walls are repaired, destroy any rocks or boulders at their spots
|
||||||
melting ice timer could persist after the ice was gone from digging or from an
|
melting ice timer could persist after the ice was gone from digging or from an
|
||||||
exploding land mine
|
exploding land mine
|
||||||
|
|
||||||
|
|||||||
39
src/vault.c
39
src/vault.c
@@ -293,6 +293,7 @@ void
|
|||||||
invault(void)
|
invault(void)
|
||||||
{
|
{
|
||||||
struct monst *guard;
|
struct monst *guard;
|
||||||
|
struct obj *otmp;
|
||||||
boolean gsensed;
|
boolean gsensed;
|
||||||
int trycount, vaultroom = (int) vault_occupied(u.urooms);
|
int trycount, vaultroom = (int) vault_occupied(u.urooms);
|
||||||
|
|
||||||
@@ -381,6 +382,25 @@ invault(void)
|
|||||||
EGD(guard)->warncnt = 0;
|
EGD(guard)->warncnt = 0;
|
||||||
|
|
||||||
reset_faint(); /* if fainted - wake up */
|
reset_faint(); /* if fainted - wake up */
|
||||||
|
/* if there are any boulders in the guard's way, destroy them;
|
||||||
|
perhaps the guard knows a touch equivalent of force bolt;
|
||||||
|
otherwise the hero wouldn't be able to push one to follow the
|
||||||
|
guard out of the vault because that guard would be in its way */
|
||||||
|
if ((otmp = sobj_at(BOULDER, guard->mx, guard->my)) != 0) {
|
||||||
|
void (*func)(const char *, ...) PRINTF_F(1, 2);
|
||||||
|
const char *bname = simpleonames(otmp);
|
||||||
|
int bcnt = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
++bcnt;
|
||||||
|
fracture_rock(otmp);
|
||||||
|
otmp = sobj_at(BOULDER, guard->mx, guard->my);
|
||||||
|
} while (otmp);
|
||||||
|
/* You_hear() will handle Deaf/!Deaf */
|
||||||
|
func = !Blind ? You_see : You_hear;
|
||||||
|
(*func)("%s shatter.",
|
||||||
|
(bcnt == 1) ? an(bname) : makeplural(bname));
|
||||||
|
}
|
||||||
gsensed = !canspotmon(guard);
|
gsensed = !canspotmon(guard);
|
||||||
if (!gsensed)
|
if (!gsensed)
|
||||||
pline("Suddenly one of the Vault's %s enters!",
|
pline("Suddenly one of the Vault's %s enters!",
|
||||||
@@ -388,6 +408,7 @@ invault(void)
|
|||||||
else
|
else
|
||||||
pline("Someone else has entered the Vault.");
|
pline("Someone else has entered the Vault.");
|
||||||
newsym(guard->mx, guard->my);
|
newsym(guard->mx, guard->my);
|
||||||
|
|
||||||
if (u.uswallow) {
|
if (u.uswallow) {
|
||||||
/* can't interrogate hero, don't interrogate engulfer */
|
/* can't interrogate hero, don't interrogate engulfer */
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
@@ -569,7 +590,7 @@ wallify_vault(struct monst *grd)
|
|||||||
xchar lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
|
xchar lox = g.rooms[vlt].lx - 1, hix = g.rooms[vlt].hx + 1,
|
||||||
loy = g.rooms[vlt].ly - 1, hiy = g.rooms[vlt].hy + 1;
|
loy = g.rooms[vlt].ly - 1, hiy = g.rooms[vlt].hy + 1;
|
||||||
struct monst *mon;
|
struct monst *mon;
|
||||||
struct obj *gold;
|
struct obj *gold, *rocks;
|
||||||
struct trap *trap;
|
struct trap *trap;
|
||||||
boolean fixed = FALSE;
|
boolean fixed = FALSE;
|
||||||
boolean movedgold = FALSE;
|
boolean movedgold = FALSE;
|
||||||
@@ -580,18 +601,32 @@ wallify_vault(struct monst *grd)
|
|||||||
if (x != lox && x != hix && y != loy && y != hiy)
|
if (x != lox && x != hix && y != loy && y != hiy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!IS_WALL(levl[x][y].typ) && !in_fcorridor(grd, x, y)) {
|
if ((!IS_WALL(levl[x][y].typ) || g_at(x, y)
|
||||||
|
|| sobj_at(ROCK, x, y) || sobj_at(BOULDER, x, y))
|
||||||
|
&& !in_fcorridor(grd, x, y)) {
|
||||||
if ((mon = m_at(x, y)) != 0 && mon != grd) {
|
if ((mon = m_at(x, y)) != 0 && mon != grd) {
|
||||||
if (mon->mtame)
|
if (mon->mtame)
|
||||||
yelp(mon);
|
yelp(mon);
|
||||||
(void) rloc(mon, FALSE);
|
(void) rloc(mon, FALSE);
|
||||||
}
|
}
|
||||||
|
/* move gold at wall locations into the vault */
|
||||||
if ((gold = g_at(x, y)) != 0) {
|
if ((gold = g_at(x, y)) != 0) {
|
||||||
move_gold(gold, EGD(grd)->vroom);
|
move_gold(gold, EGD(grd)->vroom);
|
||||||
movedgold = TRUE;
|
movedgold = TRUE;
|
||||||
}
|
}
|
||||||
|
/* destroy rocks and boulders (subsume them into the walls);
|
||||||
|
other objects present stay intact and become embedded */
|
||||||
|
while ((rocks = sobj_at(ROCK, x, y)) != 0) {
|
||||||
|
obj_extract_self(rocks);
|
||||||
|
obfree(rocks, (struct obj *) 0);
|
||||||
|
}
|
||||||
|
while ((rocks = sobj_at(BOULDER, x, y)) != 0) {
|
||||||
|
obj_extract_self(rocks);
|
||||||
|
obfree(rocks, (struct obj *) 0);
|
||||||
|
}
|
||||||
if ((trap = t_at(x, y)) != 0)
|
if ((trap = t_at(x, y)) != 0)
|
||||||
deltrap(trap);
|
deltrap(trap);
|
||||||
|
|
||||||
if (x == lox)
|
if (x == lox)
|
||||||
typ = (y == loy) ? TLCORNER
|
typ = (y == loy) ? TLCORNER
|
||||||
: (y == hiy) ? BLCORNER
|
: (y == hiy) ? BLCORNER
|
||||||
|
|||||||
@@ -4466,14 +4466,7 @@ melt_ice(xchar x, xchar y, const char *msg)
|
|||||||
if (lev->typ == DRAWBRIDGE_UP || lev->typ == DRAWBRIDGE_DOWN) {
|
if (lev->typ == DRAWBRIDGE_UP || lev->typ == DRAWBRIDGE_DOWN) {
|
||||||
lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
|
lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
|
||||||
} else { /* lev->typ == ICE */
|
} else { /* lev->typ == ICE */
|
||||||
#ifdef STUPID
|
|
||||||
if (lev->icedpool == ICED_POOL)
|
|
||||||
lev->typ = POOL;
|
|
||||||
else
|
|
||||||
lev->typ = MOAT;
|
|
||||||
#else
|
|
||||||
lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT);
|
lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT);
|
||||||
#endif
|
|
||||||
lev->icedpool = 0;
|
lev->icedpool = 0;
|
||||||
}
|
}
|
||||||
spot_stop_timers(x, y, MELT_ICE_AWAY); /* no more ice to melt away */
|
spot_stop_timers(x, y, MELT_ICE_AWAY); /* no more ice to melt away */
|
||||||
@@ -4877,7 +4870,7 @@ zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage,
|
|||||||
return rangemod;
|
return rangemod;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fractured by pick-axe or wand of striking */
|
/* fractured by pick-axe or wand of striking or by vault guard */
|
||||||
void
|
void
|
||||||
fracture_rock(struct obj *obj) /* no texts here! */
|
fracture_rock(struct obj *obj) /* no texts here! */
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user