Task #27: the thirty nights

- campaign_nights 5 -> 30. The old night 5 ("The last night") is now night 30, keeping its
  uid, title, hint, and 180 s. It grew to 73 base / 511 played in its three waves, with UFO
  groups added, at speed x1.25 and HP x1.625.
- New hand-authored night 5, "Lights in the sky": night 4's shape plus the first UFOs (two
  single-UFO groups, 14 as played), 24 base.
- New game/tools/make_nights.gd writes nights 6-29 by the plan's recipe (seed 30, sieges on
  10/15/20/25, mix, waves, scales, draft titles and hints) as .tres text with fresh uids. It
  skips existing files unless --force (which keeps their uids), refuses ranges outside 6..29,
  and checks every plan with NightPlan.problems() at the played scales (non-zero exit on any
  problem). Generated nights 6-29 are committed.
- test_nights: the arc (30 plans, breakers from night 3 and UFOs from night 5, no non-siege drop
  over 15% from night 3 on, sieges, last night longest), the per-night scales, the new night 5
  and night 30 designs. The back-to-back run plays nights 1-5, 10, and 30, skipping the rest
  with CampaignDebug.jump_morning.
- test_campaign, test_cycle, test_flow read campaign_nights instead of a hard-coded 5.
- RULES (the vacation, the Night row, the thirty nights and their table, the vacation's end),
  README, and a dated PLAYTEST section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:38:07 -04:00
parent 3bb835f7c3
commit ab1443325a
36 changed files with 2956 additions and 136 deletions

View file

@ -1,6 +1,7 @@
extends RefCounted
## Phase state machine: the untimed morning, phase order and lengths, five-night completion,
## the early-night option, night loss records, and retrying a failed night from its morning.
## Phase state machine: the untimed morning, phase order and lengths, completing the vacation
## (GameConfig.campaign_nights nights), the early-night option, night loss records, and retrying a
## failed night from its morning.
const O := CampaignController.Outcome
const P := CampaignController.Phase
@ -8,7 +9,7 @@ const P := CampaignController.Phase
func run(r: GameTestRunner) -> void:
_order_and_timers(r)
_five_nights(r)
_all_nights(r)
_early_night(r)
_night_log(r)
_retry(r)
@ -45,8 +46,9 @@ func _order_and_timers(r: GameTestRunner) -> void:
r.check(c.state.phase == P.MORNING and c.state.night == 3, "advance_phase walks a whole cycle")
func _five_nights(r: GameTestRunner) -> void:
func _all_nights(r: GameTestRunner) -> void:
var c := r.make_campaign()
var nights := c.config.campaign_nights
var ended: Array[CampaignController.Outcome] = []
var mornings: Array[int] = []
c.campaign_ended.connect(func(o: CampaignController.Outcome) -> void: ended.append(o))
@ -55,10 +57,11 @@ func _five_nights(r: GameTestRunner) -> void:
mornings.append(c.state.night))
GameTestRunner.run_until(c, P.FARMERS_RETURN)
r.check(c.state.phase == P.FARMERS_RETURN and c.outcome == O.VACATION_COMPLETE, "surviving every night brings the farmers back")
r.check(c.state.nights_survived == 5 and c.state.night == 5, "the vacation is exactly five nights (night %d, survived %d)" % [c.state.night, c.state.nights_survived])
r.check(mornings == [2, 3, 4, 5], "a morning follows each night except the last (got %s)" % [mornings])
r.check(c.state.nights_survived == nights and c.state.night == nights,
"the vacation is exactly campaign_nights (%d) nights (night %d, survived %d)" % [nights, c.state.night, c.state.nights_survived])
r.check(mornings == range(2, nights + 1), "a morning follows each night except the last (got %s)" % [mornings])
r.check(ended == [O.VACATION_COMPLETE], "campaign_ended fires once")
r.check(c.state.night_log.size() == 5, "every night is recorded")
r.check(c.state.night_log.size() == nights, "every night is recorded")
c.tick(1000.0)
c.advance_phase()
r.check(c.state.phase == P.FARMERS_RETURN and ended.size() == 1, "the farmers' return is terminal")