Debug F8 unlocks everything: every upgrade and shop item at its last level

CampaignDebug.unlock_all (debug builds, not on a co-op partner's machine,
until the vacation ends) grants every upgrade and shed item at its last
level for free through Upgrades.grant_all, which shares the new
Upgrades.level_up with buy(), so each level's effect (max health, pouch,
barrier health) applies as if bought. Not counted as bought in the night
record. In the morning review the retry snapshot is retaken
(CampaignController.retake_morning_snapshot) so a retry keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:54:34 -04:00
parent 3f32596034
commit 10390cf382
5 changed files with 101 additions and 5 deletions

View file

@ -10,6 +10,8 @@ extends CanvasLayer
## R after Game Over: retry the night; after the farmers return: new vacation
## F6 end the current phase now
## F7 cycle game speed 1x / 5x / 20x
## F8 unlock everything: every upgrade and shop item at its last level, free
## (unlock_all; debug builds only, not on a co-op partner's machine)
## F9 debug: scarecrow to 0 HP
## F10 debug: strip every farm asset
## T / G / H debug: send in a thief / a crow / a fence breaker (FarmSim)
@ -73,6 +75,8 @@ func _unhandled_input(event: InputEvent) -> void:
KEY_F7:
_speed_index = (_speed_index + 1) % SPEEDS.size()
Engine.time_scale = SPEEDS[_speed_index]
KEY_F8:
unlock_all()
KEY_F9:
s.scarecrow_hp = 0
KEY_F10:
@ -108,6 +112,23 @@ func jump_morning(step: int) -> bool:
## Next debug scenario as tonight's plan (after the last, the real plan again).
## Debug builds, until the vacation ends: every upgrade and shop item at its last level, free
## (Upgrades.grant_all), to try the late game's kit at once. On the morning review a retry keeps
## it (the morning snapshot is retaken); later in the day a retry goes back to that morning
## without it. Nothing is saved until the next morning's autosave. Returns the levels it added.
func unlock_all() -> int:
if not OS.is_debug_build() or campaign.is_over() or campaign.remote_request.is_valid():
return 0
var n := Upgrades.grant_all(campaign, sim.structures if sim != null else null)
if campaign.state.phase == CampaignController.Phase.MORNING:
campaign.retake_morning_snapshot()
if sim != null:
for panel: UpgradePanel in [sim.upgrade_panel, sim.shed_panel]:
if panel != null and panel.is_open:
panel.refresh()
return n
func cycle_scenario() -> void:
if sim == null:
return
@ -147,5 +168,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 · 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")
lines.append("F1 hide · F2 scenario · F3 / Shift+F3 next / previous morning · F6 next phase · F7 speed · F8 unlock everything · F9 scarecrow to 0 HP · F10 strip farm · T/G/H thief/crow/breaker")
return "\n".join(lines)