Exemplo n.º 1
0
        public WorkingCard(Card card, Player player)
        {
            LibraryCard = card.Clone();
            CardId      = LibraryCard.Id;
            Owner       = player;

            InitialHealth = LibraryCard.Health;
            InitialDamage = LibraryCard.Damage;
            InitialCost   = LibraryCard.Cost;
            Health        = InitialHealth;
            Damage        = InitialDamage;
            RealCost      = InitialCost;

            Type = LibraryCard.CardType;

            InstanceId = GameClient.Get <IGameplayManager>().GetController <CardsController>().GetNewCardInstanceId();
        }
Exemplo 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);
            }
        }
 public TakeUnitTypeToAdjacentAllyUnitsAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     CardType = ability.TargetCardType;
 }
 public TakeUnitTypeToAllyUnitAbility(Enumerators.CardKind cardKind, AbilityData ability)
     : base(cardKind, ability)
 {
     UnitType = ability.TargetUnitType;
 }
Exemplo n.º 5
0
        public void PlayAttackVfx(Enumerators.CardType type, Vector3 target, int damage)
        {
            GameObject effect;
            GameObject vfxPrefab;

            target = Utilites.CastVfxPosition(target);
            Vector3 offset = Vector3.forward * 1;

            switch (type)
            {
            case Enumerators.CardType.FERAL:
            {
                vfxPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/VFX/FeralAttackVFX");
                effect    = Object.Instantiate(vfxPrefab);
                effect.transform.position = target - offset;
                _soundManager.PlaySound(Enumerators.SoundType.FERAL_ATTACK, Constants.CreatureAttackSoundVolume,
                                        false, false, true);

                _particlesController.RegisterParticleSystem(effect, true, 5f);

                if (damage > 3 && damage < 7)
                {
                    _timerManager.AddTimer(
                        a =>
                        {
                            effect = Object.Instantiate(vfxPrefab);
                            effect.transform.position   = target - offset;
                            effect.transform.localScale = new Vector3(-1, 1, 1);
                            _particlesController.RegisterParticleSystem(effect, true, 5f);
                        },
                        null,
                        0.5f);
                }

                if (damage > 6)
                {
                    _timerManager.AddTimer(
                        a =>
                        {
                            effect = Object.Instantiate(vfxPrefab);
                            effect.transform.position    = target - Vector3.right - offset;
                            effect.transform.eulerAngles = Vector3.forward * 90;

                            _particlesController.RegisterParticleSystem(effect, true, 5f);
                        });
                }

                break;
            }

            case Enumerators.CardType.HEAVY:
            {
                Enumerators.SoundType soundType = Enumerators.SoundType.HEAVY_ATTACK_1;
                string prefabName = "Prefabs/VFX/HeavyAttackVFX";
                if (damage > 4)
                {
                    prefabName = "Prefabs/VFX/HeavyAttack2VFX";
                    soundType  = Enumerators.SoundType.HEAVY_ATTACK_2;
                }

                vfxPrefab = _loadObjectsManager.GetObjectByPath <GameObject>(prefabName);
                effect    = Object.Instantiate(vfxPrefab);
                effect.transform.position = target;

                _particlesController.RegisterParticleSystem(effect, true, 5f);

                _soundManager.PlaySound(soundType, Constants.CreatureAttackSoundVolume, false, false, true);
                break;
            }

            default:
            {
                vfxPrefab = _loadObjectsManager.GetObjectByPath <GameObject>("Prefabs/VFX/WalkerAttackVFX");
                effect    = Object.Instantiate(vfxPrefab);
                effect.transform.position = target - offset;

                _particlesController.RegisterParticleSystem(effect, true, 5f);

                if (damage > 4)
                {
                    _timerManager.AddTimer(
                        a =>
                        {
                            effect = Object.Instantiate(vfxPrefab);
                            effect.transform.position = target - offset;

                            effect.transform.localScale = new Vector3(-1, 1, 1);
                            _particlesController.RegisterParticleSystem(effect, true, 5f);
                        },
                        null,
                        0.5f);

                    _soundManager.PlaySound(Enumerators.SoundType.WALKER_ATTACK_2,
                                            Constants.CreatureAttackSoundVolume, false, false, true);
                }
                else
                {
                    _soundManager.PlaySound(Enumerators.SoundType.WALKER_ATTACK_1,
                                            Constants.CreatureAttackSoundVolume, false, false, true);
                }

                break;
            }
            }
        }