pulled out target selection to its own node

This commit is contained in:
2024-04-01 17:08:47 +11:00
parent 05914a3c64
commit 16951a9beb
11 changed files with 117 additions and 112 deletions

View File

@@ -5,9 +5,9 @@ class_name StatusApplyingTower extends HitscanTower
func shoot() -> void:
super.shoot()
if targeted_enemy and is_instance_valid(targeted_enemy) and targeted_enemy.alive:
targeted_enemy.damage(damage)
targeted_enemy.status_manager.add_effect(build_status_object())
if target_finder.get_target():
target_finder.get_target().damage(damage)
target_finder.get_target().status_manager.add_effect(build_status_object())
func build_status_object() -> StatusEffect: