Task #5: generic hidden/reveal shop item system

An item definition in GameConfig.upgrades can set "hidden": true
(optionally its own "reveal_goop", else the new config-tunable
hidden_reveal_goop) so the workbench shows only a bare "?" (no name,
text, or cost), disabled, until the player has collected that much
Alien Goop in total. Upgrades.goop_collected()/revealed() derive this
from FarmState.totals() (completed nights) plus night_events (the
current cycle), so it persists through save and retry without any new
stored state. blocker() and buy() both gate on it (covering the co-op
buy-request path too), and UpgradePanel.refresh() shows the "?" row.

No real upgrade ships hidden yet; #7/#8 (Alien Ray, Radar) will use
this mechanism. Test flags a duplicated long_range/sticky_tar hidden
to exercise it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-05 14:38:42 -04:00
parent 30e64ebeec
commit 45f3e83e54
4 changed files with 111 additions and 2 deletions

View file

@ -140,6 +140,12 @@ extends Resource
"long_range": {"name": "Long-range defenses", "text": "Turrets reach 30% farther", "track": "Defenses", "stat": "turret_range", "mult": 1.3},
"sticky_tar": {"name": "Sticky tar", "text": "Tar patches hold 50% longer", "track": "Defenses", "stat": "trap_slow_time", "mult": 1.5},
}
## An upgrade with "hidden": true (e.g. Alien Ray, Radar, #7/#8) shows only a "?" (no name, text,
## or cost) and can't be bought until the player has collected this much Alien Goop in total
## (Upgrades.goop_collected); then it shows and buys normally for its defined cost. Overridable
## per item with its own "reveal_goop". 5 is about 15 Alien kills at the default 33% drop chance
## (alien_goop_drop_chance) — a few kills in, not instant and not a grind.
@export_range(0, 999) var hidden_reveal_goop: int = 5
@export_group("Assessment")
## The final assessment's weight per category (Assessment): the score is the weighted share of