예제 #1
0
        static void Main(string[] args)
        {
            Human  HumanX  = new Human("HumanX");
            Wizard WizardY = new Wizard("WizardY");
            Ninja  NinjaZ  = new Ninja("NinjaZ");

            Samurai SamuraiS = new Samurai("SamuraiS");


            System.Console.WriteLine("People created:");
            HumanX.DisplayStats();
            WizardY.DisplayStats();
            NinjaZ.DisplayStats();
            SamuraiS.DisplayStats();

            System.Console.WriteLine("\n\nActions performed:");
            WizardY.Fireball(HumanX);
            NinjaZ.Steal(WizardY);
            NinjaZ.GetAway();
            SamuraiS.DeathBlow(WizardY);
            HumanX.Attack(SamuraiS);
            HumanX.Attack(SamuraiS);
            HumanX.Attack(SamuraiS);
            HumanX.Attack(SamuraiS);
            System.Console.WriteLine($"HumanX attacked {SamuraiS.name}, {SamuraiS.name}'s health is now: {SamuraiS.health}");
            SamuraiS.Meditate();


            System.Console.WriteLine("\n\nAll People's Stats After Actions:");
            HumanX.DisplayStats();
            WizardY.DisplayStats();
            NinjaZ.DisplayStats();
            SamuraiS.DisplayStats();
        }
예제 #2
0
파일: Program.cs 프로젝트: denys-glu/CSharp
        static void Main(string[] args)
        {
            Human   dummy   = new Human("Dummy");
            Wizard  gandalf = new Wizard("Gandalf");
            Ninja   asta    = new Ninja("Asta");
            Samurai jack    = new Samurai("Jack");

            jack.Attack(asta);
            jack.Attack(asta);
            jack.Attack(asta);
            jack.Attack(asta);
            jack.Attack(asta);
            jack.Attack(asta);
            jack.Attack(asta);
            asta.Steal(jack);

            // System.Console.WriteLine($"Gandalf's health is {gandalf.Health} and Intelligence is {gandalf.Intelligence}");

            // System.Console.WriteLine($"Dummy's health is {dummy.Health} and Intelligence is {dummy.Intelligence}");

            // dummy.Attack(gandalf);
            // System.Console.WriteLine($"Gandalf's health after attack is {gandalf.Health}");
            // gandalf.Attack(dummy);
            // System.Console.WriteLine($"Gandalf's health after striking back is {gandalf.Health} and Dummy's health is {dummy.Health}");
            // gandalf.Heal(dummy);
            // System.Console.WriteLine($"Gandalf heals dummy and Dummy's health is {dummy.Health}");
        }
        static void Main(string[] args)
        {
            Wizard  dumbledore = new Wizard("Dumbledore");
            Ninja   donatello  = new Ninja("Donatello");
            Samurai sam        = new Samurai("Shredder");

            donatello.Steal(sam);
        }