From 299c989dd444d69b132c820d5668e1c6895a481a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 31 May 2019 18:49:24 -0700 Subject: [PATCH] Add Axes Critical Strikes to new configs --- .../config/hocon/skills/axes/ConfigAxes.java | 14 +++++++++++ .../axes/ConfigAxesCriticalStrikes.java | 24 ++++++++++++------- .../properties/AbstractDamageProperty.java | 21 ++++++++++++++++ 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractDamageProperty.java diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxes.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxes.java index 069d460f5..26aac406a 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxes.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxes.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.config.hocon.skills.axes; +import com.gmail.nossr50.datatypes.skills.properties.AbstractMaximumProgressionLevel; +import com.gmail.nossr50.datatypes.skills.properties.DamageProperty; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @@ -62,6 +64,18 @@ public class ConfigAxes { @Setting(value = "Skull-Splitter") private ConfigAxesSkullSplitter configAxesSkullSplitter = new ConfigAxesSkullSplitter(); + public double getMaxActivationChance() { + return configAxesCriticalStrikes.getMaxActivationChance(); + } + + public AbstractMaximumProgressionLevel getMaximumProgressionLevel() { + return configAxesCriticalStrikes.getMaximumProgressionLevel(); + } + + public DamageProperty getDamageProperty() { + return configAxesCriticalStrikes.getDamageProperty(); + } + public double getSkullSplitterDamageDivisor() { return configAxesSkullSplitter.getSkullSplitterDamageDivisor(); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxesCriticalStrikes.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxesCriticalStrikes.java index 6b48b9364..3e6ae45e9 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxesCriticalStrikes.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/axes/ConfigAxesCriticalStrikes.java @@ -1,7 +1,9 @@ package com.gmail.nossr50.config.hocon.skills.axes; import com.gmail.nossr50.datatypes.skills.SubSkillType; +import com.gmail.nossr50.datatypes.skills.properties.AbstractDamageProperty; import com.gmail.nossr50.datatypes.skills.properties.AbstractMaximumProgressionLevel; +import com.gmail.nossr50.datatypes.skills.properties.DamageProperty; import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; @@ -9,15 +11,6 @@ import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; public class ConfigAxesCriticalStrikes { private static final double MAX_ACTIVATION_CHANCE_DEFAULT = 37.50D; - /* - CriticalStrikes: - # ChanceMax: Maximum chance of causing a critical hit when on or higher - # MaxBonusLevel: Level where of causing critical hits is reached - ChanceMax: 37.50 - # Damage modifier of critical hits for PVP / PVE, when causing a critical hit the damage gets multiplied by the modifier - PVP_Modifier: 1.5 - PVE_Modifier: 2.0 - */ @Setting(value = "Max-Activation-Chance", comment = "This is max percentage chance that is used to determine whether or not the ability is successful." + "\nA value of 50.0 would mean at most the ability can only have a 50% chance to work at max skill level.") @@ -27,5 +20,18 @@ public class ConfigAxesCriticalStrikes { "\nProperties of this skill may or may not scale with level, but those that do will gradually increase until max level is achieved.") AbstractMaximumProgressionLevel maximumProgressionLevel = new AbstractMaximumProgressionLevel(SubSkillType.AXES_CRITICAL_STRIKES, 100, 1000); + @Setting(value = "Damage-Modifiers", comment = "Damage dealt is multiplied by these values when this skill is successfully activated.") + DamageProperty damageProperty = new AbstractDamageProperty(1.5, 2.0); + public double getMaxActivationChance() { + return maxActivationChance; + } + + public AbstractMaximumProgressionLevel getMaximumProgressionLevel() { + return maximumProgressionLevel; + } + + public DamageProperty getDamageProperty() { + return damageProperty; + } } diff --git a/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractDamageProperty.java b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractDamageProperty.java new file mode 100644 index 000000000..c159c744a --- /dev/null +++ b/src/main/java/com/gmail/nossr50/datatypes/skills/properties/AbstractDamageProperty.java @@ -0,0 +1,21 @@ +package com.gmail.nossr50.datatypes.skills.properties; + +public class AbstractDamageProperty implements DamageProperty { + private double pveModifier; + private double pvpModifier; + + public AbstractDamageProperty(double pveModifier, double pvpModifier) { + this.pveModifier = pveModifier; + this.pvpModifier = pvpModifier; + } + + @Override + public double getPVEModifier() { + return pveModifier; + } + + @Override + public double getPVPModifier() { + return pvpModifier; + } +}