diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 2416e80ecb..cc6f8e3700 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -343,6 +343,7 @@ blocks.inputfuel = Fuel blocks.fuelburntime = Fuel Burn Time blocks.inputcapacity = Input capacity blocks.outputcapacity = Output capacity +blocks.ammo = Ammo unit.blocks = blocks unit.powersecond = power units/second unit.liquidsecond = liquid units/second diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 9ad4039266..37d4502b0e 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -1041,7 +1041,7 @@ public class Blocks implements ContentList{ //region turrets duo = new DoubleTurret("duo"){{ - requirements(Category.turret, ItemStack.with(Items.copper, 60), true); + requirements(Category.turret, ItemStack.with(Items.copper, 70), true); ammo( Items.copper, Bullets.standardCopper, Items.graphite, Bullets.standardDense, @@ -1050,10 +1050,10 @@ public class Blocks implements ContentList{ ); reload = 20f; restitution = 0.03f; - range = 90f; + range = 95f; shootCone = 15f; ammoUseEffect = Fx.shellEjectSmall; - health = 150; + health = 210; inaccuracy = 2f; rotatespeed = 10f; }}; diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index e99d1aed55..e73ad80aa1 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -260,12 +260,12 @@ public class Bullets implements ContentList{ weaveMag = 1f; }}; - standardCopper = new BasicBulletType(2.5f, 7, "bullet"){{ + standardCopper = new BasicBulletType(2.5f, 9, "bullet"){{ bulletWidth = 7f; bulletHeight = 9f; shootEffect = Fx.shootSmall; smokeEffect = Fx.shootSmallSmoke; - ammoMultiplier = 2; + ammoMultiplier = 1; }}; standardDense = new BasicBulletType(3.5f, 18, "bullet"){{ diff --git a/core/src/io/anuke/mindustry/graphics/Palette.java b/core/src/io/anuke/mindustry/graphics/Palette.java index 5e34441ddc..39f1ff1585 100644 --- a/core/src/io/anuke/mindustry/graphics/Palette.java +++ b/core/src/io/anuke/mindustry/graphics/Palette.java @@ -30,6 +30,7 @@ public class Palette{ lightishGray = Color.valueOf("a2a2a2"), darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f), darkerGray = new Color(0.2f, 0.2f, 0.2f, 1f), + ammo = Color.valueOf("ff8947"), boostTo = Color.valueOf("ffad4d"), boostFrom = Color.valueOf("ff7f57"), diff --git a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java index 5a44733af3..2f7168b434 100644 --- a/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/defense/turrets/ItemTurret.java @@ -1,10 +1,14 @@ package io.anuke.mindustry.world.blocks.defense.turrets; import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.scene.ui.layout.Table; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.entities.type.Unit; import io.anuke.mindustry.entities.bullet.BulletType; +import io.anuke.mindustry.entities.type.TileEntity; +import io.anuke.mindustry.entities.type.Unit; +import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.ui.Bar; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.values.ItemFilterValue; @@ -35,6 +39,17 @@ public class ItemTurret extends CooledTurret{ stats.add(BlockStat.inputItems, new ItemFilterValue(item -> ammo.containsKey(item))); } + + @Override + public void displayBars(Tile tile, Table bars){ + super.displayBars(tile, bars); + + TurretEntity entity = tile.entity(); + + bars.add(new Bar("blocks.ammo", Palette.ammo, () -> (float)entity.totalAmmo / maxAmmo)).growX(); + bars.row(); + } + @Override public int acceptStack(Item item, int amount, Tile tile, Unit source){ TurretEntity entity = tile.entity(); @@ -90,6 +105,11 @@ public class ItemTurret extends CooledTurret{ return ammo != null && ammo.get(item) != null && entity.totalAmmo + ammo.get(item).ammoMultiplier <= maxAmmo; } + @Override + public TileEntity newEntity(){ + return new ItemTurretEntity(); + } + public class ItemTurretEntity extends TurretEntity{ @Override public void write(DataOutput stream) throws IOException{