fx: readded merged function

This commit is contained in:
2026-03-01 15:59:49 +01:00
parent 241dfb3073
commit a11805ad30
3 changed files with 11 additions and 10 deletions

View File

@@ -16,6 +16,10 @@ func move(motion: Vector3, mod: float) -> void:
# Apply boundary to new position
position = GameManager.get_boundaried_position(position)
func handle_damage(dmg: int, src: Node) -> void:
if owner:
owner.handle_damage(dmg, src)
func duplicate_init() -> void:
var sight = $Sight
remove_child(sight)

View File

@@ -15,7 +15,7 @@ var can_attack: bool = true
func _ready() -> void:
health = maxHealth
sprite.play("Healthy")
sprite.play("Healthy") # TODO: add play_sprite function which calls both sprite and wrapper
wrapper.play_sprite("Healthy")
if starting_pos:
collision.set_position(starting_pos)
@@ -42,9 +42,6 @@ func attack(target: Node) -> void:
if target.has_method("handle_damage"):
target.handle_damage(damage, self.collision)
hit_hittable = true
elif target.is_in_group("resources"):
# TODO: resource handling logic
pass
if hit_hittable:
attack_cooldown_timer.start()