Browse Source

More cleanup in statTransferAction

feature-config-usage
MagicBot 3 months ago
parent
commit
92db9e1086
  1. 9
      src/engine/powers/poweractions/TransferStatOTPowerAction.java
  2. 10
      src/engine/powers/poweractions/TransferStatPowerAction.java

9
src/engine/powers/poweractions/TransferStatOTPowerAction.java

@ -17,9 +17,8 @@ import engine.objects.AbstractWorldObject; @@ -17,9 +17,8 @@ import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase;
import engine.powers.EffectsBase;
import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
@ -27,10 +26,10 @@ public class TransferStatOTPowerAction extends TransferStatPowerAction { @@ -27,10 +26,10 @@ public class TransferStatOTPowerAction extends TransferStatPowerAction {
private int numIterations;
public TransferStatOTPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
super(rs, effects);
public TransferStatOTPowerAction(PowerAction powerAction, HashMap<String, EffectsBase> effects) {
super(powerAction, effects);
this.numIterations = rs.getInt("numIterations");
this.numIterations = powerAction.statTransfer.transfer_ticks;
}
public int getNumIterations() {

10
src/engine/powers/poweractions/TransferStatPowerAction.java

@ -32,11 +32,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -32,11 +32,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
protected String effectID;
public PowerAction powerAction;
protected float transferAmount;
protected float transferRamp;
protected boolean transferRampAdd;
protected float transferEfficiency;
protected float transferEfficiencyRamp;
protected boolean transferEfficiencyRampAdd;
protected boolean targetToCaster;
protected mbEnums.DamageType damageType;
@ -48,10 +44,6 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -48,10 +44,6 @@ public class TransferStatPowerAction extends AbstractPowerAction {
this.powerAction = powerAction;
this.effectID = powerAction.effects.get(0).effect_id;
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;
@ -79,7 +71,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -79,7 +71,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
public float getTransferAmount(float trains) {
// if (this.transferRampAdd)
return this.transferAmount + (this.transferRamp * trains);
return this.powerAction.statTransfer.fromStatValue + (this.transferRamp * trains);
// else
// return this.transferAmount * (1 + (this.transferRamp * trains));
}

Loading…
Cancel
Save