Better Ammo Stats Display (#8429)

* Cleaner ammo stats based on unit factory recipe stats

* Display suppression in bullet stats

Also reword from "regen" to "repair" to more accurately convey that build towers are affected as well.

* PointLaserBulletTypes don't display damage in dps

* Display preview region instead of region

* autoFixed
This commit is contained in:
MEEPofFaith
2023-03-25 19:45:07 -07:00
committed by GitHub
parent f6a8c7509d
commit 6b936aa7f6
3 changed files with 28 additions and 17 deletions

View File

@@ -45,6 +45,11 @@ public class PointLaserBulletType extends BulletType{
drawSize = 1000f;
}
@Override
public float continuousDamage(){
return damage / damageInterval * 60f;
}
@Override
public float estimateDPS(){
return damage * 100f / damageInterval * 3f;

View File

@@ -292,15 +292,15 @@ public class StatValues{
continue;
}
TextureRegion region = !weapon.name.equals("") && weapon.region.found() ? weapon.region : Core.atlas.find("clear");
TextureRegion region = !weapon.name.isEmpty() ? Core.atlas.find(weapon.name + "-preview", weapon.region) : null;
table.image(region).size(60).scaling(Scaling.bounded).right().top();
table.table(Tex.underline, w -> {
w.left().defaults().padRight(3).left();
table.table(Styles.grayPanel, w -> {
w.left().top().defaults().padRight(3).left();
if(region != null && region.found()) w.image(region).size(60).scaling(Scaling.bounded).left().top();
w.row();
weapon.addStats(unit, w);
}).padTop(-9).left();
}).growX().pad(5).margin(10);
table.row();
}
};
@@ -332,14 +332,16 @@ public class StatValues{
continue;
}
//no point in displaying unit icon twice
if(!compact && !(t instanceof Turret)){
table.image(icon(t)).size(3 * 8).padRight(4).right().scaling(Scaling.fit).top();
table.add(t.localizedName).padRight(10).left().top();
}
table.table(bt -> {
table.table(Styles.grayPanel, bt -> {
bt.left().top().defaults().padRight(3).left();
//no point in displaying unit icon twice
if(!compact && !(t instanceof Turret)){
bt.table(title -> {
title.image(icon(t)).size(3 * 8).padRight(4).right().scaling(Scaling.fit).top();
title.add(t.localizedName).padRight(10).left().top();
});
bt.row();
}
if(type.damage > 0 && (type.collides || type.splashDamage <= 0)){
if(type.continuousDamage() > 0){
@@ -403,6 +405,10 @@ public class StatValues{
sep(bt, "@bullet.armorpierce");
}
if(type.suppressionRange > 0){
sep(bt, Core.bundle.format("bullet.suppression", Strings.autoFixed(type.suppressionDuration / 60f, 2), Strings.fixed(type.suppressionRange / tilesize, 1)));
}
if(type.status != StatusEffects.none){
sep(bt, (type.status.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName + (type.status.reactive ? "" : "[lightgray] ~ [stat]" + ((int)(type.statusDuration / 60f)) + "[lightgray] " + Core.bundle.get("unit.seconds")));
}
@@ -442,8 +448,7 @@ public class StatValues{
bt.row();
bt.add(coll);
}
}).padTop(compact ? 0 : -9).padLeft(indent * 8).left().get().background(compact ? null : Tex.underline);
}).padLeft(indent * 8).growX().pad(5).margin(compact ? 0 : 10);
table.row();
}
};