mtd/Scripts/Towers/status_applying_tower.gd

22 lines
524 B
GDScript3
Raw Permalink Normal View History

2024-02-22 06:22:22 +11:00
class_name StatusApplyingTower extends HitscanTower
2023-11-16 00:07:41 +11:00
2024-02-22 06:22:22 +11:00
@export var status_stats: StatusStats
2023-11-16 00:07:41 +11:00
2024-02-22 06:22:22 +11:00
func shoot() -> void:
2023-11-16 00:07:41 +11:00
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())
func build_status_object() -> StatusEffect:
2024-02-22 06:22:22 +11:00
var status: StatusEffect = StatusEffect.new()
2023-11-16 00:07:41 +11:00
status.stats = status_stats
return status
@rpc("reliable")
2024-02-22 06:22:22 +11:00
func networked_shoot() -> void:
2023-11-16 00:07:41 +11:00
super.networked_shoot()