Ejemplo n.º 1
0
        public override void OnCast()
        {
            base.OnCast();
            AbilityEffects effect = new AbilityEffects(4, parent.sourceUnit, parent);

            _tmpTarget.AddEffect(effect);
        }
Ejemplo n.º 2
0
        public override void OnHitNormalAttack(UnitObject target)
        {
            base.OnHitNormalAttack(target);
            AbilityEffects effect = new AbilityEffects(24);

            target.GetComponent <UnitObject>().AddEffect(effect);
        }
Ejemplo n.º 3
0
        public override void Update(float deltaTime)
        {
            _timeSinceLastUpdate += deltaTime;
            if (_timeSinceLastUpdate >= invokeTime)
            {
                _timeSinceLastUpdate -= invokeTime;

                // Alias
                Collider2D[] hits = Physics2D.OverlapCircleAll(parent.sourceUnit.transform.position.ToVector2(), areaOfEffect);
                foreach (Collider2D col in hits)
                {
                    if (BattleManager.ColliderIsCharacter(col, parent.sourceUnit.gameObject))
                    {
                        if (BattleManager.IsAlias(col.gameObject, parent.sourceUnit.TeamIndex) &&
                            BattleManager.IsAlive(col.gameObject))
                        {
                            AbilityEffects effect = new AbilityEffects(3, parent.sourceUnit, parent);
                            col.gameObject.GetComponent <UnitObject>().AddEffect(effect);
                        }
                    }
                }
                // Self
                AbilityEffects effect2 = new AbilityEffects(3, parent.sourceUnit, parent);
                parent.sourceUnit.AddEffect(effect2);
            }
        }
Ejemplo n.º 4
0
        public override void OnCast()
        {
            AbilityEffects effect = new AbilityEffects(4, parent.sourceUnit, parent);

            effect.PowerParameter = damagePercent[parent.LevelIndex];
            effect.EffectDuration = duration[parent.LevelIndex];
            parent.sourceUnit.GetComponent <UnitObject>().AddEffect(effect);
        }
        public override void OnHitNormalAttack(UnitObject target)
        {
            if (target == null)
            {
                return;
            }
            base.OnHitNormalAttack(target);
            AbilityEffects effect = new AbilityEffects(1);

            effect.Level = parent.Level;
            target.GetComponent <UnitObject>().AddEffect(effect);
        }
Ejemplo n.º 6
0
        public override void OnCast()
        {
            List <UnitObject> _list = BattleManager.FindEnemyInRadius(parent.sourceUnit.TeamIndex, parent.sourceUnit.transform.position, radius);

            for (int i = 0; i < _list.Count; i++)
            {
                float _damage = damageBonus[parent.LevelIndex] + parent.sourceUnit.TotalAttack * damageScale;
                _list[i].TakeDamage((int)_damage, parent.sourceUnit);
                AbilityEffects effect = new AbilityEffects(3, parent.sourceUnit, parent);
                effect.Level = parent.Level;
                _list[i].GetComponent <UnitObject>().AddEffect(effect);
            }
        }
Ejemplo n.º 7
0
        public override void OnCast()
        {
            GameObject vfx = BattleManager.CreateVFX("vfx_poison_cloud");

            vfx.transform.SetParent(parent.sourceUnit.CurrentTarget.transform);
            vfx.transform.position = parent.sourceUnit.CurrentTarget.HipPosition;
            vfx.GetComponent <VfxObject>().AutoDestroyAfter(2);

            parent.sourceUnit.CurrentTarget.TakeDamage((int)initialHit[parent.LevelIndex], parent.sourceUnit);

            AbilityEffects effect = new AbilityEffects(5, parent.sourceUnit, parent);

            effect.PowerParameter = damageScale * parent.sourceUnit.TotalAttack;
            parent.sourceUnit.CurrentTarget.AddEffect(effect);
        }
Ejemplo n.º 8
0
        public override void OnCast()
        {
            AbilityEffects effect = new AbilityEffects(2);

            effect.Level          = parent.Level;
            effect.PowerParameter = bonusDamagePercent[parent.LevelIndex];
            effect.EffectDuration = bonusDuration[parent.LevelIndex];
            parent.sourceUnit.GetComponent <UnitObject>().AddEffect(effect);

            //List<UnitObject> _list = BattleManager.FindUnitInArc(parent.sourceUnit.TeamIndex, parent.sourceUnit.transform.position,
            //    3, 45, parent.sourceUnit.unitAnimation.IsFacingLeft);
            //for (int i = 0; i < _list.Count; i++)
            //{
            //    Debug.Log("Inside: " + _list[i].name);
            //}
            //List<UnitObject> _list = BattleManager.FindUnitObjectInRadius(x => x.IsAlive && x.TeamIndex == parent.sourceUnit.TeamIndex, parent.sourceUnit.transform.position, 10);
            //for (int i = 0; i < _list.Count; i++)
            //{
            //    Debug.Log("Inside: " + _list[i].name);
            //}
        }
Ejemplo n.º 9
0
        public void OnTriggerPowerUp(UnitObject unit)
        {
            AbilityEffectsGroup effectType;
            AbilityEffects      effect;

            switch (type)
            {
            case PowerUpType.BonusDamage:
                effect = new AbilityEffects(601);
                break;

            case PowerUpType.BonusAttackSpeed:
                effect = new AbilityEffects(602);
                break;

            case PowerUpType.BonusMovementSpeed:
                effect = new AbilityEffects(603);
                break;

            case PowerUpType.BonusCriticalChance:
                effect = new AbilityEffects(604);
                break;

            case PowerUpType.BonusSpeed:
                effect = new AbilityEffects(605);
                break;

            case PowerUpType.HealOverTime:
                effect = new AbilityEffects(606);
                break;

            default:
                effect = null;
                break;
            }
            unit.AddEffect(effect);
        }