Memory optimizations, multithreading fixes, uCore updated

This commit is contained in:
Anuken
2018-06-05 14:03:08 -04:00
parent c5ed0afb4e
commit 917e2e40fb
87 changed files with 1018 additions and 752 deletions

View File

@@ -1,7 +1,9 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.bullets.*;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.type.ContentList;
@@ -160,4 +162,9 @@ public class AmmoTypes implements ContentList {
cryofluid = new AmmoType(Liquids.cryofluid, TurretBullets.cryoShot, 0.3f);
}
@Override
public Array<? extends Content> getAll() {
return AmmoType.all();
}
}

View File

@@ -1,6 +1,8 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
@@ -80,4 +82,9 @@ public class Items implements ContentList{
explosiveness = 0.2f;
}};
}
@Override
public Array<? extends Content> getAll() {
return Item.all();
}
}

View File

@@ -1,6 +1,8 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Liquid;
@@ -43,6 +45,10 @@ public class Liquids implements ContentList {
effect = StatusEffects.freezing;
}
};
}
@Override
public Array<? extends Content> getAll() {
return Liquid.all();
}
}

View File

@@ -1,7 +1,10 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.type.Upgrade;
public class Mechs implements ContentList {
public static Mech standard, standardShip;
@@ -17,4 +20,9 @@ public class Mechs implements ContentList {
drillPower = 1;
}};
}
@Override
public Array<? extends Content> getAll() {
return Upgrade.all();
}
}

View File

@@ -1,6 +1,8 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Recipe;
@@ -127,4 +129,9 @@ public class Recipes implements ContentList{
new Recipe(units, DebugBlocks.powerVoid, new ItemStack(Items.steel, 10)).setDebug();
new Recipe(units, DebugBlocks.powerInfinite, new ItemStack(Items.steel, 10), new ItemStack(Items.surgealloy, 5)).setDebug();
}
@Override
public Array<? extends Content> getAll() {
return Recipe.all();
}
}

View File

@@ -1,7 +1,9 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.entities.StatusController.TransitionResult;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.StatusEffect;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.type.ContentList;
@@ -124,4 +126,9 @@ public class StatusEffects implements ContentList {
freezing.setOpposites(burning, melting);
burning.setOpposites(wet, freezing);
}
@Override
public Array<? extends Content> getAll() {
return StatusEffect.all();
}
}

View File

@@ -1,10 +1,13 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.entities.units.types.Drone;
import io.anuke.mindustry.entities.units.types.Scout;
import io.anuke.mindustry.entities.units.types.Vtol;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.StatusEffect;
public class UnitTypes implements ContentList {
public static UnitType drone, scout, vtol;
@@ -36,4 +39,9 @@ public class UnitTypes implements ContentList {
setAmmo(AmmoTypes.bulletIron);
}};
}
@Override
public Array<? extends Content> getAll() {
return StatusEffect.all();
}
}

View File

@@ -1,7 +1,10 @@
package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Upgrade;
import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList {
@@ -18,4 +21,9 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletIron);
}};
}
@Override
public Array<? extends Content> getAll() {
return Upgrade.all();
}
}

View File

@@ -0,0 +1,14 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.world.Block;
public abstract class BlockList implements ContentList {
@Override
public Array<? extends Content> getAll() {
return Block.all();
}
}

View File

