Skeleton.cs 979 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. namespace RPG_Fight_Test.Assets.Scripts.Creatures {
  5. public class Skeleton : Creature {
  6. private void Start() {
  7. Dex = Random.Range(0, 20);
  8. }
  9. public void DecideActions(List<Creature> combatants) {
  10. List<Creature> closeEnemies = EnemiesInSquareNextToCreature(this, combatants);
  11. Debug.Log("Number of close enemies " + closeEnemies.Count);
  12. if (closeEnemies.Count > 0) {
  13. if (!HasFirstAction()) {
  14. SetFirstAction(new AttackAction(closeEnemies[0]));
  15. } else {
  16. SetSecondAction(new AttackAction(closeEnemies[0]));
  17. }
  18. } else {
  19. /*if (shouldMove())
  20. {
  21. setFirstAction(new MoveAction());
  22. }*/
  23. }
  24. }
  25. public void ShowInfo() {
  26. }
  27. }
  28. }