|
|
|
@ -132,13 +132,13 @@ public class WpakPowerManager {
@@ -132,13 +132,13 @@ public class WpakPowerManager {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//get casting time
|
|
|
|
|
int time = powerCast.getRecycleTime(trains); |
|
|
|
|
int time = getRecycleTime(powerCast, trains); |
|
|
|
|
|
|
|
|
|
//combat mode sanity check
|
|
|
|
|
if (playerCharacter.isCombat()) { |
|
|
|
|
if (!powerCast.allowedInCombat()) |
|
|
|
|
if (!allowedInCombat(powerCast)) |
|
|
|
|
return true; |
|
|
|
|
} else if (!powerCast.allowedOutOfCombat()) |
|
|
|
|
} else if (!allowedOutOfCombat(powerCast)) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
//stunned check
|
|
|
|
@ -199,7 +199,7 @@ public class WpakPowerManager {
@@ -199,7 +199,7 @@ public class WpakPowerManager {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
float cost = powerCast.getCost(trains); |
|
|
|
|
float cost = getCost(powerCast, trains); |
|
|
|
|
if (bonus != null) |
|
|
|
|
cost *= (1 + bonus.getFloatPercentAll(mbEnums.ModType.PowerCost, mbEnums.SourceType.None)); |
|
|
|
|
|
|
|
|
@ -266,7 +266,7 @@ public class WpakPowerManager {
@@ -266,7 +266,7 @@ public class WpakPowerManager {
|
|
|
|
|
playerCharacter.cancelOnSpell(); |
|
|
|
|
|
|
|
|
|
// get cast time in ms.
|
|
|
|
|
time = powerCast.getCastTime(trains); |
|
|
|
|
time = getCastTime(powerCast, trains); |
|
|
|
|
|
|
|
|
|
// set player is casting for regens
|
|
|
|
|
|
|
|
|
@ -381,4 +381,46 @@ public class WpakPowerManager {
@@ -381,4 +381,46 @@ public class WpakPowerManager {
|
|
|
|
|
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static int getRecycleTime(Power power, int trains) { // returns cast time in ms
|
|
|
|
|
if (power.curves.get("RECYCLETIME") != null) |
|
|
|
|
return (int) (((power.recycle_time + (power.curves.get("RECYCLETIME").getValue() * trains)) * 1000) + getCastTime(power, trains)); |
|
|
|
|
else |
|
|
|
|
return (int) (((power.recycle_time * (1 + (power.curves.get("RECYCLETIME").getValue() * trains))) * 1000) + getCastTime(power, trains)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static int getCastTime(Power power, int trains) { // returns cast time in ms
|
|
|
|
|
if (power.curves.get("INITTIME") != null) |
|
|
|
|
return (int) ((power.init_time + (power.curves.get("INITTIME").getValue() * trains)) * 1000); |
|
|
|
|
else |
|
|
|
|
return (int) ((power.init_time * (1 + (power.curves.get("INITTIME").getValue() * trains))) * 1000); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static float getCost(Power power, int trains) { |
|
|
|
|
if (power.curves.get("COSTAMT") != null) |
|
|
|
|
return power.cost + (float) (power.curves.get("COSTAMT").getValue() * trains); |
|
|
|
|
else |
|
|
|
|
return power.cost * (1 + (float) (power.curves.get("COSTAMT").getValue() * trains)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean allowedInCombat(Power power) { |
|
|
|
|
switch (power.castingMode.name()) { |
|
|
|
|
case "NONE": |
|
|
|
|
case "BOTH": |
|
|
|
|
case "COMBAT": |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean allowedOutOfCombat(Power power) { |
|
|
|
|
switch (power.castingMode.name()) { |
|
|
|
|
case "NONE": |
|
|
|
|
case "BOTH": |
|
|
|
|
case "NONCOMBAT": |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|