public void DarknessTest() { // Ensure normal base stats Monster monster = MonsterManager.GetMonsterByName("LegEater"); Assert.IsFalse(monster.HasPermStatus(PermStatus.Darkness)); Assert.AreEqual(60, monster.Accuracy); // Test intended effects: Halves accuracy monster.AddPermStatus(PermStatus.Darkness); Assert.AreEqual(30, monster.Accuracy); monster.RemovePermStatus(PermStatus.Darkness); Assert.AreEqual(60, monster.Accuracy); // Ensure values are rounded down monster.Accuracy = 61; // Temp stat adjustment Assert.AreEqual(61, monster.Accuracy); monster.AddPermStatus(PermStatus.Darkness); Assert.AreEqual(30, monster.Accuracy); monster.RemovePermStatus(PermStatus.Darkness); Assert.AreEqual(61, monster.Accuracy); monster.Accuracy = 60; // Set it back // TODO: Esuna 1, Eyedrops removes status check }
public void HEALTest() { // Setup Spell spell = SpellManager.GetSpellByName("HEAL"); Monster monster = new Monster(); PermStatus[] permStatOrder = { PermStatus.Darkness, PermStatus.Poison, PermStatus.Curse, PermStatus.Amnesia, PermStatus.Toad, PermStatus.Stone, PermStatus.KO }; Dictionary <PermStatus, string> expectedMessages = new Dictionary <PermStatus, string>(); expectedMessages[PermStatus.Darkness] = "Can see"; expectedMessages[PermStatus.Poison] = "Poison left"; expectedMessages[PermStatus.Curse] = "Uncursed"; expectedMessages[PermStatus.Amnesia] = "Remembers"; expectedMessages[PermStatus.Toad] = "Regained form"; expectedMessages[PermStatus.Stone] = "Normal body"; expectedMessages[PermStatus.KO] = ""; // TODO: Find this message // Cast spells up to max spell level, and check that only the proper statuses are removed for (int i = 0; i < 16; i++) { foreach (PermStatus stat in permStatOrder) { monster.AddPermStatus(stat); } SpellManager.CastSpell(monster, monster, spell, i + 1); for (int j = 0; j < (i < 7 ? i : 7); j++) { Assert.IsFalse(monster.HasPermStatus(permStatOrder[j])); } for (int k = i + 1; k < permStatOrder.Length; k++) { Assert.IsTrue(monster.HasPermStatus(permStatOrder[k])); } } // Check that results messages return expected values foreach (PermStatus stat in permStatOrder) { monster.AddPermStatus(stat); SpellResult result = SpellManager.CastSpell(monster, monster, spell, 16); Assert.AreEqual(expectedMessages[stat], result.Results[0]); } // Ensure multiple results messages are returned if multiple statuses are cured PermStatus[] multStat = { PermStatus.Amnesia, PermStatus.Poison, PermStatus.Curse }; foreach (PermStatus status in multStat) { monster.AddPermStatus(status); } SpellResult res = SpellManager.CastSpell(monster, monster, spell, 16); Assert.AreEqual(3, res.Results.Count); foreach (PermStatus status in multStat) { Assert.IsTrue(res.Results.Contains(expectedMessages[status])); } }
public void CurseTest() { // Ensure normal base stats Monster monster = MonsterManager.GetMonsterByName("LegEater"); Assert.IsFalse(monster.HasPermStatus(PermStatus.Curse)); Assert.AreEqual(4, monster.Strength); Assert.AreEqual(0, monster.Defense); // TODO: Spell power // Test intended effects: Halve Offense and defense // TODO: Spell power reduction check monster.Defense = 5; // Temp stat adjustment Assert.AreEqual(5, monster.Defense); monster.AddPermStatus(PermStatus.Curse); Assert.AreEqual(2, monster.Strength); Assert.AreEqual(2, monster.Defense); // Stat reductions round down monster.RemovePermStatus(PermStatus.Curse); Assert.AreEqual(4, monster.Strength); Assert.AreEqual(5, monster.Defense); monster.Defense = 0; // Set it back // TODO: Esuna 3, Cross removes status check }
/// <summary> /// Helper. Add and remove a PermStatus from a monster. /// </summary> /// <param name="monster"></param> /// <param name="permStatus"></param> private void AddRemovePermStatus(Monster monster, PermStatus permStatus) { // Test that the status can be applied and removed monster.AddPermStatus(permStatus); Assert.IsTrue(monster.HasPermStatus(permStatus)); monster.RemovePermStatus(permStatus); Assert.IsFalse(monster.HasPermStatus(permStatus)); }
public void ToadTest() { // Ensure normal base stats Monster monster = MonsterManager.GetMonsterByName("LegEater"); Assert.IsFalse(monster.HasPermStatus(PermStatus.Toad)); // Test that the status can be applied and the monster is removed from battle monster.AddPermStatus(PermStatus.Toad); // TODO: Check for death }
public void AmnesiaTest() { // Ensure normal base stats Monster monster = MonsterManager.GetMonsterByName("LegEater"); Assert.IsFalse(monster.HasPermStatus(PermStatus.Amnesia)); // Test intended effects // TODO: Get monster who can only cast spells (Wizard) to cast a spell monster.AddPermStatus(PermStatus.Amnesia); // TODO: Cast a spell again and get Attack instead monster.RemovePermStatus(PermStatus.Amnesia); // TODO: Cast a spell again and get a spell // TODO: Esuna 4, Mallet removes status check }