Added configurable limits for PAtk and MAtk.

This commit is contained in:
MobiusDev
2017-09-08 23:42:16 +00:00
parent f99b5d89cb
commit 7f1a6f6fee
24 changed files with 113 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ public class MAttackFinalizer implements IStatsFunction
final double chaMod = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
final double intBonus = BaseStats.INT.calcBonus(creature);
baseValue *= Math.pow(intBonus, 2) * Math.pow(creature.getLevelMod(), 2) * chaMod;
return Stats.defaultValue(creature, stat, baseValue);
return Math.min(Stats.defaultValue(creature, stat, baseValue), Config.MAX_MATK);
}
@Override

View File

@@ -55,7 +55,7 @@ public class PAttackFinalizer implements IStatsFunction
final double chaBonus = creature.isPlayer() ? BaseStats.CHA.calcBonus(creature) : 1.;
final double strBonus = creature.getSTR() > 0 ? BaseStats.STR.calcBonus(creature) : 1.;
baseValue *= strBonus * creature.getLevelMod() * chaBonus;
return Stats.defaultValue(creature, stat, baseValue);
return Math.min(Stats.defaultValue(creature, stat, baseValue), Config.MAX_PATK);
}
@Override