Browse Source

starting of new power manager

feature-config-usage
FatBoy-DOTC 2 months ago
parent
commit
3c1280e546
  1. 10
      src/engine/jobs/UsePowerJob.java
  2. 6
      src/engine/wpak/WpakPowerManager.java
  3. 11
      src/engine/wpak/data/Power.java

10
src/engine/jobs/UsePowerJob.java

@ -35,16 +35,6 @@ public class UsePowerJob extends AbstractScheduleJob { @@ -35,16 +35,6 @@ public class UsePowerJob extends AbstractScheduleJob {
this.targetLiveCounter = targetLiveCounter;
}
public UsePowerJob(PlayerCharacter pc, PerformActionMsg msg, int token, Power pb, int casterLiveCounter, int targetLiveCounter) {
super();
this.pc = pc;
this.msg = msg;
this.token = token;
this.pb = pb;
this.casterLiveCounter = casterLiveCounter;
this.targetLiveCounter = targetLiveCounter;
}
@Override
protected void doJob() {
PowersManager.finishUsePower(this.msg, this.pc, casterLiveCounter, targetLiveCounter);

6
src/engine/wpak/WpakPowerManager.java

@ -262,7 +262,7 @@ public class WpakPowerManager { @@ -262,7 +262,7 @@ public class WpakPowerManager {
copyMsg.setNumTrains(tr);
// make person casting stand up if spell (unless they're casting a chant which does not make them stand up)
if (pb.isSpell() && !pb.isChant() && playerCharacter.isSit()) {
if (powerCast.isSpell() && !powerCast.isChant() && playerCharacter.isSit()) {
playerCharacter.update();
playerCharacter.setSit(false);
UpdateStateMsg updateStateMsg = new UpdateStateMsg(playerCharacter);
@ -274,11 +274,11 @@ public class WpakPowerManager { @@ -274,11 +274,11 @@ public class WpakPowerManager {
playerCharacter.cancelOnCast();
// update castSpell (use spell) fail condition if spell
if (pb.isSpell())
if (powerCast.isSpell())
playerCharacter.cancelOnSpell();
// get cast time in ms.
time = pb.getCastTime(trains);
time = powerCast.getCastTime(trains);
// set player is casting for regens

11
src/engine/wpak/data/Power.java

@ -106,4 +106,15 @@ public class Power { @@ -106,4 +106,15 @@ public class Power {
return this.cost * (1 + (float)(this.curves.get("COSTAMT").getValue() * trains));
}
public boolean isSpell(){
return true;
}
public boolean isSkill(){
return true;
}
public boolean isChant(){
return true;
}
}

Loading…
Cancel
Save