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>
This commit is contained in:
Steven Wroblewski
2026-05-09 01:20:36 +02:00
parent a877d8f5fe
commit 9aded82dbb
5 changed files with 101 additions and 5 deletions
+8 -2
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cozypaw_lab"] [gd_scene load_steps=4 format=3 uid="uid://cozypaw_lab"]
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"] [ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
[ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"] [ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"]
[ext_resource type="Script" path="res://scripts/objects/room_chest.gd" id="3_chest"]
[node name="Lab" type="Node2D"] [node name="Lab" type="Node2D"]
@@ -25,7 +26,7 @@ color = Color(0.88, 0.92, 0.94, 1)
size = Vector2(40, 620) size = Vector2(40, 620)
position = Vector2(1240, 0) position = Vector2(1240, 0)
[node name="LabBench" type="ColorRect" parent="."] [node name="LabBenchSurface" type="ColorRect" parent="."]
color = Color(0.88, 0.88, 0.92, 1) color = Color(0.88, 0.88, 0.92, 1)
size = Vector2(800, 40) size = Vector2(800, 40)
position = Vector2(240, 480) position = Vector2(240, 480)
@@ -77,3 +78,8 @@ script = ExtResource("2_snap")
[node name="SnapLabBench2" type="Node2D" parent="."] [node name="SnapLabBench2" type="Node2D" parent="."]
position = Vector2(750, 470) position = Vector2(750, 470)
script = ExtResource("2_snap") script = ExtResource("2_snap")
[node name="LabBench" type="Node2D" parent="."]
position = Vector2(150.0, 400.0)
script = ExtResource("3_chest")
chest_id = "lab_bench"
+7 -1
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cozypaw_patientroom"] [gd_scene load_steps=4 format=3 uid="uid://cozypaw_patientroom"]
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"] [ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
[ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"] [ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"]
[ext_resource type="Script" path="res://scripts/objects/room_chest.gd" id="3_chest"]
[node name="PatientRoom" type="Node2D"] [node name="PatientRoom" type="Node2D"]
@@ -93,3 +94,8 @@ pose = "lying"
position = Vector2(810, 465) position = Vector2(810, 465)
script = ExtResource("2_snap") script = ExtResource("2_snap")
pose = "lying" pose = "lying"
[node name="PatientCabinet" type="Node2D" parent="."]
position = Vector2(150.0, 400.0)
script = ExtResource("3_chest")
chest_id = "patient_cabinet"
+12 -1
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cozypaw_pharmacy"] [gd_scene load_steps=4 format=3 uid="uid://cozypaw_pharmacy"]
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"] [ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
[ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"] [ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="2_snap"]
[ext_resource type="Script" path="res://scripts/objects/room_chest.gd" id="3_chest"]
[node name="Pharmacy" type="Node2D"] [node name="Pharmacy" type="Node2D"]
@@ -73,3 +74,13 @@ position = Vector2(640, 430)
[node name="SnapCounter" type="Node2D" parent="."] [node name="SnapCounter" type="Node2D" parent="."]
position = Vector2(640, 520) position = Vector2(640, 520)
script = ExtResource("2_snap") script = ExtResource("2_snap")
[node name="PharmacyMedicine" type="Node2D" parent="."]
position = Vector2(350.0, 320.0)
script = ExtResource("3_chest")
chest_id = "pharmacy_medicine"
[node name="PharmacyTools" type="Node2D" parent="."]
position = Vector2(900.0, 320.0)
script = ExtResource("3_chest")
chest_id = "pharmacy_tools"
+7 -1
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://cozypaw_xray"] [gd_scene load_steps=5 format=3 uid="uid://cozypaw_xray"]
[ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"] [ext_resource type="PackedScene" path="res://scenes/objects/InteractiveObject.tscn" id="1_iobj"]
[ext_resource type="PackedScene" path="res://scenes/objects/XRayMachine.tscn" id="2_xraymachine"] [ext_resource type="PackedScene" path="res://scenes/objects/XRayMachine.tscn" id="2_xraymachine"]
[ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="3_snap"] [ext_resource type="Script" path="res://scripts/objects/snap_point.gd" id="3_snap"]
[ext_resource type="Script" path="res://scripts/objects/room_chest.gd" id="4_chest"]
[node name="XRay" type="Node2D"] [node name="XRay" type="Node2D"]
@@ -59,3 +60,8 @@ position = Vector2(900, 560)
position = Vector2(640, 480) position = Vector2(640, 480)
script = ExtResource("3_snap") script = ExtResource("3_snap")
pose = "lying" pose = "lying"
[node name="XRayCabinet" type="Node2D" parent="."]
position = Vector2(150.0, 400.0)
script = ExtResource("4_chest")
chest_id = "xray_cabinet"
+67
View File
@@ -0,0 +1,67 @@
## Tests for RoomChest presence and item counts in Floor 1 rooms.
extends GutTest
func test_xray_has_chest_xray_cabinet() -> void:
var room: Node = preload("res://scenes/rooms/floor1/XRay.tscn").instantiate()
add_child_autofree(room)
assert_not_null(room.get_node_or_null("XRayCabinet"))
func test_xray_cabinet_has_three_items() -> void:
var room: Node = preload("res://scenes/rooms/floor1/XRay.tscn").instantiate()
add_child_autofree(room)
var chest: RoomChest = room.get_node_or_null("XRayCabinet") as RoomChest
assert_eq(chest.get_item_config_count(), 3)
func test_pharmacy_has_chest_pharmacy_medicine() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
add_child_autofree(room)
assert_not_null(room.get_node_or_null("PharmacyMedicine"))
func test_pharmacy_medicine_has_two_items() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
add_child_autofree(room)
var chest: RoomChest = room.get_node_or_null("PharmacyMedicine") as RoomChest
assert_eq(chest.get_item_config_count(), 2)
func test_pharmacy_has_chest_pharmacy_tools() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
add_child_autofree(room)
assert_not_null(room.get_node_or_null("PharmacyTools"))
func test_pharmacy_tools_has_two_items() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
add_child_autofree(room)
var chest: RoomChest = room.get_node_or_null("PharmacyTools") as RoomChest
assert_eq(chest.get_item_config_count(), 2)
func test_lab_has_chest_lab_bench() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Lab.tscn").instantiate()
add_child_autofree(room)
assert_not_null(room.get_node_or_null("LabBench"))
func test_lab_bench_has_three_items() -> void:
var room: Node = preload("res://scenes/rooms/floor1/Lab.tscn").instantiate()
add_child_autofree(room)
var chest: RoomChest = room.get_node_or_null("LabBench") as RoomChest
assert_eq(chest.get_item_config_count(), 3)
func test_patient_room_has_chest_patient_cabinet() -> void:
var room: Node = preload("res://scenes/rooms/floor1/PatientRoom.tscn").instantiate()
add_child_autofree(room)
assert_not_null(room.get_node_or_null("PatientCabinet"))
func test_patient_cabinet_has_three_items() -> void:
var room: Node = preload("res://scenes/rooms/floor1/PatientRoom.tscn").instantiate()
add_child_autofree(room)
var chest: RoomChest = room.get_node_or_null("PatientCabinet") as RoomChest
assert_eq(chest.get_item_config_count(), 3)