Ejemplo n.º 1
0
        IEnumerator Battle()
        {
            StartUserBattleEvent.Invoke();
            yield return(null);

            // EndUserBattleEvent.Invoke -> from UI.

            EUserGameState userBattleResult = isOver();

            if (EUserGameState.Unknown != userBattleResult)
            {
                yield break;
            }

            StartAIBattleEvent.Invoke();
            yield return(null);

            _ai.Battle();
            yield return(null);

            EndAIBattleEvent.Invoke();

            EUserGameState aiBattleResult = isOver();

            if (EUserGameState.Unknown != aiBattleResult)
            {
                yield break;
            }

            --RemainTurn;
        }
Ejemplo n.º 2
0
 // constructor
 public CombatMode()
 {
     _startEvent           = new StartEvent();
     _startUserBattleEvent = new StartUserBattleEvent();
     _endUserBattleEvent   = new EndUserBattleEvent();
     _startAIBattleEvent   = new StartAIBattleEvent();
     _endAIBattleEvent     = new EndAIBattleEvent();
     _endEvent             = new EndEvent();
     _turnChangeEvent      = new TurnChangeEvent();
     _hpChangeEvent        = new HpChangeEvent();
     _mpChangeEvent        = new MpChangeEvent();
     _criticalAttackEvent  = new CriticalAttackEvent();
     _attackEvent          = new AttackEvent();
     _criticalTrickEvent   = new CriticalTrickEvent();
     _trickEvent           = new TrickEvent();
 }