Пример #1
0
    IEnumerator PerformAction(Battler user, ActionType ActionType, Action action, int actionIndex, Battler target, IList<Battler> allCharacters, IList<Battler> allEnemies)
    {
        switch (ActionType)
        {
            case ActionType.Attack:
                yield return user.BattleBehavior.StandardAttack(user, target);
                break;

            case ActionType.Special:
                action.UseSP(user);
                yield return action.Run(user, target, allCharacters, allEnemies, this);
                break;

            case ActionType.Item:
                user.Inventory[actionIndex].RemoveFromInventory(user);
                user.Inventory[actionIndex].Use(user, target);
                break;

            case ActionType.Defend:
                Shield shield = Shields[user.BattlerIndex];
                user.BattleBehavior.Defending = true;
                shield.StartCoroutine(shield.Enter());
                break;
        }
    }