Simplified implementation of SpeedLimit effect.

This commit is contained in:
MobiusDevelopment
2022-03-09 22:31:38 +00:00
parent ad798bf20b
commit 5cd9e8ba5a
168 changed files with 1260 additions and 126 deletions

View File

@ -215,6 +215,7 @@ public class Config
public static double MAX_BONUS_EXP;
public static double MAX_BONUS_SP;
public static int MAX_RUN_SPEED;
public static int MAX_RUN_SPEED_SUMMON;
public static int MAX_PATK;
public static int MAX_MATK;
public static int MAX_PCRIT_RATE;
@ -1846,6 +1847,7 @@ public class Config
MAX_BONUS_EXP = characterConfig.getDouble("MaxExpBonus", 0);
MAX_BONUS_SP = characterConfig.getDouble("MaxSpBonus", 0);
MAX_RUN_SPEED = characterConfig.getInt("MaxRunSpeed", 300);
MAX_RUN_SPEED_SUMMON = characterConfig.getInt("MaxRunSpeedSummon", 350);
MAX_PATK = characterConfig.getInt("MaxPAtk", 999999);
MAX_MATK = characterConfig.getInt("MaxMAtk", 999999);
MAX_PCRIT_RATE = characterConfig.getInt("MaxPCritRate", 500);

View File

@ -38,9 +38,9 @@ public class SummonStat extends PlayableStat
final double val = super.getRunSpeed() + Config.RUN_SPD_BOOST;
// Apply max run speed cap.
if (val > (Config.MAX_RUN_SPEED + 50)) // In retail maximum run speed is 350 for summons and 300 for players
if (val > Config.MAX_RUN_SPEED_SUMMON) // In retail maximum run speed is 350 for summons and 300 for players
{
return Config.MAX_RUN_SPEED + 50;
return Config.MAX_RUN_SPEED_SUMMON;
}
return val;
}
@ -51,9 +51,9 @@ public class SummonStat extends PlayableStat
final double val = super.getWalkSpeed() + Config.RUN_SPD_BOOST;
// Apply max run speed cap.
if (val > (Config.MAX_RUN_SPEED + 50)) // In retail maximum run speed is 350 for summons and 300 for players
if (val > Config.MAX_RUN_SPEED_SUMMON) // In retail maximum run speed is 350 for summons and 300 for players
{
return Config.MAX_RUN_SPEED + 50;
return Config.MAX_RUN_SPEED_SUMMON;
}
return val;
}

View File

@ -168,6 +168,7 @@ public enum Stat
// Run speed, walk & escape speed are calculated proportionally, magic speed is a buff
MOVE_SPEED("moveSpeed"),
SPEED_LIMIT("speedLimit"),
RUN_SPEED("runSpd", new SpeedFinalizer()),
WALK_SPEED("walkSpd", new SpeedFinalizer()),
SWIM_RUN_SPEED("fastSwimSpd", new SpeedFinalizer()),

View File

@ -56,7 +56,21 @@ public class SpeedFinalizer implements IStatFunction
baseValue += bonusDex;
}
return validateValue(creature, Stat.defaultValue(creature, stat, baseValue), 1, creature.isPlayable() ? Config.MAX_RUN_SPEED : Double.MAX_VALUE);
final double maxSpeed;
if (creature.isPlayer())
{
maxSpeed = Config.MAX_RUN_SPEED + creature.getStat().getValue(Stat.SPEED_LIMIT, 0);
}
else if (creature.isSummon())
{
maxSpeed = Config.MAX_RUN_SPEED_SUMMON + creature.getStat().getValue(Stat.SPEED_LIMIT, 0);
}
else
{
maxSpeed = Double.MAX_VALUE;
}
return validateValue(creature, Stat.defaultValue(creature, stat, baseValue), 1, maxSpeed);
}
@Override
@ -64,7 +78,7 @@ public class SpeedFinalizer implements IStatFunction
{
if (isBlessed)
{
return (1 * Math.max(enchantLevel - 3, 0)) + (1 * Math.max(enchantLevel - 6, 0));
return Math.max(enchantLevel - 3, 0) + Math.max(enchantLevel - 6, 0);
}
return (0.6 * Math.max(enchantLevel - 3, 0)) + (0.6 * Math.max(enchantLevel - 6, 0));
}