Refactor enemy state handling to change standing variants from ambushing to idle

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-19 11:43:47 +01:00
parent 786ba4b450
commit de0d99588e
2 changed files with 8 additions and 8 deletions

View File

@@ -387,9 +387,9 @@ abstract class Enemy extends Entity {
if (matchedType.mapData.isPatrol(normalizedId)) {
spawnState = EntityState.patrolling;
} else if (matchedType.mapData.isStatic(normalizedId)) {
// Standing map placements are directional ambush actors in Wolf3D.
// Using ambushing keeps wake-up behavior aligned with placed facing.
spawnState = EntityState.ambushing;
// Standing map placements face a specific direction but stand still
// until the player enters their line of sight (handled by checkWakeUp).
spawnState = EntityState.idle;
} else {
return null;
}

View File

@@ -41,11 +41,11 @@ void main() {
expect(_spawnEnemy(141).angle, CardinalDirection.south.radians);
});
test('spawns standing variants as ambushing', () {
expect(_spawnEnemy(134).state, EntityState.ambushing);
expect(_spawnEnemy(135).state, EntityState.ambushing);
expect(_spawnEnemy(136).state, EntityState.ambushing);
expect(_spawnEnemy(137).state, EntityState.ambushing);
test('spawns standing variants as idle', () {
expect(_spawnEnemy(134).state, EntityState.idle);
expect(_spawnEnemy(135).state, EntityState.idle);
expect(_spawnEnemy(136).state, EntityState.idle);
expect(_spawnEnemy(137).state, EntityState.idle);
});
test('spawns patrol variants as patrolling', () {