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:
parent
30e64ebeec
commit
45f3e83e54
4 changed files with 111 additions and 2 deletions
|
|
@ -112,6 +112,11 @@ func refresh() -> void:
|
|||
var why := Upgrades.blocker(campaign, id)
|
||||
if Upgrades.owned(s, id):
|
||||
done += 1
|
||||
if not Upgrades.revealed(s, cfg, id):
|
||||
# Hidden: no name, description, or cost until its reveal condition is met.
|
||||
b.text = "?"
|
||||
b.disabled = true
|
||||
continue
|
||||
var price := "Done" if Upgrades.owned(s, id) else ResourceStore.describe(Upgrades.cost(cfg, id))
|
||||
b.text = "%s — %s (%s)" % [u["name"], u["text"], price]
|
||||
if why != "" and why != "Done":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue