RiftMayhem/Assets/Scripts/NPC/NPCControllers_v2/NPCAbilityPriorityManager.cs
Pedro Gomes e1081a2bf4 Necromancer and Minions update
- Necromancer class playable
- Savage minion ability & npc
- Mage minion ability & npc
- rogue minion ability & npc
- warrior minion ability & npc
- golem minion ability & npc
- minion abilities
- Class resource (used to automatically summon minions based on the amount of souls drained, in case of necromancer)
- class resource spender (auto cast from priority list)
- class resource regen instant effect option
2024-07-22 16:46:13 +01:00

27 lines
688 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NPCAbilityPriorityManager : MonoBehaviour
{
public List<NPCAbilityConditionManager> abilityPriorityList = new List<NPCAbilityConditionManager>();
NPCControllerBase npcController;
private void Awake()
{
npcController = GetComponentInParent<NPCControllerBase>();
}
public BaseAbility GetHighestPriorityAvailableAbility()
{
for (int i = 0; i < abilityPriorityList.Count; i++)
{
if (abilityPriorityList[i].CanCastAbility(npcController))
return abilityPriorityList[i].ability;
}
return null;
}
}