Exemple #1
0
        public void Attack(Human target)
        {
            int damageTaken = Strength * 5;

            target.TotalHealth = target.TotalHealth - damageTaken;
            Console.WriteLine($"{Name} has attacked {target.Name} for {damageTaken} damage!");
            target.DisplayHealth();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Human human1 = new Human("Dave");
            Human human2 = new Human("Steve", 5, 6, 3, 80);

            human1.DisplayHealth();
            human2.DisplayHealth();
            human2.Attack(human1);
        }