diff --git a/core/src/mindustry/entities/comp/StatusComp.java b/core/src/mindustry/entities/comp/StatusComp.java index 89ed591fab..f029dfade1 100644 --- a/core/src/mindustry/entities/comp/StatusComp.java +++ b/core/src/mindustry/entities/comp/StatusComp.java @@ -19,7 +19,7 @@ abstract class StatusComp implements Posc, Flyingc{ private Seq statuses = new Seq<>(); private transient Bits applied = new Bits(content.getBy(ContentType.status).size); - @ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, healthMultiplier = 1, reloadMultiplier = 1, buildSpeedMultiplier = 1; + @ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, healthMultiplier = 1, reloadMultiplier = 1, buildSpeedMultiplier = 1, dragMultiplier = 1; @ReadOnly transient boolean disarmed = false; @Import UnitType type; @@ -116,7 +116,7 @@ abstract class StatusComp implements Posc, Flyingc{ } applied.clear(); - speedMultiplier = damageMultiplier = healthMultiplier = reloadMultiplier = buildSpeedMultiplier = 1f; + speedMultiplier = damageMultiplier = healthMultiplier = reloadMultiplier = buildSpeedMultiplier = dragMultiplier = 1f; disarmed = false; if(statuses.isEmpty()) return; @@ -140,6 +140,7 @@ abstract class StatusComp implements Posc, Flyingc{ damageMultiplier *= entry.effect.damageMultiplier; reloadMultiplier *= entry.effect.reloadMultiplier; buildSpeedMultiplier *= entry.effect.buildSpeedMultiplier; + dragMultiplier *= entry.effect.dragMultiplier; disarmed |= entry.effect.disarm; diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 9efd20f9fc..d221d6d97a 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -34,7 +34,7 @@ import static mindustry.logic.GlobalConstants.*; abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, Itemsc, Rotc, Unitc, Weaponsc, Drawc, Boundedc, Syncc, Shieldc, Commanderc, Displayable, Senseable, Ranged, Minerc, Builderc{ @Import boolean hovering, dead, disarmed; - @Import float x, y, rotation, elevation, maxHealth, drag, armor, hitSize, health, ammo, minFormationSpeed; + @Import float x, y, rotation, elevation, maxHealth, drag, armor, hitSize, health, ammo, minFormationSpeed, dragMultiplier; @Import Team team; @Import int id; @Import @Nullable Tile mineTile; @@ -325,7 +325,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I } } - drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f); + drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f) * dragMultiplier; //apply knockback based on spawns if(team != state.rules.waveTeam && state.hasSpawns() && (!net.client() || isLocal())){ diff --git a/core/src/mindustry/type/StatusEffect.java b/core/src/mindustry/type/StatusEffect.java index a77517e3e1..9bf1ee74fd 100644 --- a/core/src/mindustry/type/StatusEffect.java +++ b/core/src/mindustry/type/StatusEffect.java @@ -24,6 +24,8 @@ public class StatusEffect extends UnlockableContent{ public float reloadMultiplier = 1f; /** Unit build speed multiplier. */ public float buildSpeedMultiplier = 1f; + /** Unit drag multiplier. */ + public float dragMultiplier = 1f; /** Damage dealt upon transition to an affinity. */ public float transitionDamage = 0f; /** Unit weapon(s) disabled. */