From a51c6c35247d7546ce86033423ec4962cd1f6b64 Mon Sep 17 00:00:00 2001 From: EggleEgg <125359838+EggleEgg@users.noreply.github.com> Date: Sat, 6 Sep 2025 16:31:23 +0200 Subject: [PATCH] Same type mult for repair field ability (#11205) * breh * do not display if 1 * Update core/src/mindustry/entities/abilities/RepairFieldAbility.java Co-authored-by: Jason <131086642+JasonP01@users.noreply.github.com> * Update core/src/mindustry/entities/abilities/RepairFieldAbility.java --------- Co-authored-by: Jason <131086642+JasonP01@users.noreply.github.com> Co-authored-by: Anuken --- .../mindustry/entities/abilities/RepairFieldAbility.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/abilities/RepairFieldAbility.java b/core/src/mindustry/entities/abilities/RepairFieldAbility.java index 7c871978cc..486a11980b 100644 --- a/core/src/mindustry/entities/abilities/RepairFieldAbility.java +++ b/core/src/mindustry/entities/abilities/RepairFieldAbility.java @@ -14,6 +14,8 @@ public class RepairFieldAbility extends Ability{ public Effect healEffect = Fx.heal; public Effect activeEffect = Fx.healWaveDynamic; public boolean parentizeEffects = false; + /** Multiplies healing to units of the same type by this amount. */ + public float sameTypeHealMult = 1f; protected float timer; protected boolean wasHealed = false; @@ -32,6 +34,10 @@ 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))); + if(sameTypeHealMult != 1f){ + t.row(); + t.add(abilityStat("sametypehealmultiplier", (sameTypeHealMult < 1f ? "[negstat]" : "") + Strings.autoFixed(sameTypeHealMult * 100f, 2))); + } } @Override @@ -46,7 +52,8 @@ public class RepairFieldAbility extends Ability{ healEffect.at(other, parentizeEffects); wasHealed = true; } - other.heal(amount); + float healMult = unit.type == other.type ? sameTypeHealMult : 1f; + other.heal(amount * healMult); }); if(wasHealed){