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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 17 deletions

View File

@ -952,7 +952,7 @@ ability.unitspawn = {0} Factory
ability.shieldregenfield = Shield Regen Field
ability.movelightning = Movement Lightning
ability.shieldarc = Shield Arc
ability.suppressionfield = Regen Suppression Field
ability.suppressionfield = Repair Suppression Field
ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks / [accent]{2}[] targets
bar.onlycoredeposit = Only Core Depositing Allowed
@ -989,10 +989,11 @@ bar.strength = [stat]{0}[lightgray]x strength
units.processorcontrol = [lightgray]Processor Controlled
bullet.damage = [stat]{0}[lightgray] damage
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles
bullet.splashdamage = [stat]{0}[lightgray] area dmg ~ [stat]{1}[lightgray] tiles
bullet.incendiary = [stat]incendiary
bullet.homing = [stat]homing
bullet.armorpierce = [stat]armor piercing
bullet.suppression = [stat]{0} sec[lightgray] repair suppression ~ [stat]{1}[lightgray] tiles
bullet.interval = [stat]{0}/sec[lightgray] interval bullets:
bullet.frags = [stat]{0}[lightgray]x frag bullets:
bullet.lightning = [stat]{0}[lightgray]x lightning ~ [stat]{1}[lightgray] damage

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();
}
};