Browse Source

Refactored poweractions

feature-config-usage
MagicBot 3 months ago
parent
commit
82cefce424
  1. 16
      src/engine/powers/poweractions/CreateMobPowerAction.java
  2. 7
      src/engine/powers/poweractions/TransformPowerAction.java
  3. 2
      src/engine/wpak/PowerActionParser.java

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

@ -22,9 +22,9 @@ import engine.net.client.msg.PetMsg; @@ -22,9 +22,9 @@ import engine.net.client.msg.PetMsg;
import engine.objects.*;
import engine.powers.ActionsBase;
import engine.powers.PowersBase;
import engine.wpak.data.PowerAction;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -33,19 +33,11 @@ public class CreateMobPowerAction extends AbstractPowerAction { @@ -33,19 +33,11 @@ public class CreateMobPowerAction extends AbstractPowerAction {
private int mobID;
private int mobLevel;
public CreateMobPowerAction(ResultSet rs) throws SQLException {
public CreateMobPowerAction(PowerAction rs) throws SQLException {
super(rs);
this.mobID = rs.getInt("mobID");
this.mobLevel = rs.getInt("mobLevel");
}
public int getMobID() {
return this.mobID;
}
public int getMobLevel() {
return this.mobLevel;
this.mobID = rs.petRace;
this.mobLevel = rs.petLevel;
}
@Override

7
src/engine/powers/poweractions/TransformPowerAction.java

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

2
src/engine/wpak/PowerActionParser.java

@ -93,8 +93,8 @@ public class PowerActionParser { @@ -93,8 +93,8 @@ public class PowerActionParser {
powerAction.effects.add(effect);
break;
case "CreateMob":
powerAction.petLevel = Integer.parseInt(headerIterator.next());
powerAction.petRace = Integer.parseInt(headerIterator.next());
powerAction.petLevel = Integer.parseInt(headerIterator.next());
break;
case "DamageOverTime":
effect = new Effect();

Loading…
Cancel
Save