2013-01-10 15:26:01 +01:00
|
|
|
package com.gmail.nossr50.skills;
|
|
|
|
|
2013-02-01 06:38:25 +01:00
|
|
|
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
2013-01-30 17:53:51 +01:00
|
|
|
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 {
|
2013-02-01 06:38:25 +01:00
|
|
|
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
|
|
|
|
2013-02-01 06:38:25 +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
|
|
|
}
|
|
|
|
|
2013-02-01 06:38:25 +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
|
|
|
}
|