Browse Source

finalized cleanup

master
FatBoy-DOTC 2 years ago
parent
commit
727309a706
  1. 55
      src/engine/objects/Item.java
  2. 11
      src/engine/objects/Resists.java
  3. 11
      src/engine/powers/effectmodifiers/ArmorPiercingEffectModifier.java

55
src/engine/objects/Item.java

@ -319,61 +319,6 @@ public class Item extends AbstractWorldObject { @@ -319,61 +319,6 @@ public class Item extends AbstractWorldObject {
public short getDurabilityMax() {
return durabilityMax;
}
public float getArmorPiercing(){
float val = 0;
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) {
this.durabilityCurrent = value;
}

11
src/engine/objects/Resists.java

@ -16,11 +16,13 @@ import engine.Enum.SourceType; @@ -16,11 +16,13 @@ import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.powers.EffectsBase;
import engine.powers.effectmodifiers.ArmorPiercingEffectModifier;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;
@ -305,13 +307,10 @@ public class Resists { @@ -305,13 +307,10 @@ public class Resists {
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, DamageType type, float damage, int trains) {
//handle fortitudes
damage = handleFortitude(target, type, damage);
//calculate armor piercing
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing,SourceType.None);
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap);
//check to see if any damage absorbers should cancel
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) {
//debug damage shields if any found
if (source.getDebug(2) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {

11
src/engine/powers/effectmodifiers/ArmorPiercingEffectModifier.java

@ -10,10 +10,7 @@ @@ -10,10 +10,7 @@
package engine.powers.effectmodifiers;
import engine.jobs.AbstractEffectJob;
import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject;
import engine.objects.Building;
import engine.objects.Item;
import engine.objects.*;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -32,7 +29,11 @@ public class ArmorPiercingEffectModifier extends AbstractEffectModifier { @@ -32,7 +29,11 @@ public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
@Override
public void applyBonus(AbstractCharacter ac, int trains) {
Float amount = 0f;
PlayerBonuses bonus = ac.getBonuses();
//for to testing:
amount = this.percentMod;
bonus.addFloat(this, amount * 0.01f);
}
@Override

Loading…
Cancel
Save