From 9b6e6d7861a88715642c5431ecc37f45d165f6d3 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 23 Sep 2019 12:34:00 -0700 Subject: [PATCH] Add missing limit break settings --- .../skills/acrobatics/ConfigAcrobatics.java | 2 +- .../skills/swords/ConfigSwordsLimitBreak.java | 17 +++++++++++++++++ .../skills/swords/ConfigSwordsSubSkills.java | 7 +++++++ .../hocon/skills/unarmed/ConfigUnarmed.java | 4 ++-- .../skills/unarmed/ConfigUnarmedLimitBreak.java | 17 +++++++++++++++++ ...bskills.java => ConfigUnarmedSubSkills.java} | 8 +++++++- .../skills/subskills/acrobatics/Roll.java | 6 +++--- 7 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsLimitBreak.java create mode 100644 src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedLimitBreak.java rename src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/{ConfigUnarmedSubskills.java => ConfigUnarmedSubSkills.java} (67%) diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java index 6d4153a54..23163b469 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java @@ -24,7 +24,7 @@ public class ConfigAcrobatics { return subSkills.getDodge(); } - public double getRollDamageTheshold() { + public double getRollDamageThreshold() { return getRoll().getDamageTheshold(); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsLimitBreak.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsLimitBreak.java new file mode 100644 index 000000000..4fce2c9fa --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsLimitBreak.java @@ -0,0 +1,17 @@ +package com.gmail.nossr50.config.hocon.skills.swords; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigSwordsLimitBreak { + private static final boolean DEFAULT_PVE = false; + + @Setting(value = "PVE", comment = "If true, the bonus damage from Limit Break will apply to PVE in addition to PVP." + + "\nDefault value: "+DEFAULT_PVE) + private boolean PVE = DEFAULT_PVE; + + public boolean isEnabledForPVE() { + return PVE; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsSubSkills.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsSubSkills.java index dfa5deea4..046e43579 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsSubSkills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/swords/ConfigSwordsSubSkills.java @@ -16,6 +16,9 @@ public class ConfigSwordsSubSkills { @Setting(value = "Serrated-Strikes") private ConfigSwordsSerratedStrikes serratedStrikes = new ConfigSwordsSerratedStrikes(); + @Setting(value = "Limit-Break") + private ConfigSwordsLimitBreak swordsLimitBreak = new ConfigSwordsLimitBreak(); + public ConfigSwordsCounterAttack getCounterAttack() { return counterAttack; } @@ -63,4 +66,8 @@ public class ConfigSwordsSubSkills { public int getRuptureBaseTicks() { return rupture.getRuptureBaseTicks(); } + + public ConfigSwordsLimitBreak getSwordsLimitBreak() { + return swordsLimitBreak; + } } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmed.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmed.java index b4cb97d75..0525635ce 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmed.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmed.java @@ -10,14 +10,14 @@ public class ConfigUnarmed { private static final boolean ITEMS_COUNT_AS_UNARMED_DEFAULT = true; @Setting(value = ConfigConstants.SUB_SKILL_NODE) - private ConfigUnarmedSubskills subskills = new ConfigUnarmedSubskills(); + private ConfigUnarmedSubSkills subskills = new ConfigUnarmedSubSkills(); @Setting(value = "Items-Count-As-Unarmed", comment = "Unarmed skills will work even if you are holding an item." + "\nMost tools are not considered an item, for example pickaxes, tridents, swords, etc won't count as unarmed with this setting enabled." + "\nDefault value: "+ITEMS_COUNT_AS_UNARMED_DEFAULT) private boolean doItemsCountAsUnarmed = ITEMS_COUNT_AS_UNARMED_DEFAULT; - public ConfigUnarmedSubskills getSubskills() { + public ConfigUnarmedSubSkills getSubSkills() { return subskills; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedLimitBreak.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedLimitBreak.java new file mode 100644 index 000000000..3feff5c35 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedLimitBreak.java @@ -0,0 +1,17 @@ +package com.gmail.nossr50.config.hocon.skills.unarmed; + +import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; + +@ConfigSerializable +public class ConfigUnarmedLimitBreak { + private static final boolean DEFAULT_PVE = false; + + @Setting(value = "PVE", comment = "If true, the bonus damage from Limit Break will apply to PVE in addition to PVP." + + "\nDefault value: "+DEFAULT_PVE) + private boolean PVE = DEFAULT_PVE; + + public boolean isEnabledForPVE() { + return PVE; + } +} diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubskills.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubSkills.java similarity index 67% rename from src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubskills.java rename to src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubSkills.java index 1423e84bc..51fa31c49 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubskills.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/unarmed/ConfigUnarmedSubSkills.java @@ -4,11 +4,13 @@ import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @ConfigSerializable -public class ConfigUnarmedSubskills { +public class ConfigUnarmedSubSkills { @Setting(value = "Disarm") public ConfigUnarmedDisarm disarm = new ConfigUnarmedDisarm(); + public ConfigUnarmedLimitBreak unarmedLimitBreak = new ConfigUnarmedLimitBreak(); + public ConfigUnarmedDisarm getDisarm() { return disarm; } @@ -16,4 +18,8 @@ public class ConfigUnarmedSubskills { public boolean isPreventItemTheft() { return disarm.isPreventItemTheft(); } + + public ConfigUnarmedLimitBreak getUnarmedLimitBreak() { + return unarmedLimitBreak; + } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java index 8fa7c231b..3b7c2dae3 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/subskills/acrobatics/Roll.java @@ -201,7 +201,7 @@ public class Roll extends AcrobaticsSubSkill { return gracefulRollCheck(player, mcMMOPlayer, damage, skillLevel); } - double modifiedDamage = calculateModifiedRollDamage(damage, pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageTheshold()); + double modifiedDamage = calculateModifiedRollDamage(damage, pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageThreshold()); if (!isFatal(player, modifiedDamage) && pluginRef.getRandomChanceTools().isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.ACROBATICS_ROLL, player)) { @@ -237,7 +237,7 @@ public class Roll extends AcrobaticsSubSkill { * @return the modified event damage if the ability was successful, the original event damage otherwise */ private double gracefulRollCheck(Player player, McMMOPlayer mcMMOPlayer, double damage, int skillLevel) { - double modifiedDamage = calculateModifiedRollDamage(damage, pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageTheshold() * 2); + double modifiedDamage = calculateModifiedRollDamage(damage, pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageThreshold() * 2); RandomChanceSkill rcs = new RandomChanceSkill(player, subSkillType); rcs.setSkillLevel(rcs.getSkillLevel() * 2); //Double the effective odds @@ -395,7 +395,7 @@ public class Roll extends AcrobaticsSubSkill { //Chance Stat Calculations rollChanceHalfMax = pluginRef.getRandomChanceTools().getRandomChanceExecutionChance(rollHalfMaxSkill); graceChanceHalfMax = pluginRef.getRandomChanceTools().getRandomChanceExecutionChance(rollGraceHalfMaxSkill); - damageThreshold = pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageTheshold(); + damageThreshold = pluginRef.getConfigManager().getConfigAcrobatics().getRollDamageThreshold(); chancePerLevel = pluginRef.getRandomChanceTools().getRandomChanceExecutionChance(rollOneSkillLevel);