Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class Potion extends Methods{
- public static final Potion STRENGTH = new Potion("Strength potion",new int[0], Constants.STAT_STRENGTH);
- public final int[] IDS;
- public final int SKILL;
- public final String NAME;
- public Potion(String NAME, int[] IDS, int SKILL) {
- this.NAME = NAME;
- this.IDS = IDS;
- this.SKILL = SKILL;
- }
- public boolean needsDrink(){
- return (skills.getCurrentSkillLevel(SKILL) - skills.getRealSkillLevel(SKILL)) <= 2;
- }
- public boolean drinkPotion() {
- for (int p = 0; p < IDS.length; p++) {
- if (getInventoryCount(IDS[p]) >= 1) {
- int ID = IDS[p];
- return atInventoryItem(IDS[p], "");
- }
- }
- return false;
- }
- @Override
- public String toString() {
- return NAME;
- }
- }
Add Comment
Please, Sign In to add comment