From 0fb336cf7b1f90653808c26f0d7f6339b83f3678 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 2 Sep 2018 10:46:24 -0400 Subject: [PATCH] Balancing / Fixed bridge contamination --- core/src/io/anuke/mindustry/content/Mechs.java | 2 +- .../src/io/anuke/mindustry/content/Recipes.java | 1 - .../io/anuke/mindustry/content/UnitTypes.java | 6 +++--- .../src/io/anuke/mindustry/content/Weapons.java | 2 +- .../content/blocks/CraftingBlocks.java | 2 +- .../content/blocks/ProductionBlocks.java | 2 +- .../mindustry/content/blocks/UnitBlocks.java | 14 +++++++------- core/src/io/anuke/mindustry/maps/Sectors.java | 4 ++-- .../maps/generation/FortressGenerator.java | 16 +++++++--------- .../world/blocks/distribution/ItemBridge.java | 17 ++--------------- .../world/blocks/distribution/LiquidBridge.java | 15 +-------------- 11 files changed, 26 insertions(+), 55 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index 916e6900a4..bc322083bf 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -224,7 +224,7 @@ public class Mechs implements ContentList{ @Override public float getExtraArmor(Player player){ - return player.altHeat * 40f; + return player.altHeat * 30f; } @Override diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index 7fd7edda63..acb9a99f47 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -34,7 +34,6 @@ public class Recipes implements ContentList{ new Recipe(defense, DefenseBlocks.surgeWall, new ItemStack(Items.surgealloy, 12)); new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4)); - //projectors new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250)); diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java index 9913648389..73a497c5e7 100644 --- a/core/src/io/anuke/mindustry/content/UnitTypes.java +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -27,10 +27,10 @@ public class UnitTypes implements ContentList{ { isFlying = true; drag = 0.005f; - speed = 0.5f; - maxVelocity = 1.6f; + speed = 0.6f; + maxVelocity = 1.7f; range = 40f; - health = 35; + health = 45; weapon = Weapons.droneBlaster; trailColor = Color.valueOf("ffd37f"); } diff --git a/core/src/io/anuke/mindustry/content/Weapons.java b/core/src/io/anuke/mindustry/content/Weapons.java index 027cc4f8ae..e54906a87a 100644 --- a/core/src/io/anuke/mindustry/content/Weapons.java +++ b/core/src/io/anuke/mindustry/content/Weapons.java @@ -39,7 +39,7 @@ public class Weapons implements ContentList{ droneBlaster = new Weapon("blaster"){{ length = 2f; - reload = 30f; + reload = 25f; width = 1f; roundrobin = true; ejectEffect = ShootFx.shellEjectSmall; diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index 26e8dd2bb6..2a1f48ad7c 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -207,7 +207,7 @@ public class CraftingBlocks extends BlockList implements ContentList{ itemCapacity = 50; craftTime = 25f; outputLiquid = Liquids.oil; - outputLiquidAmount = 1.4f; + outputLiquidAmount = 1.5f; size = 2; health = 320; hasLiquids = true; diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java index 57b21777ba..ad8fddfeb3 100644 --- a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java @@ -88,7 +88,7 @@ public class ProductionBlocks extends BlockList implements ContentList{ updateEffect = BlockFx.pulverize; liquidCapacity = 50f; updateEffectChance = 0.05f; - pumpAmount = 0.08f; + pumpAmount = 0.09f; size = 3; liquidCapacity = 30f; diff --git a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java index 2d395905b8..7cac576361 100644 --- a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java @@ -16,7 +16,7 @@ public class UnitBlocks extends BlockList implements ContentList{ public void load(){ dronePad = new UnitPad("drone-pad"){{ type = UnitTypes.drone; - produceTime = 5500; + produceTime = 5700; size = 2; consumes.power(0.08f); consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)}); @@ -24,7 +24,7 @@ public class UnitBlocks extends BlockList implements ContentList{ fabricatorPad = new UnitPad("fabricator-pad"){{ type = UnitTypes.fabricator; - produceTime = 7000; + produceTime = 7300; size = 2; consumes.power(0.2f); consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)}); @@ -32,7 +32,7 @@ public class UnitBlocks extends BlockList implements ContentList{ interceptorPad = new UnitPad("interceptor-pad"){{ type = UnitTypes.interceptor; - produceTime = 1900; + produceTime = 1800; size = 2; consumes.power(0.1f); consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)}); @@ -40,7 +40,7 @@ public class UnitBlocks extends BlockList implements ContentList{ monsoonPad = new UnitPad("monsoon-pad"){{ type = UnitTypes.monsoon; - produceTime = 3800; + produceTime = 3600; size = 3; consumes.power(0.2f); shadow = "shadow-round-3"; @@ -49,15 +49,15 @@ public class UnitBlocks extends BlockList implements ContentList{ daggerPad = new UnitPad("dagger-pad"){{ type = UnitTypes.dagger; - produceTime = 1800; + produceTime = 1700; size = 2; consumes.power(0.05f); - consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.copper, 15)}); + consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.copper, 10)}); }}; titanPad = new UnitPad("titan-pad"){{ type = UnitTypes.titan; - produceTime = 3600; + produceTime = 3400; size = 3; consumes.power(0.15f); shadow = "shadow-round-3"; diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index 2eb40dbf7a..543e56306a 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -24,7 +24,7 @@ import static io.anuke.mindustry.Vars.*; public class Sectors{ private static final int sectorImageSize = 32; - private static final float sectorLargeChance = 0.23f; + private static final float sectorLargeChance = 0.24f; private GridMap grid = new GridMap<>(); @@ -133,7 +133,7 @@ public class Sectors{ } private void initSector(Sector sector){ - double waveChance = 0.2; + double waveChance = 0.3; sector.difficulty = (int)(Mathf.dst(sector.x, sector.y)); diff --git a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java index ef3cb46e97..d95e266dd7 100644 --- a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java @@ -9,7 +9,6 @@ import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.maps.generation.pathfinding.AStarPathFinder; import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Recipe; @@ -84,11 +83,10 @@ public class FortressGenerator{ Drill powerDrill = (Drill) powerDrills.get((int)(difficultyScl * powerDrills.size)); Turret powerTurret = (Turret) powerTurrets.get((int)(difficultyScl * powerTurrets.size)); - Turret bigTurret = (Turret) turrets.get(Mathf.clamp((int)((difficultyScl+0.3f+gen.random.range(0.2f)) * turrets.size), 0, turrets.size-1)); + Turret bigTurret = (Turret) turrets.get(Mathf.clamp((int)((difficultyScl+0.2f+gen.random.range(0.2f)) * turrets.size), 0, turrets.size-1)); Turret turret1 = (Turret) turrets.get(Mathf.clamp((int)((difficultyScl+gen.random.range(0.2f)) * turrets.size), 0, turrets.size-1)); Turret turret2 = (Turret) turrets.get(Mathf.clamp((int)((difficultyScl+gen.random.range(0.2f)) * turrets.size), 0, turrets.size-1)); - - AStarPathFinder finder = new AStarPathFinder(gen.tiles); + float placeChance = difficultyScl*0.75f+0.25f; IntIntMap ammoPerType = new IntIntMap(); for(Block turret : turrets){ @@ -112,7 +110,7 @@ public class FortressGenerator{ }; BiFunction, IntPositionConsumer> seeder = (block, pred) -> (x, y) -> { - if(gen.canPlace(x, y, block) && ((block instanceof Wall && block.size == 1) || gen.random.chance(difficultyScl/2f+0.5f)) && checker.get(gen.tile(x, y), block, pred)){ + if(gen.canPlace(x, y, block) && ((block instanceof Wall && block.size == 1) || gen.random.chance(placeChance)) && checker.get(gen.tile(x, y), block, pred)){ gen.setBlock(x, y, block, team); } }; @@ -122,7 +120,7 @@ public class FortressGenerator{ (x, y) -> { Block block = PowerBlocks.largeSolarPanel; - if(gen.random.chance(0.001) && gen.canPlace(x, y, block)){ + if(gen.random.chance(0.001*placeChance) && gen.canPlace(x, y, block)){ gen.setBlock(x, y, block, team); } }, @@ -132,7 +130,7 @@ public class FortressGenerator{ //drills (not powered) (x, y) -> { - if(!gen.random.chance(0.1)) return; + if(!gen.random.chance(0.1*placeChance)) return; Item item = gen.drillItem(x, y, drill); if(item != null && item != Items.stone && item != Items.sand && gen.canPlace(x, y, drill)){ @@ -142,7 +140,7 @@ public class FortressGenerator{ //drills (not powered) (x, y) -> { - if(!gen.random.chance(0.1)) return; + if(!gen.random.chance(0.1*placeChance)) return; if(gen.tile(x, y).floor().isLiquid && gen.tile(x, y).floor().liquidDrop == Liquids.water){ gen.setBlock(x, y, LiquidBlocks.mechanicalPump, team); @@ -154,7 +152,7 @@ public class FortressGenerator{ //drills (powered) (x, y) -> { - if(gen.random.chance(0.4) && gen.canPlace(x, y, powerDrill) && gen.drillItem(x, y, powerDrill) == Items.thorium && checker.get(gen.tile(x, y), powerDrill, other -> other.block() instanceof PowerGenerator)){ + if(gen.random.chance(0.4*placeChance) && gen.canPlace(x, y, powerDrill) && gen.drillItem(x, y, powerDrill) == Items.thorium && checker.get(gen.tile(x, y), powerDrill, other -> other.block() instanceof PowerGenerator)){ gen.setBlock(x, y, powerDrill, team); } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/io/anuke/mindustry/world/blocks/distribution/ItemBridge.java index 1c0c175038..ca912aa8f4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/ItemBridge.java @@ -246,30 +246,17 @@ public class ItemBridge extends Block{ ItemBridgeEntity entity = tile.entity(); Tile other = world.tile(entity.link); - boolean linked = false; if(linkValid(tile, other)){ - linked = true; int rel = tile.absoluteRelativeTo(other.x, other.y); int rel2 = tile.relativeTo(source.x, source.y); if(rel == rel2) return false; }else{ - int i = tile.relativeTo(source.x, source.y); - - IntSetIterator it = entity.incoming.iterator(); - - while(it.hasNext){ - int v = it.next(); - int x = v % world.width(); - int y = v / world.width(); - if(tile.absoluteRelativeTo(x, y) == i){ - return false; - } - } + return source.block() instanceof ItemBridge && source.entity().link == tile.packedPosition(); } - return tile.entity.items.total() < itemCapacity && (linked || source.block() instanceof ItemBridge); + return tile.entity.items.total() < itemCapacity; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidBridge.java b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidBridge.java index 72eacdc3f7..97a495cc54 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidBridge.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidBridge.java @@ -1,6 +1,5 @@ package io.anuke.mindustry.world.blocks.distribution; -import com.badlogic.gdx.utils.IntSet.IntSetIterator; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; @@ -59,19 +58,7 @@ public class LiquidBridge extends ItemBridge{ Tile other = world.tile(entity.link); if(!linkValid(tile, other)){ - int i = tile.absoluteRelativeTo(to.x, to.y); - - IntSetIterator it = entity.incoming.iterator(); - - while(it.hasNext){ - int v = it.next(); - int x = v % world.width(); - int y = v / world.width(); - if(tile.absoluteRelativeTo(x, y) == i){ - return false; - } - } - return true; + return !(to.block() instanceof LiquidBridge); } int rel = tile.absoluteRelativeTo(other.x, other.y);