Exemple #1
0
        public virtual void Update(float elapseSeconds, float realElapseSecondes)
        {
            if (_mPlayerLogic != null && _mPlayerLogic.IsDead)
            {
                GameOver = true;
                return;
            }

            if (_enemyLogics.Count <= 0)
            {
                Victory = true;
                return;
            }

            foreach (var sys in _system)
            {
                sys.Update(elapseSeconds, realElapseSecondes);
            }

            if (_prepareCharacter == 4 && _prepareUI)
            {
                _enemyLogics.Sort((en0, en1) => en1.Id - en0.Id);
                foreach (var sys in _system)
                {
                    sys.SetUI(m_GameForm);
                    sys.enemys.AddRange(_enemyLogics);
                }

                _handPresentationSystem.cardSelectionSystem = _cardSelectionSystem;

                _deckDrawingSystem.LoadDeck(staringDeck);
                _deckDrawingSystem.ShuffleDeck();

                gameTurn = GameTurn.PlayerTurnBegan;

                _prepareUI        = false;
                _prepareCharacter = 0;
            }

            switch (gameTurn)
            {
            case GameTurn.None:
                break;

            case GameTurn.PlayerTurnBegan:
                foreach (var enemyLogic in _enemyLogics)
                {
                    enemyLogic.complateReset = true;
                    enemyLogic.prepareAttack = false;
                }
                m_GameForm.OnPlayerTurnBegan();
                GameEntry.Event.FireNow(this, DrawnCardEventArgs.Create(5));
                gameTurn = GameTurn.PlayerTurnUpdate;
                break;

            case GameTurn.PlayerTurnEnd:
                _deckDrawingSystem.MoveCardToDiscardPile();
                _handPresentationSystem.MoveHandToDiscardPile();
                gameTurn         = GameTurn.EnemyTurnBegan;
                actionEnemyIndex = 0;
                EnemyAction(actionEnemyIndex);
                break;

            case GameTurn.EnemyTurnBegan:
                if (_enemyLogics[actionEnemyIndex].enemyFsm.CurrentState.GetType() == typeof(EnemyResetState))
                {
                    actionEnemyIndex++;
                    if (actionEnemyIndex >= _enemyLogics.Count)
                    {
                        gameTurn = GameTurn.EnemyTurnEnd;
                        return;
                    }
                    EnemyAction(actionEnemyIndex);
                }
                break;

            case GameTurn.EnemyTurnEnd:
                gameTurn = GameTurn.PlayerTurnBegan;
                break;
            }
        }
Exemple #2
0
 public override void Resolve(TargetableObject instigator, TargetableObject target)
 {
     GameEntry.Event.FireNow(this, DrawnCardEventArgs.Create(Value));
 }