public ChangeUnitsOfTypeStatAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     StatType = ability.AbilityStatType;
     SetType  = Utilites.CastStringTuEnum <Enumerators.SetType>(ability.SetType);
     Value    = ability.Value;
 }
 public ModificateStatAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType  = ability.AbilitySetType;
     StatType = ability.AbilityStatType;
     Value    = ability.Value;
 }
Exemplo n.º 3
0
        public static CardSet GetCardSet(IDataManager dataManager, Enumerators.SetType setType)
        {
            int setIndex = dataManager.CachedCardsLibraryData.Sets.FindIndex(s =>
                                                                             s.Name.Equals(setType.ToString(), StringComparison.InvariantCultureIgnoreCase));

            return(dataManager.CachedCardsLibraryData.Sets[setIndex]);
        }
 public AllyUnitsOfTypeInPlayGetStatsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Health  = ability.Health;
     Damage  = ability.Damage;
     SetType = ability.AbilitySetType;
 }
Exemplo n.º 5
0
        public void DoRankUpgrades(List <BoardUnit> units, Enumerators.SetType element, Enumerators.CardRank rank)
        {
            switch (element)
            {
            case Enumerators.SetType.AIR:
                AirRankBuff(units, rank);
                break;

            case Enumerators.SetType.EARTH:
                EarthRankBuff(units, rank);
                break;

            case Enumerators.SetType.WATER:
                WaterRankBuff(units, rank);
                break;

            case Enumerators.SetType.FIRE:
                FireRankBuff(units, rank);
                break;

            case Enumerators.SetType.TOXIC:
                ToxicRankBuff(units, rank);
                break;

            case Enumerators.SetType.LIFE:
                LifeRankBuff(units, rank);
                break;
            }
        }
Exemplo n.º 6
0
 private void ToggleChooseOnValueChangedHandler(Enumerators.SetType type)
 {
     GameClient.Get <ISoundManager>().PlaySound(Enumerators.SoundType.CHANGE_SCREEN, Constants.SfxSoundVolume,
                                                false, false, true);
     _currentSet = type;
     LoadCards(0, type);
 }
