Phase D: build Treasury (second area) #52

Merged
scruffydude merged 1 commit from task/51-phase-d-treasury into main 2026-10-04 11:27:24 -04:00
Owner

Closes #51

New treasury.tscn: 5 items (Crown, Gem, Coin Pile, Trophy, Scroll) matching the deleted 2D Treasury's theme/palette, same room-shell baseline as Armory (colored floor/ceiling/pedestals, stand signage) but no mocked-up window or item sets - those were specific to Armory's own playtest feedback. No script changes needed - player.gd/item.gd/stand.gd/area.gd/GameProgress are all already area-agnostic. armory.tscn's next_area_scene_path now chains into Treasury instead of looping to the menu.

Along the way, testing Treasury's autosave/restore flow surfaced a real pre-existing bug: area.gd's _ready() set the win overlay hidden after restoring already-placed items, so resuming a fully-complete area silently hid the win overlay that restoration had just correctly shown. Fixed by reordering. Armory's 47 items made this edge case easy to miss; Treasury's 5 made it trivial to hit.

Validated headlessly: clean import/boot for both scenes, a disposable 3-phase hook confirming win gating/restore-shows-win/no NaN/cross-area save isolation, and confirmed armory.tscn's chain now resolves to Treasury.

🤖 Generated with Claude Code

Closes #51 New treasury.tscn: 5 items (Crown, Gem, Coin Pile, Trophy, Scroll) matching the deleted 2D Treasury's theme/palette, same room-shell baseline as Armory (colored floor/ceiling/pedestals, stand signage) but no mocked-up window or item sets - those were specific to Armory's own playtest feedback. No script changes needed - player.gd/item.gd/stand.gd/area.gd/GameProgress are all already area-agnostic. armory.tscn's next_area_scene_path now chains into Treasury instead of looping to the menu. Along the way, testing Treasury's autosave/restore flow surfaced a real pre-existing bug: area.gd's _ready() set the win overlay hidden *after* restoring already-placed items, so resuming a fully-complete area silently hid the win overlay that restoration had just correctly shown. Fixed by reordering. Armory's 47 items made this edge case easy to miss; Treasury's 5 made it trivial to hit. Validated headlessly: clean import/boot for both scenes, a disposable 3-phase hook confirming win gating/restore-shows-win/no NaN/cross-area save isolation, and confirmed armory.tscn's chain now resolves to Treasury. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
New scenes/areas/treasury.tscn, built the same way armory.tscn was:
5 items (Crown, Gem, Coin Pile, Trophy, Scroll) on 5 stands, matching
the original deleted 2D Treasury's theme/palette and click_size-derived
proportions. Same room-shell baseline Armory now has (colored floor,
ceiling, colored pedestals, stand signage) but no mocked-up window -
that was a one-off atmosphere request for Armory, not an established
pattern yet - and no item sets, since those came from real playtest
feedback on Armory specifically rather than something requested here.
Dark-purple ambient/floor and marble-purple pedestals (the exact tone
the 2D version used for every stand) distinguish it from Armory's
blue-grey/bronze.

No script changes were needed for Treasury itself - player.gd,
item.gd, stand.gd, area.gd, and GameProgress are all already
area-agnostic. armory.tscn's next_area_scene_path now points at
Treasury instead of looping back to the menu, chaining the two areas.

Testing Treasury's full autosave/restore flow surfaced a real
pre-existing bug in area.gd: _ready() set _win_overlay.visible = false
*after* the item-restoration loop, so resuming an area where every
item was already placed got its win overlay silently clobbered back
to hidden right after the restoration's own signal handling correctly
showed it. Fixed by moving that UI setup before the restoration loop
instead of after. Armory's 47 items made this edge case easy to miss;
Treasury's 5 made it trivial to hit in a single test run.

Validated headlessly: import/boot clean for both scenes; a disposable
3-phase hook in area.gd (reverted before this commit) confirmed win
gating (hidden at 4/5, shown at 5/5), that a fully-restored area shows
the win overlay on load (the bug above), no NaN/instability across a
physics settle pass, and that Treasury's autosave entries don't
collide with a simulated Armory entry under GameProgress.placed_items.
Confirmed armory.tscn's next_area_scene_path now resolves to Treasury.

Closes #51

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
scruffydude deleted branch task/51-phase-d-treasury 2026-10-04 11:27:24 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
scruffydude/project-awry!52
No description provided.