2021-02-07 18:53:12 -08:00
|
|
|
using System;
|
2021-02-16 19:10:46 -08:00
|
|
|
using UnityEngine;
|
|
|
|
using Random = System.Random;
|
2021-02-07 18:53:12 -08:00
|
|
|
|
|
|
|
public class EnemyAi
|
|
|
|
{
|
2021-02-16 19:10:46 -08:00
|
|
|
public Action attackCallback;
|
|
|
|
public Action defendCallback;
|
|
|
|
public Action counterCallback;
|
|
|
|
|
|
|
|
private Random rng;
|
|
|
|
|
|
|
|
public EnemyAi()
|
|
|
|
{
|
|
|
|
rng = new Random(1337);
|
|
|
|
}
|
2021-02-07 18:53:12 -08:00
|
|
|
|
2021-02-16 19:10:46 -08:00
|
|
|
// TODO: will need more information, not sure what info should be exposed.
|
2021-02-07 18:53:12 -08:00
|
|
|
public void TakeTurn()
|
|
|
|
{
|
2021-02-16 19:10:46 -08:00
|
|
|
var number = rng.Next(1, 4);
|
|
|
|
Debug.Log($"enemy rolled {number}");
|
|
|
|
switch (number)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
attackCallback();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
defendCallback();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
counterCallback();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Debug.LogWarning($"Enemy rolled something that it can't do {number}");
|
|
|
|
break;
|
|
|
|
}
|
2021-02-07 18:53:12 -08:00
|
|
|
}
|
|
|
|
}
|