Fix zero initialize for Swords config options

This commit is contained in:
nossr50 2019-03-05 22:01:58 -08:00
parent a2e0ca0f84
commit 608a523996
3 changed files with 11 additions and 12 deletions

View File

@ -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); }

View File

@ -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();
}
*/

View File

@ -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<DamageModifier, Double> modifiers) {
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / Swords.serratedStrikesModifier, modifiers, skill);
CombatUtils.applyAbilityAoE(getPlayer(), target, damage / AdvancedConfig.getInstance().getSerratedStrikesModifier(), modifiers, skill);
}
}