Guest User

Untitled

a guest
Jul 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. static class Potion extends Methods{
  2.  
  3. public static final Potion STRENGTH = new Potion("Strength potion",new int[0], Constants.STAT_STRENGTH);
  4.  
  5. public final int[] IDS;
  6. public final int SKILL;
  7. public final String NAME;
  8.  
  9. public Potion(String NAME, int[] IDS, int SKILL) {
  10. this.NAME = NAME;
  11. this.IDS = IDS;
  12. this.SKILL = SKILL;
  13. }
  14.  
  15. public boolean needsDrink(){
  16. return (skills.getCurrentSkillLevel(SKILL) - skills.getRealSkillLevel(SKILL)) <= 2;
  17. }
  18.  
  19. public boolean drinkPotion() {
  20. for (int p = 0; p < IDS.length; p++) {
  21. if (getInventoryCount(IDS[p]) >= 1) {
  22. int ID = IDS[p];
  23. return atInventoryItem(IDS[p], "");
  24. }
  25. }
  26. return false;
  27. }
  28.  
  29. @Override
  30. public String toString() {
  31. return NAME;
  32. }
  33. }
Add Comment
Please, Sign In to add comment