Fixed turrets saving ammo / Duo buff / Ammo display / Map saves break
This commit is contained in:
@@ -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;
|
||||
}};
|
||||
|
||||
@@ -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"){{
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user