Exemplo n.º 7
0
        public void LoadCards(int page, Enumerators.SetType setType)
        {
            _toggleGroup.transform.GetChild((int)setType).GetComponent <Toggle>().isOn = true;

            CardSet set = SetTypeUtility.GetCardSet(_dataManager, setType);

            List <Card> cards = set.Cards;

            int startIndex = page * CardPositions.Count;

            int endIndex = Mathf.Min(startIndex + CardPositions.Count, cards.Count);

            ResetBoardCards();

            for (int i = startIndex; i < endIndex; i++)
            {
                if (i >= cards.Count)
                {
                    break;
                }

                Card card = cards[i];
                CollectionCardData cardData = _dataManager.CachedCollectionData.GetCardData(card.Name);

                // hack !!!! CHECK IT!!!
                if (cardData == null)
                {
                    continue;
                }

                GameObject go;
                BoardCard  boardCard;
                switch (card.CardKind)
                {
                case Enumerators.CardKind.CREATURE:
                    go        = Object.Instantiate(CardCreaturePrefab);
                    boardCard = new UnitBoardCard(go);
                    break;

                case Enumerators.CardKind.SPELL:
                    go        = Object.Instantiate(CardSpellPrefab);
                    boardCard = new SpellBoardCard(go);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                int amount = cardData.Amount;
                boardCard.Init(card, amount);
                boardCard.SetHighlightingEnabled(false);
                boardCard.Transform.position   = CardPositions[i % CardPositions.Count].position;
                boardCard.Transform.localScale = Vector3.one * 0.32f;
                boardCard.GameObject.GetComponent <SortingGroup>().sortingLayerID = SRSortingLayers.GameUI1;

                _createdBoardCards.Add(boardCard);
            }

            HighlightCorrectIcon();
        }
        public ReplaceUnitsWithTypeOnStrongerOnesAbility(Enumerators.CardKind cardKind, AbilityData ability)
            : base(cardKind, ability)
        {
            Value       = ability.Value;
            SetType     = ability.AbilitySetType;
            TargetTypes = ability.AbilityTargetTypes;

            _boardUnits       = new List <BoardUnit>();
            _replaceUnitInfos = new List <ReplaceUnitInfo>();
        }
Exemplo n.º 9
0
        public void MoveCardsPage(int direction)
        {
            GameClient.Get <ISoundManager>().PlaySound(Enumerators.SoundType.CHANGE_SCREEN, Constants.SfxSoundVolume,
                                                       false, false, true);
            CalculateNumberOfPages();

            _currentElementPage += direction;

            if (_currentElementPage < 0)
            {
                _currentSet += direction;

                if (_currentSet < 0)
                {
                    _currentSet = (Enumerators.SetType)(_numSets - 1);
                    CalculateNumberOfPages();
                    _currentElementPage = _numElementPages - 1;
                }
                else
                {
                    CalculateNumberOfPages();

                    _currentElementPage = _numElementPages - 1;

                    _currentElementPage = _currentElementPage < 0 ? 0 : _currentElementPage;
                }
            }
            else if (_currentElementPage >= _numElementPages)
            {
                _currentSet += direction;

                if ((int)_currentSet >= _numSets)
                {
                    _currentSet         = 0;
                    _currentElementPage = 0;
                }
                else
                {
                    _currentElementPage = 0;
                }
            }

            LoadCards(_currentElementPage, _currentSet);
        }
Exemplo n.º 10
0
 private void AttackWithModifiers(
     Player owner,
     BoardSkill boardSkill,
     HeroSkill skill,
     object target,
     Enumerators.SetType attackType,
     Enumerators.SetType setType)
 {
     if (target is Player player)
     {
         // TODO additional damage to heros
         _battleController.AttackPlayerBySkill(owner, skill, player);
     }
     else
     {
         BoardUnit creature       = target as BoardUnit;
         int       attackModifier = 0;
         _battleController.AttackUnitBySkill(owner, skill, creature, attackModifier);
     }
 }
Exemplo n.º 11
0
        public void ParseData()
        {
            AbilityType         = Utilites.CastStringTuEnum <Enumerators.AbilityType>(Type);
            AbilityActivityType = Utilites.CastStringTuEnum <Enumerators.AbilityActivityType>(ActivityType);
            AbilityCallType     = Utilites.CastStringTuEnum <Enumerators.AbilityCallType>(CallType);

            if (!string.IsNullOrEmpty(TargetType))
            {
                AbilityTargetTypes = Utilites.CastList <Enumerators.AbilityTargetType>(TargetType);
            }
            else
            {
                AbilityTargetTypes = new List <Enumerators.AbilityTargetType>();
            }

            if (!string.IsNullOrEmpty(StatType))
            {
                AbilityStatType = Utilites.CastStringTuEnum <Enumerators.StatType>(StatType);
            }
            else
            {
                AbilityStatType = Enumerators.StatType.NONE;
            }

            if (!string.IsNullOrEmpty(SetType))
            {
                AbilitySetType = Utilites.CastStringTuEnum <Enumerators.SetType>(SetType);
            }
            else
            {
                AbilitySetType = Enumerators.SetType.NONE;
            }

            if (!string.IsNullOrEmpty(EffectType))
            {
                AbilityEffectType = Utilites.CastStringTuEnum <Enumerators.AbilityEffectType>(EffectType);
            }
            else
            {
                AbilityEffectType = Enumerators.AbilityEffectType.NONE;
            }

            if (!string.IsNullOrEmpty(AttackInfo))
            {
                AttackInfoType = Utilites.CastStringTuEnum <Enumerators.AttackInfoType>(AttackInfo);
            }
            else
            {
                AttackInfoType = Enumerators.AttackInfoType.ANY;
            }

            if (!string.IsNullOrEmpty(CardType))
            {
                TargetCardType = Utilites.CastStringTuEnum <Enumerators.CardType>(CardType);
            }
            else
            {
                TargetCardType = Enumerators.CardType.NONE;
            }

            if (!string.IsNullOrEmpty(UnitStatus))
            {
                TargetUnitStatusType = Utilites.CastStringTuEnum <Enumerators.UnitStatusType>(UnitStatus);
            }
            else
            {
                TargetUnitStatusType = Enumerators.UnitStatusType.NONE;
            }

            if (!string.IsNullOrEmpty(UnitType))
            {
                TargetUnitType = Utilites.CastStringTuEnum <Enumerators.CardType>(UnitType);
            }
        }
Exemplo n.º 12
0
 public ReviveDiedUnitsOfTypeFromMatchAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType = ability.AbilitySetType;
 }
Exemplo n.º 13
0
 public DrawCardAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType = ability.AbilitySetType;
 }
Exemplo n.º 14
0
 public CostsLessIfCardTypeInHandAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType = ability.AbilitySetType;
     Value   = ability.Value;
 }