feat: add ranged combat targeting

This commit is contained in:
goose
2026-10-03 01:47:41 -04:00
parent 910c24f66f
commit 46b2c8a6ff
16 changed files with 551 additions and 2 deletions
+5
View File
@@ -135,6 +135,8 @@ static func _actor_to_dict(actor: ActorState) -> Dictionary:
"ai": String(actor.ai_behavior),
"vision_range": actor.vision_range,
"range": actor.attack_range,
"ranged_weapon": actor.ranged_weapon.duplicate(true),
"ammunition": actor.ammunition,
"wounds": actor.wounds.to_dictionary(),
}
@@ -148,6 +150,9 @@ static func _actor_from_dict(data: Dictionary) -> ActorState:
data
)
actor.hit_points = int(data.get("hit_points", actor.max_hit_points))
var ranged_weapon: Dictionary = data.get("ranged_weapon", {})
if not ranged_weapon.is_empty():
actor.equip_ranged_weapon(ranged_weapon, int(data.get("ammunition", 0)))
actor.wounds = LimbWounds.from_dictionary(data.get("wounds", {}))
return actor