Esempio n. 1
0
 public void ApplyPermanently(Unit unit, UnitStats modifiedStats)
 {
     if (unit.NativeTerrainId == Id)
     {
         modifiedStats.Attack += 1;
         modifiedStats.Defense += 1;
     }
 }
Esempio n. 2
0
 public override void ApplyPermanently(Unit unit, UnitStats modifiedStats)
 {
     if (CasterStats.SkillLevel <= SecondarySkillLevel.Basic)
     {
         modifiedStats.MinDamage = modifiedStats.MaxDamage = unit.InitialStats.MaxDamage;
     }
     else
     {
         modifiedStats.MinDamage = modifiedStats.MaxDamage = unit.InitialStats.MaxDamage + 1;
     }
 }
Esempio n. 3
0
 public virtual int BaseDamage(Unit unit)
 {
     if (CasterStats.SkillLevel <= SecondarySkillLevel.Basic)
     {
         return BasicBaseDamage();
     }
     else if (CasterStats.SkillLevel == SecondarySkillLevel.Advanced)
     {
         return AdvancedBaseDamage();
     }
     else
     {
         return ExpertBaseDamage();
     }
 }
Esempio n. 4
0
 public UnitEventArgs(Unit unit)
 {
     Unit = unit;
 }
Esempio n. 5
0
        private void UnitPicked(object sender, UnitEventArgs e)
        {
            PickedUnit = e.Unit;
            UpdateData();

            UnitPicker unitPicker = (UnitPicker)sender;
            unitPicker.Close();
        }
Esempio n. 6
0
        void SetControlsWithData(SpellDamageCalculatorData data)
        {
            dataUpdateSuspended = true;

            spellComboBox.SelectedItem = data.Spell ?? spellComboBox.Items[0];

            if (data.CasterHeroStats != null && data.CasterHeroStats.Hero != null)
            {
                heroComboBox.SelectedItem = data.CasterHeroStats.Hero;
                heroLevelUpDn.Value = data.CasterHeroStats.Level;
                heroSpellPowerUpDn.Value = data.CasterHeroStats.SpellPower;

                heroAirComboBox.SelectedItem = data.CasterHeroStats.LevelForSecondarySkillType(typeof(AirMagic));
                heroFireComboBox.SelectedItem = data.CasterHeroStats.LevelForSecondarySkillType(typeof(FireMagic));
                heroEarthComboBox.SelectedItem = data.CasterHeroStats.LevelForSecondarySkillType(typeof(EarthMagic));
                heroWaterComboBox.SelectedItem = data.CasterHeroStats.LevelForSecondarySkillType(typeof(WaterMagic));
                heroSorceryComboBox.SelectedItem = data.CasterHeroStats.LevelForSecondarySkillType(typeof(Sorcery));
            }
            else
            {
                heroComboBox.SelectedIndex = 0;
                heroLevelUpDn.Value = 1;
                heroSpellPowerUpDn.Value = 0;

                heroAirComboBox.SelectedItem = SecondarySkillLevel.None;
                heroFireComboBox.SelectedItem = SecondarySkillLevel.None;
                heroEarthComboBox.SelectedItem = SecondarySkillLevel.None;
                heroWaterComboBox.SelectedItem = SecondarySkillLevel.None;
                heroSorceryComboBox.SelectedItem = SecondarySkillLevel.None;
            }

            PickedUnit = data.Target;

            dataUpdateSuspended = false;
        }
Esempio n. 7
0
 public void ApplyPermanently(Unit unit, UnitStats modifiedStats)
 {
 }
Esempio n. 8
0
        public override void ApplyPermanently(Unit unit, UnitStats modifiedStats)
        {
            if (unit.IsRanged)
            {
                return;
            }

            int bonus = (CasterStats.SkillLevel <= SecondarySkillLevel.Basic) ? 3 : 6;

            if (CasterStats.IsSpecialized)
            {
                switch (unit.Level)
                {
                    case 1:
                    case 2:
                        bonus += 3;
                        break;
                    case 3:
                    case 4:
                        bonus += 2;
                        break;
                    case 5:
                    case 6:
                        bonus += 1;
                        break;
                }
            }

            modifiedStats.Attack += bonus;
        }
Esempio n. 9
0
        public override void ApplyPermanently(Unit unit, UnitStats modifiedStats)
        {
            int reduction = (CasterStats.SkillLevel <= SecondarySkillLevel.Basic) ? 3 : 6;

            if (CasterStats.IsSpecialized)
            {
                switch (unit.Level)
                {
                    case 1:
                    case 2:
                        reduction += 3;
                        break;
                    case 3:
                    case 4:
                        reduction += 2;
                        break;
                    case 5:
                    case 6:
                        reduction += 1;
                        break;
                }
            }

            modifiedStats.Attack -= reduction;
        }
Esempio n. 10
0
        public override void ApplyPermanently(Unit unit, UnitStats modifiedStats)
        {
            if (CasterStats.SkillLevel <= SecondarySkillLevel.Basic)
            {
                modifiedStats.Attack += modifiedStats.Defense;
            }
            else if (CasterStats.SkillLevel <= SecondarySkillLevel.Advanced)
            {
                modifiedStats.Attack += modifiedStats.Defense * 3 / 2;
            }
            else
            {
                modifiedStats.Attack += modifiedStats.Defense * 2;
            }

            modifiedStats.Defense = 0;
        }
Esempio n. 11
0
        public override void ApplyPermanently(Unit unit, UnitStats modifiedStats)
        {
            int reduction;

            if (CasterStats.SkillLevel <= SecondarySkillLevel.Basic)
            {
                reduction = 3;
            }
            else if (CasterStats.SkillLevel <= SecondarySkillLevel.Advanced)
            {
                reduction = 4;
            }
            else
            {
                reduction = 5;
            }

            if (CasterStats.IsSpecialized)
            {
                reduction += 2;
            }

            modifiedStats.Defense -= reduction;
            modifiedStats.Defense = Math.Max(modifiedStats.Defense, 0);
        }
Esempio n. 12
0
        public virtual SpellDamageModifier BaseModifier(Unit unit)
        {
            SpellDamageModifier damageModifier = new SpellDamageModifier();

            if (CasterStats.IsSpecialized)
            {
                damageModifier.DamageMultipliers.Add(SpecializationMultiplier(unit));
            }

            return damageModifier;
        }
Esempio n. 13
0
 protected override double SpecializationMultiplier(Unit unit)
 {
     return 1.5;
 }
Esempio n. 14
0
        public override int BaseDamage(Unit unit)
        {
            if (!unit.IsUndead)
            {
                return 0;
            }

            return base.BaseDamage(unit);
        }
Esempio n. 15
0
 protected virtual double SpecializationMultiplier(Unit unit)
 {
     return 1 + 0.03 * (CasterStats.SpecializationLevel / unit.Level);
 }