Task #6: Supply Shed as its own weapon shop, separate from the Workbench
Adds a second UpgradePanel instance (shop "shed") at the Supply Shed's new
ShedCounter node, opened by interact like the Workbench. corn_shooter and
pumpkin_bomb move there ("shop": "shed" in GameConfig.upgrades); the
Workbench's panel (shop "workbench", the default) keeps rapid_fire,
heavy_seeds, and the rest, with "requires" still crossing shops. Co-op buys
go through the same ["buy", id] host gate; a shed_requested signal mirrors
workbench_requested so the partner's own shed panel opens. The shed's
walk-in pouch deposit is unaffected (no interact, not gated by the
counter's reach).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
1ccf825bbf
commit
308854d52c
17 changed files with 260 additions and 64 deletions
|
|
@ -49,6 +49,7 @@ const NIGHT_PLANS: Array[String] = [
|
|||
@export var asset_hud: AssetHud
|
||||
@export var review_panel: ReviewPanel
|
||||
@export var upgrade_panel: UpgradePanel
|
||||
@export var shed_panel: UpgradePanel
|
||||
@export var sun: DirectionalLight3D
|
||||
@export var world_environment: WorldEnvironment
|
||||
|
||||
|
|
@ -260,6 +261,13 @@ func _ready() -> void:
|
|||
var w := ScarecrowCombat.WEAPON_IDS.find(id)
|
||||
if w > 0:
|
||||
combat.equip(w))
|
||||
if shed_panel != null:
|
||||
shed_panel.setup(campaign, structures, player, "shed")
|
||||
interactions.shed_panel = shed_panel
|
||||
shed_panel.bought.connect(func(id: String) -> void: # a new weapon goes into its hand
|
||||
var w := ScarecrowCombat.WEAPON_IDS.find(id)
|
||||
if w > 0:
|
||||
combat.equip(w))
|
||||
if resource_hud != null:
|
||||
resource_hud.setup(campaign)
|
||||
resource_hud.structures = structures
|
||||
|
|
@ -307,6 +315,8 @@ func _ready() -> void:
|
|||
interactions.message.connect(toasts.push)
|
||||
if upgrade_panel != null:
|
||||
upgrade_panel.message.connect(toasts.push)
|
||||
if shed_panel != null:
|
||||
shed_panel.message.connect(toasts.push)
|
||||
build.message.connect(toasts.push)
|
||||
waves.arrived.connect(func(h: int, at: Vector2) -> void:
|
||||
toasts.push(arrival_message(enemies.type[enemies.resolve_handle(h)], zones.side_of(at)), Color(1.0, 0.75, 0.55)))
|
||||
|
|
@ -386,7 +396,7 @@ func _step_replica(dt: float) -> void:
|
|||
|
||||
|
||||
func _menu_open() -> bool:
|
||||
return upgrade_panel != null and upgrade_panel.is_open
|
||||
return (upgrade_panel != null and upgrade_panel.is_open) or (shed_panel != null and shed_panel.is_open)
|
||||
|
||||
|
||||
## Co-op: while this machine's scarecrow is down, the camera watches the partner's.
|
||||
|
|
@ -512,11 +522,14 @@ func set_local(a: Avatar) -> void:
|
|||
interactions.structures = structures
|
||||
interactions.build = build
|
||||
interactions.upgrade_panel = upgrade_panel
|
||||
interactions.shed_panel = shed_panel
|
||||
build.player = a.body
|
||||
build.combat = a.combat
|
||||
build.kit = a.kit
|
||||
if upgrade_panel != null:
|
||||
upgrade_panel.player = a.body
|
||||
if shed_panel != null:
|
||||
shed_panel.player = a.body
|
||||
if camera is FollowCamera:
|
||||
(camera as FollowCamera).target = a.body
|
||||
(camera as FollowCamera).snap_to_target()
|
||||
|
|
@ -732,6 +745,8 @@ func _on_phase_changed(phase: CampaignController.Phase, _previous: CampaignContr
|
|||
a.remote.release()
|
||||
if upgrade_panel != null:
|
||||
upgrade_panel.close()
|
||||
if shed_panel != null:
|
||||
shed_panel.close()
|
||||
if review_panel != null:
|
||||
review_panel.refresh() # after the farm is back in sync (the pen's gate)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue