コード例 #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);
    }
コード例 #2
0
    //Public Methods
    public void RunAction(object delegateForCastSpell)
    {
        Character.Deleg_SpellCasted onCharacterCastSpell = delegateForCastSpell as Character.Deleg_SpellCasted;

        DivineDebug.Log("Consumed Action Point:" + consumedActionPoint);
        DivineDebug.Log("spellEffectInfoCount: " + spellInfo.spellEffectInfos.Count);

        fightOwner.CastSpell(spellInfo, consumedActionPoint);

        if (onCharacterCastSpell != null)
        {
            fightOwner.Event_SpellCast += onCharacterCastSpell;
        }
    }