Esempio n. 1
0
        public AbilityBase(Enumerators.CardKind cardKind, AbilityData ability)
        {
            LoadObjectsManager = GameClient.Get <ILoadObjectsManager>();
            GameplayManager    = GameClient.Get <IGameplayManager>();
            DataManager        = GameClient.Get <IDataManager>();
            TimerManager       = GameClient.Get <ITimerManager>();
            SoundManager       = GameClient.Get <ISoundManager>();

            AbilitiesController    = GameplayManager.GetController <AbilitiesController>();
            ParticlesController    = GameplayManager.GetController <ParticlesController>();
            BattleController       = GameplayManager.GetController <BattleController>();
            ActionsQueueController = GameplayManager.GetController <ActionsQueueController>();
            BattlegroundController = GameplayManager.GetController <BattlegroundController>();
            CardsController        = GameplayManager.GetController <CardsController>();

            AbilityData         = ability;
            CardKind            = cardKind;
            AbilityActivityType = ability.AbilityActivityType;
            AbilityCallType     = ability.AbilityCallType;
            AbilityTargetTypes  = ability.AbilityTargetTypes;
            AbilityEffectType   = ability.AbilityEffectType;
            _playerAvatar       = GameplayManager.CurrentPlayer;
            _opponenentAvatar   = GameplayManager.OpponentPlayer;

            PermanentInputEndEvent += InputEndedHandler;

            ParticleIds = new List <ulong>();
        }
Esempio n. 2
0
        public override void Action(object info = null)
        {
            base.Action(info);

            foreach (Enumerators.AbilityTargetType target in TargetTypes)
            {
                switch (target)
                {
                case Enumerators.AbilityTargetType.OPPONENT:
                    for (int i = 0; i < Count; i++)
                    {
                        CardsController.SpawnUnitOnBoard(GetOpponentOverlord(), Name);
                    }

                    break;

                case Enumerators.AbilityTargetType.PLAYER:
                    for (int i = 0; i < Count; i++)
                    {
                        CardsController.SpawnUnitOnBoard(PlayerCallerOfAbility, Name);
                    }

                    break;

                default: continue;
                }
            }
        }
Esempio n. 3
0
        public BoardUnit(Transform parent)
        {
            _gameplayManager    = GameClient.Get <IGameplayManager>();
            _loadObjectsManager = GameClient.Get <ILoadObjectsManager>();
            _soundManager       = GameClient.Get <ISoundManager>();
            _tutorialManager    = GameClient.Get <ITutorialManager>();
            _timerManager       = GameClient.Get <ITimerManager>();

            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _playerController       = _gameplayManager.GetController <PlayerController>();
            _animationsController   = _gameplayManager.GetController <AnimationsController>();
            _battleController       = _gameplayManager.GetController <BattleController>();
            _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>();
            _vfxController          = _gameplayManager.GetController <VfxController>();
            _ranksController        = _gameplayManager.GetController <RanksController>();
            _abilitiesController    = _gameplayManager.GetController <AbilitiesController>();
            _cardsController        = _gameplayManager.GetController <CardsController>();
            _inputController        = _gameplayManager.GetController <InputController>();
            _boardArrowController   = _gameplayManager.GetController <BoardArrowController>();


            GameObject =
                Object.Instantiate(_loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/BoardCreature"));
            GameObject.transform.SetParent(parent, false);

            _fightTargetingArrowPrefab =
                _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/Arrow/AttackArrowVFX_Object");

            _pictureSprite = GameObject.transform.Find("CreaturePicture").GetComponent <SpriteRenderer>();
            _frozenSprite  = GameObject.transform.Find("Other/Frozen").GetComponent <SpriteRenderer>();
            _glowSprite    = GameObject.transform.Find("Other/Glow").GetComponent <SpriteRenderer>();
            _shieldSprite  = GameObject.transform.Find("Other/Shield").gameObject;

            _glowSelectedObjectSprite = GameObject.transform.Find("Other/GlowSelectedObject").gameObject;

            _attackText = GameObject.transform.Find("Other/AttackAndDefence/AttackText").GetComponent <TextMeshPro>();
            _healthText = GameObject.transform.Find("Other/AttackAndDefence/DefenceText").GetComponent <TextMeshPro>();

            _sleepingParticles = GameObject.transform.Find("Other/SleepingParticles").GetComponent <ParticleSystem>();

            _unitContentObject = GameObject.transform.Find("Other").gameObject;
            _unitContentObject.SetActive(false);

            _inputController.UnitSelectedEvent   += UnitSelectedEventHandler;
            _inputController.UnitDeselectedEvent += UnitDeselectedEventHandler;

            BuffsOnUnit = new List <Enumerators.BuffType>();
            AttackedBoardObjectsThisTurn = new List <object>();

            _glowSprite.gameObject.SetActive(true);
            _glowSprite.enabled = false;

            IsCreatedThisTurn = true;

            UnitStatus = Enumerators.UnitStatusType.NONE;

            IsAllAbilitiesResolvedAtStart = true;

            _gameplayManager.CanDoDragActions = false;
        }
 private void GenerateNewUnitsOnBoard()
 {
     foreach (ReplaceUnitInfo unitInfo in _replaceUnitInfos)
     {
         CardsController.SpawnUnitOnBoard(unitInfo.OwnerPlayer, unitInfo.NewUnitCardTitle);
     }
 }
Esempio n. 5
0
 public override void Action(object info = null)
 {
     base.Action(info);
     if (SetType == Enumerators.SetType.NONE || SetType != Enumerators.SetType.NONE && PlayerCallerOfAbility
         .BoardCards.FindAll(x => x.Card.LibraryCard.CardSetType == SetType && x != AbilityUnitOwner).Count > 0)
     {
         if (AbilityTargetTypes.Count > 0)
         {
             if (AbilityTargetTypes[0] == Enumerators.AbilityTargetType.PLAYER)
             {
                 CardsController.AddCardToHandFromOtherPlayerDeck(PlayerCallerOfAbility, PlayerCallerOfAbility);
             }
             else if (AbilityTargetTypes[0] == Enumerators.AbilityTargetType.OPPONENT)
             {
                 CardsController.AddCardToHandFromOtherPlayerDeck(PlayerCallerOfAbility,
                                                                  PlayerCallerOfAbility.Equals(GameplayManager.CurrentPlayer) ?
                                                                  GameplayManager.OpponentPlayer :
                                                                  GameplayManager.CurrentPlayer);
             }
         }
         else
         {
             CardsController.AddCardToHand(PlayerCallerOfAbility);
         }
     }
 }
Esempio n. 6
0
        public override void Action(object info = null)
        {
            base.Action(info);

            if (Name != "Corrupted Goo" && Name != "Tainted Goo" ||
                (Name == "Corrupted Goo" || Name == "Tainted Goo") &&
                CardOwnerOfAbility.CardSetType == PlayerCallerOfAbility.SelfHero.HeroElement)
            {
                CardsController.CreateNewCardByNameAndAddToHand(PlayerCallerOfAbility, Name);
            }
        }
Esempio n. 7
0
        public void Init()
        {
            _uiManager          = GameClient.Get <IUIManager>();
            _loadObjectsManager = GameClient.Get <ILoadObjectsManager>();
            _dataManager        = GameClient.Get <IDataManager>();
            _playerManager      = GameClient.Get <IPlayerManager>();

            _cardsController = GameClient.Get <IGameplayManager>().GetController <CardsController>();

            _createdBoardCards = new List <BoardCard>();
        }
        public void Init()
        {
            _activeAbilities = new List <ActiveAbility>();

            _gameplayManager = GameClient.Get <IGameplayManager>();
            _tutorialManager = GameClient.Get <ITutorialManager>();

            _cardsController        = _gameplayManager.GetController <CardsController>();
            _playerController       = _gameplayManager.GetController <PlayerController>();
            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>();
        }
        private void ReturnBoardUnitToHand(BoardUnit unit)
        {
            CreateVfx(unit.Transform.position, true, 3f, true);

            CardsController.ReturnCardToHand(unit);

            ActionsQueueController.PostGameActionReport(ActionsQueueController.FormatGameActionReport(
                                                            Enumerators.ActionType.RETURN_TO_HAND_CARD_ABILITY, new object[]
            {
                PlayerCallerOfAbility, AbilityData, unit
            }));
        }
Esempio n. 10
0
        public override void Action(object info = null)
        {
            base.Action(info);
            if (!PlayerCallerOfAbility.CardsInHand.Contains(MainWorkingCard))
            {
                return;
            }

            int gooCost = PlayerCallerOfAbility.CardsInHand
                          .FindAll(x => x.LibraryCard.CardSetType == SetType && x != MainWorkingCard).Count *Value;

            CardsController.SetGooCostOfCardInHand(PlayerCallerOfAbility, MainWorkingCard,
                                                   MainWorkingCard.RealCost + gooCost, BoardCard);
        }
Esempio n. 11
0
        public void Init()
        {
            _loadObjectsManager = GameClient.Get <ILoadObjectsManager>();
            _gameplayManager    = GameClient.Get <IGameplayManager>();
            _tutorialManager    = GameClient.Get <ITutorialManager>();
            _uiManager          = GameClient.Get <IUIManager>();
            _timerManager       = GameClient.Get <ITimerManager>();
            _soundManager       = GameClient.Get <ISoundManager>();

            _vfxController          = _gameplayManager.GetController <VfxController>();
            _battleController       = _gameplayManager.GetController <BattleController>();
            _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>();
            _cardsController        = _gameplayManager.GetController <CardsController>();

            _gameplayManager.GameEnded += GameplayManagerGameEnded;
        }
        public override void Action(object info = null)
        {
            base.Action(info);

            Vector3 unitPosition = TargetUnit.Transform.position;

            CreateVfx(unitPosition, true, 3f, true);

            CardsController.ReturnCardToHand(TargetUnit);

            ActionsQueueController.PostGameActionReport(ActionsQueueController.FormatGameActionReport(
                                                            Enumerators.ActionType.RETURN_TO_HAND_CARD_ABILITY, new object[]
            {
                PlayerCallerOfAbility, AbilityData, TargetUnit
            }));
        }
Esempio n. 13
0
        public BoardCard(GameObject selfObject)
        {
            LoadObjectsManager = GameClient.Get <ILoadObjectsManager>();
            SoundManager       = GameClient.Get <ISoundManager>();
            DataManager        = GameClient.Get <IDataManager>();
            GameplayManager    = GameClient.Get <IGameplayManager>();
            TimerManager       = GameClient.Get <ITimerManager>();

            CardsController        = GameplayManager.GetController <CardsController>();
            AbilitiesController    = GameplayManager.GetController <AbilitiesController>();
            BattlegroundController = GameplayManager.GetController <BattlegroundController>();

            GameObject = selfObject;

            ElementSlotsOfCards = new List <ElementSlotOfCards>();

            CardAnimator         = GameObject.GetComponent <Animator>();
            CardAnimator.enabled = false;

            GlowSprite       = Transform.Find("Glow").GetComponent <SpriteRenderer>();
            PictureSprite    = Transform.Find("Picture").GetComponent <SpriteRenderer>();
            BackgroundSprite = Transform.Find("Frame").GetComponent <SpriteRenderer>();

            CostText   = Transform.Find("GooText").GetComponent <TextMeshPro>();
            NameText   = Transform.Find("TitleText").GetComponent <TextMeshPro>();
            BodyText   = Transform.Find("BodyText").GetComponent <TextMeshPro>();
            AmountText = Transform.Find("Amount/Text").GetComponent <TextMeshPro>();

            RemoveCardParticle = Transform.Find("RemoveCardParticle").GetComponent <ParticleSystem>();

            DistibuteCardObject = Transform.Find("DistributeCardObject").gameObject;

            ParentOfEditingGroupUI = Transform.Find("DeckEditingGroupUI");

            AnimationEventTriggering = GameObject.GetComponent <AnimationEventTriggering>();
            BehaviourHandler         = GameObject.GetComponent <OnBehaviourHandler>();

            AnimationEventTriggering.AnimationEventTriggered += OnAnimationEvent;

            CardsController.UpdateCardsStatusEvent += UpdateCardsStatusEventHandler;

            BehaviourHandler.MouseDownTriggered += MouseDownTriggeredHandler;
            BehaviourHandler.MouseUpTriggered   += MouseUpTriggeredHandler;

            BehaviourHandler.Destroying += DestroyingHandler;
        }
Esempio n. 14
0
        public void Init()
        {
            _gameplayManager = GameClient.Get <IGameplayManager>();
            _dataManager     = GameClient.Get <IDataManager>();
            _tutorialManager = GameClient.Get <ITutorialManager>();
            _timerManager    = GameClient.Get <ITimerManager>();

            _cardsController        = _gameplayManager.GetController <CardsController>();
            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _boardArrowController   = _gameplayManager.GetController <BoardArrowController>();

            _gameplayManager.GameStarted += GameStartedHandler;
            _gameplayManager.GameEnded   += GameEndedHandler;

            _pointerEventSolver              = new PointerEventSolver();
            _pointerEventSolver.DragStarted += PointerSolverDragStartedHandler;
            _pointerEventSolver.Clicked     += PointerEventSolverClickedHandler;
            _pointerEventSolver.Ended       += PointerEventSolverEndedHandler;
        }
Esempio n. 15
0
        public void Init()
        {
            _gameplayManager    = GameClient.Get <IGameplayManager>();
            _dataManager        = GameClient.Get <IDataManager>();
            _tutorialManager    = GameClient.Get <ITutorialManager>();
            _loadObjectsManager = GameClient.Get <ILoadObjectsManager>();

            _abilitiesController    = _gameplayManager.GetController <AbilitiesController>();
            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _cardsController        = _gameplayManager.GetController <CardsController>();
            _actionsQueueController = _gameplayManager.GetController <ActionsQueueController>();
            _skillsController       = _gameplayManager.GetController <SkillsController>();

            _gameplayManager.GameEnded   += GameEndedHandler;
            _gameplayManager.GameStarted += GameStartedHandler;

            _normalUnitCardInHand  = new List <WorkingCard>();
            _normalSpellCardInHand = new List <WorkingCard>();
        }
Esempio n. 16
0
        public override void SetInfo()
        {
            base.SetInfo();

            _callerPlayer = GameAction.Parameters[0] as Player;

            if (GameAction.Parameters.Length > 1)
            {
                _playedCard = GameAction.Parameters[1] as BoardCard;

                string rarity = Enum.GetName(typeof(Enumerators.CardRank),
                                             _playedCard.WorkingCard.LibraryCard.CardRank);
                string cardSetName = CardsController.GetSetOfCard(_playedCard.WorkingCard.LibraryCard);
                PreviewImage.sprite = LoadObjectsManager.GetObjectByPath <Sprite>(
                    string.Format("Images/Cards/Illustrations/{0}_{1}_{2}", cardSetName.ToLower(), rarity.ToLower(),
                                  _playedCard.WorkingCard.LibraryCard.Picture.ToLower()));

                _playedCardPreviewObject = CreateCardPreview(_playedCard.WorkingCard, Vector3.zero);
            }
        }
Esempio n. 17
0
        public void Init()
        {
            _gameplayManager = GameClient.Get <IGameplayManager>();
            _timerManager    = GameClient.Get <ITimerManager>();
            _soundManager    = GameClient.Get <ISoundManager>();
            _dataManager     = GameClient.Get <IDataManager>();
            _tutorialManager = GameClient.Get <ITutorialManager>();
            _uiManager       = GameClient.Get <IUIManager>();
            _playerManager   = GameClient.Get <IPlayerManager>();

            _playerController = _gameplayManager.GetController <PlayerController>();
            _cardsController  = _gameplayManager.GetController <CardsController>();
            _aiController     = _gameplayManager.GetController <AIController>();

            _cardsInDestroy = new List <BoardUnit>();

            _gameplayManager.GameEnded += GameEndedHandler;

            _gameplayManager.GameInitialized += OnGameInitializedHandler;
        }
        public override void Action(object info = null)
        {
            base.Action(info);

            if (PlayerCallerOfAbility.GooOnCurrentTurn == Constants.MaximumPlayerGoo)
            {
                for (int i = 0; i < Count; i++)
                {
                    CardsController.AddCardToHand(PlayerCallerOfAbility);
                }
            }
            else if (PlayerCallerOfAbility.GooOnCurrentTurn == Constants.MaximumPlayerGoo - 1)
            {
                for (int i = 0; i < Count - 1; i++)
                {
                    CardsController.AddCardToHand(PlayerCallerOfAbility);
                }
            }

            PlayerCallerOfAbility.GooOnCurrentTurn += Value;
        }
        public override void SetInfo()
        {
            base.SetInfo();
            _abilityOwner        = GameAction.Parameters[0];
            _usedAbility         = GameAction.Parameters[1] as AbilityData;
            _abilityValue        = (int)GameAction.Parameters[2];
            _abilityUsedOnPlayer = GameAction.Parameters[3] as Player;

            switch (_abilityOwner)
            {
            case BoardUnit unit:
                PreviewImage.sprite = unit.Sprite;
                _healCreatureObj    = CreateCardPreview(unit.Card, Vector3.zero);
                break;

            case BoardSpell spell:
            {
                string rarity      = Enum.GetName(typeof(Enumerators.CardRank), spell.Card.LibraryCard.CardRank);
                string cardSetName = CardsController.GetSetOfCard(spell.Card.LibraryCard);
                PreviewImage.sprite = LoadObjectsManager.GetObjectByPath <Sprite>(
                    string.Format("Images/Cards/Illustrations/{0}_{1}_{2}", cardSetName.ToLower(), rarity.ToLower(),
                                  spell.Card.LibraryCard.Picture.ToLower()));
                _healCreatureObj = CreateCardPreview(spell.Card, Vector3.zero);
                break;
            }
            }

            HealPictureObject.SetActive(true);

            _healedPlayerObj = CreatePlayerPreview(_abilityUsedOnPlayer, Vector3.right * 6);

            GameObject attackViewPlayer = _healedPlayerObj.transform.Find("AttackingHealth").gameObject;

            attackViewPlayer.SetActive(true);
            TextMeshPro damageText = attackViewPlayer.transform.Find("AttackText").GetComponent <TextMeshPro>();

            damageText.text = _abilityValue.ToString();
            attackViewPlayer.transform.localPosition = Vector3.up * -0.86f;
        }
Esempio n. 20
0
        public ReportViewBase(GameObject prefab, Transform parent, GameActionReport gameAction)
        {
            LoadObjectsManager     = GameClient.Get <ILoadObjectsManager>();
            GameplayManager        = GameClient.Get <IGameplayManager>();
            ActionsQueueController = GameplayManager.GetController <ActionsQueueController>();
            CardsController        = GameplayManager.GetController <CardsController>();

            GameAction = gameAction;
            SelfObject = Object.Instantiate(prefab, parent, false);
            SelfObject.transform.SetSiblingIndex(0);
            PreviewImage = SelfObject.transform.Find("Image").GetComponent <Image>();

            OnBehaviourHandler behaviour = SelfObject.GetComponent <OnBehaviourHandler>();

            behaviour.PointerEntered += PointerEnteredHandler;
            behaviour.PointerExited  += PointerExitedHandler;

            PlayerAvatarPreviewPrefab =
                LoadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/PlayerAvatarPreview");
            AttackingHealthPrefab = LoadObjectsManager.GetObjectByPath <GameObject>("Prefabs/Gameplay/AttackingHealth");

            CreatePreviewPanel();
        }
        public override void SetInfo()
        {
            base.SetInfo();

            _abilityOwner        = GameAction.Parameters[0];
            _usedAbility         = GameAction.Parameters[1] as AbilityData;
            _abilityValue        = (int)GameAction.Parameters[2];
            _abilityUsedOnPlayer = GameAction.Parameters[3] as Player;

            if (_abilityOwner is BoardUnit)
            {
                PreviewImage.sprite       = (_abilityOwner as BoardUnit).Sprite;
                _attackingAbilityOwnerObj = CreateCardPreview((_abilityOwner as BoardUnit).Card, Vector3.zero);
            }
            else
            {
                string rarity = Enum.GetName(typeof(Enumerators.CardRank),
                                             (_abilityOwner as BoardSpell).Card.LibraryCard.CardRank);
                string cardSetName = CardsController.GetSetOfCard((_abilityOwner as BoardSpell).Card.LibraryCard);
                PreviewImage.sprite = LoadObjectsManager.GetObjectByPath <Sprite>(
                    string.Format("Images/Cards/Illustrations/{0}_{1}_{2}", cardSetName.ToLower(), rarity.ToLower(),
                                  (_abilityOwner as BoardSpell).Card.LibraryCard.Picture.ToLower()));
                _attackingAbilityOwnerObj = CreateCardPreview((_abilityOwner as BoardSpell).Card, Vector3.zero);
            }

            AttackingPictureObject.SetActive(true);

            _attackedPlayerObj = CreatePlayerPreview(_abilityUsedOnPlayer, Vector3.right * 6);

            GameObject cardView = _attackedPlayerObj.transform.Find("AttackingHealth").gameObject;

            cardView.SetActive(true);
            TextMeshPro damageText = cardView.transform.Find("AttackText").GetComponent <TextMeshPro>();

            damageText.text = (-_abilityValue).ToString();
            cardView.transform.localPosition = -Vector3.up;
        }
Esempio n. 22
0
        public override void Action(object info = null)
        {
            base.Action(info);

            CardsController.LowGooCostOfCardInHand(PlayerCallerOfAbility, null, Value);
        }
Esempio n. 23
0
        public Player(GameObject playerObject, bool isOpponent)
        {
            PlayerObject  = playerObject;
            IsLocalPlayer = !isOpponent;

            _dataManager     = GameClient.Get <IDataManager>();
            _gameplayManager = GameClient.Get <IGameplayManager>();
            _soundManager    = GameClient.Get <ISoundManager>();

            _cardsController        = _gameplayManager.GetController <CardsController>();
            _battlegroundController = _gameplayManager.GetController <BattlegroundController>();
            _skillsController       = _gameplayManager.GetController <SkillsController>();
            _animationsController   = _gameplayManager.GetController <AnimationsController>();

            CardsInDeck      = new List <WorkingCard>();
            CardsInGraveyard = new List <WorkingCard>();
            CardsInHand      = new List <WorkingCard>();
            CardsOnBoard     = new List <WorkingCard>();
            BoardCards       = new List <BoardUnit>();

            CardsPreparingToHand = new List <BoardCard>();

            int heroId;

            if (!isOpponent)
            {
                if (!_gameplayManager.IsTutorial)
                {
                    heroId = _dataManager.CachedDecksData.Decks.First(d => d.Id == _gameplayManager.PlayerDeckId)
                             .HeroId;
                }
                else
                {
                    heroId = Constants.TutorialPlayerHeroId;
                }
            }
            else
            {
                heroId = _dataManager.CachedOpponentDecksData.Decks.First(d => d.Id == _gameplayManager.OpponentDeckId)
                         .HeroId;
            }

            SelfHero = _dataManager.CachedHeroesData.HeroesParsed[heroId];

            _health   = Constants.DefaultPlayerHp;
            InitialHp = _health;
            BuffedHp  = 0;
            _goo      = Constants.DefaultPlayerGoo;

            _avatarObject            = playerObject.transform.Find("Avatar/Hero_Object").gameObject;
            _overlordRegularObject   = playerObject.transform.Find("OverlordArea/RegularModel").gameObject;
            _overlordDeathObject     = playerObject.transform.Find("OverlordArea/OverlordDeath").gameObject;
            _avatarHeroHighlight     = playerObject.transform.Find("Avatar/HeroHighlight").gameObject;
            _avatarSelectedHighlight = playerObject.transform.Find("Avatar/SelectedHighlight").gameObject;

            _avatarAnimator = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <Animator>();
            _deathAnimator  = _overlordDeathObject.GetComponent <Animator>();
            _gooBarFadeTool = playerObject.transform.Find("Avatar/Hero_Object").GetComponent <FadeTool>();

            _freezedHighlightObject = playerObject.transform.Find("Avatar/FreezedHighlight").gameObject;

            _avatarAnimator.enabled = false;
            _deathAnimator.enabled  = false;
            _deathAnimator.StopPlayback();

            PlayerHpChanged += PlayerHpChangedHandler;

            DamageByNoMoreCardsInDeck = 0;
        }
        private void GetInfosAboutUnitsOnBoard()
        {
            foreach (Enumerators.AbilityTargetType target in TargetTypes)
            {
                switch (target)
                {
                case Enumerators.AbilityTargetType.OPPONENT_CARD:
                    _boardUnits.AddRange(GameplayManager.OpponentPlayer.BoardCards.FindAll(x => CardsController.GetSetOfCard(x.Card.LibraryCard) == SetType.ToString()));
                    break;

                case Enumerators.AbilityTargetType.PLAYER_CARD:
                    _boardUnits.AddRange(GameplayManager.CurrentPlayer.BoardCards.FindAll(x => CardsController.GetSetOfCard(x.Card.LibraryCard) == SetType.ToString()));
                    break;

                default: break;
                }
            }
        }