spaceship/EnemyDefinitions.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

21 lines
612 B
GDScript

class_name EnemyDefinitions
extends RefCounted
const DEFAULT_ID: String = "chaser"
const ORDER: PackedStringArray = ["chaser", "sniper", "artillery"]
const DEFINITIONS: Dictionary = {
"chaser": preload("res://ChaserEnemyDefinition.tres"),
"sniper": preload("res://SniperEnemyDefinition.tres"),
"artillery": preload("res://ArtilleryEnemyDefinition.tres"),
}
static func get_definition(enemy_id: String) -> Resource:
return DEFINITIONS.get(enemy_id, DEFINITIONS[DEFAULT_ID])
static func all() -> Array:
var result: Array = []
for enemy_id in ORDER:
result.append(DEFINITIONS[enemy_id])
return result