Commit Graph

31 Commits

Author SHA1 Message Date
Steven Wroblewski c2edaf2761 feat(nav): add GameState.set_current_room and AudioManager.DEFAULT_MUSIC_VOLUME 2026-05-10 20:53:25 +02:00
Steven Wroblewski a220b641ca feat(audio): add tap handler and SFX to RoomChest
Adds _get_press_position helper and _unhandled_input tap detection to
RoomChest, wires AudioManager.play_sfx calls for chest_tap and
item_spawn events. Guards AudioManager audio load calls with Dummy
driver check so headless unit tests stay green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 20:18:16 +02:00
Steven Wroblewski bad2fbe65f feat(audio): add AudioManager with floor music cross-fade and SFX
Replaces placeholder AudioManager with full implementation: floor-based
music routing via _derive_floor_from_room, cross-fade tween between
AudioStreamPlayers, SFX event-key dispatch, and room-change guard to
prevent redundant load attempts. 11 new tests (207 total, 206 passing).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 20:14:10 +02:00
Steven Wroblewski cd3ce7bf6e feat(rooms): add RoomChest nodes to Floor 2 and Home rooms
Add UltrasoundCart, DeliveryCabinet, NurseryShelf, GardenTable, GardenStorage
chest nodes to their respective scenes. All 10 new tests pass (196 total).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:24:18 +02:00
Steven Wroblewski 9aded82dbb feat(rooms): add RoomChest nodes to Floor 1 rooms
XRayCabinet (3 items), PharmacyMedicine + PharmacyTools (2 each),
LabBench (3 items), PatientCabinet (3 items). 10 new tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:20:36 +02:00
Steven Wroblewski a877d8f5fe feat(rooms): add RoomChest nodes to Floor 0 rooms
ReceptionDesk, GiftShopShelf, RestaurantCounter, EmergencyCabinet added
to their respective tscn files. Fixes spawn_items deferred call to avoid
add_child race during _ready tree setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:16:15 +02:00
Steven Wroblewski 87db92955a fix(items): safe cast in _try_return_to_chest, typed chest state param, object_states reset
- Replace unsafe direct cast in HoldableItem._try_return_to_chest() with guarded as-cast
- Type set_chest_state() parameter as Array[String] to match RoomChest._get_spawned_ids()
- Add else-branch in apply_save_data() to reset _object_states when key absent
- Rename test_save_data_has_version_two to test_save_data_has_version_three
2026-05-09 01:12:29 +02:00
Steven Wroblewski 96ec053331 feat(items): add chest-return priority to HoldableItem and GameState v3 chest states
- HoldableItem._try_return_to_chest() snaps item back if within CHEST_RETURN_RADIUS (80px)
- _on_drag_released checks chest return before hand-slot fallback
- OutfitItem._on_drag_released checks chest return before outfit/hand-slot logic
- GameState: _chest_states dict + get/set/clear_chest_state methods
- GameState.get_save_data() bumped to version 3, includes chest_states
- GameState.apply_save_data() restores chest_states from save data
2026-05-09 01:09:47 +02:00
Steven Wroblewski 4f1766834a refactor(items): strengthen RoomChest types, guard receive_item, expose get_spawned_item 2026-05-09 01:07:16 +02:00
Steven Wroblewski b9c73b80ea feat(items): add RoomChest with spawn and receive logic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:04:34 +02:00
Steven Wroblewski 4e4743f14f refactor(items): use ItemType enum and offset constants in ChestItemData/RoomChestConfig
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:01:50 +02:00
Steven Wroblewski b97b110876 feat(items): add ChestItemData resource and RoomChestConfig static config
TDD: 4 tests written first (FAIL), then implemented — all 151 tests pass.
2026-05-09 00:58:32 +02:00
Steven Wroblewski c1df40361a feat(items): add OutfitItem, tap-to-undress, and outfit refs on Character
- Add OutfitItem (extends HoldableItem): applies outfit on drop within 80px
  of character body, falls back to hand slot attach if no character in range
