Пример #1
0
 // add a public "getter" property to access health
 // Add a constructor that takes a value to set Name, and set the remaining fields to default values
 // Add a constructor to assign custom values to all fields
 // Build Attack method
 public int Attack(Human target)
 {
     target.Health -= 5 * this.Strength;
     return(target.Health);
 }
Пример #2
0
 public override void Attack(Human player)
 {
     player.health = player.health - (strength * intelligence);
     System.Console.WriteLine($"{player.name} lost {(strength * intelligence)} health and was poisoned! {player.health} hp remaining.");
     player.poisoned += 3;
 }
Пример #3
0
 public void Steal(Human target)
 {
     target.Health -= 5;
     Health        += 5;
     Console.WriteLine("You stole 5 health form " + target.Name);
 }
Пример #4
0
 public void Heal(Human target)
 {
     target.Health += 10;
     Console.WriteLine("You healed " + target.Name);
 }
Пример #5
0
 public void Steal(Human target)
 {
     target.Health -= 5;
     this.Health   += 5;
 }