Browse Source

New costmap data implemented

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

24
src/engine/powers/EffectsBase.java

@ -9,10 +9,6 @@ @@ -9,10 +9,6 @@
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.PowersManager;
import engine.job.JobContainer;
@ -20,11 +16,18 @@ import engine.jobs.AbstractEffectJob; @@ -20,11 +16,18 @@ import engine.jobs.AbstractEffectJob;
import engine.jobs.DamageOverTimeJob;
import engine.jobs.FinishSpireEffectJob;
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.DispatchMessage;
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.Effect;
import engine.objects.PlayerCharacter;
import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
@ -718,15 +721,4 @@ public class EffectsBase { @@ -718,15 +721,4 @@ public class EffectsBase {
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