public void SetupAction(System.Action <AIAbility> callback) { var usableAbilities = new List <AIAbility>(abilities); usableAbilities.RemoveAll(a => !a.CanUse()); activeAbility = usableAbilities[Random.Range(0, usableAbilities.Count)]; activeAbility.Prepare(() => callback(activeAbility)); }
public AIAbility Create(CombatController controller) { AIAbility ability = DesertContext.StrangeNew <AIAbility>(); ability.abilityName = abilityName; ability.abilityDescription = abilityDescription; ability.targetPicker = targetPicker.Create(controller.character); ability.activator = activator.Create(controller); ability.cooldown = cooldown; ability.controller = controller; ability.animation = animation.Create(controller.character); ability.displayMessage = displayMessage; ability.restrictions = restrictions.ConvertAll(r => r.Create(controller.character)); ability.labels = labels; ability.SetInitiativeModifiation(initiativeMod); return(ability); }
private void RespondToAbility(AIAbility ability) { view.SetAbility(ability.abilityName, ability.abilityDescription); }
public void AddAbility(AIAbility ability) { abilities.Add(ability); }
float AttackAI(AIAbility ab) { return(ab.health -= 15.0f); }