Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2025-11-04 18:05:25 -05:00
43 changed files with 232 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.logic.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.*;
@@ -101,12 +102,40 @@ public class ForceProjector extends Block{
if(consItems) stats.timePeriod = phaseUseTime;
super.setStats();
stats.add(Stat.shieldHealth, shieldHealth, StatUnit.none);
stats.add(Stat.regenerationRate, cooldownNormal * 60f, StatUnit.perSecond);
stats.add(Stat.cooldownTime, (int) (shieldHealth / cooldownBrokenBase / 60f), StatUnit.seconds);
if(consItems && itemConsumer instanceof ConsumeItems coni){
stats.remove(Stat.booster);
stats.add(Stat.booster, StatValues.itemBoosters("+{0} " + StatUnit.shieldHealth.localized(), stats.timePeriod, phaseShieldBoost, phaseRadiusBoost, coni.items));
stats.add(Stat.booster, StatValues.speedBoosters("", coolantConsumption, Float.MAX_VALUE, true, this::consumesLiquid));
stats.add(Stat.booster, (table) -> {
table.row();
table.table(c -> {
for(Liquid liquid : content.liquids()){
if(!consumesLiquid(liquid)) continue;
c.table(Styles.grayPanel, b -> {
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> StatValues.withTooltip(i, liquid, false));
b.table(info -> {
info.add(liquid.localizedName).left().row();
info.add(Strings.autoFixed(coolantConsumption * 60f, 2) + StatUnit.perSecond.localized()).left().color(Color.lightGray);
});
float liquidHeat = (1f + (liquid.heatCapacity - 0.4f) * 0.9f);
float regenBoost = ((cooldownNormal * (cooldownLiquid * liquidHeat)) - cooldownNormal) * 60f;
float cooldownBoost = (shieldHealth / (cooldownBrokenBase * (cooldownLiquid * liquidHeat)) - shieldHealth / cooldownBrokenBase) / 60f;
b.table(bt -> {
bt.right().defaults().padRight(3).left();
bt.add("[lightgray]+" + Core.bundle.format("bar.regenerationrate", Strings.autoFixed(regenBoost, 2))).pad(5).row();
bt.add(Core.bundle.format("ability.stat.cooldown", Strings.autoFixed(cooldownBoost, 2))).pad(5);
}).right().grow().pad(10f).padRight(15f);
}).growX().pad(5).row();
}
}).growX().colspan(table.getColumns());
table.row();
});
}
}

View File

@@ -83,6 +83,8 @@ public class Stat implements Comparable<Stat>{
shots = new Stat("shots", StatCat.function),
reload = new Stat("reload", StatCat.function),
crushDamage = new Stat("crushDamage", StatCat.function),
legSplashDamage = new Stat("legSplashDamage", StatCat.function),
legSplashRange = new Stat("legSplashRange", StatCat.function),
targetsAir = new Stat("targetsAir", StatCat.function),
targetsGround = new Stat("targetsGround", StatCat.function),
damage = new Stat("damage", StatCat.function),
@@ -92,6 +94,7 @@ public class Stat implements Comparable<Stat>{
ammoUse = new Stat("ammoUse", StatCat.function),
shieldHealth = new Stat("shieldHealth", StatCat.function),
cooldownTime = new Stat("cooldownTime", StatCat.function),
regenerationRate = new Stat("regenerationRate", StatCat.function),
moduleTier = new Stat("moduletier", StatCat.function),
unitType = new Stat("unittype", StatCat.function),

View File

@@ -28,6 +28,7 @@ public class StatUnit{
perSecond = new StatUnit("perSecond", false),
perMinute = new StatUnit("perMinute", false),
perShot = new StatUnit("perShot", false),
perLeg = new StatUnit("perLeg"),
timesSpeed = new StatUnit("timesSpeed", false),
multiplier = new StatUnit("multiplier", false),
percent = new StatUnit("percent", false),

View File

@@ -509,7 +509,7 @@ public class StatValues{
if(!filter.get(liquid)) continue;
c.table(Styles.grayPanel, b -> {
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> withTooltip(i, liquid, false));;
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> withTooltip(i, liquid, false));
b.table(info -> {
info.add(liquid.localizedName).left().row();
info.add(Strings.autoFixed(amount * 60f, 2) + StatUnit.perSecond.localized()).left().color(Color.lightGray);