public void TestAtkSpeedOverall()
        {
            /// have tested these calculations in game and have them explained here
            /// Unit base atk speed: 1.5
            /// Upgrade level: x0.96%^5
            /// Total Raw Armor: 1.223
            /// 120% player atk speed = / 1.2
            /// x10 infuse = / 2
            /// Z rank buff = / 1.15
            /// Super Omega buff = / 2
            /// Trifecta bonus buff = / 1.3
            /// x25 essence = / 1.01^25
            /// Adrenaline+super rush = /1.2
            /// Accel = / 1.2
            /// Void Buff = / 2
            /// total = 1.22305 / (26.5032)
            /// total = 0.04615

            var loadout = GetTestLoadout();

            loadout.CurrentUnit = VUnit.New(UnitType.WarpLord, loadout);
            loadout.Upgrades.AttackSpeedUpgrade      = 5;
            loadout.Gems.AttackSpeedGem.CurrentLevel = 20;
            loadout.CurrentUnit.CurrentInfusion      = 10;
            loadout.CurrentUnit.UnitRank             = UnitRankType.XYZ;
            ((PerkCollection)loadout.Perks).TrifectaPower.DesiredLevel  = 15;
            ((PerkCollection)loadout.Perks).UpgradeCache.DesiredLevel   = 1;
            ((PerkCollection)loadout.Perks).AdrenalineRush.DesiredLevel = 15;
            ((PerkCollection)loadout.Perks).SuperRush.DesiredLevel      = 10;
            ((PerkCollection)loadout.Perks).Alacrity2.DesiredLevel      = 20;
            loadout.CurrentUnit.EssenceStacks = 25;

            Assert.That(loadout.Stats.UnitAttackSpeed, Is.EqualTo(0.0462).Within(0.0001));
        }
        public void TestArmorOverall()
        {
            /// have tested these calculations in game and have them explained here
            /// Unit base armor: 2
            /// Unit armor increment: .35
            /// Upgrade level: 20
            /// Total Raw Armor: 9
            /// 200% player armor = x2
            /// +10 infuse = x2
            /// SSA rank buff = x1.1
            /// Super Omega buff = x1.2 (tooltip says 100% but is only 20% in test
            /// Trifecta bonus buff = x1.1
            /// +25 infuse = +25
            /// total = 9 * 2 * 2 * 1.1 * 1.1 * 1.2 + 25
            /// 77.272 armor total
            var loadout = GetTestLoadout();

            loadout.CurrentUnit = VUnit.New(UnitType.WarpLord, loadout);
            loadout.Upgrades.HealthArmorUpgrade       = 20;
            loadout.Upgrades.ShieldsArmorUpgrade      = 20;
            loadout.Gems.HealthArmorGem.CurrentLevel  = 100;
            loadout.Gems.ShieldsArmorGem.CurrentLevel = 100;
            loadout.CurrentUnit.CurrentInfusion       = 10;
            loadout.CurrentUnit.UnitRank = UnitRankType.XDZ;
            ((PerkCollection)loadout.Perks).TrifectaPower.DesiredLevel = 15;
            loadout.CurrentUnit.EssenceStacks = 25;

            Assert.That(loadout.Stats.UnitHealthArmor, Is.EqualTo(77.272));
            Assert.That(loadout.Stats.UnitShieldsArmor, Is.EqualTo(77.272));
        }
        public void TestHealthAndShieldsOverall()
        {
            /// have tested these calculations in game and have them explained here
            /// Unit base armor: 100
            /// 200% player health = +100%
            /// +10 infuse = +100%
            /// SSA rank buff = +10%
            /// Super Omega buff = +100%
            /// Trifecta bonus buff = +30%
            /// +25 infuse = x 225%
            /// total = 100 + 340% * 2.25
            /// = 440 * 2.25
            /// = 990 health total
            /// BaseShields = 150 so 1485 total
            var loadout = GetTestLoadout();

            loadout.CurrentUnit = VUnit.New(UnitType.WarpLord, loadout);
            loadout.Gems.HealthGem.CurrentLevel  = 100;
            loadout.Gems.ShieldsGem.CurrentLevel = 100;
            loadout.CurrentUnit.CurrentInfusion  = 10;
            loadout.CurrentUnit.UnitRank         = UnitRankType.XDZ;
            ((PerkCollection)loadout.Perks).TrifectaPower.DesiredLevel = 15;
            ((PerkCollection)loadout.Perks).UpgradeCache.DesiredLevel  = 15;
            loadout.CurrentUnit.EssenceStacks = 25;

            Assert.That(loadout.Stats.UnitHealth, Is.EqualTo(990).Within(0.001));
            Assert.That(loadout.Stats.UnitShields, Is.EqualTo(1485).Within(0.001));
        }
        public void TestAttackOverall()
        {
            /// have tested these calculations in game and have them explained here
            /// Unit base atk: 11
            /// Unit armor increment: .6
            /// Upgrade level: 30
            /// Total Raw Armor: 29
            /// 200% player atk = +100%
            /// +10 infuse = +100%
            /// Z rank buff = +20%
            /// Super Omega buff = +100%
            /// Trifecta bonus buff = +30% (+15% without cache)
            /// +24 essence = +120%
            /// Adrenaline+super rush = +20%
            /// total = 29 + 490%
            /// total = 171.1

            var loadout = GetTestLoadout();

            loadout.CurrentUnit                 = VUnit.New(UnitType.WarpLord, loadout);
            loadout.Upgrades.AttackUpgrade      = 30;
            loadout.Gems.AttackGem.CurrentLevel = 100;
            loadout.CurrentUnit.CurrentInfusion = 10;
            loadout.CurrentUnit.UnitRank        = UnitRankType.XDZ;
            ((PerkCollection)loadout.Perks).TrifectaPower.DesiredLevel  = 15;
            ((PerkCollection)loadout.Perks).UpgradeCache.DesiredLevel   = 1;
            ((PerkCollection)loadout.Perks).AdrenalineRush.DesiredLevel = 15;
            ((PerkCollection)loadout.Perks).SuperRush.DesiredLevel      = 10;
            loadout.CurrentUnit.EssenceStacks = 24;

            Assert.That(loadout.Stats.UnitAttack, Is.EqualTo(171.1));
        }
