Advertisement
Guest User

Combat Object Class

a guest
May 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. public class CombatObject
  2. {
  3. private int HP;
  4. private Weapon main;
  5. private Weapon secondary;
  6. private int ad;
  7. private int spe;
  8. private int cHP;//current hp
  9. private char ch1r;
  10. public CombatObject(MC player)
  11. {
  12. HP = player.getHP();
  13. main = player.getWeapon();
  14. secondary = player.getSecondary();
  15. ad = main.getAtk();
  16. ch1r = '@';
  17. }
  18. public CombatObject(int hp, int sp, int a, char e)
  19. {
  20. HP = hp;
  21. spe = sp;
  22. ad = a;
  23. ch1r = e;
  24. }
  25. //accessor methods
  26. public int getHP()
  27. {
  28. return HP;
  29. }
  30. public Weapon getMain()
  31. {
  32. return main;
  33. }
  34. public Weapon getSecondary()
  35. {
  36. return secondary;
  37. }
  38. public int getAd()
  39. {
  40. return ad;
  41. }
  42. public int getSpe()
  43. {
  44. return spe;
  45. }
  46. public int getCurHP()
  47. {
  48. return cHP;
  49. }
  50. public char getChar()
  51. {
  52. return ch1r;
  53. }
  54. //editor methods
  55. public void setHP(int a)
  56. {
  57. HP = a;
  58. }
  59. public void setMain(Weapon a)
  60. {
  61. main = a;
  62. }
  63. public void setSecondary(Weapon a)
  64. {
  65. secondary = a;
  66. }
  67. public void setAd(int a)
  68. {
  69. ad = a;
  70. }
  71. public void setSpe(int a)
  72. {
  73. spe = a;
  74. }
  75. public void setCurHP(int a)
  76. {
  77. cHP = a;
  78. }
  79. public void setChar(char e)
  80. {
  81. ch1r = e;
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement