public void SetUp() { //Arrange sword = new Sword("Espadon", 50, "Corte Fugaz"); shield = new Shield("Escudo Dorado", 30, "Escudazo"); orc = new Orc("Thor", 25, "Tanque"); axe = new Axe("Hacha", 50, "Corte Rapaz"); warhammer = new Warhammer("Martillo de Guerra", 60, "Martillazo"); dwarf = new Dwarf("Wagner", 35, "Apoyo"); }
public void ShouldReturnCorrectName() { //arrange AllArmor allArmor = new AllArmor(); AllShields allShields = new AllShields(); Battleaxe battleaxe = new Battleaxe(); BrewersSupplies brewersSupplies = new BrewersSupplies(); Dagger dagger = new Dagger(); Darts darts = new Darts(); Handaxe handaxe = new Handaxe(); LightArmor lightArmor = new LightArmor(); LightCrossbow lightCrossbow = new LightCrossbow(); Longbow longbow = new Longbow(); Longsword longsword = new Longsword(); MartialWeapons martialWeapons = new MartialWeapons(); MasonsTools masonsTools = new MasonsTools(); MediumArmor mediumArmor = new MediumArmor(); Quarterstaff quarterstaff = new Quarterstaff(); Shortbow shortbow = new Shortbow(); Shortsword shortsword = new Shortsword(); SimpleWeapons simpleWeapons = new SimpleWeapons(); Sling sling = new Sling(); SmithsTools smithsTools = new SmithsTools(); ThrowingHammer throwingHammer = new ThrowingHammer(); Warhammer warhammer = new Warhammer(); //assert allArmor.Name().Should().Be(new TextObj("All Armor")); allShields.Name().Should().Be(new TextObj("All Shields")); battleaxe.Name().Should().Be(new TextObj("Battleaxe")); brewersSupplies.Name().Should().Be(new TextObj("Brewer's Supplies")); dagger.Name().Should().Be(new TextObj("Dagger")); darts.Name().Should().Be(new TextObj("Darts")); handaxe.Name().Should().Be(new TextObj("Handaxe")); lightArmor.Name().Should().Be(new TextObj("Light Armor")); lightCrossbow.Name().Should().Be(new TextObj("Light Crossbow")); longbow.Name().Should().Be(new TextObj("Longbow")); longsword.Name().Should().Be(new TextObj("Longsword")); martialWeapons.Name().Should().Be(new TextObj("Martial Weapons")); masonsTools.Name().Should().Be(new TextObj("Mason's Tools")); mediumArmor.Name().Should().Be(new TextObj("Medium Armor")); quarterstaff.Name().Should().Be(new TextObj("Quarterstaff")); shortbow.Name().Should().Be(new TextObj("Shortbow")); shortsword.Name().Should().Be(new TextObj("Shortsword")); simpleWeapons.Name().Should().Be(new TextObj("Simple Weapons")); sling.Name().Should().Be(new TextObj("Sling")); smithsTools.Name().Should().Be(new TextObj("Smith's Tools")); throwingHammer.Name().Should().Be(new TextObj("Throwing Hammer")); warhammer.Name().Should().Be(new TextObj("Warhammer")); }
public void SetUp() { //Arrange sword = new Sword("Espada rústica", 50, "Corte Fugaz"); shield = new Shield("Escudo desgastado", 70, "Bloqueo"); orc = new Orc("Azog", 25, "Tanque"); axe = new Axe("Executioner", 50, "Corte decisivo"); warhammer = new Warhammer("Mjölnir", 60, "Ultimatum"); dwarf = new Dwarf("Thorin", 70, "Luchador"); magicStaff = new MagicStaff("Báculo ancestral", 50, "Poder mágico"); spellBook = new SpellBook("Occido Lumen", "Tiene hechizos poderosos"); spell = new Spell("You shall not pass", "Genera una barrera", 0, 70); wizard = new Wizard("Gandalf", "Mago", spellBook); }
public void SetUp() { //Arrange sword = new Sword("Espadon", 50, 0, "Corte Fugaz", false); goldenShield = new GoldenShield("Escudo Dorado", 0, 25, "Escudazo", false); orc = new Orc("Azog", sword, goldenShield, "Tanque"); axe = new Axe("Hacha", 50, 5, "Corte Rapaz", false); warhammer = new Warhammer("Martillo de Guerra", 60, 10, "Martillazo", false); dwarf = new Dwarf("Throrn", axe, warhammer, "Luchador"); magicStaff = new MagicStaff("Báculo ancestral", "Hace hechizos", true); spellBook = new SpellBook("Lumen", "Tiene hechizos", true); spell = new Spell("You shall not pass", "Genera una barrera", true); wizard = new Wizard("Gandalf", magicStaff, spellBook, "Mago"); }
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() + " 🛡"); }
public void SetUp() { warhammer = new Warhammer("Aplastacráneos", 70, 0, "Machacar", false); }
public IWeapon Create(int value) { var random = new Random(); IWeapon Weapon = null; if (value == 1) { switch (random.Next(1, 3)) { case 1: Weapon = new Dagger(); break; case 2: Weapon = new Flail(); break; case 3: Weapon = new Warhammer(); break; } } else if (value == 2) { switch (random.Next(1, 3)) { case 1: Weapon = new Flail(); break; case 2: Weapon = new Warhammer(); break; case 3: Weapon = new Sword(); break; } } else if (value == 3) { switch (random.Next(1, 3)) { case 1: Weapon = new Warhammer(); break; case 2: Weapon = new Sword(); break; case 3: Weapon = new EnchantedDagger(); break; } } else if (value == 4) { switch (random.Next(1, 3)) { case 1: Weapon = new Sword(); break; case 2: Weapon = new EnchantedDagger(); break; case 3: Weapon = new EnchantedFlail(); break; } } else if (value == 5) { switch (random.Next(1, 3)) { case 1: Weapon = new EnchantedDagger(); break; case 2: Weapon = new EnchantedFlail(); break; case 3: Weapon = new EnchantedWarhammer(); break; } } else if (value > 5) { switch (random.Next(1, 3)) { case 1: Weapon = new EnchantedFlail(); break; case 2: Weapon = new EnchantedWarhammer(); break; case 3: Weapon = new EnchantedSword(); break; } } return(Weapon); }