Merge task #3: pouch 8 base, Bigger pouch upgrade to 16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-05 14:50:44 -04:00
commit 5b72e830db
4 changed files with 54 additions and 5 deletions

View file

@ -99,13 +99,15 @@ extends Resource
@export_range(0, 999) var start_straw: int = 4
@export_range(0, 999) var start_alien_goop: int = 0
## The scarecrow's pouch holds this many units in total; it empties into the shed on entry.
@export_range(1, 200) var pouch_capacity: int = 16
## Raised to 16 by the Bigger pouch upgrade (Upgrades, "pouch_capacity").
@export_range(1, 200) var pouch_capacity: int = 8
## Seconds of holding interact per gather (each takes one charge of the gather point).
@export var gather_time: float = 1.5
## What things cost: name -> {material: amount}: patching up, the buildables, and the upgrades.
@export var costs: Dictionary = {
"patch": {"straw": 2},
"straw_stuffing": {"straw": 12, "wood": 4},
"pouch_upgrade": {"wood": 10, "straw": 8},
"sprint": {"wood": 8, "straw": 6},
"corn_shooter": {"scrap": 10, "wood": 4},
"pumpkin_bomb": {"straw": 12, "scrap": 6},
@ -136,6 +138,7 @@ extends Resource
"wide_fear": {"name": "Wide fear", "text": "Fear reaches 30% farther", "track": "Fear", "stat": "fear_radius", "mult": 1.3},
"quick_fear": {"name": "Quick fear", "text": "Fear recharges 20% faster", "track": "Fear", "stat": "fear_cooldown", "mult": 0.8},
"straw_stuffing": {"name": "Straw stuffing", "text": "+2 max health", "track": "Scarecrow", "stat": "scarecrow_max_hp", "add": 2},
"pouch_upgrade": {"name": "Bigger pouch", "text": "+8 pouch capacity (16 total)", "track": "Scarecrow", "stat": "pouch_capacity", "add": 8},
"sprint": {"name": "Sprint", "text": "Sprint 80% faster for 4 s at a time, every 10 s", "track": "Scarecrow"},
"reinforced_fences": {"name": "Reinforced fences", "text": "Fences and gates +50% health", "track": "Defenses", "stat": "barrier_hp", "mult": 1.5},
"long_range": {"name": "Long-range defenses", "text": "Turrets reach 30% farther", "track": "Defenses", "stat": "turret_range", "mult": 1.3},

View file

@ -6,13 +6,14 @@ extends RefCounted
## Systems ask value() for a stat with the owned upgrades applied instead of reading GameConfig
## directly: the corn shooter's fire rate and shot damage, fear's radius and cooldown, fences' and gates'
## health (barrier_hp), the automated defense's range, and the traps' slow time. Straw stuffing
## raises the scarecrow's max health (FarmState) when bought. Sprint, the corn shooter, and
## pumpkin bombs change no stat: owning them unlocks sprinting (PlayerCharacter) and the two
## weapons (ScarecrowCombat). Rapid fire and heavy seeds need the corn shooter first ("requires").
## raises the scarecrow's max health (FarmState) when bought, and the Bigger pouch upgrade raises
## pouch_capacity (ResourceStore) the same way. Sprint, the corn shooter, and pumpkin bombs change
## no stat: owning them unlocks sprinting (PlayerCharacter) and the two weapons (ScarecrowCombat).
## Rapid fire and heavy seeds need the corn shooter first ("requires").
## Menu order, grouped by track.
const ORDER: Array[String] = ["corn_shooter", "rapid_fire", "heavy_seeds", "pumpkin_bomb", "wide_fear", "quick_fear",
"straw_stuffing", "sprint", "reinforced_fences", "long_range", "sticky_tar"]
"straw_stuffing", "pouch_upgrade", "sprint", "reinforced_fences", "long_range", "sticky_tar"]
static func owned(state: FarmState, id: String) -> bool:
@ -104,4 +105,6 @@ static func buy(campaign: CampaignController, id: String, structures: StructureS
for e in s.structures:
if e["type"] == "fence" or e["type"] == "gate":
e["hp"] = mini(roundi(int(e["hp"]) * k), structures.max_hp(e["type"]) if structures != null else 1 << 20)
"pouch_capacity": # the live value lives in ResourceStore, not read from cfg each time
s.resources.pouch_capacity += int(u.get("add", 0))
return "%s done: %s" % [u.get("name", id), String(u.get("text", "")).to_lower()]