Exemplo n.º 5
0
        public void TestToughness_CurrentUnit(UnitType unit, double expected)
        {
            SetBasicLingComposition();
            var loadout = GetLoadout();

            loadout.CurrentUnit = VUnit.New(unit, loadout);

            Assert.That(loadout.Stats.Toughness, Is.EqualTo(expected).Within(0.01));
        }
Exemplo n.º 6
0
        public void TestToughness_HasDifficulty()
        {
            var loadout = new Loadout();

            loadout.Units.Add(VUnit.New(UnitType.WarpLord, loadout));

            loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.VeryEasy;
            Assert.That(loadout.Stats.Toughness, Is.Not.EqualTo(0));

            loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.None;
            Assert.That(loadout.Stats.Toughness, Is.Not.EqualTo(0));
        }
        public void TestShields(int infuse, int essence, int stats, double expected)
        {
            // All the expected values for this test were generated in game
            var loadout = GetTestLoadout();
            var unit    = VUnit.New(UnitType.WarpLord, loadout);

            unit.CurrentInfusion = infuse;
            unit.EssenceStacks   = essence;
            loadout.Gems.ShieldsGem.CurrentLevel = (short)stats;

            Assert.That(loadout.Stats.ShieldsForBinding, Is.AtLeast(expected - 1) & Is.AtMost(expected + 1));
        }
        UnitCost GetRawUnitCost(UnitType unitType, int infuse, UnitRankType rank, bool isLimitBroken)
        {
            var unitData = VUnit.GetUnitData(unitType);

            // theres some horrible spaghetti with the logic for adding two UnitCost structs because we don't want to sum the ExcessKills.
            // It takes the Excess Kills from the element on the right side of the '+' operator.
            // Please ensure you leave these cost additions in this order to avoid breaking this accidently
            var cost = GetRankCost(rank);

            cost += GetBaseCreationCost(unitData, isLimitBroken);
            cost += GetInfusionCosts(unitData, infuse, cost.CurrentUnitKills);
            return(cost);
        }
