combat to include armor piercing calculation
This commit is contained in:
@@ -319,6 +319,60 @@ public class Item extends AbstractWorldObject {
|
|||||||
public short getDurabilityMax() {
|
public short getDurabilityMax() {
|
||||||
return durabilityMax;
|
return durabilityMax;
|
||||||
}
|
}
|
||||||
|
public float getArmorPiercing(){
|
||||||
|
float val = 1;
|
||||||
|
for(String eff : this.effectNames){
|
||||||
|
switch(eff)
|
||||||
|
{
|
||||||
|
case"PRE-001":
|
||||||
|
val += -0.20f;
|
||||||
|
break;
|
||||||
|
case"PRE-002":
|
||||||
|
val += -0.10f;
|
||||||
|
break;
|
||||||
|
case"PRE-003":
|
||||||
|
val += 0.020f;
|
||||||
|
break;
|
||||||
|
case"PRE-004":
|
||||||
|
val += 0.040f;
|
||||||
|
break;
|
||||||
|
case"PRE-005":
|
||||||
|
val += 0.060f;
|
||||||
|
break;
|
||||||
|
case"PRE-006":
|
||||||
|
val += 0.080f;
|
||||||
|
break;
|
||||||
|
case"PRE-007":
|
||||||
|
val += 0.10f;
|
||||||
|
break;
|
||||||
|
case"PRE-008":
|
||||||
|
val += 0.12f;
|
||||||
|
break;
|
||||||
|
case"PRE-009":
|
||||||
|
val += 0.14f;
|
||||||
|
break;
|
||||||
|
case"PRE-010":
|
||||||
|
val += 0.15f;
|
||||||
|
break;
|
||||||
|
case"PRE-311":
|
||||||
|
val += 0.20f;
|
||||||
|
break;
|
||||||
|
case"SUF-008":
|
||||||
|
val += 0.05f;
|
||||||
|
break;
|
||||||
|
case"SUF-009":
|
||||||
|
val += 0.10f;
|
||||||
|
break;
|
||||||
|
case"SUF-010":
|
||||||
|
val += 0.15f;
|
||||||
|
break;
|
||||||
|
case"SUF-301":
|
||||||
|
val += 0.20f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
public void setDurabilityCurrent(short value) {
|
public void setDurabilityCurrent(short value) {
|
||||||
this.durabilityCurrent = value;
|
this.durabilityCurrent = value;
|
||||||
|
|||||||
@@ -305,9 +305,13 @@ public class Resists {
|
|||||||
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, DamageType type, float damage, int trains) {
|
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, DamageType type, float damage, int trains) {
|
||||||
//handle fortitudes
|
//handle fortitudes
|
||||||
damage = handleFortitude(target, type, damage);
|
damage = handleFortitude(target, type, damage);
|
||||||
|
|
||||||
//check to see if any damage absorbers should cancel
|
//check to see if any damage absorbers should cancel
|
||||||
float damageAfterResists = damage * (1 - (this.getResist(type, trains) / 100));
|
float apMod = 0;
|
||||||
|
|
||||||
|
if(source.getCharItemManager().getEquipped(2) != null) {
|
||||||
|
apMod = source.getCharItemManager().getEquipped(2).getArmorPiercing(); // need to get the item in players off-hand and check for armor piercing enchants
|
||||||
|
}
|
||||||
|
float damageAfterResists = damage * (1 - (this.getResist(type, trains) / 100) + apMod);
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
//debug damage shields if any found
|
//debug damage shields if any found
|
||||||
if (source.getDebug(2) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
if (source.getDebug(2) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user