Merge task #24: nights by count, per-night enemy speed and HP, F3 night jump

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:05:39 -04:00
commit f5bfdc4bef
9 changed files with 259 additions and 22 deletions

View file

@ -4,6 +4,8 @@ extends CanvasLayer
## F1 show / hide this readout
## F2 cycle tonight's plan through the debug scenarios (one enemy type, then
## pairs, then all three; game/resources/scenarios/) and back to the real one
## F3 / Shift+F3 in the morning review: jump to the next / previous day's morning, farm as
## it is (jump_morning; debug builds only, not on a co-op partner's machine)
## N start the night early (only when GameConfig.allow_early_night is on)
## R after Game Over: retry the night; after the farmers return: new vacation
## F6 end the current phase now
@ -62,6 +64,8 @@ func _unhandled_input(event: InputEvent) -> void:
_label.visible = not _label.visible
KEY_F2:
cycle_scenario()
KEY_F3:
jump_morning(-1 if key.shift_pressed else 1)
KEY_N:
campaign.start_night_early()
KEY_F6:
@ -75,6 +79,34 @@ func _unhandled_input(event: InputEvent) -> void:
s.strip()
## Debug builds, in the morning review only: to the morning of the next (step 1) or previous
## (step -1) day, within the vacation. The farm stays as it is and nights_survived follows as
## night - 1. It's the campaign's own new-morning path (CampaignController.load_state with the
## current state), so everything a real morning does happens: dormant crop fields sprout (or go
## dormant again) by nights_survived, the Workbench is granted from nights_survived 1 on, the
## retry snapshot is retaken, and the review panel refreshes. As at a real night's end, the
## Workbench and the sprouted crops are in the state before that snapshot. The save file is left
## alone. Returns whether it moved.
func jump_morning(step: int) -> bool:
var s := campaign.state
if not OS.is_debug_build() or s.phase != CampaignController.Phase.MORNING or campaign.remote_request.is_valid():
return false
var night := clampi(s.night + step, 1, campaign.config.campaign_nights)
if night == s.night:
return false
s.night = night
s.nights_survived = night - 1
if sim != null: # what the night's end does first (CampaignController.night_ending)
if s.nights_survived >= 1:
sim.structures.grant_workbench()
sim.loot.grow_crops_total(s.nights_survived)
var path := campaign.save_path
campaign.save_path = "" # no autosave: a jump isn't a morning the player reached
campaign.load_state(s)
campaign.save_path = path
return true
## Next debug scenario as tonight's plan (after the last, the real plan again).
func cycle_scenario() -> void:
if sim == null:
@ -115,5 +147,5 @@ func _describe() -> String:
lines.append("[N] start the night early")
if sim != null and sim.waves.debug_plan != null:
lines.append("Scenario: %s (F2 next)" % sim.waves.debug_plan.title)
lines.append("F1 hide · F2 scenario · F6 next phase · F7 speed · F9 scarecrow to 0 HP · F10 strip farm · T/G/H thief/crow/breaker")
lines.append("F1 hide · F2 scenario · F3 / Shift+F3 next / previous morning · F6 next phase · F7 speed · F9 scarecrow to 0 HP · F10 strip farm · T/G/H thief/crow/breaker")
return "\n".join(lines)