feat: spawn enemies from reusable definitions

This commit is contained in:
Rijad Zuzo
2026-08-12 20:34:55 +02:00
parent 41b37a4962
commit 809e7c008d
12 changed files with 332 additions and 57 deletions
+6 -1
View File
@@ -51,7 +51,7 @@ func _test_core_pack() -> void:
"Core items should include food, wood, sword, and claw in stable-ID order"
)
_check(
_enemy_ids(catalog.get_enemies()) == [&"enemy_raider", &"enemy_wolf"],
_enemy_ids(catalog.get_enemies()) == [&"enemy_boar", &"enemy_raider", &"enemy_wolf"],
"Core enemies should enumerate by stable ID"
)
var food := catalog.get_item(SimulationIds.RESOURCE_FOOD)
@@ -69,10 +69,15 @@ func _test_core_pack() -> void:
"Claw should preserve its weapon contract"
)
var wolf := catalog.get_enemy(&"enemy_wolf")
var boar := catalog.get_enemy(&"enemy_boar")
_check(
wolf != null and wolf.weapon_id == SimulationIds.ITEM_CLAW,
"Enemy references should resolve against catalog items"
)
_check(
boar != null and boar.behavior_profile_id == wolf.behavior_profile_id,
"New enemy types should be able to reuse an existing behavior profile"
)
func _test_deterministic_enumeration_and_dependencies() -> void: