|
|
@ -26,9 +26,9 @@ import java.util.concurrent.ConcurrentHashMap; |
|
|
|
public class Resists { |
|
|
|
public class Resists { |
|
|
|
|
|
|
|
|
|
|
|
private static ConcurrentHashMap<Integer, Resists> mobResists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private static ConcurrentHashMap<Integer, Resists> mobResists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private ConcurrentHashMap<SourceType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private ConcurrentHashMap<Enum.DamageType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private ConcurrentHashMap<SourceType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private ConcurrentHashMap<Enum.DamageType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
private SourceType protection; |
|
|
|
private Enum.DamageType protection; |
|
|
|
private int protectionTrains = 0; |
|
|
|
private int protectionTrains = 0; |
|
|
|
private boolean immuneToAll; |
|
|
|
private boolean immuneToAll; |
|
|
|
|
|
|
|
|
|
|
@ -51,9 +51,9 @@ public class Resists { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Resists(Resists r) { |
|
|
|
public Resists(Resists r) { |
|
|
|
for (SourceType dt : r.resists.keySet()) |
|
|
|
for (Enum.DamageType dt : r.resists.keySet()) |
|
|
|
this.resists.put(dt, r.resists.get(dt)); |
|
|
|
this.resists.put(dt, r.resists.get(dt)); |
|
|
|
for (SourceType dt : r.immuneTo.keySet()) |
|
|
|
for (Enum.DamageType dt : r.immuneTo.keySet()) |
|
|
|
this.immuneTo.put(dt, r.immuneTo.get(dt)); |
|
|
|
this.immuneTo.put(dt, r.immuneTo.get(dt)); |
|
|
|
this.protection = r.protection; |
|
|
|
this.protection = r.protection; |
|
|
|
this.protectionTrains = r.protectionTrains; |
|
|
|
this.protectionTrains = r.protectionTrains; |
|
|
@ -83,30 +83,30 @@ public class Resists { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Resists(ResultSet rs) throws SQLException { |
|
|
|
public Resists(ResultSet rs) throws SQLException { |
|
|
|
this.immuneToAll = false; |
|
|
|
this.immuneToAll = false; |
|
|
|
this.resists.put(SourceType.SLASHING, rs.getFloat("slash")); |
|
|
|
this.resists.put(Enum.DamageType.Slash, rs.getFloat("slash")); |
|
|
|
this.resists.put(SourceType.CRUSHING, rs.getFloat("crush")); |
|
|
|
this.resists.put(Enum.DamageType.Crush, rs.getFloat("crush")); |
|
|
|
this.resists.put(SourceType.PIERCING, rs.getFloat("pierce")); |
|
|
|
this.resists.put(Enum.DamageType.Pierce, rs.getFloat("pierce")); |
|
|
|
this.resists.put(SourceType.MAGIC, rs.getFloat("magic")); |
|
|
|
this.resists.put(Enum.DamageType.Magic, rs.getFloat("magic")); |
|
|
|
this.resists.put(SourceType.BLEEDING, rs.getFloat("bleed")); |
|
|
|
this.resists.put(Enum.DamageType.Bleed, rs.getFloat("bleed")); |
|
|
|
this.resists.put(SourceType.POISON, rs.getFloat("poison")); |
|
|
|
this.resists.put(Enum.DamageType.Poison, rs.getFloat("poison")); |
|
|
|
this.resists.put(SourceType.MENTAL, rs.getFloat("mental")); |
|
|
|
this.resists.put(Enum.DamageType.Mental, rs.getFloat("mental")); |
|
|
|
this.resists.put(SourceType.HOLY, rs.getFloat("holy")); |
|
|
|
this.resists.put(Enum.DamageType.Holy, rs.getFloat("holy")); |
|
|
|
this.resists.put(SourceType.UNHOLY, rs.getFloat("unholy")); |
|
|
|
this.resists.put(Enum.DamageType.Unholy, rs.getFloat("unholy")); |
|
|
|
this.resists.put(SourceType.LIGHTNING, rs.getFloat("lightning")); |
|
|
|
this.resists.put(Enum.DamageType.Lightning, rs.getFloat("lightning")); |
|
|
|
this.resists.put(SourceType.FIRE, rs.getFloat("fire")); |
|
|
|
this.resists.put(Enum.DamageType.Fire, rs.getFloat("fire")); |
|
|
|
this.resists.put(SourceType.COLD, rs.getFloat("cold")); |
|
|
|
this.resists.put(Enum.DamageType.Cold, rs.getFloat("cold")); |
|
|
|
this.resists.put(SourceType.HEALING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Healing, 0f); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Handle Fortitudes
|
|
|
|
//Handle Fortitudes
|
|
|
|
private static float handleFortitude(AbstractCharacter target, SourceType type, float damage) { |
|
|
|
private static float handleFortitude(AbstractCharacter target, Enum.DamageType type, float damage) { |
|
|
|
if (target == null || !(target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))) |
|
|
|
if (target == null || !(target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))) |
|
|
|
return damage; |
|
|
|
return damage; |
|
|
|
PlayerBonuses bonus = target.getBonuses(); |
|
|
|
PlayerBonuses bonus = target.getBonuses(); |
|
|
|
|
|
|
|
|
|
|
|
//see if there is a fortitude
|
|
|
|
//see if there is a fortitude
|
|
|
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.NONE); |
|
|
|
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None); |
|
|
|
if (damageCap == 0f || type == SourceType.HEALING) |
|
|
|
if (damageCap == 0f || type == Enum.DamageType.Healing) |
|
|
|
return damage; |
|
|
|
return damage; |
|
|
|
|
|
|
|
|
|
|
|
//is fortitude, Are we under the cap?
|
|
|
|
//is fortitude, Are we under the cap?
|
|
|
@ -126,21 +126,21 @@ public class Resists { |
|
|
|
if (forts == null || !isValidDamageCapType(forts, type, exclusive)) |
|
|
|
if (forts == null || !isValidDamageCapType(forts, type, exclusive)) |
|
|
|
return damage; |
|
|
|
return damage; |
|
|
|
|
|
|
|
|
|
|
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.NONE); |
|
|
|
float adjustedDamage = bonus.getFloatPercentAll(ModType.AdjustAboveDmgCap, SourceType.None); |
|
|
|
//Adjust damage down and return new amount
|
|
|
|
//Adjust damage down and return new amount
|
|
|
|
float aadc = 1 + adjustedDamage; |
|
|
|
float aadc = 1 + adjustedDamage; |
|
|
|
return capFire * aadc; |
|
|
|
return capFire * aadc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Test if Damagetype is valid for foritude
|
|
|
|
//Test if Damagetype is valid for foritude
|
|
|
|
private static boolean isValidDamageCapType(HashSet<SourceType> forts, SourceType damageType, boolean exclusive) { |
|
|
|
private static boolean isValidDamageCapType(HashSet<SourceType> forts, Enum.DamageType damageType, boolean exclusive) { |
|
|
|
for (SourceType fort : forts) { |
|
|
|
for (SourceType fort : forts) { |
|
|
|
SourceType dt = SourceType.valueOf(fort.name().toUpperCase()); |
|
|
|
Enum.DamageType dt = Enum.DamageType.valueOf(fort.name()); |
|
|
|
|
|
|
|
|
|
|
|
if (dt == SourceType.NONE) |
|
|
|
if (dt.equals(Enum.DamageType.None)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (dt == damageType) { |
|
|
|
if (dt.equals(damageType)) { |
|
|
|
return exclusive; |
|
|
|
return exclusive; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -195,19 +195,19 @@ public class Resists { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final void setBuildingResists() { |
|
|
|
public final void setBuildingResists() { |
|
|
|
this.immuneToAll = false; |
|
|
|
this.immuneToAll = false; |
|
|
|
this.resists.put(SourceType.SLASHING, 85f); |
|
|
|
this.resists.put(Enum.DamageType.Slash, 85f); |
|
|
|
this.resists.put(SourceType.CRUSHING, 85f); |
|
|
|
this.resists.put(Enum.DamageType.Crush, 85f); |
|
|
|
this.immuneTo.put(SourceType.PIERCING, true); |
|
|
|
this.resists.put(Enum.DamageType.Siege, 0f); |
|
|
|
this.immuneTo.put(SourceType.MAGIC, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Pierce, true); |
|
|
|
this.immuneTo.put(SourceType.BLEEDING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Magic, true); |
|
|
|
this.immuneTo.put(SourceType.POISON, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Bleed, true); |
|
|
|
this.immuneTo.put(SourceType.MENTAL, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Poison, true); |
|
|
|
this.immuneTo.put(SourceType.HOLY, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Mental, true); |
|
|
|
this.immuneTo.put(SourceType.UNHOLY, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Holy, true); |
|
|
|
this.immuneTo.put(SourceType.LIGHTNING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Unholy, true); |
|
|
|
this.immuneTo.put(SourceType.FIRE, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Lightning, true); |
|
|
|
this.immuneTo.put(SourceType.COLD, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Fire, true); |
|
|
|
this.resists.put(SourceType.SIEGE, 0f); |
|
|
|
this.immuneTo.put(Enum.DamageType.Cold, true); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -216,19 +216,19 @@ public class Resists { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final void setMineResists() { |
|
|
|
public final void setMineResists() { |
|
|
|
this.immuneToAll = false; |
|
|
|
this.immuneToAll = false; |
|
|
|
this.immuneTo.put(SourceType.SLASHING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Slash, true); |
|
|
|
this.immuneTo.put(SourceType.CRUSHING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Crush, true); |
|
|
|
this.immuneTo.put(SourceType.PIERCING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Pierce, true); |
|
|
|
this.immuneTo.put(SourceType.MAGIC, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Magic, true); |
|
|
|
this.immuneTo.put(SourceType.BLEEDING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Bleed, true); |
|
|
|
this.immuneTo.put(SourceType.POISON, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Poison, true); |
|
|
|
this.immuneTo.put(SourceType.MENTAL, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Mental, true); |
|
|
|
this.immuneTo.put(SourceType.HOLY, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Holy, true); |
|
|
|
this.immuneTo.put(SourceType.UNHOLY, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Unholy, true); |
|
|
|
this.immuneTo.put(SourceType.LIGHTNING, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Lightning, true); |
|
|
|
this.immuneTo.put(SourceType.FIRE, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Fire, true); |
|
|
|
this.immuneTo.put(SourceType.COLD, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Cold, true); |
|
|
|
this.resists.put(SourceType.SIEGE, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Siege, 0f); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -236,27 +236,27 @@ public class Resists { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final void setGenericResists() { |
|
|
|
public final void setGenericResists() { |
|
|
|
this.immuneToAll = false; |
|
|
|
this.immuneToAll = false; |
|
|
|
this.resists.put(SourceType.SLASHING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Slash, 0f); |
|
|
|
this.resists.put(SourceType.CRUSHING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Crush, 0f); |
|
|
|
this.resists.put(SourceType.PIERCING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Pierce, 0f); |
|
|
|
this.resists.put(SourceType.MAGIC, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Magic, 0f); |
|
|
|
this.resists.put(SourceType.BLEEDING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Bleed, 0f); |
|
|
|
this.resists.put(SourceType.POISON, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Poison, 0f); |
|
|
|
this.resists.put(SourceType.MENTAL, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Mental, 0f); |
|
|
|
this.resists.put(SourceType.HOLY, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Holy, 0f); |
|
|
|
this.resists.put(SourceType.UNHOLY, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Unholy, 0f); |
|
|
|
this.resists.put(SourceType.LIGHTNING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Lightning, 0f); |
|
|
|
this.resists.put(SourceType.FIRE, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Fire, 0f); |
|
|
|
this.resists.put(SourceType.COLD, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Cold, 0f); |
|
|
|
this.resists.put(SourceType.HEALING, 0f); |
|
|
|
this.resists.put(Enum.DamageType.Healing, 0f); |
|
|
|
this.immuneTo.put(SourceType.SIEGE, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Siege, true); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get a resist |
|
|
|
* Get a resist |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float getResist(SourceType type, int trains) { |
|
|
|
public float getResist(Enum.DamageType type, int trains) { |
|
|
|
//get resisted amount
|
|
|
|
//get resisted amount
|
|
|
|
Float amount = 0f; |
|
|
|
Float amount = 0f; |
|
|
|
if (this.resists.containsKey(type)) |
|
|
|
if (this.resists.containsKey(type)) |
|
|
@ -278,7 +278,7 @@ public class Resists { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* get immuneTo |
|
|
|
* get immuneTo |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean immuneTo(SourceType type) { |
|
|
|
public boolean immuneTo(Enum.DamageType type) { |
|
|
|
if (this.immuneTo.containsKey(type)) |
|
|
|
if (this.immuneTo.containsKey(type)) |
|
|
|
return this.immuneTo.get(type); |
|
|
|
return this.immuneTo.get(type); |
|
|
|
else |
|
|
|
else |
|
|
@ -293,13 +293,13 @@ public class Resists { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean immuneToAttacks() { |
|
|
|
public boolean immuneToAttacks() { |
|
|
|
return immuneTo(SourceType.IMMUNETOATTACK); |
|
|
|
return immuneTo(Enum.DamageType.Attack); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set a resist |
|
|
|
* Set a resist |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setResist(SourceType type, float value) { |
|
|
|
public void setResist(Enum.DamageType type, float value) { |
|
|
|
this.resists.put(type, value); |
|
|
|
this.resists.put(type, value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -322,12 +322,12 @@ public class Resists { |
|
|
|
* get Damage after resist |
|
|
|
* get Damage after resist |
|
|
|
* Expects heals as negative damage and damage as positive damage for fortitudes. |
|
|
|
* Expects heals as negative damage and damage as positive damage for fortitudes. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, SourceType type, float damage, int trains) { |
|
|
|
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, Enum.DamageType type, float damage, int trains) { |
|
|
|
//handle fortitudes
|
|
|
|
//handle fortitudes
|
|
|
|
damage = handleFortitude(target, type, damage); |
|
|
|
damage = handleFortitude(target, type, damage); |
|
|
|
|
|
|
|
|
|
|
|
//calculate armor piercing
|
|
|
|
//calculate armor piercing
|
|
|
|
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.NONE); |
|
|
|
float ap = source.getBonuses().getFloatPercentAll(ModType.ArmorPiercing, SourceType.None); |
|
|
|
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap); |
|
|
|
float damageAfterResists = damage * (1 - (this.getResist(type, trains) * 0.01f) + ap); |
|
|
|
|
|
|
|
|
|
|
|
//check to see if any damage absorbers should cancel
|
|
|
|
//check to see if any damage absorbers should cancel
|
|
|
@ -346,41 +346,41 @@ public class Resists { |
|
|
|
|
|
|
|
|
|
|
|
if (rb != null) { |
|
|
|
if (rb != null) { |
|
|
|
// Handle immunities
|
|
|
|
// Handle immunities
|
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.STUN)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun)) |
|
|
|
this.immuneTo.put(SourceType.STUN, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Stun, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.BLIND)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind)) |
|
|
|
this.immuneTo.put(SourceType.BLIND, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Blind, true); |
|
|
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.NONE)) |
|
|
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None)) |
|
|
|
this.immuneTo.put(SourceType.IMMUNETOATTACK, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Attack, true); |
|
|
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.NONE)) |
|
|
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None)) |
|
|
|
this.immuneTo.put(SourceType.IMMUNETOPOWERS, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Powers, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.POWERBLOCK)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock)) |
|
|
|
this.immuneTo.put(SourceType.POWERBLOCK, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Powerblock, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DEBUFF)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff)) |
|
|
|
this.immuneTo.put(SourceType.DEBUFF, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.DeBuff, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.FEAR)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear)) |
|
|
|
this.immuneTo.put(SourceType.FEAR, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Fear, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.CHARM)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm)) |
|
|
|
this.immuneTo.put(SourceType.CHARM, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Charm, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.ROOT)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Root)) |
|
|
|
this.immuneTo.put(SourceType.ROOT, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Root, true); |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.SNARE)) |
|
|
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare)) |
|
|
|
this.immuneTo.put(SourceType.SNARE, true); |
|
|
|
this.immuneTo.put(Enum.DamageType.Snare, true); |
|
|
|
|
|
|
|
|
|
|
|
// Handle resists
|
|
|
|
// Handle resists
|
|
|
|
slash += rb.getFloat(ModType.Resistance, SourceType.SLASHING); |
|
|
|
slash += rb.getFloat(ModType.Resistance, SourceType.Slash); |
|
|
|
crush += rb.getFloat(ModType.Resistance, SourceType.CRUSHING); |
|
|
|
crush += rb.getFloat(ModType.Resistance, SourceType.Crush); |
|
|
|
pierce += rb.getFloat(ModType.Resistance, SourceType.PIERCING); |
|
|
|
pierce += rb.getFloat(ModType.Resistance, SourceType.Pierce); |
|
|
|
magic += rb.getFloat(ModType.Resistance, SourceType.MAGIC); |
|
|
|
magic += rb.getFloat(ModType.Resistance, SourceType.Magic); |
|
|
|
bleed += rb.getFloat(ModType.Resistance, SourceType.BLEEDING); |
|
|
|
bleed += rb.getFloat(ModType.Resistance, SourceType.Bleed); |
|
|
|
poison += rb.getFloat(ModType.Resistance, SourceType.POISON); |
|
|
|
poison += rb.getFloat(ModType.Resistance, SourceType.Poison); |
|
|
|
mental += rb.getFloat(ModType.Resistance, SourceType.MENTAL); |
|
|
|
mental += rb.getFloat(ModType.Resistance, SourceType.Mental); |
|
|
|
holy += rb.getFloat(ModType.Resistance, SourceType.HOLY); |
|
|
|
holy += rb.getFloat(ModType.Resistance, SourceType.Holy); |
|
|
|
unholy += rb.getFloat(ModType.Resistance, SourceType.UNHOLY); |
|
|
|
unholy += rb.getFloat(ModType.Resistance, SourceType.Unholy); |
|
|
|
lightning += rb.getFloat(ModType.Resistance, SourceType.LIGHTNING); |
|
|
|
lightning += rb.getFloat(ModType.Resistance, SourceType.Lightning); |
|
|
|
fire += rb.getFloat(ModType.Resistance, SourceType.FIRE); |
|
|
|
fire += rb.getFloat(ModType.Resistance, SourceType.Fire); |
|
|
|
cold += rb.getFloat(ModType.Resistance, SourceType.COLD); |
|
|
|
cold += rb.getFloat(ModType.Resistance, SourceType.Cold); |
|
|
|
healing += rb.getFloat(ModType.Resistance, SourceType.HEALING); // DamageType.Healing.name());
|
|
|
|
healing += rb.getFloat(ModType.Resistance, SourceType.Healing); // DamageType.Healing.name());
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -404,29 +404,30 @@ public class Resists { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.resists.put(SourceType.SLASHING, slash); |
|
|
|
this.resists.put(Enum.DamageType.Slash, slash); |
|
|
|
this.resists.put(SourceType.CRUSHING, crush); |
|
|
|
this.resists.put(Enum.DamageType.Crush, crush); |
|
|
|
this.resists.put(SourceType.PIERCING, pierce); |
|
|
|
this.resists.put(Enum.DamageType.Pierce, pierce); |
|
|
|
this.resists.put(SourceType.MAGIC, magic); |
|
|
|
this.resists.put(Enum.DamageType.Magic, magic); |
|
|
|
this.resists.put(SourceType.BLEEDING, bleed); |
|
|
|
this.resists.put(Enum.DamageType.Bleed, bleed); |
|
|
|
this.resists.put(SourceType.POISON, poison); |
|
|
|
this.resists.put(Enum.DamageType.Poison, poison); |
|
|
|
this.resists.put(SourceType.MENTAL, mental); |
|
|
|
this.resists.put(Enum.DamageType.Mental, mental); |
|
|
|
this.resists.put(SourceType.HOLY, holy); |
|
|
|
this.resists.put(Enum.DamageType.Holy, holy); |
|
|
|
this.resists.put(SourceType.UNHOLY, unholy); |
|
|
|
this.resists.put(Enum.DamageType.Unholy, unholy); |
|
|
|
this.resists.put(SourceType.LIGHTNING, lightning); |
|
|
|
this.resists.put(Enum.DamageType.Lightning, lightning); |
|
|
|
this.resists.put(SourceType.FIRE, fire); |
|
|
|
this.resists.put(Enum.DamageType.Fire, fire); |
|
|
|
this.resists.put(SourceType.COLD, cold); |
|
|
|
this.resists.put(Enum.DamageType.Cold, cold); |
|
|
|
this.resists.put(SourceType.HEALING, healing); |
|
|
|
this.resists.put(Enum.DamageType.Healing, healing); |
|
|
|
this.immuneTo.put(SourceType.SIEGE, true); |
|
|
|
|
|
|
|
|
|
|
|
this.immuneTo.put(Enum.DamageType.Siege, true); |
|
|
|
|
|
|
|
|
|
|
|
// debug printing of resists
|
|
|
|
// debug printing of resists
|
|
|
|
// printResists(pc);
|
|
|
|
// printResists(pc);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void printResistsToClient(PlayerCharacter pc) { |
|
|
|
public void printResistsToClient(PlayerCharacter pc) { |
|
|
|
for (SourceType dt : resists.keySet()) |
|
|
|
for (Enum.DamageType dt : resists.keySet()) |
|
|
|
ChatManager.chatSystemInfo(pc, " resist." + dt.name() + ": " + resists.get(dt)); |
|
|
|
ChatManager.chatSystemInfo(pc, " resist." + dt.name() + ": " + resists.get(dt)); |
|
|
|
for (SourceType dt : immuneTo.keySet()) |
|
|
|
for (Enum.DamageType dt : immuneTo.keySet()) |
|
|
|
ChatManager.chatSystemInfo(pc, " immuneTo." + dt.name() + ": " + immuneTo.get(dt)); |
|
|
|
ChatManager.chatSystemInfo(pc, " immuneTo." + dt.name() + ": " + immuneTo.get(dt)); |
|
|
|
ChatManager.chatSystemInfo(pc, " immuneToAll: " + this.immuneToAll); |
|
|
|
ChatManager.chatSystemInfo(pc, " immuneToAll: " + this.immuneToAll); |
|
|
|
if (protection != null) |
|
|
|
if (protection != null) |
|
|
@ -439,9 +440,9 @@ public class Resists { |
|
|
|
String out = pc.getName(); |
|
|
|
String out = pc.getName(); |
|
|
|
|
|
|
|
|
|
|
|
out += "Resists: "; |
|
|
|
out += "Resists: "; |
|
|
|
Iterator<SourceType> it = this.resists.keySet().iterator(); |
|
|
|
Iterator<Enum.DamageType> it = this.resists.keySet().iterator(); |
|
|
|
while (it.hasNext()) { |
|
|
|
while (it.hasNext()) { |
|
|
|
SourceType damType = it.next(); |
|
|
|
Enum.DamageType damType = it.next(); |
|
|
|
String dtName = damType.name(); |
|
|
|
String dtName = damType.name(); |
|
|
|
out += dtName + '=' + this.resists.get(dtName) + ", "; |
|
|
|
out += dtName + '=' + this.resists.get(dtName) + ", "; |
|
|
|
} |
|
|
|
} |
|
|
@ -449,7 +450,7 @@ public class Resists { |
|
|
|
out += "ImmuneTo: "; |
|
|
|
out += "ImmuneTo: "; |
|
|
|
it = this.immuneTo.keySet().iterator(); |
|
|
|
it = this.immuneTo.keySet().iterator(); |
|
|
|
while (it.hasNext()) { |
|
|
|
while (it.hasNext()) { |
|
|
|
SourceType damType = it.next(); |
|
|
|
Enum.DamageType damType = it.next(); |
|
|
|
|
|
|
|
|
|
|
|
String dtName = damType.name(); |
|
|
|
String dtName = damType.name(); |
|
|
|
out += dtName + '=' + this.resists.get(dtName) + ", "; |
|
|
|
out += dtName + '=' + this.resists.get(dtName) + ", "; |
|
|
|