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

@ -102,7 +102,7 @@ func _pause() -> void:
for i in 10:
await r.physics_frame
r.check(c.state.phase_time_left == t and sim.player.global_position == player, "pausing freezes the simulation tick")
r.check(main.pause_menu._where.text == "Night 1 of 5 · Day" and main.pause_menu._note.text.contains("morning of day 1"),
r.check(main.pause_menu._where.text == "Night 1 of %d · Day" % c.config.campaign_nights and main.pause_menu._note.text.contains("morning of day 1"),
"the pause menu says where you are and what Continue picks up ('%s')" % main.pause_menu._where.text)
r.check(main.pause_menu.resume_button.has_focus(), "with Resume focused")
await _press("pause")
@ -166,7 +166,7 @@ func _restart_and_quit_to_menu() -> void:
and c.state.phase == P.MORNING and c.state.resources.pouch["scrap"] == 0,
"Save & quit to menu: back at the menu, the farm at the saved morning")
r.check(FileAccess.get_file_as_string(SAVE) == file, "and the save itself is untouched")
r.check(not main.main_menu.continue_button.disabled and main.main_menu.save_note.text.begins_with("Morning of day 1 of 5"),
r.check(not main.main_menu.continue_button.disabled and main.main_menu.save_note.text.begins_with("Morning of day 1 of %d" % c.config.campaign_nights),
"Continue now offers that morning ('%s')" % main.main_menu.save_note.text)
await r.process_frame
r.check(main.main_menu.continue_button.has_focus(), "and has the focus")
@ -283,7 +283,7 @@ func _failure() -> void:
c.tick(DT)
panel._process(EndPanel.DELAY + 0.1)
r.check(c.state.phase == P.GAME_OVER and panel.is_visible_in_tree() and panel.mode == "failure" and panel._title.text == "The scarecrow has fallen"
and panel._rating.text.begins_with("Night 1 of 5: Crows at the crops"), "the failure screen gives the cause and the night ('%s')" % panel._rating.text)
and panel._rating.text.begins_with("Night 1 of %d: Crows at the crops" % c.config.campaign_nights), "the failure screen gives the cause and the night ('%s')" % panel._rating.text)
r.check(panel._detail.text.contains("You kept the farm for 0 nights.") and panel._detail.text.contains("Left: 30 of 30 crops")
and panel._detail.text.contains("Tonight: "), "what was kept, what's left, and what tonight cost")
r.check(panel._retry.visible and panel._retry.has_focus() and panel._menu.visible and not panel._new.visible
@ -352,8 +352,10 @@ func _ending() -> void:
and panel._rating.text.contains("points") and panel._bars.visible and panel._menu.visible and panel._menu.has_focus()
and not panel._retry.visible, "then the final assessment ('%s')" % panel._rating.text)
var a := Assessment.of(c.state, cfg)
r.check(panel._rating.text == "%s · %d points" % [a["tier"], a["score"]] and panel._stats.text.contains("Enemies defeated: 40 crows and 8 aliens")
and panel._stats.text.contains("Gathered 48 wood"), "with the rating, the shares kept, and the vacation's totals")
var logged := cfg.campaign_nights - 1 # the night log built above: 10 crows, 2 thieves, 12 wood a night
r.check(panel._rating.text == "%s · %d points" % [a["tier"], a["score"]]
and panel._stats.text.contains("Enemies defeated: %d crows and %d aliens" % [10 * logged, 2 * logged])
and panel._stats.text.contains("Gathered %d wood" % (12 * logged)), "with the rating, the shares kept, and the vacation's totals")
r.info("assessment: %s\n%s\n%s" % [panel._rating.text, panel._detail.text, panel._stats.text])
ending.clear()
ending.start()