diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 676281332d..a945b559cd 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -298,7 +298,7 @@ public class Damage{ * If the shields only absorb part of the damage, the bullet's damage is reduced accordingly. * @return the length of the laser, cut short if a shield absorbed it. */ - private static float findShieldLength(Bullet b, float length, boolean laser, boolean absorb){ + public static float findShieldLength(Bullet b, float length, boolean laser, boolean absorb){ float damage = b.type.shieldDamage(b); if(!(laser || b.type.shieldAbsorb) || length <= 0f || damage <= 0f) return length; diff --git a/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java b/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java index 30dd5011fb..b605a333d2 100644 --- a/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java @@ -50,7 +50,7 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{ hitColor = colors[1].cpy().a(1f); lightColor = hitColor; lightOpacity = 0.7f; - laserAbsorb = false; + laserAbsorb = true; ammoMultiplier = 1f; pierceArmor = true; } diff --git a/core/src/mindustry/entities/bullet/PointLaserBulletType.java b/core/src/mindustry/entities/bullet/PointLaserBulletType.java index ca81ce7ad7..d33e001f96 100644 --- a/core/src/mindustry/entities/bullet/PointLaserBulletType.java +++ b/core/src/mindustry/entities/bullet/PointLaserBulletType.java @@ -79,6 +79,14 @@ public class PointLaserBulletType extends BulletType{ updateTrailEffects(b); updateBulletInterval(b); + float dst = b.dst(b.aimX, b.aimY); + float length = Damage.findShieldLength(b, dst, true, laserAbsorb); + if(length < dst){ + Tmp.v1.set(b.aimX - b.x, b.aimY - b.y).setLength(length); + b.aimX = Tmp.v1.x + b.x; + b.aimY = Tmp.v1.y + b.y; + } + if(b.timer.get(0, damageInterval)){ Damage.collidePoint(b, b.team, hitEffect, b.aimX, b.aimY); } @@ -92,6 +100,11 @@ public class PointLaserBulletType extends BulletType{ } } + @Override + public float shieldDamage(Bullet b){ + return b.damage / damageInterval * Time.delta; + } + @Override public void updateTrailEffects(Bullet b){ if(trailChance > 0){