mcMMO/src/main/java/com/gmail/nossr50/skills/SkillManager.java

31 lines
916 B
Java
Raw Normal View History

2013-01-10 15:26:01 +01:00
package com.gmail.nossr50.skills;
import com.gmail.nossr50.datatypes.McMMOPlayer;
import com.gmail.nossr50.skills.utilities.SkillType;
2013-01-22 02:01:33 +01:00
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
2013-01-10 15:26:01 +01:00
public abstract class SkillManager {
protected McMMOPlayer mcMMOPlayer;
2013-01-10 15:26:01 +01:00
protected int skillLevel;
2013-01-22 02:01:33 +01:00
protected int activationChance;
2013-01-10 15:26:01 +01:00
public SkillManager(McMMOPlayer mcMMOPlayer, SkillType skill) {
this.mcMMOPlayer = mcMMOPlayer;
this.skillLevel = mcMMOPlayer.getProfile().getSkillLevel(skill);
this.activationChance = Misc.calculateActivationChance(Permissions.lucky(mcMMOPlayer.getPlayer(), skill));
2013-01-10 15:26:01 +01:00
}
public McMMOPlayer getMcMMOPlayer() {
return mcMMOPlayer;
2013-01-10 15:26:01 +01:00
}
public int getSkillLevel() {
return skillLevel;
}
2013-01-22 02:01:33 +01:00
public int getActivationChance() {
return activationChance;
}
2013-01-10 15:26:01 +01:00
}