mtd/Scripts/Towers/hitscan_tower.gd

15 lines
388 B
GDScript3
Raw Permalink Normal View History

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