public void WeaponTriangleSwordBowTest() { //hit, nocrit, miss, nocrit engine.ResetRandomNumbers(); List <int> randNumbs = new List <int> { 99, 99, 0, 0, 0, 0 }; engine.AddRandomNumbers(randNumbs); //sword, axe, lance, bow UnitEntity[] testUnits = DataFactory.GetFE7EngineWeaponTestUnits(); var result = engine.InitiateCombat(testUnits[0], testUnits[3], 1); Assert.AreEqual(result.Count, 2, "Did not have 2 actions"); CombatMissAction cma = result[0] as CombatMissAction; //Did not get a WTA bonus as expected Assert.IsNotNull(cma, "First action wasn't a miss"); result = engine.InitiateCombat(testUnits[0], testUnits[3], 1); CombatHitAction cha = result[0] as CombatHitAction; Assert.AreEqual(cha.AttackerDamage, 1, "Erroneously got weapon triangle bonus damage"); //Did not get a WTA damage bonus as expected //test WTD damage reduction randNumbs = new List <int> { 0, 0, 0, 70, 70, 0 }; engine.AddRandomNumbers(randNumbs); result = engine.InitiateCombat(testUnits[3], testUnits[0], 2); Assert.AreEqual(result.Count, 2, "Did not have 2 actions"); CombatHitAction OneCHA = result[0] as CombatHitAction; //Did not get a WDA penalty as expected Assert.AreEqual(OneCHA.AttackerDamage, 1, "Erroneously got weapon triangle bonus damage"); //Did not get a WDA damage penalty as expected }
public void WeaponTriangleAxeLanceTest() { //hit, nocrit, miss, nocrit engine.ResetRandomNumbers(); List <int> randNumbs = new List <int> { 99, 99, 0, 70, 70, 0 }; engine.AddRandomNumbers(randNumbs); //sword, axe, lance, bow UnitEntity[] testUnits = DataFactory.GetFE7EngineWeaponTestUnits(); var result = engine.InitiateCombat(testUnits[1], testUnits[2], 1); Assert.AreEqual(result.Count, 3, "Did not have 3 actions"); CombatHitAction cha = result[0] as CombatHitAction; //WTA hit increase works correctly. CombatMissAction cma = result[1] as CombatMissAction; //WTD hit reduction works correctly. Assert.IsNotNull(cha, "First action wasn't a hit"); Assert.IsNotNull(cma, "Second action wasn't a miss"); Assert.AreEqual(cha.AttackerDamage, 2, "Didn't get weapon triangle bonus damage"); //WTA damage increase works correctly //test WTD damage reduction randNumbs = new List <int> { 0, 0, 0, 70, 70, 0 }; engine.AddRandomNumbers(randNumbs); result = engine.InitiateCombat(testUnits[2], testUnits[1], 1); Assert.AreEqual(result.Count, 3, "Did not have 3 actions"); CombatHitAction ZeroCHA = result[0] as CombatHitAction; Assert.AreEqual(ZeroCHA.AttackerDamage, 0, "Didn't get weapon triangle damage penalty"); }