Opponent.gd 259 B

12345678910111213141516
  1. extends "Combatant.gd"
  2. func set_active(value):
  3. .set_active(value)
  4. if not active:
  5. return
  6. $Timer.start()
  7. yield($Timer, "timeout")
  8. var target
  9. for actor in get_parent().get_children():
  10. if not actor == self:
  11. target = actor
  12. break
  13. attack(target)