pandemonium_demo_projects/2d/role_playing_game/combat/combatants/Opponent.gd

18 lines
295 B
GDScript3
Raw Normal View History

extends Combatant
func set_active(value):
.set_active(value)
if not active:
return
if not $Timer.is_inside_tree():
return
$Timer.start()
yield($Timer, "timeout")
var target
for actor in get_parent().get_children():
if not actor == self:
target = actor
break
attack(target)