mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
SecondaryAbility's API additions
This commit is contained in:
@ -16,17 +16,12 @@ import com.gmail.nossr50.util.Misc;
|
||||
public class Archery {
|
||||
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
|
||||
|
||||
public static int retrieveMaxBonusLevel = AdvancedConfig.getInstance().getRetrieveMaxBonusLevel();
|
||||
public static double retrieveMaxChance = AdvancedConfig.getInstance().getRetrieveChanceMax();
|
||||
|
||||
public static int skillShotIncreaseLevel = AdvancedConfig.getInstance().getSkillShotIncreaseLevel();
|
||||
public static double skillShotIncreasePercentage = AdvancedConfig.getInstance().getSkillShotIncreasePercentage();
|
||||
public static double skillShotMaxBonusPercentage = AdvancedConfig.getInstance().getSkillShotBonusMax();
|
||||
public static double skillShotMaxBonusDamage = AdvancedConfig.getInstance().getSkillShotDamageMax();
|
||||
|
||||
public static int dazeMaxBonusLevel = AdvancedConfig.getInstance().getDazeMaxBonusLevel();
|
||||
public static double dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
|
||||
public static double dazeMaxBonus = AdvancedConfig.getInstance().getDazeBonusMax();
|
||||
|
||||
public static final double DISTANCE_XP_MULTIPLIER = 0.025;
|
||||
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
@ -26,15 +27,15 @@ public class ArcheryManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canDaze(LivingEntity target) {
|
||||
return target instanceof Player && Permissions.daze(getPlayer());
|
||||
return target instanceof Player && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.DAZE);
|
||||
}
|
||||
|
||||
public boolean canSkillShot() {
|
||||
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.bonusDamage(getPlayer(), skill);
|
||||
return getSkillLevel() >= Archery.skillShotIncreaseLevel && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.SKILL_SHOT);
|
||||
}
|
||||
|
||||
public boolean canTrackArrows() {
|
||||
return Permissions.arrowRetrieval(getPlayer());
|
||||
public boolean canRetrieveArrows() {
|
||||
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.RETRIEVE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,8 +60,8 @@ public class ArcheryManager extends SkillManager {
|
||||
*
|
||||
* @param target The {@link LivingEntity} damaged by the arrow
|
||||
*/
|
||||
public void trackArrows(LivingEntity target) {
|
||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Archery.retrieveMaxChance, Archery.retrieveMaxBonusLevel)) {
|
||||
public void retrieveArrows(LivingEntity target) {
|
||||
if (SkillUtils.activationSuccessful(SecondaryAbilityType.RETRIEVE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
Archery.incrementTrackerValue(target);
|
||||
}
|
||||
}
|
||||
@ -72,7 +73,7 @@ public class ArcheryManager extends SkillManager {
|
||||
* @param arrow The {@link Arrow} that was fired
|
||||
*/
|
||||
public double daze(Player defender, Arrow arrow) {
|
||||
if (!SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Archery.dazeMaxBonus, Archery.dazeMaxBonusLevel)) {
|
||||
if (!SkillUtils.activationSuccessful(SecondaryAbilityType.DAZE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user