From af636f74fcabd67ec571e32a08fed3a3f2f8aeda Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 3 Jan 2021 16:52:54 -0500 Subject: [PATCH] Core incineration tweaks --- core/src/mindustry/core/Logic.java | 3 +++ core/src/mindustry/world/blocks/storage/CoreBlock.java | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 91a0c410c1..6e7ba9b957 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -57,6 +57,8 @@ public class Logic implements ApplicationListener{ //when loading a 'damaged' sector, propagate the damage Events.on(SaveLoadEvent.class, e -> { if(state.isCampaign()){ + state.rules.coreIncinerates = true; + SectorInfo info = state.rules.sector.info; info.write(); @@ -107,6 +109,7 @@ public class Logic implements ApplicationListener{ if(!(state.getSector().preset != null && !state.getSector().preset.useAI)){ state.rules.waveTeam.rules().ai = true; } + state.rules.coreIncinerates = true; state.rules.waveTeam.rules().aiTier = state.getSector().threat * 0.8f; state.rules.waveTeam.rules().infiniteResources = true; diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index ed7c2d7849..9a3e2539bc 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -233,7 +233,7 @@ public class CoreBlock extends StorageBlock{ @Override public int getMaximumAccepted(Item item){ - return incinerate() ? storageCapacity * 2 : storageCapacity; + return state.rules.coreIncinerates ? storageCapacity * 2 : storageCapacity; } @Override @@ -318,10 +318,6 @@ public class CoreBlock extends StorageBlock{ return tile instanceof StorageBuild b && (b.linkedCore == core || b.linkedCore == null); } - public boolean incinerate(){ - return state.isCampaign() || state.rules.coreIncinerates; - } - @Override public float handleDamage(float amount){ if(player != null && team == player.team()){ @@ -386,7 +382,7 @@ public class CoreBlock extends StorageBlock{ }else{ super.handleItem(source, item); } - }else if(incinerate()){ + }else if(state.rules.coreIncinerates){ if(items.get(item) >= storageCapacity){ //create item incineration effect at random intervals if(!noEffect){