Browse Source

Update to helper method

feature-config-usage
MagicBot 2 days ago
parent
commit
a5cb785587
  1. 18
      src/engine/wpakpowers/WpakPowerManager.java

18
src/engine/wpakpowers/WpakPowerManager.java

@ -423,18 +423,26 @@ public class WpakPowerManager {
Pair<Float, Float> outData = new Pair<>(0f, 0f); Pair<Float, Float> outData = new Pair<>(0f, 0f);
// Only a subset of these ModTypes used for percents // Only a subset of these ModTypes used for percents
// are multiplicative. Everything else is additive. // are multiplicative. These have compound curves
// with "SIVL" as a prefix. (Suggests interpolation)
if (modifierEntry.percentage != 0f) { if (modifierEntry.percentage != 0f) {
outData.first = modifierEntry.percentage + (modifierEntry.compoundCurveType.getValue() * rank); outData.first = modifierEntry.compoundCurveType.name().contains("SIVL") ?
modifierEntry.percentage * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
modifierEntry.percentage + (modifierEntry.compoundCurveType.getValue() * rank);
outData.first = outData.first * 0.01f; outData.first = outData.first * 0.01f;
return outData; return outData;
} }
// As there is a min/max we return both as a pai in linear moder // As there is a min/max we return both as a pair
outData.first = modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank); outData.first = modifierEntry.compoundCurveType.name().contains("SIVL") ?
outData.second = modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank); modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank);
outData.second = modifierEntry.compoundCurveType.name().contains("SIVL") ?
modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank);
return outData; return outData;
} }

Loading…
Cancel
Save