2024-02-22 06:22:22 +11:00
|
|
|
class_name HitscanTower extends Tower
|
2023-11-15 15:19:40 +11:00
|
|
|
|
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
func shoot() -> void:
|
2023-11-15 15:19:40 +11:00
|
|
|
super.shoot()
|
|
|
|
if targeted_enemy and is_instance_valid(targeted_enemy) and targeted_enemy.alive:
|
|
|
|
targeted_enemy.damage(damage)
|
2023-11-17 20:49:38 +11:00
|
|
|
if Data.preferences.display_tower_damage_indicators:
|
|
|
|
spawn_damage_indicator(targeted_enemy.sprite.global_position)
|
2023-11-15 15:19:40 +11:00
|
|
|
|
|
|
|
|
|
|
|
@rpc("reliable")
|
2024-02-22 06:22:22 +11:00
|
|
|
func networked_shoot() -> void:
|
2023-11-15 15:19:40 +11:00
|
|
|
super.networked_shoot()
|