public void TourLastingTest() { var game = CreateGame(); var scroll = new Scroll(SpellKind.ManaShield); var spell = scroll.CreateSpell(game.Hero) as ManaShieldSpell; Assert.AreEqual(spell.TurnLasting, 5); }
public void TestDescriptions() { var game = CreateGame(); var scroll = new Scroll(SpellKind.IronSkin); var spell = scroll.CreateSpell(game.Hero); var castedSpell = spell as PassiveSpell; var features = castedSpell.CreateSpellStatsDescription(true, false); Assert.NotNull(features); Assert.AreEqual(Math.Round(castedSpell.StatKindEffective.Value, 3), 3.1); Assert.AreEqual(castedSpell.StatKindPercentage.Value, 31); //Assert.AreEqual(features[1], "Defense: +" + (BaseFactor + 1) + "%"); }
public void SpellPropertiesTest() { var game = CreateGame(); var hero = game.Hero; { var fireBallScroll = new Scroll(Roguelike.Spells.SpellKind.FireBall); var spell = fireBallScroll.CreateSpell <OffensiveSpell>(hero); Assert.Greater(spell.Damage, 0); } { var fireBallBook = new Book(Roguelike.Spells.SpellKind.FireBall); var spellFromBook = fireBallBook.CreateSpell <OffensiveSpell>(hero); Assert.Greater(spellFromBook.Damage, 0); } }
public void TeleportDescTest() { var game = CreateGame(); var scroll = new Scroll(SpellKind.Teleport); var spell = scroll.CreateSpell <TeleportSpell>(game.Hero); Assert.AreEqual(spell.Duration, 0); Assert.Greater(spell.Range, 0); Assert.Greater(spell.ManaCost, 0); var desc = spell.CreateSpellStatsDescription(true).GetEntityStats(); Assert.AreEqual(desc.Count(), 2); Assert.AreEqual(desc[0].Kind, Roguelike.Attributes.EntityStatKind.Mana); Assert.AreEqual(desc[1].Kind, Roguelike.Attributes.EntityStatKind.ElementalProjectilesRange); }