diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 9a55bfbdc2..3290095387 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -3752,7 +3752,7 @@ public class Blocks{ requirements(Category.turret, with(Items.beryllium, 150, Items.silicon, 200, Items.graphite, 200, Items.tungsten, 50)); ammo( - Items.graphite, new BasicBulletType(8f, 44){{ + Items.graphite, new BasicBulletType(8f, 41){{ knockback = 4f; width = 25f; hitSize = 7f; @@ -3797,7 +3797,7 @@ public class Blocks{ recoilAmount = 2f; restitution = 0.03f; range = 125; - shootCone = 50f; + shootCone = 40f; scaledHealth = 210; rotateSpeed = 3f; diff --git a/core/src/mindustry/content/Planets.java b/core/src/mindustry/content/Planets.java index 7bbaed0b6f..40d06329d5 100644 --- a/core/src/mindustry/content/Planets.java +++ b/core/src/mindustry/content/Planets.java @@ -76,6 +76,7 @@ public class Planets{ r.fog = true; r.staticFog = true; r.lighting = false; + r.coreDestroyClear = true; r.onlyDepositCore = true; //TODO not sure }; @@ -124,6 +125,7 @@ public class Planets{ allowWaveSimulation = true; allowSectorInvasion = true; allowLaunchSchematics = true; + enemyCoreSpawnReplace = true; allowLaunchLoadout = true; ruleSetter = r -> { r.waveTeam = Team.crux; diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 4bb17208cf..2584c4778b 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -161,9 +161,7 @@ public class Logic implements ApplicationListener{ }); Events.on(BlockDestroyEvent.class, e -> { - //TODO maybe make it a separate rule? - //makes cores go derelict in RTS mode, helps clean things up - if(e.tile.build instanceof CoreBuild core && core.team.isAI() && core.team.rules().rtsAi){ + if(e.tile.build instanceof CoreBuild core && core.team.isAI() && state.rules.coreDestroyClear){ Core.app.post(() -> { core.team.data().timeDestroy(core.x, core.y, state.rules.enemyCoreBuildRadius); }); diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 02e038ad3e..ef86b676bc 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -84,6 +84,8 @@ public class Rules{ public boolean cleanupDeadTeams = true; /** If true, items can only be deposited in the core. */ public boolean onlyDepositCore = false; + /** If true, every enemy block in the radius of the (enemy) core is destroyed upon death. Used for campaign maps. */ + public boolean coreDestroyClear = false; /** Radius around enemy wave drop zones.*/ public float dropZoneRadius = 300f; /** Time between waves in ticks. */ diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 49606742ff..3e1beae2a4 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -95,6 +95,8 @@ public class Planet extends UnlockableContent{ public boolean allowSectorInvasion = false; /** If true, sectors saves are cleared when lost. */ public boolean clearSectorOnLose = false; + /** If true, enemy cores are replaced with spawnpoints on this planet (for invasions) */ + public boolean enemyCoreSpawnReplace = false; /** If true, blocks in the radius of the core will be removed and "built up" in a shockwave upon landing. */ public boolean prebuildBase = true; /** If true, waves are created on sector loss. TODO remove. */ diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 28bfd63b32..1446851c04 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -308,7 +308,7 @@ public class CoreBlock extends StorageBlock{ } //add a spawn to the map for future reference - waves should be disabled, so it shouldn't matter - if(state.isCampaign() && team == state.rules.waveTeam && team.cores().size <= 1){ + if(state.isCampaign() && team == state.rules.waveTeam && team.cores().size <= 1 && state.rules.sector.planet.enemyCoreSpawnReplace){ //do not recache tile.setOverlayQuiet(Blocks.spawn);