@ -10,7 +10,6 @@
@@ -10,7 +10,6 @@
package engine.objects ;
import engine.Enum ;
import engine.Enum.DamageType ;
import engine.Enum.ModType ;
import engine.Enum.SourceType ;
import engine.gameManager.ChatManager ;
@ -28,9 +27,9 @@ import java.util.concurrent.ConcurrentHashMap;
@@ -28,9 +27,9 @@ import java.util.concurrent.ConcurrentHashMap;
public class Resists {
private static ConcurrentHashMap < Integer , Resists > mobResists = new ConcurrentHashMap < > ( MBServerStatics . CHM_INIT_CAP , MBServerStatics . CHM_LOAD , MBServerStatics . CHM_THREAD_LOW ) ;
private ConcurrentHashMap < Damag eType, Float > resists = new ConcurrentHashMap < > ( MBServerStatics . CHM_INIT_CAP , MBServerStatics . CHM_LOAD , MBServerStatics . CHM_THREAD_LOW ) ;
private ConcurrentHashMap < Damag eType, Boolean > immuneTo = new ConcurrentHashMap < > ( MBServerStatics . CHM_INIT_CAP , MBServerStatics . CHM_LOAD , MBServerStatics . CHM_THREAD_LOW ) ;
private Damag eType protection ;
private ConcurrentHashMap < Sourc eType, Float > resists = new ConcurrentHashMap < > ( MBServerStatics . CHM_INIT_CAP , MBServerStatics . CHM_LOAD , MBServerStatics . CHM_THREAD_LOW ) ;
private ConcurrentHashMap < Sourc eType, Boolean > immuneTo = new ConcurrentHashMap < > ( MBServerStatics . CHM_INIT_CAP , MBServerStatics . CHM_LOAD , MBServerStatics . CHM_THREAD_LOW ) ;
private Sourc eType protection ;
private int protectionTrains = 0 ;
private boolean immuneToAll ;
@ -53,9 +52,9 @@ public class Resists {
@@ -53,9 +52,9 @@ public class Resists {
}
public Resists ( Resists r ) {
for ( Damag eType dt : r . resists . keySet ( ) )
for ( Sourc eType dt : r . resists . keySet ( ) )
this . resists . put ( dt , r . resists . get ( dt ) ) ;
for ( Damag eType dt : r . immuneTo . keySet ( ) )
for ( Sourc eType dt : r . immuneTo . keySet ( ) )
this . immuneTo . put ( dt , r . immuneTo . get ( dt ) ) ;
this . protection = r . protection ;
this . protectionTrains = r . protectionTrains ;
@ -85,30 +84,30 @@ public class Resists {
@@ -85,30 +84,30 @@ public class Resists {
* /
public Resists ( ResultSet rs ) throws SQLException {
this . immuneToAll = false ;
this . resists . put ( Damag eType. Slash , rs . getFloat ( "slash" ) ) ;
this . resists . put ( Damag eType. Crush , rs . getFloat ( "crush" ) ) ;
this . resists . put ( DamageType . Pierce , rs . getFloat ( "pierce" ) ) ;
this . resists . put ( Damag eType. Magic , rs . getFloat ( "magic" ) ) ;
this . resists . put ( Damag eType. Bleed , rs . getFloat ( "bleed" ) ) ;
this . resists . put ( Damag eType. Poison , rs . getFloat ( "poison" ) ) ;
this . resists . put ( Damag eType. Mental , rs . getFloat ( "mental" ) ) ;
this . resists . put ( Damag eType. Holy , rs . getFloat ( "holy" ) ) ;
this . resists . put ( Damag eType. Unholy , rs . getFloat ( "unholy" ) ) ;
this . resists . put ( Damag eType. Lightning , rs . getFloat ( "lightning" ) ) ;
this . resists . put ( Damag eType. Fire , rs . getFloat ( "fire" ) ) ;
this . resists . put ( Damag eType. Cold , rs . getFloat ( "cold" ) ) ;
this . resists . put ( Damag eType. Healing , 0f ) ;
this . resists . put ( Sourc eType. Slashing , rs . getFloat ( "slash" ) ) ;
this . resists . put ( Sourc eType. Crushing , rs . getFloat ( "crush" ) ) ;
this . resists . put ( SourceType . Piercing , rs . getFloat ( "pierce" ) ) ;
this . resists . put ( Sourc eType. Magic , rs . getFloat ( "magic" ) ) ;
this . resists . put ( Sourc eType. Bleeding , rs . getFloat ( "bleed" ) ) ;
this . resists . put ( Sourc eType. Poison , rs . getFloat ( "poison" ) ) ;
this . resists . put ( Sourc eType. Mental , rs . getFloat ( "mental" ) ) ;
this . resists . put ( Sourc eType. Holy , rs . getFloat ( "holy" ) ) ;
this . resists . put ( Sourc eType. Unholy , rs . getFloat ( "unholy" ) ) ;
this . resists . put ( Sourc eType. Lightning , rs . getFloat ( "lightning" ) ) ;
this . resists . put ( Sourc eType. Fire , rs . getFloat ( "fire" ) ) ;
this . resists . put ( Sourc eType. Cold , rs . getFloat ( "cold" ) ) ;
this . resists . put ( Sourc eType. Healing , 0f ) ;
}
//Handle Fortitudes
private static float handleFortitude ( AbstractCharacter target , Damag eType type , float damage ) {
private static float handleFortitude ( AbstractCharacter target , Sourc eType type , float damage ) {
if ( target = = null | | ! ( target . getObjectType ( ) . equals ( Enum . GameObjectType . PlayerCharacter ) ) )
return damage ;
PlayerBonuses bonus = target . getBonuses ( ) ;
//see if there is a fortitude
float damageCap = bonus . getFloatPercentAll ( ModType . DamageCap , SourceType . None ) ;
if ( damageCap = = 0f | | type = = Damag eType. Healing )
if ( damageCap = = 0f | | type = = Sourc eType. Healing )
return damage ;
//is fortitude, Are we under the cap?
@ -135,11 +134,11 @@ public class Resists {
@@ -135,11 +134,11 @@ public class Resists {
}
//Test if Damagetype is valid for foritude
private static boolean isValidDamageCapType ( HashSet < SourceType > forts , Damag eType damageType , boolean exclusive ) {
private static boolean isValidDamageCapType ( HashSet < SourceType > forts , Sourc eType damageType , boolean exclusive ) {
for ( SourceType fort : forts ) {
DamageType dt = Damag eType. valueOf ( fort . name ( ) ) ;
SourceType dt = Sourc eType. valueOf ( fort . name ( ) ) ;
if ( dt = = Damag eType. None )
if ( dt = = Sourc eType. None )
continue ;
if ( dt = = damageType ) {
@ -195,19 +194,19 @@ public class Resists {
@@ -195,19 +194,19 @@ public class Resists {
* /
public final void setBuildingResists ( ) {
this . immuneToAll = false ;
this . resists . put ( Damag eType. Slash , 85f ) ;
this . resists . put ( Damag eType. Crush , 85f ) ;
this . resists . put ( Damag eType. Siege , 0f ) ;
this . immuneTo . put ( DamageType . Pierce , true ) ;
this . immuneTo . put ( Damag eType. Magic , true ) ;
this . immuneTo . put ( Damag eType. Bleed , true ) ;
this . immuneTo . put ( Damag eType. Poison , true ) ;
this . immuneTo . put ( Damag eType. Mental , true ) ;
this . immuneTo . put ( Damag eType. Holy , true ) ;
this . immuneTo . put ( Damag eType. Unholy , true ) ;
this . immuneTo . put ( Damag eType. Lightning , true ) ;
this . immuneTo . put ( Damag eType. Fire , true ) ;
this . immuneTo . put ( Damag eType. Cold , true ) ;
this . resists . put ( Sourc eType. Slashing , 85f ) ;
this . resists . put ( Sourc eType. Crushing , 85f ) ;
this . resists . put ( Sourc eType. Siege , 0f ) ;
this . immuneTo . put ( SourceType . Piercing , true ) ;
this . immuneTo . put ( Sourc eType. Magic , true ) ;
this . immuneTo . put ( Sourc eType. Bleeding , true ) ;
this . immuneTo . put ( Sourc eType. Poison , true ) ;
this . immuneTo . put ( Sourc eType. Mental , true ) ;
this . immuneTo . put ( Sourc eType. Holy , true ) ;
this . immuneTo . put ( Sourc eType. Unholy , true ) ;
this . immuneTo . put ( Sourc eType. Lightning , true ) ;
this . immuneTo . put ( Sourc eType. Fire , true ) ;
this . immuneTo . put ( Sourc eType. Cold , true ) ;
}
@ -216,19 +215,19 @@ public class Resists {
@@ -216,19 +215,19 @@ public class Resists {
* /
public final void setMineResists ( ) {
this . immuneToAll = false ;
this . immuneTo . put ( Damag eType. Slash , true ) ;
this . immuneTo . put ( Damag eType. Crush , true ) ;
this . immuneTo . put ( DamageType . Pierce , true ) ;
this . immuneTo . put ( Damag eType. Magic , true ) ;
this . immuneTo . put ( Damag eType. Bleed , true ) ;
this . immuneTo . put ( Damag eType. Poison , true ) ;
this . immuneTo . put ( Damag eType. Mental , true ) ;
this . immuneTo . put ( Damag eType. Holy , true ) ;
this . immuneTo . put ( Damag eType. Unholy , true ) ;
this . immuneTo . put ( Damag eType. Lightning , true ) ;
this . immuneTo . put ( Damag eType. Fire , true ) ;
this . immuneTo . put ( Damag eType. Cold , true ) ;
this . resists . put ( Damag eType. Siege , 0f ) ;
this . immuneTo . put ( Sourc eType. Slashing , true ) ;
this . immuneTo . put ( Sourc eType. Crushing , true ) ;
this . immuneTo . put ( SourceType . Piercing , true ) ;
this . immuneTo . put ( Sourc eType. Magic , true ) ;
this . immuneTo . put ( Sourc eType. Bleeding , true ) ;
this . immuneTo . put ( Sourc eType. Poison , true ) ;
this . immuneTo . put ( Sourc eType. Mental , true ) ;
this . immuneTo . put ( Sourc eType. Holy , true ) ;
this . immuneTo . put ( Sourc eType. Unholy , true ) ;
this . immuneTo . put ( Sourc eType. Lightning , true ) ;
this . immuneTo . put ( Sourc eType. Fire , true ) ;
this . immuneTo . put ( Sourc eType. Cold , true ) ;
this . resists . put ( Sourc eType. Siege , 0f ) ;
}
/ * *
@ -236,27 +235,27 @@ public class Resists {
@@ -236,27 +235,27 @@ public class Resists {
* /
public final void setGenericResists ( ) {
this . immuneToAll = false ;
this . resists . put ( Damag eType. Slash , 0f ) ;
this . resists . put ( Damag eType. Crush , 0f ) ;
this . resists . put ( DamageType . Pierce , 0f ) ;
this . resists . put ( Damag eType. Magic , 0f ) ;
this . resists . put ( Damag eType. Bleed , 0f ) ;
this . resists . put ( Damag eType. Poison , 0f ) ;
this . resists . put ( Damag eType. Mental , 0f ) ;
this . resists . put ( Damag eType. Holy , 0f ) ;
this . resists . put ( Damag eType. Unholy , 0f ) ;
this . resists . put ( Damag eType. Lightning , 0f ) ;
this . resists . put ( Damag eType. Fire , 0f ) ;
this . resists . put ( Damag eType. Cold , 0f ) ;
this . resists . put ( Damag eType. Healing , 0f ) ;
this . immuneTo . put ( Damag eType. Siege , true ) ;
this . resists . put ( Sourc eType. Slashing , 0f ) ;
this . resists . put ( Sourc eType. Crushing , 0f ) ;
this . resists . put ( SourceType . Piercing , 0f ) ;
this . resists . put ( Sourc eType. Magic , 0f ) ;
this . resists . put ( Sourc eType. Bleeding , 0f ) ;
this . resists . put ( Sourc eType. Poison , 0f ) ;
this . resists . put ( Sourc eType. Mental , 0f ) ;
this . resists . put ( Sourc eType. Holy , 0f ) ;
this . resists . put ( Sourc eType. Unholy , 0f ) ;
this . resists . put ( Sourc eType. Lightning , 0f ) ;
this . resists . put ( Sourc eType. Fire , 0f ) ;
this . resists . put ( Sourc eType. Cold , 0f ) ;
this . resists . put ( Sourc eType. Healing , 0f ) ;
this . immuneTo . put ( Sourc eType. Siege , true ) ;
}
/ * *
* Get a resist
* /
public float getResist ( Damag eType type , int trains ) {
public float getResist ( Sourc eType type , int trains ) {
//get resisted amount
Float amount = 0f ;
if ( this . resists . containsKey ( type ) )
@ -278,7 +277,7 @@ public class Resists {
@@ -278,7 +277,7 @@ public class Resists {
/ * *
* get immuneTo
* /
public boolean immuneTo ( Damag eType type ) {
public boolean immuneTo ( Sourc eType type ) {
if ( this . immuneTo . containsKey ( type ) )
return this . immuneTo . get ( type ) ;
else
@ -292,84 +291,46 @@ public class Resists {
@@ -292,84 +291,46 @@ public class Resists {
return this . immuneToAll ;
}
public boolean immuneToPowers ( ) {
return immuneTo ( DamageType . Powers ) ;
}
public boolean immuneToAttacks ( ) {
return immuneTo ( Damag eType. Attack ) ;
return immuneTo ( SourceType . ImmuneToAttack ) ;
}
public boolean immuneToSpires ( ) {
return immuneTo ( DamageType . Spires ) ;
}
/ * *
* gets immuneTo ( type ) and immuneToAll
* /
public boolean isImmune ( DamageType type ) {
if ( this . immuneToAll )
return true ;
return this . immuneTo ( type ) ;
}
/ * *
* Set a resist
* /
public void setResist ( Damag eType type , float value ) {
public void setResist ( SourceType type , float value ) {
this . resists . put ( type , value ) ;
}
/ * *
* add to a resist
* /
public void incResist ( DamageType type , float value ) {
Float amount = this . resists . get ( type ) ;
if ( amount = = null )
this . resists . put ( type , value ) ;
else
this . resists . put ( type , amount + value ) ;
}
/ * *
* subtract from a resist
* /
public void decResist ( DamageType type , float value ) {
Float amount = this . resists . get ( type ) ;
if ( amount = = null )
this . resists . put ( type , ( 0 - value ) ) ;
else
this . resists . put ( type , amount - value ) ;
}
/ * *
* set immunities from mobbase
* /
public void setImmuneTo ( int immune ) {
setImmuneTo ( Damag eType. Stun , ( ( immune & 1 ) ! = 0 ) ) ;
setImmuneTo ( DamageType . PowerB lock, ( ( immune & 2 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Drain , ( ( immune & 4 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Snare , ( ( immune & 8 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Siege , ( ( immune & 16 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Slash , ( ( immune & 32 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Crush , ( ( immune & 64 ) ! = 0 ) ) ;
setImmuneTo ( DamageType . Pierce , ( ( immune & 128 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Magic , ( ( immune & 256 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Bleed , ( ( immune & 512 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Poison , ( ( immune & 1024 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Mental , ( ( immune & 2048 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Holy , ( ( immune & 4096 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Unholy , ( ( immune & 8192 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Lightning , ( ( immune & 16384 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Fire , ( ( immune & 32768 ) ! = 0 ) ) ;
setImmuneTo ( Damag eType. Cold , ( ( immune & 65536 ) ! = 0 ) ) ;
setImmuneTo ( DamageType . Stee l, ( ( immune & 131072 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Stun , ( ( immune & 1 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Powerblock , ( ( immune & 2 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Drain , ( ( immune & 4 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Snare , ( ( immune & 8 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Siege , ( ( immune & 16 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Slashing , ( ( immune & 32 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Crushing , ( ( immune & 64 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Piercing , ( ( immune & 128 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Magic , ( ( immune & 256 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Bleeding , ( ( immune & 512 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Poison , ( ( immune & 1024 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Mental , ( ( immune & 2048 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Holy , ( ( immune & 4096 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Unholy , ( ( immune & 8192 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Lightning , ( ( immune & 16384 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Fire , ( ( immune & 32768 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Cold , ( ( immune & 65536 ) ! = 0 ) ) ;
setImmuneTo ( SourceType . Steal , ( ( immune & 131072 ) ! = 0 ) ) ;
}
/ * *
* set / unset immuneTo
* /
public void setImmuneTo ( Damag eType type , boolean value ) {
public void setImmuneTo ( Sourc eType type , boolean value ) {
this . immuneTo . put ( type , value ) ;
}
@ -392,7 +353,7 @@ public class Resists {
@@ -392,7 +353,7 @@ public class Resists {
* get Damage after resist
* Expects heals as negative damage and damage as positive damage for fortitudes .
* /
public float getResistedDamage ( AbstractCharacter source , AbstractCharacter target , Damag eType type , float damage , int trains ) {
public float getResistedDamage ( AbstractCharacter source , AbstractCharacter target , Sourc eType type , float damage , int trains ) {
//handle fortitudes
damage = handleFortitude ( target , type , damage ) ;
//calculate armor piercing
@ -430,32 +391,32 @@ public class Resists {
@@ -430,32 +391,32 @@ public class Resists {
if ( rb ! = null ) {
// Handle immunities
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Stun ) )
this . immuneTo . put ( Damag eType. Stun , true ) ;
this . immuneTo . put ( Sourc eType. Stun , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Blind ) )
this . immuneTo . put ( Damag eType. Blind , true ) ;
this . immuneTo . put ( Sourc eType. Blind , true ) ;
if ( rb . getBool ( ModType . ImmuneToAttack , SourceType . None ) )
this . immuneTo . put ( Damag eType. Attack , true ) ;
this . immuneTo . put ( Sourc eType. ImmuneTo Attack, true ) ;
if ( rb . getBool ( ModType . ImmuneToPowers , SourceType . None ) )
this . immuneTo . put ( Damag eType. Powers , true ) ;
this . immuneTo . put ( Sourc eType. ImmuneTo Powers, true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Powerblock ) )
this . immuneTo . put ( Damag eType. Powerblock , true ) ;
this . immuneTo . put ( Sourc eType. Powerblock , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . DeBuff ) )
this . immuneTo . put ( Damag eType. DeBuff , true ) ;
this . immuneTo . put ( Sourc eType. DeBuff , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Fear ) )
this . immuneTo . put ( Damag eType. Fear , true ) ;
this . immuneTo . put ( Sourc eType. Fear , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Charm ) )
this . immuneTo . put ( Damag eType. Charm , true ) ;
this . immuneTo . put ( Sourc eType. Charm , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Root ) )
this . immuneTo . put ( Damag eType. Root , true ) ;
this . immuneTo . put ( Sourc eType. Root , true ) ;
if ( rb . getBool ( ModType . ImmuneTo , SourceType . Snare ) )
this . immuneTo . put ( Damag eType. Snare , true ) ;
this . immuneTo . put ( Sourc eType. Snare , true ) ;
// Handle resists
slash + = rb . getFloat ( ModType . Resistance , SourceType . Slash ) ;
crush + = rb . getFloat ( ModType . Resistance , SourceType . Crush ) ;
pierce + = rb . getFloat ( ModType . Resistance , SourceType . Pierce ) ;
slash + = rb . getFloat ( ModType . Resistance , SourceType . Slashing ) ;
crush + = rb . getFloat ( ModType . Resistance , SourceType . Crushing ) ;
pierce + = rb . getFloat ( ModType . Resistance , SourceType . Piercing ) ;
magic + = rb . getFloat ( ModType . Resistance , SourceType . Magic ) ;
bleed + = rb . getFloat ( ModType . Resistance , SourceType . Bleed ) ;
bleed + = rb . getFloat ( ModType . Resistance , SourceType . Bleeding ) ;
poison + = rb . getFloat ( ModType . Resistance , SourceType . Poison ) ;
mental + = rb . getFloat ( ModType . Resistance , SourceType . Mental ) ;
holy + = rb . getFloat ( ModType . Resistance , SourceType . Holy ) ;
@ -465,19 +426,6 @@ public class Resists {
@@ -465,19 +426,6 @@ public class Resists {
cold + = rb . getFloat ( ModType . Resistance , SourceType . Cold ) ;
healing + = rb . getFloat ( ModType . Resistance , SourceType . Healing ) ; // DamageType.Healing.name());
//HHO
// String protectionString = rb.getString("protection");
//
// if (protectionString.isEmpty())
// this.protection = null;
// else try {
// this.protection = DamageType.valueOf(rb.getString("protection"));
// } catch (IllegalArgumentException e) {
// Logger.error( "No enum for: " + protectionString);
// this.protection = null;
// }
// this.protectionTrains = rb.getFloat("protection");
}
// get resists from equipment
@ -500,30 +448,30 @@ public class Resists {
@@ -500,30 +448,30 @@ public class Resists {
}
}
this . resists . put ( Damag eType. Slash , slash ) ;
this . resists . put ( Damag eType. Crush , crush ) ;
this . resists . put ( DamageType . Pierce , pierce ) ;
this . resists . put ( Damag eType. Magic , magic ) ;
this . resists . put ( Damag eType. Bleed , bleed ) ;
this . resists . put ( Damag eType. Poison , poison ) ;
this . resists . put ( Damag eType. Mental , mental ) ;
this . resists . put ( Damag eType. Holy , holy ) ;
this . resists . put ( Damag eType. Unholy , unholy ) ;
this . resists . put ( Damag eType. Lightning , lightning ) ;
this . resists . put ( Damag eType. Fire , fire ) ;
this . resists . put ( Damag eType. Cold , cold ) ;
this . resists . put ( Damag eType. Healing , healing ) ;
this . resists . put ( Sourc eType. Slashing , slash ) ;
this . resists . put ( Sourc eType. Crushing , crush ) ;
this . resists . put ( SourceType . Piercing , pierce ) ;
this . resists . put ( Sourc eType. Magic , magic ) ;
this . resists . put ( Sourc eType. Bleeding , bleed ) ;
this . resists . put ( Sourc eType. Poison , poison ) ;
this . resists . put ( Sourc eType. Mental , mental ) ;
this . resists . put ( Sourc eType. Holy , holy ) ;
this . resists . put ( Sourc eType. Unholy , unholy ) ;
this . resists . put ( Sourc eType. Lightning , lightning ) ;
this . resists . put ( Sourc eType. Fire , fire ) ;
this . resists . put ( Sourc eType. Cold , cold ) ;
this . resists . put ( Sourc eType. Healing , healing ) ;
this . immuneTo . put ( Damag eType. Siege , true ) ;
this . immuneTo . put ( Sourc eType. Siege , true ) ;
// debug printing of resists
// printResists(pc);
}
public void printResistsToClient ( PlayerCharacter pc ) {
for ( Damag eType dt : resists . keySet ( ) )
for ( Sourc eType dt : resists . keySet ( ) )
ChatManager . chatSystemInfo ( pc , " resist." + dt . name ( ) + ": " + resists . get ( dt ) ) ;
for ( Damag eType dt : immuneTo . keySet ( ) )
for ( Sourc eType dt : immuneTo . keySet ( ) )
ChatManager . chatSystemInfo ( pc , " immuneTo." + dt . name ( ) + ": " + immuneTo . get ( dt ) ) ;
ChatManager . chatSystemInfo ( pc , " immuneToAll: " + this . immuneToAll ) ;
if ( protection ! = null )
@ -536,9 +484,9 @@ public class Resists {
@@ -536,9 +484,9 @@ public class Resists {
String out = pc . getName ( ) ;
out + = "Resists: " ;
Iterator < Damag eType> it = this . resists . keySet ( ) . iterator ( ) ;
Iterator < Sourc eType> it = this . resists . keySet ( ) . iterator ( ) ;
while ( it . hasNext ( ) ) {
Damag eType damType = it . next ( ) ;
Sourc eType damType = it . next ( ) ;
String dtName = damType . name ( ) ;
out + = dtName + '=' + this . resists . get ( dtName ) + ", " ;
}
@ -546,7 +494,7 @@ public class Resists {
@@ -546,7 +494,7 @@ public class Resists {
out + = "ImmuneTo: " ;
it = this . immuneTo . keySet ( ) . iterator ( ) ;
while ( it . hasNext ( ) ) {
Damag eType damType = it . next ( ) ;
Sourc eType damType = it . next ( ) ;
String dtName = damType . name ( ) ;
out + = dtName + '=' + this . resists . get ( dtName ) + ", " ;