示例#1
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.AddSpell("Bola de fuego", 10, 0);
            book.AddSpell("Escudo de maná", 0, 20);

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.SpellsBook = book;
            gandalf.AddItem("Staff", 30, 20);

            Dwarf gimli = new Dwarf("Gimli");

            gimli.AddItem("Helmet", 0, 20);
            gimli.AddItem("Axe", 40, 0);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
        }
示例#2
0
        static void Main(string[] args)
        {
            SpellsBook book   = new SpellsBook();
            WhirlWind  spell1 = new WhirlWind();
            FireBall   spell2 = new FireBall();

            book.AddSpell(spell1);
            book.AddSpell(spell2);

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.AddItem(new Staff());
            gandalf.AddItem(book);

            Dwarf gimli = new Dwarf("Gimli");

            gimli.AddItem(new Axe());
            gimli.AddItem(new Helmet());
            gimli.AddItem(new Shield());

            Console.WriteLine($"Gimli has {gimli.Health} HP points");
            Console.WriteLine($"Gandalf attacks Gimli with {gandalf.AttackValue} points.");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has {gimli.Health} HP");

            gimli.Cure();

            Console.WriteLine($"Gimli has {gimli.Health} HP");
        }
示例#3
0
        static void Main(string[] args)
        {
            SpellsBook book = new SpellsBook();

            book.AddSpell(new SpellOne());
            book.AddSpell(new SpellOne());

            Wizard gandalf = new Wizard("Gandalf");

            gandalf.AddItem(book);

            Dwarf gimli = new Dwarf("Gimli");

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");
            Console.WriteLine($"Gandalf attacks Gimli with ⚔️ {gandalf.AttackValue}");

            gimli.ReceiveAttack(gandalf.AttackValue);

            Console.WriteLine($"Gimli has ❤️ {gimli.Health}");

            gimli.Cure();

            Console.WriteLine($"Someone cured Gimli. Gimli now has ❤️ {gimli.Health}");

            DarkArcher darkArcher = new DarkArcher("Orc Commander");

            darkArcher.Pv = 5;
            DarkBow darkBow = new DarkBow();

            darkArcher.AddItem(darkBow);
            darkArcher.ReceiveAttack(gimli.AttackValue);
            gimli.MorePv(darkArcher.ChechHealth());
        }
示例#4
0
        public void Setup()
        {
            dwarf = new Dwarf("Nacho");
            dwarf.AddItem("Helmet", 0, 20);
            dwarf.AddItem("Shield", 0, 10);

            wizard = new Wizard("Jero");
            SpellsBook book = new SpellsBook();

            book.AddSpell("Bola de fuego", 10, 0);
            book.AddSpell("Escudo de maná", 0, 20);
            wizard.SpellsBook = book;

            knight = new Knight("Rodri");
            knight.AddItem("Sword", 10, 0);

            knight2 = new Knight("Rodrialter");
            knight2.AddItem("Sword", 50, 0);
        }