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.Power;
|
||||
import engine.wpak.data.PowerAction;
|
||||
import engine.wpakpowers.Behaviour;
|
||||
import engine.wpakpowers.Actions;
|
||||
import engine.wpakpowers.Behaviours;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1343,22 +1344,22 @@ public class mbEnums {
|
||||
|
||||
public enum ModBehaviorType {
|
||||
|
||||
Flag(Behaviour::Flag),
|
||||
MapIntToInts(Behaviour::MapIntToInts),
|
||||
Standard(Behaviour::Standard),
|
||||
FPSubTypeAttr(Behaviour::FPSubTypeAttr),
|
||||
SubTypeSourceType(Behaviour::SubTypeSourceType),
|
||||
SubTypePowerType(Behaviour::SubTypePowerType),
|
||||
SubTypeSkill(Behaviour::SubTypeSkill),
|
||||
FPSubTypeDmg(Behaviour::FPSubTypeDmg),
|
||||
DD(Behaviour::DD),
|
||||
String(Behaviour::StringBehaviour),
|
||||
SubTypeMod(Behaviour::SubTypeMod),
|
||||
SubTypePower(Behaviour::SubTypePower),
|
||||
SubTypeDmg(Behaviour::SubTypeDmg),
|
||||
FPSubTypeSkill(Behaviour::FPSubTypeSkill),
|
||||
FPSubTypeMonster(Behaviour::FPSubTypeMonster),
|
||||
ProcInfo(Behaviour::ProcInfo);
|
||||
Flag(Behaviours::Flag),
|
||||
MapIntToInts(Behaviours::MapIntToInts),
|
||||
Standard(Behaviours::Standard),
|
||||
FPSubTypeAttr(Behaviours::FPSubTypeAttr),
|
||||
SubTypeSourceType(Behaviours::SubTypeSourceType),
|
||||
SubTypePowerType(Behaviours::SubTypePowerType),
|
||||
SubTypeSkill(Behaviours::SubTypeSkill),
|
||||
FPSubTypeDmg(Behaviours::FPSubTypeDmg),
|
||||
DD(Behaviours::DD),
|
||||
String(Behaviours::StringBehaviour),
|
||||
SubTypeMod(Behaviours::SubTypeMod),
|
||||
SubTypePower(Behaviours::SubTypePower),
|
||||
SubTypeDmg(Behaviours::SubTypeDmg),
|
||||
FPSubTypeSkill(Behaviours::FPSubTypeSkill),
|
||||
FPSubTypeMonster(Behaviours::FPSubTypeMonster),
|
||||
ProcInfo(Behaviours::ProcInfo);
|
||||
|
||||
private final ModBehaviorFunction function;
|
||||
|
||||
@@ -2829,37 +2830,52 @@ public class mbEnums {
|
||||
}
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PowerActionFunction {
|
||||
void execute();
|
||||
}
|
||||
|
||||
public enum PowerActionType {
|
||||
ApplyEffect,
|
||||
ApplyEffects,
|
||||
Block,
|
||||
Charm,
|
||||
ClaimMine,
|
||||
ClearAggro,
|
||||
ClearNearbyAggro,
|
||||
Confusion,
|
||||
CreateMob,
|
||||
DamageOverTime,
|
||||
DeferredPower,
|
||||
DirectDamage,
|
||||
Invis,
|
||||
MobRecall,
|
||||
Peek,
|
||||
Recall,
|
||||
RemoveEffect,
|
||||
Resurrect,
|
||||
RunegateTeleport,
|
||||
SetItemFlag,
|
||||
SimpleDamage,
|
||||
SpireDisable,
|
||||
Steal,
|
||||
Summon,
|
||||
Teleport,
|
||||
Track,
|
||||
TransferStat,
|
||||
TransferStatOT,
|
||||
Transform,
|
||||
TreeChoke
|
||||
ApplyEffect(Actions::ApplyEffect),
|
||||
ApplyEffects(Actions::ApplyEffects),
|
||||
Block(Actions::Block),
|
||||
Charm(Actions::Charm),
|
||||
ClaimMine(Actions::ClaimMine),
|
||||
ClearAggro(Actions::ClearAggro),
|
||||
ClearNearbyAggro(Actions::ClearNearbyAggro),
|
||||
Confusion(Actions::Confusion),
|
||||
CreateMob(Actions::CreateMob),
|
||||
DamageOverTime(Actions::DamageOverTime),
|
||||
DeferredPower(Actions::DeferredPower),
|
||||
DirectDamage(Actions::DirectDamage),
|
||||
Invis(Actions::Invis),
|
||||
MobRecall(Actions::MobRecall),
|
||||
Peek(Actions::Peek),
|
||||
Recall(Actions::Recall),
|
||||
RemoveEffect(Actions::RemoveEffect),
|
||||
Resurrect(Actions::Resurrect),
|
||||
RunegateTeleport(Actions::RunegateTeleport),
|
||||
SetItemFlag(Actions::SetItemFlag),
|
||||
SimpleDamage(Actions::SimpleDamage),
|
||||
SpireDisable(Actions::SpireDisable),
|
||||
Steal(Actions::Steal),
|
||||
Summon(Actions::Summon),
|
||||
Teleport(Actions::Teleport),
|
||||
Track(Actions::Track),
|
||||
TransferStat(Actions::TransferStat),
|
||||
TransferStatOT(Actions::TransferStatOT),
|
||||
Transform(Actions::Transform),
|
||||
TreeChoke(Actions::TreeChoke);
|
||||
|
||||
private final PowerActionFunction function;
|
||||
|
||||
PowerActionType(PowerActionFunction function) {
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public void execute() {
|
||||
function.execute();
|
||||
}
|
||||
}
|
||||
|
||||
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.PowerAction;
|
||||
|
||||
public class Behaviour {
|
||||
public class Behaviours {
|
||||
|
||||
public static Object Flag(AbstractCharacter caster, AbstractWorldObject target, Power power,
|
||||
PowerAction powerAction, Effect effect, ModifierEntry modifierEntry, Integer rank) {
|
||||
Reference in New Issue
Block a user