Walking near buried zombifying corpses wakes them up
Moving without stealth will reduce the zombifying timeout of buried corpses under and around hero's location.
This commit is contained in:
+23
@@ -17,6 +17,7 @@ static boolean doorless_door(int, int);
|
|||||||
static void move_update(boolean);
|
static void move_update(boolean);
|
||||||
static int pickup_checks(void);
|
static int pickup_checks(void);
|
||||||
static void maybe_smudge_engr(int, int, int, int);
|
static void maybe_smudge_engr(int, int, int, int);
|
||||||
|
static void check_buried_zombies(xchar, xchar);
|
||||||
static void domove_core(void);
|
static void domove_core(void);
|
||||||
|
|
||||||
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
|
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
|
||||||
@@ -1371,6 +1372,25 @@ u_rooted(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* reduce zombification timeout of buried zombies around px, py */
|
||||||
|
static void
|
||||||
|
check_buried_zombies(xchar x, xchar y)
|
||||||
|
{
|
||||||
|
struct obj *otmp;
|
||||||
|
long t;
|
||||||
|
|
||||||
|
for (otmp = g.level.buriedobjlist; otmp; otmp = otmp->nobj) {
|
||||||
|
if (otmp->otyp == CORPSE && otmp->timed
|
||||||
|
&& otmp->ox >= x - 1 && otmp->ox <= x + 1
|
||||||
|
&& otmp->oy >= y - 1 && otmp->oy <= y + 1
|
||||||
|
&& (t = peek_timer(ZOMBIFY_MON, obj_to_any(otmp))) > 0) {
|
||||||
|
t = stop_timer(ZOMBIFY_MON, obj_to_any(otmp));
|
||||||
|
(void) start_timer(max(1, t - rn2(10)), TIMER_OBJECT,
|
||||||
|
ZOMBIFY_MON, obj_to_any(otmp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
domove(void)
|
domove(void)
|
||||||
{
|
{
|
||||||
@@ -1970,6 +1990,9 @@ domove_core(void)
|
|||||||
nomul(0);
|
nomul(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Levitation && !Flying && !Stealth)
|
||||||
|
check_buried_zombies(u.ux, u.uy);
|
||||||
|
|
||||||
if (hides_under(g.youmonst.data) || g.youmonst.data->mlet == S_EEL
|
if (hides_under(g.youmonst.data) || g.youmonst.data->mlet == S_EEL
|
||||||
|| u.dx || u.dy)
|
|| u.dx || u.dy)
|
||||||
(void) hideunder(&g.youmonst);
|
(void) hideunder(&g.youmonst);
|
||||||
|
|||||||
Reference in New Issue
Block a user