Combat - Added ability specifc armor bypass and fixed incorrect armor mitigation calculation

This commit is contained in:
Ziggeh
2014-03-23 17:23:26 +01:00
parent ae402525f5
commit 9de9bb37b4
+7 -5
View File
@@ -85,7 +85,7 @@ public class CombatService implements INetworkDispatch {
}
public void doCombat(final CreatureObject attacker, final TangibleObject target, final WeaponObject weapon, final CombatCommand command, final int actionCounter) {
boolean success = true;
if((command.getAttackType() == 0 || command.getAttackType() == 1 || command.getAttackType() == 3) && !attemptCombat(attacker, target))
@@ -441,7 +441,7 @@ public class CombatService implements INetworkDispatch {
} else {
elementalType = command.getElementalType();
}
int baseArmor = 0;
@@ -460,14 +460,16 @@ public class CombatService implements INetworkDispatch {
baseArmor = target.getSkillModBase("acid");
case ElementalType.ELECTRICITY:
baseArmor = target.getSkillModBase("electricity");
}
if(target.getSkillMod("expertise_innate_reduction_all_player") != null)
baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100;
float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000);
if(command.getBypassArmor() > 0)
baseArmor *= (100 - command.getBypassArmor()) / 100;
float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor))) + baseArmor / 9000;
if(hitType == HitType.STRIKETHROUGH) {
float stMaxValue = attacker.getSkillMod("combat_strikethrough_value").getBase() / 2 + attacker.getLuck() / 10;
@@ -480,7 +482,7 @@ public class CombatService implements INetworkDispatch {
stValue = 1 - stValue;
mitigation *= stValue;
}
return mitigation / 100;
}