Browse Source

New costmap data implemented

combat-2
MagicBot 8 months ago
parent
commit
4fa646ce94
  1. 6
      src/engine/gameManager/ForgeManager.java
  2. 24
      src/engine/powers/EffectsBase.java

6
src/engine/gameManager/ForgeManager.java

@ -218,14 +218,12 @@ public enum ForgeManager implements Runnable {
if (workOrder.prefixToken != 0) { if (workOrder.prefixToken != 0) {
EffectsBase prefix = PowersManager.getEffectByToken(workOrder.prefixToken); EffectsBase prefix = PowersManager.getEffectByToken(workOrder.prefixToken);
EffectsBase prefixValue = PowersManager.getEffectByIDString(prefix.getIDString() + 'A'); production_cost.putAll(PowersManager._effect_costMaps.get(prefix.getIDString()));
production_cost.putAll(prefixValue.getResourcesForEffect());
} }
if (workOrder.suffixToken != 0) { if (workOrder.suffixToken != 0) {
EffectsBase suffix = PowersManager.getEffectByToken(workOrder.suffixToken); EffectsBase suffix = PowersManager.getEffectByToken(workOrder.suffixToken);
EffectsBase suffixValue = PowersManager.getEffectByIDString(suffix.getIDString() + 'A'); production_cost.putAll(PowersManager._effect_costMaps.get(suffix.getIDString()));
production_cost.putAll(suffixValue.getResourcesForEffect());
} }
return production_cost; return production_cost;

24
src/engine/powers/EffectsBase.java

@ -9,10 +9,6 @@
package engine.powers; package engine.powers;
import engine.mbEnums;
import engine.mbEnums.EffectSourceType;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.PowerFailCondition;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.job.JobContainer; import engine.job.JobContainer;
@ -20,11 +16,18 @@ import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob; import engine.jobs.DamageOverTimeJob;
import engine.jobs.FinishSpireEffectJob; import engine.jobs.FinishSpireEffectJob;
import engine.jobs.NoTimeJob; import engine.jobs.NoTimeJob;
import engine.mbEnums;
import engine.mbEnums.EffectSourceType;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.PowerFailCondition;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
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.Effect;
import engine.objects.PlayerCharacter;
import engine.powers.effectmodifiers.AbstractEffectModifier; import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -718,15 +721,4 @@ public class EffectsBase {
this.value = Value; this.value = Value;
} }
public ConcurrentHashMap<mbEnums.ResourceType, Integer> getResourcesForEffect() {
if (this.resourceCosts.isEmpty()) {
ArrayList<EffectsResourceCosts> effectsCostList = DbManager.EffectsResourceCostsQueries.GET_ALL_EFFECT_RESOURCES(this.IDString);
for (EffectsResourceCosts erc : effectsCostList) {
this.resourceCosts.put(mbEnums.ResourceType.resourceLookup.get(erc.getResourceID()), erc.getAmount());
}
}
return this.resourceCosts;
}
} }

Loading…
Cancel
Save