Beispiel #1
0
 public void SetOpponentSkills(GameplayPage rootPage, HeroSkill primary, HeroSkill secondary)
 {
     OpponentPrimarySkill = new BoardSkill(rootPage.OpponentPrimarySkillHandler.gameObject,
                                           _gameplayManager.OpponentPlayer, primary, true);
     OpponentSecondarySkill = new BoardSkill(rootPage.OpponentSecondarySkillHandler.gameObject,
                                             _gameplayManager.OpponentPlayer, secondary, false);
 }
Beispiel #2
0
 public void SetPlayerSkills(GameplayPage rootPage, HeroSkill primary, HeroSkill secondary)
 {
     _playerPrimarySkill = new BoardSkill(rootPage.PlayerPrimarySkillHandler.gameObject,
                                          _gameplayManager.CurrentPlayer, primary, true);
     _playerSecondarySkill = new BoardSkill(rootPage.PlayerSecondarySkillHandler.gameObject,
                                            _gameplayManager.CurrentPlayer, secondary, false);
 }
Beispiel #3
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;
        }