forked from MagicBane/Server
Method inlined
This commit is contained in:
@@ -2232,9 +2232,6 @@ public class mbEnums {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PowerFailCondition {
|
public enum PowerFailCondition {
|
||||||
|
|||||||
@@ -23,7 +23,10 @@ import engine.mbEnums.PowerFailCondition;
|
|||||||
import engine.net.Dispatch;
|
import engine.net.Dispatch;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.ApplyEffectMsg;
|
import engine.net.client.msg.ApplyEffectMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.AbstractCharacter;
|
||||||
|
import engine.objects.AbstractWorldObject;
|
||||||
|
import engine.objects.Item;
|
||||||
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.powers.effectmodifiers.*;
|
import engine.powers.effectmodifiers.*;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.util.Hasher;
|
import engine.util.Hasher;
|
||||||
@@ -31,6 +34,7 @@ import engine.wpak.data.ConditionEntry;
|
|||||||
import engine.wpak.data.Effect;
|
import engine.wpak.data.Effect;
|
||||||
import engine.wpak.data.ModifierEntry;
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -148,8 +152,8 @@ public class EffectsBase {
|
|||||||
|
|
||||||
|
|
||||||
eb.amount = entry.arg;
|
eb.amount = entry.arg;
|
||||||
eb.amountRamp = (float) entry.curveType.getValue();
|
eb.amountRamp = (float) entry.curveType.value;
|
||||||
eb.useRampAdd = (float) entry.curveType.getValue() != 0;
|
eb.useRampAdd = (float) entry.curveType.value != 0;
|
||||||
break;
|
break;
|
||||||
case Attack:
|
case Attack:
|
||||||
eb.cancelOnAttack = true;
|
eb.cancelOnAttack = true;
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ public abstract class AbstractEffectModifier {
|
|||||||
this.minMod = mod.min;
|
this.minMod = mod.min;
|
||||||
this.maxMod = mod.max;
|
this.maxMod = mod.max;
|
||||||
this.percentMod = mod.percentage;
|
this.percentMod = mod.percentage;
|
||||||
this.ramp = (float)mod.compoundCurveType.getValue();
|
this.ramp = (float) mod.compoundCurveType.value;
|
||||||
this.useRampAdd = (float)mod.compoundCurveType.getValue() != 0;
|
this.useRampAdd = (float) mod.compoundCurveType.value != 0;
|
||||||
|
|
||||||
this.string1 = mod.arg1;
|
this.string1 = mod.arg1;
|
||||||
this.string2 = mod.arg2;
|
this.string2 = mod.arg2;
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
|||||||
|
|
||||||
public float getTransferAmount(float trains) {
|
public float getTransferAmount(float trains) {
|
||||||
// if (this.transferRampAdd)
|
// if (this.transferRampAdd)
|
||||||
return (float) (this.powerAction.statTransfer.ramp + (this.powerAction.statTransfer.rampCurve.getValue() * trains));
|
return (float) (this.powerAction.statTransfer.ramp + (this.powerAction.statTransfer.rampCurve.value * trains));
|
||||||
// else
|
// else
|
||||||
// return this.transferAmount * (1 + (this.transferRamp * trains));
|
// return this.transferAmount * (1 + (this.transferRamp * trains));
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getTransferEfficiency(float trains) {
|
public float getTransferEfficiency(float trains) {
|
||||||
return (float) (this.powerAction.statTransfer.efficiency + (this.powerAction.statTransfer.efficiencyCurve.getValue() * trains));
|
return (float) (this.powerAction.statTransfer.efficiency + (this.powerAction.statTransfer.efficiencyCurve.value * trains));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean targetToCaster() {
|
public boolean targetToCaster() {
|
||||||
|
|||||||
@@ -377,24 +377,33 @@ public class WpakPowerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getRecycleTime(Power power, int trains) { // returns cast time in ms
|
public static int getRecycleTime(Power power, int trains) { // returns cast time in ms
|
||||||
if (power.curves.get("RECYCLETIME") != null)
|
if (power.curves.get("RECYCLETIME") != null) {
|
||||||
return (int) (((power.recycle_time + (power.curves.get("RECYCLETIME").getValue() * trains)) * 1000) + getCastTime(power, trains));
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("RECYCLETIME");
|
||||||
else
|
return (int) (((power.recycle_time + (compoundCurveType.value * trains)) * 1000) + getCastTime(power, trains));
|
||||||
return (int) (((power.recycle_time * (1 + (power.curves.get("RECYCLETIME").getValue() * trains))) * 1000) + getCastTime(power, trains));
|
} else {
|
||||||
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("RECYCLETIME");
|
||||||
|
return (int) (((power.recycle_time * (1 + (compoundCurveType.value * trains))) * 1000) + getCastTime(power, trains));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCastTime(Power power, int trains) { // returns cast time in ms
|
public static int getCastTime(Power power, int trains) { // returns cast time in ms
|
||||||
if (power.curves.get("INITTIME") != null)
|
if (power.curves.get("INITTIME") != null) {
|
||||||
return (int) ((power.init_time + (power.curves.get("INITTIME").getValue() * trains)) * 1000);
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("INITTIME");
|
||||||
else
|
return (int) ((power.init_time + (compoundCurveType.value * trains)) * 1000);
|
||||||
return (int) ((power.init_time * (1 + (power.curves.get("INITTIME").getValue() * trains))) * 1000);
|
} else {
|
||||||
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("INITTIME");
|
||||||
|
return (int) ((power.init_time * (1 + (compoundCurveType.value * trains))) * 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getCost(Power power, int trains) {
|
public static float getCost(Power power, int trains) {
|
||||||
if (power.curves.get("COSTAMT") != null)
|
if (power.curves.get("COSTAMT") != null) {
|
||||||
return power.cost + (power.curves.get("COSTAMT").getValue() * trains);
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("COSTAMT");
|
||||||
else
|
return power.cost + (compoundCurveType.value * trains);
|
||||||
return power.cost * (1 + (power.curves.get("COSTAMT").getValue() * trains));
|
} else {
|
||||||
|
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("COSTAMT");
|
||||||
|
return power.cost * (1 + (compoundCurveType.value * trains));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,7 +422,7 @@ public class WpakPowerManager {
|
|||||||
Pair<Float, Float> outData = new Pair<>(0f, 0f);
|
Pair<Float, Float> outData = new Pair<>(0f, 0f);
|
||||||
|
|
||||||
if (modifierEntry.percentage != 0f) {
|
if (modifierEntry.percentage != 0f) {
|
||||||
outData.first = modifierEntry.percentage + (modifierEntry.compoundCurveType.getValue() * rank);
|
outData.first = modifierEntry.percentage + (modifierEntry.compoundCurveType.value * rank);
|
||||||
outData.first = outData.first * 0.01f;
|
outData.first = outData.first * 0.01f;
|
||||||
return outData;
|
return outData;
|
||||||
}
|
}
|
||||||
@@ -426,14 +435,19 @@ public class WpakPowerManager {
|
|||||||
// These all have "SIVL" in the curve name suggesting
|
// These all have "SIVL" in the curve name suggesting
|
||||||
// interpolation between min max. Not something currently done.
|
// interpolation between min max. Not something currently done.
|
||||||
|
|
||||||
outData.first = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) {
|
||||||
modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
outData.first = modifierEntry.min * (1 + (modifierEntry.compoundCurveType.value * rank));
|
||||||
modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank);
|
} else {
|
||||||
|
outData.first = modifierEntry.min + (modifierEntry.compoundCurveType.value * rank);
|
||||||
|
}
|
||||||
|
|
||||||
if (modifierEntry.max != 0)
|
if (modifierEntry.max != 0) {
|
||||||
outData.second = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) {
|
||||||
modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
outData.second = modifierEntry.max * (1 + (modifierEntry.compoundCurveType.value * rank));
|
||||||
modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank);
|
} else {
|
||||||
|
outData.second = modifierEntry.max + (modifierEntry.compoundCurveType.value * rank);
|
||||||
|
}
|
||||||
|
}
|
||||||
return outData;
|
return outData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user