예제 #1
0
    private bool RunNextAction_IfWeHaveAny()
    {
        if (_actionData.Count == 0)
        {
            DivineDebug.Log("No action data to run.");

            return(false);
        }

        _numOfKilledCharacterInThisAct = 0;
        _apGeneratedInThisTurn         = false;

        _curState = BattleLogicStates.TurnLoop_DoingFightActions;

        DivineDebug.Log("Run action number " + _indexOfCurrentAction + " .");

        ActionData ad = _actionData[0];

        if ((ad as FightActionData) != null)
        {
            Character.Deleg_SpellCasted onCharacterCastSpell = OnCharacterCastSpell;
            ad.RunAction(onCharacterCastSpell);
        }
        else if ((ad as SecretActionData) != null)
        {
            ad.RunAction(null);
        }

        _actionData.Remove(ad);
        _indexOfCurrentAction++;

        return(true);
    }