🦀 FX classes are gone 🦀

This commit is contained in:
Anuken
2019-01-07 17:11:53 -05:00
parent ff52fec663
commit a1a69f62e1
62 changed files with 1011 additions and 1453 deletions
@@ -9,7 +9,6 @@ import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp; import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.content.fx.*;
import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.bullet.*; import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Fire;
@@ -56,7 +55,7 @@ public class Bullets implements ContentList{
public void load(){ public void load(){
artilleryDense = new ArtilleryBulletType(3f, 0, "shell"){{ artilleryDense = new ArtilleryBulletType(3f, 0, "shell"){{
hitEffect = BulletFx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 50f; lifetime = 50f;
bulletWidth = bulletHeight = 11f; bulletWidth = bulletHeight = 11f;
@@ -76,7 +75,7 @@ public class Bullets implements ContentList{
}}; }};
arilleryPlastic = new ArtilleryBulletType(3.3f, 0, "shell"){{ arilleryPlastic = new ArtilleryBulletType(3.3f, 0, "shell"){{
hitEffect = BulletFx.plasticExplosion; hitEffect = Fx.plasticExplosion;
knockback = 1f; knockback = 1f;
lifetime = 55f; lifetime = 55f;
bulletWidth = bulletHeight = 13f; bulletWidth = bulletHeight = 13f;
@@ -90,7 +89,7 @@ public class Bullets implements ContentList{
}}; }};
artilleryHoming = new ArtilleryBulletType(3f, 0, "shell"){{ artilleryHoming = new ArtilleryBulletType(3f, 0, "shell"){{
hitEffect = BulletFx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 45f; lifetime = 45f;
bulletWidth = bulletHeight = 11f; bulletWidth = bulletHeight = 11f;
@@ -102,7 +101,7 @@ public class Bullets implements ContentList{
}}; }};
artlleryIncendiary = new ArtilleryBulletType(3f, 0, "shell"){{ artlleryIncendiary = new ArtilleryBulletType(3f, 0, "shell"){{
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 60f; lifetime = 60f;
bulletWidth = bulletHeight = 13f; bulletWidth = bulletHeight = 13f;
@@ -113,11 +112,11 @@ public class Bullets implements ContentList{
incendSpread = 11f; incendSpread = 11f;
frontColor = Palette.lightishOrange; frontColor = Palette.lightishOrange;
backColor = Palette.lightOrange; backColor = Palette.lightOrange;
trailEffect = BulletFx.incendTrail; trailEffect = Fx.incendTrail;
}}; }};
artilleryExplosive = new ArtilleryBulletType(2f, 0, "shell"){{ artilleryExplosive = new ArtilleryBulletType(2f, 0, "shell"){{
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 70f; lifetime = 70f;
bulletWidth = bulletHeight = 14f; bulletWidth = bulletHeight = 14f;
@@ -129,7 +128,7 @@ public class Bullets implements ContentList{
}}; }};
artilleryUnit = new ArtilleryBulletType(2f, 0, "shell"){{ artilleryUnit = new ArtilleryBulletType(2f, 0, "shell"){{
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 90f; lifetime = 90f;
bulletWidth = bulletHeight = 14f; bulletWidth = bulletHeight = 14f;
@@ -145,7 +144,7 @@ public class Bullets implements ContentList{
splashDamageRadius = 40f; splashDamageRadius = 40f;
fragBullet = artilleryPlasticFrag; fragBullet = artilleryPlasticFrag;
fragBullets = 4; fragBullets = 4;
hitEffect = BulletFx.plasticExplosion; hitEffect = Fx.plasticExplosion;
frontColor = Palette.plastaniumFront; frontColor = Palette.plastaniumFront;
backColor = Palette.plastaniumBack; backColor = Palette.plastaniumBack;
}}; }};
@@ -168,8 +167,8 @@ public class Bullets implements ContentList{
splashDamageRadius = 30f; splashDamageRadius = 30f;
splashDamage = 30f; splashDamage = 30f;
lifetime = 150f; lifetime = 150f;
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = BulletFx.blastExplosion; despawnEffect = Fx.blastExplosion;
}}; }};
missileIncendiary = new MissileBulletType(2f, 12, "missile"){{ missileIncendiary = new MissileBulletType(2f, 12, "missile"){{
@@ -183,7 +182,7 @@ public class Bullets implements ContentList{
splashDamageRadius = 10f; splashDamageRadius = 10f;
splashDamage = 10f; splashDamage = 10f;
lifetime = 160f; lifetime = 160f;
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
incendSpread = 10f; incendSpread = 10f;
incendAmount = 3; incendAmount = 3;
}}; }};
@@ -196,8 +195,8 @@ public class Bullets implements ContentList{
splashDamageRadius = 30f; splashDamageRadius = 30f;
splashDamage = 22f; splashDamage = 22f;
lifetime = 150f; lifetime = 150f;
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = BulletFx.blastExplosion; despawnEffect = Fx.blastExplosion;
lightining = 2; lightining = 2;
lightningLength = 14; lightningLength = 14;
}}; }};
@@ -212,8 +211,8 @@ public class Bullets implements ContentList{
splashDamage = 1f; splashDamage = 1f;
lifetime = 90f; lifetime = 90f;
trailColor = Color.valueOf("b6c6fd"); trailColor = Color.valueOf("b6c6fd");
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = BulletFx.blastExplosion; despawnEffect = Fx.blastExplosion;
backColor = Palette.bulletYellowBack; backColor = Palette.bulletYellowBack;
frontColor = Palette.bulletYellow; frontColor = Palette.bulletYellow;
weaveScale = 8f; weaveScale = 8f;
@@ -233,8 +232,8 @@ public class Bullets implements ContentList{
trailColor = Color.GRAY; trailColor = Color.GRAY;
backColor = Palette.bulletYellowBack; backColor = Palette.bulletYellowBack;
frontColor = Palette.bulletYellow; frontColor = Palette.bulletYellow;
hitEffect = BulletFx.blastExplosion; hitEffect = Fx.blastExplosion;
despawnEffect = BulletFx.blastExplosion; despawnEffect = Fx.blastExplosion;
weaveScale = 8f; weaveScale = 8f;
weaveMag = 2f; weaveMag = 2f;
}}; }};
@@ -242,8 +241,8 @@ public class Bullets implements ContentList{
standardCopper = new BasicBulletType(2.5f, 7, "bullet"){{ standardCopper = new BasicBulletType(2.5f, 7, "bullet"){{
bulletWidth = 7f; bulletWidth = 7f;
bulletHeight = 9f; bulletHeight = 9f;
shootEffect = ShootFx.shootSmall; shootEffect = Fx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke; smokeEffect = Fx.shootSmallSmoke;
ammoMultiplier = 5; ammoMultiplier = 5;
}}; }};
@@ -259,8 +258,8 @@ public class Bullets implements ContentList{
bulletWidth = 10f; bulletWidth = 10f;
bulletHeight = 13f; bulletHeight = 13f;
armorPierce = 0.5f; armorPierce = 0.5f;
shootEffect = ShootFx.shootBig; shootEffect = Fx.shootBig;
smokeEffect = ShootFx.shootBigSmoke; smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 2; ammoMultiplier = 2;
}}; }};
@@ -298,7 +297,7 @@ public class Bullets implements ContentList{
bulletHeight = 14f; bulletHeight = 14f;
lifetime = 40f; lifetime = 40f;
inaccuracy = 5f; inaccuracy = 5f;
despawnEffect = BulletFx.hitBulletSmall; despawnEffect = Fx.hitBulletSmall;
}}; }};
standardDenseBig = new BasicBulletType(7f, 42, "bullet"){{ standardDenseBig = new BasicBulletType(7f, 42, "bullet"){{
@@ -326,7 +325,7 @@ public class Bullets implements ContentList{
damageLightning = new BulletType(0.0001f, 0f){ damageLightning = new BulletType(0.0001f, 0f){
{ {
lifetime = Lightning.lifetime; lifetime = Lightning.lifetime;
hitEffect = BulletFx.hitLancer; hitEffect = Fx.hitLancer;
despawnEffect = Fx.none; despawnEffect = Fx.none;
status = StatusEffects.shocked; status = StatusEffects.shocked;
statusIntensity = 1f; statusIntensity = 1f;
@@ -337,8 +336,8 @@ public class Bullets implements ContentList{
float healPercent = 3f; float healPercent = 3f;
{ {
hitEffect = BulletFx.hitLaser; hitEffect = Fx.hitLaser;
despawnEffect = BulletFx.hitLaser; despawnEffect = Fx.hitLaser;
collidesTeam = true; collidesTeam = true;
} }
@@ -363,7 +362,7 @@ public class Bullets implements ContentList{
tile = tile.target(); tile = tile.target();
if(tile != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){ if(tile != null && tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){
Effects.effect(BlockFx.healBlockFull, Palette.heal, tile.drawx(), tile.drawy(), tile.block().size); Effects.effect(Fx.healBlockFull, Palette.heal, tile.drawx(), tile.drawy(), tile.block().size);
tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth()); tile.entity.healBy(healPercent / 100f * tile.entity.maxHealth());
} }
} }
@@ -402,11 +401,11 @@ public class Bullets implements ContentList{
} }
if(Mathf.chance(0.1 * Time.delta())){ if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y); Effects.effect(Fx.fireballsmoke, b.x, b.y);
} }
if(Mathf.chance(0.1 * Time.delta())){ if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.ballfire, b.x, b.y); Effects.effect(Fx.ballfire, b.x, b.y);
} }
} }
}; };
@@ -417,7 +416,7 @@ public class Bullets implements ContentList{
lifetime = 35f; lifetime = 35f;
pierce = true; pierce = true;
drag = 0.05f; drag = 0.05f;
hitEffect = BulletFx.hitFlameSmall; hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none; despawnEffect = Fx.none;
status = StatusEffects.burning; status = StatusEffects.burning;
} }
@@ -434,7 +433,7 @@ public class Bullets implements ContentList{
float length = 100f; float length = 100f;
{ {
hitEffect = BulletFx.hitLancer; hitEffect = Fx.hitLancer;
despawnEffect = Fx.none; despawnEffect = Fx.none;
hitSize = 4; hitSize = 4;
lifetime = 16f; lifetime = 16f;
@@ -472,7 +471,7 @@ public class Bullets implements ContentList{
float length = 200f; float length = 200f;
{ {
hitEffect = BulletFx.hitMeltdown; hitEffect = Fx.hitMeltdown;
despawnEffect = Fx.none; despawnEffect = Fx.none;
hitSize = 4; hitSize = 4;
drawSize = 420f; drawSize = 420f;
@@ -518,7 +517,7 @@ public class Bullets implements ContentList{
float raySpace = 2f; float raySpace = 2f;
float rayLength = 80f; float rayLength = 80f;
{ {
hitEffect = BulletFx.hitFuse; hitEffect = Fx.hitFuse;
lifetime = 13f; lifetime = 13f;
despawnEffect = Fx.none; despawnEffect = Fx.none;
pierce = true; pierce = true;
@@ -570,7 +569,7 @@ public class Bullets implements ContentList{
{ {
lifetime = 1f; lifetime = 1f;
despawnEffect = Fx.none; despawnEffect = Fx.none;
hitEffect = BulletFx.hitLancer; hitEffect = Fx.hitLancer;
keepVelocity = false; keepVelocity = false;
} }
@@ -587,7 +586,7 @@ public class Bullets implements ContentList{
arc = new BulletType(0.001f, 26){{ arc = new BulletType(0.001f, 26){{
lifetime = 1; lifetime = 1;
despawnEffect = Fx.none; despawnEffect = Fx.none;
hitEffect = BulletFx.hitLancer; hitEffect = Fx.hitLancer;
} }
@Override @Override
@@ -612,13 +611,13 @@ public class Bullets implements ContentList{
bombExplosive = new BombBulletType(10f, 20f, "shell"){{ bombExplosive = new BombBulletType(10f, 20f, "shell"){{
bulletWidth = 9f; bulletWidth = 9f;
bulletHeight = 13f; bulletHeight = 13f;
hitEffect = BulletFx.flakExplosion; hitEffect = Fx.flakExplosion;
}}; }};
bombIncendiary = new BombBulletType(7f, 10f, "shell"){{ bombIncendiary = new BombBulletType(7f, 10f, "shell"){{
bulletWidth = 8f; bulletWidth = 8f;
bulletHeight = 12f; bulletHeight = 12f;
hitEffect = BulletFx.flakExplosion; hitEffect = Fx.flakExplosion;
backColor = Palette.lightOrange; backColor = Palette.lightOrange;
frontColor = Palette.lightishOrange; frontColor = Palette.lightishOrange;
incendChance = 1f; incendChance = 1f;
@@ -629,7 +628,7 @@ public class Bullets implements ContentList{
bombOil = new BombBulletType(2f, 3f, "shell"){{ bombOil = new BombBulletType(2f, 3f, "shell"){{
bulletWidth = 8f; bulletWidth = 8f;
bulletHeight = 12f; bulletHeight = 12f;
hitEffect = BlockFx.pulverize; hitEffect = Fx.pulverize;
backColor = new Color(0x4f4f4fff); backColor = new Color(0x4f4f4fff);
frontColor = Color.GRAY; frontColor = Color.GRAY;
} }
+814
View File
@@ -0,0 +1,814 @@
package io.anuke.mindustry.content;
import io.anuke.arc.Core;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shapes;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Item;
import static io.anuke.mindustry.Vars.tilesize;
public class Fx implements ContentList{
public static Effect
none, placeBlock, breakBlock, smoke, spawn, tapBlock, select,
vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock, reactorsmoke, nuclearsmoke, nuclearcloud,
redgeneratespark, generatespark, fuelburn, plasticburn, pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium,
producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate,
mine, mineBig, mineHuge, smelt, teleportActivate, teleport, teleportOut, ripple, bubble, commandSend,
healBlock, healBlockFull, healWaveMend, overdriveWave, overdriveBlockFull, shieldBreak, hitBulletSmall, hitFuse,
hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion,
plasticExplosion, artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak, burning, fire,
fireSmoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem, shockwave,
bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke,
shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium,
shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
@Override
public void load(){
none = new Effect(0, 0f, e -> {});
placeBlock = new Effect(16, e -> {
Draw.color(Palette.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(Palette.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 -> {
Draw.color(Palette.remove);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f);
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(Palette.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, Palette.darkishGray, e.fin());
float size = 7f - e.fin() * 7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
spawn = new Effect(23, e -> {
Lines.stroke(2f * e.fout());
Draw.color(Palette.accent);
Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f);
Draw.reset();
});
vtolHover = new Effect(40f, e -> {
float len = e.finpow() * 10f;
float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f);
Draw.color(Palette.lightFlame, Palette.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 -> {
Draw.color(Palette.lightishGray);
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 -> {
Draw.color(Palette.lightishGray, e.color, e.rotation);
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(Palette.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(Palette.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(Palette.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(Palette.heal);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 30, 4f + e.finpow() * 60f);
Draw.color();
});
heal = new Effect(11, e -> {
Draw.color(Palette.heal);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 10, 2f + e.finpow() * 7f);
Draw.color();
});
hitBulletSmall = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*5f);
});
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitFuse = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.surge, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*7f);
});
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitBulletBig = new Effect(13, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
Lines.stroke(0.5f + e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f);
});
Draw.reset();
});
hitFlameSmall = new Effect(14, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitLiquid = new Effect(16, e -> {
Draw.color(e.color);
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation + 180f, 60f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
Draw.reset();
});
hitLancer = new Effect(12, e -> {
Draw.color(Color.WHITE);
Lines.stroke(e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
Draw.reset();
});
hitMeltdown = new Effect(12, e -> {
Draw.color(Palette.meltdownHit);
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
Draw.reset();
});
hitLaser = new Effect(8, e -> {
Draw.color(Color.WHITE, Palette.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 -> {
Draw.color(Palette.lighterOrange, Color.GRAY, e.fin());
Lines.stroke(e.fout());
Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f);
});
Draw.reset();
});
flakExplosion = new Effect(20, e -> {
Draw.color(Palette.bulletYellow);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
});
Draw.color(Palette.lighterOrange);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
plasticExplosion = new Effect(24, e -> {
Draw.color(Palette.plastaniumFront);
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 24f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.plastaniumBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
plasticExplosionFlak = new Effect(28, e -> {
Draw.color(Palette.plastaniumFront);
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 34f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.plastaniumBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blastExplosion = new Effect(22, e -> {
Draw.color(Palette.missileYellow);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 15f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.missileYellowBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
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(Palette.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(Palette.accent);
Lines.stroke(2f * e.fout());
Lines.circle(e.x, e.y, 5f * e.fout());
Draw.reset();
});
flakExplosionBig = new Effect(30, e -> {
Draw.color(Palette.bulletYellowBack);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 25f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.bulletYellow);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
burning = new Effect(35f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f);
});
Draw.color();
});
fire = new Effect(35f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
fireSmoke = new Effect(35f, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
steam = new Effect(35f, e -> {
Draw.color(Color.LIGHT_GRAY);
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
fireballsmoke = new Effect(25f, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
});
Draw.color();
});
ballfire = new Effect(25f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
});
Draw.color();
});
freezing = new Effect(40f, e -> {
Draw.color(Liquids.cryofluid.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f);
});
Draw.color();
});
melting = new Effect(40f, e -> {
Draw.color(Liquids.lava.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f));
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f);
});
Draw.color();
});
wet = new Effect(40f, e -> {
Draw.color(Liquids.water.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
});
Draw.color();
});
oily = new Effect(42f, e -> {
Draw.color(Liquids.oil.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
});
Draw.color();
});
overdriven = new Effect(20f, e -> {
Draw.color(Palette.accent);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.square(e.x + x, e.y + y, e.fout() * 2.3f+0.5f);
});
Draw.color();
});
dropItem = new Effect(20f, e -> {
float length = 20f * e.finpow();
float size = 7f * e.fout();
Draw.rect(((Item) e.data).region, e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size);
});
shockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, 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.LIGHT_GRAY, 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.LIGHT_GRAY, e.fin());
Lines.stroke(e.fout() * 3f + 0.2f);
Lines.poly(e.x, e.y, 40, e.fin() * 140f);
Draw.reset();
});
explosion = new Effect(30, e -> {
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
Lines.stroke(1.5f * e.fout());
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blockExplosion = new Effect(30, e -> {
e.scaled(7, i -> {
Lines.stroke(3.1f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 14f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
Lines.stroke(1.7f * e.fout());
Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blockExplosionSmoke = new Effect(30, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.reset();
});
shootSmall = new Effect(8, e -> {
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
float w = 1f + 5 * e.fout();
Shapes.tri(e.x, e.y, w, 15f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootHeal = new Effect(8, e -> {
Draw.color(Palette.heal);
float w = 1f + 5 * e.fout();
Shapes.tri(e.x, e.y, w, 17f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootSmallSmoke = new Effect(20f, e -> {
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
});
Draw.reset();
});
shootBig = new Effect(9, e -> {
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
float w = 1.2f + 7 * e.fout();
Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootBig2 = new Effect(10, e -> {
Draw.color(Palette.lightOrange, Color.GRAY, e.fin());
float w = 1.2f + 8 * e.fout();
Shapes.tri(e.x, e.y, w, 29f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootBigSmoke = new Effect(17f, e -> {
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f);
});
Draw.reset();
});
shootBigSmoke2 = new Effect(18f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f);
});
Draw.reset();
});
shootSmallFlame = new Effect(30f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 36f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
});
Draw.reset();
});
shootLiquid = new Effect(40f, e -> {
Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
Angles.randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f);
});
Draw.reset();
});
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = Math.abs(e.rotation) + 90f;
int i = Mathf.sign(e.rotation);
float len = (2f + e.finpow() * 6f) * i;
float lr = rot + e.fin() * 30f * i;
Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
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 -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2f, 3f, rot);
}
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
});
}
Draw.color();
});
shellEjectBig = new GroundEffect(22f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2.5f, 4f,
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, -e.finpow() * 15f, e.rotation + 90f * i, 25f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
}
Draw.color();
});
lancerLaserShoot = new Effect(21f, e -> {
Draw.color(Palette.lancerLaser);
for(int i : Mathf.signs){
Shapes.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i);
}
Draw.reset();
});
lancerLaserShootSmoke = new Effect(26f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f);
});
Draw.reset();
});
lancerLaserCharge = new Effect(38f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f);
});
Draw.reset();
});
lancerLaserChargeBegin = new Effect(71f, e -> {
Draw.color(Palette.lancerLaser);
Fill.circle(e.x, e.y, e.fin() * 3f);
Draw.color();
Fill.circle(e.x, e.y, e.fin() * 2f);
});
lightningCharge = new Effect(38f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Shapes.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 -> {
Draw.color(Color.WHITE, Palette.lancerLaser, e.fin());
Lines.stroke(e.fout() * 1.2f + 0.5f);
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f);
});
Draw.reset();
});
}
@Override
public ContentType type(){
return ContentType.effect;
}
}
@@ -9,8 +9,6 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.UnitFx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.entities.effect.Lightning;
@@ -68,7 +66,7 @@ public class Mechs implements ContentList{
public void onLand(Player player){ public void onLand(Player player){
if(player.timer.get(Player.timerAbility, cooldown)){ if(player.timer.get(Player.timerAbility, cooldown)){
Effects.shake(1f, 1f, player); Effects.shake(1f, 1f, player);
Effects.effect(UnitFx.landShock, player); Effects.effect(Fx.landShock, player);
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14)); Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14));
} }
@@ -109,7 +107,7 @@ public class Mechs implements ContentList{
Units.getNearby(player.getTeam(), rect, unit -> { Units.getNearby(player.getTeam(), rect, unit -> {
if(unit.dst(player) <= healRange){ if(unit.dst(player) <= healRange){
if(unit.health < unit.maxHealth()){ if(unit.health < unit.maxHealth()){
Effects.effect(UnitFx.heal, unit); Effects.effect(Fx.heal, unit);
wasHealed = true; wasHealed = true;
} }
unit.healBy(healAmount); unit.healBy(healAmount);
@@ -117,7 +115,7 @@ public class Mechs implements ContentList{
}); });
if(wasHealed){ if(wasHealed){
Effects.effect(UnitFx.healWave, player); Effects.effect(Fx.healWave, player);
} }
} }
} }
@@ -228,7 +226,7 @@ public class Mechs implements ContentList{
public void updateAlt(Player player){ public void updateAlt(Player player){
float scl = scld(player); float scl = scld(player);
if(Mathf.chance(Time.delta() * (0.15*scl))){ if(Mathf.chance(Time.delta() * (0.15*scl))){
Effects.effect(BulletFx.hitLancer, Palette.lancerLaser, player.x, player.y); Effects.effect(Fx.hitLancer, Palette.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), Palette.lancerLaser, 10f, Lightning.create(player.getTeam(), Palette.lancerLaser, 10f,
player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14); player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14);
} }
@@ -3,7 +3,6 @@ package io.anuke.mindustry.content;
import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.entities.StatusController.StatusEntry; import io.anuke.mindustry.entities.StatusController.StatusEntry;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
@@ -27,7 +26,7 @@ public class StatusEffects implements ContentList{
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){ public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){
if(to == tarred){ if(to == tarred){
unit.damage(1f); unit.damage(1f);
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
return result.set(this, Math.min(time + newTime, baseDuration + tarred.baseDuration)); return result.set(this, Math.min(time + newTime, baseDuration + tarred.baseDuration));
} }
@@ -39,7 +38,7 @@ public class StatusEffects implements ContentList{
unit.damagePeriodic(0.04f); unit.damagePeriodic(0.04f);
if(Mathf.chance(Time.delta() * 0.2f)){ if(Mathf.chance(Time.delta() * 0.2f)){
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
} }
} }
}; };
@@ -55,7 +54,7 @@ public class StatusEffects implements ContentList{
public void update(Unit unit, float time){ public void update(Unit unit, float time){
if(Mathf.chance(Time.delta() * 0.15f)){ if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
} }
} }
}; };
@@ -80,7 +79,7 @@ public class StatusEffects implements ContentList{
@Override @Override
public void update(Unit unit, float time){ public void update(Unit unit, float time){
if(Mathf.chance(Time.delta() * 0.15f)){ if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
} }
} }
}; };
@@ -106,7 +105,7 @@ public class StatusEffects implements ContentList{
unit.damagePeriodic(0.3f); unit.damagePeriodic(0.3f);
if(Mathf.chance(Time.delta() * 0.2f)){ if(Mathf.chance(Time.delta() * 0.2f)){
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
} }
} }
}; };
@@ -119,7 +118,7 @@ public class StatusEffects implements ContentList{
@Override @Override
public void update(Unit unit, float time){ public void update(Unit unit, float time){
if(Mathf.chance(Time.delta() * 0.15f)){ if(Mathf.chance(Time.delta() * 0.15f)){
Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); Effects.effect(Fx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
} }
} }
@@ -146,7 +145,7 @@ public class StatusEffects implements ContentList{
unit.health += 0.01f * Time.delta(); unit.health += 0.01f * Time.delta();
if(Mathf.chance(Time.delta() * 0.25f)){ if(Mathf.chance(Time.delta() * 0.25f)){
Effects.effect(EnvironmentFx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit); Effects.effect(Fx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit);
} }
} }
}; };
@@ -1,7 +1,5 @@
package io.anuke.mindustry.content; package io.anuke.mindustry.content;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.type.Weapon;
@@ -17,7 +15,7 @@ public class Weapons implements ContentList{
length = 1.5f; length = 1.5f;
reload = 14f; reload = 14f;
roundrobin = true; roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
ammo = Bullets.standardMechSmall; ammo = Bullets.standardMechSmall;
}}; }};
@@ -25,7 +23,7 @@ public class Weapons implements ContentList{
length = 1.5f; length = 1.5f;
reload = 15f; reload = 15f;
roundrobin = true; roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
ammo = Bullets.standardCopper; ammo = Bullets.standardCopper;
}}; }};
@@ -33,7 +31,7 @@ public class Weapons implements ContentList{
length = 1.5f; length = 1.5f;
reload = 10f; reload = 10f;
roundrobin = true; roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
ammo = Bullets.standardGlaive; ammo = Bullets.standardGlaive;
}}; }};
@@ -42,7 +40,7 @@ public class Weapons implements ContentList{
reload = 25f; reload = 25f;
width = 1f; width = 1f;
roundrobin = true; roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
ammo = Bullets.standardCopper; ammo = Bullets.standardCopper;
}}; }};
@@ -84,7 +82,7 @@ public class Weapons implements ContentList{
length = 1.5f; length = 1.5f;
reload = 28f; reload = 28f;
roundrobin = true; roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
ammo = Bullets.standardCopper; ammo = Bullets.standardCopper;
}}; }};
@@ -107,7 +105,7 @@ public class Weapons implements ContentList{
inaccuracy = 3f; inaccuracy = 3f;
recoil = 3f; recoil = 3f;
velocityRnd = 0.1f; velocityRnd = 0.1f;
ejectEffect = ShootFx.shellEjectMedium; ejectEffect = Fx.shellEjectMedium;
ammo = Bullets.artilleryDense; ammo = Bullets.artilleryDense;
}}; }};
@@ -126,7 +124,7 @@ public class Weapons implements ContentList{
roundrobin = true; roundrobin = true;
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = ShootFx.shellEjectMedium; ejectEffect = Fx.shellEjectMedium;
ammo = Bullets.artilleryUnit; ammo = Bullets.artilleryUnit;
}}; }};
@@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
@@ -29,7 +29,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
arcsmelter = new PowerSmelter("arc-smelter"){{ arcsmelter = new PowerSmelter("arc-smelter"){{
health = 90; health = 90;
craftEffect = BlockFx.smeltsmoke; craftEffect = Fx.smeltsmoke;
result = Items.densealloy; result = Items.densealloy;
craftTime = 30f; craftTime = 30f;
size = 2; size = 2;
@@ -43,7 +43,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
siliconsmelter = new PowerSmelter("silicon-smelter"){{ siliconsmelter = new PowerSmelter("silicon-smelter"){{
health = 90; health = 90;
craftEffect = BlockFx.smeltsmoke; craftEffect = Fx.smeltsmoke;
result = Items.silicon; result = Items.silicon;
craftTime = 40f; craftTime = 40f;
size = 2; size = 2;
@@ -63,8 +63,8 @@ public class CraftingBlocks extends BlockList implements ContentList{
size = 2; size = 2;
health = 320; health = 320;
hasPower = hasLiquids = true; hasPower = hasLiquids = true;
craftEffect = BlockFx.formsmoke; craftEffect = Fx.formsmoke;
updateEffect = BlockFx.plasticburn; updateEffect = Fx.plasticburn;
consumes.liquid(Liquids.oil, 0.25f); consumes.liquid(Liquids.oil, 0.25f);
consumes.power(0.3f); consumes.power(0.3f);
@@ -72,7 +72,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
}}; }};
phaseWeaver = new PhaseWeaver("phase-weaver"){{ phaseWeaver = new PhaseWeaver("phase-weaver"){{
craftEffect = BlockFx.smeltsmoke; craftEffect = Fx.smeltsmoke;
result = Items.phasefabric; result = Items.phasefabric;
craftTime = 120f; craftTime = 120f;
size = 2; size = 2;
@@ -82,7 +82,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
}}; }};
alloySmelter = new PowerSmelter("alloy-smelter"){{ alloySmelter = new PowerSmelter("alloy-smelter"){{
craftEffect = BlockFx.smeltsmoke; craftEffect = Fx.smeltsmoke;
result = Items.surgealloy; result = Items.surgealloy;
craftTime = 75f; craftTime = 75f;
size = 2; size = 2;
@@ -207,9 +207,9 @@ public class CraftingBlocks extends BlockList implements ContentList{
itemCapacity = 40; itemCapacity = 40;
output = Items.sand; output = Items.sand;
health = 80; health = 80;
craftEffect = BlockFx.pulverize; craftEffect = Fx.pulverize;
craftTime = 40f; craftTime = 40f;
updateEffect = BlockFx.pulverizeSmall; updateEffect = Fx.pulverizeSmall;
hasItems = hasPower = true; hasItems = hasPower = true;
consumes.item(Items.stone, 1); consumes.item(Items.stone, 1);
@@ -222,7 +222,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
output = Items.stone; output = Items.stone;
itemCapacity = 20; itemCapacity = 20;
health = 80; health = 80;
craftEffect = BlockFx.purifystone; craftEffect = Fx.purifystone;
hasLiquids = hasItems = true; hasLiquids = hasItems = true;
consumes.liquid(Liquids.lava, 1f); consumes.liquid(Liquids.lava, 1f);
@@ -1,7 +1,7 @@
package io.anuke.mindustry.content.blocks; package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.*; import io.anuke.mindustry.world.blocks.defense.*;
@@ -64,8 +64,8 @@ public class DefenseBlocks extends BlockList implements ContentList{
}}; }};
doorLarge = new Door("door-large"){{ doorLarge = new Door("door-large"){{
openfx = BlockFx.dooropenlarge; openfx = Fx.dooropenlarge;
closefx = BlockFx.doorcloselarge; closefx = Fx.doorcloselarge;
health = 100 * 4 * wallHealthMultiplier; health = 100 * 4 * wallHealthMultiplier;
size = 2; size = 2;
}}; }};
@@ -1,10 +1,9 @@
package io.anuke.mindustry.content.blocks; package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.power.*; import io.anuke.mindustry.world.blocks.power.*;
public class PowerBlocks extends BlockList implements ContentList{ public class PowerBlocks extends BlockList implements ContentList{
@@ -21,7 +20,7 @@ public class PowerBlocks extends BlockList implements ContentList{
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{ thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
maxLiquidGenerate = 2f; maxLiquidGenerate = 2f;
powerProduction = 2f; powerProduction = 2f;
generateEffect = BlockFx.redgeneratespark; generateEffect = Fx.redgeneratespark;
size = 2; size = 2;
}}; }};
@@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.production.Cultivator; import io.anuke.mindustry.world.blocks.production.Cultivator;
@@ -35,8 +35,8 @@ public class ProductionBlocks extends BlockList implements ContentList{
size = 2; size = 2;
hasPower = true; hasPower = true;
tier = 4; tier = 4;
updateEffect = BlockFx.pulverizeMedium; updateEffect = Fx.pulverizeMedium;
drillEffect = BlockFx.mineBig; drillEffect = Fx.mineBig;
consumes.power(0.11f); consumes.power(0.11f);
}}; }};
@@ -47,9 +47,9 @@ public class ProductionBlocks extends BlockList implements ContentList{
drawRim = true; drawRim = true;
hasPower = true; hasPower = true;
tier = 5; tier = 5;
updateEffect = BlockFx.pulverizeRed; updateEffect = Fx.pulverizeRed;
updateEffectChance = 0.03f; updateEffectChance = 0.03f;
drillEffect = BlockFx.mineHuge; drillEffect = Fx.mineHuge;
rotateSpeed = 6f; rotateSpeed = 6f;
warmupSpeed = 0.01f; warmupSpeed = 0.01f;
@@ -65,9 +65,9 @@ public class ProductionBlocks extends BlockList implements ContentList{
tier = 5; tier = 5;
rotateSpeed = 9f; rotateSpeed = 9f;
drawRim = true; drawRim = true;
updateEffect = BlockFx.pulverizeRedder; updateEffect = Fx.pulverizeRedder;
updateEffectChance = 0.04f; updateEffectChance = 0.04f;
drillEffect = BlockFx.mineHuge; drillEffect = Fx.mineHuge;
warmupSpeed = 0.005f; warmupSpeed = 0.005f;
consumes.power(0.7f); consumes.power(0.7f);
@@ -85,7 +85,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
oilExtractor = new Fracker("oil-extractor"){{ oilExtractor = new Fracker("oil-extractor"){{
result = Liquids.oil; result = Liquids.oil;
updateEffect = BlockFx.pulverize; updateEffect = Fx.pulverize;
liquidCapacity = 50f; liquidCapacity = 50f;
updateEffectChance = 0.05f; updateEffectChance = 0.05f;
pumpAmount = 0.09f; pumpAmount = 0.09f;
@@ -5,7 +5,7 @@ import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.ShootFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.turrets.*; import io.anuke.mindustry.world.blocks.defense.turrets.*;
@@ -27,7 +27,7 @@ public class TurretBlocks extends BlockList implements ContentList{
restitution = 0.03f; restitution = 0.03f;
range = 90f; range = 90f;
shootCone = 15f; shootCone = 15f;
ammoUseEffect = ShootFx.shellEjectSmall; ammoUseEffect = Fx.shellEjectSmall;
health = 80; health = 80;
inaccuracy = 2f; inaccuracy = 2f;
rotatespeed = 10f; rotatespeed = 10f;
@@ -52,7 +52,7 @@ public class TurretBlocks extends BlockList implements ContentList{
recoil = 0f; recoil = 0f;
reload = 4f; reload = 4f;
shootCone = 50f; shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall; ammoUseEffect = Fx.shellEjectSmall;
health = 160; health = 160;
}}; }};
@@ -68,7 +68,7 @@ public class TurretBlocks extends BlockList implements ContentList{
reload = 4f; reload = 4f;
inaccuracy = 5f; inaccuracy = 5f;
shootCone = 50f; shootCone = 50f;
shootEffect = ShootFx.shootLiquid; shootEffect = Fx.shootLiquid;
range = 90f; range = 90f;
health = 360; health = 360;
@@ -94,10 +94,10 @@ public class TurretBlocks extends BlockList implements ContentList{
powerUsed = 1 / 3f; powerUsed = 1 / 3f;
consumes.powerBuffered(60f); consumes.powerBuffered(60f);
shootShake = 2f; shootShake = 2f;
shootEffect = ShootFx.lancerLaserShoot; shootEffect = Fx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke; smokeEffect = Fx.lancerLaserShootSmoke;
chargeEffect = ShootFx.lancerLaserCharge; chargeEffect = Fx.lancerLaserCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin; chargeBeginEffect = Fx.lancerLaserChargeBegin;
heatColor = Color.RED; heatColor = Color.RED;
size = 2; size = 2;
health = 320; health = 320;
@@ -113,7 +113,7 @@ public class TurretBlocks extends BlockList implements ContentList{
powerUsed = 1f / 3f; powerUsed = 1f / 3f;
consumes.powerBuffered(30f); consumes.powerBuffered(30f);
range = 150f; range = 150f;
shootEffect = ShootFx.lightningShoot; shootEffect = Fx.lightningShoot;
heatColor = Color.RED; heatColor = Color.RED;
recoil = 1f; recoil = 1f;
size = 1; size = 1;
@@ -154,7 +154,7 @@ public class TurretBlocks extends BlockList implements ContentList{
shootShake = 2f; shootShake = 2f;
burstSpacing = 4; burstSpacing = 4;
shots = 3; shots = 3;
ammoUseEffect = ShootFx.shellEjectBig; ammoUseEffect = Fx.shellEjectBig;
health = 360; health = 360;
}}; }};
@@ -171,7 +171,7 @@ public class TurretBlocks extends BlockList implements ContentList{
inaccuracy = 12f; inaccuracy = 12f;
reload = 60f; reload = 60f;
ammoEjectBack = 5f; ammoEjectBack = 5f;
ammoUseEffect = ShootFx.shellEjectBig; ammoUseEffect = Fx.shellEjectBig;
cooldown = 0.03f; cooldown = 0.03f;
velocityInaccuracy = 0.2f; velocityInaccuracy = 0.2f;
restitution = 0.02f; restitution = 0.02f;
@@ -222,7 +222,7 @@ public class TurretBlocks extends BlockList implements ContentList{
coolantMultiplier = 0.5f; coolantMultiplier = 0.5f;
maxCoolantUsed = 1.5f; maxCoolantUsed = 1.5f;
restitution = 0.1f; restitution = 0.1f;
ammoUseEffect = ShootFx.shellEjectBig; ammoUseEffect = Fx.shellEjectBig;
range = 200f; range = 200f;
inaccuracy = 3f; inaccuracy = 3f;
recoil = 3f; recoil = 3f;
@@ -238,7 +238,7 @@ public class TurretBlocks extends BlockList implements ContentList{
meltdown = new LaserTurret("meltdown"){{ meltdown = new LaserTurret("meltdown"){{
shootType = Bullets.meltdownLaser; shootType = Bullets.meltdownLaser;
shootEffect = ShootFx.shootBigSmoke2; shootEffect = Fx.shootBigSmoke2;
shootCone = 40f; shootCone = 40f;
recoil = 4f; recoil = 4f;
size = 4; size = 4;
@@ -1,330 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Tmp;
import static io.anuke.mindustry.Vars.tilesize;
public class BlockFx extends FxList implements ContentList{
public static Effect reactorsmoke, nuclearsmoke, nuclearcloud, redgeneratespark, generatespark, fuelburn, plasticburn,
pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium, producesmoke, smeltsmoke, formsmoke, blastsmoke,
lava, dooropen, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate, mine, mineBig, mineHuge,
smelt, teleportActivate, teleport, teleportOut, ripple, bubble, commandSend, healBlock, healBlockFull, healWaveMend, overdriveWave,
overdriveBlockFull, shieldBreak;
@Override
public void load(){
reactorsmoke = new Effect(17, e -> {
Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> {
float size = 1f + e.fout() * 5f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset();
});
});
nuclearsmoke = new Effect(40, e -> {
Angles.randLenVectors(e.id, 4, e.fin() * 13f, (x, y) -> {
float size = e.fslope() * 4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
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.finpow() * 90f, (x, y) -> {
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();
});
});
redgeneratespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Palette.redSpark, Color.GRAY, e.fin());
//Draw.alpha(e.fout());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
});
generatespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Palette.orangeSpark, Color.GRAY, e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
});
fuelburn = new Effect(23, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Color.LIGHT_GRAY, 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(Palette.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(Palette.redDust, Palette.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(Palette.redderDust, Palette.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(Palette.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(Palette.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, Palette.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(Palette.plasticSmoke, Color.LIGHT_GRAY, e.fin());
Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45);
Draw.reset();
});
});
blastsmoke = new Effect(26, e -> {
Angles.randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> {
float size = 2f + e.fout() * 6f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fin());
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.fin() * 10f, (x, y) -> {
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.LIGHT_GRAY, 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.LIGHT_GRAY, 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.LIGHT_GRAY, 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 -> {
Draw.color(e.color);
e.scaled(8f, e2 -> {
Lines.stroke(e2.fout() * 4f);
Lines.circle(e2.x, e2.y, 4f + e2.fin() * 27f);
});
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> {
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);
Lines.stroke(e.fin() * 2f);
Lines.circle(e.x, e.y, 7f + e.fout() * 8f);
Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> {
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);
Lines.stroke(e.fout() * 2f);
Lines.circle(e.x, e.y, 7f + e.fin() * 8f);
Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> {
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).shiftValue(0.1f));
Lines.stroke(e.fout() + 0.4f);
Lines.circle(e.x, e.y, 2f + e.fin() * 4f);
Draw.reset();
});
bubble = new Effect(20, e -> {
Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f));
Lines.stroke(e.fout() + 0.2f);
Angles.randLenVectors(e.id, 2, 8f, (x, y) -> {
Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f);
});
Draw.reset();
});
commandSend = new Effect(28, e -> {
Draw.color(Palette.command);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 40, 4f + e.finpow() * 120f);
Draw.color();
});
healWaveMend = new Effect(40, e -> {
Draw.color(e.color);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation);
Draw.color();
});
overdriveWave = new Effect(50, e -> {
Draw.color(e.color);
Lines.stroke(e.fout() * 1f);
Lines.poly(e.x, e.y, 30, e.finpow() * e.rotation);
Draw.color();
});
healBlock = new Effect(20, e -> {
Draw.color(Palette.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(Palette.accent);
Lines.stroke(3f * e.fout());
Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90);
Draw.reset();
});
}
}
@@ -1,281 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig, plasticExplosionFlak;
@Override
public void load(){
hitBulletSmall = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*5f);
});
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitFuse = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.surge, e.fin());
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*7f);
});
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitBulletBig = new Effect(13, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
Lines.stroke(0.5f + e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f);
});
Draw.reset();
});
hitFlameSmall = new Effect(14, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Lines.stroke(0.5f + e.fout());
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
});
Draw.reset();
});
hitLiquid = new Effect(16, e -> {
Draw.color(e.color);
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation + 180f, 60f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
Draw.reset();
});
hitLancer = new Effect(12, e -> {
Draw.color(Color.WHITE);
Lines.stroke(e.fout() * 1.5f);
Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
Draw.reset();
});
hitMeltdown = new Effect(12, e -> {
Draw.color(Palette.meltdownHit);
Lines.stroke(e.fout() * 2f);
Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
});
Draw.reset();
});
hitLaser = new Effect(8, e -> {
Draw.color(Color.WHITE, Palette.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 -> {
Draw.color(Palette.lighterOrange, Color.GRAY, e.fin());
Lines.stroke(e.fout());
Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> {
float ang = Mathf.angle(x, y);
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f);
});
Draw.reset();
});
flakExplosion = new Effect(20, e -> {
Draw.color(Palette.bulletYellow);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
});
Draw.color(Palette.lighterOrange);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
plasticExplosion = new Effect(24, e -> {
Draw.color(Palette.plastaniumFront);
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 24f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 7, 2f + 28f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.plastaniumBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
plasticExplosionFlak = new Effect(28, e -> {
Draw.color(Palette.plastaniumFront);
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 34f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 7, 2f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.plastaniumBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blastExplosion = new Effect(22, e -> {
Draw.color(Palette.missileYellow);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 15f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.missileYellowBack);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
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(Palette.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(Palette.accent);
Lines.stroke(2f * e.fout());
Lines.circle(e.x, e.y, 5f * e.fout());
Draw.reset();
});
flakExplosionBig = new Effect(30, e -> {
Draw.color(Palette.bulletYellowBack);
e.scaled(6, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 25f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
});
Draw.color(Palette.bulletYellow);
Lines.stroke(1f * e.fout());
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
}
}
@@ -1,137 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.Item;
public class EnvironmentFx extends FxList implements ContentList{
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem;
@Override
public void load(){
burning = new Effect(35f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f);
});
Draw.color();
});
fire = new Effect(35f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
smoke = new Effect(35f, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
steam = new Effect(35f, e -> {
Draw.color(Color.LIGHT_GRAY);
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
});
Draw.color();
});
fireballsmoke = new Effect(25f, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
});
Draw.color();
});
ballfire = new Effect(25f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
});
Draw.color();
});
freezing = new Effect(40f, e -> {
Draw.color(Liquids.cryofluid.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f);
});
Draw.color();
});
melting = new Effect(40f, e -> {
Draw.color(Liquids.lava.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f));
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f);
});
Draw.color();
});
wet = new Effect(40f, e -> {
Draw.color(Liquids.water.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
});
Draw.color();
});
oily = new Effect(42f, e -> {
Draw.color(Liquids.oil.color);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
});
Draw.color();
});
overdriven = new Effect(20f, e -> {
Draw.color(Palette.accent);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.square(e.x + x, e.y + y, e.fout() * 2.3f+0.5f);
});
Draw.color();
});
dropItem = new Effect(20f, e -> {
float length = 20f * e.finpow();
float size = 7f * e.fout();
Draw.rect(((Item) e.data).region, e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size);
});
}
}
@@ -1,97 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
public class ExplosionFx extends FxList implements ContentList{
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
@Override
public void load(){
shockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, 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.LIGHT_GRAY, 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.LIGHT_GRAY, e.fin());
Lines.stroke(e.fout() * 3f + 0.2f);
Lines.poly(e.x, e.y, 40, e.fin() * 140f);
Draw.reset();
});
explosion = new Effect(30, e -> {
e.scaled(7, i -> {
Lines.stroke(3f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 10f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
Lines.stroke(1.5f * e.fout());
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blockExplosion = new Effect(30, e -> {
e.scaled(7, i -> {
Lines.stroke(3.1f * i.fout());
Lines.circle(e.x, e.y, 3f + i.fin() * 14f);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
Lines.stroke(1.7f * e.fout());
Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f);
});
Draw.reset();
});
blockExplosionSmoke = new Effect(30, e -> {
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 3f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f);
});
Draw.reset();
});
}
}
@@ -1,69 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import static io.anuke.mindustry.Vars.tilesize;
public class Fx extends FxList implements ContentList{
public static Effect none, placeBlock, breakBlock, smoke, spawn, tapBlock, select;
@Override
public void load(){
none = new Effect(0, 0f, e -> {
});
placeBlock = new Effect(16, e -> {
Draw.color(Palette.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(Palette.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 -> {
Draw.color(Palette.remove);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f);
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(Palette.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, Palette.darkishGray, e.fin());
float size = 7f - e.fin() * 7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
spawn = new Effect(23, e -> {
Lines.stroke(2f * e.fout());
Draw.color(Palette.accent);
Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f);
Draw.reset();
});
}
}
@@ -1,12 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
public abstract class FxList implements ContentList{
@Override
public ContentType type(){
return ContentType.effect;
}
}
@@ -1,225 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.Core;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shapes;
public class ShootFx extends FxList implements ContentList{
public static Effect shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
@Override
public void load(){
shootSmall = new Effect(8, e -> {
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
float w = 1f + 5 * e.fout();
Shapes.tri(e.x, e.y, w, 15f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootHeal = new Effect(8, e -> {
Draw.color(Palette.heal);
float w = 1f + 5 * e.fout();
Shapes.tri(e.x, e.y, w, 17f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootSmallSmoke = new Effect(20f, e -> {
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
});
Draw.reset();
});
shootBig = new Effect(9, e -> {
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
float w = 1.2f + 7 * e.fout();
Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootBig2 = new Effect(10, e -> {
Draw.color(Palette.lightOrange, Color.GRAY, e.fin());
float w = 1.2f + 8 * e.fout();
Shapes.tri(e.x, e.y, w, 29f * e.fout(), e.rotation);
Shapes.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f);
Draw.reset();
});
shootBigSmoke = new Effect(17f, e -> {
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f);
});
Draw.reset();
});
shootBigSmoke2 = new Effect(18f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f);
});
Draw.reset();
});
shootSmallFlame = new Effect(30f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
Angles.randLenVectors(e.id, 8, e.finpow() * 36f, e.rotation, 10f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
});
Draw.reset();
});
shootLiquid = new Effect(40f, e -> {
Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
Angles.randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f);
});
Draw.reset();
});
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = Math.abs(e.rotation) + 90f;
int i = Mathf.sign(e.rotation);
float len = (2f + e.finpow() * 6f) * i;
float lr = rot + e.fin() * 30f * i;
Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
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 -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2f, 3f, rot);
}
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
});
}
Draw.color();
});
shellEjectBig = new GroundEffect(22f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2.5f, 4f,
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, -e.finpow() * 15f, e.rotation + 90f * i, 25f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
}
Draw.color();
});
lancerLaserShoot = new Effect(21f, e -> {
Draw.color(Palette.lancerLaser);
for(int i : Mathf.signs){
Shapes.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i);
}
Draw.reset();
});
lancerLaserShootSmoke = new Effect(26f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f);
});
Draw.reset();
});
lancerLaserCharge = new Effect(38f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f);
});
Draw.reset();
});
lancerLaserChargeBegin = new Effect(71f, e -> {
Draw.color(Palette.lancerLaser);
Fill.circle(e.x, e.y, e.fin() * 3f);
Draw.color();
Fill.circle(e.x, e.y, e.fin() * 2f);
});
lightningCharge = new Effect(38f, e -> {
Draw.color(Palette.lancerLaser);
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
Shapes.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 -> {
Draw.color(Color.WHITE, Palette.lancerLaser, e.fin());
Lines.stroke(e.fout() * 1.2f + 0.5f);
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f);
});
Draw.reset();
});
}
}
@@ -1,78 +0,0 @@
package io.anuke.mindustry.content.fx;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
public class UnitFx extends FxList implements ContentList{
public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock;
@Override
public void load(){
vtolHover = new Effect(40f, e -> {
float len = e.finpow() * 10f;
float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f);
Draw.color(Palette.lightFlame, Palette.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 -> {
Draw.color(Palette.lightishGray);
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 -> {
Draw.color(Palette.lightishGray, e.color, e.rotation);
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(Palette.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(Palette.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(Palette.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(Palette.heal);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 30, 4f + e.finpow() * 60f);
Draw.color();
});
heal = new Effect(11, e -> {
Draw.color(Palette.heal);
Lines.stroke(e.fout() * 2f);
Lines.poly(e.x, e.y, 10, 2f + e.finpow() * 7f);
Draw.color();
});
}
}
@@ -7,7 +7,6 @@ import io.anuke.arc.function.Consumer;
import io.anuke.arc.util.Log; import io.anuke.arc.util.Log;
import io.anuke.mindustry.content.*; import io.anuke.mindustry.content.*;
import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.content.fx.*;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
@@ -41,13 +40,7 @@ public class ContentLoader{
private ObjectSet<Consumer<Content>> initialization = new ObjectSet<>(); private ObjectSet<Consumer<Content>> initialization = new ObjectSet<>();
private ContentList[] content = { private ContentList[] content = {
//effects //effects
new BlockFx(),
new BulletFx(),
new EnvironmentFx(),
new ExplosionFx(),
new Fx(), new Fx(),
new ShootFx(),
new UnitFx(),
//items //items
new Items(), new Items(),
@@ -21,7 +21,7 @@ import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.ScreenRecorder; import io.anuke.arc.util.ScreenRecorder;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.util.pooling.Pools; import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
@@ -11,7 +11,7 @@ import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.entities.effect.Lightning;
@@ -46,21 +46,21 @@ public class Damage{
int f = i; int f = i;
Time.run(i * 2f, () -> { Time.run(i * 2f, () -> {
Damage.damage(x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f); Damage.damage(x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f);
Effects.effect(ExplosionFx.blockExplosionSmoke, x + Mathf.range(radius), y + Mathf.range(radius)); Effects.effect(Fx.blockExplosionSmoke, x + Mathf.range(radius), y + Mathf.range(radius));
}); });
} }
if(explosiveness > 15f){ if(explosiveness > 15f){
Effects.effect(ExplosionFx.shockwave, x, y); Effects.effect(Fx.shockwave, x, y);
} }
if(explosiveness > 30f){ if(explosiveness > 30f){
Effects.effect(ExplosionFx.bigShockwave, x, y); Effects.effect(Fx.bigShockwave, x, y);
} }
float shake = Math.min(explosiveness / 4f + 3f, 9f); float shake = Math.min(explosiveness / 4f + 3f, 9f);
Effects.shake(shake, shake, x, y); Effects.shake(shake, shake, x, y);
Effects.effect(ExplosionFx.blockExplosion, x, y); Effects.effect(Fx.blockExplosion, x, y);
} }
public static void createIncend(float x, float y, float range, int amount){ public static void createIncend(float x, float y, float range, int amount){
@@ -20,7 +20,7 @@ import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.util.pooling.Pools; import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.effect.ScorchDecal; import io.anuke.mindustry.entities.effect.ScorchDecal;
import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Team;
@@ -502,7 +502,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
if(mech.shake > 1f){ if(mech.shake > 1f){
Effects.shake(mech.shake, mech.shake, this); Effects.shake(mech.shake, mech.shake, this);
} }
Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f); Effects.effect(Fx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
} }
mech.onLand(this); mech.onLand(this);
achievedFlight = false; achievedFlight = false;
@@ -13,7 +13,7 @@ import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Interval; import io.anuke.arc.util.Interval;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.entities.traits.TargetTrait;
import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Team;
@@ -1,13 +1,13 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects;
import io.anuke.arc.entities.Effects.Effect; import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.mindustry.content.Fx;
//TODO scale velocity depending on fslope() //TODO scale velocity depending on fslope()
public class ArtilleryBulletType extends BasicBulletType{ public class ArtilleryBulletType extends BasicBulletType{
protected Effect trailEffect = BulletFx.artilleryTrail; protected Effect trailEffect = Fx.artilleryTrail;
public ArtilleryBulletType(float speed, float damage, String bulletSprite){ public ArtilleryBulletType(float speed, float damage, String bulletSprite){
super(speed, damage, bulletSprite); super(speed, damage, bulletSprite);
@@ -3,8 +3,7 @@ package io.anuke.mindustry.entities.bullet;
import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects;
import io.anuke.arc.entities.Effects.Effect; import io.anuke.arc.entities.Effects.Effect;
import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.type.StatusEffect;
@@ -21,9 +20,9 @@ public abstract class BulletType extends Content{
public Effect hitEffect, despawnEffect; public Effect hitEffect, despawnEffect;
/**Effect created when shooting.*/ /**Effect created when shooting.*/
public Effect shootEffect = ShootFx.shootSmall; public Effect shootEffect = Fx.shootSmall;
/**Extra smoke effect created when shooting.*/ /**Extra smoke effect created when shooting.*/
public Effect smokeEffect = ShootFx.shootSmallSmoke; public Effect smokeEffect = Fx.shootSmallSmoke;
/**Extra inaccuracy when firing.*/ /**Extra inaccuracy when firing.*/
public float inaccuracy = 0f; public float inaccuracy = 0f;
/**How many bullets get created per ammo item/liquid.*/ /**How many bullets get created per ammo item/liquid.*/
@@ -61,8 +60,8 @@ public abstract class BulletType extends Content{
this.speed = speed; this.speed = speed;
this.damage = damage; this.damage = damage;
lifetime = 40f; lifetime = 40f;
hitEffect = BulletFx.hitBulletSmall; hitEffect = Fx.hitBulletSmall;
despawnEffect = BulletFx.hitBulletSmall; despawnEffect = Fx.hitBulletSmall;
} }
/**Returns maximum distance the bullet this bullet type has can travel.*/ /**Returns maximum distance the bullet this bullet type has can travel.*/
@@ -1,7 +1,7 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Rectangle;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
@@ -13,7 +13,7 @@ public abstract class FlakBulletType extends BasicBulletType{
super(speed, damage, "shell"); super(speed, damage, "shell");
splashDamage = 15f; splashDamage = 15f;
splashDamageRadius = 34f; splashDamageRadius = 34f;
hitEffect = BulletFx.flakExplosionBig; hitEffect = Fx.flakExplosionBig;
bulletWidth = 8f; bulletWidth = 8f;
bulletHeight = 10f; bulletHeight = 10f;
} }
@@ -7,8 +7,7 @@ import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Point2; import io.anuke.arc.math.geom.Point2;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Puddle; import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
@@ -28,7 +27,7 @@ public class LiquidBulletType extends BulletType{
status = liquid.effect; status = liquid.effect;
statusIntensity = 0.5f; statusIntensity = 0.5f;
despawnEffect = Fx.none; despawnEffect = Fx.none;
hitEffect = BulletFx.hitLiquid; hitEffect = Fx.hitLiquid;
drag = 0.01f; drag = 0.01f;
knockback = 0.5f; knockback = 0.5f;
} }
@@ -5,9 +5,7 @@ import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.math.Angles; import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData; import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
@@ -19,8 +17,8 @@ public class MassDriverBolt extends BulletType{
super(5.3f, 50); super(5.3f, 50);
collidesTiles = false; collidesTiles = false;
lifetime = 200f; lifetime = 200f;
despawnEffect = BlockFx.smeltsmoke; despawnEffect = Fx.smeltsmoke;
hitEffect = BulletFx.hitBulletBig; hitEffect = Fx.hitBulletBig;
drag = 0.005f; drag = 0.005f;
} }
@@ -96,7 +94,7 @@ public class MassDriverBolt extends BulletType{
int amountDropped = Mathf.random(0, data.items[i]); int amountDropped = Mathf.random(0, data.items[i]);
if(amountDropped > 0){ if(amountDropped > 0){
float angle = b.rot() + Mathf.range(100f); float angle = b.rot() + Mathf.range(100f);
Effects.effect(EnvironmentFx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i)); Effects.effect(Fx.dropItem, Color.WHITE, b.x, b.y, angle, content.item(i));
} }
} }
} }
@@ -1,7 +1,7 @@
package io.anuke.mindustry.entities.bullet; package io.anuke.mindustry.entities.bullet;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Palette;
import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
@@ -25,7 +25,7 @@ public class MissileBulletType extends BasicBulletType{
super.update(b); super.update(b);
if(Mathf.chance(Time.delta() * 0.2)){ if(Mathf.chance(Time.delta() * 0.2)){
Effects.effect(BulletFx.missileTrail, trailColor, b.x, b.y, 2f); Effects.effect(Fx.missileTrail, trailColor, b.x, b.y, 2f);
} }
if(weaveMag > 0){ if(weaveMag > 0){
@@ -15,7 +15,7 @@ import io.anuke.arc.util.pooling.Pool.Poolable;
import io.anuke.arc.util.pooling.Pools; import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.traits.SaveTrait; import io.anuke.mindustry.entities.traits.SaveTrait;
@@ -93,11 +93,11 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{
@Override @Override
public void update(){ public void update(){
if(Mathf.chance(0.1 * Time.delta())){ if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.fire, x + Mathf.range(4f), y + Mathf.range(4f)); Effects.effect(Fx.fire, x + Mathf.range(4f), y + Mathf.range(4f));
} }
if(Mathf.chance(0.05 * Time.delta())){ if(Mathf.chance(0.05 * Time.delta())){
Effects.effect(EnvironmentFx.smoke, x + Mathf.range(4f), y + Mathf.range(4f)); Effects.effect(Fx.fireSmoke, x + Mathf.range(4f), y + Mathf.range(4f));
} }
if(Net.client()){ if(Net.client()){
@@ -21,8 +21,7 @@ import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.traits.SaveTrait; import io.anuke.mindustry.entities.traits.SaveTrait;
import io.anuke.mindustry.entities.traits.SyncTrait; import io.anuke.mindustry.entities.traits.SyncTrait;
@@ -85,7 +84,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai
Puddle p = map.get(tile.pos()); Puddle p = map.get(tile.pos());
if(generation == 0 && p != null && p.lastRipple <= Time.time() - 40f){ if(generation == 0 && p != null && p.lastRipple <= Time.time() - 40f){
Effects.effect(BlockFx.ripple, tile.floor().liquidDrop.color, Effects.effect(Fx.ripple, tile.floor().liquidDrop.color,
(tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f);
p.lastRipple = Time.time(); p.lastRipple = Time.time();
} }
@@ -108,7 +107,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai
p.accepting = Math.max(amount, p.accepting); p.accepting = Math.max(amount, p.accepting);
if(generation == 0 && p.lastRipple <= Time.time() - 40f && p.amount >= maxLiquid / 2f){ if(generation == 0 && p.lastRipple <= Time.time() - 40f && p.amount >= maxLiquid / 2f){
Effects.effect(BlockFx.ripple, p.liquid.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); Effects.effect(Fx.ripple, p.liquid.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f);
p.lastRipple = Time.time(); p.lastRipple = Time.time();
} }
}else{ }else{
@@ -134,12 +133,12 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai
} }
}else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot puddle }else if(dest.temperature > 0.7f && liquid.temperature < 0.55f){ //cold liquid poured onto hot puddle
if(Mathf.chance(0.5f * amount)){ if(Mathf.chance(0.5f * amount)){
Effects.effect(EnvironmentFx.steam, x, y); Effects.effect(Fx.steam, x, y);
} }
return -0.1f * amount; return -0.1f * amount;
}else if(liquid.temperature > 0.7f && dest.temperature < 0.55f){ //hot liquid poured onto cold puddle }else if(liquid.temperature > 0.7f && dest.temperature < 0.55f){ //hot liquid poured onto cold puddle
if(Mathf.chance(0.8f * amount)){ if(Mathf.chance(0.8f * amount)){
Effects.effect(EnvironmentFx.steam, x, y); Effects.effect(Fx.steam, x, y);
} }
return -0.4f * amount; return -0.4f * amount;
} }
@@ -209,7 +208,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai
unit.applyEffect(liquid.effect, 0.5f); unit.applyEffect(liquid.effect, 0.5f);
if(unit.velocity().len() > 0.1){ if(unit.velocity().len() > 0.1){
Effects.effect(BlockFx.ripple, liquid.color, unit.x, unit.y); Effects.effect(Fx.ripple, liquid.color, unit.x, unit.y);
} }
}); });
@@ -16,7 +16,7 @@ import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -285,7 +285,7 @@ public interface BuilderTrait extends Entity{
} }
if(Mathf.chance(0.06 * Time.delta())){ if(Mathf.chance(0.06 * Time.delta())){
Effects.effect(BlockFx.pulverizeSmall, Effects.effect(Fx.pulverizeSmall,
tile.worldx() + Mathf.range(tilesize / 2f), tile.worldx() + Mathf.range(tilesize / 2f),
tile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color); tile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color);
} }
@@ -2,7 +2,7 @@ package io.anuke.mindustry.entities.traits;
import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote; import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.gen.Call;
import io.anuke.arc.entities.Effects; import io.anuke.arc.entities.Effects;
@@ -26,7 +26,7 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{
if(trait.getCarry() != null){ //already carrying something, drop it if(trait.getCarry() != null){ //already carrying something, drop it
//drop current //drop current
Effects.effect(UnitFx.unitDrop, trait.getCarry()); Effects.effect(Fx.unitDrop, trait.getCarry());
trait.getCarry().setCarrier(null); trait.getCarry().setCarrier(null);
trait.setCarry(null); trait.setCarry(null);
@@ -37,7 +37,7 @@ public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{
trait.setCarry(unit); trait.setCarry(unit);
unit.setCarrier(trait); unit.setCarrier(trait);
Effects.effect(UnitFx.unitPickup, trait); Effects.effect(Fx.unitPickup, trait);
} }
} }
@@ -14,7 +14,7 @@ import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.util.Interval; import io.anuke.arc.util.Interval;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -77,7 +77,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
unit.onSuperDeath(); unit.onSuperDeath();
ScorchDecal.create(unit.x, unit.y); ScorchDecal.create(unit.x, unit.y);
Effects.effect(ExplosionFx.explosion, unit); Effects.effect(Fx.explosion, unit);
Effects.shake(2f, 2f, unit); Effects.shake(2f, 2f, unit);
//must run afterwards so the unit's group is not null when sending the removal packet //must run afterwards so the unit's group is not null when sending the removal packet
@@ -12,7 +12,7 @@ import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.effect.ItemTransfer; import io.anuke.mindustry.entities.effect.ItemTransfer;
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest; import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
@@ -57,7 +57,7 @@ public abstract class InputHandler implements InputProcessor{
throw new ValidateException(player, "Player cannot drop an item."); throw new ValidateException(player, "Player cannot drop an item.");
} }
Effects.effect(EnvironmentFx.dropItem, Color.WHITE, player.x, player.y, angle, player.inventory.getItem().item); Effects.effect(Fx.dropItem, Color.WHITE, player.x, player.y, angle, player.inventory.getItem().item);
player.inventory.clearItem(); player.inventory.clearItem();
} }
@@ -19,7 +19,7 @@ import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.util.Align; import io.anuke.arc.util.Align;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
+1 -1
View File
@@ -10,7 +10,7 @@ import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
@@ -6,7 +6,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.effect.Puddle; import io.anuke.mindustry.entities.effect.Puddle;
@@ -157,13 +157,13 @@ public abstract class BaseBlock extends MappableContent{
tile.entity.damage(1 * Time.delta()); tile.entity.damage(1 * Time.delta());
next.entity.damage(1 * Time.delta()); next.entity.damage(1 * Time.delta());
if(Mathf.chance(0.1 * Time.delta())){ if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(EnvironmentFx.fire, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); Effects.effect(Fx.fire, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
} }
}else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || }else if((liquid.temperature > 0.7f && other.temperature < 0.55f) ||
(other.temperature > 0.7f && liquid.temperature < 0.55f)){ (other.temperature > 0.7f && liquid.temperature < 0.55f)){
tile.entity.liquids.remove(liquid, Math.min(tile.entity.liquids.get(liquid), 0.7f * Time.delta())); tile.entity.liquids.remove(liquid, Math.min(tile.entity.liquids.get(liquid), 0.7f * Time.delta()));
if(Mathf.chance(0.2f * Time.delta())){ if(Mathf.chance(0.2f * Time.delta())){
Effects.effect(EnvironmentFx.steam, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f); Effects.effect(Fx.steam, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
} }
} }
} }
@@ -9,8 +9,7 @@ import io.anuke.arc.entities.Effects;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -103,7 +102,7 @@ public class BuildBlock extends Block{
@Override @Override
public void onDestroyed(Tile tile){ public void onDestroyed(Tile tile){
Effects.effect(ExplosionFx.blockExplosionSmoke, tile); Effects.effect(Fx.blockExplosionSmoke, tile);
if(!tile.floor().solid && !tile.floor().isLiquid){ if(!tile.floor().solid && !tile.floor().isLiquid){
RubbleDecal.create(tile.drawx(), tile.drawy(), size); RubbleDecal.create(tile.drawx(), tile.drawy(), size);
@@ -11,7 +11,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry; import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.type.StatusEffect;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
@@ -33,9 +33,9 @@ public class Floor extends Block{
/** How many ticks it takes to drown on this. */ /** How many ticks it takes to drown on this. */
public float drownTime = 0f; public float drownTime = 0f;
/** Effect when walking on this floor. */ /** Effect when walking on this floor. */
public Effect walkEffect = BlockFx.ripple; public Effect walkEffect = Fx.ripple;
/** Effect displayed when drowning on this floor. */ /** Effect displayed when drowning on this floor. */
public Effect drownUpdateEffect = BlockFx.bubble; public Effect drownUpdateEffect = Fx.bubble;
/** Status effect applied when walking on. */ /** Status effect applied when walking on. */
public StatusEffect status = StatusEffects.none; public StatusEffect status = StatusEffects.none;
/** Intensity of applied status effect. */ /** Intensity of applied status effect. */
@@ -8,7 +8,7 @@ import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.g2d.Draw; import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.geom.Rectangle; import io.anuke.arc.math.geom.Rectangle;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
@@ -21,8 +21,8 @@ import java.io.IOException;
public class Door extends Wall{ public class Door extends Wall{
protected final Rectangle rect = new Rectangle(); protected final Rectangle rect = new Rectangle();
protected Effect openfx = BlockFx.dooropen; protected Effect openfx = Fx.dooropen;
protected Effect closefx = BlockFx.doorclose; protected Effect closefx = Fx.doorclose;
protected TextureRegion openRegion; protected TextureRegion openRegion;
@@ -13,8 +13,7 @@ import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.traits.AbsorbTrait; import io.anuke.mindustry.entities.traits.AbsorbTrait;
import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Palette;
@@ -94,7 +93,7 @@ public class ForceProjector extends Block {
entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : 1f, 0.05f); entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : 1f, 0.05f);
if(Mathf.chance(Time.delta() * entity.buildup / breakage * 0.1f)){ if(Mathf.chance(Time.delta() * entity.buildup / breakage * 0.1f)){
Effects.effect(BlockFx.reactorsmoke, tile.drawx() + Mathf.range(tilesize/2f), tile.drawy() + Mathf.range(tilesize/2f)); Effects.effect(Fx.reactorsmoke, tile.drawx() + Mathf.range(tilesize/2f), tile.drawy() + Mathf.range(tilesize/2f));
} }
// Use Cases: // Use Cases:
@@ -137,7 +136,7 @@ public class ForceProjector extends Block {
if(entity.buildup >= breakage && !entity.broken){ if(entity.buildup >= breakage && !entity.broken){
entity.broken = true; entity.broken = true;
entity.buildup = breakage; entity.buildup = breakage;
Effects.effect(BlockFx.shieldBreak, tile.drawx(), tile.drawy(), radius); Effects.effect(Fx.shieldBreak, tile.drawx(), tile.drawy(), radius);
} }
if(entity.hit > 0f){ if(entity.hit > 0f){
@@ -151,7 +150,7 @@ public class ForceProjector extends Block {
AbsorbTrait trait = (AbsorbTrait)bullet; AbsorbTrait trait = (AbsorbTrait)bullet;
if(trait.canBeAbsorbed() && trait.getTeam() != tile.getTeam() && isInsideHexagon(trait.getX(), trait.getY(), realRadius * 2f, tile.drawx(), tile.drawy())){ if(trait.canBeAbsorbed() && trait.getTeam() != tile.getTeam() && isInsideHexagon(trait.getX(), trait.getY(), realRadius * 2f, tile.drawx(), tile.drawy())){
trait.absorb(); trait.absorb();
Effects.effect(BulletFx.absorb, trait); Effects.effect(Fx.absorb, trait);
float relativeDamagePowerDraw = trait.getShieldDamage() * powerDamage / consumePower.powerCapacity; float relativeDamagePowerDraw = trait.getShieldDamage() * powerDamage / consumePower.powerCapacity;
entity.hit = 1f; entity.hit = 1f;
@@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp; import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -68,7 +68,7 @@ public class MendProjector extends Block{
if(entity.charge >= reload){ if(entity.charge >= reload){
float realRange = range + entity.phaseHeat * phaseRangeBoost; float realRange = range + entity.phaseHeat * phaseRangeBoost;
Effects.effect(BlockFx.healWaveMend, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); Effects.effect(Fx.healWaveMend, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange);
entity.charge = 0f; entity.charge = 0f;
int tileRange = (int)(realRange / tilesize); int tileRange = (int)(realRange / tilesize);
@@ -85,7 +85,7 @@ public class MendProjector extends Block{
if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null && other.entity.health < other.entity.maxHealth()){ if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null && other.entity.health < other.entity.maxHealth()){
other.entity.healBy(other.entity.maxHealth() * (healPercent + entity.phaseHeat*phaseBoost)/100f * entity.power.satisfaction); other.entity.healBy(other.entity.maxHealth() * (healPercent + entity.phaseHeat*phaseBoost)/100f * entity.power.satisfaction);
Effects.effect(BlockFx.healBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); Effects.effect(Fx.healBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size);
healed.add(other.pos()); healed.add(other.pos());
} }
} }
@@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp; import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -70,7 +70,7 @@ public class OverdriveProjector extends Block{
float realRange = range + entity.phaseHeat * phaseRangeBoost; float realRange = range + entity.phaseHeat * phaseRangeBoost;
float realBoost = (speedBoost + entity.phaseHeat*speedBoostPhase) * entity.power.satisfaction; float realBoost = (speedBoost + entity.phaseHeat*speedBoostPhase) * entity.power.satisfaction;
Effects.effect(BlockFx.overdriveWave, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange); Effects.effect(Fx.overdriveWave, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange);
entity.charge = 0f; entity.charge = 0f;
int tileRange = (int)(realRange / tilesize); int tileRange = (int)(realRange / tilesize);
@@ -88,7 +88,7 @@ public class OverdriveProjector extends Block{
if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null){ if(other.getTeamID() == tile.getTeamID() && !healed.contains(other.pos()) && other.entity != null){
other.entity.timeScaleDuration = Math.max(other.entity.timeScaleDuration, reload + 1f); other.entity.timeScaleDuration = Math.max(other.entity.timeScaleDuration, reload + 1f);
other.entity.timeScale = Math.max(other.entity.timeScale, realBoost); other.entity.timeScale = Math.max(other.entity.timeScale, realBoost);
Effects.effect(BlockFx.overdriveBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size); Effects.effect(Fx.overdriveBlockFull, Tmp.c1.set(color).lerp(phase, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size);
healed.add(other.pos()); healed.add(other.pos());
} }
} }
@@ -4,7 +4,7 @@ import io.anuke.arc.entities.Effects;
import io.anuke.arc.entities.Effects.Effect; import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -1,6 +1,6 @@
package io.anuke.mindustry.world.blocks.defense.turrets; package io.anuke.mindustry.world.blocks.defense.turrets;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter; import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
@@ -16,7 +16,7 @@ public class CooledTurret extends Turret{
protected float coolantMultiplier = 1f; protected float coolantMultiplier = 1f;
/**Max coolant used per tick.*/ /**Max coolant used per tick.*/
protected float maxCoolantUsed = 1f; protected float maxCoolantUsed = 1f;
protected Effect coolEffect = BlockFx.fuelburn; protected Effect coolEffect = Fx.fuelburn;
public CooledTurret(String name){ public CooledTurret(String name){
super(name); super(name);
@@ -15,7 +15,7 @@ import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.Predict;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.Units;
@@ -16,10 +16,7 @@ import io.anuke.arc.util.Time;
import io.anuke.arc.util.pooling.Pool.Poolable; import io.anuke.arc.util.pooling.Pool.Poolable;
import io.anuke.arc.util.pooling.Pools; import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.Bullets; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.Bullet;
@@ -46,9 +43,9 @@ public class MassDriver extends Block{
protected int minDistribute = 10; protected int minDistribute = 10;
protected float knockback = 4f; protected float knockback = 4f;
protected float reloadTime = 100f; protected float reloadTime = 100f;
protected Effect shootEffect = ShootFx.shootBig2; protected Effect shootEffect = Fx.shootBig2;
protected Effect smokeEffect = ShootFx.shootBigSmoke2; protected Effect smokeEffect = Fx.shootBigSmoke2;
protected Effect recieveEffect = BlockFx.mineBig; protected Effect recieveEffect = Fx.mineBig;
protected float shake = 3f; protected float shake = 3f;
protected final static float powerPercentageUsed = 1.0f; protected final static float powerPercentageUsed = 1.0f;
protected TextureRegion turretRegion; protected TextureRegion turretRegion;
@@ -309,7 +306,7 @@ public class MassDriver extends Block{
int amountDropped = Mathf.random(0, data.items[i]); int amountDropped = Mathf.random(0, data.items[i]);
if(amountDropped > 0){ if(amountDropped > 0){
float angle = Mathf.range(180f); float angle = Mathf.range(180f);
Effects.effect(EnvironmentFx.dropItem, Color.WHITE, bullet.x, bullet.y, angle, content.item(i)); Effects.effect(Fx.dropItem, Color.WHITE, bullet.x, bullet.y, angle, content.item(i));
} }
} }
@@ -7,7 +7,7 @@ import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
@@ -32,8 +32,8 @@ public class ItemLiquidGenerator extends PowerGenerator{
/** Maximum liquid used per frame. */ /** Maximum liquid used per frame. */
protected float maxLiquidGenerate = 0.4f; protected float maxLiquidGenerate = 0.4f;
protected Effects.Effect generateEffect = BlockFx.generatespark; protected Effects.Effect generateEffect = Fx.generatespark;
protected Effects.Effect explodeEffect = BlockFx.generatespark; protected Effects.Effect explodeEffect = Fx.generatespark;
protected Color heatColor = Color.valueOf("ff9b59"); protected Color heatColor = Color.valueOf("ff9b59");
protected TextureRegion topRegion; protected TextureRegion topRegion;
@@ -9,8 +9,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.arc.math.geom.Vector2; import io.anuke.arc.math.geom.Vector2;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.ExplosionFx;
import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
@@ -106,7 +105,7 @@ public class NuclearReactor extends PowerGenerator{
if(entity.heat > smokeThreshold){ if(entity.heat > smokeThreshold){
float smoke = 1.0f + (entity.heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0 float smoke = 1.0f + (entity.heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0
if(Mathf.chance(smoke / 20.0 * entity.delta())){ if(Mathf.chance(smoke / 20.0 * entity.delta())){
Effects.effect(BlockFx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f), Effects.effect(Fx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f),
tile.worldy() + Mathf.random(size * tilesize / 2f)); tile.worldy() + Mathf.random(size * tilesize / 2f));
} }
} }
@@ -131,9 +130,9 @@ public class NuclearReactor extends PowerGenerator{
if(fuel < 5 && entity.heat < 0.5f) return; if(fuel < 5 && entity.heat < 0.5f) return;
Effects.shake(6f, 16f, tile.worldx(), tile.worldy()); Effects.shake(6f, 16f, tile.worldx(), tile.worldy());
Effects.effect(ExplosionFx.nuclearShockwave, tile.worldx(), tile.worldy()); Effects.effect(Fx.nuclearShockwave, tile.worldx(), tile.worldy());
for(int i = 0; i < 6; i++){ for(int i = 0; i < 6; i++){
Time.run(Mathf.random(40), () -> Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy())); Time.run(Mathf.random(40), () -> Effects.effect(Fx.nuclearcloud, tile.worldx(), tile.worldy()));
} }
Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4); Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4);
@@ -142,14 +141,14 @@ public class NuclearReactor extends PowerGenerator{
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
Time.run(Mathf.random(50), () -> { Time.run(Mathf.random(50), () -> {
tr.rnd(Mathf.random(40f)); tr.rnd(Mathf.random(40f));
Effects.effect(ExplosionFx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy()); Effects.effect(Fx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy());
}); });
} }
for(int i = 0; i < 70; i++){ for(int i = 0; i < 70; i++){
Time.run(Mathf.random(80), () -> { Time.run(Mathf.random(80), () -> {
tr.rnd(Mathf.random(120f)); tr.rnd(Mathf.random(120f));
Effects.effect(BlockFx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy()); Effects.effect(Fx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy());
}); });
} }
} }
@@ -10,7 +10,7 @@ import io.anuke.arc.math.RandomXS128;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -12,7 +12,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.graphics.Layer;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
@@ -48,11 +48,11 @@ public class Drill extends Block{
/**Whether to draw the item this drill is mining.*/ /**Whether to draw the item this drill is mining.*/
protected boolean drawMineItem = false; protected boolean drawMineItem = false;
/**Effect played when an item is produced. This is colored.*/ /**Effect played when an item is produced. This is colored.*/
protected Effect drillEffect = BlockFx.mine; protected Effect drillEffect = Fx.mine;
/**Speed the drill bit rotates at.*/ /**Speed the drill bit rotates at.*/
protected float rotateSpeed = 2f; protected float rotateSpeed = 2f;
/**Effect randomly played while drilling.*/ /**Effect randomly played while drilling.*/
protected Effect updateEffect = BlockFx.pulverizeSmall; protected Effect updateEffect = Fx.pulverizeSmall;
/**Chance the update effect will appear.*/ /**Chance the update effect will appear.*/
protected float updateEffectChance = 0.02f; protected float updateEffectChance = 0.02f;
@@ -2,8 +2,7 @@ package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.Core; import io.anuke.arc.Core;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
@@ -26,7 +25,7 @@ public class GenericCrafter extends Block{
protected Item output; protected Item output;
protected float craftTime = 80; protected float craftTime = 80;
protected Effect craftEffect = BlockFx.purify; protected Effect craftEffect = Fx.purify;
protected Effect updateEffect = Fx.none; protected Effect updateEffect = Fx.none;
protected float updateEffectChance = 0.04f; protected float updateEffectChance = 0.04f;
@@ -7,7 +7,7 @@ import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill; import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
@@ -15,7 +15,7 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
public class Incinerator extends Block{ public class Incinerator extends Block{
protected Effect effect = BlockFx.fuelburn; protected Effect effect = Fx.fuelburn;
protected Color flameColor = Color.valueOf("ffad9d"); protected Color flameColor = Color.valueOf("ffad9d");
public Incinerator(String name){ public Incinerator(String name){
@@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.Core; import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemStack;
@@ -41,8 +41,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 craftTime = 20f; //time to craft one item, so max 3 items per second by default
protected float burnEffectChance = 0.01f; protected float burnEffectChance = 0.01f;
protected Effect craftEffect = BlockFx.smelt, protected Effect craftEffect = Fx.smelt,
burnEffect = BlockFx.fuelburn; burnEffect = Fx.fuelburn;
protected Color flameColor = Color.valueOf("ffc999"); protected Color flameColor = Color.valueOf("ffc999");
protected TextureRegion topRegion; protected TextureRegion topRegion;
@@ -1,7 +1,7 @@
package io.anuke.mindustry.world.blocks.production; package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemStack;
@@ -32,7 +32,7 @@ public class Smelter extends Block{
protected float craftTime = 20f; protected float craftTime = 20f;
protected float burnDuration = 50f; protected float burnDuration = 50f;
protected Effect craftEffect = BlockFx.smelt, burnEffect = BlockFx.fuelburn; protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn;
protected Color flameColor = Color.valueOf("ffb879"); protected Color flameColor = Color.valueOf("ffb879");
public Smelter(String name){ public Smelter(String name){
@@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.production;
import io.anuke.arc.Core; import io.anuke.arc.Core;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
@@ -12,7 +12,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.UnitTypes; import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -13,7 +13,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.scene.ui.ButtonGroup; import io.anuke.arc.scene.ui.ButtonGroup;
import io.anuke.arc.scene.ui.ImageButton; import io.anuke.arc.scene.ui.ImageButton;
import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.BaseUnit;
@@ -35,7 +35,7 @@ public class CommandCenter extends Block{
protected TextureRegion[] commandRegions = new TextureRegion[UnitCommand.values().length]; protected TextureRegion[] commandRegions = new TextureRegion[UnitCommand.values().length];
protected Color topColor = Palette.command; protected Color topColor = Palette.command;
protected Color bottomColor = Color.valueOf("5e5e5e"); protected Color bottomColor = Color.valueOf("5e5e5e");
protected Effect effect = BlockFx.commandSend; protected Effect effect = Fx.commandSend;
public CommandCenter(String name){ public CommandCenter(String name){
super(name); super(name);
@@ -12,7 +12,7 @@ import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -24,7 +24,6 @@ import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.type.Mech; import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.meta.BlockStat;
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
@@ -11,7 +11,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time; import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Unit;
@@ -10,7 +10,7 @@ import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.entities.units.UnitType;
@@ -64,7 +64,7 @@ public class UnitFactory extends Block{
entity.buildTime = 0f; entity.buildTime = 0f;
Effects.shake(2f, 3f, entity); Effects.shake(2f, 3f, entity);
Effects.effect(BlockFx.producesmoke, tile.drawx(), tile.drawy()); Effects.effect(Fx.producesmoke, tile.drawx(), tile.drawy());
if(!Net.client()){ if(!Net.client()){
BaseUnit unit = factory.type.create(tile.getTeam()); BaseUnit unit = factory.type.create(tile.getTeam());