Browse Source

Refactored poweractions

feature-config-usage
MagicBot 2 months ago
parent
commit
deab274ba2
  1. 6
      src/engine/powers/poweractions/BlockPowerAction.java
  2. 6
      src/engine/powers/poweractions/ClaimMinePowerAction.java
  3. 6
      src/engine/powers/poweractions/ClearAggroPowerAction.java
  4. 6
      src/engine/powers/poweractions/ClearNearbyAggroPowerAction.java
  5. 4
      src/engine/powers/poweractions/CreateMobPowerAction.java
  6. 8
      src/engine/powers/poweractions/InvisPowerAction.java
  7. 9
      src/engine/powers/poweractions/MobRecallPowerAction.java
  8. 6
      src/engine/powers/poweractions/OpenGatePowerAction.java
  9. 6
      src/engine/powers/poweractions/RecallPowerAction.java
  10. 6
      src/engine/powers/poweractions/ResurrectPowerAction.java
  11. 6
      src/engine/powers/poweractions/RunegateTeleportPowerAction.java
  12. 6
      src/engine/powers/poweractions/SimpleDamagePowerAction.java
  13. 6
      src/engine/powers/poweractions/SpireDisablePowerAction.java
  14. 5
      src/engine/powers/poweractions/StealPowerAction.java
  15. 6
      src/engine/powers/poweractions/SummonPowerAction.java
  16. 6
      src/engine/powers/poweractions/TreeChokePowerAction.java

6
src/engine/powers/poweractions/BlockPowerAction.java

