Combat tactics

This commit is contained in:
gamer147
2026-04-04 12:27:35 -04:00
parent 595e389033
commit 68d1406632
22 changed files with 1094 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ enum UnitState { ALIVE, DEAD }
@export var stat_template: UnitStats
@export var info_template: UnitInfo
@export var allegiance_template: UnitAllegiance
@export var tactics: Array[CombatTactic] = []
#endregion
var current_stats: UnitStats
@@ -21,8 +22,20 @@ func _ready() -> void:
current_stats = stat_template.duplicate(true)
current_info = info_template.duplicate(true)
current_allegiance = allegiance_template.duplicate(true)
_append_builtin_tactics()
unit_allegiance_changed.emit(self, current_allegiance)
func _append_builtin_tactics() -> void:
var attack := AttackCombatTactic.new()
attack.tactic_name = "Attack"
attack.tactic_range = UnitMatchingCombatTacticRange.new()
tactics.append(attack)
var defend := DefendCombatTactic.new()
defend.tactic_name = "Defend"
defend.tactic_range = AnyCombatTacticRange.new()
tactics.append(defend)
func set_selected(selected: bool) -> void:
unit_selected_changed.emit(self, selected)