Advertisement
WupEly

Untitled

Jan 25th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. class Artefact
  2. {
  3. string name;
  4. int damage;
  5. int hpInfluence;
  6. int armorInfluence;
  7. int price;
  8.  
  9. //Инициализатор
  10. public Artefact(string name, int damage, int hpInfluence, int armorInfluence, int price)
  11. {
  12. this.name = name;
  13. this.damage = damage;
  14. this.hpInfluence = hpInfluence;
  15. this.armorInfluence = armorInfluence;
  16. this.price = price;
  17.  
  18.  
  19. }
  20. public int discountPrice(int discount)
  21. {
  22. discount = discount / 100;
  23. return (price - (price / discount));
  24.  
  25. }
  26. public int getDamage(int damage)
  27. {
  28.  
  29. return (this.damage + damage);
  30.  
  31. }
  32. public int getHp(int hp)
  33. {
  34. return (hp + this.hpInfluence);
  35. }
  36. public int getArmor(int armor)
  37. {
  38. return (armor + armorInfluence);
  39. }
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement