@ -22,9 +22,8 @@ import engine.powers.ActionsBase;
@@ -22,9 +22,8 @@ import engine.powers.ActionsBase;
import engine.powers.EffectsBase ;
import engine.powers.PowersBase ;
import engine.powers.effectmodifiers.HealthEffectModifier ;
import engine.wpak.data.PowerAction ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.util.HashMap ;
import java.util.concurrent.ThreadLocalRandom ;
@ -47,34 +46,35 @@ public class TransferStatPowerAction extends AbstractPowerAction {
@@ -47,34 +46,35 @@ public class TransferStatPowerAction extends AbstractPowerAction {
protected mbEnums . DamageType damageType ;
protected EffectsBase effect ;
public TransferStatPowerAction ( ResultSet rs , HashMap < String , EffectsBase > effects ) throws SQLException {
super ( rs ) ;
this . effectID = rs . getString ( "effectID" ) ;
String st = rs . getString ( "transferFromType" ) ;
public TransferStatPowerAction ( PowerAction powerAction , HashMap < String , EffectsBase > effects ) {
super ( powerAction ) ;
this . effectID = powerAction . effects . get ( 0 ) . effect_id ;
String st = powerAction . statTransfer . fromStat ;
if ( st . equals ( "HEALTH" ) )
this . transferFromHealth = true ;
else if ( st . equals ( "MANA" ) )
this . transferFromMana = true ;
else
this . transferFromStamina = true ;
st = rs . getString ( "transferToType" ) ;
st = powerAction . getString ( "transferToType" ) ;
if ( st . equals ( "HEALTH" ) )
this . transferToHealth = true ;
else if ( st . equals ( "MANA" ) )
this . transferToMana = true ;
else
this . transferToStamina = true ;
this . transferAmount = rs . getFloat ( "transferAmount" ) ;
this . transferRamp = rs . getFloat ( "transferRamp" ) ;
this . transferEfficiency = rs . getFloat ( "transferEfficiency" ) ;
this . transferEfficiencyRamp = rs . getFloat ( "transferEfficiencyRamp" ) ;
int flags = rs . getInt ( "flags" ) ;
this . transferAmount = powerAction . getFloat ( "transferAmount" ) ;
this . transferRamp = powerAction . getFloat ( "transferRamp" ) ;
this . transferEfficiency = powerAction . getFloat ( "transferEfficiency" ) ;
this . transferEfficiencyRamp = powerAction . getFloat ( "transferEfficiencyRamp" ) ;
int flags = powerAction . getInt ( "flags" ) ;
this . transferRampAdd = ( ( flags & 4096 ) ! = 0 ) ? true : false ;
this . transferEfficiencyRampAdd = ( ( flags & 8192 ) ! = 0 ) ? true : false ;
this . targetToCaster = ( ( flags & 16384 ) ! = 0 ) ? true : false ;
this . effect = effects . get ( this . effectID ) ;
try {
String damageString = rs . getString ( "damageType" ) ;
String damageString = powerAction . getString ( "damageType" ) ;
// Damage type can sometimes be null in the DB.
if ( damageString . isEmpty ( ) = = false )