@@ -11,7 +11,7 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.types.*;
public class Blocks implements ContentList{
public class Blocks extends BlockList implements ContentList{
public static Block air, spawn, blockpart, build1, build2, build3, build4, build5, build6, defaultFloor, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, iron, lead, coal, titanium, thorium, dirt, sand, ice, snow, grass, sandblock, snowblock, stoneblock, blackstoneblock, grassblock, mossblock, shrub, rock, icerock, blackrock, dirtblock;
@Override

View File

@@ -10,7 +10,7 @@ import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.production.*;
public class CraftingBlocks implements ContentList {
public class CraftingBlocks extends BlockList implements ContentList {
public static Block smelter, alloysmelter, siliconsmelter, poweralloysmelter, powersmelter, cryofluidmixer, melter, separator, centrifuge, plasticFormer, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, weaponFactory, incinerator;
@Override

View File

@@ -20,7 +20,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
public class DebugBlocks implements ContentList{
public class DebugBlocks extends BlockList implements ContentList{
public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid;
@Override

View File

@@ -7,7 +7,7 @@ import io.anuke.mindustry.world.blocks.types.Wall;
import io.anuke.mindustry.world.blocks.types.defense.Door;
import io.anuke.mindustry.world.blocks.types.defense.ShieldedWallBlock;
public class DefenseBlocks implements ContentList {
public class DefenseBlocks extends BlockList implements ContentList {
public static Block stonewall, ironwall, steelwall, titaniumwall, diriumwall, compositewall, steelwalllarge, titaniumwalllarge, diriumwalllarge, titaniumshieldwall, door, largedoor;
@Override

View File

@@ -4,7 +4,7 @@ import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.distribution.*;
public class DistributionBlocks implements ContentList{
public class DistributionBlocks extends BlockList implements ContentList{
public static Block conveyor, steelconveyor, pulseconveyor, router, multiplexer, junction, bridgeconveyor, laserconveyor, sorter, splitter, overflowgate;
@Override

View File

@@ -5,7 +5,7 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.types.distribution.*;
import io.anuke.mindustry.world.blocks.types.production.Pump;
public class LiquidBlocks implements ContentList{
public class LiquidBlocks extends BlockList implements ContentList{
public static Block pump, fluxpump, conduit, pulseconduit, liquidrouter, liquidtank, liquidjunction, bridgeconduit, laserconduit;
@Override

View File

@@ -8,7 +8,7 @@ import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
import io.anuke.mindustry.world.blocks.types.distribution.Teleporter;
import io.anuke.mindustry.world.blocks.types.power.*;
public class PowerBlocks implements ContentList {
public class PowerBlocks extends BlockList implements ContentList {
public static Block combustiongenerator, thermalgenerator, liquidcombustiongenerator, rtgenerator, solarpanel, largesolarpanel, nuclearReactor, fusionReactor, repairturret, megarepairturret, shieldgenerator, battery, batteryLarge, powernode, powernodelarge, teleporter;
@Override
@@ -95,7 +95,7 @@ public class PowerBlocks implements ContentList {
powerSpeed = 1f;
maxNodes = 5;
laserRange = 7.5f;
shadow = "powernodelarge-shadow";
shadow = "shadow-round-2";
}};
teleporter = new Teleporter("teleporter");

View File

@@ -11,7 +11,7 @@ import io.anuke.mindustry.world.blocks.types.production.Drill;
import io.anuke.mindustry.world.blocks.types.production.Fracker;
import io.anuke.mindustry.world.blocks.types.production.SolidPump;
public class ProductionBlocks implements ContentList {
public class ProductionBlocks extends BlockList implements ContentList {
public static Block ironDrill, reinforcedDrill, steelDrill, titaniumDrill, laserdrill, nucleardrill, plasmadrill, waterextractor, oilextractor, cultivator;
@Override

View File

@@ -7,7 +7,7 @@ import io.anuke.mindustry.world.blocks.types.storage.SortedUnloader;
import io.anuke.mindustry.world.blocks.types.storage.Unloader;
import io.anuke.mindustry.world.blocks.types.storage.Vault;
public class StorageBlocks implements ContentList {
public class StorageBlocks extends BlockList implements ContentList {
public static Block core, vault, unloader, sortedunloader;
@Override

View File

@@ -10,7 +10,7 @@ import io.anuke.mindustry.world.blocks.types.units.RepairPoint;
import io.anuke.mindustry.world.blocks.types.units.ResupplyPoint;
import io.anuke.mindustry.world.blocks.types.units.UnitFactory;
public class UnitBlocks implements ContentList {
public class UnitBlocks extends BlockList implements ContentList {
public static Block resupplyPoint, repairPoint, droneFactory, dropPoint;
@Override

View File

@@ -12,7 +12,7 @@ import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
public class WeaponBlocks implements ContentList {
public class WeaponBlocks extends BlockList implements ContentList {
public static Block duo, scatter, scorch, hail, wave, crux, lancer, arc, swarmer, ripple, cyclone, fuse, spectre, eraser, meltdown;
@Override

View File

@@ -5,80 +5,74 @@ import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.ContentList;
public class ArtilleryBullets implements ContentList{
public class ArtilleryBullets extends BulletList implements ContentList{
public static BulletType lead, thorium, plastic, homing, incindiary, surge;
@Override
public void load() {
lead = new BasicBulletType(3f, 0) {
lead = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
thorium = new BasicBulletType(3f, 0) {
thorium = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
plastic = new BasicBulletType(3f, 0) {
plastic = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
homing = new BasicBulletType(3f, 0) {
homing = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
incindiary = new BasicBulletType(3f, 0) {
incindiary = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
surge = new BasicBulletType(3f, 0) {
surge = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
lifetime = 90f;
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};

View File

@@ -0,0 +1,14 @@
package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
public abstract class BulletList implements ContentList {
@Override
public Array<? extends Content> getAll() {
return BulletType.all();
}
}

View File

@@ -4,34 +4,34 @@ import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.ContentList;
public class FlakBullets implements ContentList {
public class FlakBullets extends BulletList implements ContentList {
public static BulletType lead, plastic, explosive, surge;
@Override
public void load() {
lead = new BasicBulletType(3f, 5) {
lead = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
plastic = new BasicBulletType(3f, 5) {
plastic = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
explosive = new BasicBulletType(3f, 5) {
explosive = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
surge = new BasicBulletType(3f, 5) {
surge = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;

View File

@@ -4,27 +4,27 @@ import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.ContentList;
public class MissileBullets implements ContentList {
public class MissileBullets extends BulletList implements ContentList {
public static BulletType explosive, incindiary, surge;
@Override
public void load() {
explosive = new BasicBulletType(3f, 5) {
explosive = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
incindiary = new BasicBulletType(3f, 5) {
incindiary = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
surge = new BasicBulletType(3f, 5) {
surge = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;

View File

@@ -6,13 +6,13 @@ import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.ContentList;
public class ShellBullets implements ContentList {
public class ShellBullets extends BulletList implements ContentList {
public static BulletType lead, leadShard, thorium, thoriumShard, plastic, plasticShard, explosive, explosiveShard, incindiary;
@Override
public void load() {
lead = new BasicBulletType(3f, 0) {
lead = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -20,12 +20,11 @@ public class ShellBullets implements ContentList {
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
leadShard = new BasicBulletType(3f, 0) {
leadShard = new BasicBulletType(3f, 0, "shell") {
{
drag = 0.1f;
hiteffect = Fx.none;
@@ -38,7 +37,7 @@ public class ShellBullets implements ContentList {
}
};
thorium = new BasicBulletType(3f, 0) {
thorium = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -46,12 +45,11 @@ public class ShellBullets implements ContentList {
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
thoriumShard = new BasicBulletType(3f, 0) {
thoriumShard = new BasicBulletType(3f, 0, "shell") {
{
drag = 0.1f;
hiteffect = Fx.none;
@@ -64,7 +62,7 @@ public class ShellBullets implements ContentList {
}
};
plastic = new BasicBulletType(3f, 0) {
plastic = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -72,12 +70,11 @@ public class ShellBullets implements ContentList {
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
plasticShard = new BasicBulletType(3f, 0) {
plasticShard = new BasicBulletType(3f, 0, "shell") {
{
drag = 0.1f;
hiteffect = Fx.none;
@@ -90,7 +87,7 @@ public class ShellBullets implements ContentList {
}
};
explosive = new BasicBulletType(3f, 0) {
explosive = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -98,12 +95,11 @@ public class ShellBullets implements ContentList {
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};
explosiveShard = new BasicBulletType(3f, 0) {
explosiveShard = new BasicBulletType(3f, 0, "shell") {
{
drag = 0.1f;
hiteffect = Fx.none;
@@ -116,7 +112,7 @@ public class ShellBullets implements ContentList {
}
};
incindiary = new BasicBulletType(3f, 0) {
incindiary = new BasicBulletType(3f, 0, "shell") {
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -124,7 +120,6 @@ public class ShellBullets implements ContentList {
drag = 0.01f;
bulletWidth = bulletHeight = 9f;
fragBullet = leadShard;
bulletSprite = "frag";
bulletShrink = 0.1f;
}
};

View File

@@ -4,48 +4,48 @@ import io.anuke.mindustry.entities.bullet.BasicBulletType;
import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.type.ContentList;
public class StandardBullets implements ContentList {
public class StandardBullets extends BulletList implements ContentList {
public static BulletType iron, lead, steel, thorium, homing, tracer;
@Override
public void load() {
iron = new BasicBulletType(3f, 5) {
iron = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
lead = new BasicBulletType(3f, 5) {
lead = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
steel = new BasicBulletType(3f, 5) {
steel = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
thorium = new BasicBulletType(3f, 5) {
thorium = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
homing = new BasicBulletType(3f, 5) {
homing = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
tracer = new BasicBulletType(3f, 5) {
tracer = new BasicBulletType(3f, 5, "bullet") {
{
bulletWidth = 7f;
bulletHeight = 9f;

View File

@@ -24,7 +24,7 @@ import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.world;
public class TurretBullets implements ContentList {
public class TurretBullets extends BulletList implements ContentList {
public static BulletType fireball, basicFlame, lancerLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning;
@Override

View File

@@ -15,7 +15,7 @@ import io.anuke.ucore.util.Tmp;
import static io.anuke.mindustry.Vars.tilesize;
public class BlockFx implements ContentList{
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;
@Override
@@ -48,7 +48,7 @@ public class BlockFx implements ContentList{
redgeneratespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.fin());
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();
@@ -57,7 +57,7 @@ public class BlockFx implements ContentList{
generatespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
float len = e.fout() * 4f;
Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.fin());
Draw.color(Palette.orangeSpark, Color.GRAY, e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset();
});
@@ -86,14 +86,14 @@ public class BlockFx implements ContentList{
});
pulverizeRed = new Effect(40, e -> {
Angles.randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> {
Draw.color(Color.valueOf("ffa480"), Palette.stoneGray, e.fin());
Draw.color(Palette.redDust, Palette.stoneGray, e.fin());
Fill.poly(e.x + x, e.y + y, 4, 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(Color.valueOf("ff7b69"), Palette.stoneGray, e.fin());
Draw.color(Palette.redderDust, Palette.stoneGray, e.fin());
Fill.poly(e.x + x, e.y + y, 4, e.fout() * 2.5f + 0.5f, 45);
Draw.reset();
});
@@ -128,7 +128,7 @@ public class BlockFx implements ContentList{
});
formsmoke = new Effect(40, e -> {
Angles.randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> {
Draw.color(Color.valueOf("f1e479"), Color.LIGHT_GRAY, e.fin());
Draw.color(Palette.plasticSmoke, Color.LIGHT_GRAY, e.fin());
Fill.poly(e.x + x, e.y + y, 4, 0.2f + e.fout() * 2f, 45);
Draw.reset();
});

View File

@@ -10,7 +10,7 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class BulletFx implements ContentList {
public class BulletFx extends FxList implements ContentList {
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLancer, despawn, flakExplosion;
@Override

View File

@@ -10,7 +10,7 @@ import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class EnvironmentFx implements ContentList {
public class EnvironmentFx extends FxList implements ContentList {
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily;
@Override

View File

@@ -10,7 +10,7 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class ExplosionFx implements ContentList {
public class ExplosionFx extends FxList implements ContentList {
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
@Override

View File

@@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
import static io.anuke.mindustry.Vars.tilesize;
public class Fx implements ContentList {
public class Fx extends FxList implements ContentList {
public static Effect none, placeBlock, breakBlock, smoke, spawn, tapBlock, select;
@Override
@@ -53,7 +53,7 @@ public class Fx implements ContentList {
});
smoke = new Effect(100, e -> {
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.fin());
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();

View File

@@ -0,0 +1,13 @@
package io.anuke.mindustry.content.fx;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
public abstract class FxList implements ContentList{
@Override
public Array<? extends Content> getAll() {
return Array.with();
}
}

View File

@@ -12,7 +12,7 @@ import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class ShootFx implements ContentList {
public class ShootFx extends FxList implements ContentList {
public static Effect shootSmall, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
@Override

View File

@@ -10,7 +10,7 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class UnitFx implements ContentList {
public class UnitFx extends FxList implements ContentList {
public static Effect vtolHover, unitDrop, unitPickup;
@Override