forked from MagicBane/Server
Static method to apply curves
This commit is contained in:
@@ -1623,8 +1623,7 @@ public class mbEnums {
|
||||
Warrior(SexType.NONE),
|
||||
Wizard(SexType.NONE),
|
||||
Nightstalker(SexType.NONE),
|
||||
Necromancer(SexType.NONE),
|
||||
;
|
||||
Necromancer(SexType.NONE);
|
||||
|
||||
private final SexType sexRestriction;
|
||||
|
||||
|
||||
@@ -31,22 +31,8 @@ public class Behaviour {
|
||||
|
||||
public static Object Standard(AbstractCharacter caster, AbstractWorldObject target, Power power,
|
||||
ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) {
|
||||
boolean useAdditiveCurve = true;
|
||||
float modifierCurveValue = modifierEntry.compoundCurveType.getValue();
|
||||
float modValue;
|
||||
|
||||
if (modifierCurveValue > 0 && modifierCurveValue < .1 &&
|
||||
modifierEntry.min != 0 && modifierEntry.max != 0)
|
||||
useAdditiveCurve = false;
|
||||
|
||||
if (useAdditiveCurve)
|
||||
modValue = powerAction.curve.getValue() + (modifierCurveValue * rank);
|
||||
else
|
||||
modValue = powerAction.curve.getValue() * (1 + (modifierCurveValue * rank));
|
||||
|
||||
modValue = modValue * 0.01f;
|
||||
|
||||
return modValue;
|
||||
return WpakPowerManager.applyCurveToModifier(powerAction, modifierEntry, rank);
|
||||
}
|
||||
|
||||
public static Object FPSubTypeAttr(AbstractCharacter caster, AbstractWorldObject target, Power power,
|
||||
|
||||
@@ -427,4 +427,24 @@ public class WpakPowerManager {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static float applyCurveToModifier(ActionEntry powerAction, ModifierEntry modifierEntry, int rank) {
|
||||
|
||||
boolean additiveMode = true;
|
||||
float modifierCurveValue = modifierEntry.compoundCurveType.getValue();
|
||||
float modValue;
|
||||
|
||||
if (modifierCurveValue > 0 && modifierCurveValue < .1 &&
|
||||
modifierEntry.min != 0 && modifierEntry.max != 0)
|
||||
additiveMode = false;
|
||||
|
||||
if (additiveMode)
|
||||
modValue = powerAction.curve.getValue() + (modifierCurveValue * rank);
|
||||
else
|
||||
modValue = powerAction.curve.getValue() * (1 + (modifierCurveValue * rank));
|
||||
|
||||
modValue = modValue * 0.01f;
|
||||
|
||||
return modValue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user