Пример #1
0
        static void Main(string[] args)
        {
            Human   Greg    = new Human("Greg");
            Human   Dean    = new Human("Dean");
            Wizard  Gandalf = new Wizard("Gandalf");
            Samurai Tonchu  = new Samurai("Tonchu");

            Greg.Attack(Gandalf);
            Dean.Attack(Tonchu);
            Tonchu.Attack(Dean);
            Gandalf.Attack(Dean);
            Dean.Attack(Tonchu);



            Console.WriteLine(Greg.Dexterity);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Wizard  Nat    = new Wizard("Nat");
            Ninja   Josh   = new Ninja("Josh");
            Human   Balazs = new Human("Balazs");
            Samurai Will   = new Samurai("Will");

            Nat.Attack(Josh);
            Nat.Fireball(Josh);
            Josh.Steal(Nat);
            Will.Attack(Balazs);
            Josh.getAway();
            Nat.Heal();
            Will.Meditate();
            Will.deathBlow(Nat);
            Will.deathBlow(Josh);
        }
Пример #3
0
        static void Main(string[] args)
        {
            Wizard  wizard1  = new Wizard("Wizard 1");
            Ninja   ninja1   = new Ninja("Ninja 1");
            Samurai samurai1 = new Samurai("Samurai 1");

            Console.WriteLine(wizard1.Health);
            ninja1.Attack(wizard1);
            ninja1.Attack(samurai1);
            samurai1.Attack(wizard1);
            Console.WriteLine(samurai1.Health);
            samurai1.Meditate("Samurai 1");
            Console.WriteLine(samurai1.Health);
            wizard1.Heal(ninja1);
            Console.WriteLine(ninja1.Health);
            ninja1.Steal(wizard1);
            Console.WriteLine(ninja1.Health);
        }
Пример #4
0
        static void Main(string[] args)
        {
            Wizard  w1 = new Wizard("Tom");
            Wizard  w2 = new Wizard("Tim");
            Ninja   n1 = new Ninja("Frank");
            Samurai s1 = new Samurai("Josh");

            // w1.Attack(w2);
            s1.Attack(w1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
            n1.Attack(s1);
        }
Пример #5
0
        static void Main(string[] args)
        {
            Human   joe     = new Human("Joe");
            Wizard  gandalf = new Wizard("Gandalf");
            Ninja   naruto  = new Ninja("Naruto");
            Samurai hanzo   = new Samurai("Hanzo");

            Console.WriteLine(hanzo.Health);
            gandalf.Attack(hanzo);
            gandalf.Attack(hanzo);
            naruto.Attack(gandalf);
            hanzo.Attack(naruto);
            gandalf.Heal(gandalf);
            hanzo.Meditate();
            naruto.Steal(hanzo);
            Console.WriteLine(hanzo.Health);
            Console.WriteLine(gandalf.Health);
            Console.WriteLine(naruto.Health);
        }
Пример #6
0
        // Use a switch statement for attack or heal.
        public void Action(string do_this, Wizard w1, Samurai s1, Ninja n1, Human mon)
        {
            Random rand = new Random();

            System.Console.WriteLine("_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_");
            switch (do_this)
            {
            case "a":
                w1.Attack(mon);
                int x = rand.Next(3);
                int y = rand.Next(2);
                if (x == 1)
                {
                    System.Console.WriteLine($"{s1.Name} has decided to help you attack!");
                    s1.Attack(mon);
                }
                else if (x == 2)
                {
                    System.Console.WriteLine($"{n1.Name} has decided to help you attack!");
                    n1.Attack(mon);
                }
                System.Console.WriteLine("-------------------------------------------------");
                if (y == 0)
                {
                    mon.Attack(w1);
                }
                if (y == 1)
                {
                    mon.Attack1(w1);
                }
                break;

            case "h":
                w1.Heal(w1);
                System.Console.WriteLine("-------------------------------------------------");
                mon.Attack(w1);
                break;
            }
            System.Console.WriteLine("-------------------------------------------------");
            mon.GetInfo();
            w1.GetInfo();
            System.Console.WriteLine("_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_");
        }
Пример #7
0
        static void Main(string[] args)
        {
            Wizard  claire = new Wizard("Claire");
            Wizard  troy   = new Wizard("Troy");
            Ninja   frank  = new Ninja("Frank");
            Samurai evan   = new Samurai("Evan");
            Samurai phil   = new Samurai("Phil");

            Console.WriteLine(frank.current_health);
            claire.Fireball(frank);
            claire.Fireball(3);
            evan.Attack(claire);
            claire.Heal();
            evan.DeathBlow(claire);
            evan.HowMany(claire, troy, frank, evan, phil);
            frank.GetAway();
            frank.Stealth(phil);
            troy.Fireball(frank);
            troy.Fireball(frank);
        }