Ammo/shot display
This commit is contained in:
@@ -699,6 +699,7 @@ stat.commandlimit = Command Limit
|
|||||||
stat.abilities = Abilities
|
stat.abilities = Abilities
|
||||||
stat.canboost = Can Boost
|
stat.canboost = Can Boost
|
||||||
stat.flying = Flying
|
stat.flying = Flying
|
||||||
|
stat.ammouse = Ammo Use
|
||||||
|
|
||||||
ability.forcefield = Force Field
|
ability.forcefield = Force Field
|
||||||
ability.repairfield = Repair Field
|
ability.repairfield = Repair Field
|
||||||
@@ -766,6 +767,7 @@ unit.items = items
|
|||||||
unit.thousands = k
|
unit.thousands = k
|
||||||
unit.millions = mil
|
unit.millions = mil
|
||||||
unit.billions = b
|
unit.billions = b
|
||||||
|
unit.pershot = /shot
|
||||||
category.purpose = Purpose
|
category.purpose = Purpose
|
||||||
category.general = General
|
category.general = General
|
||||||
category.power = Power
|
category.power = Power
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class Turret extends ReloadTurret{
|
|||||||
stats.add(Stat.reload, 60f / reloadTime * (alternate ? 1 : shots), StatUnit.none);
|
stats.add(Stat.reload, 60f / reloadTime * (alternate ? 1 : shots), StatUnit.none);
|
||||||
stats.add(Stat.targetsAir, targetAir);
|
stats.add(Stat.targetsAir, targetAir);
|
||||||
stats.add(Stat.targetsGround, targetGround);
|
stats.add(Stat.targetsGround, targetGround);
|
||||||
|
if(ammoPerShot != 1) stats.add(Stat.ammoUse, ammoPerShot, StatUnit.perShot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class SolidPump extends Pump{
|
|||||||
stats.remove(Stat.output);
|
stats.remove(Stat.output);
|
||||||
stats.add(Stat.output, result, 60f * pumpAmount, true);
|
stats.add(Stat.output, result, 60f * pumpAmount, true);
|
||||||
if(attribute != null){
|
if(attribute != null){
|
||||||
stats.add(baseEfficiency > 0.0001f ? Stat.affinities : Stat.tiles, attribute);
|
stats.add(baseEfficiency > 0.0001f ? Stat.affinities : Stat.tiles, attribute, floating, 1f, baseEfficiency <= 0.001f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public enum Stat{
|
|||||||
targetsGround(StatCat.function),
|
targetsGround(StatCat.function),
|
||||||
damage(StatCat.function),
|
damage(StatCat.function),
|
||||||
ammo(StatCat.function),
|
ammo(StatCat.function),
|
||||||
|
ammoUse(StatCat.function),
|
||||||
shieldHealth(StatCat.function),
|
shieldHealth(StatCat.function),
|
||||||
cooldownTime(StatCat.function),
|
cooldownTime(StatCat.function),
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public enum StatUnit{
|
|||||||
minutes,
|
minutes,
|
||||||
perSecond,
|
perSecond,
|
||||||
perMinute,
|
perMinute,
|
||||||
|
perShot,
|
||||||
timesSpeed(false),
|
timesSpeed(false),
|
||||||
percent(false),
|
percent(false),
|
||||||
shieldHealth,
|
shieldHealth,
|
||||||
|
|||||||
@@ -55,22 +55,22 @@ public class Stats{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(Stat stat, Attribute attr){
|
public void add(Stat stat, Attribute attr){
|
||||||
add(stat, attr, false, 1f);
|
add(stat, attr, false, 1f, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Stat stat, Attribute attr, float scale){
|
public void add(Stat stat, Attribute attr, float scale){
|
||||||
add(stat, attr, false, scale);
|
add(stat, attr, false, scale, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Stat stat, Attribute attr, boolean floating){
|
public void add(Stat stat, Attribute attr, boolean floating){
|
||||||
add(stat, attr, floating, 1f);
|
add(stat, attr, floating, 1f, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Stat stat, Attribute attr, boolean floating, float scale){
|
public void add(Stat stat, Attribute attr, boolean floating, float scale, boolean startZero){
|
||||||
for(var block : Vars.content.blocks()
|
for(var block : Vars.content.blocks()
|
||||||
.select(block -> block instanceof Floor f && f.attributes.get(attr) != 0 && !(f.isLiquid && !floating))
|
.select(block -> block instanceof Floor f && f.attributes.get(attr) != 0 && !(f.isLiquid && !floating))
|
||||||
.<Floor>as().with(s -> s.sort(f -> f.attributes.get(attr)))){
|
.<Floor>as().with(s -> s.sort(f -> f.attributes.get(attr)))){
|
||||||
add(stat, new FloorEfficiencyValue(block, block.attributes.get(attr) * scale));
|
add(stat, new FloorEfficiencyValue(block, block.attributes.get(attr) * scale, startZero));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,18 @@ import mindustry.world.meta.*;
|
|||||||
public class FloorEfficiencyValue implements StatValue{
|
public class FloorEfficiencyValue implements StatValue{
|
||||||
private final Floor floor;
|
private final Floor floor;
|
||||||
private final float multiplier;
|
private final float multiplier;
|
||||||
|
private final boolean startZero;
|
||||||
|
|
||||||
public FloorEfficiencyValue(Floor floor, float multiplier){
|
public FloorEfficiencyValue(Floor floor, float multiplier, boolean startZero){
|
||||||
this.floor = floor;
|
this.floor = floor;
|
||||||
this.multiplier = multiplier;
|
this.multiplier = multiplier;
|
||||||
|
this.startZero = startZero;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Table table){
|
public void display(Table table){
|
||||||
table.stack(new Image(floor.icon(Cicon.medium)).setScaling(Scaling.fit), new Table(t -> {
|
table.stack(new Image(floor.icon(Cicon.medium)).setScaling(Scaling.fit), new Table(t -> {
|
||||||
t.top().right().add((multiplier < 0 ? "[scarlet]" : "[accent]+") + (int)((multiplier) * 100) + "%").style(Styles.outlineLabel);
|
t.top().right().add((multiplier < 0 ? "[scarlet]" : startZero ? "[accent]" : "[accent]+") + (int)((multiplier) * 100) + "%").style(Styles.outlineLabel);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user