diff --git a/core/assets-raw/sprites/blocks/environment/core-zone.png b/core/assets-raw/sprites/blocks/environment/core-zone.png new file mode 100644 index 0000000000..91962e1abd Binary files /dev/null and b/core/assets-raw/sprites/blocks/environment/core-zone.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index aa71685ccf..970d26f24a 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -818,6 +818,7 @@ ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks bar.drilltierreq = Better Drill Required bar.noresources = Missing Resources bar.corereq = Core Base Required +bar.corefloor = Core Zone Tile Required bar.cargounitcap = Cargo Unit Cap Reached bar.drillspeed = Drill Speed: {0}/s bar.pumpspeed = Pump Speed: {0}/s diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 92c3c960a2..4e6fa24051 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -541,3 +541,4 @@ 63162=carbide-wall-large|block-carbide-wall-large-ui 63161=prime-control-core|block-prime-control-core-ui 63160=ore-wall-thorium|block-ore-wall-thorium-ui +63159=core-zone|block-core-zone-ui diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 1856b75b7a..98d4c4f3d7 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -50,6 +50,7 @@ public class Blocks{ regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall, arkyicWall, crystallineStoneWall, redStoneWall, redDiamondWall, ferricStone, ferricCraters, carbonStone, beryllicStone, crystallineStone, crystalFloor, yellowStonePlates, iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt, + coreZone, //boulders shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder, arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystalBlocks, crystalOrbs, crystallineBoulder, redIceBoulder, rhyoliteBoulder, redStoneBoulder, @@ -528,6 +529,11 @@ public class Blocks{ attributes.set(Attribute.spores, 0.15f); }}; + coreZone = new Floor("core-zone"){{ + variants = 0; + allowCorePlacement = true; + }}; + sporeMoss = new Floor("spore-moss"){{ variants = 3; attributes.set(Attribute.spores, 0.3f); @@ -2546,6 +2552,7 @@ public class Blocks{ requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 800)); alwaysUnlocked = true; + isFirstTier = true; unitType = UnitTypes.alpha; health = 1100; itemCapacity = 4000; @@ -2582,8 +2589,9 @@ public class Blocks{ coreBastion = new CoreBlock("core-bastion"){{ //TODO cost - requirements(Category.effect, BuildVisibility.editorOnly, with(Items.graphite, 1000, Items.silicon, 2000, Items.beryllium, 800)); + requirements(Category.effect, with(Items.graphite, 1000, Items.silicon, 2000, Items.beryllium, 800)); + isFirstTier = true; unitType = UnitTypes.evoke; health = 7000; itemCapacity = 8000; @@ -2591,6 +2599,9 @@ public class Blocks{ thrusterLength = 34/4f; armor = 5f; + //TODO should this be higher? + buildCostMultiplier = 0.75f; + unitCapModifier = 2; researchCostMultiplier = 0.07f; }}; diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 51ffd4e836..910bc7d395 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -278,7 +278,9 @@ public class DesktopInput extends InputHandler{ shouldShoot = !scene.hasMouse() && !locked; - if(!locked && block == null && !scene.hasField()){ + if(!locked && block == null && !scene.hasField() && + //disable command mode when player unit can boost and command mode binding is the same + !(!player.dead() && player.unit().type.canBoost && keybinds.get(Binding.commandMode).key == keybinds.get(Binding.boost).key)){ commandMode = input.keyDown(Binding.commandMode); }else{ commandMode = false; @@ -691,7 +693,6 @@ public class DesktopInput extends InputHandler{ public boolean tap(float x, float y, int count, KeyCode button){ if(scene.hasMouse() || !commandMode) return false; - //TODO doesn't work properly tappedOne = true; //click: select a single unit diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index edf2e8759f..301203101c 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -71,6 +71,8 @@ public class Floor extends Block{ public boolean canShadow = true; /** Whether this overlay needs a surface to be on. False for floating blocks, like spawns. */ public boolean needsSurface = true; + /** If true, cores can be placed on this floor. */ + public boolean allowCorePlacement = false; /** If true, this ore is allowed on walls. */ public boolean wallOre = false; /** Actual ID used for blend groups. Internal. */ diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 87e76c4b41..d8c567dd59 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -32,6 +32,7 @@ public class CoreBlock extends StorageBlock{ public @Load(value = "@-thruster1", fallback = "clear-effect") TextureRegion thruster1; //top right public @Load(value = "@-thruster2", fallback = "clear-effect") TextureRegion thruster2; //bot left public float thrusterLength = 14f/4f; + public boolean isFirstTier; public UnitType unitType = UnitTypes.alpha; @@ -124,6 +125,13 @@ public class CoreBlock extends StorageBlock{ if(tile == null) return false; //in the editor, you can place them anywhere for convenience if(state.isEditor()) return true; + + //special floor upon which cores can be placed + tile.getLinkedTiles(tempTiles); + if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){ + return true; + } + CoreBuild core = team.core(); //must have all requirements if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false; @@ -171,9 +179,12 @@ public class CoreBlock extends StorageBlock{ if(!canPlaceOn(world.tile(x, y), player.team(), rotation)){ drawPlaceText(Core.bundle.get( - (player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ? - "bar.corereq" : - "bar.noresources" + isFirstTier ? + //TODO better message + "bar.corefloor" : + (player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ? + "bar.corereq" : + "bar.noresources" ), x, y, valid); } }