Refactored unit
This commit is contained in:
@@ -45,7 +45,7 @@ func _ready() -> void:
|
||||
func _on_mouse_grid_changed(coords: Vector2i) -> void:
|
||||
combat_map.target_tile(coords)
|
||||
|
||||
func _on_combat_requested(attacker: Unit, defender: Unit) -> void:
|
||||
func _on_combat_requested(attacker: DeployedUnit, defender: DeployedUnit) -> void:
|
||||
var atk_coords := combat_map.world_to_coords(attacker.position)
|
||||
var def_coords := combat_map.world_to_coords(defender.position)
|
||||
var distance := absi(atk_coords.x - def_coords.x) + absi(atk_coords.y - def_coords.y)
|
||||
|
||||
Reference in New Issue
Block a user