diff --git a/src/classes/Unit.gd b/src/classes/Unit.gd index e13a175..95cb90e 100644 --- a/src/classes/Unit.gd +++ b/src/classes/Unit.gd @@ -6,6 +6,7 @@ export var unit_type : String export var max_health : int = 10 export var health : int = 10 export var movement_distance : int = 10 +export var attack_limit : int = 20 export var height : int = 0 export var water_walk : bool = false export var air_walk : bool = false @@ -26,7 +27,7 @@ onready var Grid = get_node("../Grid") func start_turn(): - attack_points = 0 + attack_points = attack_limit movement_points = movement_distance _has_sent_turn_completed = false @@ -105,8 +106,6 @@ func _physics_process(delta: float) -> void: position.x = move_toward(position.x, _target_position.x, 800 * delta) position.y = move_toward(position.y, _target_position.y, 800 * delta) - attack_points = false - if attack_points == 0 && movement_points == 0 && not _has_sent_turn_completed: emit_signal("turn_completed") _has_sent_turn_completed = true