Minor polish

This commit is contained in:
Anuken
2022-01-10 22:52:22 -05:00
parent 10d8e63368
commit 125994482e
11 changed files with 35 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -132,6 +132,7 @@ public class Blocks{
//unit - erekir //unit - erekir
tankAssembler, tankAssembler,
shipAssembler, shipAssembler,
mechAssembler,
basicAssemblerModule, basicAssemblerModule,
//payloads //payloads
@@ -2993,7 +2994,7 @@ public class Blocks{
//TODO bad name //TODO bad name
sublimate = new ContinuousLiquidTurret("sublimate"){{ sublimate = new ContinuousLiquidTurret("sublimate"){{
//TODO requirements //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-"){{ draw = new DrawTurret("reinforced-"){{
@@ -3035,15 +3036,17 @@ public class Blocks{
//TODO balance, set up, where is liquid/sec displayed? status effects maybe? //TODO balance, set up, where is liquid/sec displayed? status effects maybe?
ammo( ammo(
Liquids.ozone, new ContinuousFlameBulletType(){{ Liquids.ozone, new ContinuousFlameBulletType(){{
damage = 7f; damage = 9f;
length = range; 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}; 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(){{ Liquids.cyanogen, new ContinuousFlameBulletType(){{
damage = 14f; damage = 20f;
rangeChange = 50f; rangeChange = 70f;
length = range + rangeChange; 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}; 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"); flareColor = Color.valueOf("89e8b6");
@@ -3312,6 +3315,8 @@ public class Blocks{
}}; }};
//TODO mech assembler
basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{ basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{
requirements(Category.units, with(Items.graphite, 10)); requirements(Category.units, with(Items.graphite, 10));
consumes.power(0.5f); consumes.power(0.5f);

View File

@@ -33,12 +33,14 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
super.setStats(); super.setStats();
stats.remove(Stat.ammo); 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)); stats.add(Stat.ammo, StatValues.ammo(ammoTypes));
} }
@Override @Override
public void init(){ public void init(){
//TODO use ammoMultiplier here? //TODO display ammoMultiplier.
consumes.add(new ConsumeLiquidFilter(i -> ammoTypes.containsKey(i), liquidConsumed){ consumes.add(new ConsumeLiquidFilter(i -> ammoTypes.containsKey(i), liquidConsumed){
@Override @Override
public boolean valid(Building build){ public boolean valid(Building build){
@@ -49,6 +51,12 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
public void display(Stats stats){ 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(); super.init();

View File

@@ -27,6 +27,8 @@ public class ContinuousTurret extends Turret{
super.setStats(); super.setStats();
stats.add(Stat.ammo, StatValues.ammo(ObjectMap.of(this, shootType))); stats.add(Stat.ammo, StatValues.ammo(ObjectMap.of(this, shootType)));
stats.remove(Stat.reload);
stats.remove(Stat.inaccuracy);
} }
public class ContinuousTurretBuild extends TurretBuild{ public class ContinuousTurretBuild extends TurretBuild{
@@ -107,7 +109,7 @@ public class ContinuousTurret extends Turret{
return; return;
} }
if(consValid() && !charging){ if(cons.canConsume() && !charging){
shoot(peekAmmo()); shoot(peekAmmo());
} }
} }

View File

@@ -34,15 +34,25 @@ public class StatValues{
return table -> table.add(!value ? "@no" : "@yes"); 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 -> { return table -> {
int precision = Math.abs((int)value - value) <= 0.001f ? 0 : Math.abs((int)(value * 10) - value * 10) <= 0.001f ? 1 : 2; 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)); String l1 = Strings.fixed(value, precision), l2 = (unit.space ? " " : "") + unit.localized();
table.add((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){ public static StatValue liquid(Liquid liquid, float amount, boolean perSecond){
return table -> table.add(new LiquidDisplay(liquid, amount, perSecond)); return table -> table.add(new LiquidDisplay(liquid, amount, perSecond));
} }

View File

@@ -24,4 +24,4 @@ android.useAndroidX=true
#used for slow jitpack builds; TODO see if this actually works #used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
archash=3bd873b8b7 archash=368ccbfa7e