feat: route resources through typed content

This commit is contained in:
Rijad Zuzo
2026-08-12 20:51:01 +02:00
parent 4e4ae1a969
commit dc0f59fcf0
31 changed files with 1071 additions and 10 deletions
+10
View File
@@ -8,6 +8,8 @@ const VALID_CATEGORIES := [CATEGORY_RESOURCE, CATEGORY_WEAPON]
@export var item_id: StringName
@export var display_name: String
@export var category: StringName = CATEGORY_RESOURCE
@export var capability_tag_ids: Array[StringName] = []
@export var presentation_cue_id: StringName
@export var equip_slot: StringName
@export_range(0.0, 1000.0, 0.1) var damage := 0.0
@export_range(0.0, 50.0, 0.1) var reach := 0.0
@@ -35,6 +37,14 @@ func validate() -> Array[String]:
errors.append("attack_cooldown must be positive for '%s'" % item_id)
elif not equip_slot.is_empty():
errors.append("resource item '%s' cannot declare equip_slot '%s'" % [item_id, equip_slot])
var seen_tags := {}
for tag_id in capability_tag_ids:
if tag_id.is_empty():
errors.append("capability tag ID is empty for '%s'" % item_id)
elif seen_tags.has(tag_id):
errors.append("duplicate capability tag '%s' for '%s'" % [tag_id, item_id])
else:
seen_tags[tag_id] = true
return errors