Beispiel #1
0
        public void TestRifleGimmick()
        {
            var setting = new Settings
            {
                PrimaryWeapon   = WeaponType.Rifle,
                SecondaryWeapon = WeaponType.Fist,
                FightLength     = 4,
                TargetType      = TargetType.Champion,
                Apl             = ""
            };

            var spell  = new RifleGrenadeSpell();
            var spell2 = new RifleLoadGrenadeSpell();
            var player = new Player(setting);

            player.Spells.Add(spell);
            player.Spells.Add(spell2);

            var engine = new Engine(setting);
            var fight  = engine.StartFight(player);

            var endTime = fight.RoundResults.Last().TimeSec;
            var rounds  = fight.RoundResults.Count;

            var loadCount = fight.RoundResults
                            .SelectMany(r => r.Attacks.Where(a => a.Spell is RifleLoadGrenadeSpell)).Count();
            var grenadeCount = fight.RoundResults
                               .SelectMany(r => r.Attacks.Where(a => a.Spell is RifleGrenadeSpell)).Count();

            // 0.0, start load cast

            // 1.0, finish load cast        load: 1
            // 1.0, start cook grenade
            // 1.0, start next load cast

            // 2.0, finish load cast        load: 2
            // 2.0, start next load cast

            // 3.0, finish load cast        load: 3
            // 3.0, start next load cast

            // 4.0, finish load cast        load: 4
            // 4.0, finish cook grenade
            // 4.0, grenade cast (gcd)      grenade: 1

            Assert.AreEqual(rounds, 4);
            Assert.AreEqual(endTime, 4.0m);
            Assert.IsTrue(loadCount == 4);
            Assert.IsTrue(grenadeCount == 1);
        }
Beispiel #2
0
        public void TestRifleGimmickFuseTimerKsr43()
        {
            var setting = new Settings
            {
                PrimaryWeapon     = WeaponType.Rifle,
                SecondaryWeapon   = WeaponType.Fist,
                FightLength       = 4,
                TargetType        = TargetType.Champion,
                PrimaryWeaponProc = WeaponProc.Ksr43,
                Apl = ""
            };

            var spell = new RifleGrenadeSpell {
                Args = "Rifle.FuseTimer > 3"
            };
            var spell2 = new RifleLoadGrenadeSpell();
            var player = new Player(setting);

            player.Spells.Add(spell);
            player.Spells.Add(spell2);

            var engine = new Engine(setting);
            var fight  = engine.StartFight(player);

            var endTime = fight.RoundResults.Last().TimeSec;
            var rounds  = fight.RoundResults.Count;

            var loadCount = fight.RoundResults
                            .SelectMany(r => r.Attacks.Where(a => a.Spell is RifleLoadGrenadeSpell)).Count();
            var grenadeCount = fight.RoundResults
                               .SelectMany(r => r.Attacks.Where(a => a.Spell is RifleGrenadeSpell)).Count();

            // NO grenade spells since fusetimer will blow

            Assert.AreEqual(rounds, 4);
            Assert.AreEqual(endTime, 4.0m);
            Assert.IsTrue(loadCount == 4);
            Assert.IsTrue(grenadeCount == 0);
        }