From f410fc548234e45aebaaaff32c0915e656a02c42 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 30 Nov 2024 09:57:04 -0500 Subject: [PATCH] Set curve names properly --- .../powers/poweractions/CharmPowerAction.java | 4 ++-- .../powers/poweractions/FearPowerAction.java | 4 ++-- .../poweractions/TransferStatPowerAction.java | 2 +- src/engine/wpak/PowerActionParser.java | 22 +++++++++---------- src/engine/wpak/data/PowerAction.java | 4 ++-- src/engine/wpak/data/StatTransfer.java | 8 +++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/engine/powers/poweractions/CharmPowerAction.java b/src/engine/powers/poweractions/CharmPowerAction.java index 13eba3ed..380871cc 100644 --- a/src/engine/powers/poweractions/CharmPowerAction.java +++ b/src/engine/powers/poweractions/CharmPowerAction.java @@ -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 diff --git a/src/engine/powers/poweractions/FearPowerAction.java b/src/engine/powers/poweractions/FearPowerAction.java index 4867bb4d..9ca954a9 100644 --- a/src/engine/powers/poweractions/FearPowerAction.java +++ b/src/engine/powers/poweractions/FearPowerAction.java @@ -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 diff --git a/src/engine/powers/poweractions/TransferStatPowerAction.java b/src/engine/powers/poweractions/TransferStatPowerAction.java index 6d83ed0d..79cde713 100644 --- a/src/engine/powers/poweractions/TransferStatPowerAction.java +++ b/src/engine/powers/poweractions/TransferStatPowerAction.java @@ -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)); } diff --git a/src/engine/wpak/PowerActionParser.java b/src/engine/wpak/PowerActionParser.java index ce48cff4..5e61a777 100644 --- a/src/engine/wpak/PowerActionParser.java +++ b/src/engine/wpak/PowerActionParser.java @@ -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 { 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 { 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 { 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()); diff --git a/src/engine/wpak/data/PowerAction.java b/src/engine/wpak/data/PowerAction.java index ac893b70..d0a02a7c 100644 --- a/src/engine/wpak/data/PowerAction.java +++ b/src/engine/wpak/data/PowerAction.java @@ -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. diff --git a/src/engine/wpak/data/StatTransfer.java b/src/engine/wpak/data/StatTransfer.java index 88eeb65b..c0370d16 100644 --- a/src/engine/wpak/data/StatTransfer.java +++ b/src/engine/wpak/data/StatTransfer.java @@ -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;