public ModificateStatAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType  = ability.AbilitySetType;
     StatType = ability.AbilityStatType;
     Value    = ability.Value;
 }
Пример #2
0
 public SummonsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Name        = ability.Name;
     Count       = ability.Count;
     TargetTypes = ability.AbilityTargetTypes;
 }
Пример #3
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>();
        }
 public ChangeUnitsOfTypeStatAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     StatType = ability.AbilityStatType;
     SetType  = Utilites.CastStringTuEnum <Enumerators.SetType>(ability.SetType);
     Value    = ability.Value;
 }
 public AllyUnitsOfTypeInPlayGetStatsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Health  = ability.Health;
     Damage  = ability.Damage;
     SetType = ability.AbilitySetType;
 }
Пример #6
0
        public RestoreDefRandomlySplitAbility(Enumerators.CardKind cardKind, AbilityData ability)
            : base(cardKind, ability)
        {
            Value       = ability.Value;
            TargetTypes = ability.AbilityTargetTypes;

            _targets = new List <object>();
        }
        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>();
        }
        public bool CheckActivateAvailability(Enumerators.CardKind kind, AbilityData ability, Player localPlayer)
        {
            bool available = false;

            Player opponent = localPlayer.Equals(_gameplayManager.CurrentPlayer) ?
                              _gameplayManager.OpponentPlayer :
                              _gameplayManager.CurrentPlayer;

            lock (_lock)
            {
                foreach (Enumerators.AbilityTargetType item in ability.AbilityTargetTypes)
                {
                    switch (item)
                    {
                    case Enumerators.AbilityTargetType.OPPONENT_CARD:
                    {
                        if (opponent.BoardCards.Count > 0)
                        {
                            available = true;
                        }
                    }

                    break;

                    case Enumerators.AbilityTargetType.PLAYER_CARD:
                    {
                        if (localPlayer.BoardCards.Count > 1 || kind == Enumerators.CardKind.SPELL)
                        {
                            available = true;
                        }
                    }

                    break;

                    case Enumerators.AbilityTargetType.PLAYER:
                    case Enumerators.AbilityTargetType.OPPONENT:
                    case Enumerators.AbilityTargetType.ALL:
                        available = true;
                        break;
                    }
                }
            }

            return(available);
        }
        public ActiveAbility CreateActiveAbility(
            AbilityData ability,
            Enumerators.CardKind kind,
            object boardObject,
            Player caller,
            Card cardOwner,
            WorkingCard workingCard)
        {
            lock (_lock)
            {
                ActiveAbility activeAbility = new ActiveAbility
                {
                    Id      = _castedAbilitiesIds++,
                    Ability = CreateAbilityByType(kind, ability)
                };

                activeAbility.Ability.ActivityId            = activeAbility.Id;
                activeAbility.Ability.PlayerCallerOfAbility = caller;
                activeAbility.Ability.CardOwnerOfAbility    = cardOwner;
                activeAbility.Ability.MainWorkingCard       = workingCard;

                if (boardObject != null)
                {
                    if (boardObject is BoardCard)
                    {
                        activeAbility.Ability.BoardCard = boardObject as BoardCard;
                    }
                    else
                    {
                        if (kind == Enumerators.CardKind.CREATURE)
                        {
                            activeAbility.Ability.AbilityUnitOwner = boardObject as BoardUnit;
                        }
                        else
                        {
                            activeAbility.Ability.BoardSpell = boardObject as BoardSpell;
                        }
                    }
                }

                _activeAbilities.Add(activeAbility);

                return(activeAbility);
            }
        }
Пример #10
0
 public AddCardByNameToHandAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Name = ability.Name;
 }
Пример #11
0
 public StunOrDamageAdjustmentsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     StatType = ability.AbilityStatType;
     Value    = ability.Value;
 }
Пример #12
0
 public UnitWeaponAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value  = ability.Value;
     Damage = ability.Damage;
 }
Пример #13
0
 public ReanimateAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #14
0
 public AdjacentUnitsGetHeavyAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #15
0
 public ReviveDiedUnitsOfTypeFromMatchAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType = ability.AbilitySetType;
 }
Пример #16
0
 public EnemyThatAttacksBecomeFrozenAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
 public DamageEnemyUnitsAndFreezeThemAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value = ability.Value;
 }
Пример #18
0
 public AddGooVialsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value = ability.Value;
     Count = ability.Count;
 }
 public ReturnUnitsOnBoardToOwnersDecksAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #20
0
 public AttackOverlordAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     TargetTypes = ability.AbilityTargetTypes;
     Value       = ability.Value;
 }
Пример #21
0
 public DrawCardAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     SetType = ability.AbilitySetType;
 }
Пример #22
0
 public PriorityAttackAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #23
0
 public AdditionalDamageToHeavyInAttackAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #24
0
 public DelayedAbilityBase(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Delay             = ability.Delay;
     _delayedTurnsLeft = Delay;
 }
Пример #25
0
 public SwingAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value = ability.Value;
 }
Пример #26
0
 public DestroyUnitByTypeAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     TargetCardType = ability.TargetCardType;
 }
 public DelayedGainAttackAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value = ability.Value;
 }
Пример #28
0
 public StunAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     StatType = ability.AbilityStatType;
     Value    = ability.Value;
 }
 public TakeControlEnemyUnitAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
 }
Пример #30
0
 public TakeDamageRandomEnemyAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     Value = ability.Value;
 }