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 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);
            }
        }