2013-03-01 06:52:01 +01:00
|
|
|
package com.gmail.nossr50.skills;
|
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
|
|
|
import com.gmail.nossr50.util.skills.PerksUtils;
|
|
|
|
|
|
|
|
public abstract class SkillManager {
|
|
|
|
protected McMMOPlayer mcMMOPlayer;
|
|
|
|
protected int activationChance;
|
|
|
|
protected SkillType skill;
|
|
|
|
|
|
|
|
public SkillManager(McMMOPlayer mcMMOPlayer, SkillType skill) {
|
|
|
|
this.mcMMOPlayer = mcMMOPlayer;
|
|
|
|
this.activationChance = PerksUtils.handleLuckyPerks(mcMMOPlayer.getPlayer(), skill);
|
|
|
|
this.skill = skill;
|
|
|
|
}
|
|
|
|
|
|
|
|
public McMMOPlayer getMcMMOPlayer() {
|
|
|
|
return mcMMOPlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player getPlayer() {
|
|
|
|
return mcMMOPlayer.getPlayer();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getSkillLevel() {
|
2013-10-29 16:02:57 +01:00
|
|
|
return mcMMOPlayer.getSkillLevel(skill);
|
2013-03-01 06:52:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getActivationChance() {
|
|
|
|
return activationChance;
|
|
|
|
}
|
|
|
|
|
2013-04-24 19:30:46 +02:00
|
|
|
public void applyXpGain(float xp) {
|
2013-03-01 06:52:01 +01:00
|
|
|
mcMMOPlayer.beginXpGain(skill, xp);
|
|
|
|
}
|
|
|
|
}
|