@ -14,14 +14,12 @@ import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class BlockPowerAction extends AbstractPowerAction { public class BlockPowerAction extends AbstractPowerAction {
public BlockPowerAction(ResultSet rs) throws SQLException { public BlockPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/ClaimMinePowerAction.java

@ -15,14 +15,12 @@ import engine.mbEnums;
import engine.objects.*; import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ClaimMinePowerAction extends AbstractPowerAction { public class ClaimMinePowerAction extends AbstractPowerAction {
public ClaimMinePowerAction(ResultSet rs) throws SQLException { public ClaimMinePowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/ClearAggroPowerAction.java

@ -16,14 +16,12 @@ import engine.objects.AbstractWorldObject;
import engine.objects.Mob; import engine.objects.Mob;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ClearAggroPowerAction extends AbstractPowerAction { public class ClearAggroPowerAction extends AbstractPowerAction {
public ClearAggroPowerAction(ResultSet rs) throws SQLException { public ClearAggroPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/ClearNearbyAggroPowerAction.java

@ -15,14 +15,12 @@ import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ClearNearbyAggroPowerAction extends AbstractPowerAction { public class ClearNearbyAggroPowerAction extends AbstractPowerAction {
public ClearNearbyAggroPowerAction(ResultSet rs) throws SQLException { public ClearNearbyAggroPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

4
src/engine/powers/poweractions/CreateMobPowerAction.java

@ -25,15 +25,13 @@ import engine.powers.PowersBase;
import engine.wpak.data.PowerAction; import engine.wpak.data.PowerAction;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.SQLException;
public class CreateMobPowerAction extends AbstractPowerAction { public class CreateMobPowerAction extends AbstractPowerAction {
private int mobID; private int mobID;
private int mobLevel; private int mobLevel;
public CreateMobPowerAction(PowerAction rs) throws SQLException { public CreateMobPowerAction(PowerAction rs) {
super(rs); super(rs);
this.mobID = rs.petRace; this.mobID = rs.petRace;

8
src/engine/powers/poweractions/InvisPowerAction.java

@ -16,9 +16,8 @@ import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
@ -27,10 +26,11 @@ public class InvisPowerAction extends AbstractPowerAction {
private String effectID; private String effectID;
private EffectsBase effect; private EffectsBase effect;
public InvisPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException { public InvisPowerAction(PowerAction rs, HashMap<String, EffectsBase> effects) {
super(rs); super(rs);
this.effectID = rs.getString("effectID"); this.effectID = rs.effects.get(0).effect_id;
;
this.effect = effects.get(this.effectID); this.effect = effects.get(this.effectID);
} }

9
src/engine/powers/poweractions/MobRecallPowerAction.java

@ -14,17 +14,14 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.objects.Mob;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class MobRecallPowerAction extends AbstractPowerAction { public class MobRecallPowerAction extends AbstractPowerAction {
public MobRecallPowerAction(ResultSet rs) throws SQLException { public MobRecallPowerAction(PowerAction rs) {
super(rs); super(rs);
} }
@ -41,7 +38,7 @@ public class MobRecallPowerAction extends AbstractPowerAction {
MovementManager.translocate(awoac, awoac.getBindLoc()); MovementManager.translocate(awoac, awoac.getBindLoc());
if (awoac.getObjectType() == GameObjectType.Mob) { if (awoac.getObjectType() == GameObjectType.Mob) {
//MobAI.setAwake((Mob)awoac,true); //MobAI.setAwake((Mob)awoac,true);
((Mob) awoac).setCombatTarget(null); (awoac).setCombatTarget(null);
} }

6
src/engine/powers/poweractions/OpenGatePowerAction.java

@ -19,16 +19,14 @@ import engine.objects.Building;
import engine.objects.Runegate; import engine.objects.Runegate;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class OpenGatePowerAction extends AbstractPowerAction { public class OpenGatePowerAction extends AbstractPowerAction {
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
public OpenGatePowerAction(ResultSet rs) throws SQLException { public OpenGatePowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/RecallPowerAction.java

@ -25,14 +25,12 @@ import engine.objects.PlayerCharacter;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class RecallPowerAction extends AbstractPowerAction { public class RecallPowerAction extends AbstractPowerAction {
public RecallPowerAction(ResultSet rs) throws SQLException { public RecallPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/ResurrectPowerAction.java

@ -14,14 +14,12 @@ import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ResurrectPowerAction extends AbstractPowerAction { public class ResurrectPowerAction extends AbstractPowerAction {
public ResurrectPowerAction(ResultSet rs) throws SQLException { public ResurrectPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/RunegateTeleportPowerAction.java

@ -17,9 +17,7 @@ import engine.net.client.msg.PromptRecallMsg;
import engine.objects.*; import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
import static engine.math.FastMath.sqr; import static engine.math.FastMath.sqr;
import static engine.math.FastMath.sqrt; import static engine.math.FastMath.sqrt;
@ -29,7 +27,7 @@ public class RunegateTeleportPowerAction extends AbstractPowerAction {
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
public RunegateTeleportPowerAction(ResultSet rs) throws SQLException { public RunegateTeleportPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/SimpleDamagePowerAction.java

@ -14,16 +14,14 @@ import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SimpleDamagePowerAction extends AbstractPowerAction { public class SimpleDamagePowerAction extends AbstractPowerAction {
private int simpleDamage; private int simpleDamage;
public SimpleDamagePowerAction(ResultSet rs) throws SQLException { public SimpleDamagePowerAction(PowerAction rs) {
super(rs); super(rs);
this.simpleDamage = rs.getInt("simpleDamage"); this.simpleDamage = rs.getInt("simpleDamage");

6
src/engine/powers/poweractions/SpireDisablePowerAction.java

@ -19,16 +19,14 @@ import engine.objects.Building;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SpireDisablePowerAction extends AbstractPowerAction { public class SpireDisablePowerAction extends AbstractPowerAction {
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
public SpireDisablePowerAction(ResultSet rs) throws SQLException { public SpireDisablePowerAction(PowerAction rs) {
super(rs); super(rs);
} }

5
src/engine/powers/poweractions/StealPowerAction.java

@ -22,9 +22,8 @@ import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import static engine.math.FastMath.sqr; import static engine.math.FastMath.sqr;
@ -35,7 +34,7 @@ public class StealPowerAction extends AbstractPowerAction {
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
public StealPowerAction(ResultSet rs) throws SQLException { public StealPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/SummonPowerAction.java

@ -23,16 +23,14 @@ import engine.objects.PlayerCharacter;
import engine.objects.Zone; import engine.objects.Zone;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SummonPowerAction extends AbstractPowerAction { public class SummonPowerAction extends AbstractPowerAction {
/** /**
* ResultSet Constructor * ResultSet Constructor
*/ */
public SummonPowerAction(ResultSet rs) throws SQLException { public SummonPowerAction(PowerAction rs) {
super(rs); super(rs);
} }

6
src/engine/powers/poweractions/TreeChokePowerAction.java

@ -14,14 +14,12 @@ import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import java.sql.ResultSet;
import java.sql.SQLException;
public class TreeChokePowerAction extends AbstractPowerAction { public class TreeChokePowerAction extends AbstractPowerAction {
public TreeChokePowerAction(ResultSet rs) throws SQLException { public TreeChokePowerAction(PowerAction rs) {
super(rs); super(rs);
} }

Loading…
Cancel
Save