Minor code cleanup.
Thanks to nasseka.
This commit is contained in:
@@ -71,7 +71,7 @@ public class Cp extends AbstractEffect
|
||||
}
|
||||
case PER:
|
||||
{
|
||||
amount = Math.min((effected.getMaxCp() * basicAmount) / 100.0, Math.max(0, effected.getMaxRecoverableCp() - effected.getCurrentCp()));
|
||||
amount = Math.min((effected.getMaxCp() * basicAmount) / 100, Math.max(0, effected.getMaxRecoverableCp() - effected.getCurrentCp()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Hp extends AbstractEffect
|
||||
}
|
||||
case PER:
|
||||
{
|
||||
amount = Math.min((effected.getMaxHp() * basicAmount) / 100.0, Math.max(0, effected.getMaxRecoverableHp() - effected.getCurrentHp()));
|
||||
amount = Math.min((effected.getMaxHp() * basicAmount) / 100, Math.max(0, effected.getMaxRecoverableHp() - effected.getCurrentHp()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class Mp extends AbstractEffect
|
||||
}
|
||||
case PER:
|
||||
{
|
||||
amount = Math.min((effected.getMaxMp() * basicAmount) / 100.0, Math.max(0, effected.getMaxRecoverableMp() - effected.getCurrentMp()));
|
||||
amount = Math.min((effected.getMaxMp() * basicAmount) / 100, Math.max(0, effected.getMaxRecoverableMp() - effected.getCurrentMp()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1420,7 +1420,7 @@ public class Formulas
|
||||
}
|
||||
case SHIELD_DEFENSE_PERFECT_BLOCK:
|
||||
{
|
||||
return 1.;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class MAttackSpeedFinalizer implements IStatFunction
|
||||
baseValue *= Config.CHAMPION_SPD_ATK;
|
||||
}
|
||||
|
||||
final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.;
|
||||
final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1;
|
||||
baseValue *= witBonus;
|
||||
return validateValue(creature, defaultValue(creature, stat, baseValue), 1, creature.isPlayable() ? Config.MAX_MATK_SPEED : Double.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction
|
||||
}
|
||||
|
||||
final double physicalBonus = creature.getStat().getMul(Stat.MAGIC_CRITICAL_RATE_BY_CRITICAL_RATE, 0) * creature.getStat().getCriticalHit();
|
||||
final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.;
|
||||
final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1;
|
||||
return validateValue(creature, Stat.defaultValue(creature, stat, (baseValue * witBonus * 10) + physicalBonus), 0, creature.isPlayable() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public class MDefenseFinalizer implements IStatFunction
|
||||
baseValue *= Config.RAID_MDEFENCE_MULTIPLIER;
|
||||
}
|
||||
|
||||
final double bonus = creature.getMEN() > 0 ? BaseStat.MEN.calcBonus(creature) : 1.;
|
||||
final double bonus = creature.getMEN() > 0 ? BaseStat.MEN.calcBonus(creature) : 1;
|
||||
baseValue *= bonus * creature.getLevelMod();
|
||||
return defaultValue(creature, stat, baseValue);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class MaxCpFinalizer implements IStatFunction
|
||||
{
|
||||
baseValue = player.getTemplate().getBaseCpMax(player.getLevel());
|
||||
}
|
||||
final double conBonus = creature.getCON() > 0 ? BaseStat.CON.calcBonus(creature) : 1.;
|
||||
final double conBonus = creature.getCON() > 0 ? BaseStat.CON.calcBonus(creature) : 1;
|
||||
baseValue *= conBonus;
|
||||
return Stat.defaultValue(creature, stat, baseValue);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class MaxHpFinalizer implements IStatFunction
|
||||
}
|
||||
}
|
||||
|
||||
final double conBonus = creature.getCON() > 0 ? BaseStat.CON.calcBonus(creature) : 1.;
|
||||
final double conBonus = creature.getCON() > 0 ? BaseStat.CON.calcBonus(creature) : 1;
|
||||
baseValue *= conBonus;
|
||||
|
||||
return defaultValue(creature, stat, baseValue);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class MaxMpFinalizer implements IStatFunction
|
||||
}
|
||||
}
|
||||
|
||||
final double menBonus = creature.getMEN() > 0 ? BaseStat.MEN.calcBonus(creature) : 1.;
|
||||
final double menBonus = creature.getMEN() > 0 ? BaseStat.MEN.calcBonus(creature) : 1;
|
||||
baseValue *= menBonus;
|
||||
|
||||
return defaultValue(creature, stat, baseValue);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PAttackSpeedFinalizer implements IStatFunction
|
||||
{
|
||||
baseValue *= Config.CHAMPION_SPD_ATK;
|
||||
}
|
||||
final double dexBonus = creature.getDEX() > 0 ? BaseStat.DEX.calcBonus(creature) : 1.;
|
||||
final double dexBonus = creature.getDEX() > 0 ? BaseStat.DEX.calcBonus(creature) : 1;
|
||||
baseValue *= dexBonus;
|
||||
return validateValue(creature, defaultValue(creature, stat, baseValue), 1, creature.isPlayable() ? Config.MAX_PATK_SPEED : Double.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PCriticalRateFinalizer implements IStatFunction
|
||||
// Enchanted legs bonus
|
||||
baseValue += calcEnchantBodyPart(creature, ItemTemplate.SLOT_LEGS);
|
||||
}
|
||||
final double dexBonus = creature.getDEX() > 0 ? BaseStat.DEX.calcBonus(creature) : 1.;
|
||||
final double dexBonus = creature.getDEX() > 0 ? BaseStat.DEX.calcBonus(creature) : 1;
|
||||
return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * dexBonus * 10), 0, creature.isPlayable() ? Config.MAX_PCRIT_RATE : Double.MAX_VALUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ public class VampiricChanceFinalizer implements IStatFunction
|
||||
|
||||
final double amount = creature.getStat().getValue(Stat.ABSORB_DAMAGE_PERCENT, 0) * 100;
|
||||
final double vampiricSum = creature.getStat().getVampiricSum();
|
||||
return amount > 0 ? Stat.defaultValue(creature, stat, Math.min(1.0, vampiricSum / amount / 100)) : 0;
|
||||
return amount > 0 ? Stat.defaultValue(creature, stat, Math.min(1, vampiricSum / amount / 100)) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user