Exemplo n.º 9
0
        static void AddUnits(Loadout loadout)
        {
            var unit = VUnit.New(UnitType.WarpLord, loadout);

            unit.EssenceStacks   = 15;
            unit.CurrentInfusion = 10;
            unit.UnitRank        = UnitRankType.XYZ;
            loadout.Units.Add(unit);

            unit = VUnit.New(UnitType.WingedArchon, loadout);
            unit.EssenceStacks   = 3;
            unit.CurrentInfusion = 8;
            unit.UnitRank        = UnitRankType.SSS;
            loadout.Units.Add(unit);
        }
        public void TestWeaponDamage(UnitType unit, double expectedDamage)
        {
            var loadout = TestHelper.GetTestLoadout();

            loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.Hell;
            loadout.Upgrades.AttackUpgrade            = 100;
            loadout.Upgrades.AttackSpeedUpgrade       = 15;
            loadout.Gems.AttackGem.CurrentLevel       = 200;
            loadout.Gems.AttackSpeedGem.CurrentLevel  = 100;
            loadout.Units.Add(VUnit.New(unit, loadout));
            loadout.CurrentUnit.CurrentInfusion = 5;
            loadout.CurrentUnit.EssenceStacks   = 2500;
            loadout.CurrentUnit.UnitRank        = UnitRankType.XX;

            Assert.That(loadout.Stats.Damage, Is.EqualTo(expectedDamage).Within(1));
        }
        public void TestDamageReduction(short specPerks, int statsDR, short rankDr, double otherDr, double expectedDR)
        {
            var loadout = TestHelper.GetTestLoadout();

            loadout.CurrentUnit = VUnit.New(UnitType.WarpLord, loadout);
            loadout.UnitSpec    = UnitType.WarpLord;
            var perks = (PerkCollection)loadout.Perks;

            perks.UnitSpecialization.DesiredLevel = specPerks;
            perks.DamageReduction.DesiredLevel    = (short)(statsDR > 10 ? 10 : statsDR);
            perks.DamageReduction2.DesiredLevel   = (short)(statsDR < 10 ? 0 : statsDR - 10);
            loadout.CurrentUnit.UnitRank          = (UnitRankType)rankDr;
            loadout.Stats.UpdateDamageReduction("OTHER", otherDr);

            Assert.That(loadout.Stats.DamageReductionForBinding, Is.EqualTo(expectedDR));
        }
