spaceship/tests/_artillery_telegraph_rocky_preview.gd
Loïc Wisniewski def224667d Add artillery enemy with telegraphed AOE (#46)
EnemyArtilleryComponent is a stationary siege piece (slow drift toward
the fleet, deliberately no pursuit component) that fires at the fleet
centroid on a long cooldown via a standalone ArtilleryShell -
telegraph ring (~1.8s, growing radius plus a filling countdown arc) ->
slow visible travel -> AOE explosion via Ship.take_damage() on every
player_ships node inside, same all-or-nothing shield absorption as
every other damage source. The shell is independent of the enemy that
fired it (added to the tree root, like EnemyProjectile/Projectile) so
the shooter dying mid-flight doesn't cancel an already-telegraphed
shot, and the impact point is fixed at fire time - never re-aimed at
where the fleet moves to afterward.

Part of the #40 conquest-mechanic breakdown.
2026-08-15 21:23:43 +02:00

20 lines
697 B
GDScript

extends Node2D
func _ready() -> void:
GameState.planet_name = "Kepler's Rest"
GameState.planet_id = "artillery_preview_rocky"
GameState.planet_definition_id = "rocky"
GameState.surviving_ship_count = 3
var surface: Node = load("res://PlanetSurface.tscn").instantiate()
surface.get_node("SurfaceController").fade_duration = 0.0
add_child(surface)
var shell: Node = load("res://ArtilleryShell.tscn").instantiate()
shell.telegraph_time = 10.0 # frozen mid-countdown for the screenshot
shell.aoe_radius = 220.0
surface.add_child(shell)
shell.launch(Vector2(-600, -600), Vector2.ZERO)
shell.telegraph_left = shell.telegraph_time * 0.45
shell.set_process(false)
shell.queue_redraw()