feat: replace activity markers with typed sites
This commit is contained in:
@@ -31,6 +31,7 @@ func _run() -> void:
|
||||
not main_scene.has_node("World")
|
||||
and not main_scene.has_node("ResourceNodes")
|
||||
and not main_scene.has_node("ActivityMarkers")
|
||||
and not main_scene.has_node("JajceWorld/LegacyActivityMarkers")
|
||||
),
|
||||
"Runtime should not retain duplicate flat-world objects"
|
||||
)
|
||||
@@ -57,12 +58,10 @@ func _run() -> void:
|
||||
)
|
||||
var pantry := main_scene.get_node("JajceWorld/WorldObjects/StorageSites/VillagePantry") as StorageNode
|
||||
destinations.append(pantry.get_interaction_position())
|
||||
for marker_path in [
|
||||
"JajceWorld/LegacyActivityMarkers/GuardZone",
|
||||
"JajceWorld/LegacyActivityMarkers/StudyZone",
|
||||
"JajceWorld/LegacyActivityMarkers/RestZone"
|
||||
]:
|
||||
destinations.append(main_scene.get_node(marker_path).global_position)
|
||||
var activity_root := main_scene.get_node("JajceWorld/WorldObjects/ActivitySites")
|
||||
_check(activity_root.get_child_count() == 3, "Runtime should expose three typed activity sites")
|
||||
for site in activity_root.get_children():
|
||||
destinations.append((site as ActivitySite).get_interaction_position())
|
||||
|
||||
for resource in resource_root.get_children():
|
||||
destinations.append((resource as ResourceNode).interaction_point.global_position)
|
||||
@@ -96,9 +95,14 @@ func _run() -> void:
|
||||
storage_target.get("target_id", "") == String(SimulationIds.STORAGE_VILLAGE_PANTRY),
|
||||
"Runtime adapter should route storage actions to village_pantry"
|
||||
)
|
||||
var study_target := adapter.get_activity_target(SimulationIds.ACTION_STUDY)
|
||||
_check(
|
||||
study_target.get("target_id", "") == "study_desk",
|
||||
"Runtime adapter should route study to the typed study desk"
|
||||
)
|
||||
|
||||
if failures.is_empty():
|
||||
print("[TEST] Jajce runtime passed: 6 NPCs, 4 resources, typed pantry route")
|
||||
print("[TEST] Jajce runtime passed: 6 NPCs, typed storage and activity sites")
|
||||
quit(0)
|
||||
return
|
||||
|
||||
|
||||
@@ -127,6 +127,19 @@ func _run() -> void:
|
||||
not world.has_node("LegacyActivityMarkers/PantryMarker"),
|
||||
"Pantry should no longer be a legacy activity marker"
|
||||
)
|
||||
_check(
|
||||
not world.has_node("LegacyActivityMarkers"),
|
||||
"JajceWorld should no longer expose legacy activity markers"
|
||||
)
|
||||
var activity_root := world.get_node("WorldObjects/ActivitySites")
|
||||
var activity_ids: Array[String] = []
|
||||
for site in activity_root.get_children():
|
||||
activity_ids.append(String((site as ActivitySite).site_id))
|
||||
activity_ids.sort()
|
||||
_check(
|
||||
activity_ids == ["guard_post", "rest_bench", "study_desk"],
|
||||
"Jajce activity sites should preserve stable semantic IDs"
|
||||
)
|
||||
|
||||
var navigation_region := world.get_node("NavigationRegion3D") as NavigationRegion3D
|
||||
var navigation_map: RID = NavigationServer3D.region_get_map(navigation_region.get_rid())
|
||||
@@ -143,8 +156,8 @@ func _run() -> void:
|
||||
for resource in resources:
|
||||
destinations.append((resource as ResourceNode).interaction_point.global_position)
|
||||
destinations.append(pantry.get_interaction_position())
|
||||
for marker in world.get_node("LegacyActivityMarkers").get_children():
|
||||
destinations.append((marker as Marker3D).global_position)
|
||||
for site in activity_root.get_children():
|
||||
destinations.append((site as ActivitySite).get_interaction_position())
|
||||
|
||||
for origin in origins:
|
||||
for destination in destinations:
|
||||
@@ -187,10 +200,15 @@ func _run() -> void:
|
||||
storage_target_position.distance_to(pantry.get_interaction_position()) < 0.01,
|
||||
"Storage actions should use the pantry StorageNode interaction point"
|
||||
)
|
||||
var rest_target := adapter.get_activity_target(SimulationIds.ACTION_REST)
|
||||
_check(
|
||||
rest_target.get("target_id", "") == "rest_bench",
|
||||
"Rest should target the typed RestBench ActivitySite"
|
||||
)
|
||||
|
||||
if failures.is_empty():
|
||||
print(
|
||||
"[TEST] Jajce scaffold passed: Terrain3D, storage site, shader water, building blockouts"
|
||||
"[TEST] Jajce scaffold passed: Terrain3D, storage/activity sites, shader water"
|
||||
)
|
||||
quit(0)
|
||||
return
|
||||
|
||||
@@ -68,6 +68,14 @@ func _run() -> void:
|
||||
pantry_state.get_amount(SimulationIds.RESOURCE_FOOD) < pantry_food_before,
|
||||
"Player should eat from the typed pantry StorageNode"
|
||||
)
|
||||
var guard_site := main_scene.get_node("JajceWorld/WorldObjects/ActivitySites/GuardPost") as ActivitySite
|
||||
player.global_position = guard_site.get_interaction_position()
|
||||
var safety_before: float = simulation_manager.village.safety
|
||||
player.try_interact()
|
||||
_check(
|
||||
simulation_manager.village.safety > safety_before,
|
||||
"Player should help guard from the typed GuardPost ActivitySite"
|
||||
)
|
||||
|
||||
if failures.is_empty():
|
||||
print("[TEST] ResourceNode player parity passed")
|
||||
|
||||
Reference in New Issue
Block a user