Browse Source

Set curve names properly

feature-config-usage
MagicBot 4 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 {
public CharmPowerAction(PowerAction powerAction) { public CharmPowerAction(PowerAction powerAction) {
super(powerAction); super(powerAction);
this.levelCap = powerAction.levelCap; this.levelCap = powerAction.ramp;
this.levelCapRamp = powerAction.levelCurve.ordinal(); this.levelCapRamp = powerAction.rampCurve.ordinal();
} }
@Override @Override

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

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

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

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

22
src/engine/wpak/PowerActionParser.java

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

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

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

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

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

Loading…
Cancel
Save