Fixed turrets saving ammo / Duo buff / Ammo display / Map saves break
This commit is contained in:
@@ -343,6 +343,7 @@ blocks.inputfuel = Fuel
|
|||||||
blocks.fuelburntime = Fuel Burn Time
|
blocks.fuelburntime = Fuel Burn Time
|
||||||
blocks.inputcapacity = Input capacity
|
blocks.inputcapacity = Input capacity
|
||||||
blocks.outputcapacity = Output capacity
|
blocks.outputcapacity = Output capacity
|
||||||
|
blocks.ammo = Ammo
|
||||||
unit.blocks = blocks
|
unit.blocks = blocks
|
||||||
unit.powersecond = power units/second
|
unit.powersecond = power units/second
|
||||||
unit.liquidsecond = liquid units/second
|
unit.liquidsecond = liquid units/second
|
||||||
|
|||||||
@@ -1041,7 +1041,7 @@ public class Blocks implements ContentList{
|
|||||||
//region turrets
|
//region turrets
|
||||||
|
|
||||||
duo = new DoubleTurret("duo"){{
|
duo = new DoubleTurret("duo"){{
|
||||||
requirements(Category.turret, ItemStack.with(Items.copper, 60), true);
|
requirements(Category.turret, ItemStack.with(Items.copper, 70), true);
|
||||||
ammo(
|
ammo(
|
||||||
Items.copper, Bullets.standardCopper,
|
Items.copper, Bullets.standardCopper,
|
||||||
Items.graphite, Bullets.standardDense,
|
Items.graphite, Bullets.standardDense,
|
||||||
@@ -1050,10 +1050,10 @@ public class Blocks implements ContentList{
|
|||||||
);
|
);
|
||||||
reload = 20f;
|
reload = 20f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
range = 90f;
|
range = 95f;
|
||||||
shootCone = 15f;
|
shootCone = 15f;
|
||||||
ammoUseEffect = Fx.shellEjectSmall;
|
ammoUseEffect = Fx.shellEjectSmall;
|
||||||
health = 150;
|
health = 210;
|
||||||
inaccuracy = 2f;
|
inaccuracy = 2f;
|
||||||
rotatespeed = 10f;
|
rotatespeed = 10f;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -260,12 +260,12 @@ public class Bullets implements ContentList{
|
|||||||
weaveMag = 1f;
|
weaveMag = 1f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
standardCopper = new BasicBulletType(2.5f, 7, "bullet"){{
|
standardCopper = new BasicBulletType(2.5f, 9, "bullet"){{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
shootEffect = Fx.shootSmall;
|
shootEffect = Fx.shootSmall;
|
||||||
smokeEffect = Fx.shootSmallSmoke;
|
smokeEffect = Fx.shootSmallSmoke;
|
||||||
ammoMultiplier = 2;
|
ammoMultiplier = 1;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
standardDense = new BasicBulletType(3.5f, 18, "bullet"){{
|
standardDense = new BasicBulletType(3.5f, 18, "bullet"){{
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class Palette{
|
|||||||
lightishGray = Color.valueOf("a2a2a2"),
|
lightishGray = Color.valueOf("a2a2a2"),
|
||||||
darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f),
|
darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f),
|
||||||
darkerGray = new Color(0.2f, 0.2f, 0.2f, 1f),
|
darkerGray = new Color(0.2f, 0.2f, 0.2f, 1f),
|
||||||
|
ammo = Color.valueOf("ff8947"),
|
||||||
|
|
||||||
boostTo = Color.valueOf("ffad4d"),
|
boostTo = Color.valueOf("ffad4d"),
|
||||||
boostFrom = Color.valueOf("ff7f57"),
|
boostFrom = Color.valueOf("ff7f57"),
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense.turrets;
|
package io.anuke.mindustry.world.blocks.defense.turrets;
|
||||||
|
|
||||||
import io.anuke.arc.collection.ObjectMap;
|
import io.anuke.arc.collection.ObjectMap;
|
||||||
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.entities.type.Unit;
|
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
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.type.Item;
|
||||||
|
import io.anuke.mindustry.ui.Bar;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.mindustry.world.meta.values.ItemFilterValue;
|
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)));
|
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
|
@Override
|
||||||
public int acceptStack(Item item, int amount, Tile tile, Unit source){
|
public int acceptStack(Item item, int amount, Tile tile, Unit source){
|
||||||
TurretEntity entity = tile.entity();
|
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;
|
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{
|
public class ItemTurretEntity extends TurretEntity{
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutput stream) throws IOException{
|
public void write(DataOutput stream) throws IOException{
|
||||||
|
|||||||
Reference in New Issue
Block a user