#113: a wave converges on the nearest structure from any distance
A wave is an attack on what the player has built, not a hazard sitting in space waiting to be flown near. Wave enemies now ignore the detection radius their components otherwise respect and close on the nearest building from wherever they arrived. The flag is per INSTANCE rather than per definition: the same chaser is a wave when the director launches it and a garrison when a map author places it, and a planet garrison that chased the player across the system would be a very different thing from what the editor is used to place. The test pins both halves - a wave chaser 6000px out closed on a crafter, and an identically built one nobody sent held its station. What it fights on the way is unchanged: EnemyTargets already prefers a vessel inside 520px over a building further off, and already searches the player_ships group, so the fleet and an outpost's garrison both count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
7a78d1b1a6
commit
1a2a27b6e8
6 changed files with 68 additions and 3 deletions
|
|
@ -64,3 +64,10 @@ static func nearest_target(node: Node, from: Vector2) -> Node2D:
|
|||
|
||||
static func is_building(target: Node) -> bool:
|
||||
return target != null and target.is_in_group("buildings")
|
||||
|
||||
|
||||
# #113: whether this enemy may act on a target however far away it is.
|
||||
# Asked here rather than read directly, so the three movement components
|
||||
# cannot drift into disagreeing about what "relentless" means.
|
||||
static func ignores_range(enemy: Node) -> bool:
|
||||
return enemy != null and bool(enemy.get("relentless"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue