Player.cs 615 B

123456789101112131415161718192021222324252627282930
  1. namespace D21._1
  2. {
  3. public abstract class Player
  4. {
  5. protected int OrigHitPoints { get; set; }
  6. public int HitPoints { get; set; }
  7. public int Damage { get; set; }
  8. public int Armor { get; set; }
  9. public void Heal() => HitPoints = OrigHitPoints;
  10. }
  11. public class Heroe : Player
  12. {
  13. public Heroe()
  14. {
  15. HitPoints = 100;
  16. OrigHitPoints = 100;
  17. }
  18. }
  19. public class MonsterBoss : Player
  20. {
  21. public MonsterBoss(int hp)
  22. {
  23. HitPoints = hp;
  24. OrigHitPoints = hp;
  25. }
  26. }
  27. }