From 608a52399643182ceac138fc8f5ba3d4b5604c73 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 5 Mar 2019 22:01:58 -0800 Subject: [PATCH] Fix zero initialize for Swords config options --- .../java/com/gmail/nossr50/config/AdvancedConfig.java | 10 +++------- .../java/com/gmail/nossr50/skills/swords/Swords.java | 4 +++- .../com/gmail/nossr50/skills/swords/SwordsManager.java | 9 +++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 30a7fe275..ac202c5d2 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -408,7 +408,7 @@ public class AdvancedConfig extends ConfigValidated { reason.add(SKILLS + "." + SWORDS + "." + COUNTER_ATTACK + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } - if (getCounterModifier() < 1) { + if (getCounterAttackModifier() < 1) { reason.add(SKILLS + "." + SWORDS + "." + COUNTER_ATTACK + "." + DAMAGE_MODIFIER + " should be at least 1!"); } @@ -416,10 +416,6 @@ public class AdvancedConfig extends ConfigValidated { reason.add(SKILLS + "." + SWORDS + "." + SERRATED_STRIKES + "." + DAMAGE_MODIFIER + " should be at least 1!"); } - if (getSerratedStrikesTicks() < 1) { - reason.add(SKILLS + "." + SWORDS + "." + SERRATED_STRIKES + "." + RUPTURE + "Ticks should be at least 1!"); - } - /* TAMING */ if (getMaximumProbability(SubSkillType.TAMING_GORE) < 1) { @@ -699,10 +695,10 @@ public class AdvancedConfig extends ConfigValidated { public int getRuptureMaxTicks() { return getIntValue(SKILLS, SWORDS, RUPTURE, MAX_TICKS); } public int getRuptureBaseTicks() { return getIntValue(SKILLS, SWORDS, RUPTURE, BASE_TICKS); } - public double getCounterModifier() { return getDoubleValue(SKILLS, SWORDS, COUNTER_ATTACK, DAMAGE_MODIFIER); } + public double getCounterAttackModifier() { return getDoubleValue(SKILLS, SWORDS, COUNTER_ATTACK, DAMAGE_MODIFIER); } public double getSerratedStrikesModifier() { return getDoubleValue(SKILLS, SWORDS, SERRATED_STRIKES, DAMAGE_MODIFIER); } - public int getSerratedStrikesTicks() { return getIntValue(SKILLS, SWORDS, SERRATED_STRIKES, RUPTURE, TICKS); } + //public int getSerratedStrikesTicks() { return getIntValue(SKILLS, SWORDS, SERRATED_STRIKES, RUPTURE, TICKS); } /* TAMING */ public double getGoreModifier() { return getDoubleValue(SKILLS, TAMING, GORE, MODIFIER); } diff --git a/src/main/java/com/gmail/nossr50/skills/swords/Swords.java b/src/main/java/com/gmail/nossr50/skills/swords/Swords.java index c15d05ab7..4f806077f 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/Swords.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/Swords.java @@ -1,3 +1,4 @@ +/* package com.gmail.nossr50.skills.swords; import com.gmail.nossr50.config.AdvancedConfig; @@ -5,7 +6,8 @@ import com.gmail.nossr50.config.AdvancedConfig; public class Swords { public static int bleedMaxTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); - public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterModifier(); + public static double counterAttackModifier = AdvancedConfig.getInstance().getCounterAttackModifier(); public static double serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier(); } +*/ diff --git a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java index 59be2626b..6bdd8e028 100644 --- a/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.skills.swords; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; @@ -113,8 +114,8 @@ public class SwordsManager extends SkillManager { { int bleedTicks = 2 * RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_RUPTURE); - if(bleedTicks > Swords.bleedMaxTicks) - bleedTicks = Swords.bleedMaxTicks; + if(bleedTicks > AdvancedConfig.getInstance().getRuptureMaxTicks()) + bleedTicks = AdvancedConfig.getInstance().getRuptureMaxTicks(); return bleedTicks; } @@ -127,7 +128,7 @@ public class SwordsManager extends SkillManager { */ public void counterAttackChecks(LivingEntity attacker, double damage) { if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer())) { - CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier, getPlayer()); + CombatUtils.dealDamage(attacker, damage / AdvancedConfig.getInstance().getCounterAttackModifier(), getPlayer()); NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered"); @@ -144,6 +145,6 @@ public class SwordsManager extends SkillManager { * @param damage The amount of damage initially dealt by the event */ public void serratedStrikes(LivingEntity target, double damage, Map modifiers) { - CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Swords.serratedStrikesModifier, modifiers, skill); + CombatUtils.applyAbilityAoE(getPlayer(), target, damage / AdvancedConfig.getInstance().getSerratedStrikesModifier(), modifiers, skill); } }