From 1a64272801362920556981e53cf3ec78ac302644 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 22 Feb 2025 13:10:30 -0500 Subject: [PATCH] Unified signature: caster/power/rank/target --- src/engine/mbEnums.java | 10 +- src/engine/wpakpowers/Actions.java | 116 ++++++++++---------- src/engine/wpakpowers/WpakPowerManager.java | 2 +- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index b8c8d1cb..8ee88b95 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -1375,8 +1375,8 @@ public class mbEnums { @FunctionalInterface public interface PowerActionFunction { - void execute(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction); + void execute(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target, + PowerAction powerAction); } public enum PowerActionType { @@ -1420,9 +1420,9 @@ public class mbEnums { // Need to figure out what this signature looks like. // Identical to behaviours? - public void execute(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { - function.execute(caster, target, power, rank, powerAction); + public void execute(AbstractCharacter caster, Power power, Integer rank, AbstractWorldObject target, + PowerAction powerAction) { + function.execute(caster, power, rank, target, powerAction); } } diff --git a/src/engine/wpakpowers/Actions.java b/src/engine/wpakpowers/Actions.java index fdbd9c86..6c5dd4cd 100644 --- a/src/engine/wpakpowers/Actions.java +++ b/src/engine/wpakpowers/Actions.java @@ -17,8 +17,8 @@ import engine.wpak.data.PowerAction; public class Actions { - public static void ApplyEffects(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void ApplyEffects(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { // Iterate effects for this powerAction and apply @@ -48,143 +48,143 @@ public class Actions { // target.updateBonuses() here? } - public static void Block(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Block(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Charm(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Charm(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void ClaimMine(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void ClaimMine(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void ClearAggro(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void ClearAggro(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void ClearNearbyAggro(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void ClearNearbyAggro(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Confusion(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Confusion(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void CreateMob(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void CreateMob(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void DamageOverTime(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void DamageOverTime(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void DeferredPower(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void DeferredPower(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void DirectDamage(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void DirectDamage(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Invis(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Invis(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void MobRecall(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void MobRecall(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Peek(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Peek(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Recall(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Recall(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void RemoveEffect(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void RemoveEffect(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Resurrect(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Resurrect(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void RunegateTeleport(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void RunegateTeleport(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void SetItemFlag(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void SetItemFlag(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void SimpleDamage(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void SimpleDamage(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void SpireDisable(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void SpireDisable(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Steal(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Steal(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Summon(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Summon(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Teleport(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Teleport(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Track(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Track(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void TransferStat(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void TransferStat(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void TransferStatOT(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void TransferStatOT(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void Transform(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void Transform(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } - public static void TreeChoke(AbstractCharacter caster, AbstractWorldObject target, Power power, - Integer rank, PowerAction powerAction) { + public static void TreeChoke(AbstractCharacter caster, Power power, + Integer rank, AbstractWorldObject target, PowerAction powerAction) { System.out.println("PowerAction method called"); } } diff --git a/src/engine/wpakpowers/WpakPowerManager.java b/src/engine/wpakpowers/WpakPowerManager.java index 46a0e598..7383836c 100644 --- a/src/engine/wpakpowers/WpakPowerManager.java +++ b/src/engine/wpakpowers/WpakPowerManager.java @@ -351,7 +351,7 @@ public class WpakPowerManager { continue; } - powerAction.action_type.execute(caster, target, power, rank, + powerAction.action_type.execute(caster, power, rank, target, powerAction); } }