Take planets by killing what defends them

#211 conquest is the fight now: a planet registers the garrison its setup
authors, each defender's own death counts against it, and the last one takes
the world. The capture points - stand in a ring, wait out a timer, once per
ring - are gone, along with the editor palette that placed them.
#212 conquest opens a dialog on the surface naming the research points
recovered; the award travels with the signal, after it is banked.
#209 the prologue's charted sectors go with the breach, so the map the
survivors keep is of where they now are - and "chart 30 sectors" is no
longer complete before they have flown anywhere.
#218 enemy variety is gated on the FLEET, not on wave strength: a starting
fleet meets chasers only at any wave number, and each vessel past three
opens one more kind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
Loïc Wisniewski 2026-09-05 13:31:25 +02:00
commit 6e13b6397c
42 changed files with 540 additions and 749 deletions

View file

@ -8,18 +8,18 @@ extends SceneTree
# 2. dropping a new .tres into res://PlanetSetups/ makes it appear via
# PlanetSetups.rescan() with no other code change
# 3. landing on a rocky/gas planet composes a PlanetSetupHost carrying the
# resolved setup, with one marker per capture point
# resolved setup, placing one enemy per authored spawn
const SCRATCH_SETUP_PATH: String = "res://PlanetSetups/_test_scratch_setup.tres"
# Resolved via load() inside _initialize(), NOT a top-level `const ...
# preload(...)` - a top-level preload in a script-mode ENTRY point (-s
# this_file.gd) evaluates during this file's own early compilation, which
# can happen before autoloads are registered, and CapturePoint.gd
# references GameState in a function body (resolved at compile time). See
# test_capture_points.gd for the full explanation.
# can happen before autoloads are registered, and the scripts loaded here
# reference GameState in function bodies (resolved at compile time). See
# test_planet_garrison.gd for the full explanation.
var PLANET_SETUP_SCRIPT: Script
var CAPTURE_POINT_SCRIPT: Script
var ENEMY_SCRIPT: Script
var game_state: Node
var rocky_setup: Resource
@ -30,7 +30,7 @@ var pending_surface: Node
func _initialize() -> void:
PLANET_SETUP_SCRIPT = load("res://surface/PlanetSetup.gd")
CAPTURE_POINT_SCRIPT = load("res://surface/CapturePoint.gd")
ENEMY_SCRIPT = load("res://enemies/Enemy.gd")
# --- 1. determinism and profile filtering ---
rocky_setup = PlanetSetups.setup_for_planet("chunk:3:7", "rocky")
if rocky_setup == null:
@ -65,7 +65,6 @@ func _initialize() -> void:
scratch.setup_id = "_test_scratch_setup"
scratch.display_name = "Scratch"
scratch.surface_profile_id = "rocky"
scratch.capture_points = PackedVector2Array([Vector2(100, 100)])
var save_err: int = ResourceSaver.save(scratch, SCRATCH_SETUP_PATH)
if save_err != OK:
return _fail("could not save the scratch setup for the pickup check (err %d)" % save_err)
@ -108,14 +107,14 @@ func _process(delta: float) -> bool:
if host.setup != rocky_setup:
pending_surface.free()
return _fail("host did not receive the deterministically resolved setup")
var point_count: int = 0
var enemy_count: int = 0
for child in host.get_children():
if child.get_script() == CAPTURE_POINT_SCRIPT:
point_count += 1
if point_count != rocky_setup.capture_points.size():
if child.get_script() == ENEMY_SCRIPT:
enemy_count += 1
if enemy_count != rocky_setup.enemy_spawns.size():
pending_surface.free()
return _fail("host placed %d capture points for %d authored ones" % [
point_count, rocky_setup.capture_points.size()
return _fail("host placed %d enemies for %d authored spawns" % [
enemy_count, rocky_setup.enemy_spawns.size()
])
pending_surface.free()