Ejemplo n.º 1
0
        public static void builder()
        {
            Mage mage = new Mage();

            MagicStaff fireMagicStaff     = mage.CreateMagicStaff(new FireMagicStaffBuilder());
            MagicStaff drakonidMagicStaff = mage.CreateMagicStaff(new DrakonidMagicStaffBuilder());

            Console.WriteLine(fireMagicStaff);
            Console.WriteLine(drakonidMagicStaff);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            //Arrange
            magicStaff = new MagicStaff("Varita", "Hace hechizos", true);
            spellBook  = new SpellBook("Libro", "Tiene hechizos", true);
            spell      = new Spell("Wingardium Leviosa", "Hace levitar objetos", true);
            wizard     = new Wizard("Hermione", magicStaff, spellBook, "Mago");

            goldenShield = new GoldenShield("GoldenShield", 0, 30, "Escudo Protector", false);
            sword        = new Sword("Katana", 50, 0, "Corte Fugaz", false);
            orc          = new Orc("Grom", sword, goldenShield, "Tanque");
        }
        public void SetUp()
        {
            //Arrange
            magicStaff = new MagicStaff("Varita", 10, "Hace hechizos");
            spellBook  = new SpellBook("Libro", "Tiene hechizos");
            spell      = new Spell("Wingardium Leviosa", "Hace levitar objetos", 10, 10);
            wizard     = new Wizard("Hermione", "Mago", spellBook);

            shield = new Shield("GoldenShield", 30, "Escudo Protector");
            sword  = new Sword("Katana", 50, "Corte Fugaz");
            orc    = new Orc("Grom", 10, "Tanque");
            orc.Equip(shield);
            orc.Equip(sword);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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() + " 🛡");
        }
Ejemplo n.º 8
0
 public void SetUp()
 {
     magicStaff = new MagicStaff("Accio", "Atrae un objeto", true);
 }
Ejemplo n.º 9
0
        public void TestThatBoltQuiverCannotBeEquippedWhenNonCrossBowIsInMainHand()
        {
            PlayerEquipmentSlots playerEquipment   = new PlayerEquipmentSlots();
            EquipmentClass       mainHandEquipment = new OneHandedSword();

            EquipmentClass offHand = new BoltQuiver();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            EquipmentClass offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new OneHandedMace();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new Wand();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new TwoHandedSword();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new TwoHandedMace();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new MagicStaff();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new Bow();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new CrossBow();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(offHand);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.EqualTo(offHand));
        }
Ejemplo n.º 10
0
        public void TestThatMagicStaffsCannotBeEquippedWithOffHands()
        {
            EquipmentClass testCandidate = new MagicStaff();

            TestThatTwoHandedWeaponsCannotBeEquippedWithOffHands(testCandidate);
        }
Ejemplo n.º 11
0
        public void TestThatMagicStaffCanBeEquippedInMainHandWithNothingPresent()
        {
            EquipmentClass testCandidate = new MagicStaff();

            EquipInMainHandAndTestThatItIsOccupied(testCandidate);
        }
Ejemplo n.º 12
0
        private void TestThatOffHanderCanOnlyBeEquippedWithOneHander(EquipmentClass firstOffHanderInstance, EquipmentClass secondOffHanderInstance)
        {
            PlayerEquipmentSlots playerEquipment = new PlayerEquipmentSlots();

            EquipmentClass mainHandEquipment = new TwoHandedSword();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            EquipmentClass offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new TwoHandedMace();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new MagicStaff();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new Bow();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new CrossBow();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.Null);

            mainHandEquipment = new OneHandedSword();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.EqualTo(firstOffHanderInstance));

            mainHandEquipment = new OneHandedMace();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(secondOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.EqualTo(secondOffHanderInstance));

            mainHandEquipment = new Wand();

            playerEquipment.EquipInMainHand(mainHandEquipment);
            playerEquipment.EquipInOffHand(firstOffHanderInstance);

            offHandEquipment = playerEquipment.GetOffHandEquipment();

            Assert.That(offHandEquipment, Is.EqualTo(firstOffHanderInstance));
        }