Add Axes Critical Strikes to new configs

This commit is contained in:
nossr50 2019-05-31 18:49:24 -07:00
parent 00131bb412
commit 299c989dd4
3 changed files with 50 additions and 9 deletions

View File

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

View File

@ -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 <MaxBonusLevel> or higher
# MaxBonusLevel: Level where <ChanceMax> 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;
}
}

View File

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