Exemple #1
0
        private void OnClickPlay()
        {
            _soundManager.PlaySound(Enumerators.SoundType.CLICK, Constants.SfxSoundVolume, false, false, true);
            if (GameClient.Get <IDataManager>().CachedUserLocalData.Tutorial)
            {
                _uiManager.GetPage <GameplayPage>().CurrentDeckId = 0;

                GameClient.Get <IMatchManager>().FindMatch(Enumerators.MatchType.LOCAL);
            }
            else
            {
                _stateManager.ChangeAppState(Enumerators.AppState.DECK_SELECTION);
            }
        }
        public void StartCardDistribution()
        {
            CardDistribution = true;

            GameClient.Get <ICameraManager>().FadeIn(0.8f, 0, false);

            if (_gameplayManager.IsTutorial || _gameplayManager.IsSpecificGameplayBattleground)
            {
                EndCardDistribution();
            }
            else
            {
                _uiManager.GetPage <GameplayPage>().KeepButtonVisibility(true);
            }
        }
        private void DesintegrateButtonHandler()
        {
            GameClient.Get <ISoundManager>()
            .PlaySound(Enumerators.SoundType.CLICK, Constants.SfxSoundVolume, false, false, true);
            _cardData.Amount--;
            if (_cardData.Amount == 0)
            {
                _yesButton.interactable = false;
            }

            _cardPreview.GetComponent <BoardCard>().UpdateAmount(_cardData.Amount);

            Card libraryCard = GameClient.Get <IDataManager>().CachedCardsLibraryData.Cards
                               .Find(card => card.Name == _cardData.CardName);

            GameClient.Get <IPlayerManager>().ChangeGoo(5 * ((int)libraryCard.CardRank + 1));

            _uiManager.GetPage <CollectionPage>().UpdateGooValue();
        }
Exemple #4
0
        public void InitializeSkills()
        {
            GameplayPage rootPage = _uiManager.GetPage <GameplayPage>();

            rootPage.PlayerPrimarySkillHandler.MouseDownTriggered += PrimarySkillHandlerMouseDownTriggeredHandler;
            rootPage.PlayerPrimarySkillHandler.MouseUpTriggered   += PrimarySkillHandlerMouseUpTriggeredHandler;

            rootPage.PlayerSecondarySkillHandler.MouseDownTriggered += SecondarySkillHandlerMouseDownTriggeredHandler;
            rootPage.PlayerSecondarySkillHandler.MouseUpTriggered   += SecondarySkillHandlerMouseUpTriggeredHandler;
            rootPage.OpponentPrimarySkillHandler.MouseDownTriggered +=
                OpponentPrimarySkillHandlerMouseDownTriggeredHandler;
            rootPage.OpponentPrimarySkillHandler.MouseUpTriggered += OpponentPrimarySkillHandlerMouseUpTriggeredHandler;

            rootPage.OpponentSecondarySkillHandler.MouseDownTriggered +=
                OpponentSecondarySkillHandlerMouseDownTriggeredHandler;
            rootPage.OpponentSecondarySkillHandler.MouseUpTriggered +=
                OpponentSecondarySkillHandlerMouseUpTriggeredHandler;

            int primary   = _gameplayManager.CurrentPlayer.SelfHero.PrimarySkill;
            int secondary = _gameplayManager.CurrentPlayer.SelfHero.SecondarySkill;

            if (primary < _gameplayManager.CurrentPlayer.SelfHero.Skills.Count &&
                secondary < _gameplayManager.CurrentPlayer.SelfHero.Skills.Count)
            {
                SetPlayerSkills(rootPage, _gameplayManager.CurrentPlayer.SelfHero.Skills[primary],
                                _gameplayManager.CurrentPlayer.SelfHero.Skills[secondary]);
            }

            primary   = _gameplayManager.OpponentPlayer.SelfHero.PrimarySkill;
            secondary = _gameplayManager.OpponentPlayer.SelfHero.SecondarySkill;

            if (primary < _gameplayManager.OpponentPlayer.SelfHero.Skills.Count &&
                secondary < _gameplayManager.OpponentPlayer.SelfHero.Skills.Count)
            {
                SetOpponentSkills(rootPage, _gameplayManager.OpponentPlayer.SelfHero.Skills[primary],
                                  _gameplayManager.OpponentPlayer.SelfHero.Skills[secondary]);
            }

            _skillsInitialized = true;
        }
 private void BattleButtonOnClickHandler()
 {
     _soundManager.PlaySound(Enumerators.SoundType.CLICK, Constants.SfxSoundVolume, false, false, true);
     _uiManager.GetPage <GameplayPage>().CurrentDeckId = _selectedDeckId;
     _matchManager.FindMatch(Enumerators.MatchType.LOCAL);
 }
Exemple #6
0
        public void StartTurn()
        {
            if (_gameplayManager.IsGameEnded)
            {
                return;
            }

            CurrentTurn++;

            _gameplayManager.CurrentTurnPlayer.Turn++;

            if (_dataManager.CachedUserLocalData.Tutorial && !_tutorialManager.IsTutorial)
            {
                Debug.Log("_dataManager.CachedUserLocalData.Tutorial = " + _dataManager.CachedUserLocalData.Tutorial);
                Debug.Log("_tutorialManager.IsTutorial = " + _tutorialManager.IsTutorial);
                _tutorialManager.StartTutorial();
            }

            _uiManager.GetPage <GameplayPage>().SetEndTurnButtonStatus(_gameplayManager.IsLocalPlayerTurn());

            UpdatePositionOfCardsInOpponentHand();
            _playerController.IsActive = _gameplayManager.IsLocalPlayerTurn();

            if (_gameplayManager.IsLocalPlayerTurn())
            {
                List <BoardUnit> creatures = new List <BoardUnit>();

                foreach (BoardUnit card in PlayerBoardCards)
                {
                    if (_playerController == null || !card.GameObject)
                    {
                        creatures.Add(card);
                        continue;
                    }

                    card.OnStartTurn();
                }

                foreach (BoardUnit item in creatures)
                {
                    PlayerBoardCards.Remove(item);
                }

                creatures.Clear();

                foreach (BoardUnit card in PlayerBoardCards)
                {
                    card.SetHighlightingEnabled(true);
                }
            }
            else
            {
                foreach (BoardUnit card in OpponentBoardCards)
                {
                    card.OnStartTurn();
                }

                foreach (BoardCard card in PlayerHandCards)
                {
                    card.SetHighlightingEnabled(false);
                }

                foreach (BoardUnit card in PlayerBoardCards)
                {
                    card.SetHighlightingEnabled(false);
                }
            }

            _gameplayManager.CurrentPlayer.InvokeTurnStarted();
            _gameplayManager.OpponentPlayer.InvokeTurnStarted();

            _playerController.UpdateHandCardsHighlight();

            _tutorialManager.ReportAction(Enumerators.TutorialReportAction.START_TURN);

            TurnStarted?.Invoke();
        }
 private void AbilityPopupClosedEvent()
 {
     _uiManager.GetPopup <OverlordAbilitySelectionPopup>().PopupHiding -= AbilityPopupClosedEvent;
     _uiManager.GetPage <DeckEditingPage>().CurrentHeroId = _currentOverlordObject.SelfHero.HeroId;
     _appStateManager.ChangeAppState(Enumerators.AppState.DECK_EDITING);
 }