Ejemplo n.º 1
0
        public Spell( Enemy targetEnemy, Tower tower, float movementSpeed )
        {

            this.targetEnemy = targetEnemy;
            this.tower = tower;
            this.movementSpeed = movementSpeed;

        }
Ejemplo n.º 2
0
        //AOEs
        protected void DoRangedEffects()
        {
            // if (_isAnimation)return;
            if (doneEffects == false)
            {
                _data.GetMinionEffects().ForEach(effect => {
                    var minions = _player.WaveManager.GetMinionList();
                    switch (effect)
                    {
                    case SkillEffect.Damage:
                        foreach (var minion in minions)
                        {
                            if (InRange(minion.gameObject))
                            {
                                minion.DecreaseLife(_data.GetDamage());
                            }
                        }
                        break;

                    case SkillEffect.ChangeSpeed:
                        foreach (var minion in minions)
                        {
                            if (InRange(minion.gameObject))
                            {
                                minion.ChangeSpeed(_data.GetMultiplier(effect));     // Multiplier returns the multiplier according to Increase/Decrease.
                            }
                        }
                        break;

                    default:
                        break;
                    }
                });

                _data.GetTowerEffects().ForEach(effect => {
                    var towers = new List <Tower>();
                    _player.Data.GetMages().ToList().ForEach((Mage thisMage) => {
                        if (thisMage.GetBuilding() != null && thisMage.GetBuilding() is Tower)
                        {
                            Tower tower = thisMage.GetBuilding() as Tower;
                            towers.Add(tower);
                        }
                    });
                    switch (effect)
                    {
                    case SkillEffect.ChangeDamage:
                        foreach (var tower in towers)
                        {
                            if (InRange(tower.gameObject))
                            {
                                tower.InsideMage.ChangeDamage(_data.GetMultiplier(effect));
                            }
                        }
                        break;

                    case SkillEffect.ChangeRange:
                        foreach (var tower in towers)
                        {
                            if (InRange(tower.gameObject))
                            {
                                tower.InsideMage.ChangeRange(_data.GetMultiplier(effect));
                            }
                        }
                        break;

                    case SkillEffect.ChangeDelay:
                        foreach (var tower in towers)
                        {
                            if (InRange(tower.gameObject))
                            {
                                tower.InsideMage.ChangeDelay(_data.GetMultiplier(effect));
                            }
                        }
                        break;
                    }
                });
                doneEffects = true;
            }
        }
Ejemplo n.º 3
0
 public void SetTowerToFoeList(Tower foeTower)
 {
     _foeTowersList.Add(foeTower);
 }