From e06d61dcc93119d6a61643376e8218e038321f1d Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 8 Dec 2019 18:38:56 -0500 Subject: [PATCH] FX cleanup --- core/src/io/anuke/mindustry/content/Fx.java | 117 ------------------ .../io/anuke/mindustry/entities/Effects.java | 2 + 2 files changed, 2 insertions(+), 117 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Fx.java b/core/src/io/anuke/mindustry/content/Fx.java index d7aeed4c65..4c31f0bd1a 100644 --- a/core/src/io/anuke/mindustry/content/Fx.java +++ b/core/src/io/anuke/mindustry/content/Fx.java @@ -48,28 +48,24 @@ public class Fx implements ContentList{ Draw.rect(unit.getIconRegion(), e.x, e.y, unit.getIconRegion().getWidth() * Draw.scl * scl, unit.getIconRegion().getWidth() * Draw.scl * scl, 180f); - Draw.reset(); }); commandSend = new Effect(28, e -> { Draw.color(Pal.command); Lines.stroke(e.fout() * 2f); Lines.circle(e.x, e.y, 4f + e.finpow() * 120f); - Draw.color(); }); placeBlock = new Effect(16, e -> { Draw.color(Pal.accent); Lines.stroke(3f - e.fin() * 2f); Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f); - Draw.reset(); }); tapBlock = new Effect(12, e -> { Draw.color(Pal.accent); Lines.stroke(3f - e.fin() * 2f); Lines.circle(e.x, e.y, 4f + (tilesize / 1.5f * e.rotation) * e.fin()); - Draw.reset(); }); breakBlock = new Effect(12, e -> { @@ -80,41 +76,35 @@ public class Fx implements ContentList{ Angles.randLenVectors(e.id, 3 + (int)(e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> { Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation)); }); - Draw.reset(); }); select = new Effect(23, e -> { Draw.color(Pal.accent); Lines.stroke(e.fout() * 3f); Lines.circle(e.x, e.y, 3f + e.fin() * 14f); - Draw.reset(); }); smoke = new Effect(100, e -> { Draw.color(Color.gray, Pal.darkishGray, e.fin()); float size = 7f - e.fin() * 7f; Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); }); magmasmoke = new Effect(110, e -> { Draw.color(Color.gray); Fill.circle(e.x, e.y, e.fslope() * 6f); - Draw.reset(); }); spawn = new Effect(30, e -> { Lines.stroke(2f * e.fout()); Draw.color(Pal.accent); Lines.poly(e.x, e.y, 4, 5f + e.fin() * 12f); - Draw.reset(); }); padlaunch = new Effect(10, e -> { Lines.stroke(4f * e.fout()); Draw.color(Pal.accent); Lines.poly(e.x, e.y, 4, 5f + e.fin() * 60f); - Draw.reset(); }); vtolHover = new Effect(40f, e -> { @@ -122,7 +112,6 @@ public class Fx implements ContentList{ float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f); Draw.color(Pal.lightFlame, Pal.lightOrange, e.fin()); Fill.circle(e.x + Angles.trnsx(ang, len), e.y + Angles.trnsy(ang, len), 2f * e.fout()); - Draw.reset(); }); unitDrop = new GroundEffect(30, e -> { @@ -130,7 +119,6 @@ public class Fx implements ContentList{ Angles.randLenVectors(e.id, 9, 3 + 20f * e.finpow(), (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.4f); }); - Draw.reset(); }); unitLand = new GroundEffect(30, e -> { @@ -138,42 +126,36 @@ public class Fx implements ContentList{ Angles.randLenVectors(e.id, 6, 17f * e.finpow(), (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.3f); }); - Draw.reset(); }); unitPickup = new GroundEffect(18, e -> { Draw.color(Pal.lightishGray); Lines.stroke(e.fin() * 2f); Lines.poly(e.x, e.y, 4, 13f * e.fout()); - Draw.reset(); }); landShock = new GroundEffect(12, e -> { Draw.color(Pal.lancerLaser); Lines.stroke(e.fout() * 3f); Lines.poly(e.x, e.y, 12, 20f * e.fout()); - Draw.reset(); }); pickup = new Effect(18, e -> { Draw.color(Pal.lightishGray); Lines.stroke(e.fout() * 2f); Lines.spikes(e.x, e.y, 1f + e.fin() * 6f, e.fout() * 4f, 6); - Draw.reset(); }); healWave = new Effect(22, e -> { Draw.color(Pal.heal); Lines.stroke(e.fout() * 2f); Lines.circle(e.x, e.y, 4f + e.finpow() * 60f); - Draw.color(); }); heal = new Effect(11, e -> { Draw.color(Pal.heal); Lines.stroke(e.fout() * 2f); Lines.circle(e.x, e.y, 2f + e.finpow() * 7f); - Draw.color(); }); @@ -193,7 +175,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); - Draw.reset(); }); hitFuse = new Effect(14, e -> { @@ -212,7 +193,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); - Draw.reset(); }); hitBulletBig = new Effect(13, e -> { @@ -224,7 +204,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f); }); - Draw.reset(); }); hitFlameSmall = new Effect(14, e -> { @@ -236,7 +215,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); - Draw.reset(); }); hitLiquid = new Effect(16, e -> { @@ -246,7 +224,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 2f); }); - Draw.reset(); }); hitLancer = new Effect(12, e -> { @@ -258,7 +235,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); - Draw.reset(); }); hitMeltdown = new Effect(12, e -> { @@ -270,14 +246,12 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); - Draw.reset(); }); hitLaser = new Effect(8, e -> { Draw.color(Color.white, Pal.heal, e.fin()); Lines.stroke(0.5f + e.fout()); Lines.circle(e.x, e.y, e.fin() * 5f); - Draw.reset(); }); despawn = new Effect(12, e -> { @@ -289,7 +263,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f); }); - Draw.reset(); }); flakExplosion = new Effect(20, e -> { @@ -313,7 +286,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); plasticExplosion = new Effect(24, e -> { @@ -337,7 +309,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); plasticExplosionFlak = new Effect(28, e -> { @@ -361,7 +332,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); blastExplosion = new Effect(22, e -> { @@ -385,32 +355,27 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); artilleryTrail = new Effect(50, e -> { Draw.color(e.color); Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); }); incendTrail = new Effect(50, e -> { Draw.color(Pal.lightOrange); Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); }); missileTrail = new Effect(50, e -> { Draw.color(e.color); Fill.circle(e.x, e.y, e.rotation * e.fout()); - Draw.reset(); }); absorb = new Effect(12, e -> { Draw.color(Pal.accent); Lines.stroke(2f * e.fout()); Lines.circle(e.x, e.y, 5f * e.fout()); - Draw.reset(); }); flakExplosionBig = new Effect(30, e -> { @@ -434,7 +399,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); @@ -445,7 +409,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f); }); - Draw.color(); }); fire = new Effect(50f, e -> { @@ -467,7 +430,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); }); - Draw.color(); }); steam = new Effect(35f, e -> { @@ -477,7 +439,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); }); - Draw.color(); }); fireballsmoke = new Effect(25f, e -> { @@ -487,7 +448,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); }); - Draw.color(); }); ballfire = new Effect(25f, e -> { @@ -497,7 +457,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); }); - Draw.color(); }); freezing = new Effect(40f, e -> { @@ -507,7 +466,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f); }); - Draw.color(); }); melting = new Effect(40f, e -> { @@ -517,7 +475,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f); }); - Draw.color(); }); wet = new Effect(40f, e -> { @@ -527,7 +484,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 1f); }); - Draw.color(); }); oily = new Effect(42f, e -> { @@ -537,7 +493,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 1f); }); - Draw.color(); }); overdriven = new Effect(20f, e -> { @@ -547,7 +502,6 @@ public class Fx implements ContentList{ Fill.square(e.x + x, e.y + y, e.fout() * 2.3f + 0.5f); }); - Draw.color(); }); dropItem = new Effect(20f, e -> { @@ -562,35 +516,30 @@ public class Fx implements ContentList{ Draw.color(Color.white, Color.lightGray, e.fin()); Lines.stroke(e.fout() * 2f + 0.2f); Lines.circle(e.x, e.y, e.fin() * 28f); - Draw.reset(); }); bigShockwave = new Effect(10f, 80f, e -> { Draw.color(Color.white, Color.lightGray, e.fin()); Lines.stroke(e.fout() * 3f); Lines.circle(e.x, e.y, e.fin() * 50f); - Draw.reset(); }); nuclearShockwave = new Effect(10f, 200f, e -> { Draw.color(Color.white, Color.lightGray, e.fin()); Lines.stroke(e.fout() * 3f + 0.2f); Lines.circle(e.x, e.y, e.fin() * 140f); - Draw.reset(); }); impactShockwave = new Effect(13f, 300f, e -> { Draw.color(Pal.lighterOrange, Color.lightGray, e.fin()); Lines.stroke(e.fout() * 4f + 0.2f); Lines.circle(e.x, e.y, e.fin() * 200f); - Draw.reset(); }); spawnShockwave = new Effect(20f, 400f, e -> { Draw.color(Color.white, Color.lightGray, e.fin()); Lines.stroke(e.fout() * 3f + 0.5f); Lines.circle(e.x, e.y, e.fin() * (e.rotation + 50f)); - Draw.reset(); }); explosion = new Effect(30, e -> { @@ -613,7 +562,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); dynamicExplosion = new Effect(30, e -> { @@ -638,7 +586,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + out * 4 * (3f + intensity)); }); - Draw.reset(); }); blockExplosion = new Effect(30, e -> { @@ -661,7 +608,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - Draw.reset(); }); blockExplosionSmoke = new Effect(30, e -> { @@ -672,7 +618,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); }); - Draw.reset(); }); @@ -681,7 +626,6 @@ public class Fx implements ContentList{ float w = 1f + 5 * e.fout(); Drawf.tri(e.x, e.y, w, 15f * e.fout(), e.rotation); Drawf.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f); - Draw.reset(); }); shootHeal = new Effect(8, e -> { @@ -689,7 +633,6 @@ public class Fx implements ContentList{ float w = 1f + 5 * e.fout(); Drawf.tri(e.x, e.y, w, 17f * e.fout(), e.rotation); Drawf.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); - Draw.reset(); }); shootSmallSmoke = new Effect(20f, e -> { @@ -699,7 +642,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); }); - Draw.reset(); }); shootBig = new Effect(9, e -> { @@ -707,7 +649,6 @@ public class Fx implements ContentList{ float w = 1.2f + 7 * e.fout(); Drawf.tri(e.x, e.y, w, 25f * e.fout(), e.rotation); Drawf.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f); - Draw.reset(); }); shootBig2 = new Effect(10, e -> { @@ -715,7 +656,6 @@ public class Fx implements ContentList{ float w = 1.2f + 8 * e.fout(); Drawf.tri(e.x, e.y, w, 29f * e.fout(), e.rotation); Drawf.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f); - Draw.reset(); }); shootBigSmoke = new Effect(17f, e -> { @@ -725,7 +665,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f); }); - Draw.reset(); }); shootBigSmoke2 = new Effect(18f, e -> { @@ -735,7 +674,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f); }); - Draw.reset(); }); shootSmallFlame = new Effect(32f, e -> { @@ -745,7 +683,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); }); - Draw.reset(); }); shootPyraFlame = new Effect(33f, e -> { @@ -755,7 +692,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f); }); - Draw.reset(); }); shootLiquid = new Effect(40f, e -> { @@ -765,7 +701,6 @@ public class Fx implements ContentList{ Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f); }); - Draw.reset(); }); shellEjectSmall = new GroundEffect(30f, 400f, e -> { @@ -780,7 +715,6 @@ public class Fx implements ContentList{ e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), 1f, 2f, rot + e.fin() * 50f * i); - Draw.color(); }); shellEjectMedium = new GroundEffect(34f, 400f, e -> { @@ -804,7 +738,6 @@ public class Fx implements ContentList{ }); } - Draw.color(); }); shellEjectBig = new GroundEffect(22f, 400f, e -> { @@ -829,7 +762,6 @@ public class Fx implements ContentList{ }); } - Draw.color(); }); lancerLaserShoot = new Effect(21f, e -> { @@ -839,7 +771,6 @@ public class Fx implements ContentList{ Drawf.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i); } - Draw.reset(); }); lancerLaserShootSmoke = new Effect(26f, e -> { @@ -849,7 +780,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); }); - Draw.reset(); }); lancerLaserCharge = new Effect(38f, e -> { @@ -859,7 +789,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); }); - Draw.reset(); }); lancerLaserChargeBegin = new Effect(71f, e -> { @@ -877,7 +806,6 @@ public class Fx implements ContentList{ Drawf.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); }); - Draw.reset(); }); lightningShoot = new Effect(12f, e -> { @@ -888,7 +816,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); }); - Draw.reset(); }); @@ -897,7 +824,6 @@ public class Fx implements ContentList{ float size = 1f + e.fout() * 5f; Draw.color(Color.lightGray, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); nuclearsmoke = new Effect(40, e -> { @@ -905,7 +831,6 @@ public class Fx implements ContentList{ float size = e.fslope() * 4f; Draw.color(Color.lightGray, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); nuclearcloud = new Effect(90, 200f, e -> { @@ -913,7 +838,6 @@ public class Fx implements ContentList{ float size = e.fout() * 14f; Draw.color(Color.lime, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); impactsmoke = new Effect(60, e -> { @@ -921,7 +845,6 @@ public class Fx implements ContentList{ float size = e.fslope() * 4f; Draw.color(Color.lightGray, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); impactcloud = new Effect(140, 400f, e -> { @@ -929,7 +852,6 @@ public class Fx implements ContentList{ float size = e.fout() * 15f; Draw.color(Pal.lighterOrange, Color.lightGray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); redgeneratespark = new Effect(18, e -> { @@ -937,7 +859,6 @@ public class Fx implements ContentList{ float len = e.fout() * 4f; Draw.color(Pal.redSpark, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); }); }); generatespark = new Effect(18, e -> { @@ -945,7 +866,6 @@ public class Fx implements ContentList{ float len = e.fout() * 4f; Draw.color(Pal.orangeSpark, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); }); }); fuelburn = new Effect(23, e -> { @@ -953,70 +873,60 @@ public class Fx implements ContentList{ float len = e.fout() * 4f; Draw.color(Color.lightGray, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); }); }); plasticburn = new Effect(40, e -> { Angles.randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { Draw.color(Color.valueOf("e9ead3"), Color.gray, e.fin()); Fill.circle(e.x + x, e.y + y, e.fout() * 1f); - Draw.reset(); }); }); pulverize = new Effect(40, e -> { Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { Draw.color(Pal.stoneGray); Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); }); }); pulverizeRed = new Effect(40, e -> { Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { Draw.color(Pal.redDust, Pal.stoneGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); }); }); pulverizeRedder = new Effect(40, e -> { Angles.randLenVectors(e.id, 5, 3f + e.fin() * 9f, (x, y) -> { Draw.color(Pal.redderDust, Pal.stoneGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45); - Draw.reset(); }); }); pulverizeSmall = new Effect(30, e -> { Angles.randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { Draw.color(Pal.stoneGray); Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); - Draw.reset(); }); }); pulverizeMedium = new Effect(30, e -> { Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { Draw.color(Pal.stoneGray); Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); - Draw.reset(); }); }); producesmoke = new Effect(12, e -> { Angles.randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { Draw.color(Color.white, Pal.accent, e.fin()); Fill.square(e.x + x, e.y + y, 1f + e.fout() * 3f, 45); - Draw.reset(); }); }); smeltsmoke = new Effect(15, e -> { Angles.randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { Draw.color(Color.white, e.color, e.fin()); Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); - Draw.reset(); }); }); formsmoke = new Effect(40, e -> { Angles.randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { Draw.color(Pal.plasticSmoke, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); - Draw.reset(); }); }); blastsmoke = new Effect(26, e -> { @@ -1024,7 +934,6 @@ public class Fx implements ContentList{ float size = 2f + e.fout() * 6f; Draw.color(Color.lightGray, Color.darkGray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); lava = new Effect(18, e -> { @@ -1032,79 +941,66 @@ public class Fx implements ContentList{ float size = e.fslope() * 4f; Draw.color(Color.orange, Color.gray, e.fin()); Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); }); }); dooropen = new Effect(10, e -> { Lines.stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f); - Draw.reset(); }); doorclose = new Effect(10, e -> { Lines.stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f); - Draw.reset(); }); dooropenlarge = new Effect(10, e -> { Lines.stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize + e.fin() * 2f); - Draw.reset(); }); doorcloselarge = new Effect(10, e -> { Lines.stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize + e.fout() * 2f); - Draw.reset(); }); purify = new Effect(10, e -> { Draw.color(Color.royal, Color.gray, e.fin()); Lines.stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); }); purifyoil = new Effect(10, e -> { Draw.color(Color.black, Color.gray, e.fin()); Lines.stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); }); purifystone = new Effect(10, e -> { Draw.color(Color.orange, Color.gray, e.fin()); Lines.stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); - Draw.reset(); }); generate = new Effect(11, e -> { Draw.color(Color.orange, Color.yellow, e.fin()); Lines.stroke(1f); Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8); - Draw.reset(); }); mine = new Effect(20, e -> { Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> { Draw.color(e.color, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45); - Draw.reset(); }); }); mineBig = new Effect(30, e -> { Angles.randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> { Draw.color(e.color, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.2f, 45); - Draw.reset(); }); }); mineHuge = new Effect(40, e -> { Angles.randLenVectors(e.id, 8, 5f + e.fin() * 10f, (x, y) -> { Draw.color(e.color, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); - Draw.reset(); }); }); smelt = new Effect(20, e -> { Angles.randLenVectors(e.id, 6, 2f + e.fin() * 5f, (x, y) -> { Draw.color(Color.white, e.color, e.fin()); Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); - Draw.reset(); }); }); teleportActivate = new Effect(50, e -> { @@ -1121,7 +1017,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); - Draw.reset(); }); teleport = new Effect(60, e -> { Draw.color(e.color); @@ -1132,7 +1027,6 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); - Draw.reset(); }); teleportOut = new Effect(20, e -> { Draw.color(e.color); @@ -1143,13 +1037,11 @@ public class Fx implements ContentList{ Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); }); - Draw.reset(); }); ripple = new GroundEffect(false, 30, e -> { Draw.color(Tmp.c1.set(e.color).mul(1.2f)); Lines.stroke(e.fout() + 0.4f); Lines.circle(e.x, e.y, 2f + e.fin() * 4f); - Draw.reset(); }); bubble = new Effect(20, e -> { @@ -1158,56 +1050,47 @@ public class Fx implements ContentList{ Angles.randLenVectors(e.id, 2, 8f, (x, y) -> { Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f); }); - Draw.reset(); }); launch = new Effect(28, e -> { Draw.color(Pal.command); Lines.stroke(e.fout() * 2f); Lines.circle(e.x, e.y, 4f + e.finpow() * 120f); - Draw.color(); }); healWaveMend = new Effect(40, e -> { Draw.color(e.color); Lines.stroke(e.fout() * 2f); Lines.circle(e.x, e.y, e.finpow() * e.rotation); - Draw.color(); }); overdriveWave = new Effect(50, e -> { Draw.color(e.color); Lines.stroke(e.fout() * 1f); Lines.circle(e.x, e.y, e.finpow() * e.rotation); - Draw.color(); }); healBlock = new Effect(20, e -> { Draw.color(Pal.heal); Lines.stroke(2f * e.fout() + 0.5f); Lines.square(e.x, e.y, 1f + (e.fin() * e.rotation * tilesize / 2f - 1f)); - Draw.color(); }); healBlockFull = new Effect(20, e -> { Draw.color(e.color); Draw.alpha(e.fout()); - Fill.square(e.x, e.y, e.rotation * tilesize / 2f); - Draw.color(); }); overdriveBlockFull = new Effect(60, e -> { Draw.color(e.color); Draw.alpha(e.fslope() * 0.4f); Fill.square(e.x, e.y, e.rotation * tilesize); - Draw.color(); }); shieldBreak = new Effect(40, e -> { Draw.color(Pal.accent); Lines.stroke(3f * e.fout()); Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90); - Draw.reset(); }); coreLand = new Effect(120f, e -> { diff --git a/core/src/io/anuke/mindustry/entities/Effects.java b/core/src/io/anuke/mindustry/entities/Effects.java index 2647fc2427..ca1492bdbf 100644 --- a/core/src/io/anuke/mindustry/entities/Effects.java +++ b/core/src/io/anuke/mindustry/entities/Effects.java @@ -4,6 +4,7 @@ import io.anuke.arc.Core; import io.anuke.arc.collection.Array; import io.anuke.arc.func.Cons; import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.*; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Position; import io.anuke.arc.util.pooling.Pools; @@ -36,6 +37,7 @@ public class Effects{ public static void renderEffect(int id, Effect render, Color color, float life, float rotation, float x, float y, Object data){ container.set(id, color, life, render.lifetime, rotation, x, y, data); render.draw.render(container); + Draw.reset(); } public static Effect getEffect(int id){