mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
SecondaryAbility's API additions
This commit is contained in:
@ -3,15 +3,11 @@ package com.gmail.nossr50.skills.swords;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
|
||||
public class Swords {
|
||||
public static int bleedMaxBonusLevel = AdvancedConfig.getInstance().getBleedMaxBonusLevel();
|
||||
public static int bleedMaxTicks = AdvancedConfig.getInstance().getBleedMaxTicks();
|
||||
public static int bleedBaseTicks = AdvancedConfig.getInstance().getBleedBaseTicks();
|
||||
public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
|
||||
|
||||
public static boolean counterAttackRequiresBlock = AdvancedConfig.getInstance().getCounterRequiresBlock();
|
||||
public static int counterAttackMaxBonusLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
|
||||
public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier();
|
||||
public static double counterAttackMaxChance = AdvancedConfig.getInstance().getCounterChanceMax();
|
||||
|
||||
public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
||||
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
||||
|
@ -4,8 +4,10 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.ToolType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
@ -26,11 +28,11 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
|
||||
public boolean canUseBleed() {
|
||||
return Permissions.bleed(getPlayer());
|
||||
return Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.BLEED);
|
||||
}
|
||||
|
||||
public boolean canUseCounterAttack(Entity target) {
|
||||
return target instanceof LivingEntity && Permissions.counterAttack(getPlayer());
|
||||
return target instanceof LivingEntity && Permissions.secondaryAbilityEnabled(getPlayer(), SecondaryAbilityType.COUNTER);
|
||||
}
|
||||
|
||||
public boolean canUseSerratedStrike() {
|
||||
@ -43,9 +45,9 @@ public class SwordsManager extends SkillManager {
|
||||
* @param target The defending entity
|
||||
*/
|
||||
public void bleedCheck(LivingEntity target) {
|
||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Swords.bleedMaxChance, Swords.bleedMaxBonusLevel)) {
|
||||
if (SkillUtils.activationSuccessful(SecondaryAbilityType.BLEED, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
|
||||
if (getSkillLevel() >= Swords.bleedMaxBonusLevel) {
|
||||
if (getSkillLevel() >= AdvancedConfig.getInstance().getMaxBonusLevel(SecondaryAbilityType.BLEED)) {
|
||||
BleedTimerTask.add(target, Swords.bleedMaxTicks);
|
||||
}
|
||||
else {
|
||||
@ -77,7 +79,7 @@ public class SwordsManager extends SkillManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SkillUtils.activationSuccessful(getSkillLevel(), getActivationChance(), Swords.counterAttackMaxChance, Swords.counterAttackMaxBonusLevel)) {
|
||||
if (SkillUtils.activationSuccessful(SecondaryAbilityType.COUNTER, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier);
|
||||
|
||||
getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||
|
Reference in New Issue
Block a user