feat: port tactical enemy AI

This commit is contained in:
goose
2026-10-03 01:22:20 -04:00
parent 1e1f43bc46
commit ee9dc65184
13 changed files with 301 additions and 17 deletions
+9
View File
@@ -26,6 +26,12 @@ var xp_reward := 0
var xp := 0
var loot_table: StringName = &""
var perception := 0
# Tactical data is copied from the ASCII enemy definition at spawn/load time.
var ai_behavior: StringName = &"legacy"
# Legacy/demo fixtures did not carry a catalog definition; keep their previous
# global-chase behavior while catalog-backed enemies overwrite this value.
var vision_range := 99
var attack_range := 1
var wounds: LimbWounds
func _init(new_id: StringName, new_cell: Vector2i, new_hit_points: int, new_attack_damage: int, new_content_id: StringName = &"", combat_data: Dictionary = {}) -> void:
@@ -49,6 +55,9 @@ func _init(new_id: StringName, new_cell: Vector2i, new_hit_points: int, new_atta
xp = int(combat_data.get("xp", xp))
loot_table = StringName(combat_data.get("loot_table", loot_table))
perception = int(combat_data.get("perception", combat_data.get("per", perception)))
ai_behavior = StringName(combat_data.get("ai", combat_data.get("ai_behavior", ai_behavior)))
vision_range = int(combat_data.get("vision_range", vision_range))
attack_range = int(combat_data.get("range", combat_data.get("attack_range", attack_range)))
wounds = LimbWoundsType.new()
func is_alive() -> bool: