public override void OnCardSelected(BoardUnit unit)
        {
            if (unit.CurrentHp <= 0)
            {
                return;
            }

            if (PossibleTargets.Contains(Enumerators.AbilityTargetType.PLAYER_CARD) &&
                unit.GameObject.CompareTag(SRTags.PlayerOwned) ||
                PossibleTargets.Contains(Enumerators.AbilityTargetType.OPPONENT_CARD) &&
                unit.GameObject.CompareTag(SRTags.OpponentOwned) ||
                PossibleTargets.Contains(Enumerators.AbilityTargetType.ALL))
            {
                if (TargetUnitType == Enumerators.CardType.NONE || unit.InitialUnitType == TargetUnitType)
                {
                    if (TargetUnitStatusType == Enumerators.UnitStatusType.NONE ||
                        unit.UnitStatus == TargetUnitStatusType)
                    {
                        if (SelfBoardCreature != unit)
                        {
                            SelectedCard?.SetSelectedUnit(false);

                            SelectedCard = unit;
                            SelectedPlayer?.SetGlowStatus(false);

                            SelectedPlayer = null;
                            SelectedCard.SetSelectedUnit(true);

                            CardSelected?.Invoke(unit);
                        }
                    }
                }
            }
        }
示例#2
0
 public override void OnCardUnselected(BoardUnit creature)
 {
     if (SelectedCard == creature)
     {
         SelectedCard.SetSelectedUnit(false);
         SelectedCard = null;
     }
 }
示例#3
0
 public override void OnPlayerUnselected(Player player)
 {
     if (SelectedPlayer == player)
     {
         SelectedCard?.SetSelectedUnit(false);
         SelectedCard = null;
         SelectedPlayer.SetGlowStatus(false);
         SelectedPlayer = null;
     }
 }
示例#4
0
        public override void OnCardSelected(BoardUnit unit)
        {
            if (TutorialManager.IsTutorial && TutorialManager.CurrentTutorialDataStep.BoardArrowCantUsableOnUnit)
            {
                return;
            }

            if (IgnoreBoardObjectsList != null && IgnoreBoardObjectsList.Contains(unit))
            {
                return;
            }

            if (unit.CurrentHp <= 0)
            {
                return;
            }

            if (ElementType.Count > 0 && !ElementType.Contains(unit.Card.LibraryCard.CardSetType))
            {
                return;
            }

            if (TargetsType.Contains(Enumerators.SkillTargetType.ALL_CARDS) ||
                TargetsType.Contains(Enumerators.SkillTargetType.PLAYER_CARD) &&
                unit.Transform.CompareTag("PlayerOwned") ||
                TargetsType.Contains(Enumerators.SkillTargetType.OPPONENT_CARD) &&
                unit.Transform.CompareTag("OpponentOwned"))
            {
                bool opponentHasProvoke = OpponentBoardContainsProvokingCreatures();
                if (!opponentHasProvoke || opponentHasProvoke && unit.IsHeavyUnit() || IgnoreHeavy)
                {
                    SelectedCard?.SetSelectedUnit(false);

                    SelectedCard = unit;
                    SelectedPlayer?.SetGlowStatus(false);

                    SelectedPlayer = null;
                    SelectedCard.SetSelectedUnit(true);
                }
            }
        }
        public override void OnPlayerSelected(Player player)
        {
            if (player.Health <= 0)
            {
                return;
            }

            if (PossibleTargets.Contains(Enumerators.AbilityTargetType.PLAYER) &&
                player.AvatarObject.CompareTag(SRTags.PlayerOwned) ||
                PossibleTargets.Contains(Enumerators.AbilityTargetType.OPPONENT) &&
                player.AvatarObject.CompareTag(SRTags.OpponentOwned) ||
                PossibleTargets.Contains(Enumerators.AbilityTargetType.ALL))
            {
                SelectedPlayer = player;
                SelectedCard?.SetSelectedUnit(false);

                SelectedCard = null;
                SelectedPlayer.SetGlowStatus(true);
                PlayerSelected?.Invoke(player);
            }
        }
示例#6
0
        public override void OnPlayerSelected(Player player)
        {
            if (TutorialManager.IsTutorial && !TutorialManager.CurrentTutorialDataStep.BoardArrowCanUsableOnPlayer)
            {
                return;
            }

            if (player.Health <= 0)
            {
                return;
            }

            if (IgnoreBoardObjectsList != null && IgnoreBoardObjectsList.Contains(player))
            {
                return;
            }

            if (Owner != null && !Owner.HasFeral && Owner.HasBuffRush)
            {
                return;
            }

            if (TargetsType.Contains(Enumerators.SkillTargetType.OPPONENT) &&
                player.AvatarObject.CompareTag("OpponentOwned") ||
                TargetsType.Contains(Enumerators.SkillTargetType.PLAYER) &&
                player.AvatarObject.CompareTag("PlayerOwned"))
            {
                bool opponentHasProvoke = OpponentBoardContainsProvokingCreatures();
                if (!opponentHasProvoke || IgnoreHeavy)
                {
                    SelectedPlayer = player;

                    SelectedPlayer.SetGlowStatus(true);
                    SelectedCard?.SetSelectedUnit(false);

                    SelectedCard = null;
                }
            }
        }
示例#7
0
    private void ResetSelecting()
    {
        if (SelectedCard != null)
        {
            if (SelectedCard.GameObject != null)
            {
                SelectedCard.SetSelectedUnit(false);
                OnCardUnselected(SelectedCard);
            }

            SelectedCard = null;
        }

        if (SelectedPlayer != null)
        {
            if (SelectedPlayer.AvatarObject != null)
            {
                SelectedPlayer.SetGlowStatus(false);
                OnPlayerUnselected(SelectedPlayer);
            }

            SelectedPlayer = null;
        }
    }