Exemplo n.º 12
0
        public override void DeactivateUniqueEffect()
        {
            base.DeactivateUniqueEffect();

            var bonusDoubleWarp = 0;

            using (Loadout.Stats.SuspendRefreshingStatBindings())
            {
                var unit = Loadout.CurrentUnit;
                Loadout.CurrentUnit = VUnit.New(UnitType.None, Loadout);
                bonusDoubleWarp     = (int)(Loadout.Stats.Attack - 100) / 10;
                Loadout.CurrentUnit = unit;
            }

            Loadout.IncomeManager.DoubleWarp -= 5 + bonusDoubleWarp;
        }
        public void TestUnitSpec()
        {
            var validSpecTypes = VUnit.ValidSpecTypes();
            var loadout        = (VLoadout) new Loadout();

            foreach (var unitType in Enums.GetValues <UnitType>())
            {
                var unit = VUnit.New(unitType, loadout);

                if (speclessUnitTypes().Contains(unitType))
                {
                    Assert.That <object>(() => unit.UnitData.SpecTypes, Has.Length.EqualTo(0), $"Unit {unitType} should have no spec types");
                }
                else
                {
                    Assert.That <object>(() => unit.UnitData.SpecTypes, Has.Length.GreaterThan(0), $"Unit {unitType} should have at least 1 spec type");
                }

                foreach (var specType in unit.UnitData.SpecTypes)
                {
                    Assert.That <object>(() => validSpecTypes, Has.Member(specType), $"unit {unitType} has a spec type of {specType} which is invalid");
                }
            }
Exemplo n.º 14
0
        public void TestProposedValues_DontChangeState()
        {
            var loadout = TestHelper.GetEmptyLoadout();

            loadout.CurrentUnit = VUnit.New(UnitType.Striker, loadout);
            loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.VeryEasy;
            loadout.CurrentUnit.CurrentInfusion       = loadout.CurrentUnit.MaximumInfusion;
            loadout.CurrentUnit.CurrentKills          = loadout.CurrentUnit.MaximumKills;

            var oldDamage    = loadout.Stats.Damage;
            var oldToughness = loadout.Stats.Toughness;
            var perks        = loadout.Perks as PerkCollection;

            foreach (var perk in perks.AllPerks)
            {
                perk.GetIncrementHint(perk.MinimumIncreaseForOptimise);
                Assert.That(loadout.Stats.Damage, Is.EqualTo(oldDamage), $"{perk.Name} Perk permanently modifies damage when getting it's increment hint");
                Assert.That(loadout.Stats.Toughness, Is.EqualTo(oldToughness), $"{perk.Name} Perk permanently modifies toughness when getting it's increment hint");

                perk.GetDecrementHint(perk.MinimumIncreaseForOptimise);
                Assert.That(loadout.Stats.Damage, Is.EqualTo(oldDamage), $"{perk.Name} Perk permanently modifies damage when getting it's decrement hint");
                Assert.That(loadout.Stats.Toughness, Is.EqualTo(oldToughness), $"{perk.Name} Perk permanently modifies toughness when getting it's decrement hint");
            }
        }
        public void TestAllUnitProperties()
        {
            var loadout = (VLoadout) new Loadout();

            foreach (var unitType in Enums.GetValues <UnitType>())
            {
                VUnit unit = null;
                Assert.That <VUnit>(() => unit = VUnit.New(unitType, loadout), Throws.Nothing, $"Cannot create a {unitType} unit");

                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("BaseHealth", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseHealth");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("BaseHealthArmor", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseHealthArmor");
                //Assert.That<object>(() => unit.UnitData.GetType().GetProperty("BaseHealthRegen", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseHealthRegen");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("BaseShields", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseShields");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("BaseShieldsArmor", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseShieldsArmor");
                //Assert.That<object>(() => unit.UnitData.GetType().GetProperty("BaseShieldsRegen", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.BaseShieldsRegen");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("HealthIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.HealthIncrement");
                //Assert.That<object>(() => unit.UnitData.GetType().GetProperty("HealthRegenIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.HealthRegenIncrement");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("HealthArmorIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.HealthArmorIncrement");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("ShieldIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.ShieldIncrement");
                //Assert.That<object>(() => unit.UnitData.GetType().GetProperty("ShieldRegenIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.ShieldRegenIncrement");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("ShieldArmorIncrement", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.ShieldArmorIncrement");
                Assert.That <object>(() => unit.UnitData.GetType().GetProperty("Type", BindingFlags.Public | BindingFlags.Instance).GetValue(unit.UnitData), Throws.Nothing, $"{unitType}.Type");
            }
        }
Exemplo n.º 16
0
        static VLoadout GetLoadout()
        {
            // loadout with 1 WL,
            // 19.5 armor,
            // 550 shields
            // 300 health
            var loadout = new Loadout();

            loadout.Units.Add(VUnit.New(UnitType.WarpLord, loadout));
            loadout.ShouldRestrict = false;
            loadout.UnitConfiguration.DifficultyLevel = DifficultyLevel.Normal;
            loadout.Upgrades.HealthArmorUpgrade       = 50;
            loadout.Upgrades.HealthUpgrade            = 50;
            loadout.Upgrades.ShieldsArmorUpgrade      = 50;
            loadout.Upgrades.ShieldsUpgrade           = 50;

            var perks = loadout.Perks as PerkCollection;

            perks.MaximumPotiential.DesiredLevel  = 8;
            perks.MaximumPotiential2.DesiredLevel = 10;
            perks.MaximumPotiental3.DesiredLevel  = 10;
            perks.MaximumPotential4.DesiredLevel  = 10;
            return(loadout);
        }
        static VLoadout LoadMaxPage14()
        {
            var loadout = TestHelper.GetTestLoadout();
            var perks   = loadout.Perks as PerkCollection;

            foreach (var perk in perks.AllPerks.Where(p => p.Page <= 14))
            {
                perk.DesiredLevel = perk.MaxLevel;
            }
            perks.DominatorDamage.DesiredLevel = 50;
            perks.DominatorSpeed.DesiredLevel  = 50;
            loadout.CurrentUnit = VUnit.New(UnitType.BladeMaster, loadout);
            loadout.CurrentUnit.CurrentInfusion = 10;
            loadout.CurrentUnit.EssenceStacks   = 25;
            loadout.CurrentUnit.UnitRank        = UnitRankType.XYZ;
            loadout.Upgrades.MaxAll();
            loadout.Gems.CritChanceGem.CurrentLevel  = 50;
            loadout.Gems.CritDamageGem.CurrentLevel  = 50;
            loadout.Gems.AttackGem.CurrentLevel      = 50;
            loadout.Gems.AttackSpeedGem.CurrentLevel = 50;
            loadout.Gems.HealthArmorGem.CurrentLevel = 50;
            loadout.Gems.HealthGem.CurrentLevel      = 50;
            return(loadout);
        }
 public UnitCost GetUnitCost(VUnit unit)
 {
     return(GetUnitCost(new VUnit[] { unit }));
 }