Jump to content

Potion data


Recommended Posts

Posted (edited)

Wrote some potion data. The potion class is missing some methods but I'm sure you can add them yourself. 

It should be possible to add other boosting items like brews and such. 

constructive criticism is welcome.

Potion class:

package data;

import wrappers.IncreaseValue;
import wrappers.PotionInfo;


import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.MethodProvider;



public class Potions {
	
	
	
	
	public enum Potion{
		ATTACK_POTION( new PotionInfo()
				      .add(Skill.ATTACK , new IncreaseValue(3,10))),
		
		SUPER_ATTACK( new PotionInfo()
				.add(Skill.ATTACK, new IncreaseValue(5,15))),
		
		STRENGTH_POTION(new PotionInfo()
				.add(Skill.STRENGTH, new IncreaseValue(3,10))),
		
		SUPER_STRENGTH(new PotionInfo()
				.add(Skill.STRENGTH, new IncreaseValue(5,15))),
		
		COMBAT_POTION(new PotionInfo()
				.add(Skill.STRENGTH, new IncreaseValue(3,10))
		        .add(Skill.ATTACK , new IncreaseValue(3,10))),
		
		SUPER_COMBAT_POTION(new PotionInfo()
				.add(Skill.ATTACK, new IncreaseValue(5,15))
				.add(Skill.ATTACK, new IncreaseValue(5,15))
		        .add(Skill.DEFENCE , new IncreaseValue(5,15))),
		
		DEFENCE_POTION(new PotionInfo()
				.add(Skill.DEFENCE , new IncreaseValue(3,10))),
		
		SUPER_DEFENCE(new PotionInfo()
				.add(Skill.DEFENCE , new IncreaseValue(5,15))),
		
		RANGING_POTION(new PotionInfo()
				.add(Skill.RANGED , new IncreaseValue(3,10))),
		
		SUPER_RANGING(new PotionInfo()
				.add(Skill.RANGED, new IncreaseValue(5,15))),
		
		MAGIC_POTION(new PotionInfo()
				.add(Skill.MAGIC, new IncreaseValue(3,10))),
		
		SUPER_MAGIC(new PotionInfo()
				.add(Skill.MAGIC, new IncreaseValue(5,15))),
		PRAYER_POTION(new PotionInfo()
				.add(Skill.PRAYER, new IncreaseValue(7,25)));
		
		
	 
		PotionInfo potionInfo;

		Potion( PotionInfo potionInfo) {
			this.potionInfo = potionInfo;
		}
		
		public PotionInfo getPotionInfo() {
			return potionInfo;
		}
		
		public String getPotionName() {
			String lower = super.toString().toLowerCase().replace("_", " ");
			return Character.toUpperCase(lower.charAt(0)) + lower.substring(1);
		}
		
	}

IncreaseValue class:

package wrappers;

public class IncreaseValue {

    int baseIncrease;
	int percentageIncrease;
	
	public IncreaseValue(int baseIncrease, int percentageIncrease) {
		this.baseIncrease = baseIncrease;
		this.percentageIncrease = percentageIncrease;
	}
	
	public int getBaseIncrease() {
		return baseIncrease;
	}
	
	public int getPercentageIncrease() {
		return percentageIncrease;
	}
	
}

PotionInfo class:

package wrappers;

import java.util.HashMap;
import java.util.Map;
import wrappers.IncreaseValue;

import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.MethodProvider;

public class PotionInfo {

	Map<Skill, IncreaseValue> boostMap = new HashMap();

	public PotionInfo add(Skill skill, IncreaseValue levelIncrease) {
		boostMap.put(skill, levelIncrease);
		return this;
	}

}

 

Edited by Jammer
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...