Get rid of the SuccessModifier

There's no need for this modifier, because the user can define the
exact chance for Rolls and Gracefull Rolls in the config file. This
means that the ratio between the two is already configurable.
This commit is contained in:
TfT_02 2013-05-18 14:12:07 +02:00
parent 2e74c079b0
commit 7f1ef61657
3 changed files with 4 additions and 6 deletions

View File

@ -37,7 +37,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public double getGracefulRollChanceMax() { return config.getDouble("Skills.Acrobatics.GracefulRoll_ChanceMax", 100.0D); }
public int getGracefulRollMaxBonusLevel() { return config.getInt("Skills.Acrobatics.GracefulRoll_MaxBonusLevel", 500); }
public int getGracefulRollDamageThreshold() { return config.getInt("Skills.Acrobatics.GracefulRoll_DamageThreshold", 14); }
public int getGracefulRollSuccessModifer() { return config.getInt("Skills.Acrobatics.GracefulRoll_SuccessModifier", 2); }
public int getDodgeXPModifier() { return config.getInt("Skills.Acrobatics.Dodge_XP_Modifier", 120); }
public int getRollXPModifier() { return config.getInt("Skills.Acrobatics.Roll_XP_Modifier", 80); }

View File

@ -14,7 +14,6 @@ public final class Acrobatics {
public static int gracefulRollMaxBonusLevel = AdvancedConfig.getInstance().getGracefulRollMaxBonusLevel();
public static int gracefulRollThreshold = AdvancedConfig.getInstance().getGracefulRollDamageThreshold();
public static int gracefulRollSuccessModifier = AdvancedConfig.getInstance().getGracefulRollSuccessModifer();
public static double gracefulRollMaxChance = AdvancedConfig.getInstance().getGracefulRollChanceMax();
public static int dodgeXpModifier = AdvancedConfig.getInstance().getDodgeXPModifier();

View File

@ -81,7 +81,7 @@ public class AcrobaticsManager extends SkillManager {
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.rollThreshold);
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.rollMaxChance, Acrobatics.rollMaxBonusLevel, 1)) {
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.rollMaxChance, Acrobatics.rollMaxBonusLevel)) {
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
applyXpGain(damage * Acrobatics.rollXpModifier);
@ -103,7 +103,7 @@ public class AcrobaticsManager extends SkillManager {
private int gracefulRollCheck(int damage) {
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.gracefulRollThreshold);
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.gracefulRollMaxChance, Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollSuccessModifier)) {
if (!isFatal(modifiedDamage) && isSuccessfulRoll(Acrobatics.gracefulRollMaxChance, Acrobatics.gracefulRollMaxBonusLevel)) {
getPlayer().sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
applyXpGain(damage * Acrobatics.rollXpModifier);
@ -116,8 +116,8 @@ public class AcrobaticsManager extends SkillManager {
return damage;
}
private boolean isSuccessfulRoll(double maxChance, int maxLevel, int successModifier) {
return ((maxChance / maxLevel) * Math.min(getSkillLevel(), maxLevel) * successModifier) > Misc.getRandom().nextInt(activationChance);
private boolean isSuccessfulRoll(double maxChance, int maxLevel) {
return (maxChance / maxLevel) * Math.min(getSkillLevel(), maxLevel) > Misc.getRandom().nextInt(activationChance);
}
private boolean isFatal(int damage) {