|
|
|
@ -34,6 +34,7 @@ import engine.wpak.data.Effect;
@@ -34,6 +34,7 @@ import engine.wpak.data.Effect;
|
|
|
|
|
import engine.wpak.data.*; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.util.EnumSet; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
|
@ -430,21 +431,18 @@ public class WpakPowerManager {
@@ -430,21 +431,18 @@ public class WpakPowerManager {
|
|
|
|
|
|
|
|
|
|
public static float applyCurveToModifier(ActionEntry powerAction, ModifierEntry modifierEntry, int rank) { |
|
|
|
|
|
|
|
|
|
boolean additiveMode = true; |
|
|
|
|
float modifierCurveValue = modifierEntry.compoundCurveType.getValue(); |
|
|
|
|
float modValue; |
|
|
|
|
float scaledValue; |
|
|
|
|
|
|
|
|
|
if (modifierCurveValue > 0 && modifierCurveValue < .1 && |
|
|
|
|
modifierEntry.min != 0 && modifierEntry.max != 0) |
|
|
|
|
additiveMode = false; |
|
|
|
|
// Method scales by either integer or float values driven by the curve type
|
|
|
|
|
|
|
|
|
|
if (additiveMode) |
|
|
|
|
modValue = powerAction.curve.getValue() + (modifierCurveValue * rank); |
|
|
|
|
if (EnumSet.of(mbEnums.CompoundCurveType.DefaultFlat, mbEnums.CompoundCurveType.DefaultSlope, |
|
|
|
|
mbEnums.CompoundCurveType.DefaultSlopeDown).contains(powerAction.curve)) |
|
|
|
|
scaledValue = powerAction.curve.getValue() + (modifierEntry.compoundCurveType.getValue() * rank); |
|
|
|
|
else |
|
|
|
|
modValue = powerAction.curve.getValue() * (1 + (modifierCurveValue * rank)); |
|
|
|
|
scaledValue = powerAction.curve.getValue() * (1 + (modifierEntry.compoundCurveType.getValue() * rank)); |
|
|
|
|
|
|
|
|
|
modValue = modValue * 0.01f; |
|
|
|
|
scaledValue = scaledValue * 0.01f; |
|
|
|
|
|
|
|
|
|
return modValue; |
|
|
|
|
return scaledValue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|