示例#1
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());
        }