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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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', () {
|
||||
|
||||
Reference in New Issue
Block a user