public void AtackCheckHealthEnemy() //Se prueba que el valor total de la vida del enemigo sea el esperado despues de recibir un ataque por el enano. { //Act int expectedHealthLeftEnemy = 270 - 180; orc.Equip(shield); dwarf.Equip(axe); dwarf.Equip(warhammer); dwarf.Attack(orc); //Assert Assert.AreEqual(expectedHealthLeftEnemy, orc.Health); }
public void PuttingAttackItemInTest() { Dwarf gimli = new Dwarf(); Orc dummy1 = new Orc(); dummy1.ReceiveDamage(gimli.Attack()); Orc dummy2 = new Orc(); BasicSword sword = new BasicSword(); gimli.AddItem(sword); dummy2.ReceiveDamage(gimli.Attack()); Assert.AreEqual(dummy1.HealthActual - dummy2.HealthActual, sword.AttackPower); }
public void TwoAttackItemsTest() { Dwarf gimli = new Dwarf(); Orc dummy1 = new Orc(); dummy1.ReceiveDamage(gimli.Attack()); Orc dummy2 = new Orc(); BasicSword sword = new BasicSword(); StygianBlade sword2 = new StygianBlade(); gimli.AddItem(sword); gimli.AddItem(sword2); dummy2.ReceiveDamage(gimli.Attack()); Assert.AreEqual(dummy1.HealthActual - dummy2.HealthActual, sword.AttackPower + sword2.AttackPower); }
public void T3_create_a_dwarf_character_with_a_Name() { var dwarf = new Dwarf(0) { Name = "Gonar" }; var attack = dwarf.Attack(); dwarf.Name.Should().Be("Gonar"); attack.Quantity.Should().Be(dwarf.NormalDamage); attack.Type.Should().Be(DamageTypes.Physical); }
public void DarkSwordTest() { Gem gem1 = new Gem("Fire Gem"); Gem gem2 = new Gem("Earth Gem"); DarkSword sword = new DarkSword(); Dwarf gimli = new Dwarf(); Orc dummy1 = new Orc(); Orc dummy2 = new Orc(); Orc dummy3 = new Orc(); gimli.AddItem(sword); dummy1.ReceiveDamage(gimli.Attack()); sword.AddGem(gem1); dummy2.ReceiveDamage(gimli.Attack()); sword.AddGem(gem2); dummy3.ReceiveDamage(gimli.Attack()); Assert.IsTrue(dummy3.HealthActual < dummy2.HealthActual && dummy2.HealthActual < dummy1.HealthActual); }
void Update() { if (Input.GetButtonDown(appendPlayerSuffix("Jump"))) { Debug.Log(appendPlayerSuffix("Jump")); dwarf.Jump(); } if (Input.GetAxis(appendPlayerSuffix("Attack")) == 1) { Debug.Log(appendPlayerSuffix("Attack")); dwarf.Attack(); } }
public void AtackCheckHealthEnemy() /*Se prueba que el valor total de la vida del enemigo sea el esperado * despues de recibir un ataque por el enano.*/ { int expectedHealthLeftEnemy = 90; //Act dwarf.Attack(orc); //Assert Assert.AreEqual(expectedHealthLeftEnemy, orc.Health); }
public void HealthReductedTest() { Dwarf gimli = new Dwarf(); StygianBlade sword = new StygianBlade(); Orc dummy = new Orc(); GoldenCoat coat = new GoldenCoat(); gimli.AddItem(sword); dummy.AddItem(coat); dummy.ReceiveDamage(gimli.Attack()); Assert.AreEqual(dummy.HealthMax - dummy.HealthActual, gimli.BaseAttackPower + sword.AttackPower - dummy.BaseDefensePower - coat.DefensePower); }
public void T7_a_drunk_dwarf_character_make_less_damage() { var character = new Dwarf(50) { Name = "Gonar" }; var characterClass = new Wizard(character); var baseDamage = character.Attack(); var damages = characterClass.Attack(); character.Name.Should().Be("Gonar"); characterClass.Should().BeOfType <Wizard>(); damages.Quantity.Should().Be(baseDamage.Quantity + characterClass.Damages.Quantity); damages.Type.Should().Be(characterClass.Damages.Type); }
static void Main(string[] args) { GoldenShield goldenShield = new GoldenShield("GoldenShield", 0, 25, "Escudo Protector", false); Sword sword1 = new Sword("Katana", 50, 0, "Corte Fugaz", false); Orc orc = new Orc("Grom", sword1, goldenShield, "Tanque"); Sword sword2 = new Sword("Excalibur", 10, 0, "Corte Diagonal", false); orc.AttachSword(sword2); InvisibilityCloak invisibilityCloak = new InvisibilityCloak("Capa maxima", 0, 85, "Invisibilidad", false); Bow bow1 = new Bow("Arco gigante", 75, 5, "Tira fuego", false); Elf elf = new Elf("Frank", bow1, invisibilityCloak, "Escurridizo"); Bow bow2 = new Bow("Arco", 60, 5, "Automatico", false); elf.AttachBow(bow2); MagicStaff magicStaff = new MagicStaff("Varita", "Es mágica(?)", true); SpellBook spellBook = new SpellBook("Libro de Hechizos", "Tiene hechizos(?)", true); Wizard wizard = new Wizard("Harry", magicStaff, spellBook, "Support"); Spell spell = new Spell("Lumos", "La varita enciende luz", true); wizard.LearnSpell(spell); Axe axe1 = new Axe("El ejecutor", 65, 5, "Hacha giratoria", false); Axe axe2 = new Axe("Verdugo", 70, 0, "Juicio final", false); Warhammer warhammer = new Warhammer("Mjölnir", 90, 10, "Aplastar y machacar", false); Dwarf dwarf = new Dwarf("Thorin", axe1, warhammer, "Luchador"); dwarf.AttachAxe(axe2); wizard.Attack(orc); orc.Attack(dwarf); wizard.HealOrc(orc); dwarf.Attack(orc); dwarf.HealWizard(wizard); elf.Attack(orc); }
static void Main(string[] args) { Shield shield = new Shield("Golden Shield", 75, "Escudo Protector"); Sword sword = new Sword("Katana", 125, "Corte Fugaz"); Orc orc = new Orc("Grom", 25, "Tanque"); orc.Equip(sword); orc.Equip(shield); Axe axe = new Axe("Verdugo", 70, "Juicio final"); Warhammer warhammer = new Warhammer("Mjölnir", 90, "Aplastar y machacar"); Dwarf dwarf = new Dwarf("Thorin", 35, "Luchador"); dwarf.Equip(axe); dwarf.Equip(warhammer); Bow bow = new Bow("Arco gigante", 75, "Tira fuego"); Cloak cloak = new Cloak("Capa maxima", 85, "Invisibilidad"); Elf elf = new Elf("Galardiel", 15, "Escurridizo"); elf.Equip(bow); elf.Equip(cloak); SpellBook spellBook = new SpellBook("Libro de Hechizos Oscuros", "Hechizos oscuros"); Spell spell = new Spell("Lumos", "La varita enciende luz", 65, 0); MagicStaff magicStaff = new MagicStaff("Baculo Oscuro", 150, "Baculo perdido de Toran"); Wizard wizard = new Wizard("Harry", "Mago De Apoyo", spellBook); dwarf.Attack(orc); Console.WriteLine("👳 " + dwarf.Name + " cura a 🤢 " + orc.Name); dwarf.HealCharacter(orc); Console.WriteLine(); orc.Attack(wizard); wizard.Respawn(); Console.WriteLine(wizard.Name + " ha respawneado"); Console.WriteLine("La vida actual de 🧙 " + wizard.Name + " ahora es: " + wizard.Health + " ❤"); Console.WriteLine(); elf.UnEquip(bow); elf.Equip(sword); Console.WriteLine("El daño total que causa 🧝♀️ " + elf.Name + " es: " + elf.TotalDamage() + " 🗡"); Console.WriteLine("La protección total de 🧝♀️ " + elf.Name + " es: " + elf.TotalProtection() + " 🛡"); Console.WriteLine(); orc.UnEquip(sword); orc.Equip(axe); Console.WriteLine("El daño total que causa 🤢 " + orc.Name + " es: " + orc.TotalDamage() + " 🗡"); Console.WriteLine("La protección total de 🤢 " + orc.Name + " es: " + orc.TotalProtection() + " 🛡"); Console.WriteLine(); dwarf.UnEquip(axe); dwarf.Equip(shield); Console.WriteLine("El daño total que causa 👳 " + dwarf.Name + " es: " + dwarf.TotalDamage() + " 🗡"); Console.WriteLine("La protección total de 👳 " + dwarf.Name + " es: " + dwarf.TotalProtection() + " 🛡"); Console.WriteLine(); wizard.Equip(magicStaff); wizard.Equip(spellBook); wizard.LearnSpell(spell); Console.WriteLine(); Console.WriteLine("El daño total que causa 🧙 " + wizard.Name + " es: " + wizard.TotalDamage() + " 🗡"); Console.WriteLine("La protección total de 🧙 " + wizard.Name + " es: " + wizard.TotalProtection() + " 🛡"); Console.WriteLine(); wizard.UnEquip(magicStaff); Console.WriteLine(); wizard.Equip(sword); wizard.Equip(shield); Console.WriteLine("Se añadieron los items: " + sword.Name + " y " + shield.Name + " al inventario de " + wizard.Name); Console.WriteLine("El daño total que causa 🧙 " + wizard.Name + " ahora es: " + wizard.TotalDamage() + " 🗡"); Console.WriteLine("La protección total de 🧙 " + wizard.Name + " ahora es: " + wizard.TotalProtection() + " 🛡"); }