diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index f04da239bb..4f684b0d2b 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1341,6 +1341,7 @@ public class Blocks implements ContentList{ size = 4; unitCapModifier = 14; + researchCostMultiplier = 0.04f; }}; coreNucleus = new CoreBlock("core-nucleus"){{ @@ -1352,6 +1353,7 @@ public class Blocks implements ContentList{ size = 5; unitCapModifier = 20; + researchCostMultiplier = 0.06f; }}; vault = new StorageBlock("vault"){{ diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index dd54bcc59d..f49133e7d1 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -9,7 +9,6 @@ import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.game.Teams.*; import mindustry.gen.*; -import mindustry.maps.*; import mindustry.type.*; import mindustry.type.Weather.*; import mindustry.world.*; @@ -93,9 +92,10 @@ public class Logic implements ApplicationListener{ //apply fractional damage based on how many turns have passed for this sector float turnsPassed = seconds / (turnDuration / 60f); - if(state.rules.sector.hasWaves() && turnsPassed > 0 && state.rules.sector.hasBase()){ - SectorDamage.apply(turnsPassed / sectorDestructionTurns); - } + //TODO sector damage disabled for now + //if(state.rules.sector.hasWaves() && turnsPassed > 0 && state.rules.sector.hasBase()){ + // SectorDamage.apply(turnsPassed / sectorDestructionTurns); + //} //add resources based on turns passed if(state.rules.sector.save != null && core != null){ diff --git a/core/src/mindustry/game/Universe.java b/core/src/mindustry/game/Universe.java index e64b4cfc07..892b93b731 100644 --- a/core/src/mindustry/game/Universe.java +++ b/core/src/mindustry/game/Universe.java @@ -140,8 +140,9 @@ public class Universe{ if(!sector.isBeingPlayed()){ sector.setSecondsPassed(sector.getSecondsPassed() + actuallyPassed); + //TODO sector damage disabled for now //check if the sector has been attacked too many times... - if(sector.hasBase() && sector.hasWaves() && sector.getSecondsPassed() * 60f > turnDuration * sectorDestructionTurns){ + /*if(sector.hasBase() && sector.hasWaves() && sector.getSecondsPassed() * 60f > turnDuration * sectorDestructionTurns){ //fire event for losing the sector Events.fire(new SectorLoseEvent(sector)); @@ -151,7 +152,7 @@ public class Universe{ //clear recieved sector.setExtraItems(new ItemSeq()); sector.save = null; - } + }*/ } //export to another sector diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 0b21a2cea4..7099f254dd 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -176,7 +176,7 @@ public class DesktopInput extends InputHandler{ public void update(){ super.update(); - if(net.active() && Core.input.keyTap(Binding.player_list) && (scene.getKeyboardFocus() == null || scene.getKeyboardFocus().isDescendantOf(ui.listfrag.content))){ + if(net.active() && Core.input.keyTap(Binding.player_list) && (scene.getKeyboardFocus() == null || scene.getKeyboardFocus().isDescendantOf(ui.listfrag.content) || scene.getKeyboardFocus().isDescendantOf(ui.minimapfrag.elem))){ ui.listfrag.toggle(); } diff --git a/core/src/mindustry/ui/fragments/MinimapFragment.java b/core/src/mindustry/ui/fragments/MinimapFragment.java index 7c9d3b5994..43ad3163b0 100644 --- a/core/src/mindustry/ui/fragments/MinimapFragment.java +++ b/core/src/mindustry/ui/fragments/MinimapFragment.java @@ -18,7 +18,7 @@ public class MinimapFragment extends Fragment{ private boolean shown; float panx, pany, zoom = 1f, lastZoom = -1; private float baseSize = Scl.scl(5f); - private Element elem; + public Element elem; @Override public void build(Group parent){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 189a9c21c1..95d9a426e0 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -193,6 +193,8 @@ public class Block extends UnlockableContent{ public BuildPlaceability buildPlaceability = BuildPlaceability.always; /** Multiplier for speed of building this block. */ public float buildCostMultiplier = 1f; + /** Multiplier for cost of research in tech tree. */ + public float researchCostMultiplier = 1; /** Whether this block has instant transfer.*/ public boolean instantTransfer = false; /** Whether you can rotate this block with Keybind rotateplaced + Scroll Wheel. */ @@ -619,7 +621,7 @@ public class Block extends UnlockableContent{ public ItemStack[] researchRequirements(){ ItemStack[] out = new ItemStack[requirements.length]; for(int i = 0; i < out.length; i++){ - int quantity = 40 + Mathf.round(Mathf.pow(requirements[i].amount, 1.25f) * 20, 10); + int quantity = 40 + Mathf.round(Mathf.pow(requirements[i].amount, 1.25f) * 20 * researchCostMultiplier, 10); out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity)); } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 14d60280ee..8d656a95d2 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -14,6 +14,7 @@ import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; +import mindustry.logic.*; import mindustry.type.*; import mindustry.ui.*; import mindustry.world.*; @@ -159,6 +160,12 @@ public class CoreBlock extends StorageBlock{ public BlockUnitc unit = Nulls.blockUnit; public boolean noEffect = false; + @Override + public double sense(LAccess sensor){ + if(sensor == LAccess.itemCapacity) return storageCapacity; + return super.sense(sensor); + } + @Override public void created(){ unit = (BlockUnitc)UnitTypes.block.create(team);