Task #24: nights by count, per-night enemy speed and HP
- Plans load by count: FarmSim.night_plan_path(n) ("res://game/resources/nights/night_%d.tres")
for n in 1..campaign_nights (FarmSim.load_night_plans). A missing file is a push_error and
that night plays the last plan that loaded. FarmSim.NIGHT_PLANS is gone. campaign_nights
stays 5.
- NightPlan.enemy_speed_scale / enemy_hp_scale (default 1; problems() flags non-positive ones).
At nightfall WaveDirector._on_phase_changed hands tonight's plan (or the F2 debug plan) to
EnemySystem.night_speed_scale / night_hp_scale, and the morning puts them back to 1.
EnemySystem.full_hp(type) = maxi(t_hp, floori(t_hp * night_hp_scale)) at spawn; steering
and max_speed() use t_speed * night_speed_scale (fleeing and carrying are shares of it).
Enemies have no HP bar (only structures do), and the co-op replica never simulates enemy HP,
so the wire format and CoopSession.PROTOCOL (5) are unchanged.
- Debug F3 / Shift+F3 (CampaignDebug.jump_morning; debug builds, morning review only, not on
a co-op partner's machine): next / previous day's morning with the farm as it is and
nights_survived = night - 1. It grants the Workbench and grows crops_total as a night's end
does, then re-enters the morning through CampaignController.load_state with save_path
blanked, so there's no autosave.
- test_nights: plan paths load in order (and a missing one repeats the last), spawn HP and
speed at default and 1.6 scales, and the F3 / Shift+F3 jump.
- RULES.md (The enemies: per-night scales), PLAYTEST.md (NIGHT_PLANS note), GameConfig
campaign_nights comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6a9575dfe4
commit
192a89770a
9 changed files with 259 additions and 22 deletions
|
|
@ -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:
|
||||
|
|
@ -117,5 +149,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue