Random assorted changes (#11338)

* shield stat changes

* shield stats + leg crush stats + apply floormultiplier to comp
This commit is contained in:
EggleEgg
2025-11-04 16:44:08 +01:00
committed by GitHub
parent 38d9bc83a3
commit 56b7e6357f
9 changed files with 62 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ import mindustry.gen.*;
import static mindustry.Vars.*;
public class RepairFieldAbility extends Ability{
public float amount = 1, reload = 100, range = 60;
public float amount = 1, reload = 100, range = 60, healPercent = 0f;
public Effect healEffect = Fx.heal;
public Effect activeEffect = Fx.healWaveDynamic;
public boolean parentizeEffects = false;
@@ -27,6 +27,12 @@ public class RepairFieldAbility extends Ability{
this.reload = reload;
this.range = range;
}
public RepairFieldAbility(float amount, float reload, float range, float healPercent){
this.amount = amount;
this.reload = reload;
this.range = range;
this.healPercent = healPercent;
}
@Override
public void addStats(Table t){
@@ -34,6 +40,11 @@ public class RepairFieldAbility extends Ability{
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
t.row();
t.add(abilityStat("repairspeed", Strings.autoFixed(amount * 60f / reload, 2)));
t.row();
if(healPercent > 0f){
t.row();
t.add(Core.bundle.format("bullet.healpercent", Strings.autoFixed(healPercent, 2)));
}
if(sameTypeHealMult != 1f){
t.row();
t.add(abilityStat("sametypehealmultiplier", (sameTypeHealMult < 1f ? "[negstat]" : "") + Strings.autoFixed(sameTypeHealMult * 100f, 2)));
@@ -53,7 +64,7 @@ public class RepairFieldAbility extends Ability{
wasHealed = true;
}
float healMult = unit.type == other.type ? sameTypeHealMult : 1f;
other.heal(amount * healMult);
other.heal((amount + healPercent / 100f * other.maxHealth()) * healMult);
});
if(wasHealed){