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

@@ -227,6 +227,14 @@ MaxSpBonus = 0
# Default: 300
MaxRunSpeed = 300
# Maximum character Physical Attack.
# Default: 999999
MaxPAtk = 999999
# Maximum character Magic Attack.
# Default: 999999
MaxMAtk = 999999
# Maximum character Physical Critical Rate. (10 = 1%)
# Default: 500
MaxPCritRate = 500

View File

@@ -350,7 +350,7 @@
<value level="1">0</value>
<value level="2">0</value>
<value level="3">999900</value>
<value level="4">999900</value> <!-- Retail value: 0 -->
<value level="4">999999</value> <!-- Retail value: 0 -->
</amount>
<mode>PER</mode>
</effect>
@@ -428,6 +428,15 @@
<mode>PER</mode>
<magicType>1</magicType>
</effect>
<effect name="MAtk"> <!-- custom -->
<amount>
<value level="1">0</value>
<value level="2">0</value>
<value level="3">999900</value>
<value level="4">999999</value>
</amount>
<mode>PER</mode>
</effect>
</effects>
</skill>
<skill id="7030" toLevel="1" name="Summon King Bugbear">

View File

@@ -182,6 +182,8 @@ public final class Config
public static double MAX_BONUS_EXP;
public static double MAX_BONUS_SP;
public static int MAX_RUN_SPEED;
public static int MAX_PATK;
public static int MAX_MATK;
public static int MAX_PCRIT_RATE;
public static int MAX_MCRIT_RATE;
public static int MAX_PATK_SPEED;
@@ -1448,6 +1450,8 @@ public final class Config
MAX_BONUS_EXP = Character.getDouble("MaxExpBonus", 0);
MAX_BONUS_SP = Character.getDouble("MaxSpBonus", 0);
MAX_RUN_SPEED = Character.getInt("MaxRunSpeed", 300);
MAX_PATK = Character.getInt("MaxPAtk", 999999);
MAX_MATK = Character.getInt("MaxMAtk", 999999);
MAX_PCRIT_RATE = Character.getInt("MaxPCritRate", 500);
MAX_MCRIT_RATE = Character.getInt("MaxMCritRate", 200);
MAX_PATK_SPEED = Character.getInt("MaxPAtkSpeed", 1500);

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