Rewrite of all static initialization code
This commit is contained in:
@@ -86,6 +86,7 @@ project(":desktop") {
|
|||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||||
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
||||||
|
compile 'com.yuvimasory:orange-extensions:1.3.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
package io.anuke.mindustry;
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
|
||||||
import com.badlogic.gdx.graphics.Pixmap;
|
|
||||||
import com.badlogic.gdx.graphics.Pixmap.Filter;
|
|
||||||
import com.badlogic.gdx.graphics.PixmapIO;
|
|
||||||
import io.anuke.mindustry.core.*;
|
import io.anuke.mindustry.core.*;
|
||||||
import io.anuke.mindustry.core.ContentLoader;
|
|
||||||
import io.anuke.mindustry.io.BundleLoader;
|
import io.anuke.mindustry.io.BundleLoader;
|
||||||
import io.anuke.ucore.modules.ModuleCore;
|
import io.anuke.ucore.modules.ModuleCore;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.Log;
|
||||||
@@ -17,6 +11,8 @@ public class Mindustry extends ModuleCore {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
|
Vars.init();
|
||||||
|
|
||||||
debug = Platform.instance.isDebug();
|
debug = Platform.instance.isDebug();
|
||||||
|
|
||||||
Log.setUseColors(false);
|
Log.setUseColors(false);
|
||||||
|
|||||||
@@ -5,17 +5,15 @@ import com.badlogic.gdx.Gdx;
|
|||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.core.*;
|
import io.anuke.mindustry.core.*;
|
||||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
|
||||||
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.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.entities.effect.Shield;
|
import io.anuke.mindustry.entities.effect.Shield;
|
||||||
import io.anuke.mindustry.core.Platform;
|
|
||||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.net.ClientDebug;
|
import io.anuke.mindustry.io.Version;
|
||||||
import io.anuke.mindustry.net.ServerDebug;
|
|
||||||
import io.anuke.ucore.entities.EffectEntity;
|
import io.anuke.ucore.entities.EffectEntity;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.Entity;
|
import io.anuke.ucore.entities.Entity;
|
||||||
@@ -29,52 +27,43 @@ public class Vars{
|
|||||||
|
|
||||||
public static final boolean testMobile = true;
|
public static final boolean testMobile = true;
|
||||||
//shorthand for whether or not this is running on android or ios
|
//shorthand for whether or not this is running on android or ios
|
||||||
public static final boolean mobile = (Gdx.app.getType() == ApplicationType.Android) ||
|
public static boolean mobile;
|
||||||
Gdx.app.getType() == ApplicationType.iOS || testMobile;
|
public static boolean ios;
|
||||||
public static final boolean ios = Gdx.app.getType() == ApplicationType.iOS;
|
public static boolean android;
|
||||||
public static final boolean android = Gdx.app.getType() == ApplicationType.Android;
|
|
||||||
//shorthand for whether or not this is running on GWT
|
//shorthand for whether or not this is running on GWT
|
||||||
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
|
public static boolean gwt;
|
||||||
//whether to send block state change events to players
|
|
||||||
public static final boolean syncBlockState = false;
|
|
||||||
//how far away from the player blocks can be placed
|
|
||||||
public static final float placerange = 66;
|
|
||||||
//respawn time in frames
|
//respawn time in frames
|
||||||
public static final float respawnduration = 60*4;
|
public static final float respawnduration = 60*4;
|
||||||
//time between waves in frames (on normal mode)
|
//time between waves in frames (on normal mode)
|
||||||
public static final float wavespace = 60*60*(mobile ? 1 : 1);
|
public static final float wavespace = 60*60;
|
||||||
//waves can last no longer than 3 minutes, otherwise the next one spawns
|
//waves can last no longer than 3 minutes, otherwise the next one spawns
|
||||||
public static final float maxwavespace = 60*60*4f;
|
public static final float maxwavespace = 60*60*4f;
|
||||||
//advance time the pathfinding starts at
|
|
||||||
public static final float aheadPathfinding = 60*15;
|
|
||||||
//how far away from spawn points the player can't place blocks
|
|
||||||
public static final float enemyspawnspace = 65;
|
|
||||||
|
|
||||||
public static final float coreBuildRange = 400f;
|
public static final float coreBuildRange = 400f;
|
||||||
//discord group URL
|
//discord group URL
|
||||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||||
|
|
||||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||||
|
|
||||||
//directory for user-created map data
|
//directory for user-created map data
|
||||||
public static final FileHandle customMapDirectory = OS.getAppDataDirectory("Mindustry").child("maps/");
|
public static FileHandle customMapDirectory;
|
||||||
//save file directory
|
//save file directory
|
||||||
public static final FileHandle saveDirectory = OS.getAppDataDirectory("Mindustry").child("saves/");
|
public static FileHandle saveDirectory;
|
||||||
public static final String mapExtension = "mmap";
|
public static String mapExtension = "mmap";
|
||||||
public static final String saveExtension = "msav";
|
public static String saveExtension = "msav";
|
||||||
//scale of the font
|
//scale of the font
|
||||||
public static float fontscale = Math.max(Unit.dp.scl(1f)/2f, 0.5f);
|
public static float fontScale;
|
||||||
//camera zoom displayed on startup
|
//camera zoom displayed on startup
|
||||||
public static final int baseCameraScale = Math.round(Unit.dp.scl(4));
|
public static int baseCameraScale;
|
||||||
//how much the zoom changes every zoom button press (unused?)
|
//how much the zoom changes every zoom button press (unused?)
|
||||||
public static final int zoomScale = Math.round(Unit.dp.scl(1));
|
public static int zoomScale;
|
||||||
//if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available
|
//if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available
|
||||||
public static boolean debug = false;
|
public static boolean debug = false;
|
||||||
public static boolean debugNet = true;
|
public static boolean debugNet = true;
|
||||||
public static boolean console = false;
|
public static boolean console = false;
|
||||||
//whether the player can clip through walls
|
//whether the player can clip through walls
|
||||||
public static boolean noclip = false;
|
public static boolean noclip = false;
|
||||||
//whether to draw chunk borders
|
|
||||||
public static boolean debugChunks = false;
|
|
||||||
//whether turrets have infinite ammo (only with debug)
|
//whether turrets have infinite ammo (only with debug)
|
||||||
public static boolean infiniteAmmo = true;
|
public static boolean infiniteAmmo = true;
|
||||||
//whether to show paths of enemies
|
//whether to show paths of enemies
|
||||||
@@ -130,10 +119,7 @@ public class Vars{
|
|||||||
public static final int webPort = 6568;
|
public static final int webPort = 6568;
|
||||||
|
|
||||||
public static GameState state;
|
public static GameState state;
|
||||||
public static final ThreadHandler threads = new ThreadHandler(Platform.instance.getThreadProvider());
|
public static ThreadHandler threads;
|
||||||
|
|
||||||
public static final ServerDebug serverDebug = new ServerDebug();
|
|
||||||
public static final ClientDebug clientDebug = new ClientDebug();
|
|
||||||
|
|
||||||
public static Control control;
|
public static Control control;
|
||||||
public static Logic logic;
|
public static Logic logic;
|
||||||
@@ -146,19 +132,46 @@ public class Vars{
|
|||||||
|
|
||||||
public static Player[] players = {};
|
public static Player[] players = {};
|
||||||
|
|
||||||
public static final EntityGroup<Player> playerGroup = Entities.addGroup(Player.class).enableMapping();
|
public static EntityGroup<Player> playerGroup;
|
||||||
public static final EntityGroup<TileEntity> tileGroup = Entities.addGroup(TileEntity.class, false);
|
public static EntityGroup<TileEntity> tileGroup;
|
||||||
public static final EntityGroup<Bullet> bulletGroup = Entities.addGroup(Bullet.class);
|
public static EntityGroup<Bullet> bulletGroup;
|
||||||
public static final EntityGroup<Shield> shieldGroup = Entities.addGroup(Shield.class, false);
|
public static EntityGroup<Shield> shieldGroup;
|
||||||
public static final EntityGroup<EffectEntity> effectGroup = Entities.addGroup(EffectEntity.class, false);
|
public static EntityGroup<EffectEntity> effectGroup;
|
||||||
public static final EntityGroup<Entity> groundEffectGroup = Entities.addGroup(Entity.class, false);
|
public static EntityGroup<Entity> groundEffectGroup;
|
||||||
public static final EntityGroup<Puddle> puddleGroup = Entities.addGroup(Puddle.class, false);
|
public static EntityGroup<Puddle> puddleGroup;
|
||||||
public static final EntityGroup<Fire> airItemGroup = Entities.addGroup(Fire.class, false);
|
public static EntityGroup<Fire> airItemGroup;
|
||||||
public static final EntityGroup<BaseUnit>[] unitGroups = new EntityGroup[Team.values().length];
|
public static EntityGroup<BaseUnit>[] unitGroups;
|
||||||
|
|
||||||
|
public static void init(){
|
||||||
|
Version.init();
|
||||||
|
|
||||||
|
playerGroup = Entities.addGroup(Player.class).enableMapping();
|
||||||
|
tileGroup = Entities.addGroup(TileEntity.class, false);
|
||||||
|
bulletGroup = Entities.addGroup(Bullet.class);
|
||||||
|
shieldGroup = Entities.addGroup(Shield.class, false);
|
||||||
|
effectGroup = Entities.addGroup(EffectEntity.class, false);
|
||||||
|
groundEffectGroup = Entities.addGroup(Entity.class, false);
|
||||||
|
puddleGroup = Entities.addGroup(Puddle.class, false);
|
||||||
|
airItemGroup = Entities.addGroup(Fire.class, false);
|
||||||
|
unitGroups = new EntityGroup[Team.values().length];
|
||||||
|
|
||||||
|
threads = new ThreadHandler(Platform.instance.getThreadProvider());
|
||||||
|
|
||||||
static{
|
|
||||||
for(Team team : Team.values()){
|
for(Team team : Team.values()){
|
||||||
unitGroups[team.ordinal()] = Entities.addGroup(BaseUnit.class).enableMapping();
|
unitGroups[team.ordinal()] = Entities.addGroup(BaseUnit.class).enableMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mobile = (Gdx.app.getType() == ApplicationType.Android) ||
|
||||||
|
Gdx.app.getType() == ApplicationType.iOS || testMobile;
|
||||||
|
ios = Gdx.app.getType() == ApplicationType.iOS;
|
||||||
|
android = Gdx.app.getType() == ApplicationType.Android;
|
||||||
|
gwt = Gdx.app.getType() == ApplicationType.WebGL;
|
||||||
|
|
||||||
|
customMapDirectory = OS.getAppDataDirectory("Mindustry").child("maps/");
|
||||||
|
saveDirectory = OS.getAppDataDirectory("Mindustry").child("saves/");
|
||||||
|
|
||||||
|
fontScale = Math.max(Unit.dp.scl(1f)/2f, 0.5f);
|
||||||
|
baseCameraScale = Math.round(Unit.dp.scl(4));
|
||||||
|
zoomScale = Math.round(Unit.dp.scl(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,156 +3,161 @@ package io.anuke.mindustry.content;
|
|||||||
import io.anuke.mindustry.content.bullets.*;
|
import io.anuke.mindustry.content.bullets.*;
|
||||||
import io.anuke.mindustry.content.fx.ShootFx;
|
import io.anuke.mindustry.content.fx.ShootFx;
|
||||||
import io.anuke.mindustry.type.AmmoType;
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class AmmoTypes {
|
public class AmmoTypes implements ContentList {
|
||||||
//TODO add definitions for all ammo types
|
public static AmmoType bulletIron, bulletLead, bulletSteel, bulletThorium, bulletSilicon, bulletThermite, flakLead, flakExplosive, flakPlastic, flakSurge, shellLead, shellExplosive, shellPlastic, shellThorium, missileExplosive, missileIncindiary, missileSurge, artilleryLead, artilleryThorium, artilleryPlastic, artilleryHoming, artilleryIncindiary, basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
|
||||||
public static final AmmoType
|
|
||||||
|
|
||||||
//bullets
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
bulletIron = new AmmoType(Items.iron, StandardBullets.iron, 5){{
|
//bullets
|
||||||
shootEffect = ShootFx.shootSmall;
|
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
|
||||||
}},
|
|
||||||
|
|
||||||
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5){{
|
bulletIron = new AmmoType(Items.iron, StandardBullets.iron, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
bulletSteel = new AmmoType(Items.steel, StandardBullets.steel, 5){{
|
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 5){{
|
bulletSteel = new AmmoType(Items.steel, StandardBullets.steel, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5){{
|
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 5){{
|
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
//flak
|
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 5) {{
|
||||||
|
shootEffect = ShootFx.shootSmall;
|
||||||
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
}};
|
||||||
|
|
||||||
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5){{
|
//flak
|
||||||
shootEffect = ShootFx.shootSmall;
|
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
|
||||||
}},
|
|
||||||
|
|
||||||
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{
|
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
flakPlastic = new AmmoType(Items.plastic, FlakBullets.plastic, 5){{
|
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
|
flakPlastic = new AmmoType(Items.plastic, FlakBullets.plastic, 5) {{
|
||||||
shootEffect = ShootFx.shootSmall;
|
shootEffect = ShootFx.shootSmall;
|
||||||
smokeEffect = ShootFx.shootSmallSmoke;
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
//shells
|
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5) {{
|
||||||
|
shootEffect = ShootFx.shootSmall;
|
||||||
|
smokeEffect = ShootFx.shootSmallSmoke;
|
||||||
|
}};
|
||||||
|
|
||||||
shellLead = new AmmoType(Items.lead, ShellBullets.lead, 1){{
|
//shells
|
||||||
shootEffect = ShootFx.shootBig2;
|
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
|
||||||
}},
|
|
||||||
|
|
||||||
shellExplosive = new AmmoType(Items.blastCompound, ShellBullets.explosive, 1){{
|
shellLead = new AmmoType(Items.lead, ShellBullets.lead, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
shellPlastic = new AmmoType(Items.plastic, ShellBullets.plastic, 1){{
|
shellExplosive = new AmmoType(Items.blastCompound, ShellBullets.explosive, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
shellThorium = new AmmoType(Items.thorium, ShellBullets.thorium, 1){{
|
shellPlastic = new AmmoType(Items.plastic, ShellBullets.plastic, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
//missiles
|
shellThorium = new AmmoType(Items.thorium, ShellBullets.thorium, 1) {{
|
||||||
|
shootEffect = ShootFx.shootBig2;
|
||||||
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
|
}};
|
||||||
|
|
||||||
missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1){{
|
//missiles
|
||||||
shootEffect = ShootFx.shootBig2;
|
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
|
||||||
}},
|
|
||||||
|
|
||||||
missileIncindiary = new AmmoType(Items.thermite, MissileBullets.incindiary, 1){{
|
missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1){{
|
missileIncindiary = new AmmoType(Items.thermite, MissileBullets.incindiary, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
//artillery
|
missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1) {{
|
||||||
|
shootEffect = ShootFx.shootBig2;
|
||||||
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
|
}};
|
||||||
|
|
||||||
artilleryLead = new AmmoType(Items.lead, ArtilleryBullets.lead, 1){{
|
//artillery
|
||||||
shootEffect = ShootFx.shootBig2;
|
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
|
||||||
}},
|
|
||||||
|
|
||||||
artilleryThorium = new AmmoType(Items.thorium, ArtilleryBullets.thorium, 1){{
|
artilleryLead = new AmmoType(Items.lead, ArtilleryBullets.lead, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
artilleryPlastic = new AmmoType(Items.plastic, ArtilleryBullets.plastic, 1){{
|
artilleryThorium = new AmmoType(Items.thorium, ArtilleryBullets.thorium, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1){{
|
artilleryPlastic = new AmmoType(Items.plastic, ArtilleryBullets.plastic, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
artilleryIncindiary = new AmmoType(Items.thermite, ArtilleryBullets.incindiary, 1){{
|
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1) {{
|
||||||
shootEffect = ShootFx.shootBig2;
|
shootEffect = ShootFx.shootBig2;
|
||||||
smokeEffect = ShootFx.shootBigSmoke2;
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
//flame
|
artilleryIncindiary = new AmmoType(Items.thermite, ArtilleryBullets.incindiary, 1) {{
|
||||||
|
shootEffect = ShootFx.shootBig2;
|
||||||
|
smokeEffect = ShootFx.shootBigSmoke2;
|
||||||
|
}};
|
||||||
|
|
||||||
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f){{
|
//flame
|
||||||
shootEffect = ShootFx.shootSmallFlame;
|
|
||||||
}},
|
|
||||||
|
|
||||||
//power
|
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f) {{
|
||||||
|
shootEffect = ShootFx.shootSmallFlame;
|
||||||
|
}};
|
||||||
|
|
||||||
lancerLaser = new AmmoType(TurretBullets.lancerLaser),
|
//power
|
||||||
|
|
||||||
lightning = new AmmoType(TurretBullets.lightning),
|
lancerLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||||
|
|
||||||
spectreLaser = new AmmoType(TurretBullets.lancerLaser),
|
lightning = new AmmoType(TurretBullets.lightning);
|
||||||
|
|
||||||
meltdownLaser = new AmmoType(TurretBullets.lancerLaser),
|
spectreLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||||
|
|
||||||
fuseShotgun = new AmmoType(Items.iron, TurretBullets.fuseShot, 0.1f),
|
meltdownLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||||
|
|
||||||
//liquid
|
fuseShotgun = new AmmoType(Items.iron, TurretBullets.fuseShot, 0.1f);
|
||||||
|
|
||||||
oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f),
|
//liquid
|
||||||
|
|
||||||
water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f),
|
oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f);
|
||||||
|
|
||||||
lava = new AmmoType(Liquids.lava, TurretBullets.lavaShot, 0.3f),
|
water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f);
|
||||||
|
|
||||||
cryofluid = new AmmoType(Liquids.cryofluid, TurretBullets.cryoShot, 0.3f);
|
lava = new AmmoType(Liquids.lava, TurretBullets.lavaShot, 0.3f);
|
||||||
|
|
||||||
|
cryofluid = new AmmoType(Liquids.cryofluid, TurretBullets.cryoShot, 0.3f);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,78 +1,83 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemType;
|
import io.anuke.mindustry.type.ItemType;
|
||||||
|
|
||||||
public class Items {
|
public class Items implements ContentList{
|
||||||
public static final Item
|
public static Item stone, iron, lead, coal, steel, titanium, thorium, silicon, plastic, surgealloy, biomatter, sand, blastCompound, thermite;
|
||||||
|
|
||||||
stone = new Item("stone", Color.valueOf("777777")) {{
|
@Override
|
||||||
hardness = 3;
|
public void load() {
|
||||||
}},
|
|
||||||
|
|
||||||
iron = new Item("iron", Color.valueOf("bc8271")){{
|
stone = new Item("stone", Color.valueOf("777777")) {{
|
||||||
type = ItemType.material;
|
hardness = 3;
|
||||||
hardness = 1;
|
}};
|
||||||
}},
|
|
||||||
|
|
||||||
lead = new Item("lead", Color.valueOf("8e85a2")){{
|
iron = new Item("iron", Color.valueOf("bc8271")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
hardness = 1;
|
hardness = 1;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
coal = new Item("coal", Color.valueOf("272727")) {{
|
lead = new Item("lead", Color.valueOf("8e85a2")) {{
|
||||||
explosiveness = 0.2f;
|
type = ItemType.material;
|
||||||
flammability = 0.5f;
|
hardness = 1;
|
||||||
fluxiness = 0.3f;
|
}};
|
||||||
hardness = 2;
|
|
||||||
}},
|
|
||||||
|
|
||||||
steel = new Item("steel", Color.valueOf("e2e2e2")){{
|
coal = new Item("coal", Color.valueOf("272727")) {{
|
||||||
type = ItemType.material;
|
explosiveness = 0.2f;
|
||||||
}},
|
flammability = 0.5f;
|
||||||
|
fluxiness = 0.3f;
|
||||||
|
hardness = 2;
|
||||||
|
}};
|
||||||
|
|
||||||
titanium = new Item("titanium", Color.valueOf("8da1e3")){{
|
steel = new Item("steel", Color.valueOf("e2e2e2")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
hardness = 3;
|
}};
|
||||||
}},
|
|
||||||
|
|
||||||
thorium = new Item("thorium", Color.valueOf("f9a3c7")) {{
|
titanium = new Item("titanium", Color.valueOf("8da1e3")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
explosiveness = 0.1f;
|
hardness = 3;
|
||||||
hardness = 4;
|
}};
|
||||||
}},
|
|
||||||
|
|
||||||
silicon = new Item("silicon", Color.valueOf("53565c")){{
|
thorium = new Item("thorium", Color.valueOf("f9a3c7")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
}},
|
explosiveness = 0.1f;
|
||||||
|
hardness = 4;
|
||||||
|
}};
|
||||||
|
|
||||||
plastic = new Item("plastic", Color.valueOf("e9ead3")){{
|
silicon = new Item("silicon", Color.valueOf("53565c")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
flammability = 0.2f;
|
}};
|
||||||
explosiveness = 0.1f;
|
|
||||||
}},
|
|
||||||
|
|
||||||
surgealloy = new Item("surge-alloy", Color.valueOf("b4d5c7")){{
|
plastic = new Item("plastic", Color.valueOf("e9ead3")) {{
|
||||||
type = ItemType.material;
|
type = ItemType.material;
|
||||||
}},
|
flammability = 0.2f;
|
||||||
|
explosiveness = 0.1f;
|
||||||
|
}};
|
||||||
|
|
||||||
biomatter = new Item("biomatter", Color.valueOf("648b55")) {{
|
surgealloy = new Item("surge-alloy", Color.valueOf("b4d5c7")) {{
|
||||||
flammability = 0.4f;
|
type = ItemType.material;
|
||||||
fluxiness = 0.2f;
|
}};
|
||||||
}},
|
|
||||||
|
|
||||||
sand = new Item("sand", Color.valueOf("e3d39e")){{
|
biomatter = new Item("biomatter", Color.valueOf("648b55")) {{
|
||||||
fluxiness = 0.5f;
|
flammability = 0.4f;
|
||||||
}},
|
fluxiness = 0.2f;
|
||||||
|
}};
|
||||||
|
|
||||||
blastCompound = new Item("blast-compound", Color.valueOf("ff795e")){{
|
sand = new Item("sand", Color.valueOf("e3d39e")) {{
|
||||||
flammability = 0.2f;
|
fluxiness = 0.5f;
|
||||||
explosiveness = 0.6f;
|
}};
|
||||||
}},
|
|
||||||
|
|
||||||
thermite = new Item("thermite", Color.valueOf("ff795e")){{
|
blastCompound = new Item("blast-compound", Color.valueOf("ff795e")) {{
|
||||||
flammability = 0.7f;
|
flammability = 0.2f;
|
||||||
explosiveness = 0.2f;
|
explosiveness = 0.6f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
thermite = new Item("thermite", Color.valueOf("ff795e")) {{
|
||||||
|
flammability = 0.7f;
|
||||||
|
explosiveness = 0.2f;
|
||||||
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,48 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
|
|
||||||
public class Liquids {
|
public class Liquids implements ContentList {
|
||||||
|
public static Liquid none, water, lava, oil, cryofluid;
|
||||||
|
|
||||||
public static final Liquid
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
none = new Liquid("none", Color.CLEAR),
|
none = new Liquid("none", Color.CLEAR);
|
||||||
water = new Liquid("water", Color.valueOf("486acd")) {
|
|
||||||
{
|
water = new Liquid("water", Color.valueOf("486acd")) {
|
||||||
heatCapacity = 0.4f;
|
{
|
||||||
effect = StatusEffects.wet;
|
heatCapacity = 0.4f;
|
||||||
}
|
effect = StatusEffects.wet;
|
||||||
},
|
}
|
||||||
lava = new Liquid("lava", Color.valueOf("e37341")) {
|
};
|
||||||
{
|
|
||||||
temperature = 0.8f;
|
lava = new Liquid("lava", Color.valueOf("e37341")) {
|
||||||
viscosity = 0.8f;
|
{
|
||||||
effect = StatusEffects.melting;
|
temperature = 0.8f;
|
||||||
}
|
viscosity = 0.8f;
|
||||||
},
|
effect = StatusEffects.melting;
|
||||||
oil = new Liquid("oil", Color.valueOf("313131")) {
|
}
|
||||||
{
|
};
|
||||||
viscosity = 0.7f;
|
|
||||||
flammability = 0.6f;
|
oil = new Liquid("oil", Color.valueOf("313131")) {
|
||||||
explosiveness = 0.6f;
|
{
|
||||||
effect = StatusEffects.oiled;
|
viscosity = 0.7f;
|
||||||
}
|
flammability = 0.6f;
|
||||||
},
|
explosiveness = 0.6f;
|
||||||
cryofluid = new Liquid("cryofluid", Color.SKY) {
|
effect = StatusEffects.oiled;
|
||||||
{
|
}
|
||||||
heatCapacity = 0.75f;
|
};
|
||||||
temperature = 0.5f;
|
|
||||||
effect = StatusEffects.freezing;
|
cryofluid = new Liquid("cryofluid", Color.SKY) {
|
||||||
}
|
{
|
||||||
};
|
heatCapacity = 0.75f;
|
||||||
|
temperature = 0.5f;
|
||||||
|
effect = StatusEffects.freezing;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Mech;
|
import io.anuke.mindustry.type.Mech;
|
||||||
|
|
||||||
public class Mechs {
|
public class Mechs implements ContentList {
|
||||||
public static final Mech
|
public static Mech standard, standardShip;
|
||||||
|
|
||||||
standard = new Mech("standard-mech", false),
|
@Override
|
||||||
standardShip = new Mech("standard-ship", true);
|
public void load() {
|
||||||
|
|
||||||
|
standard = new Mech("standard-mech", false);
|
||||||
|
standardShip = new Mech("standard-ship", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.blocks.*;
|
import io.anuke.mindustry.content.blocks.*;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.type.Recipe;
|
import io.anuke.mindustry.type.Recipe;
|
||||||
import static io.anuke.mindustry.type.Section.*;
|
import static io.anuke.mindustry.type.Section.*;
|
||||||
|
|
||||||
public class Recipes {
|
public class Recipes implements ContentList{
|
||||||
static {
|
|
||||||
|
@Override
|
||||||
|
public void load (){
|
||||||
new Recipe(defense, DefenseBlocks.ironwall, new ItemStack(Items.iron, 12));
|
new Recipe(defense, DefenseBlocks.ironwall, new ItemStack(Items.iron, 12));
|
||||||
new Recipe(defense, DefenseBlocks.steelwall, new ItemStack(Items.steel, 12));
|
new Recipe(defense, DefenseBlocks.steelwall, new ItemStack(Items.steel, 12));
|
||||||
new Recipe(defense, DefenseBlocks.titaniumwall, new ItemStack(Items.titanium, 12));
|
new Recipe(defense, DefenseBlocks.titaniumwall, new ItemStack(Items.titanium, 12));
|
||||||
|
|||||||
@@ -4,118 +4,121 @@ import io.anuke.mindustry.content.fx.EnvironmentFx;
|
|||||||
import io.anuke.mindustry.entities.StatusController.TransitionResult;
|
import io.anuke.mindustry.entities.StatusController.TransitionResult;
|
||||||
import io.anuke.mindustry.entities.StatusEffect;
|
import io.anuke.mindustry.entities.StatusEffect;
|
||||||
import io.anuke.mindustry.entities.Unit;
|
import io.anuke.mindustry.entities.Unit;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class StatusEffects {
|
public class StatusEffects implements ContentList {
|
||||||
public static final StatusEffect
|
public static StatusEffect none, burning, freezing, wet, melting, oiled;
|
||||||
|
|
||||||
none = new StatusEffect(0),
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
burning = new StatusEffect(4*60f){
|
none = new StatusEffect(0);
|
||||||
{
|
|
||||||
oppositeScale = 0.5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
burning = new StatusEffect(4 * 60f) {
|
||||||
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result){
|
{
|
||||||
if(to == oiled){
|
oppositeScale = 0.5f;
|
||||||
unit.damage(1f);
|
|
||||||
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
return result.set(this, Math.min(time + newTime, baseDuration + oiled.baseDuration));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getTransition(unit, to, time, newTime, result);
|
@Override
|
||||||
}
|
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result) {
|
||||||
|
if (to == oiled) {
|
||||||
|
unit.damage(1f);
|
||||||
|
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
|
return result.set(this, Math.min(time + newTime, baseDuration + oiled.baseDuration));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
return super.getTransition(unit, to, time, newTime, result);
|
||||||
public void update(Unit unit, float time){
|
|
||||||
unit.damagePeriodic(0.04f);
|
|
||||||
|
|
||||||
if(Mathf.chance(Timers.delta() * 0.2f)){
|
|
||||||
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
},
|
public void update(Unit unit, float time) {
|
||||||
|
unit.damagePeriodic(0.04f);
|
||||||
|
|
||||||
freezing = new StatusEffect(5*60f){
|
if (Mathf.chance(Timers.delta() * 0.2f)) {
|
||||||
{
|
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
oppositeScale = 0.4f;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Unit unit, float time){
|
|
||||||
unit.velocity.scl(0.7f);
|
|
||||||
|
|
||||||
if(Mathf.chance(Timers.delta() * 0.15f)){
|
|
||||||
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
|
||||||
|
|
||||||
wet = new StatusEffect(3*60f){
|
freezing = new StatusEffect(5 * 60f) {
|
||||||
{
|
{
|
||||||
oppositeScale = 0.5f;
|
oppositeScale = 0.4f;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Unit unit, float time){
|
|
||||||
if(Mathf.chance(Timers.delta() * 0.15f)){
|
|
||||||
Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unit.velocity.scl(0.999f);
|
@Override
|
||||||
}
|
public void update(Unit unit, float time) {
|
||||||
},
|
unit.velocity.scl(0.7f);
|
||||||
|
|
||||||
melting = new StatusEffect(5*60f){
|
if (Mathf.chance(Timers.delta() * 0.15f)) {
|
||||||
{
|
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
oppositeScale = 0.2f;
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
wet = new StatusEffect(3 * 60f) {
|
||||||
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result){
|
{
|
||||||
if(to == oiled){
|
oppositeScale = 0.5f;
|
||||||
return result.set(this, Math.min(time + newTime/2f, baseDuration));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getTransition(unit, to, time, newTime, result);
|
@Override
|
||||||
}
|
public void update(Unit unit, float time) {
|
||||||
|
if (Mathf.chance(Timers.delta() * 0.15f)) {
|
||||||
|
Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
unit.velocity.scl(0.999f);
|
||||||
public void update(Unit unit, float time){
|
|
||||||
unit.velocity.scl(0.8f);
|
|
||||||
unit.damagePeriodic(0.1f);
|
|
||||||
|
|
||||||
if(Mathf.chance(Timers.delta() * 0.2f)){
|
|
||||||
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
|
||||||
|
|
||||||
oiled = new StatusEffect(4*60f){
|
melting = new StatusEffect(5 * 60f) {
|
||||||
@Override
|
{
|
||||||
public void update(Unit unit, float time){
|
oppositeScale = 0.2f;
|
||||||
if(Mathf.chance(Timers.delta() * 0.15f)){
|
|
||||||
Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize()/2f), unit.y + Mathf.range(unit.getSize()/2f));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unit.velocity.scl(0.6f);
|
@Override
|
||||||
}
|
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result) {
|
||||||
|
if (to == oiled) {
|
||||||
|
return result.set(this, Math.min(time + newTime / 2f, baseDuration));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
return super.getTransition(unit, to, time, newTime, result);
|
||||||
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result){
|
|
||||||
if(to == melting || to == burning){
|
|
||||||
return result.set(to, newTime + time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.set(to, newTime);
|
@Override
|
||||||
}
|
public void update(Unit unit, float time) {
|
||||||
};
|
unit.velocity.scl(0.8f);
|
||||||
|
unit.damagePeriodic(0.1f);
|
||||||
|
|
||||||
|
if (Mathf.chance(Timers.delta() * 0.2f)) {
|
||||||
|
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
oiled = new StatusEffect(4 * 60f) {
|
||||||
|
@Override
|
||||||
|
public void update(Unit unit, float time) {
|
||||||
|
if (Mathf.chance(Timers.delta() * 0.15f)) {
|
||||||
|
Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||||
|
}
|
||||||
|
|
||||||
|
unit.velocity.scl(0.6f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TransitionResult getTransition(Unit unit, StatusEffect to, float time, float newTime, TransitionResult result) {
|
||||||
|
if (to == melting || to == burning) {
|
||||||
|
return result.set(to, newTime + time);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.set(to, newTime);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static{
|
|
||||||
melting.setOpposites(wet, freezing);
|
melting.setOpposites(wet, freezing);
|
||||||
wet.setOpposites(burning);
|
wet.setOpposites(burning);
|
||||||
freezing.setOpposites(burning, melting);
|
freezing.setOpposites(burning, melting);
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ import io.anuke.mindustry.entities.units.UnitType;
|
|||||||
import io.anuke.mindustry.entities.units.types.Drone;
|
import io.anuke.mindustry.entities.units.types.Drone;
|
||||||
import io.anuke.mindustry.entities.units.types.Scout;
|
import io.anuke.mindustry.entities.units.types.Scout;
|
||||||
import io.anuke.mindustry.entities.units.types.Vtol;
|
import io.anuke.mindustry.entities.units.types.Vtol;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class UnitTypes {
|
public class UnitTypes implements ContentList {
|
||||||
public static final UnitType
|
public static UnitType drone, scout, vtol;
|
||||||
|
|
||||||
drone = new Drone(),
|
@Override
|
||||||
scout = new Scout(),
|
public void load() {
|
||||||
vtol = new Vtol();
|
drone = new Drone();
|
||||||
|
scout = new Scout();
|
||||||
|
vtol = new Vtol();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package io.anuke.mindustry.content;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.ObjectMap;
|
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Entries;
|
|
||||||
import io.anuke.mindustry.type.Item;
|
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
|
||||||
import io.anuke.mindustry.type.Upgrade;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
public class UpgradeRecipes {
|
|
||||||
private static final ObjectMap<Upgrade, ItemStack[]> recipes = Mathf.map(
|
|
||||||
/*
|
|
||||||
Weapons.triblaster, list(stack(Items.iron, 60), stack(Items.steel, 80)),
|
|
||||||
Weapons.clustergun, list(stack(Items.iron, 300), stack(Items.steel, 80)),
|
|
||||||
Weapons.vulcan, list(stack(Items.iron, 100), stack(Items.steel, 150), stack(Items.titanium, 80)),
|
|
||||||
Weapons.beam, list(stack(Items.steel, 260), stack(Items.titanium, 160), stack(Items.surgealloy, 120)),
|
|
||||||
Weapons.shockgun, list(stack(Items.steel, 240), stack(Items.titanium, 160), stack(Items.surgealloy, 160))*/
|
|
||||||
);
|
|
||||||
|
|
||||||
private static final ItemStack[] empty = {};
|
|
||||||
|
|
||||||
public static ItemStack[] get(Upgrade upgrade){
|
|
||||||
return recipes.get(upgrade, empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Entries<Upgrade, ItemStack[]> getAllRecipes(){
|
|
||||||
return recipes.entries();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ItemStack[] list(ItemStack... stacks){
|
|
||||||
return stacks;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ItemStack stack(Item item, int amount){
|
|
||||||
return new ItemStack(item, amount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,21 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.fx.ShootFx;
|
import io.anuke.mindustry.content.fx.ShootFx;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Weapon;
|
import io.anuke.mindustry.type.Weapon;
|
||||||
|
|
||||||
public class Weapons {
|
public class Weapons implements ContentList {
|
||||||
public static final Weapon
|
public static Weapon blaster;
|
||||||
|
|
||||||
blaster = new Weapon("blaster") {{
|
@Override
|
||||||
length = 1.5f;
|
public void load() {
|
||||||
reload = 15f;
|
|
||||||
roundrobin = true;
|
blaster = new Weapon("blaster") {{
|
||||||
ejectEffect = ShootFx.shellEjectSmall;
|
length = 1.5f;
|
||||||
setAmmo(AmmoTypes.bulletIron);
|
reload = 15f;
|
||||||
}};
|
roundrobin = true;
|
||||||
|
ejectEffect = ShootFx.shellEjectSmall;
|
||||||
|
setAmmo(AmmoTypes.bulletIron);
|
||||||
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,193 +5,193 @@ import io.anuke.mindustry.content.Items;
|
|||||||
import io.anuke.mindustry.content.Liquids;
|
import io.anuke.mindustry.content.Liquids;
|
||||||
import io.anuke.mindustry.content.StatusEffects;
|
import io.anuke.mindustry.content.StatusEffects;
|
||||||
import io.anuke.mindustry.graphics.CacheLayer;
|
import io.anuke.mindustry.graphics.CacheLayer;
|
||||||
|
import io.anuke.mindustry.type.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;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.*;
|
import io.anuke.mindustry.world.blocks.types.*;
|
||||||
|
|
||||||
public class Blocks {
|
public class Blocks implements ContentList{
|
||||||
public static final Block
|
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;
|
||||||
|
|
||||||
air = new Block("air") {
|
@Override
|
||||||
//don't draw
|
public void load() {
|
||||||
public void draw(Tile tile) {}
|
air = new Block("air") {
|
||||||
},
|
//don't draw
|
||||||
|
public void draw(Tile tile) {}
|
||||||
|
};
|
||||||
|
|
||||||
//player/enemy spawnpoint?
|
//player/enemy spawnpoint?
|
||||||
spawn = new Block("spawn"),
|
spawn = new Block("spawn");
|
||||||
|
|
||||||
blockpart = new BlockPart(),
|
blockpart = new BlockPart();
|
||||||
|
|
||||||
build1 = new BuildBlock("build1"),
|
build1 = new BuildBlock("build1");
|
||||||
|
|
||||||
build2 = new BuildBlock("build2"),
|
build2 = new BuildBlock("build2");
|
||||||
|
|
||||||
build3 = new BuildBlock("build3"),
|
build3 = new BuildBlock("build3");
|
||||||
|
|
||||||
build4 = new BuildBlock("build4"),
|
build4 = new BuildBlock("build4");
|
||||||
|
|
||||||
build5 = new BuildBlock("build5"),
|
build5 = new BuildBlock("build5");
|
||||||
|
|
||||||
build6 = new BuildBlock("build6"),
|
build6 = new BuildBlock("build6");
|
||||||
|
|
||||||
defaultFloor = new Floor("defaultfloor") {{
|
defaultFloor = new Floor("defaultfloor");
|
||||||
}},
|
|
||||||
|
|
||||||
space = new Floor("space") {{
|
space = new Floor("space") {{
|
||||||
placeableOn = false;
|
placeableOn = false;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
cacheLayer = CacheLayer.space;
|
cacheLayer = CacheLayer.space;
|
||||||
solid = true;
|
solid = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
metalfloor = new Floor("metalfloor"){{
|
metalfloor = new Floor("metalfloor") {{
|
||||||
variants = 6;
|
variants = 6;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
deepwater = new Floor("deepwater") {{
|
deepwater = new Floor("deepwater") {{
|
||||||
placeableOn = false;
|
placeableOn = false;
|
||||||
liquidColor = Color.valueOf("546bb3");
|
liquidColor = Color.valueOf("546bb3");
|
||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
liquidDrop = Liquids.water;
|
liquidDrop = Liquids.water;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
status = StatusEffects.wet;
|
status = StatusEffects.wet;
|
||||||
statusIntensity = 1f;
|
statusIntensity = 1f;
|
||||||
drownTime = 140f;
|
drownTime = 140f;
|
||||||
cacheLayer = CacheLayer.water;
|
cacheLayer = CacheLayer.water;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
water = new Floor("water") {{
|
water = new Floor("water") {{
|
||||||
placeableOn = false;
|
placeableOn = false;
|
||||||
liquidColor = Color.valueOf("546bb3");
|
liquidColor = Color.valueOf("546bb3");
|
||||||
speedMultiplier = 0.5f;
|
speedMultiplier = 0.5f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
status = StatusEffects.wet;
|
status = StatusEffects.wet;
|
||||||
statusIntensity = 0.9f;
|
statusIntensity = 0.9f;
|
||||||
liquidDrop = Liquids.water;
|
liquidDrop = Liquids.water;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
cacheLayer = CacheLayer.water;
|
cacheLayer = CacheLayer.water;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
lava = new Floor("lava") {{
|
lava = new Floor("lava") {{
|
||||||
placeableOn = false;
|
placeableOn = false;
|
||||||
liquidColor = Color.valueOf("ed5334");
|
liquidColor = Color.valueOf("ed5334");
|
||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
damageTaken = 0.1f;
|
damageTaken = 0.1f;
|
||||||
status = StatusEffects.melting;
|
status = StatusEffects.melting;
|
||||||
statusIntensity = 0.8f;
|
statusIntensity = 0.8f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
liquidDrop = Liquids.lava;
|
liquidDrop = Liquids.lava;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
cacheLayer = CacheLayer.lava;
|
cacheLayer = CacheLayer.lava;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
oil = new Floor("oil") {{
|
oil = new Floor("oil") {{
|
||||||
placeableOn = false;
|
placeableOn = false;
|
||||||
liquidColor = Color.valueOf("292929");
|
liquidColor = Color.valueOf("292929");
|
||||||
status = StatusEffects.oiled;
|
status = StatusEffects.oiled;
|
||||||
statusIntensity = 1f;
|
statusIntensity = 1f;
|
||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
liquidDrop = Liquids.oil;
|
liquidDrop = Liquids.oil;
|
||||||
liquid = true;
|
liquid = true;
|
||||||
cacheLayer = CacheLayer.oil;
|
cacheLayer = CacheLayer.oil;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
stone = new Floor("stone") {{
|
stone = new Floor("stone") {{
|
||||||
drops = new ItemStack(Items.stone, 1);
|
drops = new ItemStack(Items.stone, 1);
|
||||||
blends = block -> block != this && !(block instanceof Ore);
|
blends = block -> block != this && !(block instanceof Ore);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
blackstone = new Floor("blackstone") {{
|
blackstone = new Floor("blackstone") {{
|
||||||
drops = new ItemStack(Items.stone, 1);
|
drops = new ItemStack(Items.stone, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
iron = new Ore("iron") {{
|
iron = new Ore("iron") {{
|
||||||
drops = new ItemStack(Items.iron, 1);
|
drops = new ItemStack(Items.iron, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
lead = new Ore("lead") {{
|
lead = new Ore("lead") {{
|
||||||
drops = new ItemStack(Items.lead, 1);
|
drops = new ItemStack(Items.lead, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
coal = new Ore("coal") {{
|
coal = new Ore("coal") {{
|
||||||
drops = new ItemStack(Items.coal, 1);
|
drops = new ItemStack(Items.coal, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
titanium = new Ore("titanium") {{
|
titanium = new Ore("titanium") {{
|
||||||
drops = new ItemStack(Items.titanium, 1);
|
drops = new ItemStack(Items.titanium, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
thorium = new Ore("thorium") {{
|
thorium = new Ore("thorium") {{
|
||||||
drops = new ItemStack(Items.thorium, 1);
|
drops = new ItemStack(Items.thorium, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
dirt = new Floor("dirt") {
|
dirt = new Floor("dirt");
|
||||||
},
|
|
||||||
|
|
||||||
sand = new Floor("sand") {{
|
sand = new Floor("sand") {{
|
||||||
drops = new ItemStack(Items.sand, 1);
|
drops = new ItemStack(Items.sand, 1);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
ice = new Floor("ice") {{
|
ice = new Floor("ice") {{
|
||||||
dragMultiplier = 0.2f;
|
dragMultiplier = 0.2f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
snow = new Floor("snow") {
|
snow = new Floor("snow");
|
||||||
},
|
|
||||||
|
|
||||||
grass = new Floor("grass") {
|
grass = new Floor("grass");
|
||||||
},
|
|
||||||
|
|
||||||
sandblock = new StaticBlock("sandblock") {{
|
sandblock = new StaticBlock("sandblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
variants = 3;
|
variants = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
snowblock = new StaticBlock("snowblock") {{
|
snowblock = new StaticBlock("snowblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
variants = 3;
|
variants = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
stoneblock = new StaticBlock("stoneblock") {{
|
stoneblock = new StaticBlock("stoneblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
variants = 3;
|
variants = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
blackstoneblock = new StaticBlock("blackstoneblock") {{
|
blackstoneblock = new StaticBlock("blackstoneblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
variants = 3;
|
variants = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
grassblock = new StaticBlock("grassblock") {{
|
grassblock = new StaticBlock("grassblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
variants = 2;
|
variants = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
mossblock = new StaticBlock("mossblock") {{
|
mossblock = new StaticBlock("mossblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
shrub = new Rock("shrub"),
|
shrub = new Rock("shrub");
|
||||||
|
|
||||||
rock = new Rock("rock") {{
|
rock = new Rock("rock") {{
|
||||||
variants = 2;
|
variants = 2;
|
||||||
varyShadow = true;
|
varyShadow = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
icerock = new Rock("icerock") {{
|
icerock = new Rock("icerock") {{
|
||||||
variants = 2;
|
variants = 2;
|
||||||
varyShadow = true;
|
varyShadow = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
blackrock = new Rock("blackrock") {{
|
blackrock = new Rock("blackrock") {{
|
||||||
variants = 1;
|
variants = 1;
|
||||||
varyShadow = true;
|
varyShadow = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
dirtblock = new StaticBlock("dirtblock") {{
|
dirtblock = new StaticBlock("dirtblock") {{
|
||||||
solid = true;
|
solid = true;
|
||||||
}};
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,199 +4,203 @@ import com.badlogic.gdx.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.BlockFx;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.*;
|
import io.anuke.mindustry.world.blocks.types.production.*;
|
||||||
|
|
||||||
public class CraftingBlocks {
|
public class CraftingBlocks implements ContentList {
|
||||||
public static final Block
|
public static Block smelter, alloysmelter, siliconsmelter, poweralloysmelter, powersmelter, cryofluidmixer, melter, separator, centrifuge, plasticFormer, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, weaponFactory, incinerator;
|
||||||
|
|
||||||
smelter = new Smelter("smelter") {{
|
@Override
|
||||||
health = 70;
|
public void load() {
|
||||||
inputs = new Item[]{Items.iron};
|
smelter = new Smelter("smelter") {{
|
||||||
fuel = Items.coal;
|
health = 70;
|
||||||
result = Items.steel;
|
inputs = new Item[]{Items.iron};
|
||||||
craftTime = 25f;
|
fuel = Items.coal;
|
||||||
}},
|
result = Items.steel;
|
||||||
|
craftTime = 25f;
|
||||||
|
}};
|
||||||
|
|
||||||
alloysmelter = new Smelter("alloysmelter") {{
|
alloysmelter = new Smelter("alloysmelter") {{
|
||||||
health = 90;
|
health = 90;
|
||||||
inputs = new Item[]{Items.titanium, Items.steel};
|
inputs = new Item[]{Items.titanium, Items.steel};
|
||||||
fuel = Items.coal;
|
fuel = Items.coal;
|
||||||
result = Items.surgealloy;
|
result = Items.surgealloy;
|
||||||
burnDuration = 45f;
|
burnDuration = 45f;
|
||||||
craftTime = 25f;
|
craftTime = 25f;
|
||||||
flameColor = Color.valueOf("fd896e");
|
flameColor = Color.valueOf("fd896e");
|
||||||
}},
|
}};
|
||||||
|
|
||||||
siliconsmelter = new PowerSmelter("siliconsmelter") {{
|
siliconsmelter = new PowerSmelter("siliconsmelter") {{
|
||||||
health = 90;
|
health = 90;
|
||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)};
|
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)};
|
||||||
result = Items.silicon;
|
result = Items.silicon;
|
||||||
powerUse = 0.05f;
|
powerUse = 0.05f;
|
||||||
craftTime = 35f;
|
craftTime = 35f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasLiquids = false;
|
hasLiquids = false;
|
||||||
flameColor = Color.valueOf("ffef99");
|
flameColor = Color.valueOf("ffef99");
|
||||||
}},
|
}};
|
||||||
|
|
||||||
poweralloysmelter = new PowerSmelter("poweralloysmelter") {{
|
poweralloysmelter = new PowerSmelter("poweralloysmelter") {{
|
||||||
health = 90;
|
health = 90;
|
||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
inputs = new ItemStack[]{new ItemStack(Items.titanium, 4), new ItemStack(Items.thorium, 4)};
|
inputs = new ItemStack[]{new ItemStack(Items.titanium, 4), new ItemStack(Items.thorium, 4)};
|
||||||
result = Items.surgealloy;
|
result = Items.surgealloy;
|
||||||
powerUse = 0.3f;
|
powerUse = 0.3f;
|
||||||
craftTime = 25f;
|
craftTime = 25f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
powersmelter = new PowerSmelter("powersmelter") {{
|
powersmelter = new PowerSmelter("powersmelter") {{
|
||||||
health = 90;
|
health = 90;
|
||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.iron, 1)};
|
inputs = new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.iron, 1)};
|
||||||
result = Items.steel;
|
result = Items.steel;
|
||||||
powerUse = 0.1f;
|
powerUse = 0.1f;
|
||||||
craftTime = 25f;
|
craftTime = 25f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
|
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
|
||||||
health = 200;
|
health = 200;
|
||||||
inputLiquid = Liquids.water;
|
inputLiquid = Liquids.water;
|
||||||
outputLiquid = Liquids.cryofluid;
|
outputLiquid = Liquids.cryofluid;
|
||||||
inputItem = Items.titanium;
|
inputItem = Items.titanium;
|
||||||
liquidPerItem = 50f;
|
liquidPerItem = 50f;
|
||||||
itemCapacity = 50;
|
itemCapacity = 50;
|
||||||
powerUse = 0.1f;
|
powerUse = 0.1f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
melter = new PowerCrafter("melter") {{
|
melter = new PowerCrafter("melter") {{
|
||||||
health = 200;
|
health = 200;
|
||||||
outputLiquid = Liquids.lava;
|
outputLiquid = Liquids.lava;
|
||||||
outputLiquidAmount = 0.05f;
|
outputLiquidAmount = 0.05f;
|
||||||
input = new ItemStack(Items.stone, 1);
|
input = new ItemStack(Items.stone, 1);
|
||||||
itemCapacity = 50;
|
itemCapacity = 50;
|
||||||
craftTime = 10f;
|
craftTime = 10f;
|
||||||
powerUse = 0.1f;
|
powerUse = 0.1f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
separator = new Separator("separator") {{
|
separator = new Separator("separator") {{
|
||||||
liquid = Liquids.water;
|
liquid = Liquids.water;
|
||||||
item = Items.stone;
|
item = Items.stone;
|
||||||
results = new Item[]{
|
results = new Item[]{
|
||||||
null, null, null, null, null, null, null, null, null, null,
|
null, null, null, null, null, null, null, null, null, null,
|
||||||
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
|
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
|
||||||
Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone,
|
Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone,
|
||||||
Items.iron, Items.iron, Items.iron, Items.iron,
|
Items.iron, Items.iron, Items.iron, Items.iron,
|
||||||
Items.lead, Items.lead,
|
Items.lead, Items.lead,
|
||||||
Items.coal, Items.coal,
|
Items.coal, Items.coal,
|
||||||
Items.titanium
|
Items.titanium
|
||||||
};
|
};
|
||||||
liquidUse = 0.2f;
|
liquidUse = 0.2f;
|
||||||
filterTime = 40f;
|
filterTime = 40f;
|
||||||
itemCapacity = 40;
|
itemCapacity = 40;
|
||||||
health = 50;
|
health = 50;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
centrifuge = new Separator("centrifuge") {{
|
centrifuge = new Separator("centrifuge") {{
|
||||||
liquid = Liquids.water;
|
liquid = Liquids.water;
|
||||||
item = Items.stone;
|
item = Items.stone;
|
||||||
results = new Item[]{
|
results = new Item[]{
|
||||||
null, null, null, null, null, null, null, null, null, null, null, null, null,
|
null, null, null, null, null, null, null, null, null, null, null, null, null,
|
||||||
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
|
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
|
||||||
Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone,
|
Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone, Items.stone,
|
||||||
Items.iron, Items.iron, Items.iron, Items.iron, Items.iron,
|
Items.iron, Items.iron, Items.iron, Items.iron, Items.iron,
|
||||||
Items.lead, Items.lead, Items.lead,
|
Items.lead, Items.lead, Items.lead,
|
||||||
Items.coal, Items.coal, Items.coal,
|
Items.coal, Items.coal, Items.coal,
|
||||||
Items.titanium, Items.titanium,
|
Items.titanium, Items.titanium,
|
||||||
Items.thorium,
|
Items.thorium,
|
||||||
};
|
};
|
||||||
|
|
||||||
liquidUse = 0.3f;
|
liquidUse = 0.3f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
powerUse = 0.2f;
|
powerUse = 0.2f;
|
||||||
filterTime = 15f;
|
filterTime = 15f;
|
||||||
itemCapacity = 60;
|
itemCapacity = 60;
|
||||||
health = 50*4;
|
health = 50 * 4;
|
||||||
spinnerLength = 1.5f;
|
spinnerLength = 1.5f;
|
||||||
spinnerRadius = 3.5f;
|
spinnerRadius = 3.5f;
|
||||||
spinnerThickness = 1.5f;
|
spinnerThickness = 1.5f;
|
||||||
spinnerSpeed = 3f;
|
spinnerSpeed = 3f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
plasticFormer = new PlasticFormer("plasticformer") {{
|
plasticFormer = new PlasticFormer("plasticformer") {{
|
||||||
inputLiquid = Liquids.oil;
|
inputLiquid = Liquids.oil;
|
||||||
liquidUse = 0.3f;
|
liquidUse = 0.3f;
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
powerUse = 0.5f;
|
powerUse = 0.5f;
|
||||||
craftTime = 80f;
|
craftTime = 80f;
|
||||||
output = Items.plastic;
|
output = Items.plastic;
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 320;
|
||||||
hasPower = hasLiquids = true;
|
hasPower = hasLiquids = true;
|
||||||
craftEffect = BlockFx.formsmoke;
|
craftEffect = BlockFx.formsmoke;
|
||||||
updateEffect = BlockFx.plasticburn;
|
updateEffect = BlockFx.plasticburn;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
biomatterCompressor = new Compressor("biomattercompressor") {{
|
biomatterCompressor = new Compressor("biomattercompressor") {{
|
||||||
input = new ItemStack(Items.biomatter, 1);
|
input = new ItemStack(Items.biomatter, 1);
|
||||||
liquidCapacity = 60f;
|
liquidCapacity = 60f;
|
||||||
itemCapacity = 50;
|
itemCapacity = 50;
|
||||||
powerUse = 0.06f;
|
powerUse = 0.06f;
|
||||||
craftTime = 25f;
|
craftTime = 25f;
|
||||||
outputLiquid = Liquids.oil;
|
outputLiquid = Liquids.oil;
|
||||||
outputLiquidAmount = 0.1f;
|
outputLiquidAmount = 0.1f;
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 320;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
pulverizer = new Pulverizer("pulverizer") {{
|
pulverizer = new Pulverizer("pulverizer") {{
|
||||||
inputItem = new ItemStack(Items.stone, 2);
|
inputItem = new ItemStack(Items.stone, 2);
|
||||||
itemCapacity = 40;
|
itemCapacity = 40;
|
||||||
powerUse = 0.2f;
|
powerUse = 0.2f;
|
||||||
output = Items.sand;
|
output = Items.sand;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = BlockFx.pulverize;
|
craftEffect = BlockFx.pulverize;
|
||||||
craftTime = 60f;
|
craftTime = 60f;
|
||||||
updateEffect = BlockFx.pulverizeSmall;
|
updateEffect = BlockFx.pulverizeSmall;
|
||||||
hasItems = hasPower = true;
|
hasItems = hasPower = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
oilRefinery = new GenericCrafter("oilrefinery") {{
|
oilRefinery = new GenericCrafter("oilrefinery") {{
|
||||||
inputLiquid = Liquids.oil;
|
inputLiquid = Liquids.oil;
|
||||||
powerUse = 0.05f;
|
powerUse = 0.05f;
|
||||||
liquidUse = 0.1f;
|
liquidUse = 0.1f;
|
||||||
liquidCapacity = 56f;
|
liquidCapacity = 56f;
|
||||||
output = Items.coal;
|
output = Items.coal;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = BlockFx.purifyoil;
|
craftEffect = BlockFx.purifyoil;
|
||||||
hasItems = hasLiquids = hasPower = true;
|
hasItems = hasLiquids = hasPower = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
stoneFormer = new GenericCrafter("stoneformer") {{
|
stoneFormer = new GenericCrafter("stoneformer") {{
|
||||||
inputLiquid = Liquids.lava;
|
inputLiquid = Liquids.lava;
|
||||||
liquidUse = 1f;
|
liquidUse = 1f;
|
||||||
liquidCapacity = 21f;
|
liquidCapacity = 21f;
|
||||||
craftTime = 14;
|
craftTime = 14;
|
||||||
output = Items.stone;
|
output = Items.stone;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = BlockFx.purifystone;
|
craftEffect = BlockFx.purifystone;
|
||||||
hasLiquids = hasItems = true;
|
hasLiquids = hasItems = true;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
weaponFactory = new WeaponFactory("weaponfactory") {{
|
weaponFactory = new WeaponFactory("weaponfactory") {{
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 250;
|
health = 250;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
incinerator = new Incinerator("incinerator") {{
|
incinerator = new Incinerator("incinerator") {{
|
||||||
health = 90;
|
health = 90;
|
||||||
}};
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.blocks;
|
|||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.content.Liquids;
|
import io.anuke.mindustry.content.Liquids;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@@ -19,137 +20,141 @@ import java.io.DataInputStream;
|
|||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class DebugBlocks {
|
public class DebugBlocks implements ContentList{
|
||||||
public static final Block
|
public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid;
|
||||||
|
|
||||||
powerVoid = new PowerBlock("powervoid") {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
powerCapacity = Float.MAX_VALUE;
|
powerVoid = new PowerBlock("powervoid") {
|
||||||
}
|
{
|
||||||
},
|
powerCapacity = Float.MAX_VALUE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
powerInfinite = new PowerDistributor("powerinfinite") {
|
powerInfinite = new PowerDistributor("powerinfinite") {
|
||||||
{
|
{
|
||||||
powerCapacity = 10000f;
|
powerCapacity = 10000f;
|
||||||
powerSpeed = 100f;
|
powerSpeed = 100f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile) {
|
||||||
super.update(tile);
|
super.update(tile);
|
||||||
tile.entity.power.amount = powerCapacity;
|
tile.entity.power.amount = powerCapacity;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
itemSource = new Sorter("itemsource"){
|
itemSource = new Sorter("itemsource") {
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile) {
|
public void update(Tile tile) {
|
||||||
SorterEntity entity = tile.entity();
|
SorterEntity entity = tile.entity();
|
||||||
entity.items.items[entity.sortItem.id] = 1;
|
entity.items.items[entity.sortItem.id] = 1;
|
||||||
tryDump(tile, entity.sortItem);
|
tryDump(tile, entity.sortItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
public boolean acceptItem(Item item, Tile tile, Tile source) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
liquidSource = new Block("liquidsource"){
|
liquidSource = new Block("liquidsource") {
|
||||||
{
|
{
|
||||||
update = true;
|
update = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
liquidCapacity = 100f;
|
liquidCapacity = 100f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isConfigurable(Tile tile) {
|
public boolean isConfigurable(Tile tile) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile) {
|
public void update(Tile tile) {
|
||||||
LiquidSourceEntity entity = tile.entity();
|
LiquidSourceEntity entity = tile.entity();
|
||||||
|
|
||||||
tile.entity.liquids.amount = liquidCapacity;
|
tile.entity.liquids.amount = liquidCapacity;
|
||||||
tile.entity.liquids.liquid = entity.source;
|
tile.entity.liquids.liquid = entity.source;
|
||||||
tryDumpLiquid(tile);
|
tryDumpLiquid(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile) {
|
||||||
super.draw(tile);
|
super.draw(tile);
|
||||||
|
|
||||||
LiquidSourceEntity entity = tile.entity();
|
LiquidSourceEntity entity = tile.entity();
|
||||||
|
|
||||||
Draw.color(entity.source.color);
|
Draw.color(entity.source.color);
|
||||||
Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f);
|
Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildTable(Tile tile, Table table){
|
public void buildTable(Tile tile, Table table) {
|
||||||
LiquidSourceEntity entity = tile.entity();
|
LiquidSourceEntity entity = tile.entity();
|
||||||
|
|
||||||
Array<Liquid> items = Liquid.all();
|
Array<Liquid> items = Liquid.all();
|
||||||
|
|
||||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||||
Table cont = new Table();
|
Table cont = new Table();
|
||||||
cont.margin(4);
|
cont.margin(4);
|
||||||
cont.marginBottom(5);
|
cont.marginBottom(5);
|
||||||
|
|
||||||
cont.add().colspan(4).height(50f * (int)(items.size/4f + 1f));
|
cont.add().colspan(4).height(50f * (int) (items.size / 4f + 1f));
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
for(int i = 0; i < items.size; i ++){
|
for (int i = 0; i < items.size; i++) {
|
||||||
if(i == 0) continue;
|
if (i == 0) continue;
|
||||||
final int f = i;
|
final int f = i;
|
||||||
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> {
|
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> {
|
||||||
entity.source = items.get(f);
|
entity.source = items.get(f);
|
||||||
}).size(38, 42).padBottom(-5.1f).group(group).get();
|
}).size(38, 42).padBottom(-5.1f).group(group).get();
|
||||||
button.getStyle().imageUpColor = items.get(i).color;
|
button.getStyle().imageUpColor = items.get(i).color;
|
||||||
button.setChecked(entity.source.id == f);
|
button.setChecked(entity.source.id == f);
|
||||||
|
|
||||||
if(i%4 == 3){
|
if (i % 4 == 3) {
|
||||||
cont.row();
|
cont.row();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table.add(cont);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity getEntity() {
|
||||||
|
return new LiquidSourceEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
class LiquidSourceEntity extends TileEntity {
|
||||||
|
public Liquid source = Liquids.water;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(DataOutputStream stream) throws IOException {
|
||||||
|
stream.writeByte(source.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void read(DataInputStream stream) throws IOException {
|
||||||
|
source = Liquid.getByID(stream.readByte());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
table.add(cont);
|
itemVoid = new Block("itemvoid") {
|
||||||
}
|
{
|
||||||
|
update = solid = true;
|
||||||
@Override
|
|
||||||
public TileEntity getEntity(){
|
|
||||||
return new LiquidSourceEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
class LiquidSourceEntity extends TileEntity{
|
|
||||||
public Liquid source = Liquids.water;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(DataOutputStream stream) throws IOException {
|
|
||||||
stream.writeByte(source.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(DataInputStream stream) throws IOException {
|
public void handleItem(Item item, Tile tile, Tile source) {
|
||||||
source = Liquid.getByID(stream.readByte());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
itemVoid = new Block("itemvoid"){
|
@Override
|
||||||
{
|
public boolean acceptItem(Item item, Tile tile, Tile source) {
|
||||||
update = solid = true;
|
return true;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
@Override
|
}
|
||||||
public void handleItem(Item item, Tile tile, Tile source) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,71 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.fx.BlockFx;
|
import io.anuke.mindustry.content.fx.BlockFx;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.Wall;
|
import io.anuke.mindustry.world.blocks.types.Wall;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.*;
|
import io.anuke.mindustry.world.blocks.types.defense.Door;
|
||||||
|
import io.anuke.mindustry.world.blocks.types.defense.ShieldedWallBlock;
|
||||||
|
|
||||||
public class DefenseBlocks {
|
public class DefenseBlocks implements ContentList {
|
||||||
static final int wallHealthMultiplier = 4;
|
public static Block stonewall, ironwall, steelwall, titaniumwall, diriumwall, compositewall, steelwalllarge, titaniumwalllarge, diriumwalllarge, titaniumshieldwall, door, largedoor;
|
||||||
|
|
||||||
public static final Block
|
@Override
|
||||||
|
public void load() {
|
||||||
|
int wallHealthMultiplier = 4;
|
||||||
|
|
||||||
stonewall = new Wall("stonewall") {{
|
stonewall = new Wall("stonewall") {{
|
||||||
health = 40 * wallHealthMultiplier;
|
health = 40 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
ironwall = new Wall("ironwall") {{
|
ironwall = new Wall("ironwall") {{
|
||||||
health = 80 * wallHealthMultiplier;
|
health = 80 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
steelwall = new Wall("steelwall") {{
|
steelwall = new Wall("steelwall") {{
|
||||||
health = 110 * wallHealthMultiplier;
|
health = 110 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
titaniumwall = new Wall("titaniumwall") {{
|
titaniumwall = new Wall("titaniumwall") {{
|
||||||
health = 150 * wallHealthMultiplier;
|
health = 150 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
diriumwall = new Wall("duriumwall") {{
|
diriumwall = new Wall("duriumwall") {{
|
||||||
health = 190 * wallHealthMultiplier;
|
health = 190 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
compositewall = new Wall("compositewall") {{
|
compositewall = new Wall("compositewall") {{
|
||||||
health = 270 * wallHealthMultiplier;
|
health = 270 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
steelwalllarge = new Wall("steelwall-large") {{
|
steelwalllarge = new Wall("steelwall-large") {{
|
||||||
health = 110 * 4 * wallHealthMultiplier;
|
health = 110 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
titaniumwalllarge = new Wall("titaniumwall-large") {{
|
titaniumwalllarge = new Wall("titaniumwall-large") {{
|
||||||
health = 150 * 4 * wallHealthMultiplier;
|
health = 150 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
diriumwalllarge = new Wall("duriumwall-large") {{
|
diriumwalllarge = new Wall("duriumwall-large") {{
|
||||||
health = 190 * 4 * wallHealthMultiplier;
|
health = 190 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall") {{
|
titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall") {{
|
||||||
health = 150 * wallHealthMultiplier;
|
health = 150 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
door = new Door("door") {{
|
door = new Door("door") {{
|
||||||
health = 90 * wallHealthMultiplier;
|
health = 90 * wallHealthMultiplier;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
largedoor = new Door("door-large") {{
|
largedoor = new Door("door-large") {{
|
||||||
openfx = BlockFx.dooropenlarge;
|
openfx = BlockFx.dooropenlarge;
|
||||||
closefx = BlockFx.doorcloselarge;
|
closefx = BlockFx.doorcloselarge;
|
||||||
health = 90 * 4 * wallHealthMultiplier;
|
health = 90 * 4 * wallHealthMultiplier;
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,55 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
||||||
|
|
||||||
public class DistributionBlocks{
|
public class DistributionBlocks implements ContentList{
|
||||||
|
public static Block conveyor, steelconveyor, pulseconveyor, router, multiplexer, junction, bridgeconveyor, laserconveyor, sorter, splitter, overflowgate;
|
||||||
|
|
||||||
public static final Block
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
conveyor = new Conveyor("conveyor"){{
|
conveyor = new Conveyor("conveyor") {{
|
||||||
health = 40;
|
health = 40;
|
||||||
speed = 0.02f;
|
speed = 0.02f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
steelconveyor = new Conveyor("steelconveyor"){{
|
steelconveyor = new Conveyor("steelconveyor") {{
|
||||||
health = 55;
|
health = 55;
|
||||||
speed = 0.04f;
|
speed = 0.04f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
pulseconveyor = new Conveyor("poweredconveyor"){{
|
pulseconveyor = new Conveyor("poweredconveyor") {{
|
||||||
health = 75;
|
health = 75;
|
||||||
speed = 0.09f;
|
speed = 0.09f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
router = new Router("router"),
|
router = new Router("router");
|
||||||
|
|
||||||
multiplexer = new Router("multiplexer"){{
|
multiplexer = new Router("multiplexer") {{
|
||||||
size = 2;
|
size = 2;
|
||||||
itemCapacity = 80;
|
itemCapacity = 80;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
junction = new Junction("junction"){{
|
junction = new Junction("junction") {{
|
||||||
speed = 26;
|
speed = 26;
|
||||||
capacity = 32;
|
capacity = 32;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
bridgeconveyor = new BufferedItemBridge("bridgeconveyor"){{
|
bridgeconveyor = new BufferedItemBridge("bridgeconveyor") {{
|
||||||
range = 3;
|
range = 3;
|
||||||
hasPower = false;
|
hasPower = false;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
laserconveyor = new ItemBridge("laserconveyor"){{
|
laserconveyor = new ItemBridge("laserconveyor") {{
|
||||||
range = 7;
|
range = 7;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
sorter = new Sorter("sorter"),
|
sorter = new Sorter("sorter");
|
||||||
|
|
||||||
splitter = new Splitter("splitter"),
|
splitter = new Splitter("splitter");
|
||||||
|
|
||||||
overflowgate = new OverflowGate("overflowgate");
|
overflowgate = new OverflowGate("overflowgate");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,53 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.Pump;
|
import io.anuke.mindustry.world.blocks.types.production.Pump;
|
||||||
|
|
||||||
public class LiquidBlocks {
|
public class LiquidBlocks implements ContentList{
|
||||||
public static final Block
|
public static Block pump, fluxpump, conduit, pulseconduit, liquidrouter, liquidtank, liquidjunction, bridgeconduit, laserconduit;
|
||||||
|
|
||||||
pump = new Pump("pump") {{
|
@Override
|
||||||
pumpAmount = 0.1f;
|
public void load() {
|
||||||
}},
|
|
||||||
|
|
||||||
fluxpump = new Pump("fluxpump") {{
|
pump = new Pump("pump") {{
|
||||||
pumpAmount = 0.2f;
|
pumpAmount = 0.1f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
conduit = new Conduit("conduit") {{
|
fluxpump = new Pump("fluxpump") {{
|
||||||
health = 45;
|
pumpAmount = 0.2f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
pulseconduit = new Conduit("pulseconduit") {{
|
conduit = new Conduit("conduit") {{
|
||||||
liquidCapacity = 16f;
|
health = 45;
|
||||||
liquidFlowFactor = 4.9f;
|
}};
|
||||||
health = 65;
|
|
||||||
}},
|
|
||||||
|
|
||||||
liquidrouter = new LiquidRouter("liquidrouter") {{
|
pulseconduit = new Conduit("pulseconduit") {{
|
||||||
liquidCapacity = 40f;
|
liquidCapacity = 16f;
|
||||||
}},
|
liquidFlowFactor = 4.9f;
|
||||||
|
health = 65;
|
||||||
|
}};
|
||||||
|
|
||||||
liquidtank = new LiquidRouter("liquidtank") {{
|
liquidrouter = new LiquidRouter("liquidrouter") {{
|
||||||
size = 3;
|
liquidCapacity = 40f;
|
||||||
liquidCapacity = 1500f;
|
}};
|
||||||
health = 500;
|
|
||||||
}},
|
|
||||||
|
|
||||||
liquidjunction = new LiquidJunction("liquidjunction"),
|
liquidtank = new LiquidRouter("liquidtank") {{
|
||||||
|
size = 3;
|
||||||
|
liquidCapacity = 1500f;
|
||||||
|
health = 500;
|
||||||
|
}};
|
||||||
|
|
||||||
bridgeconduit = new LiquidExtendingBridge("bridgeconduit"){{
|
liquidjunction = new LiquidJunction("liquidjunction");
|
||||||
range = 3;
|
|
||||||
hasPower = false;
|
|
||||||
}},
|
|
||||||
|
|
||||||
laserconduit = new LiquidBridge("laserconduit"){{
|
bridgeconduit = new LiquidExtendingBridge("bridgeconduit") {{
|
||||||
range = 7;
|
range = 3;
|
||||||
}};
|
hasPower = false;
|
||||||
|
}};
|
||||||
|
|
||||||
|
laserconduit = new LiquidBridge("laserconduit") {{
|
||||||
|
range = 7;
|
||||||
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,99 +1,104 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
import io.anuke.mindustry.content.fx.BlockFx;
|
import io.anuke.mindustry.content.fx.BlockFx;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.RepairTurret;
|
import io.anuke.mindustry.world.blocks.types.defense.RepairTurret;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
|
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.distribution.Teleporter;
|
||||||
import io.anuke.mindustry.world.blocks.types.power.*;
|
import io.anuke.mindustry.world.blocks.types.power.*;
|
||||||
|
|
||||||
public class PowerBlocks {
|
public class PowerBlocks implements ContentList {
|
||||||
public static final Block
|
public static Block combustiongenerator, thermalgenerator, liquidcombustiongenerator, rtgenerator, solarpanel, largesolarpanel, nuclearReactor, fusionReactor, repairturret, megarepairturret, shieldgenerator, battery, batteryLarge, powernode, powernodelarge, teleporter;
|
||||||
|
|
||||||
combustiongenerator = new BurnerGenerator("combustiongenerator") {{
|
@Override
|
||||||
powerOutput = 0.04f;
|
public void load() {
|
||||||
powerCapacity = 40f;
|
combustiongenerator = new BurnerGenerator("combustiongenerator") {{
|
||||||
}},
|
powerOutput = 0.04f;
|
||||||
|
powerCapacity = 40f;
|
||||||
|
}};
|
||||||
|
|
||||||
thermalgenerator = new LiquidHeatGenerator("thermalgenerator") {{
|
thermalgenerator = new LiquidHeatGenerator("thermalgenerator") {{
|
||||||
maxLiquidGenerate = 0.5f;
|
maxLiquidGenerate = 0.5f;
|
||||||
powerPerLiquid = 0.08f;
|
powerPerLiquid = 0.08f;
|
||||||
powerCapacity = 40f;
|
powerCapacity = 40f;
|
||||||
generateEffect = BlockFx.redgeneratespark;
|
generateEffect = BlockFx.redgeneratespark;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
liquidcombustiongenerator = new LiquidBurnerGenerator("liquidcombustiongenerator") {{
|
liquidcombustiongenerator = new LiquidBurnerGenerator("liquidcombustiongenerator") {{
|
||||||
maxLiquidGenerate = 0.4f;
|
maxLiquidGenerate = 0.4f;
|
||||||
powerPerLiquid = 0.12f;
|
powerPerLiquid = 0.12f;
|
||||||
powerCapacity = 40f;
|
powerCapacity = 40f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
rtgenerator = new DecayGenerator("rtgenerator") {{
|
rtgenerator = new DecayGenerator("rtgenerator") {{
|
||||||
powerCapacity = 40f;
|
powerCapacity = 40f;
|
||||||
powerOutput = 0.02f;
|
powerOutput = 0.02f;
|
||||||
itemDuration = 500f;
|
itemDuration = 500f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
solarpanel = new SolarGenerator("solarpanel") {{
|
solarpanel = new SolarGenerator("solarpanel") {{
|
||||||
generation = 0.003f;
|
generation = 0.003f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
largesolarpanel = new SolarGenerator("largesolarpanel") {{
|
largesolarpanel = new SolarGenerator("largesolarpanel") {{
|
||||||
size = 3;
|
size = 3;
|
||||||
generation = 0.012f;
|
generation = 0.012f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
nuclearReactor = new NuclearReactor("nuclearreactor") {{
|
nuclearReactor = new NuclearReactor("nuclearreactor") {{
|
||||||
size = 3;
|
size = 3;
|
||||||
health = 600;
|
health = 600;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
fusionReactor = new FusionReactor("fusionreactor") {{
|
fusionReactor = new FusionReactor("fusionreactor") {{
|
||||||
size = 4;
|
size = 4;
|
||||||
health = 600;
|
health = 600;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
repairturret = new RepairTurret("repairturret") {{
|
repairturret = new RepairTurret("repairturret") {{
|
||||||
range = 30;
|
range = 30;
|
||||||
reload = 20f;
|
reload = 20f;
|
||||||
health = 60;
|
health = 60;
|
||||||
powerUsed = 0.08f;
|
powerUsed = 0.08f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
megarepairturret = new RepairTurret("megarepairturret") {{
|
megarepairturret = new RepairTurret("megarepairturret") {{
|
||||||
range = 44;
|
range = 44;
|
||||||
reload = 12f;
|
reload = 12f;
|
||||||
health = 90;
|
health = 90;
|
||||||
powerUsed = 0.13f;
|
powerUsed = 0.13f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
shieldgenerator = new ShieldBlock("shieldgenerator") {{
|
shieldgenerator = new ShieldBlock("shieldgenerator") {{
|
||||||
health = 400;
|
health = 400;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
battery = new PowerGenerator("battery") {{
|
battery = new PowerGenerator("battery") {{
|
||||||
powerCapacity = 320f;
|
powerCapacity = 320f;
|
||||||
hasItems = false;
|
hasItems = false;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
batteryLarge = new PowerGenerator("batterylarge") {{
|
batteryLarge = new PowerGenerator("batterylarge") {{
|
||||||
size = 3;
|
size = 3;
|
||||||
powerCapacity = 2000f;
|
powerCapacity = 2000f;
|
||||||
hasItems = false;
|
hasItems = false;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
powernode = new PowerDistributor("powernode"){{
|
powernode = new PowerDistributor("powernode") {{
|
||||||
shadow = "shadow-round-1";
|
shadow = "shadow-round-1";
|
||||||
}},
|
}};
|
||||||
|
|
||||||
powernodelarge = new PowerDistributor("powernodelarge"){{
|
powernodelarge = new PowerDistributor("powernodelarge") {{
|
||||||
size = 2;
|
size = 2;
|
||||||
powerSpeed = 1f;
|
powerSpeed = 1f;
|
||||||
maxNodes = 5;
|
maxNodes = 5;
|
||||||
laserRange = 7.5f;
|
laserRange = 7.5f;
|
||||||
shadow = "powernodelarge-shadow";
|
shadow = "powernodelarge-shadow";
|
||||||
}},
|
}};
|
||||||
|
|
||||||
teleporter = new Teleporter("teleporter");
|
teleporter = new Teleporter("teleporter");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,103 +4,108 @@ import com.badlogic.gdx.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.BlockFx;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.Cultivator;
|
import io.anuke.mindustry.world.blocks.types.production.Cultivator;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.Drill;
|
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.Fracker;
|
||||||
import io.anuke.mindustry.world.blocks.types.production.SolidPump;
|
import io.anuke.mindustry.world.blocks.types.production.SolidPump;
|
||||||
|
|
||||||
public class ProductionBlocks {
|
public class ProductionBlocks implements ContentList {
|
||||||
public static final Block
|
public static Block ironDrill, reinforcedDrill, steelDrill, titaniumDrill, laserdrill, nucleardrill, plasmadrill, waterextractor, oilextractor, cultivator;
|
||||||
|
|
||||||
ironDrill = new Drill("irondrill") {{
|
@Override
|
||||||
tier = 1;
|
public void load() {
|
||||||
drillTime = 400;
|
ironDrill = new Drill("irondrill") {{
|
||||||
}},
|
tier = 1;
|
||||||
|
drillTime = 400;
|
||||||
|
}};
|
||||||
|
|
||||||
reinforcedDrill = new Drill("reinforceddrill") {{
|
reinforcedDrill = new Drill("reinforceddrill") {{
|
||||||
tier = 2;
|
tier = 2;
|
||||||
drillTime = 360;
|
drillTime = 360;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
steelDrill = new Drill("steeldrill") {{
|
steelDrill = new Drill("steeldrill") {{
|
||||||
tier = 3;
|
tier = 3;
|
||||||
drillTime = 320;
|
drillTime = 320;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
titaniumDrill = new Drill("titaniumdrill") {{
|
titaniumDrill = new Drill("titaniumdrill") {{
|
||||||
tier = 4;
|
tier = 4;
|
||||||
drillTime = 280;
|
drillTime = 280;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
laserdrill = new Drill("laserdrill") {{
|
laserdrill = new Drill("laserdrill") {{
|
||||||
drillTime = 220;
|
drillTime = 220;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerUse = 0.2f;
|
powerUse = 0.2f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
tier = 5;
|
tier = 5;
|
||||||
updateEffect = BlockFx.pulverizeMedium;
|
updateEffect = BlockFx.pulverizeMedium;
|
||||||
drillEffect = BlockFx.mineBig;
|
drillEffect = BlockFx.mineBig;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
nucleardrill = new Drill("nucleardrill") {{
|
nucleardrill = new Drill("nucleardrill") {{
|
||||||
drillTime = 160;
|
drillTime = 160;
|
||||||
size = 3;
|
size = 3;
|
||||||
powerUse = 0.5f;
|
powerUse = 0.5f;
|
||||||
drawRim = true;
|
drawRim = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
tier = 5;
|
tier = 5;
|
||||||
updateEffect = BlockFx.pulverizeRed;
|
updateEffect = BlockFx.pulverizeRed;
|
||||||
updateEffectChance = 0.03f;
|
updateEffectChance = 0.03f;
|
||||||
drillEffect = BlockFx.mineHuge;
|
drillEffect = BlockFx.mineHuge;
|
||||||
rotateSpeed = 6f;
|
rotateSpeed = 6f;
|
||||||
warmupSpeed = 0.01f;
|
warmupSpeed = 0.01f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
plasmadrill = new Drill("plasmadrill") {{
|
plasmadrill = new Drill("plasmadrill") {{
|
||||||
heatColor = Color.valueOf("ff461b");
|
heatColor = Color.valueOf("ff461b");
|
||||||
drillTime = 110;
|
drillTime = 110;
|
||||||
size = 4;
|
size = 4;
|
||||||
powerUse = 0.7f;
|
powerUse = 0.7f;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
tier = 5;
|
tier = 5;
|
||||||
rotateSpeed = 9f;
|
rotateSpeed = 9f;
|
||||||
drawRim = true;
|
drawRim = true;
|
||||||
updateEffect = BlockFx.pulverizeRedder;
|
updateEffect = BlockFx.pulverizeRedder;
|
||||||
updateEffectChance = 0.04f;
|
updateEffectChance = 0.04f;
|
||||||
drillEffect = BlockFx.mineHuge;
|
drillEffect = BlockFx.mineHuge;
|
||||||
warmupSpeed = 0.005f;
|
warmupSpeed = 0.005f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
waterextractor = new SolidPump("waterextractor") {{
|
waterextractor = new SolidPump("waterextractor") {{
|
||||||
result = Liquids.water;
|
result = Liquids.water;
|
||||||
powerUse = 0.2f;
|
powerUse = 0.2f;
|
||||||
pumpAmount = 0.1f;
|
pumpAmount = 0.1f;
|
||||||
size = 2;
|
size = 2;
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
rotateSpeed = 1.4f;
|
rotateSpeed = 1.4f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
oilextractor = new Fracker("oilextractor") {{
|
oilextractor = new Fracker("oilextractor") {{
|
||||||
result = Liquids.oil;
|
result = Liquids.oil;
|
||||||
inputLiquid = Liquids.water;
|
inputLiquid = Liquids.water;
|
||||||
updateEffect = BlockFx.pulverize;
|
updateEffect = BlockFx.pulverize;
|
||||||
updateEffectChance = 0.05f;
|
updateEffectChance = 0.05f;
|
||||||
inputLiquidUse = 0.3f;
|
inputLiquidUse = 0.3f;
|
||||||
powerUse = 0.6f;
|
powerUse = 0.6f;
|
||||||
pumpAmount = 0.06f;
|
pumpAmount = 0.06f;
|
||||||
size = 3;
|
size = 3;
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
cultivator = new Cultivator("cultivator") {{
|
cultivator = new Cultivator("cultivator") {{
|
||||||
result = Items.biomatter;
|
result = Items.biomatter;
|
||||||
inputLiquid = Liquids.water;
|
inputLiquid = Liquids.water;
|
||||||
liquidUse = 0.2f;
|
liquidUse = 0.2f;
|
||||||
drillTime = 260;
|
drillTime = 260;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,32 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.storage.CoreBlock;
|
import io.anuke.mindustry.world.blocks.types.storage.CoreBlock;
|
||||||
import io.anuke.mindustry.world.blocks.types.storage.SortedUnloader;
|
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.Unloader;
|
||||||
import io.anuke.mindustry.world.blocks.types.storage.Vault;
|
import io.anuke.mindustry.world.blocks.types.storage.Vault;
|
||||||
|
|
||||||
public class StorageBlocks {
|
public class StorageBlocks implements ContentList {
|
||||||
public static final Block
|
public static Block core, vault, unloader, sortedunloader;
|
||||||
|
|
||||||
core = new CoreBlock("core"){{
|
@Override
|
||||||
health = 800;
|
public void load() {
|
||||||
}},
|
core = new CoreBlock("core") {{
|
||||||
|
health = 800;
|
||||||
|
}};
|
||||||
|
|
||||||
vault = new Vault("vault"){{
|
vault = new Vault("vault") {{
|
||||||
size = 3;
|
size = 3;
|
||||||
health = 600;
|
health = 600;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
unloader = new Unloader("unloader"){{
|
unloader = new Unloader("unloader") {{
|
||||||
speed = 5;
|
speed = 5;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
sortedunloader = new SortedUnloader("sortedunloader"){{
|
sortedunloader = new SortedUnloader("sortedunloader") {{
|
||||||
speed = 5;
|
speed = 5;
|
||||||
}};
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +1,33 @@
|
|||||||
package io.anuke.mindustry.content.blocks;
|
package io.anuke.mindustry.content.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.units.RepairPoint;
|
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.ResupplyPoint;
|
||||||
|
|
||||||
public class UnitBlocks {
|
public class UnitBlocks implements ContentList {
|
||||||
public static final Block
|
public static Block resupplyPoint, repairPoint, droneFactory;
|
||||||
/*
|
|
||||||
droneFactory = new UnitFactory("dronefactory"){{
|
|
||||||
type = UnitTypes.drone;
|
|
||||||
produceTime = 200;
|
|
||||||
size = 2;
|
|
||||||
requirements = new ItemStack[]{
|
|
||||||
new ItemStack(Items.stone, 5)
|
|
||||||
};
|
|
||||||
}},
|
|
||||||
|
|
||||||
vtolFactory = new UnitFactory("vtolfactory"){{
|
@Override
|
||||||
type = UnitTypes.vtol;
|
public void load() {
|
||||||
produceTime = 200;
|
/*
|
||||||
size = 2;
|
droneFactory = new UnitFactory("dronefactory") {{
|
||||||
requirements = new ItemStack[]{
|
type = UnitTypes.drone;
|
||||||
new ItemStack(Items.stone, 5)
|
produceTime = 200;
|
||||||
};
|
size = 2;
|
||||||
}},
|
requirements = new ItemStack[]{
|
||||||
|
new ItemStack(Items.stone, 5)
|
||||||
|
};
|
||||||
|
}};*/
|
||||||
|
|
||||||
walkerFactory = new UnitFactory("walkerfactory"){{
|
resupplyPoint = new ResupplyPoint("resupplypoint") {{
|
||||||
type = UnitTypes.scout;
|
shadow = "shadow-round-1";
|
||||||
produceTime = 20;
|
itemCapacity = 30;
|
||||||
size = 2;
|
}};
|
||||||
requirements = new ItemStack[]{
|
|
||||||
new ItemStack(Items.stone, 1)
|
|
||||||
};
|
|
||||||
}},*/
|
|
||||||
|
|
||||||
resupplyPoint = new ResupplyPoint("resupplypoint"){{
|
repairPoint = new RepairPoint("repairpoint") {{
|
||||||
shadow = "shadow-round-1";
|
shadow = "shadow-round-1";
|
||||||
itemCapacity = 30;
|
repairSpeed = 0.1f;
|
||||||
}},
|
}};
|
||||||
|
}
|
||||||
repairPoint = new RepairPoint("repairpoint"){{
|
|
||||||
shadow = "shadow-round-1";
|
|
||||||
repairSpeed = 0.1f;
|
|
||||||
}};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
import io.anuke.mindustry.content.AmmoTypes;
|
import io.anuke.mindustry.content.AmmoTypes;
|
||||||
import io.anuke.mindustry.content.fx.ShootFx;
|
import io.anuke.mindustry.content.fx.ShootFx;
|
||||||
import io.anuke.mindustry.type.AmmoType;
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.types.defense.turrets.*;
|
import io.anuke.mindustry.world.blocks.types.defense.turrets.*;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
@@ -11,167 +12,170 @@ import io.anuke.ucore.util.Angles;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
public class WeaponBlocks{
|
public class WeaponBlocks implements ContentList {
|
||||||
public static Block
|
public static Block duo, scatter, scorch, hail, wave, crux, lancer, arc, swarmer, ripple, cyclone, fuse, spectre, eraser, meltdown;
|
||||||
|
|
||||||
duo = new DoubleTurret("duo"){{
|
@Override
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite};
|
public void load() {
|
||||||
reload = 25f;
|
duo = new DoubleTurret("duo") {{
|
||||||
restitution = 0.03f;
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite};
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
reload = 25f;
|
||||||
}},
|
restitution = 0.03f;
|
||||||
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
|
}};
|
||||||
|
|
||||||
scatter = new BurstTurret("scatter") {{
|
scatter = new BurstTurret("scatter") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic};
|
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic};
|
||||||
ammoPerShot = 1;
|
ammoPerShot = 1;
|
||||||
shots = 3;
|
shots = 3;
|
||||||
reload = 60f;
|
reload = 60f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
recoil = 1.5f;
|
recoil = 1.5f;
|
||||||
burstSpacing = 6f;
|
burstSpacing = 6f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
scorch = new LiquidTurret("scorch"){{
|
scorch = new LiquidTurret("scorch") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
|
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
|
||||||
recoil = 0f;
|
recoil = 0f;
|
||||||
reload = 5f;
|
reload = 5f;
|
||||||
shootCone = 50f;
|
shootCone = 50f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
|
|
||||||
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||||
}},
|
}};
|
||||||
|
|
||||||
hail = new ItemTurret("hail") {{
|
hail = new ItemTurret("hail") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
|
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
|
||||||
}},
|
}};
|
||||||
|
|
||||||
wave = new LiquidTurret("wave") {{
|
wave = new LiquidTurret("wave") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
|
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
|
||||||
size = 2;
|
size = 2;
|
||||||
recoil = 0f;
|
recoil = 0f;
|
||||||
reload = 4f;
|
reload = 4f;
|
||||||
inaccuracy = 5f;
|
inaccuracy = 5f;
|
||||||
shootCone = 50f;
|
shootCone = 50f;
|
||||||
shootEffect = ShootFx.shootLiquid;
|
shootEffect = ShootFx.shootLiquid;
|
||||||
range = 70f;
|
range = 70f;
|
||||||
|
|
||||||
drawer = (tile, entity) -> {
|
drawer = (tile, entity) -> {
|
||||||
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||||
|
|
||||||
Draw.color(entity.liquids.liquid.color);
|
Draw.color(entity.liquids.liquid.color);
|
||||||
Draw.alpha(entity.liquids.amount/liquidCapacity);
|
Draw.alpha(entity.liquids.amount / liquidCapacity);
|
||||||
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
};
|
};
|
||||||
}},
|
}};
|
||||||
|
|
||||||
crux = new ItemTurret("crux"){{
|
crux = new ItemTurret("crux") {{
|
||||||
size = 2;
|
size = 2;
|
||||||
range = 100f;
|
range = 100f;
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.shellExplosive, AmmoTypes.shellLead, AmmoTypes.shellPlastic, AmmoTypes.shellThorium};
|
ammoTypes = new AmmoType[]{AmmoTypes.shellExplosive, AmmoTypes.shellLead, AmmoTypes.shellPlastic, AmmoTypes.shellThorium};
|
||||||
reload = 70f;
|
reload = 70f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
ammoEjectBack = 3f;
|
ammoEjectBack = 3f;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
ammoUseEffect = ShootFx.shellEjectBig;
|
ammoUseEffect = ShootFx.shellEjectBig;
|
||||||
|
|
||||||
drawer = (tile, entity) -> {
|
drawer = (tile, entity) -> {
|
||||||
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||||
float offsetx = (int)(Mathf.abscurve(Mathf.curve(entity.reload/reload, 0.3f, 0.2f)) * 3f);
|
float offsetx = (int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
|
||||||
float offsety = -(int)(Mathf.abscurve(Mathf.curve(entity.reload/reload, 0.3f, 0.2f)) * 2f);
|
float offsety = -(int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
|
||||||
|
|
||||||
for(int i : Mathf.signs){
|
for (int i : Mathf.signs) {
|
||||||
float rot = entity.rotation + 90*i;
|
float rot = entity.rotation + 90 * i;
|
||||||
Draw.rect(name + "-panel-" + Strings.dir(i),
|
Draw.rect(name + "-panel-" + Strings.dir(i),
|
||||||
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
|
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
|
||||||
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
|
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}},
|
}};
|
||||||
|
|
||||||
lancer = new LaserTurret("lancer"){{
|
lancer = new LaserTurret("lancer") {{
|
||||||
range = 70f;
|
range = 70f;
|
||||||
chargeTime = 70f;
|
chargeTime = 70f;
|
||||||
chargeMaxDelay = 30f;
|
chargeMaxDelay = 30f;
|
||||||
chargeEffects = 7;
|
chargeEffects = 7;
|
||||||
shootType = AmmoTypes.lancerLaser;
|
shootType = AmmoTypes.lancerLaser;
|
||||||
recoil = 2f;
|
recoil = 2f;
|
||||||
reload = 130f;
|
reload = 130f;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
shootEffect = ShootFx.lancerLaserShoot;
|
shootEffect = ShootFx.lancerLaserShoot;
|
||||||
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
||||||
chargeEffect = ShootFx.lancerLaserCharge;
|
chargeEffect = ShootFx.lancerLaserCharge;
|
||||||
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
arc = new LaserTurret("arc"){{
|
arc = new LaserTurret("arc") {{
|
||||||
shootType = AmmoTypes.lightning;
|
shootType = AmmoTypes.lightning;
|
||||||
reload = 100f;
|
reload = 100f;
|
||||||
chargeTime = 70f;
|
chargeTime = 70f;
|
||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
chargeMaxDelay = 30f;
|
chargeMaxDelay = 30f;
|
||||||
chargeEffects = 7;
|
chargeEffects = 7;
|
||||||
shootEffect = ShootFx.lightningShoot;
|
shootEffect = ShootFx.lightningShoot;
|
||||||
chargeEffect = ShootFx.lightningCharge;
|
chargeEffect = ShootFx.lightningCharge;
|
||||||
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
swarmer = new ItemTurret("swarmer") {{
|
swarmer = new ItemTurret("swarmer") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge};
|
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge};
|
||||||
size = 2;
|
size = 2;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
ripple = new ItemTurret("ripple") {{
|
ripple = new ItemTurret("ripple") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
|
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
|
||||||
size = 3;
|
size = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
cyclone = new ItemTurret("cyclone") {{
|
cyclone = new ItemTurret("cyclone") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
|
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
|
||||||
size = 3;
|
size = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
fuse = new ItemTurret("fuse") {{
|
fuse = new ItemTurret("fuse") {{
|
||||||
//TODO make it use power
|
//TODO make it use power
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
|
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
|
||||||
size = 3;
|
size = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
spectre = new LaserTurret("spectre") {{
|
spectre = new LaserTurret("spectre") {{
|
||||||
range = 70f;
|
range = 70f;
|
||||||
chargeTime = 70f;
|
chargeTime = 70f;
|
||||||
chargeMaxDelay = 30f;
|
chargeMaxDelay = 30f;
|
||||||
chargeEffects = 7;
|
chargeEffects = 7;
|
||||||
shootType = AmmoTypes.spectreLaser;
|
shootType = AmmoTypes.spectreLaser;
|
||||||
recoil = 2f;
|
recoil = 2f;
|
||||||
reload = 130f;
|
reload = 130f;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
shootEffect = ShootFx.lancerLaserShoot;
|
shootEffect = ShootFx.lancerLaserShoot;
|
||||||
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
||||||
chargeEffect = ShootFx.lancerLaserCharge;
|
chargeEffect = ShootFx.lancerLaserCharge;
|
||||||
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
size = 3;
|
size = 3;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
eraser = new ItemTurret("eraser"){{
|
eraser = new ItemTurret("eraser") {{
|
||||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
||||||
reload = 25f;
|
reload = 25f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||||
size = 4;
|
size = 4;
|
||||||
}},
|
}};
|
||||||
|
|
||||||
meltdown = new PowerTurret("meltdown") {{
|
meltdown = new PowerTurret("meltdown") {{
|
||||||
shootType = AmmoTypes.meltdownLaser;
|
shootType = AmmoTypes.meltdownLaser;
|
||||||
size = 4;
|
size = 4;
|
||||||
}};
|
}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,79 +3,84 @@ package io.anuke.mindustry.content.bullets;
|
|||||||
import io.anuke.mindustry.content.fx.BulletFx;
|
import io.anuke.mindustry.content.fx.BulletFx;
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class ArtilleryBullets {
|
public class ArtilleryBullets implements ContentList{
|
||||||
public static final BulletType
|
public static BulletType lead, thorium, plastic, homing, incindiary, surge;
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 0) {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
hiteffect = BulletFx.flakExplosion;
|
|
||||||
knockback = 0.8f;
|
|
||||||
lifetime = 90f;
|
|
||||||
drag = 0.01f;
|
|
||||||
bulletWidth = bulletHeight = 9f;
|
|
||||||
bulletSprite = "frag";
|
|
||||||
bulletShrink = 0.1f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
thorium = new BasicBulletType(3f, 0) {
|
lead = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
lifetime = 90f;
|
lifetime = 90f;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
bulletWidth = bulletHeight = 9f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletSprite = "frag";
|
bulletSprite = "frag";
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
plastic = new BasicBulletType(3f, 0) {
|
thorium = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
lifetime = 90f;
|
lifetime = 90f;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
bulletWidth = bulletHeight = 9f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletSprite = "frag";
|
bulletSprite = "frag";
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
homing = new BasicBulletType(3f, 0) {
|
plastic = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
lifetime = 90f;
|
lifetime = 90f;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
bulletWidth = bulletHeight = 9f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletSprite = "frag";
|
bulletSprite = "frag";
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
incindiary = new BasicBulletType(3f, 0) {
|
homing = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
lifetime = 90f;
|
lifetime = 90f;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
bulletWidth = bulletHeight = 9f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletSprite = "frag";
|
bulletSprite = "frag";
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
surge = new BasicBulletType(3f, 0) {
|
incindiary = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
knockback = 0.8f;
|
knockback = 0.8f;
|
||||||
lifetime = 90f;
|
lifetime = 90f;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
bulletWidth = bulletHeight = 9f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletSprite = "frag";
|
bulletSprite = "frag";
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
surge = new BasicBulletType(3f, 0) {
|
||||||
|
{
|
||||||
|
hiteffect = BulletFx.flakExplosion;
|
||||||
|
knockback = 0.8f;
|
||||||
|
lifetime = 90f;
|
||||||
|
drag = 0.01f;
|
||||||
|
bulletWidth = bulletHeight = 9f;
|
||||||
|
bulletSprite = "frag";
|
||||||
|
bulletShrink = 0.1f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,35 +2,40 @@ package io.anuke.mindustry.content.bullets;
|
|||||||
|
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class FlakBullets {
|
public class FlakBullets implements ContentList {
|
||||||
public static final BulletType
|
public static BulletType lead, plastic, explosive, surge;
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 5) {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
bulletWidth = 7f;
|
|
||||||
bulletHeight = 9f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
plastic = new BasicBulletType(3f, 5) {
|
lead = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
explosive = new BasicBulletType(3f, 5) {
|
plastic = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
surge = new BasicBulletType(3f, 5) {
|
explosive = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
surge = new BasicBulletType(3f, 5) {
|
||||||
|
{
|
||||||
|
bulletWidth = 7f;
|
||||||
|
bulletHeight = 9f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,28 +2,33 @@ package io.anuke.mindustry.content.bullets;
|
|||||||
|
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class MissileBullets {
|
public class MissileBullets implements ContentList {
|
||||||
public static final BulletType
|
public static BulletType explosive, incindiary, surge;
|
||||||
|
|
||||||
explosive = new BasicBulletType(3f, 5) {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
bulletWidth = 7f;
|
|
||||||
bulletHeight = 9f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
incindiary = new BasicBulletType(3f, 5) {
|
explosive = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
surge = new BasicBulletType(3f, 5) {
|
incindiary = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
surge = new BasicBulletType(3f, 5) {
|
||||||
|
{
|
||||||
|
bulletWidth = 7f;
|
||||||
|
bulletHeight = 9f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,124 +4,129 @@ import io.anuke.mindustry.content.fx.BulletFx;
|
|||||||
import io.anuke.mindustry.content.fx.Fx;
|
import io.anuke.mindustry.content.fx.Fx;
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class ShellBullets {
|
public class ShellBullets implements ContentList {
|
||||||
public static final BulletType
|
public static BulletType lead, leadShard, thorium, thoriumShard, plastic, plasticShard, explosive, explosiveShard, incindiary;
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 0) {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
hiteffect = BulletFx.flakExplosion;
|
|
||||||
knockback = 0.8f;
|
|
||||||
lifetime = 90f;
|
|
||||||
drag = 0.01f;
|
|
||||||
bulletWidth = bulletHeight = 9f;
|
|
||||||
fragBullet = leadShard;
|
|
||||||
bulletSprite = "frag";
|
|
||||||
bulletShrink = 0.1f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
leadShard = new BasicBulletType(3f, 0) {
|
lead = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
drag = 0.1f;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
hiteffect = Fx.none;
|
knockback = 0.8f;
|
||||||
despawneffect = Fx.none;
|
lifetime = 90f;
|
||||||
hitsize = 4;
|
drag = 0.01f;
|
||||||
lifetime = 20f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletWidth = 9f;
|
fragBullet = leadShard;
|
||||||
bulletHeight = 11f;
|
bulletSprite = "frag";
|
||||||
bulletShrink = 1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
thorium = new BasicBulletType(3f, 0) {
|
leadShard = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
drag = 0.1f;
|
||||||
knockback = 0.8f;
|
hiteffect = Fx.none;
|
||||||
lifetime = 90f;
|
despawneffect = Fx.none;
|
||||||
drag = 0.01f;
|
hitsize = 4;
|
||||||
bulletWidth = bulletHeight = 9f;
|
lifetime = 20f;
|
||||||
fragBullet = leadShard;
|
bulletWidth = 9f;
|
||||||
bulletSprite = "frag";
|
bulletHeight = 11f;
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
thoriumShard = new BasicBulletType(3f, 0) {
|
thorium = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
drag = 0.1f;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
hiteffect = Fx.none;
|
knockback = 0.8f;
|
||||||
despawneffect = Fx.none;
|
lifetime = 90f;
|
||||||
hitsize = 4;
|
drag = 0.01f;
|
||||||
lifetime = 20f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletWidth = 9f;
|
fragBullet = leadShard;
|
||||||
bulletHeight = 11f;
|
bulletSprite = "frag";
|
||||||
bulletShrink = 1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
plastic = new BasicBulletType(3f, 0) {
|
thoriumShard = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
drag = 0.1f;
|
||||||
knockback = 0.8f;
|
hiteffect = Fx.none;
|
||||||
lifetime = 90f;
|
despawneffect = Fx.none;
|
||||||
drag = 0.01f;
|
hitsize = 4;
|
||||||
bulletWidth = bulletHeight = 9f;
|
lifetime = 20f;
|
||||||
fragBullet = leadShard;
|
bulletWidth = 9f;
|
||||||
bulletSprite = "frag";
|
bulletHeight = 11f;
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
plasticShard = new BasicBulletType(3f, 0) {
|
plastic = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
drag = 0.1f;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
hiteffect = Fx.none;
|
knockback = 0.8f;
|
||||||
despawneffect = Fx.none;
|
lifetime = 90f;
|
||||||
hitsize = 4;
|
drag = 0.01f;
|
||||||
lifetime = 20f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletWidth = 9f;
|
fragBullet = leadShard;
|
||||||
bulletHeight = 11f;
|
bulletSprite = "frag";
|
||||||
bulletShrink = 1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
explosive = new BasicBulletType(3f, 0) {
|
plasticShard = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
drag = 0.1f;
|
||||||
knockback = 0.8f;
|
hiteffect = Fx.none;
|
||||||
lifetime = 90f;
|
despawneffect = Fx.none;
|
||||||
drag = 0.01f;
|
hitsize = 4;
|
||||||
bulletWidth = bulletHeight = 9f;
|
lifetime = 20f;
|
||||||
fragBullet = leadShard;
|
bulletWidth = 9f;
|
||||||
bulletSprite = "frag";
|
bulletHeight = 11f;
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
explosiveShard = new BasicBulletType(3f, 0) {
|
explosive = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
drag = 0.1f;
|
hiteffect = BulletFx.flakExplosion;
|
||||||
hiteffect = Fx.none;
|
knockback = 0.8f;
|
||||||
despawneffect = Fx.none;
|
lifetime = 90f;
|
||||||
hitsize = 4;
|
drag = 0.01f;
|
||||||
lifetime = 20f;
|
bulletWidth = bulletHeight = 9f;
|
||||||
bulletWidth = 9f;
|
fragBullet = leadShard;
|
||||||
bulletHeight = 11f;
|
bulletSprite = "frag";
|
||||||
bulletShrink = 1f;
|
bulletShrink = 0.1f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
incindiary = new BasicBulletType(3f, 0) {
|
explosiveShard = new BasicBulletType(3f, 0) {
|
||||||
{
|
{
|
||||||
hiteffect = BulletFx.flakExplosion;
|
drag = 0.1f;
|
||||||
knockback = 0.8f;
|
hiteffect = Fx.none;
|
||||||
lifetime = 90f;
|
despawneffect = Fx.none;
|
||||||
drag = 0.01f;
|
hitsize = 4;
|
||||||
bulletWidth = bulletHeight = 9f;
|
lifetime = 20f;
|
||||||
fragBullet = leadShard;
|
bulletWidth = 9f;
|
||||||
bulletSprite = "frag";
|
bulletHeight = 11f;
|
||||||
bulletShrink = 0.1f;
|
bulletShrink = 1f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
incindiary = new BasicBulletType(3f, 0) {
|
||||||
|
{
|
||||||
|
hiteffect = BulletFx.flakExplosion;
|
||||||
|
knockback = 0.8f;
|
||||||
|
lifetime = 90f;
|
||||||
|
drag = 0.01f;
|
||||||
|
bulletWidth = bulletHeight = 9f;
|
||||||
|
fragBullet = leadShard;
|
||||||
|
bulletSprite = "frag";
|
||||||
|
bulletShrink = 0.1f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,49 +2,54 @@ package io.anuke.mindustry.content.bullets;
|
|||||||
|
|
||||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
|
||||||
public class StandardBullets {
|
public class StandardBullets implements ContentList {
|
||||||
public static final BulletType
|
public static BulletType iron, lead, steel, thorium, homing, tracer;
|
||||||
|
|
||||||
iron = new BasicBulletType(3f, 5) {
|
@Override
|
||||||
{
|
public void load() {
|
||||||
bulletWidth = 7f;
|
|
||||||
bulletHeight = 9f;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
lead = new BasicBulletType(3f, 5) {
|
iron = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
steel = new BasicBulletType(3f, 5) {
|
lead = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
thorium = new BasicBulletType(3f, 5) {
|
steel = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
homing = new BasicBulletType(3f, 5) {
|
thorium = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
tracer = new BasicBulletType(3f, 5) {
|
homing = new BasicBulletType(3f, 5) {
|
||||||
{
|
{
|
||||||
bulletWidth = 7f;
|
bulletWidth = 7f;
|
||||||
bulletHeight = 9f;
|
bulletHeight = 9f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tracer = new BasicBulletType(3f, 5) {
|
||||||
|
{
|
||||||
|
bulletWidth = 7f;
|
||||||
|
bulletHeight = 9f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.mindustry.entities.effect.DamageArea;
|
|||||||
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;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
@@ -23,147 +24,152 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class TurretBullets {
|
public class TurretBullets implements ContentList {
|
||||||
|
public static BulletType fireball, basicFlame, lancerLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning;
|
||||||
|
|
||||||
public static final BulletType
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
fireball = new BulletType(1f, 1) {
|
fireball = new BulletType(1f, 1) {
|
||||||
{
|
{
|
||||||
pierce = true;
|
pierce = true;
|
||||||
hitTiles = false;
|
hitTiles = false;
|
||||||
drag = 0.3f;
|
drag = 0.3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Bullet b) {
|
public void init(Bullet b) {
|
||||||
b.velocity.setLength(0.6f + Mathf.random(2f));
|
b.velocity.setLength(0.6f + Mathf.random(2f));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Bullet b) {
|
public void draw(Bullet b) {
|
||||||
//TODO add color to the bullet depending on the color of the flame it came from
|
//TODO add color to the bullet depending on the color of the flame it came from
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin());
|
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin());
|
||||||
Fill.circle(b.x, b.y, 3f * b.fout());
|
Fill.circle(b.x, b.y, 3f * b.fout());
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Bullet b) {
|
public void update(Bullet b) {
|
||||||
if(Mathf.chance(0.04 * Timers.delta())){
|
if (Mathf.chance(0.04 * Timers.delta())) {
|
||||||
Tile tile = world.tileWorld(b.x, b.y);
|
Tile tile = world.tileWorld(b.x, b.y);
|
||||||
if(tile != null){
|
if (tile != null) {
|
||||||
Fire.create(tile);
|
Fire.create(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Mathf.chance(0.1 * Timers.delta())) {
|
||||||
|
Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Mathf.chance(0.1 * Timers.delta())) {
|
||||||
|
Effects.effect(EnvironmentFx.ballfire, b.x, b.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if(Mathf.chance(0.1 * Timers.delta())){
|
basicFlame = new BulletType(2f, 0) {
|
||||||
Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y);
|
{
|
||||||
|
hitsize = 7f;
|
||||||
|
lifetime = 30f;
|
||||||
|
pierce = true;
|
||||||
|
drag = 0.07f;
|
||||||
|
hiteffect = BulletFx.hitFlameSmall;
|
||||||
|
despawneffect = Fx.none;
|
||||||
|
status = StatusEffects.burning;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.1 * Timers.delta())){
|
@Override
|
||||||
Effects.effect(EnvironmentFx.ballfire, b.x, b.y);
|
public void draw(Bullet b) {
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
|
||||||
|
|
||||||
basicFlame = new BulletType(2f, 0) {
|
lancerLaser = new BulletType(0.001f, 1) {
|
||||||
{
|
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
|
||||||
hitsize = 7f;
|
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
|
||||||
lifetime = 30f;
|
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
|
||||||
pierce = true;
|
float length = 70f;
|
||||||
drag = 0.07f;
|
|
||||||
hiteffect = BulletFx.hitFlameSmall;
|
|
||||||
despawneffect = Fx.none;
|
|
||||||
status = StatusEffects.burning;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
{
|
||||||
public void draw(Bullet b) {}
|
hiteffect = BulletFx.hitLancer;
|
||||||
},
|
despawneffect = Fx.none;
|
||||||
|
hitsize = 4;
|
||||||
|
lifetime = 16f;
|
||||||
|
pierce = true;
|
||||||
|
}
|
||||||
|
|
||||||
lancerLaser = new BulletType(0.001f, 1) {
|
@Override
|
||||||
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
|
public void init(Bullet b) {
|
||||||
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
|
DamageArea.collideLine(b, b.team, hiteffect, b.x, b.y, b.angle(), length);
|
||||||
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
|
}
|
||||||
float length = 70f;
|
|
||||||
|
|
||||||
{
|
@Override
|
||||||
hiteffect = BulletFx.hitLancer;
|
public void draw(Bullet b) {
|
||||||
despawneffect = Fx.none;
|
float f = Mathf.curve(b.fin(), 0f, 0.2f);
|
||||||
hitsize = 4;
|
float baseLen = length * f;
|
||||||
lifetime = 16f;
|
|
||||||
pierce = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
||||||
public void init(Bullet b) {
|
for (int s = 0; s < 3; s++) {
|
||||||
DamageArea.collideLine(b, b.team, hiteffect, b.x, b.y, b.angle(), length);
|
Draw.color(colors[s]);
|
||||||
}
|
for (int i = 0; i < tscales.length; i++) {
|
||||||
|
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
|
||||||
@Override
|
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
|
||||||
public void draw(Bullet b) {
|
}
|
||||||
float f = Mathf.curve(b.fin(), 0f, 0.2f);
|
|
||||||
float baseLen = length * f;
|
|
||||||
|
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
|
|
||||||
for(int s = 0; s < 3; s ++) {
|
|
||||||
Draw.color(colors[s]);
|
|
||||||
for (int i = 0; i < tscales.length; i++) {
|
|
||||||
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
|
|
||||||
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
|
|
||||||
}
|
}
|
||||||
|
Draw.reset();
|
||||||
}
|
}
|
||||||
Draw.reset();
|
};
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fuseShot = new BulletType(0.01f, 100) {
|
fuseShot = new BulletType(0.01f, 100) {
|
||||||
//TODO
|
//TODO
|
||||||
},
|
};
|
||||||
|
|
||||||
waterShot = new LiquidBulletType(Liquids.water) {
|
waterShot = new LiquidBulletType(Liquids.water) {
|
||||||
{
|
{
|
||||||
status = StatusEffects.wet;
|
status = StatusEffects.wet;
|
||||||
statusIntensity = 0.5f;
|
statusIntensity = 0.5f;
|
||||||
knockback = 0.65f;
|
knockback = 0.65f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
cryoShot = new LiquidBulletType(Liquids.cryofluid) {
|
cryoShot = new LiquidBulletType(Liquids.cryofluid) {
|
||||||
{
|
{
|
||||||
status = StatusEffects.freezing;
|
status = StatusEffects.freezing;
|
||||||
statusIntensity = 0.5f;
|
statusIntensity = 0.5f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
lavaShot = new LiquidBulletType(Liquids.lava) {
|
lavaShot = new LiquidBulletType(Liquids.lava) {
|
||||||
{
|
{
|
||||||
damage = 4;
|
damage = 4;
|
||||||
speed = 1.9f;
|
speed = 1.9f;
|
||||||
drag = 0.03f;
|
drag = 0.03f;
|
||||||
status = StatusEffects.melting;
|
status = StatusEffects.melting;
|
||||||
statusIntensity = 0.5f;
|
statusIntensity = 0.5f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
oilShot = new LiquidBulletType(Liquids.oil) {
|
oilShot = new LiquidBulletType(Liquids.oil) {
|
||||||
{
|
{
|
||||||
speed = 2f;
|
speed = 2f;
|
||||||
drag = 0.03f;
|
drag = 0.03f;
|
||||||
status = StatusEffects.oiled;
|
status = StatusEffects.oiled;
|
||||||
statusIntensity = 0.5f;
|
statusIntensity = 0.5f;
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
lightning = new BulletType(0.001f, 5) {
|
lightning = new BulletType(0.001f, 5) {
|
||||||
{
|
{
|
||||||
lifetime = 1;
|
lifetime = 1;
|
||||||
despawneffect = Fx.none;
|
despawneffect = Fx.none;
|
||||||
hiteffect = BulletFx.hitLancer;
|
hiteffect = BulletFx.hitLancer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Bullet b) {}
|
public void draw(Bullet b) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Bullet b) {
|
public void init(Bullet b) {
|
||||||
Lightning.create(b.team, hiteffect, Palette.lancerLaser, damage, b.x, b.y, b.angle(), 30);
|
Lightning.create(b.team, hiteffect, Palette.lancerLaser, damage, b.x, b.y, b.angle(), 30);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.fx;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
@@ -14,260 +15,264 @@ import io.anuke.ucore.util.Tmp;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class BlockFx {
|
public class BlockFx implements ContentList{
|
||||||
public static final Effect
|
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;
|
||||||
|
|
||||||
reactorsmoke = new Effect(17, e -> {
|
@Override
|
||||||
Angles.randLenVectors(e.id, 4, e.fin()*8f, (x, y)->{
|
public void load() {
|
||||||
float size = 1f+e.fout()*5f;
|
|
||||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
reactorsmoke = new Effect(17, e -> {
|
||||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
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(Color.valueOf("fbb97f"), 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(Color.valueOf("d2b29c"), 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.poly(e.x + x, e.y + y, 4, 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(Color.valueOf("ffa480"), 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());
|
||||||
|
Fill.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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(Color.valueOf("f1e479"), Color.LIGHT_GRAY, e.fin());
|
||||||
|
Fill.poly(e.x + x, e.y + y, 4, 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();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
doorclose = new Effect(10, e -> {
|
||||||
nuclearsmoke = new Effect(40, e -> {
|
Lines.stroke(e.fout() * 1.6f);
|
||||||
Angles.randLenVectors(e.id, 4, e.fin()*13f, (x, y)->{
|
Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f);
|
||||||
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();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
dooropenlarge = new Effect(10, e -> {
|
||||||
nuclearcloud = new Effect(90, 200f, e -> {
|
Lines.stroke(e.fout() * 1.6f);
|
||||||
Angles.randLenVectors(e.id, 10, e.finpow()*90f, (x, y)->{
|
Lines.square(e.x, e.y, tilesize + e.fin() * 2f);
|
||||||
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();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
doorcloselarge = new Effect(10, e -> {
|
||||||
redgeneratespark = new Effect(18, e -> {
|
Lines.stroke(e.fout() * 1.6f);
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*8f, (x, y)->{
|
Lines.square(e.x, e.y, tilesize + e.fout() * 2f);
|
||||||
float len = e.fout()*4f;
|
|
||||||
Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.fin());
|
|
||||||
//Draw.alpha(e.fout());
|
|
||||||
Draw.rect("circle", e.x + x, e.y + y, len, len);
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
purify = new Effect(10, e -> {
|
||||||
generatespark = new Effect(18, e -> {
|
Draw.color(Color.ROYAL, Color.GRAY, e.fin());
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*8f, (x, y)->{
|
Lines.stroke(2f);
|
||||||
float len = e.fout()*4f;
|
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||||
Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.fin());
|
|
||||||
Draw.rect("circle", e.x + x, e.y + y, len, len);
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
purifyoil = new Effect(10, e -> {
|
||||||
fuelburn = new Effect(23, e -> {
|
Draw.color(Color.BLACK, Color.GRAY, e.fin());
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*9f, (x, y)->{
|
Lines.stroke(2f);
|
||||||
float len = e.fout()*4f;
|
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
|
||||||
Draw.rect("circle", e.x + x, e.y + y, len, len);
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
purifystone = new Effect(10, e -> {
|
||||||
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.poly(e.x + x, e.y + y, 4, 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(Color.valueOf("ffa480"), 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());
|
|
||||||
Fill.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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(Color.valueOf("f1e479"), Color.LIGHT_GRAY, e.fin());
|
|
||||||
Fill.poly(e.x + x, e.y + y, 4, 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.color(Color.ORANGE, Color.GRAY, e.fin());
|
||||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
Lines.stroke(2f);
|
||||||
|
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
generate = new Effect(11, e -> {
|
||||||
dooropen = new Effect(10, e -> {
|
Draw.color(Color.ORANGE, Color.YELLOW, e.fin());
|
||||||
Lines.stroke(e.fout() * 1.6f);
|
Lines.stroke(1f);
|
||||||
Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f);
|
Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8);
|
||||||
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.poly(e.x + x, e.y + y, 4, e.fout() * 2f, 45);
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
mine = new Effect(20, e -> {
|
||||||
mineBig = new Effect(30, e -> {
|
Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> {
|
||||||
Angles.randLenVectors(e.id, 6, 4f + e.fin()*8f, (x, y)->{
|
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
|
||||||
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
|
Fill.poly(e.x + x, e.y + y, 4, e.fout() * 2f, 45);
|
||||||
Fill.poly(e.x + x, e.y + y, 4, e.fout() * 2f + 0.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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.poly(e.x + x, e.y + y, 4, 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.atan2(x, y), e.fin() * 4f + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
teleport = new Effect(60, e -> {
|
||||||
mineHuge = new Effect(40, e -> {
|
Draw.color(e.color);
|
||||||
Angles.randLenVectors(e.id, 8, 5f + e.fin()*10f, (x, y)->{
|
Lines.stroke(e.fin() * 2f);
|
||||||
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
|
Lines.circle(e.x, e.y, 7f + e.fout() * 8f);
|
||||||
Fill.poly(e.x + x, e.y + y, 4, e.fout() * 2f + 0.5f, 45);
|
|
||||||
|
Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> {
|
||||||
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 4f + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
teleportOut = new Effect(20, e -> {
|
||||||
smelt = new Effect(20, e -> {
|
Draw.color(e.color);
|
||||||
Angles.randLenVectors(e.id, 6, 2f + e.fin()*5f, (x, y)->{
|
Lines.stroke(e.fout() * 2f);
|
||||||
Draw.color(Color.WHITE, e.color, e.fin());
|
Lines.circle(e.x, e.y, 7f + e.fin() * 8f);
|
||||||
Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fout()*2f, 45);
|
|
||||||
|
Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> {
|
||||||
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 4f + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
}),
|
ripple = new GroundEffect(false, 30, e -> {
|
||||||
teleportActivate = new Effect(50, e -> {
|
Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f));
|
||||||
Draw.color(e.color);
|
Lines.stroke(e.fout() + 0.4f);
|
||||||
|
Lines.circle(e.x, e.y, 2f + e.fin() * 4f);
|
||||||
e.scaled(8f, e2 -> {
|
Draw.reset();
|
||||||
Lines.stroke(e2.fout()*4f);
|
|
||||||
Lines.circle(e2.x, e2.y, 4f + e2.fin()*27f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Lines.stroke(e.fout()*2f);
|
bubble = new Effect(20, e -> {
|
||||||
|
Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f));
|
||||||
Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> {
|
Lines.stroke(e.fout() + 0.2f);
|
||||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin()*4f + 1f);
|
Angles.randLenVectors(e.id, 2, 8f, (x, y) -> {
|
||||||
|
Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f);
|
||||||
|
});
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
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.atan2(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.atan2(x, y), e.fslope()*4f + 1f);
|
|
||||||
});
|
|
||||||
|
|
||||||
Draw.reset();
|
|
||||||
}),
|
|
||||||
ripple = new GroundEffect(false, 30, e -> {
|
|
||||||
Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 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(Hue.shift(Tmp.c1.set(e.color), 2, 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();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
@@ -9,101 +10,105 @@ import io.anuke.ucore.graphics.Lines;
|
|||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class BulletFx {
|
public class BulletFx implements ContentList {
|
||||||
public static final Effect
|
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLancer, despawn, flakExplosion;
|
||||||
|
|
||||||
hitBulletSmall = new Effect(14, e -> {
|
@Override
|
||||||
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
public void load() {
|
||||||
Lines.stroke(0.5f + e.fout());
|
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*15f, e.rotation, 50f, (x, y) -> {
|
hitBulletSmall = new Effect(14, e -> {
|
||||||
float ang = Mathf.atan2(x, y);
|
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
||||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout()*3 + 1f);
|
Lines.stroke(0.5f + e.fout());
|
||||||
|
|
||||||
|
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> {
|
||||||
|
float ang = Mathf.atan2(x, y);
|
||||||
|
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
hitBulletBig = new Effect(13, e -> {
|
||||||
}),
|
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
||||||
|
Lines.stroke(0.5f + e.fout() * 1.5f);
|
||||||
|
|
||||||
hitBulletBig = new Effect(13, e -> {
|
Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> {
|
||||||
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
float ang = Mathf.atan2(x, y);
|
||||||
Lines.stroke(0.5f + e.fout()*1.5f);
|
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 8, e.finpow()*30f, e.rotation, 50f, (x, y) -> {
|
Draw.reset();
|
||||||
float ang = Mathf.atan2(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());
|
||||||
|
|
||||||
hitFlameSmall = new Effect(14, e -> {
|
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> {
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
float ang = Mathf.atan2(x, y);
|
||||||
Lines.stroke(0.5f + e.fout());
|
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*15f, e.rotation, 50f, (x, y) -> {
|
Draw.reset();
|
||||||
float ang = Mathf.atan2(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);
|
||||||
|
|
||||||
hitLiquid = new Effect(16, e -> {
|
Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation + 180f, 60f, (x, y) -> {
|
||||||
Draw.color(e.color);
|
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 5, e.fin()*15f, e.rotation + 180f, 60f, (x, y) -> {
|
Draw.reset();
|
||||||
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);
|
||||||
|
|
||||||
hitLancer = new Effect(12, e -> {
|
Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> {
|
||||||
Draw.color(Color.WHITE);
|
float ang = Mathf.atan2(x, y);
|
||||||
Lines.stroke(e.fout()*1.5f);
|
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 8, e.finpow()*17f, e.rotation, 360f, (x, y) -> {
|
Draw.reset();
|
||||||
float ang = Mathf.atan2(x, y);
|
|
||||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout()*4 + 1f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
despawn = new Effect(12, e -> {
|
||||||
}),
|
Draw.color(Palette.lighterOrange, Color.GRAY, e.fin());
|
||||||
|
Lines.stroke(e.fout());
|
||||||
|
|
||||||
despawn = new Effect(12, e -> {
|
Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> {
|
||||||
Draw.color(Palette.lighterOrange, Color.GRAY, e.fin());
|
float ang = Mathf.atan2(x, y);
|
||||||
Lines.stroke(e.fout());
|
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 7, e.fin()*7f, e.rotation, 40f, (x, y) -> {
|
Draw.reset();
|
||||||
float ang = Mathf.atan2(x, y);
|
|
||||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fout()*2 + 1f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
flakExplosion = new Effect(20, e -> {
|
||||||
}),
|
|
||||||
|
|
||||||
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(Palette.bulletYellow);
|
Draw.color(Color.GRAY);
|
||||||
e.scaled(6, i -> {
|
|
||||||
Lines.stroke(3f * i.fout());
|
Angles.randLenVectors(e.id, 5, 2f + 23f * e.finpow(), (x, y) -> {
|
||||||
Lines.circle(e.x, e.y, 3f + i.fin()*10f);
|
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.atan2(x, y), 1f + e.fout() * 3f);
|
||||||
|
});
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
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.atan2(x, y), 1f + e.fout()*3f);
|
|
||||||
});
|
|
||||||
|
|
||||||
Draw.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,113 +3,117 @@ package io.anuke.mindustry.content.fx;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.content.Liquids;
|
import io.anuke.mindustry.content.Liquids;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class EnvironmentFx {
|
public class EnvironmentFx implements ContentList {
|
||||||
|
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily;
|
||||||
|
|
||||||
public static final Effect
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
burning = new Effect(35f, e -> {
|
burning = new Effect(35f, e -> {
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 3, 2f + e.fin()*7f, (x, y) -> {
|
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);
|
Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f);
|
||||||
|
});
|
||||||
|
|
||||||
|
Draw.color();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color();
|
fire = new Effect(35f, e -> {
|
||||||
}),
|
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||||
|
|
||||||
fire = new Effect(35f, e -> {
|
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 2f + e.fin()*7f, (x, y) -> {
|
Draw.color();
|
||||||
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);
|
||||||
|
|
||||||
smoke = new Effect(35f, e -> {
|
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
|
||||||
Draw.color(Color.GRAY);
|
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 1, 2f + e.fin()*7f, (x, y) -> {
|
Draw.color();
|
||||||
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);
|
||||||
|
|
||||||
steam = new Effect(35f, e -> {
|
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
|
||||||
Draw.color(Color.LIGHT_GRAY);
|
Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 2f + e.fin()*7f, (x, y) -> {
|
Draw.color();
|
||||||
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);
|
||||||
|
|
||||||
fireballsmoke = new Effect(25f, e -> {
|
Angles.randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> {
|
||||||
Draw.color(Color.GRAY);
|
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 1, 2f + e.fin()*7f, (x, y) -> {
|
Draw.color();
|
||||||
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());
|
||||||
|
|
||||||
ballfire = new Effect(25f, e -> {
|
Angles.randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> {
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 2f + e.fin()*7f, (x, y) -> {
|
Draw.color();
|
||||||
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);
|
||||||
|
|
||||||
freezing = new Effect(40f, e -> {
|
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
|
||||||
Draw.color(Liquids.cryofluid.color);
|
Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 1f + e.fin()*2f, (x, y) -> {
|
Draw.color();
|
||||||
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));
|
||||||
|
|
||||||
melting = new Effect(40f, e -> {
|
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> {
|
||||||
Draw.color(Liquids.lava.color, Color.WHITE, e.fout()/5f + Mathf.randomSeedRange(e.id, 0.12f));
|
Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 1f + e.fin()*3f, (x, y) -> {
|
Draw.color();
|
||||||
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);
|
||||||
|
|
||||||
wet = new Effect(40f, e -> {
|
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
|
||||||
Draw.color(Liquids.water.color);
|
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 1f + e.fin()*2f, (x, y) -> {
|
Draw.color();
|
||||||
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color();
|
oily = new Effect(42f, e -> {
|
||||||
}),
|
Draw.color(Liquids.oil.color);
|
||||||
|
|
||||||
oily = new Effect(42f, e -> {
|
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
|
||||||
Draw.color(Liquids.oil.color);
|
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 1f + e.fin()*2f, (x, y) -> {
|
Draw.color();
|
||||||
Fill.circle(e.x + x, e.y + y, e.fout() * 1f);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Draw.color();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
@@ -9,84 +10,88 @@ import io.anuke.ucore.graphics.Lines;
|
|||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class ExplosionFx {
|
public class ExplosionFx implements ContentList {
|
||||||
public static final Effect
|
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
|
||||||
|
|
||||||
shockwave = new Effect(10f, 80f, e -> {
|
@Override
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
public void load() {
|
||||||
Lines.stroke(e.fout()*2f + 0.2f);
|
|
||||||
Lines.circle(e.x, e.y, e.fin()*28f);
|
|
||||||
Draw.reset();
|
|
||||||
}),
|
|
||||||
|
|
||||||
bigShockwave = new Effect(10f, 80f, e -> {
|
shockwave = new Effect(10f, 80f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||||
Lines.stroke(e.fout()*3f);
|
Lines.stroke(e.fout() * 2f + 0.2f);
|
||||||
Lines.circle(e.x, e.y, e.fin()*50f);
|
Lines.circle(e.x, e.y, e.fin() * 28f);
|
||||||
Draw.reset();
|
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);
|
bigShockwave = new Effect(10f, 80f, e -> {
|
||||||
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||||
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) ->{
|
Lines.stroke(e.fout() * 3f);
|
||||||
Fill.circle(e.x + x, e.y + y, e.fout()*3f + 0.5f);
|
Lines.circle(e.x, e.y, e.fin() * 50f);
|
||||||
Fill.circle(e.x + x/2f, e.y + y/2f, e.fout()*1f);
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
|
nuclearShockwave = new Effect(10f, 200f, e -> {
|
||||||
Lines.stroke(1.5f * e.fout());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||||
|
Lines.stroke(e.fout() * 3f + 0.2f);
|
||||||
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> {
|
Lines.poly(e.x, e.y, 40, e.fin() * 140f);
|
||||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout()*3f);
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
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);
|
||||||
|
});
|
||||||
|
|
||||||
blockExplosion = new Effect(30, e -> {
|
Draw.color(Color.GRAY);
|
||||||
e.scaled(7, i -> {
|
|
||||||
Lines.stroke(3.1f * i.fout());
|
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) -> {
|
||||||
Lines.circle(e.x, e.y, 3f + i.fin()*14f);
|
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.atan2(x, y), 1f + e.fout() * 3f);
|
||||||
|
});
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color(Color.GRAY);
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 6, 2f + 19f * e.finpow(), (x, y) ->{
|
Draw.color(Color.GRAY);
|
||||||
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);
|
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.atan2(x, y), 1f + e.fout() * 3f);
|
||||||
|
});
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.fin());
|
blockExplosionSmoke = new Effect(30, e -> {
|
||||||
Lines.stroke(1.7f * e.fout());
|
Draw.color(Color.GRAY);
|
||||||
|
|
||||||
Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> {
|
Angles.randLenVectors(e.id, 6, 4f + 30f * e.finpow(), (x, y) -> {
|
||||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout()*3f);
|
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();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
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();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
@@ -10,44 +11,47 @@ import io.anuke.ucore.util.Angles;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
public class Fx{
|
public class Fx implements ContentList {
|
||||||
|
public static Effect none, placeBlock, breakBlock, smoke, spawn;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load() {
|
||||||
|
|
||||||
public static final Effect
|
none = new Effect(0, 0f, e -> {
|
||||||
|
|
||||||
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 * (float)(e.data) + e.fin() * 3f);
|
|
||||||
Draw.reset();
|
|
||||||
}),
|
|
||||||
|
|
||||||
breakBlock = new Effect(12, e -> {
|
|
||||||
float data = (float)(e.data);
|
|
||||||
|
|
||||||
Draw.color(Palette.remove);
|
|
||||||
Lines.stroke(3f - e.fin() * 2f);
|
|
||||||
Lines.square(e.x, e.y, tilesize / 2f * data + e.fin() * 3f);
|
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 3 + (int)(data*3), data*2f + (tilesize * data) * e.finpow(), (x, y) -> {
|
|
||||||
Fill.square(e.x + x, e.y + y, 1f + e.fout()*(3f+data));
|
|
||||||
});
|
});
|
||||||
Draw.reset();
|
|
||||||
}),
|
|
||||||
|
|
||||||
smoke = new Effect(100, e -> {
|
placeBlock = new Effect(16, e -> {
|
||||||
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.fin());
|
Draw.color(Palette.accent);
|
||||||
float size = 7f-e.fin()*7f;
|
Lines.stroke(3f - e.fin() * 2f);
|
||||||
Draw.rect("circle", e.x, e.y, size, size);
|
Lines.square(e.x, e.y, tilesize / 2f * (float) (e.data) + e.fin() * 3f);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
});
|
||||||
|
|
||||||
spawn = new Effect(23, e -> {
|
breakBlock = new Effect(12, e -> {
|
||||||
Lines.stroke(2f);
|
float data = (float) (e.data);
|
||||||
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.fin());
|
|
||||||
Lines.circle(e.x, e.y, 7f - e.fin() * 6f);
|
Draw.color(Palette.remove);
|
||||||
Draw.reset();
|
Lines.stroke(3f - e.fin() * 2f);
|
||||||
});
|
Lines.square(e.x, e.y, tilesize / 2f * data + e.fin() * 3f);
|
||||||
|
|
||||||
|
Angles.randLenVectors(e.id, 3 + (int) (data * 3), data * 2f + (tilesize * data) * e.finpow(), (x, y) -> {
|
||||||
|
Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + data));
|
||||||
|
});
|
||||||
|
Draw.reset();
|
||||||
|
});
|
||||||
|
|
||||||
|
smoke = new Effect(100, e -> {
|
||||||
|
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), 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);
|
||||||
|
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.fin());
|
||||||
|
Lines.circle(e.x, e.y, 7f - e.fin() * 6f);
|
||||||
|
Draw.reset();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.fx;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
@@ -11,202 +12,206 @@ import io.anuke.ucore.graphics.Shapes;
|
|||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class ShootFx {
|
public class ShootFx implements ContentList {
|
||||||
public static final Effect
|
public static Effect shootSmall, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
|
||||||
|
|
||||||
shootSmall = new Effect(8, e -> {
|
@Override
|
||||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
public void load() {
|
||||||
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();
|
|
||||||
}),
|
|
||||||
|
|
||||||
shootSmallSmoke = new Effect(20f, e -> {
|
shootSmall = new Effect(8, e -> {
|
||||||
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
||||||
|
float w = 1f + 5 * e.fout();
|
||||||
Angles.randLenVectors(e.id, 5, e.finpow()*6f, e.rotation, 20f, (x, y) -> {
|
Shapes.tri(e.x, e.y, w, 15f * e.fout(), e.rotation);
|
||||||
Fill.circle(e.x + x, e.y + y, e.fout()*1.5f);
|
Shapes.tri(e.x, e.y, w, 3f * e.fout(), e.rotation + 180f);
|
||||||
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
shootSmallSmoke = new Effect(20f, e -> {
|
||||||
}),
|
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||||
|
|
||||||
shootBig = new Effect(9, e -> {
|
Angles.randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> {
|
||||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
|
||||||
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.reset();
|
||||||
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();
|
shootBig = new Effect(9, e -> {
|
||||||
}),
|
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
||||||
|
float w = 1.2f + 7 * e.fout();
|
||||||
shootBigSmoke2 = new Effect(18f, e -> {
|
Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation);
|
||||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
|
||||||
|
Draw.reset();
|
||||||
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();
|
shootBig2 = new Effect(10, e -> {
|
||||||
}),
|
Draw.color(Palette.lightOrange, Color.GRAY, e.fin());
|
||||||
|
float w = 1.2f + 8 * e.fout();
|
||||||
shootSmallFlame = new Effect(30f, e -> {
|
Shapes.tri(e.x, e.y, w, 29f * e.fout(), e.rotation);
|
||||||
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
|
Shapes.tri(e.x, e.y, w, 5f * e.fout(), e.rotation + 180f);
|
||||||
|
Draw.reset();
|
||||||
Angles.randLenVectors(e.id, 8, e.finpow()*26f, e.rotation, 10f, (x, y) -> {
|
|
||||||
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout()*1.5f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
shootBigSmoke = new Effect(17f, e -> {
|
||||||
}),
|
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||||
|
|
||||||
shootLiquid = new Effect(40f, e -> {
|
Angles.randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> {
|
||||||
Draw.color(e.color, Color.WHITE, e.fout()/6f + Mathf.randomSeedRange(e.id, 0.1f));
|
Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f);
|
||||||
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 6, e.finpow()*60f, e.rotation, 11f, (x, y) -> {
|
Draw.reset();
|
||||||
Fill.circle(e.x + x, e.y + y, 0.5f + e.fout()*2.5f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
shootBigSmoke2 = new Effect(18f, e -> {
|
||||||
}),
|
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||||
|
|
||||||
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
|
Angles.randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> {
|
||||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f);
|
||||||
float rot = Math.abs(e.rotation) + 90f;
|
});
|
||||||
|
|
||||||
int i = Mathf.sign(e.rotation);
|
Draw.reset();
|
||||||
|
});
|
||||||
|
|
||||||
float len = (2f + e.finpow()*6f) * i;
|
shootSmallFlame = new Effect(30f, e -> {
|
||||||
float lr = rot + e.fin()*30f*i;
|
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
|
||||||
Draw.rect("white",
|
|
||||||
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();
|
Angles.randLenVectors(e.id, 8, e.finpow() * 26f, e.rotation, 10f, (x, y) -> {
|
||||||
}),
|
Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f);
|
||||||
|
});
|
||||||
|
|
||||||
shellEjectMedium = new GroundEffect(34f, 400f, e -> {
|
Draw.reset();
|
||||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
});
|
||||||
float rot = e.rotation + 90f;
|
|
||||||
for(int i : Mathf.signs){
|
shootLiquid = new Effect(40f, e -> {
|
||||||
float len = (2f + e.finpow()*10f) * i;
|
Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
|
||||||
float lr = rot + e.fin()*20f*i;
|
|
||||||
Draw.rect("casing",
|
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;
|
||||||
|
Draw.rect("white",
|
||||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
|
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()),
|
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
|
||||||
2f, 3f, rot);
|
1f, 2f, rot + e.fin() * 50f * i);
|
||||||
}
|
|
||||||
|
|
||||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
Draw.color();
|
||||||
|
});
|
||||||
|
|
||||||
for(int i : Mathf.signs){
|
shellEjectMedium = new GroundEffect(34f, 400f, e -> {
|
||||||
Angles.randLenVectors(e.id, 4, 1f + e.finpow()*11f, e.rotation + 90f*i, 20f, (x, y) -> {
|
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
||||||
Fill.circle(e.x + x, e.y + y, e.fout()*1.5f);
|
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("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("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.atan2(x, y), e.fout() * 9f);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
Draw.color();
|
Draw.reset();
|
||||||
}),
|
});
|
||||||
|
|
||||||
shellEjectBig = new GroundEffect(22f, 400f, e -> {
|
lancerLaserCharge = new Effect(38f, e -> {
|
||||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
Draw.color(Palette.lancerLaser);
|
||||||
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("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);
|
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
|
||||||
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 3f + 1f);
|
||||||
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();
|
Draw.reset();
|
||||||
}),
|
|
||||||
|
|
||||||
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.atan2(x, y), e.fout()*9f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
lancerLaserChargeBegin = new Effect(71f, e -> {
|
||||||
}),
|
Draw.color(Palette.lancerLaser);
|
||||||
|
Fill.circle(e.x, e.y, e.fin() * 3f);
|
||||||
|
|
||||||
lancerLaserCharge = new Effect(38f, e -> {
|
Draw.color();
|
||||||
Draw.color(Palette.lancerLaser);
|
Fill.circle(e.x, e.y, e.fin() * 2f);
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
|
|
||||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope()*3f + 1f);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Draw.reset();
|
lightningCharge = new Effect(38f, e -> {
|
||||||
}),
|
Draw.color(Palette.lancerLaser);
|
||||||
|
|
||||||
lancerLaserChargeBegin = new Effect(71f, e -> {
|
Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> {
|
||||||
Draw.color(Palette.lancerLaser);
|
Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.atan2(x, y));
|
||||||
Fill.circle(e.x, e.y, e.fin() * 3f);
|
});
|
||||||
|
|
||||||
Draw.color();
|
Draw.reset();
|
||||||
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.atan2(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);
|
||||||
|
|
||||||
lightningShoot= new Effect(12f, e -> {
|
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
|
||||||
Draw.color(Color.WHITE, Palette.lancerLaser, e.fin());
|
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 5f + 2f);
|
||||||
Lines.stroke(e.fout() * 1.2f + 0.5f);
|
});
|
||||||
|
|
||||||
Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> {
|
Draw.reset();
|
||||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin()*5f + 2f);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Draw.reset();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
package io.anuke.mindustry.content.fx;
|
package io.anuke.mindustry.content.fx;
|
||||||
|
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Fill;
|
import io.anuke.ucore.graphics.Fill;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class UnitFx {
|
public class UnitFx implements ContentList {
|
||||||
public static final Effect
|
public static Effect vtolHover;
|
||||||
|
|
||||||
vtolHover = new Effect(40f, e -> {
|
@Override
|
||||||
float len = e.finpow()*10f;
|
public void load() {
|
||||||
float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f);
|
|
||||||
Draw.color(Palette.lightFlame, Palette.lightOrange, e.fin());
|
vtolHover = new Effect(40f, e -> {
|
||||||
Fill.circle(e.x + Angles.trnsx(ang, len), e.y + Angles.trnsy(ang, len), 2f * e.fout());
|
float len = e.finpow() * 10f;
|
||||||
Draw.reset();
|
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();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,60 @@ package io.anuke.mindustry.core;
|
|||||||
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.bullets.*;
|
import io.anuke.mindustry.content.bullets.*;
|
||||||
|
import io.anuke.mindustry.content.fx.*;
|
||||||
import io.anuke.mindustry.entities.StatusEffect;
|
import io.anuke.mindustry.entities.StatusEffect;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||||
import io.anuke.mindustry.entities.units.UnitType;
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
|
import io.anuke.mindustry.type.ContentList;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.ucore.util.Log;
|
import io.anuke.ucore.util.Log;
|
||||||
|
|
||||||
/**Loads all game content by creating class instances.
|
/**Loads all game content.
|
||||||
* Call load() before doing anything with content.*/
|
* Call load() before doing anything with content.*/
|
||||||
public class ContentLoader {
|
public class ContentLoader {
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
|
|
||||||
Object[] content = {
|
ContentList[] content = {
|
||||||
|
//items
|
||||||
|
new Items(),
|
||||||
|
|
||||||
|
//liquids
|
||||||
|
new Liquids(),
|
||||||
|
|
||||||
|
//ammotypes
|
||||||
|
new AmmoTypes(),
|
||||||
|
|
||||||
|
//mechs
|
||||||
|
new Mechs(),
|
||||||
|
|
||||||
|
//bullets
|
||||||
|
new ArtilleryBullets(),
|
||||||
|
new FlakBullets(),
|
||||||
|
new MissileBullets(),
|
||||||
|
new ShellBullets(),
|
||||||
|
new StandardBullets(),
|
||||||
|
new TurretBullets(),
|
||||||
|
|
||||||
|
//units
|
||||||
|
new UnitTypes(),
|
||||||
|
|
||||||
|
//weapons
|
||||||
|
new Weapons(),
|
||||||
|
|
||||||
|
//status effects
|
||||||
|
new StatusEffects(),
|
||||||
|
|
||||||
|
//effects
|
||||||
|
new BlockFx(),
|
||||||
|
new BulletFx(),
|
||||||
|
new EnvironmentFx(),
|
||||||
|
new ExplosionFx(),
|
||||||
|
new Fx(),
|
||||||
|
new ShootFx(),
|
||||||
|
new UnitFx(),
|
||||||
|
|
||||||
//blocks
|
//blocks
|
||||||
new Blocks(),
|
new Blocks(),
|
||||||
new DefenseBlocks(),
|
new DefenseBlocks(),
|
||||||
@@ -30,40 +70,14 @@ public class ContentLoader {
|
|||||||
new PowerBlocks(),
|
new PowerBlocks(),
|
||||||
new CraftingBlocks(),
|
new CraftingBlocks(),
|
||||||
|
|
||||||
//items
|
|
||||||
new Items(),
|
|
||||||
|
|
||||||
//liquids
|
|
||||||
new Liquids(),
|
|
||||||
|
|
||||||
//mechs
|
|
||||||
new Mechs(),
|
|
||||||
|
|
||||||
//weapons
|
|
||||||
new Weapons(),
|
|
||||||
|
|
||||||
//units
|
|
||||||
new UnitTypes(),
|
|
||||||
|
|
||||||
|
|
||||||
//bullets
|
|
||||||
new ArtilleryBullets(),
|
|
||||||
new FlakBullets(),
|
|
||||||
new MissileBullets(),
|
|
||||||
new ShellBullets(),
|
|
||||||
new StandardBullets(),
|
|
||||||
new TurretBullets(),
|
|
||||||
|
|
||||||
//ammotypes
|
|
||||||
new AmmoTypes(),
|
|
||||||
|
|
||||||
//status effects
|
|
||||||
new StatusEffects(),
|
|
||||||
|
|
||||||
//recipes
|
//recipes
|
||||||
new Recipes(),
|
new Recipes(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
for (ContentList list : content){
|
||||||
|
list.load();
|
||||||
|
}
|
||||||
|
|
||||||
for(Block block : Block.getAllBlocks()){
|
for(Block block : Block.getAllBlocks()){
|
||||||
block.init();
|
block.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,10 +139,6 @@ public class NetClient extends Module {
|
|||||||
entity.read(data, time);
|
entity.read(data, time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(debugNet){
|
|
||||||
clientDebug.setSyncDebug(players, enemies);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Net.handleClient(InvokePacket.class, packet -> {
|
Net.handleClient(InvokePacket.class, packet -> {
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public class Renderer extends RendererModule{
|
|||||||
public Renderer() {
|
public Renderer() {
|
||||||
Lines.setCircleVertices(14);
|
Lines.setCircleVertices(14);
|
||||||
|
|
||||||
|
Shaders.init();
|
||||||
|
|
||||||
Core.cameraScale = baseCameraScale;
|
Core.cameraScale = baseCameraScale;
|
||||||
Effects.setEffectProvider((effect, color, x, y, rotation, data) -> {
|
Effects.setEffectProvider((effect, color, x, y, rotation, data) -> {
|
||||||
if(effect == Fx.none) return;
|
if(effect == Fx.none) return;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class UI extends SceneModule{
|
|||||||
skin = new Skin(Gdx.files.internal("ui/uiskin.json"), Core.atlas);
|
skin = new Skin(Gdx.files.internal("ui/uiskin.json"), Core.atlas);
|
||||||
Mathf.each(font -> {
|
Mathf.each(font -> {
|
||||||
font.setUseIntegerPositions(false);
|
font.setUseIntegerPositions(false);
|
||||||
font.getData().setScale(Vars.fontscale);
|
font.getData().setScale(Vars.fontScale);
|
||||||
font.getData().down += Unit.dp.scl(4f);
|
font.getData().down += Unit.dp.scl(4f);
|
||||||
font.getData().lineHeight -= Unit.dp.scl(2f);
|
font.getData().lineHeight -= Unit.dp.scl(2f);
|
||||||
}, skin.font(), skin.getFont("default-font-chat"), skin.getFont("korean"));
|
}, skin.font(), skin.getFont("default-font-chat"), skin.getFont("korean"));
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public class Player extends Unit implements BlockBuilder {
|
|||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
Pools.free(layout);
|
Pools.free(layout);
|
||||||
Draw.tscl(fontscale);
|
Draw.tscl(fontScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawBuildRequests(){
|
public void drawBuildRequests(){
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class OverlayRenderer {
|
|||||||
Draw.color(0f, 0f, 0f, 0.5f);
|
Draw.color(0f, 0f, 0f, 0.5f);
|
||||||
Fill.rect(target.drawx(), target.drawy(), v.x, v.y);
|
Fill.rect(target.drawx(), target.drawy(), v.x, v.y);
|
||||||
Draw.textc(result.toString(), target.drawx(), target.drawy(), v);
|
Draw.textc(result.toString(), target.drawx(), target.drawy(), v);
|
||||||
Draw.tscl(fontscale);
|
Draw.tscl(fontScale);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.graphics;
|
|||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
|
||||||
import com.badlogic.gdx.utils.FloatArray;
|
import com.badlogic.gdx.utils.FloatArray;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
@@ -14,18 +13,29 @@ import static io.anuke.mindustry.Vars.tilesize;
|
|||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class Shaders{
|
public class Shaders{
|
||||||
public static final Outline outline = new Outline();
|
public static Outline outline;
|
||||||
public static final BlockBuild blockbuild = new BlockBuild();
|
public static BlockBuild blockbuild;
|
||||||
public static final BlockPreview blockpreview = new BlockPreview();
|
public static BlockPreview blockpreview;
|
||||||
public static final Shield shield = new Shield();
|
public static Shield shield;
|
||||||
public static final SurfaceShader water = new SurfaceShader("water");
|
public static SurfaceShader water;
|
||||||
public static final SurfaceShader lava = new SurfaceShader("lava");
|
public static SurfaceShader lava;
|
||||||
public static final SurfaceShader oil = new SurfaceShader("oil");
|
public static SurfaceShader oil;
|
||||||
public static final Space space = new Space();
|
public static Space space;
|
||||||
public static final UnitBuild build = new UnitBuild();
|
public static UnitBuild build;
|
||||||
public static final Shader hit = new Shader("hit", "default");
|
public static Shader hit;
|
||||||
|
|
||||||
private static final Vector2 vec = new Vector2();
|
public static void init(){
|
||||||
|
outline = new Outline();
|
||||||
|
blockbuild = new BlockBuild();
|
||||||
|
blockpreview = new BlockPreview();
|
||||||
|
shield = new Shield();
|
||||||
|
water = new SurfaceShader("water");
|
||||||
|
lava = new SurfaceShader("lava");
|
||||||
|
oil = new SurfaceShader("oil");
|
||||||
|
space = new Space();
|
||||||
|
build = new UnitBuild();
|
||||||
|
hit = new Shader("hit", "default");
|
||||||
|
}
|
||||||
|
|
||||||
public static class Space extends SurfaceShader{
|
public static class Space extends SurfaceShader{
|
||||||
|
|
||||||
@@ -70,7 +80,7 @@ public class Shaders{
|
|||||||
@Override
|
@Override
|
||||||
public void apply(){
|
public void apply(){
|
||||||
shader.setUniformf("u_color", color);
|
shader.setUniformf("u_color", color);
|
||||||
shader.setUniformf("u_texsize", vec.set(region.getTexture().getWidth(), region.getTexture().getHeight()));
|
shader.setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ package io.anuke.mindustry.input;
|
|||||||
|
|
||||||
import com.badlogic.gdx.input.GestureDetector;
|
import com.badlogic.gdx.input.GestureDetector;
|
||||||
import com.badlogic.gdx.input.GestureDetector.GestureListener;
|
import com.badlogic.gdx.input.GestureDetector.GestureListener;
|
||||||
|
import com.badlogic.gdx.math.Rectangle;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
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.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.type.Recipe;
|
import io.anuke.mindustry.type.Recipe;
|
||||||
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Core;
|
import io.anuke.ucore.core.Core;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
@@ -23,6 +25,8 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class AndroidInput extends InputHandler implements GestureListener{
|
public class AndroidInput extends InputHandler implements GestureListener{
|
||||||
|
private static Rectangle r1 = new Rectangle(), r2 = new Rectangle();
|
||||||
|
|
||||||
//gesture data
|
//gesture data
|
||||||
private Vector2 pinch1 = new Vector2(-1, -1), pinch2 = pinch1.cpy();
|
private Vector2 pinch1 = new Vector2(-1, -1), pinch2 = pinch1.cpy();
|
||||||
private Vector2 vector = new Vector2();
|
private Vector2 vector = new Vector2();
|
||||||
@@ -39,13 +43,51 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||||||
Inputs.addProcessor(new GestureDetector(20, 0.5f, 2, 0.15f, this));
|
Inputs.addProcessor(new GestureDetector(20, 0.5f, 2, 0.15f, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Returns whether this tile is in the list of requests, or at least colliding with one.*/
|
||||||
boolean hasRequest(Tile tile){
|
boolean hasRequest(Tile tile){
|
||||||
|
return getRequest(tile) != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**Returns whether this block overlaps any placement requests.*/
|
||||||
|
boolean checkOverlapPlacement(int x, int y, Block block){
|
||||||
|
r2.setSize(block.size * tilesize);
|
||||||
|
r2.setCenter(x * tilesize + block.offset(), y * tilesize + block.offset());
|
||||||
|
|
||||||
for(PlaceRequest req : placement){
|
for(PlaceRequest req : placement){
|
||||||
if(req.tile() == tile) return true;
|
Tile other = req.tile();
|
||||||
|
|
||||||
|
if(other == null) continue;
|
||||||
|
|
||||||
|
r1.setSize(req.recipe.result.size * tilesize);
|
||||||
|
r1.setCenter(other.worldx() + req.recipe.result.offset(), other.worldy() + req.recipe.result.offset());
|
||||||
|
|
||||||
|
if(r2.overlaps(r1)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**Returns the placement request that overlaps this tile, or null.*/
|
||||||
|
PlaceRequest getRequest(Tile tile){
|
||||||
|
r2.setSize(tilesize);
|
||||||
|
r2.setCenter(tile.worldx(), tile.worldy());
|
||||||
|
|
||||||
|
for(PlaceRequest req : placement){
|
||||||
|
Tile other = req.tile();
|
||||||
|
|
||||||
|
if(other == null) continue;
|
||||||
|
|
||||||
|
r1.setSize(req.recipe.result.size * tilesize);
|
||||||
|
r1.setCenter(other.worldx() + req.recipe.result.offset(), other.worldy() + req.recipe.result.offset());
|
||||||
|
|
||||||
|
if(r2.overlaps(r1)){
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildUI(Group group) {
|
public void buildUI(Group group) {
|
||||||
|
|
||||||
@@ -122,6 +164,24 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean longPress(float x, float y) {
|
||||||
|
if(state.is(State.menu)) return false;
|
||||||
|
|
||||||
|
//get tile on cursor
|
||||||
|
Tile cursor = world.tile(Mathf.scl2(Graphics.mouseWorld().x, tilesize), Mathf.scl2(Graphics.mouseWorld().y, tilesize));
|
||||||
|
|
||||||
|
//ignore off-screen taps
|
||||||
|
if(cursor == null || ui.hasMouse(x, y)) return false;
|
||||||
|
|
||||||
|
//remove request if it's there
|
||||||
|
if(hasRequest(cursor)){
|
||||||
|
placement.removeValue(getRequest(cursor), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean tap(float x, float y, int count, int button) {
|
public boolean tap(float x, float y, int count, int button) {
|
||||||
if(state.is(State.menu)) return false;
|
if(state.is(State.menu)) return false;
|
||||||
@@ -133,7 +193,7 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||||||
if(cursor == null || ui.hasMouse(x, y)) return false;
|
if(cursor == null || ui.hasMouse(x, y)) return false;
|
||||||
|
|
||||||
//add to placement queue if it's a valid place position
|
//add to placement queue if it's a valid place position
|
||||||
if(isPlacing() && validPlace(cursor.x, cursor.y, recipe.result)){
|
if(isPlacing() && validPlace(cursor.x, cursor.y, recipe.result) && !checkOverlapPlacement(cursor.x, cursor.y, recipe.result)){
|
||||||
placement.add(new PlaceRequest(cursor.worldx(), cursor.worldy(), recipe, rotation));
|
placement.add(new PlaceRequest(cursor.worldx(), cursor.worldy(), recipe, rotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +275,6 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public boolean touchDown(float x, float y, int pointer, int button) { return false; }
|
@Override public boolean touchDown(float x, float y, int pointer, int button) { return false; }
|
||||||
@Override public boolean longPress(float x, float y) { return false; }
|
|
||||||
@Override public boolean fling(float velocityX, float velocityY, int button) { return false; }
|
@Override public boolean fling(float velocityX, float velocityY, int button) { return false; }
|
||||||
|
|
||||||
class PlaceRequest{
|
class PlaceRequest{
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import io.anuke.ucore.util.Translator;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public abstract class InputHandler extends InputAdapter{
|
public abstract class InputHandler extends InputAdapter{
|
||||||
public final static float playerSelectRange = Unit.dp.scl(60f);
|
float playerSelectRange = Unit.dp.scl(60f);
|
||||||
private final static Translator stackTrns = new Translator();
|
Translator stackTrns = new Translator();
|
||||||
|
|
||||||
private float mx, my;
|
private float mx, my;
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import io.anuke.ucore.util.Strings;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class Version {
|
public class Version {
|
||||||
public static final String name;
|
public static String name;
|
||||||
public static final String type;
|
public static String type;
|
||||||
public static final String code;
|
public static String code;
|
||||||
public static final int build;
|
public static int build;
|
||||||
public static final String buildName;
|
public static String buildName;
|
||||||
|
|
||||||
static{
|
public static void init(){
|
||||||
try {
|
try {
|
||||||
FileHandle file = Gdx.files.internal("version.properties");
|
FileHandle file = Gdx.files.internal("version.properties");
|
||||||
|
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
package io.anuke.mindustry.net;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
|
||||||
import com.badlogic.gdx.utils.TimeUtils;
|
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
|
||||||
|
|
||||||
public class ClientDebug {
|
|
||||||
private OrderedMap<Class<?>, Long> last = new OrderedMap<>();
|
|
||||||
private int syncPlayers = 0;
|
|
||||||
private int syncEnemies = 0;
|
|
||||||
|
|
||||||
public void handle(Object packet){
|
|
||||||
last.put(packet.getClass(), TimeUtils.millis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSyncDebug(int players, int enemies){
|
|
||||||
this.syncEnemies = enemies;
|
|
||||||
this.syncPlayers = players;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOut(){
|
|
||||||
StringBuilder build = new StringBuilder();
|
|
||||||
for(Class<?> type : last.orderedKeys()){
|
|
||||||
build.append(elapsed(type));
|
|
||||||
build.append("\n");
|
|
||||||
}
|
|
||||||
build.append("sync.players: ");
|
|
||||||
build.append(syncPlayers);
|
|
||||||
build.append("\n");
|
|
||||||
build.append("sync.enemies: ");
|
|
||||||
build.append(syncEnemies);
|
|
||||||
build.append("\n");
|
|
||||||
return build.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String elapsed(Class<?> type){
|
|
||||||
long t = last.get(type, -1L);
|
|
||||||
if(t == -1){
|
|
||||||
return ClassReflection.getSimpleName(type) + ": <never>";
|
|
||||||
}else{
|
|
||||||
float el = TimeUtils.timeSinceMillis(t) / 1000f;
|
|
||||||
String tu;
|
|
||||||
if(el > 1f){
|
|
||||||
tu = (int)el + "s";
|
|
||||||
}else{
|
|
||||||
tu = (int)(el * 60) + "f";
|
|
||||||
}
|
|
||||||
return ClassReflection.getSimpleName(type) + ": " + tu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -163,7 +163,6 @@ public class Net{
|
|||||||
|
|
||||||
/**Call to handle a packet being recieved for the client.*/
|
/**Call to handle a packet being recieved for the client.*/
|
||||||
public static void handleClientReceived(Object object){
|
public static void handleClientReceived(Object object){
|
||||||
if(debugNet) clientDebug.handle(object);
|
|
||||||
|
|
||||||
if(object instanceof StreamBegin) {
|
if(object instanceof StreamBegin) {
|
||||||
StreamBegin b = (StreamBegin) object;
|
StreamBegin b = (StreamBegin) object;
|
||||||
@@ -198,7 +197,6 @@ public class Net{
|
|||||||
|
|
||||||
/**Call to handle a packet being recieved for the server.*/
|
/**Call to handle a packet being recieved for the server.*/
|
||||||
public static void handleServerReceived(int connection, Object object){
|
public static void handleServerReceived(int connection, Object object){
|
||||||
if(debugNet) serverDebug.handle(connection, object);
|
|
||||||
|
|
||||||
if(serverListeners.get(object.getClass()) != null || listeners.get(object.getClass()) != null){
|
if(serverListeners.get(object.getClass()) != null || listeners.get(object.getClass()) != null){
|
||||||
if(serverListeners.get(object.getClass()) != null) serverListeners.get(object.getClass()).accept(connection, object);
|
if(serverListeners.get(object.getClass()) != null) serverListeners.get(object.getClass()).accept(connection, object);
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
package io.anuke.mindustry.net;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.IntMap;
|
|
||||||
import com.badlogic.gdx.utils.OrderedMap;
|
|
||||||
import com.badlogic.gdx.utils.TimeUtils;
|
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
|
||||||
import io.anuke.mindustry.entities.Player;
|
|
||||||
import io.anuke.mindustry.net.Packets.Disconnect;
|
|
||||||
import io.anuke.ucore.util.Log;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.playerGroup;
|
|
||||||
|
|
||||||
public class ServerDebug {
|
|
||||||
private IntMap<OrderedMap<Class<?>, Long>> last = new IntMap<>();
|
|
||||||
|
|
||||||
public void handle(int connection, Object packet){
|
|
||||||
try {
|
|
||||||
if (!last.containsKey(connection))
|
|
||||||
last.put(connection, new OrderedMap<>());
|
|
||||||
if (packet instanceof Disconnect)
|
|
||||||
last.remove(connection);
|
|
||||||
else
|
|
||||||
last.get(connection).put(packet.getClass(), TimeUtils.millis());
|
|
||||||
}catch (Exception e){
|
|
||||||
Log.err("<An internal debug error has occurred.>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOut(){
|
|
||||||
StringBuilder build = new StringBuilder();
|
|
||||||
for(Player player : playerGroup.all()){
|
|
||||||
OrderedMap<Class<?>, Long> map = last.get(player.clientid, new OrderedMap<>());
|
|
||||||
build.append("connection ");
|
|
||||||
build.append(player.clientid);
|
|
||||||
build.append(" / player '");
|
|
||||||
build.append(player.name);
|
|
||||||
build.append(" mech: ");
|
|
||||||
build.append(player.mech);
|
|
||||||
build.append("'\n");
|
|
||||||
|
|
||||||
for(Class<?> type : map.orderedKeys()){
|
|
||||||
build.append(" ");
|
|
||||||
build.append(elapsed(type, map));
|
|
||||||
build.append("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return build.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String elapsed(Class<?> type, OrderedMap<Class<?>, Long> last) {
|
|
||||||
long t = last.get(type, -1L);
|
|
||||||
if (t == -1) {
|
|
||||||
return ClassReflection.getSimpleName(type) + ": <never>";
|
|
||||||
} else {
|
|
||||||
float el = TimeUtils.timeSinceMillis(t) / 1000f;
|
|
||||||
String tu;
|
|
||||||
if (el > 1f) {
|
|
||||||
tu = (int) el + "s";
|
|
||||||
} else {
|
|
||||||
tu = (int) (el * 60) + "f";
|
|
||||||
}
|
|
||||||
return ClassReflection.getSimpleName(type) + ": " + tu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
5
core/src/io/anuke/mindustry/type/ContentList.java
Normal file
5
core/src/io/anuke/mindustry/type/ContentList.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package io.anuke.mindustry.type;
|
||||||
|
|
||||||
|
public interface ContentList {
|
||||||
|
void load();
|
||||||
|
}
|
||||||
@@ -4,17 +4,25 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
import io.anuke.ucore.util.Bundles;
|
import io.anuke.ucore.util.Bundles;
|
||||||
|
|
||||||
public class Links {
|
public class Links {
|
||||||
private static final LinkEntry[] links = {
|
private static LinkEntry[] links;
|
||||||
new LinkEntry("discord", "https://discord.gg/BKADYds", Color.valueOf("7289da")),
|
|
||||||
new LinkEntry("trello", "https://trello.com/b/aE2tcUwF", Color.valueOf("026aa7")),
|
private static void createLinks(){
|
||||||
new LinkEntry("wiki", "http://mindustry.wikia.com/wiki/Mindustry_Wiki", Color.valueOf("0f142f")),
|
links = new LinkEntry[]{
|
||||||
new LinkEntry("itch.io", "https://anuke.itch.io/mindustry", Color.valueOf("fa5c5c")),
|
new LinkEntry("discord", "https://discord.gg/BKADYds", Color.valueOf("7289da")),
|
||||||
new LinkEntry("google-play", "https://play.google.com/store/apps/details?id=io.anuke.mindustry", Color.valueOf("689f38")),
|
new LinkEntry("trello", "https://trello.com/b/aE2tcUwF", Color.valueOf("026aa7")),
|
||||||
new LinkEntry("github", "https://github.com/Anuken/Mindustry/", Color.valueOf("24292e")),
|
new LinkEntry("wiki", "http://mindustry.wikia.com/wiki/Mindustry_Wiki", Color.valueOf("0f142f")),
|
||||||
new LinkEntry("dev-builds", "https://github.com/Anuken/Mindustry/wiki", Color.valueOf("fafbfc")),
|
new LinkEntry("itch.io", "https://anuke.itch.io/mindustry", Color.valueOf("fa5c5c")),
|
||||||
};
|
new LinkEntry("google-play", "https://play.google.com/store/apps/details?id=io.anuke.mindustry", Color.valueOf("689f38")),
|
||||||
|
new LinkEntry("github", "https://github.com/Anuken/Mindustry/", Color.valueOf("24292e")),
|
||||||
|
new LinkEntry("dev-builds", "https://github.com/Anuken/Mindustry/wiki", Color.valueOf("fafbfc"))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public static LinkEntry[] getLinks(){
|
public static LinkEntry[] getLinks(){
|
||||||
|
if(links == null){
|
||||||
|
createLinks();
|
||||||
|
}
|
||||||
|
|
||||||
return links;
|
return links;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,8 +141,7 @@ public class DebugFragment implements Fragment {
|
|||||||
"tiles.sleeping: " + TileEntity.sleepingEntities,
|
"tiles.sleeping: " + TileEntity.sleepingEntities,
|
||||||
"time: " + Timers.time(),
|
"time: " + Timers.time(),
|
||||||
"state.gameover: " + state.gameOver,
|
"state.gameover: " + state.gameOver,
|
||||||
"state: " + state.getState(),
|
"state: " + state.getState()
|
||||||
!Net.server() ? clientDebug.getOut() : serverDebug.getOut()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
result.append("players: ");
|
result.append("players: ");
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class HudFragment implements Fragment{
|
|||||||
new table(){{
|
new table(){{
|
||||||
aleft();
|
aleft();
|
||||||
|
|
||||||
new label(() -> Bundles.format("text.wave", state.wave)).scale(fontscale*1.5f).left().padLeft(-6);
|
new label(() -> Bundles.format("text.wave", state.wave)).scale(fontScale *1.5f).left().padLeft(-6);
|
||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class MenuFragment implements Fragment{
|
|||||||
|
|
||||||
new imagebutton("icon-play-2", isize, ui.levels::show).text("$text.play").padTop(4f);
|
new imagebutton("icon-play-2", isize, ui.levels::show).text("$text.play").padTop(4f);
|
||||||
|
|
||||||
new imagebutton("icon-tutorial", isize, () -> control.playMap(world.maps().getByName("tutorial"))).text("$text.tutorial").padTop(4f);
|
new imagebutton("icon-tutorial", isize, () -> {}).text("$text.tutorial").padTop(4f);
|
||||||
|
|
||||||
new imagebutton("icon-load", isize, ui.load::show).text("$text.load").padTop(4f);
|
new imagebutton("icon-load", isize, ui.load::show).text("$text.load").padTop(4f);
|
||||||
|
|
||||||
@@ -123,10 +123,7 @@ public class MenuFragment implements Fragment{
|
|||||||
ui.showInfo("$text.multiplayer.web");
|
ui.showInfo("$text.multiplayer.web");
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> {
|
dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> {}));
|
||||||
control.playMap(world.maps().getByName("tutorial"));
|
|
||||||
dialog.hide();
|
|
||||||
}));
|
|
||||||
|
|
||||||
dialog.content().row();
|
dialog.content().row();
|
||||||
|
|
||||||
|
|||||||
@@ -16,51 +16,48 @@ public class ColorMapper{
|
|||||||
|
|
||||||
private static ObjectIntMap<Block> reverseColors = new ObjectIntMap<>();
|
private static ObjectIntMap<Block> reverseColors = new ObjectIntMap<>();
|
||||||
private static Array<BlockPair> pairs = new Array<>();
|
private static Array<BlockPair> pairs = new Array<>();
|
||||||
private static IntMap<BlockPair> colors = map(
|
private static IntMap<BlockPair> colors;
|
||||||
"323232", pair(Blocks.stone),
|
|
||||||
"646464", pair(Blocks.stone, Blocks.stoneblock),
|
private static void init(){
|
||||||
"50965a", pair(Blocks.grass),
|
if(colors != null) return;
|
||||||
"5ab464", pair(Blocks.grass, Blocks.grassblock),
|
|
||||||
"506eb4", pair(Blocks.water),
|
colors = map(
|
||||||
"465a96", pair(Blocks.deepwater),
|
"323232", pair(Blocks.stone),
|
||||||
"252525", pair(Blocks.blackstone),
|
"646464", pair(Blocks.stone, Blocks.stoneblock),
|
||||||
"575757", pair(Blocks.blackstone, Blocks.blackstoneblock),
|
"50965a", pair(Blocks.grass),
|
||||||
"988a67", pair(Blocks.sand),
|
"5ab464", pair(Blocks.grass, Blocks.grassblock),
|
||||||
"e5d8bb", pair(Blocks.sand, Blocks.sandblock),
|
"506eb4", pair(Blocks.water),
|
||||||
"c2d1d2", pair(Blocks.snow),
|
"465a96", pair(Blocks.deepwater),
|
||||||
"c4e3e7", pair(Blocks.ice),
|
"252525", pair(Blocks.blackstone),
|
||||||
"f7feff", pair(Blocks.snow, Blocks.snowblock),
|
"575757", pair(Blocks.blackstone, Blocks.blackstoneblock),
|
||||||
"6e501e", pair(Blocks.dirt),
|
"988a67", pair(Blocks.sand),
|
||||||
"ed5334", pair(Blocks.lava),
|
"e5d8bb", pair(Blocks.sand, Blocks.sandblock),
|
||||||
"292929", pair(Blocks.oil),
|
"c2d1d2", pair(Blocks.snow),
|
||||||
"c3a490", pair(Blocks.iron),
|
"c4e3e7", pair(Blocks.ice),
|
||||||
"161616", pair(Blocks.coal),
|
"f7feff", pair(Blocks.snow, Blocks.snowblock),
|
||||||
"6277bc", pair(Blocks.titanium),
|
"6e501e", pair(Blocks.dirt),
|
||||||
"83bc58", pair(Blocks.thorium),
|
"ed5334", pair(Blocks.lava),
|
||||||
"000000", pair(Blocks.space)
|
"292929", pair(Blocks.oil),
|
||||||
);
|
"c3a490", pair(Blocks.iron),
|
||||||
|
"161616", pair(Blocks.coal),
|
||||||
|
"6277bc", pair(Blocks.titanium),
|
||||||
|
"83bc58", pair(Blocks.thorium),
|
||||||
|
"000000", pair(Blocks.space)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static BlockPair get(int color){
|
public static BlockPair get(int color){
|
||||||
|
init();
|
||||||
return colors.get(color);
|
return colors.get(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getColorByID(byte id){
|
|
||||||
return colorIDS[id];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte getColorID(int color){
|
|
||||||
return (byte)reverseIDs.get(color, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IntMap<BlockPair> getColors(){
|
|
||||||
return colors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Array<BlockPair> getPairs(){
|
public static Array<BlockPair> getPairs(){
|
||||||
|
init();
|
||||||
return pairs;
|
return pairs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getColor(Block block){
|
public static int getColor(Block block){
|
||||||
|
init();
|
||||||
return reverseColors.get(block, 0);
|
return reverseColors.get(block, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.anuke.mindustry.world;
|
package io.anuke.mindustry.world;
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.IntArray;
|
import com.badlogic.gdx.utils.IntArray;
|
||||||
import com.badlogic.gdx.utils.ObjectMap;
|
|
||||||
import io.anuke.mindustry.content.blocks.Blocks;
|
import io.anuke.mindustry.content.blocks.Blocks;
|
||||||
import io.anuke.mindustry.content.blocks.StorageBlocks;
|
import io.anuke.mindustry.content.blocks.StorageBlocks;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
@@ -14,12 +13,6 @@ import static io.anuke.mindustry.Vars.world;
|
|||||||
|
|
||||||
|
|
||||||
public class WorldGenerator {
|
public class WorldGenerator {
|
||||||
public static final ObjectMap<Block, Block> rocks = new ObjectMap<Block, Block>(){{
|
|
||||||
put(Blocks.stone, Blocks.rock);
|
|
||||||
put(Blocks.snow, Blocks.icerock);
|
|
||||||
put(Blocks.grass, Blocks.shrub);
|
|
||||||
put(Blocks.blackstone, Blocks.blackrock);
|
|
||||||
}};
|
|
||||||
|
|
||||||
/**Should fill spawns with the correct spawnpoints.*/
|
/**Should fill spawns with the correct spawnpoints.*/
|
||||||
public static void generate(Tile[][] tiles, MapTileData data){
|
public static void generate(Tile[][] tiles, MapTileData data){
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package io.anuke.mindustry.desktop;
|
|||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -42,9 +40,9 @@ public class CrashHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
JOptionPane.showMessageDialog(null, "An error has occured: \n" + result + "\n\n" +
|
//JOptionPane.showMessageDialog(null, "An error has occured: \n" + result + "\n\n" +
|
||||||
(!failed ? "A crash report has been written to " + new File(filename).getAbsolutePath() + ".\nPlease send this file to the developer!"
|
// (!failed ? "A crash report has been written to " + new File(filename).getAbsolutePath() + ".\nPlease send this file to the developer!"
|
||||||
: "Failed to generate crash report.\nPlease send an image of this crash log to the developer!"));
|
// : "Failed to generate crash report.\nPlease send an image of this crash log to the developer!"));
|
||||||
}catch (Throwable i){
|
}catch (Throwable i){
|
||||||
i.printStackTrace();
|
i.printStackTrace();
|
||||||
//what now?
|
//what now?
|
||||||
|
|||||||
@@ -6,14 +6,12 @@ import club.minnced.discord.rpc.DiscordRichPresence;
|
|||||||
import com.badlogic.gdx.utils.Base64Coder;
|
import com.badlogic.gdx.utils.Base64Coder;
|
||||||
import io.anuke.kryonet.DefaultThreadImpl;
|
import io.anuke.kryonet.DefaultThreadImpl;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.core.ThreadHandler.ThreadProvider;
|
|
||||||
import io.anuke.mindustry.core.Platform;
|
import io.anuke.mindustry.core.Platform;
|
||||||
|
import io.anuke.mindustry.core.ThreadHandler.ThreadProvider;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.util.OS;
|
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.net.NetworkInterface;
|
import java.net.NetworkInterface;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
@@ -26,7 +24,7 @@ import java.util.Random;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class DesktopPlatform extends Platform {
|
public class DesktopPlatform extends Platform {
|
||||||
final static boolean useDiscord = OS.getPropertyNotNull("sun.arch.data.model").equals("64");
|
final static boolean useDiscord = false;//OS.getPropertyNotNull("sun.arch.data.model").equals("64");
|
||||||
final static String applicationId = "398246104468291591";
|
final static String applicationId = "398246104468291591";
|
||||||
final static DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
final static DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
||||||
String[] args;
|
String[] args;
|
||||||
@@ -52,7 +50,7 @@ public class DesktopPlatform extends Platform {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showError(String text){
|
public void showError(String text){
|
||||||
JOptionPane.showMessageDialog(null, text);
|
//JOptionPane.showMessageDialog(null, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ public class KryoServer implements ServerProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
UCore.setPrivate(server, "shutdown", true);
|
|
||||||
connections.clear();
|
connections.clear();
|
||||||
lastconnection = 0;
|
lastconnection = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package io.anuke.mindustry.server;
|
package io.anuke.mindustry.server;
|
||||||
|
|
||||||
import io.anuke.mindustry.core.Logic;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.NetCommon;
|
import io.anuke.mindustry.core.*;
|
||||||
import io.anuke.mindustry.core.NetServer;
|
|
||||||
import io.anuke.mindustry.core.World;
|
|
||||||
import io.anuke.mindustry.core.ContentLoader;
|
|
||||||
import io.anuke.mindustry.io.BundleLoader;
|
import io.anuke.mindustry.io.BundleLoader;
|
||||||
import io.anuke.ucore.modules.ModuleCore;
|
import io.anuke.ucore.modules.ModuleCore;
|
||||||
|
|
||||||
@@ -19,6 +16,8 @@ public class MindustryServer extends ModuleCore {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
|
Vars.init();
|
||||||
|
|
||||||
headless = true;
|
headless = true;
|
||||||
|
|
||||||
BundleLoader.load();
|
BundleLoader.load();
|
||||||
|
|||||||
Reference in New Issue
Block a user