Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class skillInfo {
- public int skillAmount = Skills.SKILL_NAMES.length-1;
- public int[] expStarts = new int[skillAmount];
- public int[] lvlStarts = new int[skillAmount];
- public boolean initialized = false;
- skillInfo() {
- }
- public int getLvl(int skill) {
- check();
- return skills.getCurrentLevel(skill);
- }
- public int getExpToLvl(int skill) {
- check();
- return skills.getExpToNextLevel(skill);
- }
- public int getPercentToLvl(int skill) {
- check();
- return skills.getPercentToNextLevel(skill);
- }
- public int getExpGained(int skill) {
- check();
- return skills.getCurrentExp(skill)-expStarts[skill];
- }
- public int getLvlGained(int skill) {
- check();
- return skills.getRealLevel(skill)-lvlStarts[skill];
- }
- public String getSkillName(int skill) {
- check();
- return Skills.SKILL_NAMES[skill];
- }
- public void check() {
- if (skillsInitialized() && !initialized) {
- initialize();
- }
- }
- public void initialize() {
- for (int i = 0; i < skillAmount; i++) {
- expStarts[i] = skills.getCurrentExp(i);
- lvlStarts[i] = skills.getRealLevel(i);
- }
- initialized = true;
- }
- public boolean skillsInitialized() {
- return skills.getCurrentExp(Skills.CONSTITUTION) > 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement