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(); }
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); }