From eab226f04d19f9ecb756065b895c30ca84fe7fe7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 31 Mar 2018 15:30:06 -0400 Subject: [PATCH] Organized FX --- core/assets/version.properties | 2 +- .../io/anuke/mindustry/content/Weapons.java | 14 +- .../content/blocks/CraftingBlocks.java | 20 +- .../content/blocks/DefenseBlocks.java | 6 +- .../mindustry/content/blocks/PowerBlocks.java | 4 +- .../content/blocks/ProductionBlocks.java | 16 +- .../content/blocks/WeaponBlocks.java | 14 +- .../anuke/mindustry/entities/BulletType.java | 36 +- .../io/anuke/mindustry/entities/Player.java | 13 +- .../anuke/mindustry/entities/TileEntity.java | 2 +- .../anuke/mindustry/entities/effect/EMP.java | 4 +- .../mindustry/entities/effect/TeslaOrb.java | 4 +- .../entities/units/FlyingUnitType.java | 4 +- .../mindustry/entities/units/UnitType.java | 4 +- .../io/anuke/mindustry/graphics/BlockFx.java | 5 - .../mindustry/graphics/BlockRenderer.java | 15 +- .../anuke/mindustry/graphics/ExplosionFx.java | 5 - core/src/io/anuke/mindustry/graphics/Fx.java | 608 ------------------ .../io/anuke/mindustry/graphics/TurretFx.java | 5 - .../anuke/mindustry/graphics/fx/BlockFx.java | 216 +++++++ .../anuke/mindustry/graphics/fx/BulletFx.java | 183 ++++++ .../mindustry/graphics/fx/ExplosionFx.java | 45 ++ .../io/anuke/mindustry/graphics/fx/Fx.java | 77 +++ core/src/io/anuke/mindustry/world/Block.java | 4 +- .../io/anuke/mindustry/world/Placement.java | 2 +- .../world/blocks/types/defense/Door.java | 6 +- .../blocks/types/defense/LaserTurret.java | 4 +- .../blocks/types/defense/ShieldBlock.java | 4 +- .../world/blocks/types/defense/Turret.java | 2 +- .../blocks/types/power/BurnerGenerator.java | 4 +- .../types/power/LiquidBurnerGenerator.java | 4 +- .../blocks/types/power/NuclearReactor.java | 13 +- .../blocks/types/power/PowerGenerator.java | 12 +- .../blocks/types/production/Cultivator.java | 2 +- .../world/blocks/types/production/Drill.java | 6 +- .../types/production/GenericCrafter.java | 5 +- .../blocks/types/production/PowerSmelter.java | 6 +- .../blocks/types/production/Smelter.java | 4 +- .../blocks/types/production/SolidPump.java | 2 +- .../blocks/types/production/UnitFactory.java | 4 +- 40 files changed, 652 insertions(+), 734 deletions(-) delete mode 100644 core/src/io/anuke/mindustry/graphics/BlockFx.java delete mode 100644 core/src/io/anuke/mindustry/graphics/ExplosionFx.java delete mode 100644 core/src/io/anuke/mindustry/graphics/Fx.java delete mode 100644 core/src/io/anuke/mindustry/graphics/TurretFx.java create mode 100644 core/src/io/anuke/mindustry/graphics/fx/BlockFx.java create mode 100644 core/src/io/anuke/mindustry/graphics/fx/BulletFx.java create mode 100644 core/src/io/anuke/mindustry/graphics/fx/ExplosionFx.java create mode 100644 core/src/io/anuke/mindustry/graphics/fx/Fx.java diff --git a/core/assets/version.properties b/core/assets/version.properties index 257ca8500e..9562894511 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,5 +1,5 @@ #Autogenerated file. Do not modify. -#Sat Mar 31 14:50:44 EDT 2018 +#Sat Mar 31 15:29:43 EDT 2018 version=release androidBuildCode=766 name=Mindustry diff --git a/core/src/io/anuke/mindustry/content/Weapons.java b/core/src/io/anuke/mindustry/content/Weapons.java index 52a8462fdf..d5bcb962a8 100644 --- a/core/src/io/anuke/mindustry/content/Weapons.java +++ b/core/src/io/anuke/mindustry/content/Weapons.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.content; import io.anuke.mindustry.entities.BulletType; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.resource.Weapon; public class Weapons { @@ -9,20 +9,20 @@ public class Weapons { blaster = new Weapon("blaster", 12, BulletType.shot) { { - effect = Fx.laserShoot; + effect = BulletFx.laserShoot; length = 2f; } }, triblaster = new Weapon("triblaster", 16, BulletType.spread) { { shots = 3; - effect = Fx.spreadShoot; + effect = BulletFx.spreadShoot; roundrobin = true; } }, clustergun = new Weapon("clustergun", 26f, BulletType.cluster) { { - effect = Fx.clusterShoot; + effect = BulletFx.clusterShoot; inaccuracy = 17f; roundrobin = true; shots = 2; @@ -31,7 +31,7 @@ public class Weapons { }, beam = new Weapon("beam", 30f, BulletType.beamlaser) { { - effect = Fx.beamShoot; + effect = BulletFx.beamShoot; inaccuracy = 0; roundrobin = true; shake = 2f; @@ -39,7 +39,7 @@ public class Weapons { }, vulcan = new Weapon("vulcan", 5, BulletType.vulcan) { { - effect = Fx.vulcanShoot; + effect = BulletFx.vulcanShoot; inaccuracy = 5; roundrobin = true; shake = 1f; @@ -49,7 +49,7 @@ public class Weapons { shockgun = new Weapon("shockgun", 36, BulletType.shockshell) { { shootsound = "bigshot"; - effect = Fx.shockShoot; + effect = BulletFx.shockShoot; shake = 2f; roundrobin = true; shots = 7; diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index d68018e394..59b7ffb7eb 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.world.Block; @@ -32,7 +32,7 @@ public class CraftingBlocks { siliconsmelter = new PowerSmelter("siliconsmelter") {{ health = 90; - craftEffect = Fx.smeltsmoke; + craftEffect = BlockFx.smeltsmoke; inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)}; result = Items.silicon; powerUse = 0.05f; @@ -44,7 +44,7 @@ public class CraftingBlocks { poweralloysmelter = new PowerSmelter("poweralloysmelter") {{ health = 90; - craftEffect = Fx.smeltsmoke; + craftEffect = BlockFx.smeltsmoke; inputs = new ItemStack[]{new ItemStack(Items.titanium, 4), new ItemStack(Items.thorium, 4)}; result = Items.densealloy; powerUse = 0.3f; @@ -54,7 +54,7 @@ public class CraftingBlocks { powersmelter = new PowerSmelter("powersmelter") {{ health = 90; - craftEffect = Fx.smeltsmoke; + craftEffect = BlockFx.smeltsmoke; inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.iron, 1)}; result = Items.steel; powerUse = 0.1f; @@ -140,8 +140,8 @@ public class CraftingBlocks { size = 2; health = 320; hasPower = hasLiquids = true; - craftEffect = Fx.formsmoke; - updateEffect = Fx.plasticburn; + craftEffect = BlockFx.formsmoke; + updateEffect = BlockFx.plasticburn; }}, biomatterCompressor = new Compressor("biomattercompressor") {{ @@ -163,9 +163,9 @@ public class CraftingBlocks { powerUse = 0.2f; output = Items.sand; health = 80; - craftEffect = Fx.pulverize; + craftEffect = BlockFx.pulverize; craftTime = 60f; - updateEffect = Fx.pulverizeSmall; + updateEffect = BlockFx.pulverizeSmall; hasInventory = hasPower = true; }}, @@ -176,7 +176,7 @@ public class CraftingBlocks { liquidCapacity = 56f; output = Items.coal; health = 80; - craftEffect = Fx.purifyoil; + craftEffect = BlockFx.purifyoil; hasInventory = hasLiquids = hasPower = true; }}, @@ -187,7 +187,7 @@ public class CraftingBlocks { craftTime = 12; output = Items.stone; health = 80; - craftEffect = Fx.purifystone; + craftEffect = BlockFx.purifystone; }}, weaponFactory = new WeaponFactory("weaponfactory") {{ diff --git a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java index 863c9ee7fa..3af61d154e 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.types.Wall; import io.anuke.mindustry.world.blocks.types.defense.*; @@ -58,8 +58,8 @@ public class DefenseBlocks { }}, largedoor = new Door("door-large") {{ - openfx = Fx.dooropenlarge; - closefx = Fx.doorcloselarge; + openfx = BlockFx.dooropenlarge; + closefx = BlockFx.doorcloselarge; health = 90 * 4 * wallHealthMultiplier; size = 2; }}; diff --git a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java index cead256b36..6f58e095f2 100644 --- a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.types.defense.RepairTurret; import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock; @@ -20,7 +20,7 @@ public class PowerBlocks { maxLiquidGenerate = 0.5f; powerPerLiquid = 0.08f; powerCapacity = 40f; - generateEffect = Fx.redgeneratespark; + generateEffect = BlockFx.redgeneratespark; }}, combustiongenerator = new LiquidBurnerGenerator("combustiongenerator") {{ diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java index 43e31413fc..03200fe977 100644 --- a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.types.production.Cultivator; import io.anuke.mindustry.world.blocks.types.production.Drill; @@ -39,8 +39,8 @@ public class ProductionBlocks { powerUse = 0.2f; hasPower = true; tier = 5; - updateEffect = Fx.pulverizeMedium; - drillEffect = Fx.mineBig; + updateEffect = BlockFx.pulverizeMedium; + drillEffect = BlockFx.mineBig; }}, nucleardrill = new Drill("nucleardrill") {{ @@ -50,9 +50,9 @@ public class ProductionBlocks { drawRim = true; hasPower = true; tier = 5; - updateEffect = Fx.pulverizeRed; + updateEffect = BlockFx.pulverizeRed; updateEffectChance = 0.03f; - drillEffect = Fx.mineHuge; + drillEffect = BlockFx.mineHuge; rotateSpeed = 6f; warmupSpeed = 0.01f; }}, @@ -70,9 +70,9 @@ public class ProductionBlocks { tier = 5; rotateSpeed = 9f; drawRim = true; - updateEffect = Fx.pulverizeRedder; + updateEffect = BlockFx.pulverizeRedder; updateEffectChance = 0.04f; - drillEffect = Fx.mineHuge; + drillEffect = BlockFx.mineHuge; warmupSpeed = 0.005f; }}, @@ -88,7 +88,7 @@ public class ProductionBlocks { oilextractor = new Fracker("oilextractor") {{ result = Liquids.oil; inputLiquid = Liquids.water; - updateEffect = Fx.pulverize; + updateEffect = BlockFx.pulverize; updateEffectChance = 0.05f; inputLiquidUse = 0.3f; powerUse = 0.6f; diff --git a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java index b5df92fc3f..657adb52d2 100644 --- a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java @@ -5,7 +5,7 @@ import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.effect.TeslaOrb; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.defense.LaserTurret; @@ -68,7 +68,7 @@ public class WeaponBlocks{ bullet = BulletType.sniper; ammo = Items.steel; health = 70; - shootEffect = Fx.railshot; + shootEffect = BulletFx.railshot; } }, @@ -84,7 +84,7 @@ public class WeaponBlocks{ ammo = Items.coal; ammoMultiplier = 5; health = 110; - shootEffect = Fx.mortarshot; + shootEffect = BulletFx.mortarshot; shootShake = 2f; size = 2; } @@ -161,7 +161,7 @@ public class WeaponBlocks{ shootCone = 9f; ammoMultiplier = 8; shots = 2; - shootEffect = Fx.chainshot; + shootEffect = BulletFx.chainshot; } @Override @@ -194,7 +194,7 @@ public class WeaponBlocks{ size = 3; rotatespeed = 0.07f; shootCone = 9f; - shootEffect = Fx.titanshot; + shootEffect = BulletFx.titanshot; shootShake = 3f; } }, @@ -211,7 +211,7 @@ public class WeaponBlocks{ size = 3; rotatespeed = 0.07f; shootCone = 9f; - shootEffect = Fx.titanshot; + shootEffect = BulletFx.titanshot; shootShake = 3f; } }, @@ -227,7 +227,7 @@ public class WeaponBlocks{ size = 2; rotatespeed = 0.07f; shootCone = 9f; - shootEffect = Fx.titanshot; + shootEffect = BulletFx.titanshot; shootShake = 3f; } }; diff --git a/core/src/io/anuke/mindustry/entities/BulletType.java b/core/src/io/anuke/mindustry/entities/BulletType.java index 6daceb485f..acbdfa9144 100644 --- a/core/src/io/anuke/mindustry/entities/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/BulletType.java @@ -3,7 +3,9 @@ package io.anuke.mindustry.entities; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.effect.DamageArea; import io.anuke.mindustry.entities.effect.EMP; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; +import io.anuke.mindustry.graphics.fx.BulletFx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.BaseBulletType; @@ -12,7 +14,7 @@ import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Mathf; -import static io.anuke.mindustry.graphics.Fx.*; +import static io.anuke.mindustry.graphics.fx.Fx.*; public abstract class BulletType extends BaseBulletType{ @@ -52,7 +54,7 @@ public abstract class BulletType extends BaseBulletType{ public void update(Bullet b){ if(b.timer.get(0, 4)){ - Effects.effect(Fx.railsmoke, b.x, b.y); + Effects.effect(BulletFx.railsmoke, b.x, b.y); } } }, @@ -73,7 +75,7 @@ public abstract class BulletType extends BaseBulletType{ public void update(Bullet b){ if(b.timer.get(0, 2)){ - Effects.effect(Fx.empspark, b.x + Mathf.range(2), b.y + Mathf.range(2)); + Effects.effect(BulletFx.empspark, b.x + Mathf.range(2), b.y + Mathf.range(2)); } } @@ -83,7 +85,7 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Timers.run(5f, ()-> new EMP(b.x, b.y, b.getDamage()).add()); - Effects.effect(Fx.empshockwave, b); + Effects.effect(BulletFx.empshockwave, b); Effects.shake(3f, 3f, b); } }, @@ -118,8 +120,8 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Effects.shake(3f, 3f, b); - Effects.effect(Fx.shellsmoke, b); - Effects.effect(Fx.shellexplosion, b); + Effects.effect(BulletFx.shellsmoke, b); + Effects.effect(BulletFx.shellexplosion, b); DamageArea.damage(b.team, b.x, b.y, 25f, (int)(damage * 2f/3f)); } @@ -146,7 +148,7 @@ public abstract class BulletType extends BaseBulletType{ } public void hit(Bullet b, float hitx, float hity) { - Effects.effect(shellsmoke, b); + Effects.effect(BulletFx.shellsmoke, b); for(int i = 0; i < 3; i ++){ Bullet bullet = new Bullet(flakspark, b, hitx, hity, b.angle() + Mathf.range(120f)); bullet.add(); @@ -198,8 +200,8 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Effects.shake(3f, 3f, b); - Effects.effect(Fx.shellsmoke, b); - Effects.effect(Fx.shockwaveSmall, b); + Effects.effect(BulletFx.shellsmoke, b); + Effects.effect(BulletFx.shockwaveSmall, b); DamageArea.damage(b.team, b.x, b.y, 50f, (int)(damage * 2f/3f)); } @@ -229,8 +231,8 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Effects.shake(3f, 3f, b); - Effects.effect(Fx.shellsmoke, b); - Effects.effect(Fx.shockwaveSmall, b); + Effects.effect(BulletFx.shellsmoke, b); + Effects.effect(BulletFx.shockwaveSmall, b); DamageArea.damage(b.team, b.x, b.y, 25f, (int)(damage * 2f/3f)); } @@ -249,8 +251,8 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Effects.shake(3f, 3f, b); - Effects.effect(Fx.blastsmoke, b); - Effects.effect(Fx.blastexplosion, b); + Effects.effect(BlockFx.blastsmoke, b); + Effects.effect(BulletFx.blastexplosion, b); //TODO remove translation() usage Angles.circleVectors(30, 6f, (nx, ny) -> { @@ -368,7 +370,7 @@ public abstract class BulletType extends BaseBulletType{ public void hit(Bullet b, float hitx, float hity){ Effects.shake(1.5f, 1.5f, b); - Effects.effect(Fx.clusterbomb, b); + Effects.effect(BulletFx.clusterbomb, b); DamageArea.damage(b.team, b.x, b.y, 35f, damage); } @@ -391,7 +393,7 @@ public abstract class BulletType extends BaseBulletType{ public void update(Bullet b){ if(b.timer.get(0, 4)){ - Effects.effect(Fx.chainsmoke, b.x, b.y); + Effects.effect(BulletFx.chainsmoke, b.x, b.y); } } }, @@ -449,7 +451,7 @@ public abstract class BulletType extends BaseBulletType{ } public void init(Bullet b) { - DamageArea.damageLine(b.team, Fx.beamhit, b.x, b.y, b.angle(), length, damage); + DamageArea.damageLine(b.team, BulletFx.beamhit, b.x, b.y, b.angle(), length, damage); } public void draw(Bullet b) { diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 474fab4e73..7b93bd8693 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -6,7 +6,8 @@ import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.ExplosionFx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.resource.Mech; @@ -109,7 +110,7 @@ public class Player extends Unit{ NetEvents.handleUnitDeath(this); } - Effects.effect(Fx.explosion, this); + Effects.effect(ExplosionFx.explosion, this); Effects.shake(4f, 5f, this); Effects.sound("die", this); @@ -120,7 +121,7 @@ public class Player extends Unit{ @Override public void onRemoteDeath(){ dead = true; - Effects.effect(Fx.explosion, this); + Effects.effect(ExplosionFx.explosion, this); Effects.shake(4f, 5f, this); Effects.sound("die", this); @@ -245,7 +246,7 @@ public class Player extends Unit{ } if(dashing && timer.get(timerDash, 3) && movement.len() > 0){ - Effects.effect(Fx.dashsmoke, x + Angles.trnsx(rotation + 180f, 3f), y + Angles.trnsy(rotation + 180f, 3f)); + Effects.effect(Fx.dash, x + Angles.trnsx(rotation + 180f, 3f), y + Angles.trnsy(rotation + 180f, 3f)); } movement.limit(speed); @@ -357,11 +358,11 @@ public class Player extends Unit{ float ty = y + Angles.trnsy(rotation + 180f, 4f); if(mech.flying && i.target.dst(i.last) > 2f && timer.get(timerDash, 1)){ - Effects.effect(Fx.dashsmoke, tx, ty); + Effects.effect(Fx.dash, tx, ty); } if(dashing && !dead && timer.get(timerDash, 3) && i.target.dst(i.last) > 1f){ - Effects.effect(Fx.dashsmoke, tx, ty); + Effects.effect(Fx.dash, tx, ty); } } diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index d863ed3311..eb457fc1a5 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.entities; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.world.Block; diff --git a/core/src/io/anuke/mindustry/entities/effect/EMP.java b/core/src/io/anuke/mindustry/entities/effect/EMP.java index 6e037f16b2..00983f25cb 100644 --- a/core/src/io/anuke/mindustry/entities/effect/EMP.java +++ b/core/src/io/anuke/mindustry/entities/effect/EMP.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.entities.effect; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects; import io.anuke.ucore.entities.TimedEntity; @@ -61,7 +61,7 @@ public class EMP extends TimedEntity{ if(tile == null) continue; //entity may be null here, after the block is dead! - Effects.effect(Fx.empspark, tile.worldx(), tile.worldy()); + Effects.effect(BulletFx.empspark, tile.worldx(), tile.worldy()); if(tile.entity != null) tile.entity.damage(damage); } } diff --git a/core/src/io/anuke/mindustry/entities/effect/TeslaOrb.java b/core/src/io/anuke/mindustry/entities/effect/TeslaOrb.java index 8ad021d36e..2cf4e1fceb 100644 --- a/core/src/io/anuke/mindustry/entities/effect/TeslaOrb.java +++ b/core/src/io/anuke/mindustry/entities/effect/TeslaOrb.java @@ -8,7 +8,7 @@ import com.badlogic.gdx.utils.ObjectSet; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.Entity; @@ -70,7 +70,7 @@ public class TeslaOrb extends Entity{ void damageEnemy(BaseUnit enemy){ enemy.damage(damage); - Effects.effect(Fx.laserhit, enemy.x + Mathf.range(2f), enemy.y + Mathf.range(2f)); + Effects.effect(BulletFx.laserhit, enemy.x + Mathf.range(2f), enemy.y + Mathf.range(2f)); } @Override diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java index 0df3262e29..8da49b4206 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.ObjectSet; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.TeamInfo.TeamData; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; @@ -34,7 +34,7 @@ public class FlyingUnitType extends UnitType { unit.rotation = unit.velocity.angle(); if(unit.velocity.len() > 0.2f && unit.timer.get(timerBoost, 2f)){ - Effects.effect(Fx.dashsmoke, unit.x + Angles.trnsx(unit.rotation + 180f, boosterLength), + Effects.effect(Fx.dash, unit.x + Angles.trnsx(unit.rotation + 180f, boosterLength), unit.y + Angles.trnsy(unit.rotation + 180f, boosterLength)); } } diff --git a/core/src/io/anuke/mindustry/entities/units/UnitType.java b/core/src/io/anuke/mindustry/entities/units/UnitType.java index 616070876c..503130759b 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitType.java @@ -5,7 +5,7 @@ import io.anuke.mindustry.entities.Bullet; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.ExplosionFx; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.ucore.core.Effects; @@ -111,7 +111,7 @@ public abstract class UnitType { public void onDeath(BaseUnit unit){ //TODO other things, such as enemies? - Effects.effect(Fx.explosion, unit); + Effects.effect(ExplosionFx.explosion, unit); if(Net.server()){ NetEvents.handleUnitDeath(unit); diff --git a/core/src/io/anuke/mindustry/graphics/BlockFx.java b/core/src/io/anuke/mindustry/graphics/BlockFx.java deleted file mode 100644 index 884b7bf0cf..0000000000 --- a/core/src/io/anuke/mindustry/graphics/BlockFx.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.anuke.mindustry.graphics; - -public class BlockFx { - //TODO -} diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index 6b5322f052..acf97a0c80 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -30,6 +30,7 @@ public class BlockRenderer{ private CacheBatch cbatch; private Array requests = new Array(initialRequests); + private Layer lastLayer; private int requestidx = 0; private int iterateidx = 0; @@ -57,6 +58,7 @@ public class BlockRenderer{ /**Process all blocks to draw, simultaneously drawing block shadows and static blocks.*/ public void processBlocks(){ requestidx = 0; + lastLayer = null; int crangex = (int) (camera.viewportWidth / (chunksize * tilesize)) + 1; int crangey = (int) (camera.viewportHeight / (chunksize * tilesize)) + 1; @@ -131,6 +133,11 @@ public class BlockRenderer{ BlockRequest req = requests.get(iterateidx); Block block = req.tile.block(); + if(req.layer != lastLayer){ + if(lastLayer != null) layerEnds(lastLayer); + layerBegins(req.layer); + } + if(req.layer == Layer.block){ block.draw(req.tile); }else if(req.layer == block.layer){ @@ -138,6 +145,8 @@ public class BlockRenderer{ }else if(req.layer == block.layer2){ block.drawLayer2(req.tile); } + + lastLayer = req.layer; } } @@ -170,7 +179,11 @@ public class BlockRenderer{ } } } - + + private void layerBegins(Layer layer){} + + private void layerEnds(Layer layer){} + private void addRequest(Tile tile, Layer layer){ if(requestidx >= requests.size){ requests.add(new BlockRequest()); diff --git a/core/src/io/anuke/mindustry/graphics/ExplosionFx.java b/core/src/io/anuke/mindustry/graphics/ExplosionFx.java deleted file mode 100644 index 0bd0d0b345..0000000000 --- a/core/src/io/anuke/mindustry/graphics/ExplosionFx.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.anuke.mindustry.graphics; - -public class ExplosionFx { - //TODO -} diff --git a/core/src/io/anuke/mindustry/graphics/Fx.java b/core/src/io/anuke/mindustry/graphics/Fx.java deleted file mode 100644 index 0dc5ec1f0f..0000000000 --- a/core/src/io/anuke/mindustry/graphics/Fx.java +++ /dev/null @@ -1,608 +0,0 @@ -package io.anuke.mindustry.graphics; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Colors; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.*; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; - -import static io.anuke.mindustry.Vars.respawnduration; -import static io.anuke.mindustry.Vars.tilesize; - -public class Fx{ - public static Color lightRed = Hue.mix(Color.WHITE, Color.FIREBRICK, 0.1f); - public static Color lightOrange = Color.valueOf("f68021"); - public static Color lighterOrange = Color.valueOf("f6e096"); - public static Color whiteOrange = Hue.mix(lightOrange, Color.WHITE, 0.6f); - public static Color whiteYellow = Hue.mix(Color.YELLOW, Color.WHITE, 0.6f); - public static Color lightGray = Color.valueOf("b0b0b0"); - public static Color glowy = Color.valueOf("fdc056"); - public static Color beam = Color.valueOf("9bffbe"); - public static Color beamLight = Color.valueOf("ddffe9"); - public static Color stoneGray = Color.valueOf("8f8f8f"); - - public static final Effect - - none = new Effect(0, 0f, e->{}), - - generatorexplosion = new Effect(28, 40f, e -> { - Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y)->{ - float size = e.fract()*12f + 1f; - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - reactorsmoke = new Effect(17, e -> { - Angles.randLenVectors(e.id, 4, e.ifract()*8f, (x, y)->{ - float size = 1f+e.fract()*5f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - nuclearsmoke = new Effect(40, e -> { - Angles.randLenVectors(e.id, 4, e.ifract()*13f, (x, y)->{ - float size = e.sfract()*4f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - nuclearcloud = new Effect(90, 200f, e -> { - Angles.randLenVectors(e.id, 10, e.powfract()*90f, (x, y)->{ - float size = e.fract()*14f; - Draw.color(Color.LIME, Color.GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - chainshot = new Effect(9f, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Lines.stroke(e.fract()*4f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*7f); - Lines.stroke(e.fract()*2f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); - Draw.reset(); - }), - - mortarshot = new Effect(10f, e -> { - Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); - Lines.stroke(e.fract()*6f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); - Lines.stroke(e.fract()*5f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); - Lines.stroke(e.fract()*1f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); - Draw.reset(); - }), - - railshot = new Effect(9f, e -> { - Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); - Lines.stroke(e.fract()*5f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*8f); - Lines.stroke(e.fract()*4f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); - Lines.stroke(e.fract()*1f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); - Draw.reset(); - }), - - titanshot = new Effect(12f, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Lines.stroke(e.fract()*7f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); - Lines.stroke(e.fract()*4f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); - Lines.stroke(e.fract()*2f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f); - Draw.reset(); - }), - - largeCannonShot = new Effect(11f, e -> { - Draw.color(Color.WHITE, whiteYellow, e.ifract()); - Lines.stroke(e.fract()*6f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); - Lines.stroke(e.fract()*3f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); - Lines.stroke(e.fract()*1f); - Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f); - Draw.reset(); - }), - - shockwave = new Effect(10f, 80f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); - Lines.stroke(e.fract()*2f + 0.2f); - Lines.circle(e.x, e.y, e.ifract()*28f); - Draw.reset(); - }), - - nuclearShockwave = new Effect(10f, 200f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); - Lines.stroke(e.fract()*3f + 0.2f); - Lines.poly(e.x, e.y, 40, e.ifract()*140f); - Draw.reset(); - }), - - shockwaveSmall = new Effect(10f, e -> { - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); - Lines.stroke(e.fract()*2f + 0.1f); - Lines.circle(e.x, e.y, e.ifract()*15f); - Draw.reset(); - }), - - empshockwave = new Effect(7f, e -> { - Draw.color(Color.WHITE, Color.SKY, e.ifract()); - Lines.stroke(e.fract()*2f); - Lines.circle(e.x, e.y, e.ifract()*40f); - Draw.reset(); - }), - - empspark = new Effect(13, e -> { - Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{ - float len = 1f+e.fract()*6f; - Draw.color(Color.SKY); - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len); - Draw.reset(); - }); - }), - - redgeneratespark = new Effect(18, e -> { - Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ - float len = e.fract()*4f; - Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.ifract()); - //Draw.alpha(e.fract()); - Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); - }); - }), - - generatespark = new Effect(18, e -> { - Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ - float len = e.fract()*4f; - Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, len, len); - Draw.reset(); - }); - }), - - fuelburn = new Effect(23, e -> { - Angles.randLenVectors(e.id, 5, e.ifract()*9f, (x, y)->{ - float len = e.fract()*4f; - Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); - 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.ifract()*5f, (x, y)->{ - Draw.color(Color.valueOf("e9ead3"), Color.GRAY, e.ifract()); - Fill.circle(e.x + x, e.y + y, e.fract()*1f); - Draw.reset(); - }); - }), - - pulverize = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ - Draw.color(stoneGray); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); - Draw.reset(); - }); - }), - - pulverizeRed = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ - Draw.color(Color.valueOf("ffa480"), stoneGray, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); - Draw.reset(); - }); - }), - - pulverizeRedder = new Effect(40, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.ifract()*9f, (x, y)->{ - Draw.color(Color.valueOf("ff7b69"), stoneGray, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2.5f + 0.5f, 45); - Draw.reset(); - }); - }), - - pulverizeSmall = new Effect(30, e -> { - Angles.randLenVectors(e.id, 3, e.ifract()*5f, (x, y)->{ - Draw.color(stoneGray); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 1f + 0.5f, 45); - Draw.reset(); - }); - }), - - pulverizeMedium = new Effect(30, e -> { - Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ - Draw.color(stoneGray); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 1f + 0.5f, 45); - Draw.reset(); - }); - }), - - laserspark = new Effect(14, e -> { - Angles.randLenVectors(e.id, 8, 1f + e.ifract()*11f, (x, y)->{ - float len = 1f+e.fract()*5f; - Draw.color(Color.WHITE, Color.CORAL, e.ifract()); - Draw.alpha(e.ifract()/1.3f); - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len); - Draw.reset(); - }); - }), - - shellsmoke = new Effect(20, e -> { - Angles.randLenVectors(e.id, 8, 3f + e.ifract()*17f, (x, y)->{ - float size = 2f+e.fract()*5f; - Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - producesmoke = new Effect(12, e -> { - Angles.randLenVectors(e.id, 8, 4f + e.ifract()*18f, (x, y)->{ - Draw.color(Color.WHITE, Colors.get("accent"), e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, 1f+e.fract()*3f, 45); - Draw.reset(); - }); - }), - - smeltsmoke = new Effect(15, e -> { - Angles.randLenVectors(e.id, 6, 4f + e.ifract()*5f, (x, y)->{ - Draw.color(Color.WHITE, e.color, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fract()*2f, 45); - Draw.reset(); - }); - }), - - formsmoke = new Effect(40, e -> { - Angles.randLenVectors(e.id, 6, 5f + e.ifract()*8f, (x, y)->{ - Draw.color(Color.valueOf("f1e479"), Color.LIGHT_GRAY, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, 0.2f+e.fract()*2f, 45); - Draw.reset(); - }); - }), - - blastsmoke = new Effect(26, e -> { - Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{ - float size = 2f+e.fract()*6f; - Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - lava = new Effect(18, e -> { - Angles.randLenVectors(e.id, 3, 1f + e.ifract()*10f, (x, y)->{ - float size = e.sfract()*4f; - Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - }), - - lavabubble = new Effect(45f, e -> { - Draw.color(Color.ORANGE); - float scl = 0.35f; - Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl)); - Lines.circle(e.x, e.y, e.ifract()*4f); - Draw.reset(); - }), - - oilbubble = new Effect(64f, e -> { - Draw.color(Color.DARK_GRAY); - float scl = 0.25f; - Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl)); - Lines.circle(e.x, e.y, e.ifract()*3f); - Draw.reset(); - }), - - shellexplosion = new Effect(9, e -> { - Lines.stroke(2f - e.ifract()*1.7f); - Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); - Lines.circle(e.x, e.y, 3f + e.ifract() * 9f); - Draw.reset(); - }), - - blastexplosion = new Effect(14, e -> { - Lines.stroke(1.2f - e.ifract()); - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Lines.circle(e.x, e.y, 1.5f + e.ifract() * 9f); - Draw.reset(); - }), - - place = new Effect(16, e -> { - Lines.stroke(3f - e.ifract() * 2f); - Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 3f); - Draw.reset(); - }), - - dooropen = new Effect(10, e -> { - Lines.stroke(e.fract() * 1.6f); - Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 2f); - Draw.reset(); - }), - - doorclose= new Effect(10, e -> { - Lines.stroke(e.fract() * 1.6f); - Lines.square(e.x, e.y, tilesize / 2f + e.fract() * 2f); - Draw.reset(); - }), - - dooropenlarge = new Effect(10, e -> { - Lines.stroke(e.fract() * 1.6f); - Lines.square(e.x, e.y, tilesize + e.ifract() * 2f); - Draw.reset(); - }), - - doorcloselarge = new Effect(10, e -> { - Lines.stroke(e.fract() * 1.6f); - Lines.square(e.x, e.y, tilesize + e.fract() * 2f); - Draw.reset(); - }), - - purify = new Effect(10, e -> { - Draw.color(Color.ROYAL, Color.GRAY, e.ifract()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); - Draw.reset(); - }), - - purifyoil = new Effect(10, e -> { - Draw.color(Color.BLACK, Color.GRAY, e.ifract()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); - Draw.reset(); - }), - - purifystone = new Effect(10, e -> { - Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); - Lines.stroke(2f); - Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); - Draw.reset(); - }), - - generate = new Effect(11, e -> { - Draw.color(Color.ORANGE, Color.YELLOW, e.ifract()); - Lines.stroke(1f); - Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); - Draw.reset(); - }), - - spark = new Effect(10, e -> { - Lines.stroke(1f); - Draw.color(Color.WHITE, Color.GRAY, e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); - Draw.reset(); - }), - - mine = new Effect(20, e -> { - Angles.randLenVectors(e.id, 6, 3f + e.ifract()*6f, (x, y)->{ - Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f, 45); - Draw.reset(); - }); - }), - - mineBig = new Effect(30, e -> { - Angles.randLenVectors(e.id, 6, 4f + e.ifract()*8f, (x, y)->{ - Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.2f, 45); - Draw.reset(); - }); - }), - - mineHuge = new Effect(40, e -> { - Angles.randLenVectors(e.id, 8, 5f + e.ifract()*10f, (x, y)->{ - Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); - Draw.reset(); - }); - }), - - mineMassive = new Effect(50, e -> { - Angles.randLenVectors(e.id, 8, 5f + e.ifract()*14f, (x, y)->{ - Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2.5f + 0.5f, 45); - Draw.reset(); - }); - }), - - sparkbig = new Effect(11, e -> { - Lines.stroke(1f); - Draw.color(lightRed, Color.GRAY, e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 5f, 2.3f, 8); - Draw.reset(); - }), - - smelt = new Effect(20, e -> { - Angles.randLenVectors(e.id, 6, 2f + e.ifract()*5f, (x, y)->{ - Draw.color(Color.WHITE, e.color, e.ifract()); - Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fract()*2f, 45); - Draw.reset(); - }); - }), - - breakBlock = new Effect(12, e -> { - Lines.stroke(2f); - Draw.color(Color.WHITE, Colors.get("break"), e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90); - Draw.reset(); - }), - - hit = new Effect(10, e -> { - Lines.stroke(1f); - Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 3f, 2, 8); - Draw.reset(); - }), - - laserhit = new Effect(10, e -> { - Lines.stroke(1f); - Draw.color(Color.WHITE, Color.SKY, e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 2f, 2, 6); - Draw.reset(); - }), - - shieldhit = new Effect(9, e -> { - Lines.stroke(1f); - Draw.color(Color.WHITE, Color.SKY, e.ifract()); - Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 6); - Lines.stroke(4f*e.fract()); - Lines.circle(e.x, e.y, e.ifract()*14f); - Draw.reset(); - }), - - laserShoot = new Effect(8, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f); - Draw.reset(); - }), - - spreadShoot = new Effect(12, e -> { - Draw.color(Color.WHITE, Color.PURPLE, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f); - Draw.reset(); - }), - - clusterShoot = new Effect(12, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f); - Draw.reset(); - }), - - vulcanShoot = new Effect(8, e -> { - Draw.color(lighterOrange, lightOrange, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f); - Draw.reset(); - }), - - shockShoot = new Effect(8, e -> { - Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f); - Draw.reset(); - }), - - beamShoot = new Effect(8, e -> { - Draw.color(beamLight, beam, e.ifract()); - Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f); - Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f); - Draw.reset(); - }), - - beamhit = new Effect(8, e -> { - Draw.color(beamLight, beam, e.ifract()); - Lines.stroke(e.fract()*3f+0.5f); - Lines.circle(e.x, e.y, e.ifract()*8f); - Lines.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45); - Draw.reset(); - }), - - explosion = new Effect(11, e -> { - Lines.stroke(2f*e.fract()+0.5f); - Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract()); - Lines.circle(e.x, e.y, 5f + e.powfract() * 6f); - - Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); - Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ - Fill.circle(e.x + x, e.y + y, e.fract()*5f + 2.5f); - }); - - Draw.reset(); - }), - - - blockexplosion = new Effect(13, e -> { - Angles.randLenVectors(e.id+1, 8, 5f + e.ifract()*11f, (x, y)->{ - float size = 2f+e.fract()*8f; - Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); - Draw.rect("circle", e.x + x, e.y + y, size, size); - Draw.reset(); - }); - - Lines.stroke(2f*e.fract()+0.4f); - Draw.color(Color.WHITE, Color.ORANGE, e.powfract()); - Lines.circle(e.x, e.y, 2f + e.powfract() * 9f); - - Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); - Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ - Fill.circle(e.x + x, e.y + y, e.fract()*5f + 1f); - }); - - Draw.reset(); - }), - - clusterbomb = new Effect(10f, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); - Lines.stroke(e.fract()*1.5f); - Lines.poly(e.x, e.y, 4, e.fract()*8f); - Lines.circle(e.x, e.y, e.ifract()*14f); - Draw.reset(); - }), - - coreexplosion = new Effect(13, e -> { - Lines.stroke(3f-e.ifract()*2f); - Draw.color(Color.ORANGE, Color.WHITE, e.ifract()); - Lines.spikes(e.x, e.y, 5f + e.ifract() * 40f, 6, 6); - Lines.circle(e.x, e.y, 4f + e.ifract() * 40f); - Draw.reset(); - }), - - smoke = new Effect(100, e -> { - Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.ifract()); - float size = 7f-e.ifract()*7f; - Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); - }), - - railsmoke = new Effect(30, e -> { - Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.ifract()); - float size = e.fract()*4f; - Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); - }), - - chainsmoke = new Effect(30, e -> { - Draw.color(lightGray); - float size = e.fract()*4f; - Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); - }), - - dashsmoke = new Effect(30, e -> { - Draw.color(Color.CORAL, Color.GRAY, e.ifract()); - float size = e.fract()*4f; - Draw.rect("circle", e.x, e.y, size, size); - Draw.reset(); - }), - - spawn = new Effect(23, e -> { - Lines.stroke(2f); - Draw.color(Color.DARK_GRAY, Color.SCARLET, e.ifract()); - Lines.circle(e.x, e.y, 7f - e.ifract() * 6f); - Draw.reset(); - }), - - respawn = new Effect(respawnduration, e -> { - Draw.tcolor(Color.SCARLET); - Draw.tscl(0.25f); - Draw.text("Respawning in " + (int)((e.lifetime-e.time)/60), e.x, e.y); - Draw.tscl(0.5f); - Draw.reset(); - }), - - transfer = new Effect(20, e -> { - Draw.color(Color.SCARLET, Color.CLEAR, e.fract()); - Lines.square(e.x, e.y, 4); - Lines.lineAngle(e.x, e.y, e.rotation, 5f); - Draw.reset(); - }); -} diff --git a/core/src/io/anuke/mindustry/graphics/TurretFx.java b/core/src/io/anuke/mindustry/graphics/TurretFx.java deleted file mode 100644 index d3ee8d8f02..0000000000 --- a/core/src/io/anuke/mindustry/graphics/TurretFx.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.anuke.mindustry.graphics; - -public class TurretFx { - //TODO -} diff --git a/core/src/io/anuke/mindustry/graphics/fx/BlockFx.java b/core/src/io/anuke/mindustry/graphics/fx/BlockFx.java new file mode 100644 index 0000000000..f0ba592d97 --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/fx/BlockFx.java @@ -0,0 +1,216 @@ +package io.anuke.mindustry.graphics.fx; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Colors; +import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Fill; +import io.anuke.ucore.graphics.Lines; +import io.anuke.ucore.util.Angles; + +import static io.anuke.mindustry.Vars.tilesize; + +public class BlockFx { + public static final Effect + + reactorsmoke = new Effect(17, e -> { + Angles.randLenVectors(e.id, 4, e.ifract()*8f, (x, y)->{ + float size = 1f+e.fract()*5f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + nuclearsmoke = new Effect(40, e -> { + Angles.randLenVectors(e.id, 4, e.ifract()*13f, (x, y)->{ + float size = e.sfract()*4f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + nuclearcloud = new Effect(90, 200f, e -> { + Angles.randLenVectors(e.id, 10, e.powfract()*90f, (x, y)->{ + float size = e.fract()*14f; + Draw.color(Color.LIME, Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + redgeneratespark = new Effect(18, e -> { + Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ + float len = e.fract()*4f; + Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.ifract()); + //Draw.alpha(e.fract()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }), + generatespark = new Effect(18, e -> { + Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ + float len = e.fract()*4f; + Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }), + fuelburn = new Effect(23, e -> { + Angles.randLenVectors(e.id, 5, e.ifract()*9f, (x, y)->{ + float len = e.fract()*4f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + 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.ifract()*5f, (x, y)->{ + Draw.color(Color.valueOf("e9ead3"), Color.GRAY, e.ifract()); + Fill.circle(e.x + x, e.y + y, e.fract()*1f); + Draw.reset(); + }); + }), + pulverize = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ + Draw.color(Fx.stoneGray); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); + Draw.reset(); + }); + }), + pulverizeRed = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ + Draw.color(Color.valueOf("ffa480"), Fx.stoneGray, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); + Draw.reset(); + }); + }), + pulverizeRedder = new Effect(40, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.ifract()*9f, (x, y)->{ + Draw.color(Color.valueOf("ff7b69"), Fx.stoneGray, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2.5f + 0.5f, 45); + Draw.reset(); + }); + }), + pulverizeSmall = new Effect(30, e -> { + Angles.randLenVectors(e.id, 3, e.ifract()*5f, (x, y)->{ + Draw.color(Fx.stoneGray); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 1f + 0.5f, 45); + Draw.reset(); + }); + }), + pulverizeMedium = new Effect(30, e -> { + Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{ + Draw.color(Fx.stoneGray); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 1f + 0.5f, 45); + Draw.reset(); + }); + }), + producesmoke = new Effect(12, e -> { + Angles.randLenVectors(e.id, 8, 4f + e.ifract()*18f, (x, y)->{ + Draw.color(Color.WHITE, Colors.get("accent"), e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, 1f+e.fract()*3f, 45); + Draw.reset(); + }); + }), + smeltsmoke = new Effect(15, e -> { + Angles.randLenVectors(e.id, 6, 4f + e.ifract()*5f, (x, y)->{ + Draw.color(Color.WHITE, e.color, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fract()*2f, 45); + Draw.reset(); + }); + }), + formsmoke = new Effect(40, e -> { + Angles.randLenVectors(e.id, 6, 5f + e.ifract()*8f, (x, y)->{ + Draw.color(Color.valueOf("f1e479"), Color.LIGHT_GRAY, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, 0.2f+e.fract()*2f, 45); + Draw.reset(); + }); + }), + blastsmoke = new Effect(26, e -> { + Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{ + float size = 2f+e.fract()*6f; + Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + lava = new Effect(18, e -> { + Angles.randLenVectors(e.id, 3, 1f + e.ifract()*10f, (x, y)->{ + float size = e.sfract()*4f; + Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + dooropen = new Effect(10, e -> { + Lines.stroke(e.fract() * 1.6f); + Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 2f); + Draw.reset(); + }), + doorclose= new Effect(10, e -> { + Lines.stroke(e.fract() * 1.6f); + Lines.square(e.x, e.y, tilesize / 2f + e.fract() * 2f); + Draw.reset(); + }), + dooropenlarge = new Effect(10, e -> { + Lines.stroke(e.fract() * 1.6f); + Lines.square(e.x, e.y, tilesize + e.ifract() * 2f); + Draw.reset(); + }), + doorcloselarge = new Effect(10, e -> { + Lines.stroke(e.fract() * 1.6f); + Lines.square(e.x, e.y, tilesize + e.fract() * 2f); + Draw.reset(); + }), + purify = new Effect(10, e -> { + Draw.color(Color.ROYAL, Color.GRAY, e.ifract()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); + Draw.reset(); + }), + purifyoil = new Effect(10, e -> { + Draw.color(Color.BLACK, Color.GRAY, e.ifract()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); + Draw.reset(); + }), + purifystone = new Effect(10, e -> { + Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); + Lines.stroke(2f); + Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); + Draw.reset(); + }), + generate = new Effect(11, e -> { + Draw.color(Color.ORANGE, Color.YELLOW, e.ifract()); + Lines.stroke(1f); + Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); + Draw.reset(); + }), + mine = new Effect(20, e -> { + Angles.randLenVectors(e.id, 6, 3f + e.ifract()*6f, (x, y)->{ + Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f, 45); + Draw.reset(); + }); + }), + mineBig = new Effect(30, e -> { + Angles.randLenVectors(e.id, 6, 4f + e.ifract()*8f, (x, y)->{ + Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.2f, 45); + Draw.reset(); + }); + }), + mineHuge = new Effect(40, e -> { + Angles.randLenVectors(e.id, 8, 5f + e.ifract()*10f, (x, y)->{ + Draw.color(e.color, Color.LIGHT_GRAY, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45); + Draw.reset(); + }); + }), + smelt = new Effect(20, e -> { + Angles.randLenVectors(e.id, 6, 2f + e.ifract()*5f, (x, y)->{ + Draw.color(Color.WHITE, e.color, e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fract()*2f, 45); + Draw.reset(); + }); + }); +} diff --git a/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java new file mode 100644 index 0000000000..bde5e1c17b --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java @@ -0,0 +1,183 @@ +package io.anuke.mindustry.graphics.fx; + +import com.badlogic.gdx.graphics.Color; +import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Fill; +import io.anuke.ucore.graphics.Lines; +import io.anuke.ucore.graphics.Shapes; +import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; + +public class BulletFx { + public static final Effect + + chainshot = new Effect(9f, e -> { + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Lines.stroke(e.fract()*4f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*7f); + Lines.stroke(e.fract()*2f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); + Draw.reset(); + }), + mortarshot = new Effect(10f, e -> { + Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); + Lines.stroke(e.fract()*6f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); + Lines.stroke(e.fract()*5f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); + Lines.stroke(e.fract()*1f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); + Draw.reset(); + }), + railshot = new Effect(9f, e -> { + Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); + Lines.stroke(e.fract()*5f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*8f); + Lines.stroke(e.fract()*4f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); + Lines.stroke(e.fract()*1f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); + Draw.reset(); + }), + titanshot = new Effect(12f, e -> { + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Lines.stroke(e.fract()*7f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); + Lines.stroke(e.fract()*4f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); + Lines.stroke(e.fract()*2f); + Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f); + Draw.reset(); + }), + shockwaveSmall = new Effect(10f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); + Lines.stroke(e.fract()*2f + 0.1f); + Lines.circle(e.x, e.y, e.ifract()*15f); + Draw.reset(); + }), + empshockwave = new Effect(7f, e -> { + Draw.color(Color.WHITE, Color.SKY, e.ifract()); + Lines.stroke(e.fract()*2f); + Lines.circle(e.x, e.y, e.ifract()*40f); + Draw.reset(); + }), + empspark = new Effect(13, e -> { + Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{ + float len = 1f+e.fract()*6f; + Draw.color(Color.SKY); + Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len); + Draw.reset(); + }); + }), + shellsmoke = new Effect(20, e -> { + Angles.randLenVectors(e.id, 8, 3f + e.ifract()*17f, (x, y)->{ + float size = 2f+e.fract()*5f; + Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + shellexplosion = new Effect(9, e -> { + Lines.stroke(2f - e.ifract()*1.7f); + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); + Lines.circle(e.x, e.y, 3f + e.ifract() * 9f); + Draw.reset(); + }), + blastexplosion = new Effect(14, e -> { + Lines.stroke(1.2f - e.ifract()); + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Lines.circle(e.x, e.y, 1.5f + e.ifract() * 9f); + Draw.reset(); + }), + laserhit = new Effect(10, e -> { + Lines.stroke(1f); + Draw.color(Color.WHITE, Color.SKY, e.ifract()); + Lines.spikes(e.x, e.y, e.ifract() * 2f, 2, 6); + Draw.reset(); + }), + shieldhit = new Effect(9, e -> { + Lines.stroke(1f); + Draw.color(Color.WHITE, Color.SKY, e.ifract()); + Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 6); + Lines.stroke(4f*e.fract()); + Lines.circle(e.x, e.y, e.ifract()*14f); + Draw.reset(); + }), + laserShoot = new Effect(8, e -> { + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f); + Draw.reset(); + }), + spreadShoot = new Effect(12, e -> { + Draw.color(Color.WHITE, Color.PURPLE, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f); + Draw.reset(); + }), + clusterShoot = new Effect(12, e -> { + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f); + Draw.reset(); + }), + vulcanShoot = new Effect(8, e -> { + Draw.color(Fx.lighterOrange, Fx.lightOrange, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f); + Draw.reset(); + }), + shockShoot = new Effect(8, e -> { + Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f); + Draw.reset(); + }), + beamShoot = new Effect(8, e -> { + Draw.color(Fx.beamLight, Fx.beam, e.ifract()); + Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f); + Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f); + Draw.reset(); + }), + beamhit = new Effect(8, e -> { + Draw.color(Fx.beamLight, Fx.beam, e.ifract()); + Lines.stroke(e.fract()*3f+0.5f); + Lines.circle(e.x, e.y, e.ifract()*8f); + Lines.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45); + Draw.reset(); + }), + blockexplosion = new Effect(13, e -> { + Angles.randLenVectors(e.id+1, 8, 5f + e.ifract()*11f, (x, y)->{ + float size = 2f+e.fract()*8f; + Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + + Lines.stroke(2f*e.fract()+0.4f); + Draw.color(Color.WHITE, Color.ORANGE, e.powfract()); + Lines.circle(e.x, e.y, 2f + e.powfract() * 9f); + + Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); + Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ + Fill.circle(e.x + x, e.y + y, e.fract()*5f + 1f); + }); + + Draw.reset(); + }), + clusterbomb = new Effect(10f, e -> { + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Lines.stroke(e.fract()*1.5f); + Lines.poly(e.x, e.y, 4, e.fract()*8f); + Lines.circle(e.x, e.y, e.ifract()*14f); + Draw.reset(); + }), + railsmoke = new Effect(30, e -> { + Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.ifract()); + float size = e.fract()*4f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }), + chainsmoke = new Effect(30, e -> { + Draw.color(Fx.lightGray); + float size = e.fract()*4f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }); +} diff --git a/core/src/io/anuke/mindustry/graphics/fx/ExplosionFx.java b/core/src/io/anuke/mindustry/graphics/fx/ExplosionFx.java new file mode 100644 index 0000000000..8e00937a4c --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/fx/ExplosionFx.java @@ -0,0 +1,45 @@ +package io.anuke.mindustry.graphics.fx; + +import com.badlogic.gdx.graphics.Color; +import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Fill; +import io.anuke.ucore.graphics.Lines; +import io.anuke.ucore.util.Angles; + +public class ExplosionFx { + public static final Effect + + generatorexplosion = new Effect(28, 40f, e -> { + Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y)->{ + float size = e.fract()*12f + 1f; + Draw.color(Color.WHITE, Fx.lightOrange, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }), + shockwave = new Effect(10f, 80f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); + Lines.stroke(e.fract()*2f + 0.2f); + Lines.circle(e.x, e.y, e.ifract()*28f); + Draw.reset(); + }), + nuclearShockwave = new Effect(10f, 200f, e -> { + Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); + Lines.stroke(e.fract()*3f + 0.2f); + Lines.poly(e.x, e.y, 40, e.ifract()*140f); + Draw.reset(); + }), + explosion = new Effect(11, e -> { + Lines.stroke(2f*e.fract()+0.5f); + Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract()); + Lines.circle(e.x, e.y, 5f + e.powfract() * 6f); + + Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); + Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ + Fill.circle(e.x + x, e.y + y, e.fract()*5f + 2.5f); + }); + + Draw.reset(); + }); +} diff --git a/core/src/io/anuke/mindustry/graphics/fx/Fx.java b/core/src/io/anuke/mindustry/graphics/fx/Fx.java new file mode 100644 index 0000000000..9399b9505f --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/fx/Fx.java @@ -0,0 +1,77 @@ +package io.anuke.mindustry.graphics.fx; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Colors; +import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Hue; +import io.anuke.ucore.graphics.Lines; + +import static io.anuke.mindustry.Vars.respawnduration; +import static io.anuke.mindustry.Vars.tilesize; + +public class Fx{ + public static Color lightRed = Hue.mix(Color.WHITE, Color.FIREBRICK, 0.1f); + public static Color lightOrange = Color.valueOf("f68021"); + public static Color lighterOrange = Color.valueOf("f6e096"); + public static Color whiteOrange = Hue.mix(lightOrange, Color.WHITE, 0.6f); + public static Color whiteYellow = Hue.mix(Color.YELLOW, Color.WHITE, 0.6f); + public static Color lightGray = Color.valueOf("b0b0b0"); + public static Color glowy = Color.valueOf("fdc056"); + public static Color beam = Color.valueOf("9bffbe"); + public static Color beamLight = Color.valueOf("ddffe9"); + public static Color stoneGray = Color.valueOf("8f8f8f"); + + public static final Effect + + none = new Effect(0, 0f, e->{}), + + place = new Effect(16, e -> { + Lines.stroke(3f - e.ifract() * 2f); + Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 3f); + Draw.reset(); + }), + + breakBlock = new Effect(12, e -> { + Lines.stroke(2f); + Draw.color(Color.WHITE, Colors.get("break"), e.ifract()); + Lines.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90); + Draw.reset(); + }), + + hit = new Effect(10, e -> { + Lines.stroke(1f); + Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); + Lines.spikes(e.x, e.y, e.ifract() * 3f, 2, 8); + Draw.reset(); + }), + + smoke = new Effect(100, e -> { + Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.ifract()); + float size = 7f-e.ifract()*7f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }), + + dash = new Effect(30, e -> { + Draw.color(Color.CORAL, Color.GRAY, e.ifract()); + float size = e.fract()*4f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }), + + spawn = new Effect(23, e -> { + Lines.stroke(2f); + Draw.color(Color.DARK_GRAY, Color.SCARLET, e.ifract()); + Lines.circle(e.x, e.y, 7f - e.ifract() * 6f); + Draw.reset(); + }), + + respawn = new Effect(respawnduration, e -> { + Draw.tcolor(Color.SCARLET); + Draw.tscl(0.25f); + Draw.text("Respawning in " + (int)((e.lifetime-e.time)/60), e.x, e.y); + Draw.tscl(0.5f); + Draw.reset(); + }); +} diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index e41c9f836d..7bbf059c3c 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -8,7 +8,7 @@ import com.badlogic.gdx.utils.reflect.ClassReflection; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.graphics.DrawLayer; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; @@ -40,7 +40,7 @@ public class Block extends BaseBlock { /**display name*/ public final String formalName; /**played on destroy*/ - public Effect explosionEffect = Fx.blockexplosion; + public Effect explosionEffect = BulletFx.blockexplosion; /**played on destroy*/ public String explosionSound = "break"; /**whether this block has a tile entity that updates*/ diff --git a/core/src/io/anuke/mindustry/world/Placement.java b/core/src/io/anuke/mindustry/world/Placement.java index 234f8c8f82..523b2ab1a7 100644 --- a/core/src/io/anuke/mindustry/world/Placement.java +++ b/core/src/io/anuke/mindustry/world/Placement.java @@ -8,7 +8,7 @@ import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Recipe; import io.anuke.ucore.core.Effects; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java index 65244cd82c..a01970571e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.math.Rectangle; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.Wall; @@ -20,8 +20,8 @@ import static io.anuke.mindustry.Vars.tilesize; public class Door extends Wall{ protected final Rectangle rect = new Rectangle(); - protected Effect openfx = Fx.dooropen; - protected Effect closefx = Fx.doorclose; + protected Effect openfx = BlockFx.dooropen; + protected Effect closefx = BlockFx.doorclose; public Door(String name) { super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java index fbaee4920b..61b882b917 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.MathUtils; import io.anuke.mindustry.entities.Unit; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects; @@ -17,7 +17,7 @@ import io.anuke.ucore.util.Tmp; public class LaserTurret extends PowerTurret{ protected Color beamColor = Color.WHITE.cpy(); - protected Effect hiteffect = Fx.laserhit; + protected Effect hiteffect = BulletFx.laserhit; protected int damage = 4; protected float cone = 15f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java index cbc3bbbc7a..ba5c5158c3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.defense; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.effect.Shield; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Effects; @@ -75,7 +75,7 @@ public class ShieldBlock extends PowerBlock{ } bullet.remove(); - Effects.effect(bullet.damage > 5 ? Fx.shieldhit : Fx.laserhit, bullet); + Effects.effect(bullet.damage > 5 ? BulletFx.shieldhit : BulletFx.laserhit, bullet); if(!headless) renderer.addShieldHit(bullet.x, bullet.y); entity.power.amount -= bullet.getDamage() * powerPerDamage; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java index 19b9bf53ac..ef98075c4c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.*; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.*; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/power/BurnerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/power/BurnerGenerator.java index 44243595c1..a380bde896 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/power/BurnerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/power/BurnerGenerator.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.power; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.BlockBar; @@ -22,7 +22,7 @@ public class BurnerGenerator extends PowerGenerator { protected float minFlammability = 0.2f; protected float powerOutput; protected float itemDuration = 70f; - protected Effect generateEffect = Fx.generatespark; + protected Effect generateEffect = BlockFx.generatespark; protected Color heatColor = Color.valueOf("ff9b59"); public BurnerGenerator(String name) { diff --git a/core/src/io/anuke/mindustry/world/blocks/types/power/LiquidBurnerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/power/LiquidBurnerGenerator.java index baaeac9b4d..4533cbac63 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/power/LiquidBurnerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/power/LiquidBurnerGenerator.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.world.blocks.types.power; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.power.BurnerGenerator.BurnerEntity; @@ -17,7 +17,7 @@ public class LiquidBurnerGenerator extends PowerGenerator { protected float powerPerLiquid = 0.13f; /**Maximum liquid used per frame.*/ protected float maxLiquidGenerate = 0.4f; - protected Effect generateEffect = Fx.generatespark; + protected Effect generateEffect = BlockFx.generatespark; public LiquidBurnerGenerator(String name) { super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/power/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/power/NuclearReactor.java index 02396cee66..42cbeff32b 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/power/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/power/NuclearReactor.java @@ -4,7 +4,8 @@ import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.effect.DamageArea; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; +import io.anuke.mindustry.graphics.fx.ExplosionFx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.BarType; @@ -45,7 +46,7 @@ public class NuclearReactor extends LiquidBurnerGenerator { generateItem = Items.thorium; itemCapacity = 30; liquidCapacity = 50; - explosionEffect = Fx.nuclearShockwave; + explosionEffect = ExplosionFx.nuclearShockwave; powerCapacity = 80f; } @@ -99,7 +100,7 @@ public class NuclearReactor extends LiquidBurnerGenerator { if(entity.heat > smokeThreshold){ float smoke = 1.0f + (entity.heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0 if(Mathf.chance(smoke / 20.0 * Timers.delta())){ - Effects.effect(Fx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f), + Effects.effect(BlockFx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f), tile.worldy() + Mathf.random(size * tilesize / 2f)); } } @@ -132,7 +133,7 @@ public class NuclearReactor extends LiquidBurnerGenerator { Effects.effect(explosionEffect, tile.worldx(), tile.worldy()); for(int i = 0; i < 6; i ++){ Timers.run(Mathf.random(40), () -> { - Effects.effect(Fx.nuclearcloud, tile.worldx(), tile.worldy()); + Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy()); }); } @@ -142,14 +143,14 @@ public class NuclearReactor extends LiquidBurnerGenerator { for(int i = 0; i < 20; i ++){ Timers.run(Mathf.random(50), ()->{ tr.rnd(Mathf.random(40f)); - Effects.effect(Fx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy()); + Effects.effect(ExplosionFx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy()); }); } for(int i = 0; i < 70; i ++){ Timers.run(Mathf.random(80), ()->{ tr.rnd(Mathf.random(120f)); - Effects.effect(Fx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy()); + Effects.effect(BlockFx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy()); }); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/power/PowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/power/PowerGenerator.java index 9f5330b5f4..0397daa8de 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/power/PowerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/power/PowerGenerator.java @@ -2,7 +2,9 @@ package io.anuke.mindustry.world.blocks.types.power; import com.badlogic.gdx.math.GridPoint2; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; +import io.anuke.mindustry.graphics.fx.BulletFx; +import io.anuke.mindustry.graphics.fx.ExplosionFx; import io.anuke.mindustry.world.Edges; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.PowerBlock; @@ -61,13 +63,13 @@ public class PowerGenerator extends PowerBlock { public void onDestroyed(Tile tile){ float x = tile.worldx(), y = tile.worldy(); - Effects.effect(Fx.shellsmoke, x, y); - Effects.effect(Fx.blastsmoke, x, y); + Effects.effect(BulletFx.shellsmoke, x, y); + Effects.effect(BlockFx.blastsmoke, x, y); Timers.run(Mathf.random(8f + Mathf.random(6f)), () -> { Effects.shake(6f, 8f, x, y); - Effects.effect(Fx.generatorexplosion, x, y); - Effects.effect(Fx.shockwave, x, y); + Effects.effect(ExplosionFx.generatorexplosion, x, y); + Effects.effect(ExplosionFx.shockwave, x, y); //TODO better explosion effect! diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Cultivator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Cultivator.java index 5ff422a97c..4e659596b5 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Cultivator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Cultivator.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.TextureRegion; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Timers; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java index 2378a152be..41a40d1729 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Liquid; @@ -45,11 +45,11 @@ public class Drill extends Block{ protected float warmupSpeed = 0.02f; /**Effect played when an item is produced. This is colored.*/ - protected Effect drillEffect = Fx.mine; + protected Effect drillEffect = BlockFx.mine; /**Speed the drill bit rotates at.*/ protected float rotateSpeed = 2f; /**Effect randomly played while drilling.*/ - protected Effect updateEffect = Fx.pulverizeSmall; + protected Effect updateEffect = BlockFx.pulverizeSmall; /**Chance the update effect will appear.*/ protected float updateEffectChance = 0.02f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/GenericCrafter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/GenericCrafter.java index 5d30347c04..7e66c8a831 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/GenericCrafter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/GenericCrafter.java @@ -2,7 +2,8 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.g2d.TextureRegion; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Liquid; @@ -29,7 +30,7 @@ public class GenericCrafter extends Block{ protected float craftTime = 80; protected float powerUse; protected float liquidUse; - protected Effect craftEffect = Fx.purify; + protected Effect craftEffect = BlockFx.purify; protected Effect updateEffect = Fx.none; protected float updateEffectChance = 0.04f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java index fcbf19c460..92c2780658 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.world.BarType; @@ -37,8 +37,8 @@ public class PowerSmelter extends PowerBlock { protected float craftTime = 20f; //time to craft one item, so max 3 items per second by default protected float burnEffectChance = 0.01f; - protected Effect craftEffect = Fx.smelt, - burnEffect = Fx.fuelburn; + protected Effect craftEffect = BlockFx.smelt, + burnEffect = BlockFx.fuelburn; protected Color flameColor = Color.valueOf("ffc999"); protected int capacity = 20; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java index 018ae463fe..44d5f96b6a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.Block; @@ -28,7 +28,7 @@ public class Smelter extends Block{ protected float craftTime = 20f; //time to craft one item, so max 3 items per second by default protected float burnDuration = 50f; //by default, the fuel will burn 45 frames, so that's 2.5 items/fuel at most - protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn; + protected Effect craftEffect = BlockFx.smelt, burnEffect = BlockFx.fuelburn; protected Color flameColor = Color.valueOf("ffb879"); protected int capacity = 20; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java b/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java index 0bff274746..16ae1bfc91 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java b/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java index d5326ce877..bcbc13be28 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java @@ -8,7 +8,7 @@ import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitType; -import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.graphics.fx.BlockFx; import io.anuke.mindustry.graphics.Shaders; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; @@ -139,7 +139,7 @@ public class UnitFactory extends Block { Timers.run(openDuration/1.5f, () -> { entity.buildTime = 0f; Effects.shake(2f, 3f, entity); - Effects.effect(Fx.producesmoke, tile.drawx(), tile.drawy()); + Effects.effect(BlockFx.producesmoke, tile.drawx(), tile.drawy()); BaseUnit unit = new BaseUnit(type, tile.getTeam()); unit.set(tile.drawx(), tile.drawy()).add();