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 {
|
||||
|
||||
@@ -23,7 +23,10 @@ import engine.mbEnums.PowerFailCondition;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.client.ClientConnection;
|
||||
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.server.MBServerStatics;
|
||||
import engine.util.Hasher;
|
||||
@@ -31,6 +34,7 @@ import engine.wpak.data.ConditionEntry;
|
||||
import engine.wpak.data.Effect;
|
||||
import engine.wpak.data.ModifierEntry;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
@@ -148,8 +152,8 @@ public class EffectsBase {
|
||||
|
||||
|
||||
eb.amount = entry.arg;
|
||||
eb.amountRamp = (float) entry.curveType.getValue();
|
||||
eb.useRampAdd = (float) entry.curveType.getValue() != 0;
|
||||
eb.amountRamp = (float) entry.curveType.value;
|
||||
eb.useRampAdd = (float) entry.curveType.value != 0;
|
||||
break;
|
||||
case Attack:
|
||||
eb.cancelOnAttack = true;
|
||||
|
||||
@@ -52,8 +52,8 @@ public abstract class AbstractEffectModifier {
|
||||
this.minMod = mod.min;
|
||||
this.maxMod = mod.max;
|
||||
this.percentMod = mod.percentage;
|
||||
this.ramp = (float)mod.compoundCurveType.getValue();
|
||||
this.useRampAdd = (float)mod.compoundCurveType.getValue() != 0;
|
||||
this.ramp = (float) mod.compoundCurveType.value;
|
||||
this.useRampAdd = (float) mod.compoundCurveType.value != 0;
|
||||
|
||||
this.string1 = mod.arg1;
|
||||
this.string2 = mod.arg2;
|
||||
|
||||
@@ -67,13 +67,13 @@ public class TransferStatPowerAction extends AbstractPowerAction {
|
||||
|
||||
public float getTransferAmount(float trains) {
|
||||
// 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
|
||||
// return this.transferAmount * (1 + (this.transferRamp * 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() {
|
||||
|
||||
@@ -377,24 +377,33 @@ public class WpakPowerManager {
|
||||
}
|
||||
|
||||
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));
|
||||
if (power.curves.get("RECYCLETIME") != null) {
|
||||
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("RECYCLETIME");
|
||||
return (int) (((power.recycle_time + (compoundCurveType.value * 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
|
||||
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);
|
||||
if (power.curves.get("INITTIME") != null) {
|
||||
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("INITTIME");
|
||||
return (int) ((power.init_time + (compoundCurveType.value * 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) {
|
||||
if (power.curves.get("COSTAMT") != null)
|
||||
return power.cost + (power.curves.get("COSTAMT").getValue() * trains);
|
||||
else
|
||||
return power.cost * (1 + (power.curves.get("COSTAMT").getValue() * trains));
|
||||
if (power.curves.get("COSTAMT") != null) {
|
||||
mbEnums.CompoundCurveType compoundCurveType = power.curves.get("COSTAMT");
|
||||
return power.cost + (compoundCurveType.value * 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);
|
||||
|
||||
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;
|
||||
return outData;
|
||||
}
|
||||
@@ -426,14 +435,19 @@ public class WpakPowerManager {
|
||||
// These all have "SIVL" in the curve name suggesting
|
||||
// interpolation between min max. Not something currently done.
|
||||
|
||||
outData.first = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
||||
modifierEntry.min * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
||||
modifierEntry.min + (modifierEntry.compoundCurveType.getValue() * rank);
|
||||
if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) {
|
||||
outData.first = modifierEntry.min * (1 + (modifierEntry.compoundCurveType.value * rank));
|
||||
} else {
|
||||
outData.first = modifierEntry.min + (modifierEntry.compoundCurveType.value * rank);
|
||||
}
|
||||
|
||||
if (modifierEntry.max != 0)
|
||||
outData.second = modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY) ?
|
||||
modifierEntry.max * (1 + (modifierEntry.compoundCurveType.getValue() * rank)) :
|
||||
modifierEntry.max + (modifierEntry.compoundCurveType.getValue() * rank);
|
||||
if (modifierEntry.max != 0) {
|
||||
if (modifierEntry.compoundCurveType.type.equals(mbEnums.ModificationType.MULTIPLY)) {
|
||||
outData.second = modifierEntry.max * (1 + (modifierEntry.compoundCurveType.value * rank));
|
||||
} else {
|
||||
outData.second = modifierEntry.max + (modifierEntry.compoundCurveType.value * rank);
|
||||
}
|
||||
}
|
||||
return outData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user