示例#1
0
    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));
    }
示例#2
0
    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);
    }
示例#3
0
 private void RespondToAbility(AIAbility ability)
 {
     view.SetAbility(ability.abilityName, ability.abilityDescription);
 }
示例#4
0
 public void AddAbility(AIAbility ability)
 {
     abilities.Add(ability);
 }
示例#5
0
 float AttackAI(AIAbility ab)
 {
     return(ab.health -= 15.0f);
 }