Minor polish
This commit is contained in:
@@ -132,6 +132,7 @@ public class Blocks{
|
||||
//unit - erekir
|
||||
tankAssembler,
|
||||
shipAssembler,
|
||||
mechAssembler,
|
||||
basicAssemblerModule,
|
||||
|
||||
//payloads
|
||||
@@ -2993,7 +2994,7 @@ public class Blocks{
|
||||
//TODO bad name
|
||||
sublimate = new ContinuousLiquidTurret("sublimate"){{
|
||||
//TODO requirements
|
||||
requirements(Category.turret, with(Items.tungsten, 150, Items.silicon, 160, Items.oxide, 50, Items.beryllium, 200));
|
||||
requirements(Category.turret, with(Items.tungsten, 150, Items.silicon, 160, Items.oxide, 50, Items.beryllium, 250));
|
||||
|
||||
draw = new DrawTurret("reinforced-"){{
|
||||
|
||||
@@ -3035,15 +3036,17 @@ public class Blocks{
|
||||
//TODO balance, set up, where is liquid/sec displayed? status effects maybe?
|
||||
ammo(
|
||||
Liquids.ozone, new ContinuousFlameBulletType(){{
|
||||
damage = 7f;
|
||||
damage = 9f;
|
||||
length = range;
|
||||
knockback = 1f;
|
||||
|
||||
colors = new Color[]{Color.valueOf("eb7abe").a(0.55f), Color.valueOf("e189f5").a(0.7f), Color.valueOf("907ef7").a(0.8f), Color.valueOf("91a4ff"), Color.white};
|
||||
}},
|
||||
Liquids.cyanogen, new ContinuousFlameBulletType(){{
|
||||
damage = 14f;
|
||||
rangeChange = 50f;
|
||||
damage = 20f;
|
||||
rangeChange = 70f;
|
||||
length = range + rangeChange;
|
||||
knockback = 2f;
|
||||
|
||||
colors = new Color[]{Color.valueOf("465ab8").a(0.55f), Color.valueOf("66a6d2").a(0.7f), Color.valueOf("89e8b6").a(0.8f), Color.valueOf("cafcbe"), Color.white};
|
||||
flareColor = Color.valueOf("89e8b6");
|
||||
@@ -3312,6 +3315,8 @@ public class Blocks{
|
||||
|
||||
}};
|
||||
|
||||
//TODO mech assembler
|
||||
|
||||
basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{
|
||||
requirements(Category.units, with(Items.graphite, 10));
|
||||
consumes.power(0.5f);
|
||||
|
||||
@@ -33,12 +33,14 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
|
||||
super.setStats();
|
||||
|
||||
stats.remove(Stat.ammo);
|
||||
//TODO looks bad
|
||||
stats.add(Stat.ammo, StatValues.number(liquidConsumed * 60f, StatUnit.perSecond, true));
|
||||
stats.add(Stat.ammo, StatValues.ammo(ammoTypes));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
//TODO use ammoMultiplier here?
|
||||
//TODO display ammoMultiplier.
|
||||
consumes.add(new ConsumeLiquidFilter(i -> ammoTypes.containsKey(i), liquidConsumed){
|
||||
@Override
|
||||
public boolean valid(Building build){
|
||||
@@ -49,6 +51,12 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
|
||||
public void display(Stats stats){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float use(Building entity){
|
||||
BulletType type = ammoTypes.get(entity.liquids.current());
|
||||
return Math.min(amount * entity.edelta(), entity.block.liquidCapacity) / (type == null ? 1f : type.ammoMultiplier);
|
||||
}
|
||||
});
|
||||
|
||||
super.init();
|
||||
|
||||
@@ -27,6 +27,8 @@ public class ContinuousTurret extends Turret{
|
||||
super.setStats();
|
||||
|
||||
stats.add(Stat.ammo, StatValues.ammo(ObjectMap.of(this, shootType)));
|
||||
stats.remove(Stat.reload);
|
||||
stats.remove(Stat.inaccuracy);
|
||||
}
|
||||
|
||||
public class ContinuousTurretBuild extends TurretBuild{
|
||||
@@ -107,7 +109,7 @@ public class ContinuousTurret extends Turret{
|
||||
return;
|
||||
}
|
||||
|
||||
if(consValid() && !charging){
|
||||
if(cons.canConsume() && !charging){
|
||||
shoot(peekAmmo());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,15 +34,25 @@ public class StatValues{
|
||||
return table -> table.add(!value ? "@no" : "@yes");
|
||||
}
|
||||
|
||||
public static StatValue number(float value, StatUnit unit){
|
||||
public static StatValue number(float value, StatUnit unit, boolean merge){
|
||||
return table -> {
|
||||
int precision = Math.abs((int)value - value) <= 0.001f ? 0 : Math.abs((int)(value * 10) - value * 10) <= 0.001f ? 1 : 2;
|
||||
|
||||
table.add(Strings.fixed(value, precision));
|
||||
table.add((unit.space ? " " : "") + unit.localized());
|
||||
String l1 = Strings.fixed(value, precision), l2 = (unit.space ? " " : "") + unit.localized();
|
||||
|
||||
if(merge){
|
||||
table.add(l1 + l2);
|
||||
}else{
|
||||
table.add(l1);
|
||||
table.add(l2);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static StatValue number(float value, StatUnit unit){
|
||||
return number(value, unit, false);
|
||||
}
|
||||
|
||||
public static StatValue liquid(Liquid liquid, float amount, boolean perSecond){
|
||||
return table -> table.add(new LiquidDisplay(liquid, amount, perSecond));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user