示例#1
0
    public void SetTurnState(STATETURN _curStateTurn)
    {
        OnLeavingState(curStateTurn);

        curStateTurn = _curStateTurn;

        switch (curStateTurn)
        {
        case STATETURN.RECHARGE:

            ContSkillEngine.Get().AddExec(new ExecTurnRecharge(_chrSource: null));

            break;

        case STATETURN.READY:

            ContSkillEngine.Get().AddExec(new ExecTurnReady(_chrSource: null));

            break;

        case STATETURN.REDUCECOOLDOWNS:

            ContSkillEngine.Get().AddExec(new ExecTurnReduceCooldowns(_chrSource: null));

            break;

        case STATETURN.GIVEMANA:

            ContSkillEngine.Get().AddExec(new ExecTurnGiveMana(_chrSource: null));

            break;


        case STATETURN.TURNSTART:

            ContSkillEngine.Get().AddExec(new ExecTurnStartTurn(_chrSource: null));

            break;

        case STATETURN.CHOOSESKILL:

            ContSkillEngine.Get().AddExec(new ExecTurnChooseSkills(_chrSource: null));

            break;

        case STATETURN.TURNEND:

            ContSkillEngine.Get().AddExec(new ExecTurnEndTurn(_chrSource: null));

            break;
        }
    }
示例#2
0
    public STATETURN GetNextPhase(STATETURN turnphase)
    {
        //Loop around to the recharge phase if we've reached the end of a turn
        if (turnphase == STATETURN.TURNEND)
        {
            return(STATETURN.RECHARGE);
        }
        else if (turnphase == STATETURN.TURNSTART)
        {
            //If we'd normally move to choosing a skill for a character, but no character is set to move this turn, then we can directly skip to the end of turn
            if (GetNextActingChr() == null)
            {
                return(STATETURN.TURNEND);
            }
            else
            {
                return(STATETURN.CHOOSESKILL);
            }
        }
        else if (turnphase == STATETURN.CHOOSESKILL)
        {
            //If we have finished choosing and executing a skill, then let's check if we want to stay in the choose-skills phase of the turn,
            // or we can move to the end of turn if no one is left to act
            if (GetNextActingChr() == null)
            {
                return(STATETURN.TURNEND);
            }
            else
            {
                return(STATETURN.CHOOSESKILL);
            }
        }

        //Generally, just move to the next sequential turn phase
        return(turnphase + 1);
    }
示例#3
0
 public void InitStartingTurnPhase()
 {
     curStateTurn = STATETURN.TURNEND;
 }