redSkywalker

R.Sakutin_задача_3

Feb 15th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Wombat{
  2.     public int Health;
  3.     public int Armor;
  4.  
  5.     public void TakeDamage(int damage){
  6.         Health -= damage - armor;
  7.         if(Health <= 0){
  8.             Console.WriteLine("Я умер");
  9.         }
  10.     }
  11. }
  12.  
  13. class Human{
  14.     public int Health;
  15.     public int Agility;
  16.  
  17.     public void TakeDamage(int damage){
  18.         Health -= damage / Agility;
  19.         if(Health <= 0){
  20.             Console.WriteLine("Я умер");
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment