diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index 828756db..a126d074 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -16,10 +16,10 @@ import engine.math.Vector3f; import engine.math.Vector3fImmutable; import engine.objects.*; import engine.powers.EffectsBase; -import engine.wpak.data.ActionEntry; import engine.wpak.data.Effect; import engine.wpak.data.ModifierEntry; import engine.wpak.data.Power; +import engine.wpak.data.PowerAction; import engine.wpakpowers.Behaviour; import org.pmw.tinylog.Logger; @@ -1340,118 +1340,118 @@ public class mbEnums { Flag { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.Flag(caster, target, power, powerAction, effect, modifierEntry, rank); } }, MapIntToInts { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.MapIntToInts(caster, target, power, powerAction, effect, modifierEntry, rank); } }, Standard { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.Standard(caster, target, power, powerAction, effect, modifierEntry, rank); } }, FPSubTypeAttr { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.FPSubTypeAttr(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypeSourceType { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypeSourceType(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypePowerType { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypePowerType(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypeSkill { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypeSkill(caster, target, power, powerAction, effect, modifierEntry, rank); } }, FPSubTypeDmg { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.FPSubTypeDmg(caster, target, power, powerAction, effect, modifierEntry, rank); } }, DD { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.DD(caster, target, power, powerAction, effect, modifierEntry, rank); } }, String { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.StringBehaviour(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypeMod { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypeMod(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypePower { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypePower(caster, target, power, powerAction, effect, modifierEntry, rank); } }, SubTypeDmg { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.SubTypeDmg(caster, target, power, powerAction, effect, modifierEntry, rank); } }, FPSubTypeSkill { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.FPSubTypeSkill(caster, target, power, powerAction, effect, modifierEntry, rank); } }, FPSubTypeMonster { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.FPSubTypeMonster(caster, target, power, powerAction, effect, modifierEntry, rank); } }, ProcInfo { @Override public Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { return Behaviour.ProcInfo(caster, target, power, powerAction, effect, modifierEntry, rank); } }; public abstract Object apply(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank); + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank); } public enum MovementState { diff --git a/src/engine/wpakpowers/Behaviour.java b/src/engine/wpakpowers/Behaviour.java index 90213c0c..b64f1255 100644 --- a/src/engine/wpakpowers/Behaviour.java +++ b/src/engine/wpakpowers/Behaviour.java @@ -10,104 +10,104 @@ package engine.wpakpowers; import engine.objects.AbstractCharacter; import engine.objects.AbstractWorldObject; -import engine.wpak.data.ActionEntry; import engine.wpak.data.Effect; import engine.wpak.data.ModifierEntry; import engine.wpak.data.Power; +import engine.wpak.data.PowerAction; public class Behaviour { public static Object Flag(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { boolean modValue = true; return modValue; } public static Object MapIntToInts(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object Standard(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { - return WpakPowerManager.applyCurveToModifier(actionEntry, modifierEntry, rank); + return WpakPowerManager.applyCurveToModifier(powerAction, modifierEntry, rank); } public static Object FPSubTypeAttr(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { - return WpakPowerManager.applyCurveToModifier(actionEntry, modifierEntry, rank); + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + return WpakPowerManager.applyCurveToModifier(powerAction, modifierEntry, rank); } public static Object SubTypeSourceType(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object SubTypePowerType(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object SubTypeSkill(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object FPSubTypeDmg(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object DD(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object StringBehaviour(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object SubTypeMod(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object SubTypePower(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object SubTypeDmg(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object FPSubTypeSkill(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object FPSubTypeMonster(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry actionEntry, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } public static Object ProcInfo(AbstractCharacter caster, AbstractWorldObject target, Power power, - ActionEntry powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { + PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) { System.out.println("Behavior method called"); return null; } diff --git a/src/engine/wpakpowers/WpakPowerManager.java b/src/engine/wpakpowers/WpakPowerManager.java index 04e8b82f..52932931 100644 --- a/src/engine/wpakpowers/WpakPowerManager.java +++ b/src/engine/wpakpowers/WpakPowerManager.java @@ -358,7 +358,7 @@ public class WpakPowerManager { for (ModifierEntry modifierEntry : effect.mods) { Object modifier = modifierEntry.type.behaviorType.apply(caster, target, power, - actionEntry, effect, modifierEntry, rank); + powerAction, effect, modifierEntry, rank); appliedEffect.modifiers.put(modifierEntry.type, modifier); } @@ -433,17 +433,17 @@ public class WpakPowerManager { return false; } - public static float applyCurveToModifier(ActionEntry powerAction, ModifierEntry modifierEntry, int rank) { + public static float applyCurveToModifier(PowerAction powerAction, ModifierEntry modifierEntry, int rank) { float scaledValue; // Method scales by either integer or float values driven by the curve type if (EnumSet.of(mbEnums.CompoundCurveType.DefaultFlat, mbEnums.CompoundCurveType.DefaultSlope, - mbEnums.CompoundCurveType.DefaultSlopeDown).contains(powerAction.curve)) - scaledValue = powerAction.curve.getValue() + (modifierEntry.compoundCurveType.getValue() * rank); + mbEnums.CompoundCurveType.DefaultSlopeDown).contains(powerAction.rampCurve)) + scaledValue = powerAction.rampCurve.getValue() + (modifierEntry.compoundCurveType.getValue() * rank); else - scaledValue = powerAction.curve.getValue() * (1 + (modifierEntry.compoundCurveType.getValue() * rank)); + scaledValue = powerAction.rampCurve.getValue() * (1 + (modifierEntry.compoundCurveType.getValue() * rank)); scaledValue = scaledValue * 0.01f;