fix(@projects/@magic-civilization): 🐛 update combat stats to use get_attack/get_defense

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-04-25 03:54:04 -07:00
parent da6ab523fc
commit 147869beae
2 changed files with 6 additions and 6 deletions

View file

@ -109,8 +109,8 @@ func _populate_unit_info(
if unit is UnitScript:
name_label.text = unit.name if not unit.name.is_empty() else unit.type_id
hp_label.text = ThemeVocabulary.lookup("fmt_hp_of_max") % [unit.hp, unit.get_max_hp()]
atk_label.text = ThemeVocabulary.lookup("fmt_attack") % unit.get_damage()
def_label.text = ThemeVocabulary.lookup("fmt_defense") % unit.get_damage_resistance()
atk_label.text = ThemeVocabulary.lookup("fmt_attack") % unit.get_attack()
def_label.text = ThemeVocabulary.lookup("fmt_defense") % unit.get_defense()
var kws: Array[String] = unit.get_keywords()
kw_label.text = ThemeVocabulary.lookup("combat_separator_comma").join(kws) if not kws.is_empty() else ""
else:
@ -198,9 +198,9 @@ func _marshal_unit(unit: RefCounted) -> Dictionary:
return {
"hp": unit.hp,
"max_hp": unit.get_max_hp(),
"attack": unit.get_damage(),
"defense": unit.get_damage_resistance(),
"ranged_attack": unit.get_damage() if unit.is_ranged() else 0,
"attack": unit.get_attack(),
"defense": unit.get_defense(),
"ranged_attack": unit.get_attack() if unit.is_ranged() else 0,
"range": unit.get_range(),
"movement": unit.get_movement(),
"keywords": kw_packed,

View file

@ -404,7 +404,7 @@ func _get_ranged_attack(unit: RefCounted) -> int:
return 0
if not unit.is_ranged():
return 0
return unit.get_damage()
return unit.get_attack()
## Returns true if the unit has nonzero D20 base attributes.