Browse Source

Set curve names properly

feature-config-usage
MagicBot 3 weeks ago
parent
commit
f410fc5482
  1. 4
      src/engine/powers/poweractions/CharmPowerAction.java
  2. 4
      src/engine/powers/poweractions/FearPowerAction.java
  3. 2
      src/engine/powers/poweractions/TransferStatPowerAction.java
  4. 22
      src/engine/wpak/PowerActionParser.java
  5. 4
      src/engine/wpak/data/PowerAction.java
  6. 8
      src/engine/wpak/data/StatTransfer.java

4
src/engine/powers/poweractions/CharmPowerAction.java

@ -28,8 +28,8 @@ public class CharmPowerAction extends AbstractPowerAction { @@ -28,8 +28,8 @@ public class CharmPowerAction extends AbstractPowerAction {
public CharmPowerAction(PowerAction powerAction) {
super(powerAction);
this.levelCap = powerAction.levelCap;
this.levelCapRamp = powerAction.levelCurve.ordinal();
this.levelCap = powerAction.ramp;
this.levelCapRamp = powerAction.rampCurve.ordinal();
}
@Override

4
src/engine/powers/poweractions/FearPowerAction.java

@ -29,8 +29,8 @@ public class FearPowerAction extends AbstractPowerAction { @@ -29,8 +29,8 @@ public class FearPowerAction extends AbstractPowerAction {
public FearPowerAction(PowerAction powerAction) {
super(powerAction);
this.levelCap = powerAction.levelCap;
this.levelCapRamp = powerAction.levelCurve.ordinal();
this.levelCap = powerAction.ramp;
this.levelCapRamp = powerAction.rampCurve.ordinal();
}
@Override

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

@ -71,7 +71,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -71,7 +71,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
public float getTransferAmount(float trains) {
// if (this.transferRampAdd)
return this.powerAction.statTransfer.fromStatValue + (this.transferRamp * trains);
return this.powerAction.statTransfer.ramp + (this.transferRamp * trains);
// else
// return this.transferAmount * (1 + (this.transferRamp * trains));
}

22
src/engine/wpak/PowerActionParser.java

@ -134,10 +134,10 @@ public class PowerActionParser { @@ -134,10 +134,10 @@ public class PowerActionParser {
statTransfer = new StatTransfer();
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
statTransfer.fromStatValue = Float.parseFloat(headerIterator.next());
statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.toStatValue = Float.parseFloat(headerIterator.next());
statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.ramp = Float.parseFloat(headerIterator.next());
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
powerAction.statTransfer = statTransfer;
@ -146,10 +146,10 @@ public class PowerActionParser { @@ -146,10 +146,10 @@ public class PowerActionParser {
statTransfer = new StatTransfer();
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
statTransfer.fromStatValue = Float.parseFloat(headerIterator.next());
statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.toStatValue = Float.parseFloat(headerIterator.next());
statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.ramp = Float.parseFloat(headerIterator.next());
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
statTransfer.transfer_action = headerIterator.next();
@ -170,7 +170,7 @@ public class PowerActionParser { @@ -170,7 +170,7 @@ public class PowerActionParser {
powerAction.effects.add(effect);
break;
case "Resurrect":
powerAction.levelCap = Integer.parseInt(headerIterator.next());
powerAction.ramp = Integer.parseInt(headerIterator.next());
break;
case "SetItemFlag":
powerAction.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
@ -270,10 +270,10 @@ public class PowerActionParser { @@ -270,10 +270,10 @@ public class PowerActionParser {
break;
case "LEVELCAP":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerAction.levelCap = Integer.parseInt(arguments.get(0));
powerAction.ramp = Integer.parseInt(arguments.get(0));
if (arguments.size() > 1) // Not all level caps have a curve
powerAction.levelCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
powerAction.rampCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
break;
case "CLEARAGGRO":
powerAction.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());

4
src/engine/wpak/data/PowerAction.java

@ -22,8 +22,8 @@ public class PowerAction { @@ -22,8 +22,8 @@ public class PowerAction {
public int petLevel;
public int petRace;
public StatTransfer statTransfer;
public int levelCap;
public mbEnums.CompoundCurveType levelCurve;
public int ramp;
public mbEnums.CompoundCurveType rampCurve;
public TrackEntry trackEntry;
// Additional variables after header go here.

8
src/engine/wpak/data/StatTransfer.java

@ -12,11 +12,11 @@ import engine.mbEnums; @@ -12,11 +12,11 @@ import engine.mbEnums;
public class StatTransfer {
public mbEnums.CostType fromStat;
public float fromStatValue;
public mbEnums.CompoundCurveType fromCurve;
public float ramp;
public mbEnums.CompoundCurveType rampCurve;
public mbEnums.CostType toStat;
public float toStatValue;
public mbEnums.CompoundCurveType toCurve;
public float efficiency;
public mbEnums.CompoundCurveType efficiencyCurve;
public boolean fromStatBool;
public boolean toStatBool;
public String transfer_action;

Loading…
Cancel
Save