forked from MagicBane/Server
Refactor for poweraction implementation
This commit is contained in:
+63
-47
@@ -20,7 +20,8 @@ import engine.wpak.data.Effect;
|
|||||||
import engine.wpak.data.ModifierEntry;
|
import engine.wpak.data.ModifierEntry;
|
||||||
import engine.wpak.data.Power;
|
import engine.wpak.data.Power;
|
||||||
import engine.wpak.data.PowerAction;
|
import engine.wpak.data.PowerAction;
|
||||||
import engine.wpakpowers.Behaviour;
|
import engine.wpakpowers.Actions;
|
||||||
|
import engine.wpakpowers.Behaviours;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -1343,22 +1344,22 @@ public class mbEnums {
|
|||||||
|
|
||||||
public enum ModBehaviorType {
|
public enum ModBehaviorType {
|
||||||
|
|
||||||
Flag(Behaviour::Flag),
|
Flag(Behaviours::Flag),
|
||||||
MapIntToInts(Behaviour::MapIntToInts),
|
MapIntToInts(Behaviours::MapIntToInts),
|
||||||
Standard(Behaviour::Standard),
|
Standard(Behaviours::Standard),
|
||||||
FPSubTypeAttr(Behaviour::FPSubTypeAttr),
|
FPSubTypeAttr(Behaviours::FPSubTypeAttr),
|
||||||
SubTypeSourceType(Behaviour::SubTypeSourceType),
|
SubTypeSourceType(Behaviours::SubTypeSourceType),
|
||||||
SubTypePowerType(Behaviour::SubTypePowerType),
|
SubTypePowerType(Behaviours::SubTypePowerType),
|
||||||
SubTypeSkill(Behaviour::SubTypeSkill),
|
SubTypeSkill(Behaviours::SubTypeSkill),
|
||||||
FPSubTypeDmg(Behaviour::FPSubTypeDmg),
|
FPSubTypeDmg(Behaviours::FPSubTypeDmg),
|
||||||
DD(Behaviour::DD),
|
DD(Behaviours::DD),
|
||||||
String(Behaviour::StringBehaviour),
|
String(Behaviours::StringBehaviour),
|
||||||
SubTypeMod(Behaviour::SubTypeMod),
|
SubTypeMod(Behaviours::SubTypeMod),
|
||||||
SubTypePower(Behaviour::SubTypePower),
|
SubTypePower(Behaviours::SubTypePower),
|
||||||
SubTypeDmg(Behaviour::SubTypeDmg),
|
SubTypeDmg(Behaviours::SubTypeDmg),
|
||||||
FPSubTypeSkill(Behaviour::FPSubTypeSkill),
|
FPSubTypeSkill(Behaviours::FPSubTypeSkill),
|
||||||
FPSubTypeMonster(Behaviour::FPSubTypeMonster),
|
FPSubTypeMonster(Behaviours::FPSubTypeMonster),
|
||||||
ProcInfo(Behaviour::ProcInfo);
|
ProcInfo(Behaviours::ProcInfo);
|
||||||
|
|
||||||
private final ModBehaviorFunction function;
|
private final ModBehaviorFunction function;
|
||||||
|
|
||||||
@@ -2829,37 +2830,52 @@ public class mbEnums {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface PowerActionFunction {
|
||||||
|
void execute();
|
||||||
|
}
|
||||||
|
|
||||||
public enum PowerActionType {
|
public enum PowerActionType {
|
||||||
ApplyEffect,
|
ApplyEffect(Actions::ApplyEffect),
|
||||||
ApplyEffects,
|
ApplyEffects(Actions::ApplyEffects),
|
||||||
Block,
|
Block(Actions::Block),
|
||||||
Charm,
|
Charm(Actions::Charm),
|
||||||
ClaimMine,
|
ClaimMine(Actions::ClaimMine),
|
||||||
ClearAggro,
|
ClearAggro(Actions::ClearAggro),
|
||||||
ClearNearbyAggro,
|
ClearNearbyAggro(Actions::ClearNearbyAggro),
|
||||||
Confusion,
|
Confusion(Actions::Confusion),
|
||||||
CreateMob,
|
CreateMob(Actions::CreateMob),
|
||||||
DamageOverTime,
|
DamageOverTime(Actions::DamageOverTime),
|
||||||
DeferredPower,
|
DeferredPower(Actions::DeferredPower),
|
||||||
DirectDamage,
|
DirectDamage(Actions::DirectDamage),
|
||||||
Invis,
|
Invis(Actions::Invis),
|
||||||
MobRecall,
|
MobRecall(Actions::MobRecall),
|
||||||
Peek,
|
Peek(Actions::Peek),
|
||||||
Recall,
|
Recall(Actions::Recall),
|
||||||
RemoveEffect,
|
RemoveEffect(Actions::RemoveEffect),
|
||||||
Resurrect,
|
Resurrect(Actions::Resurrect),
|
||||||
RunegateTeleport,
|
RunegateTeleport(Actions::RunegateTeleport),
|
||||||
SetItemFlag,
|
SetItemFlag(Actions::SetItemFlag),
|
||||||
SimpleDamage,
|
SimpleDamage(Actions::SimpleDamage),
|
||||||
SpireDisable,
|
SpireDisable(Actions::SpireDisable),
|
||||||
Steal,
|
Steal(Actions::Steal),
|
||||||
Summon,
|
Summon(Actions::Summon),
|
||||||
Teleport,
|
Teleport(Actions::Teleport),
|
||||||
Track,
|
Track(Actions::Track),
|
||||||
TransferStat,
|
TransferStat(Actions::TransferStat),
|
||||||
TransferStatOT,
|
TransferStatOT(Actions::TransferStatOT),
|
||||||
Transform,
|
Transform(Actions::Transform),
|
||||||
TreeChoke
|
TreeChoke(Actions::TreeChoke);
|
||||||
|
|
||||||
|
private final PowerActionFunction function;
|
||||||
|
|
||||||
|
PowerActionType(PowerActionFunction function) {
|
||||||
|
this.function = function;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void execute() {
|
||||||
|
function.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum AccountStatus {
|
public enum AccountStatus {
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package engine.wpakpowers;
|
||||||
|
|
||||||
|
public class Actions {
|
||||||
|
|
||||||
|
public static void ApplyEffect() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ApplyEffects() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Block() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Charm() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ClaimMine() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ClearAggro() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ClearNearbyAggro() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Confusion() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateMob() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DamageOverTime() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DeferredPower() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DirectDamage() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Invis() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void MobRecall() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Peek() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Recall() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RemoveEffect() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Resurrect() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RunegateTeleport() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetItemFlag() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SimpleDamage() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SpireDisable() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Steal() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Summon() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Teleport() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Track() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void TransferStat() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void TransferStatOT() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Transform() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void TreeChoke() {
|
||||||
|
System.out.println("PowerAction method called");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ import engine.wpak.data.ModifierEntry;
|
|||||||
import engine.wpak.data.Power;
|
import engine.wpak.data.Power;
|
||||||
import engine.wpak.data.PowerAction;
|
import engine.wpak.data.PowerAction;
|
||||||
|
|
||||||
public class Behaviour {
|
public class Behaviours {
|
||||||
|
|
||||||
public static Object Flag(AbstractCharacter caster, AbstractWorldObject target, Power power,
|
public static Object Flag(AbstractCharacter caster, AbstractWorldObject target, Power power,
|
||||||
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) {
|
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) {
|
||||||
Reference in New Issue
Block a user