#46: sprint becomes a permanent speed upgrade

Owning the Sprint upgrade now multiplies the scarecrow's speed by
sprint_speed_mult (1.25) all the time, walking and running, on every
platform; the run clip speeds up to match. The hold-to-sprint burst is
gone: sprint_time, sprint_cooldown, the stamina state in PlayerCharacter
(can_sprint is now has_sprint), and the HUD's stamina bar. The upgrade
keeps its id, cost, and name; its text is "Run 25% faster, always".
The sprint input action stays in project.godot, unused.

Tests: test_scarecrow's sprint checks cover 1x without it, x1.25 with it
(run and walk, clip speed, network strength), 30 s with no time limit,
no cooldown, the next morning, and no platform dependence; test_nights
checks it after the retry and a loaded save; test_economy checks the
text matches the multiplier, the menu row, and that an old save's
{"sprint": 1} still owns it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-14 14:32:39 -04:00
parent f0291133fd
commit 962c7b0b93
9 changed files with 138 additions and 149 deletions

View file

@ -45,12 +45,11 @@ extends Resource
## Patch up: hold for patch_time (rooted, no shooting) to restore patch_heal HP.
@export var patch_time: float = 2.0
@export_range(1, 100) var patch_heal: int = 3
## Sprint (the workbench's Sprint upgrade): hold sprint while moving to run sprint_speed_mult
## times as fast for up to sprint_time seconds; once it ends, sprint_cooldown seconds until the
## next one.
@export var sprint_speed_mult: float = 1.8
@export var sprint_time: float = 4.0
@export var sprint_cooldown: float = 10.0
## Sprint (the workbench's Sprint upgrade): once it's bought, the scarecrow moves
## sprint_speed_mult times as fast for good, walking and running alike (PlayerCharacter). No
## button, time limit, or cooldown. Its "text" in upgrades below names the boost: keep the two
## in step.
@export var sprint_speed_mult: float = 1.25
@export_group("Farm assets")
## Crop units and animals on the farm when the vacation starts; they must match the farm scene
@ -148,8 +147,8 @@ extends Resource
## "name", "track" (the menu's heading), "text": what it does.
## "stat": the one stat it changes. Stats are GameConfig settings, plus scarecrow_max_hp (the
## scarecrow's, in FarmState) and barrier_hp (fences' and gates' health). One without a stat
## unlocks something instead (sprint: PlayerCharacter; the weapons: ScarecrowCombat; radar:
## RadarHud).
## does something else instead (sprint: PlayerCharacter's speed, by sprint_speed_mult; the
## weapons: ScarecrowCombat; radar: RadarHud).
## "mult" multiplies the stat, "add" adds to it: a number (the same every level) or an Array
## with one entry per level. Each owned level's entry applies in turn, so they stack.
## "levels": how many times it can be bought (1 by default). Level L costs costs[id] x
@ -180,7 +179,7 @@ extends Resource
"texts": ["+2 max health", "+2 more max health", "+2 more max health"]},
"pouch_upgrade": {"name": "Bigger pouch", "track": "Scarecrow", "stat": "pouch_capacity", "add": [8, 4, 4], "levels": 3,
"texts": ["+8 pouch capacity (16 total)", "+4 pouch capacity (20 total)", "+4 pouch capacity (24 total)"]},
"sprint": {"name": "Sprint", "text": "Sprint 80% faster for 4 s at a time, every 10 s", "track": "Scarecrow"},
"sprint": {"name": "Sprint", "text": "Run 25% faster, always", "track": "Scarecrow"},
"reinforced_fences": {"name": "Reinforced fences", "track": "Defenses", "stat": "barrier_hp", "mult": [1.5, 1.25, 1.25], "levels": 3,
"texts": ["Fences and gates +50% health", "Fences and gates another +25% health", "Fences and gates +25% health again"]},
"long_range": {"name": "Long-range defenses", "track": "Defenses", "stat": "turret_range", "mult": [1.3, 1.15, 1.15], "levels": 3,