diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 9164029398..272d766bfe 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2726,7 +2726,9 @@ public class Blocks implements ContentList{ range = 170f; + //TODO unfinished, needs damage + proper mechanics shootType = new ContinuousFlameBulletType(){{ + damage = 4f; length = range; }}; shootLength = 7f; diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 4d06a5eec1..37b6c1d6bc 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -549,6 +549,14 @@ public class Fx{ }); }), + hitFlameBeam = new Effect(19, e -> { + color(e.color); + + randLenVectors(e.id, 7, e.finpow() * 11f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fout() * 2 + 0.5f); + }); + }), + hitMeltdown = new Effect(12, e -> { color(Pal.meltdownHit); stroke(e.fout() * 2f); diff --git a/core/src/mindustry/entities/bullet/ContinuousBulletType.java b/core/src/mindustry/entities/bullet/ContinuousBulletType.java index 010eeebacb..a2624e7475 100644 --- a/core/src/mindustry/entities/bullet/ContinuousBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousBulletType.java @@ -10,6 +10,7 @@ public class ContinuousBulletType extends BulletType{ public float shake = 0f; public float damageInterval = 5f; public boolean largeHit = false; + public boolean laserAbsorb = true; { speed = 0f; @@ -53,7 +54,7 @@ public class ContinuousBulletType extends BulletType{ //damage every 5 ticks if(b.timer(1, damageInterval)){ - Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), length, largeHit); + Damage.collideLine(b, b.team, hitEffect, b.x, b.y, b.rotation(), currentLength(b), largeHit, laserAbsorb); } if(shake > 0){ @@ -61,4 +62,8 @@ public class ContinuousBulletType extends BulletType{ } } + public float currentLength(Bullet b){ + return length; + } + } diff --git a/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java b/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java index d1dcc2d5af..248c6a26a6 100644 --- a/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java +++ b/core/src/mindustry/entities/bullet/ContinuousFlameBulletType.java @@ -5,7 +5,6 @@ import arc.graphics.g2d.*; import arc.math.*; import arc.util.*; import mindustry.content.*; -import mindustry.entities.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -42,19 +41,20 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{ { optimalLifeFract = 0.5f; length = 120f; - hitEffect = Fx.hitBeam; + hitEffect = Fx.hitFlameBeam; hitSize = 4; drawSize = 420f; lifetime = 16f; - hitColor = colors[3]; - lightColor = colors[3]; + hitColor = colors[1].cpy().a(1f); + lightColor = hitColor; + //TODO what if, instead of piercing, it stopped at the first target regardless? or maybe 2? + laserAbsorb = false; } @Override public void draw(Bullet b){ float mult = b.fslope(); - float maxLength = length * mult; - float realLength = Damage.findLaserLength(b, maxLength); + float realLength = length * mult; float sin = Mathf.sin(Time.time, oscScl, oscMag); @@ -88,6 +88,11 @@ public class ContinuousFlameBulletType extends ContinuousBulletType{ Draw.reset(); } + @Override + public float currentLength(Bullet b){ + return length * b.fslope(); + } + @Override public void drawLight(Bullet b){ //no light drawn here