- Add apply_outfit_item / remove_outfit / _handle_outfit_tap to Character
- Track item node refs in _outfit_item_refs for restoring visibility
- Fix animation state: reset to idle before tap handling in _on_drag_released
- Extract _ITEM_DROP_OFFSET constant (replaces magic Vector2(0,60))
- Add 5 tests in test_outfit_item.gd, 14 new tests in test_character_v2.gd
2026-05-09 00:19:15 +02:00
Steven Wroblewski 07c3b996d7 feat(save): extend GameState to v2 — outfit and held items persisted per character
- Add held_left/held_right fields to CharacterData
- Add get/set_character_outfit and get/set_character_held_item to GameState
- get_save_data now returns version:2 with character_outfits and character_held_items
- apply_save_data resets both dicts when keys absent (empty-dict reset safe)
- 11 new tests in test_game_state.gd — 147/147 passing
2026-05-09 00:12:33 +02:00
Steven Wroblewski 09033b9401 fix(test): use get_node_or_null in detach position test per project convention 2026-05-09 00:09:53 +02:00
Steven Wroblewski ca1d20781e feat(items): add HoldableItem with hand slot detection, fix detach_item position
- Character registers in "characters" group on _ready for group scanning
- detach_item saves/restores global_position after reparenting
- New HoldableItem base class: scans "characters" group on drag_released,
  attaches to nearest free hand within 60px radius, detaches on pickup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:03:25 +02:00
Steven Wroblewski 0d3788246a feat(snap-points): add SnapPoints to all 2.OG and Garten rooms (Ultrasound, DeliveryRoom, Nursery, GardenParty)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:40:45 +02:00
Steven Wroblewski 8cae50bc11 feat(snap-points): add SnapPoints to all 1.OG rooms (XRay, Pharmacy, Lab, PatientRoom) 2026-05-08 22:32:57 +02:00
Steven Wroblewski 7848b7a979 feat(snap-points): add SnapPoints to all EG rooms (Reception, GiftShop, Restaurant, EmergencyRoom) 2026-05-08 22:30:12 +02:00
Steven Wroblewski 2f5e9d99a6 feat(snap-receiver): implement snap detection, position snapping, and pose animation trigger
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:12:18 +02:00
Steven Wroblewski 60fba44316 feat(character): add hand slot API (attach/detach/get_held_item/is_hand_free) 2026-05-08 22:09:56 +02:00
Steven Wroblewski 1a9d916293 feat(character): add outfit layer API (set/clear/get_outfit per layer 1-3) 2026-05-08 22:07:53 +02:00
Steven Wroblewski 9be67c8dfe feat(character): add animation state API (set/get_animation_state) 2026-05-08 22:02:59 +02:00
Steven Wroblewski 15ac8666f8 feat(character-data): add outfit array field for three outfit layer slots 2026-05-08 22:01:18 +02:00
Steven Wroblewski 2c576ad419 feat(character): add AnimatedSprite2D, OutfitLayers, HandSlots, SnapReceiver to Character scene
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 21:59:30 +02:00
Steven Wroblewski cc5f205a7e feat(snap-point): add SnapPoint node with pose, baby_only filter, and occupant tracking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 21:56:50 +02:00
Steven Wroblewski 1e445263a7 test(gift-box): add unit tests for CLOSED/OPENING/OPEN state machine 2026-04-17 22:45:26 +02:00
Steven Wroblewski 286498804d test(room-navigator): add missing is_at_home and go_to_hospital tests
Adds 7 new test cases covering home/hospital navigation state:
- is_at_home() initial state and transitions
- go_to_home() with idempotence check
- go_to_hospital() state restoration and guards
- is_at_home flag cleanup on room navigation

Implements corresponding methods in RoomNavigator:
- is_at_home(): Returns home state
- go_to_home(): Navigates to home (0,0) and saves hospital position
- go_to_hospital(): Returns to previously saved hospital location
- _go_to_room_internal(): Helper to avoid flag interference

All 34 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:41:59 +02:00
Steven Wroblewski 297b57a3c1 test(room-navigator): add unit tests for floor/room state and camera navigation 2026-04-17 22:39:09 +02:00
Steven Wroblewski e3a93d3c52 test(game-state): add unit tests for character positions, object states, and save round-trip 2026-04-17 22:36:53 +02:00
Steven Wroblewski 978c8a5c80 chore(tooling): add GUT test infrastructure and smoke test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:35:08 +02:00