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-controllers-lwjgl3:$gdxVersion"
|
||||
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;
|
||||
|
||||
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.ContentLoader;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
import io.anuke.ucore.modules.ModuleCore;
|
||||
import io.anuke.ucore.util.Log;
|
||||
@@ -17,6 +11,8 @@ public class Mindustry extends ModuleCore {
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
Vars.init();
|
||||
|
||||
debug = Platform.instance.isDebug();
|
||||
|
||||
Log.setUseColors(false);
|
||||
|
||||
@@ -5,17 +5,15 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
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.Puddle;
|
||||
import io.anuke.mindustry.entities.effect.Shield;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.net.ClientDebug;
|
||||
import io.anuke.mindustry.net.ServerDebug;
|
||||
import io.anuke.mindustry.io.Version;
|
||||
import io.anuke.ucore.entities.EffectEntity;
|
||||
import io.anuke.ucore.entities.Entities;
|
||||
import io.anuke.ucore.entities.Entity;
|
||||
@@ -29,52 +27,43 @@ public class Vars{
|
||||
|
||||
public static final boolean testMobile = true;
|
||||
//shorthand for whether or not this is running on android or ios
|
||||
public static final boolean mobile = (Gdx.app.getType() == ApplicationType.Android) ||
|
||||
Gdx.app.getType() == ApplicationType.iOS || testMobile;
|
||||
public static final boolean ios = Gdx.app.getType() == ApplicationType.iOS;
|
||||
public static final boolean android = Gdx.app.getType() == ApplicationType.Android;
|
||||
public static boolean mobile;
|
||||
public static boolean ios;
|
||||
public static boolean android;
|
||||
//shorthand for whether or not this is running on GWT
|
||||
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
|
||||
//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;
|
||||
public static boolean gwt;
|
||||
|
||||
//respawn time in frames
|
||||
public static final float respawnduration = 60*4;
|
||||
//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
|
||||
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;
|
||||
//discord group URL
|
||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||
|
||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||
|
||||
//directory for user-created map data
|
||||
public static final FileHandle customMapDirectory = OS.getAppDataDirectory("Mindustry").child("maps/");
|
||||
public static FileHandle customMapDirectory;
|
||||
//save file directory
|
||||
public static final FileHandle saveDirectory = OS.getAppDataDirectory("Mindustry").child("saves/");
|
||||
public static final String mapExtension = "mmap";
|
||||
public static final String saveExtension = "msav";
|
||||
public static FileHandle saveDirectory;
|
||||
public static String mapExtension = "mmap";
|
||||
public static String saveExtension = "msav";
|
||||
//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
|
||||
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?)
|
||||
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
|
||||
public static boolean debug = false;
|
||||
public static boolean debugNet = true;
|
||||
public static boolean console = false;
|
||||
//whether the player can clip through walls
|
||||
public static boolean noclip = false;
|
||||
//whether to draw chunk borders
|
||||
public static boolean debugChunks = false;
|
||||
//whether turrets have infinite ammo (only with debug)
|
||||
public static boolean infiniteAmmo = true;
|
||||
//whether to show paths of enemies
|
||||
@@ -130,10 +119,7 @@ public class Vars{
|
||||
public static final int webPort = 6568;
|
||||
|
||||
public static GameState state;
|
||||
public static final ThreadHandler threads = new ThreadHandler(Platform.instance.getThreadProvider());
|
||||
|
||||
public static final ServerDebug serverDebug = new ServerDebug();
|
||||
public static final ClientDebug clientDebug = new ClientDebug();
|
||||
public static ThreadHandler threads;
|
||||
|
||||
public static Control control;
|
||||
public static Logic logic;
|
||||
@@ -146,19 +132,46 @@ public class Vars{
|
||||
|
||||
public static Player[] players = {};
|
||||
|
||||
public static final EntityGroup<Player> playerGroup = Entities.addGroup(Player.class).enableMapping();
|
||||
public static final EntityGroup<TileEntity> tileGroup = Entities.addGroup(TileEntity.class, false);
|
||||
public static final EntityGroup<Bullet> bulletGroup = Entities.addGroup(Bullet.class);
|
||||
public static final EntityGroup<Shield> shieldGroup = Entities.addGroup(Shield.class, false);
|
||||
public static final EntityGroup<EffectEntity> effectGroup = Entities.addGroup(EffectEntity.class, false);
|
||||
public static final EntityGroup<Entity> groundEffectGroup = Entities.addGroup(Entity.class, false);
|
||||
public static final EntityGroup<Puddle> puddleGroup = Entities.addGroup(Puddle.class, false);
|
||||
public static final EntityGroup<Fire> airItemGroup = Entities.addGroup(Fire.class, false);
|
||||
public static final EntityGroup<BaseUnit>[] unitGroups = new EntityGroup[Team.values().length];
|
||||
public static EntityGroup<Player> playerGroup;
|
||||
public static EntityGroup<TileEntity> tileGroup;
|
||||
public static EntityGroup<Bullet> bulletGroup;
|
||||
public static EntityGroup<Shield> shieldGroup;
|
||||
public static EntityGroup<EffectEntity> effectGroup;
|
||||
public static EntityGroup<Entity> groundEffectGroup;
|
||||
public static EntityGroup<Puddle> puddleGroup;
|
||||
public static EntityGroup<Fire> airItemGroup;
|
||||
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()){
|
||||
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.fx.ShootFx;
|
||||
import io.anuke.mindustry.type.AmmoType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class AmmoTypes {
|
||||
//TODO add definitions for all ammo types
|
||||
public static final AmmoType
|
||||
public class AmmoTypes implements ContentList {
|
||||
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;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
//bullets
|
||||
|
||||
bulletIron = new AmmoType(Items.iron, StandardBullets.iron, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
bulletSteel = new AmmoType(Items.steel, StandardBullets.steel, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
bulletThermite = new AmmoType(Items.thermite, StandardBullets.tracer, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
//flak
|
||||
|
||||
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
flakPlastic = new AmmoType(Items.plastic, FlakBullets.plastic, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5) {{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}},
|
||||
}};
|
||||
|
||||
//shells
|
||||
|
||||
shellLead = new AmmoType(Items.lead, ShellBullets.lead, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
shellExplosive = new AmmoType(Items.blastCompound, ShellBullets.explosive, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
shellPlastic = new AmmoType(Items.plastic, ShellBullets.plastic, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
shellThorium = new AmmoType(Items.thorium, ShellBullets.thorium, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
//missiles
|
||||
|
||||
missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
missileIncindiary = new AmmoType(Items.thermite, MissileBullets.incindiary, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
//artillery
|
||||
|
||||
artilleryLead = new AmmoType(Items.lead, ArtilleryBullets.lead, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
artilleryThorium = new AmmoType(Items.thorium, ArtilleryBullets.thorium, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
artilleryPlastic = new AmmoType(Items.plastic, ArtilleryBullets.plastic, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
artilleryIncindiary = new AmmoType(Items.thermite, ArtilleryBullets.incindiary, 1) {{
|
||||
shootEffect = ShootFx.shootBig2;
|
||||
smokeEffect = ShootFx.shootBigSmoke2;
|
||||
}},
|
||||
}};
|
||||
|
||||
//flame
|
||||
|
||||
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f) {{
|
||||
shootEffect = ShootFx.shootSmallFlame;
|
||||
}},
|
||||
}};
|
||||
|
||||
//power
|
||||
|
||||
lancerLaser = new AmmoType(TurretBullets.lancerLaser),
|
||||
lancerLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||
|
||||
lightning = new AmmoType(TurretBullets.lightning),
|
||||
lightning = new AmmoType(TurretBullets.lightning);
|
||||
|
||||
spectreLaser = new AmmoType(TurretBullets.lancerLaser),
|
||||
spectreLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||
|
||||
meltdownLaser = new AmmoType(TurretBullets.lancerLaser),
|
||||
meltdownLaser = new AmmoType(TurretBullets.lancerLaser);
|
||||
|
||||
fuseShotgun = new AmmoType(Items.iron, TurretBullets.fuseShot, 0.1f),
|
||||
fuseShotgun = new AmmoType(Items.iron, TurretBullets.fuseShot, 0.1f);
|
||||
|
||||
//liquid
|
||||
|
||||
oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f),
|
||||
oil = new AmmoType(Liquids.oil, TurretBullets.oilShot, 0.3f);
|
||||
|
||||
water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f),
|
||||
water = new AmmoType(Liquids.water, TurretBullets.waterShot, 0.3f);
|
||||
|
||||
lava = new AmmoType(Liquids.lava, TurretBullets.lavaShot, 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;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemType;
|
||||
|
||||
public class Items {
|
||||
public static final Item
|
||||
public class Items implements ContentList{
|
||||
public static Item stone, iron, lead, coal, steel, titanium, thorium, silicon, plastic, surgealloy, biomatter, sand, blastCompound, thermite;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
stone = new Item("stone", Color.valueOf("777777")) {{
|
||||
hardness = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
iron = new Item("iron", Color.valueOf("bc8271")) {{
|
||||
type = ItemType.material;
|
||||
hardness = 1;
|
||||
}},
|
||||
}};
|
||||
|
||||
lead = new Item("lead", Color.valueOf("8e85a2")) {{
|
||||
type = ItemType.material;
|
||||
hardness = 1;
|
||||
}},
|
||||
}};
|
||||
|
||||
coal = new Item("coal", Color.valueOf("272727")) {{
|
||||
explosiveness = 0.2f;
|
||||
flammability = 0.5f;
|
||||
fluxiness = 0.3f;
|
||||
hardness = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
steel = new Item("steel", Color.valueOf("e2e2e2")) {{
|
||||
type = ItemType.material;
|
||||
}},
|
||||
}};
|
||||
|
||||
titanium = new Item("titanium", Color.valueOf("8da1e3")) {{
|
||||
type = ItemType.material;
|
||||
hardness = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
thorium = new Item("thorium", Color.valueOf("f9a3c7")) {{
|
||||
type = ItemType.material;
|
||||
explosiveness = 0.1f;
|
||||
hardness = 4;
|
||||
}},
|
||||
}};
|
||||
|
||||
silicon = new Item("silicon", Color.valueOf("53565c")) {{
|
||||
type = ItemType.material;
|
||||
}},
|
||||
}};
|
||||
|
||||
plastic = new Item("plastic", Color.valueOf("e9ead3")) {{
|
||||
type = ItemType.material;
|
||||
flammability = 0.2f;
|
||||
explosiveness = 0.1f;
|
||||
}},
|
||||
}};
|
||||
|
||||
surgealloy = new Item("surge-alloy", Color.valueOf("b4d5c7")) {{
|
||||
type = ItemType.material;
|
||||
}},
|
||||
}};
|
||||
|
||||
biomatter = new Item("biomatter", Color.valueOf("648b55")) {{
|
||||
flammability = 0.4f;
|
||||
fluxiness = 0.2f;
|
||||
}},
|
||||
}};
|
||||
|
||||
sand = new Item("sand", Color.valueOf("e3d39e")) {{
|
||||
fluxiness = 0.5f;
|
||||
}},
|
||||
}};
|
||||
|
||||
blastCompound = new Item("blast-compound", Color.valueOf("ff795e")) {{
|
||||
flammability = 0.2f;
|
||||
explosiveness = 0.6f;
|
||||
}},
|
||||
}};
|
||||
|
||||
thermite = new Item("thermite", Color.valueOf("ff795e")) {{
|
||||
flammability = 0.7f;
|
||||
explosiveness = 0.2f;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
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")) {
|
||||
{
|
||||
heatCapacity = 0.4f;
|
||||
effect = StatusEffects.wet;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
lava = new Liquid("lava", Color.valueOf("e37341")) {
|
||||
{
|
||||
temperature = 0.8f;
|
||||
viscosity = 0.8f;
|
||||
effect = StatusEffects.melting;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
oil = new Liquid("oil", Color.valueOf("313131")) {
|
||||
{
|
||||
viscosity = 0.7f;
|
||||
@@ -28,7 +34,8 @@ public class Liquids {
|
||||
explosiveness = 0.6f;
|
||||
effect = StatusEffects.oiled;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
cryofluid = new Liquid("cryofluid", Color.SKY) {
|
||||
{
|
||||
heatCapacity = 0.75f;
|
||||
@@ -36,4 +43,6 @@ public class Liquids {
|
||||
effect = StatusEffects.freezing;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Mech;
|
||||
|
||||
public class Mechs {
|
||||
public static final Mech
|
||||
public class Mechs implements ContentList {
|
||||
public static Mech standard, standardShip;
|
||||
|
||||
standard = new Mech("standard-mech", false),
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
standard = new Mech("standard-mech", false);
|
||||
standardShip = new Mech("standard-ship", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.mindustry.content.blocks.*;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import static io.anuke.mindustry.type.Section.*;
|
||||
|
||||
public class Recipes {
|
||||
static {
|
||||
public class Recipes implements ContentList{
|
||||
|
||||
@Override
|
||||
public void load (){
|
||||
new Recipe(defense, DefenseBlocks.ironwall, new ItemStack(Items.iron, 12));
|
||||
new Recipe(defense, DefenseBlocks.steelwall, new ItemStack(Items.steel, 12));
|
||||
new Recipe(defense, DefenseBlocks.titaniumwall, new ItemStack(Items.titanium, 12));
|
||||
|
||||
@@ -4,14 +4,18 @@ import io.anuke.mindustry.content.fx.EnvironmentFx;
|
||||
import io.anuke.mindustry.entities.StatusController.TransitionResult;
|
||||
import io.anuke.mindustry.entities.StatusEffect;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class StatusEffects {
|
||||
public static final StatusEffect
|
||||
public class StatusEffects implements ContentList {
|
||||
public static StatusEffect none, burning, freezing, wet, melting, oiled;
|
||||
|
||||
none = new StatusEffect(0),
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
none = new StatusEffect(0);
|
||||
|
||||
burning = new StatusEffect(4 * 60f) {
|
||||
{
|
||||
@@ -38,7 +42,7 @@ public class StatusEffects {
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
freezing = new StatusEffect(5 * 60f) {
|
||||
{
|
||||
@@ -53,7 +57,7 @@ public class StatusEffects {
|
||||
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
wet = new StatusEffect(3 * 60f) {
|
||||
{
|
||||
@@ -68,7 +72,7 @@ public class StatusEffects {
|
||||
|
||||
unit.velocity.scl(0.999f);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
melting = new StatusEffect(5 * 60f) {
|
||||
{
|
||||
@@ -93,7 +97,7 @@ public class StatusEffects {
|
||||
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
oiled = new StatusEffect(4 * 60f) {
|
||||
@Override
|
||||
@@ -115,7 +119,6 @@ public class StatusEffects {
|
||||
}
|
||||
};
|
||||
|
||||
static{
|
||||
melting.setOpposites(wet, freezing);
|
||||
wet.setOpposites(burning);
|
||||
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.Scout;
|
||||
import io.anuke.mindustry.entities.units.types.Vtol;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class UnitTypes {
|
||||
public static final UnitType
|
||||
public class UnitTypes implements ContentList {
|
||||
public static UnitType drone, scout, vtol;
|
||||
|
||||
drone = new Drone(),
|
||||
scout = new Scout(),
|
||||
@Override
|
||||
public void load() {
|
||||
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,10 +1,14 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.mindustry.content.fx.ShootFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Weapon;
|
||||
|
||||
public class Weapons {
|
||||
public static final Weapon
|
||||
public class Weapons implements ContentList {
|
||||
public static Weapon blaster;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
blaster = new Weapon("blaster") {{
|
||||
length = 1.5f;
|
||||
@@ -14,3 +18,4 @@ public class Weapons {
|
||||
setAmmo(AmmoTypes.bulletIron);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,49 +5,51 @@ import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.graphics.CacheLayer;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.*;
|
||||
|
||||
public class Blocks {
|
||||
public static final Block
|
||||
public class Blocks implements ContentList{
|
||||
public static Block air, spawn, blockpart, build1, build2, build3, build4, build5, build6, defaultFloor, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, iron, lead, coal, titanium, thorium, dirt, sand, ice, snow, grass, sandblock, snowblock, stoneblock, blackstoneblock, grassblock, mossblock, shrub, rock, icerock, blackrock, dirtblock;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
air = new Block("air") {
|
||||
//don't draw
|
||||
public void draw(Tile tile) {}
|
||||
},
|
||||
};
|
||||
|
||||
//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") {{
|
||||
placeableOn = false;
|
||||
variants = 0;
|
||||
cacheLayer = CacheLayer.space;
|
||||
solid = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
metalfloor = new Floor("metalfloor") {{
|
||||
variants = 6;
|
||||
}},
|
||||
}};
|
||||
|
||||
deepwater = new Floor("deepwater") {{
|
||||
placeableOn = false;
|
||||
@@ -60,7 +62,7 @@ public class Blocks {
|
||||
statusIntensity = 1f;
|
||||
drownTime = 140f;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}},
|
||||
}};
|
||||
|
||||
water = new Floor("water") {{
|
||||
placeableOn = false;
|
||||
@@ -72,7 +74,7 @@ public class Blocks {
|
||||
liquidDrop = Liquids.water;
|
||||
liquid = true;
|
||||
cacheLayer = CacheLayer.water;
|
||||
}},
|
||||
}};
|
||||
|
||||
lava = new Floor("lava") {{
|
||||
placeableOn = false;
|
||||
@@ -85,7 +87,7 @@ public class Blocks {
|
||||
liquidDrop = Liquids.lava;
|
||||
liquid = true;
|
||||
cacheLayer = CacheLayer.lava;
|
||||
}},
|
||||
}};
|
||||
|
||||
oil = new Floor("oil") {{
|
||||
placeableOn = false;
|
||||
@@ -97,101 +99,99 @@ public class Blocks {
|
||||
liquidDrop = Liquids.oil;
|
||||
liquid = true;
|
||||
cacheLayer = CacheLayer.oil;
|
||||
}},
|
||||
}};
|
||||
|
||||
stone = new Floor("stone") {{
|
||||
drops = new ItemStack(Items.stone, 1);
|
||||
blends = block -> block != this && !(block instanceof Ore);
|
||||
}},
|
||||
}};
|
||||
|
||||
blackstone = new Floor("blackstone") {{
|
||||
drops = new ItemStack(Items.stone, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
iron = new Ore("iron") {{
|
||||
drops = new ItemStack(Items.iron, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
lead = new Ore("lead") {{
|
||||
drops = new ItemStack(Items.lead, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
coal = new Ore("coal") {{
|
||||
drops = new ItemStack(Items.coal, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
titanium = new Ore("titanium") {{
|
||||
drops = new ItemStack(Items.titanium, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
thorium = new Ore("thorium") {{
|
||||
drops = new ItemStack(Items.thorium, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
dirt = new Floor("dirt") {
|
||||
},
|
||||
dirt = new Floor("dirt");
|
||||
|
||||
sand = new Floor("sand") {{
|
||||
drops = new ItemStack(Items.sand, 1);
|
||||
}},
|
||||
}};
|
||||
|
||||
ice = new Floor("ice") {{
|
||||
dragMultiplier = 0.2f;
|
||||
}},
|
||||
}};
|
||||
|
||||
snow = new Floor("snow") {
|
||||
},
|
||||
snow = new Floor("snow");
|
||||
|
||||
grass = new Floor("grass") {
|
||||
},
|
||||
grass = new Floor("grass");
|
||||
|
||||
sandblock = new StaticBlock("sandblock") {{
|
||||
solid = true;
|
||||
variants = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
snowblock = new StaticBlock("snowblock") {{
|
||||
solid = true;
|
||||
variants = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
stoneblock = new StaticBlock("stoneblock") {{
|
||||
solid = true;
|
||||
variants = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
blackstoneblock = new StaticBlock("blackstoneblock") {{
|
||||
solid = true;
|
||||
variants = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
grassblock = new StaticBlock("grassblock") {{
|
||||
solid = true;
|
||||
variants = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
mossblock = new StaticBlock("mossblock") {{
|
||||
solid = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
shrub = new Rock("shrub"),
|
||||
shrub = new Rock("shrub");
|
||||
|
||||
rock = new Rock("rock") {{
|
||||
variants = 2;
|
||||
varyShadow = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
icerock = new Rock("icerock") {{
|
||||
variants = 2;
|
||||
varyShadow = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
blackrock = new Rock("blackrock") {{
|
||||
variants = 1;
|
||||
varyShadow = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
dirtblock = new StaticBlock("dirtblock") {{
|
||||
solid = true;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,21 +4,24 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.production.*;
|
||||
|
||||
public class CraftingBlocks {
|
||||
public static final Block
|
||||
public class CraftingBlocks implements ContentList {
|
||||
public static Block smelter, alloysmelter, siliconsmelter, poweralloysmelter, powersmelter, cryofluidmixer, melter, separator, centrifuge, plasticFormer, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, weaponFactory, incinerator;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
smelter = new Smelter("smelter") {{
|
||||
health = 70;
|
||||
inputs = new Item[]{Items.iron};
|
||||
fuel = Items.coal;
|
||||
result = Items.steel;
|
||||
craftTime = 25f;
|
||||
}},
|
||||
}};
|
||||
|
||||
alloysmelter = new Smelter("alloysmelter") {{
|
||||
health = 90;
|
||||
@@ -28,7 +31,7 @@ public class CraftingBlocks {
|
||||
burnDuration = 45f;
|
||||
craftTime = 25f;
|
||||
flameColor = Color.valueOf("fd896e");
|
||||
}},
|
||||
}};
|
||||
|
||||
siliconsmelter = new PowerSmelter("siliconsmelter") {{
|
||||
health = 90;
|
||||
@@ -40,7 +43,7 @@ public class CraftingBlocks {
|
||||
size = 2;
|
||||
hasLiquids = false;
|
||||
flameColor = Color.valueOf("ffef99");
|
||||
}},
|
||||
}};
|
||||
|
||||
poweralloysmelter = new PowerSmelter("poweralloysmelter") {{
|
||||
health = 90;
|
||||
@@ -50,7 +53,7 @@ public class CraftingBlocks {
|
||||
powerUse = 0.3f;
|
||||
craftTime = 25f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
powersmelter = new PowerSmelter("powersmelter") {{
|
||||
health = 90;
|
||||
@@ -60,7 +63,7 @@ public class CraftingBlocks {
|
||||
powerUse = 0.1f;
|
||||
craftTime = 25f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
|
||||
health = 200;
|
||||
@@ -71,7 +74,7 @@ public class CraftingBlocks {
|
||||
itemCapacity = 50;
|
||||
powerUse = 0.1f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
melter = new PowerCrafter("melter") {{
|
||||
health = 200;
|
||||
@@ -82,7 +85,7 @@ public class CraftingBlocks {
|
||||
craftTime = 10f;
|
||||
powerUse = 0.1f;
|
||||
hasLiquids = hasPower = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
separator = new Separator("separator") {{
|
||||
liquid = Liquids.water;
|
||||
@@ -100,7 +103,7 @@ public class CraftingBlocks {
|
||||
filterTime = 40f;
|
||||
itemCapacity = 40;
|
||||
health = 50;
|
||||
}},
|
||||
}};
|
||||
|
||||
centrifuge = new Separator("centrifuge") {{
|
||||
liquid = Liquids.water;
|
||||
@@ -127,7 +130,7 @@ public class CraftingBlocks {
|
||||
spinnerThickness = 1.5f;
|
||||
spinnerSpeed = 3f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
plasticFormer = new PlasticFormer("plasticformer") {{
|
||||
inputLiquid = Liquids.oil;
|
||||
@@ -142,7 +145,7 @@ public class CraftingBlocks {
|
||||
hasPower = hasLiquids = true;
|
||||
craftEffect = BlockFx.formsmoke;
|
||||
updateEffect = BlockFx.plasticburn;
|
||||
}},
|
||||
}};
|
||||
|
||||
biomatterCompressor = new Compressor("biomattercompressor") {{
|
||||
input = new ItemStack(Items.biomatter, 1);
|
||||
@@ -155,7 +158,7 @@ public class CraftingBlocks {
|
||||
size = 2;
|
||||
health = 320;
|
||||
hasLiquids = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
pulverizer = new Pulverizer("pulverizer") {{
|
||||
inputItem = new ItemStack(Items.stone, 2);
|
||||
@@ -167,7 +170,7 @@ public class CraftingBlocks {
|
||||
craftTime = 60f;
|
||||
updateEffect = BlockFx.pulverizeSmall;
|
||||
hasItems = hasPower = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
oilRefinery = new GenericCrafter("oilrefinery") {{
|
||||
inputLiquid = Liquids.oil;
|
||||
@@ -178,7 +181,7 @@ public class CraftingBlocks {
|
||||
health = 80;
|
||||
craftEffect = BlockFx.purifyoil;
|
||||
hasItems = hasLiquids = hasPower = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
stoneFormer = new GenericCrafter("stoneformer") {{
|
||||
inputLiquid = Liquids.lava;
|
||||
@@ -189,14 +192,15 @@ public class CraftingBlocks {
|
||||
health = 80;
|
||||
craftEffect = BlockFx.purifystone;
|
||||
hasLiquids = hasItems = true;
|
||||
}},
|
||||
}};
|
||||
|
||||
weaponFactory = new WeaponFactory("weaponfactory") {{
|
||||
size = 2;
|
||||
health = 250;
|
||||
}},
|
||||
}};
|
||||
|
||||
incinerator = new Incinerator("incinerator") {{
|
||||
health = 90;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.blocks;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Liquid;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
@@ -19,14 +20,16 @@ import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DebugBlocks {
|
||||
public static final Block
|
||||
public class DebugBlocks implements ContentList{
|
||||
public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
powerVoid = new PowerBlock("powervoid") {
|
||||
{
|
||||
powerCapacity = Float.MAX_VALUE;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
powerInfinite = new PowerDistributor("powerinfinite") {
|
||||
{
|
||||
@@ -39,7 +42,7 @@ public class DebugBlocks {
|
||||
super.update(tile);
|
||||
tile.entity.power.amount = powerCapacity;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
itemSource = new Sorter("itemsource") {
|
||||
@Override
|
||||
@@ -53,7 +56,7 @@ public class DebugBlocks {
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
liquidSource = new Block("liquidsource") {
|
||||
{
|
||||
@@ -137,7 +140,7 @@ public class DebugBlocks {
|
||||
source = Liquid.getByID(stream.readByte());
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
itemVoid = new Block("itemvoid") {
|
||||
{
|
||||
@@ -145,7 +148,8 @@ public class DebugBlocks {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleItem(Item item, Tile tile, Tile source) {}
|
||||
public void handleItem(Item item, Tile tile, Tile source) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source) {
|
||||
@@ -153,3 +157,4 @@ public class DebugBlocks {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,65 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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 {
|
||||
static final int wallHealthMultiplier = 4;
|
||||
public class DefenseBlocks implements ContentList {
|
||||
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") {{
|
||||
health = 40 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
ironwall = new Wall("ironwall") {{
|
||||
health = 80 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
steelwall = new Wall("steelwall") {{
|
||||
health = 110 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
titaniumwall = new Wall("titaniumwall") {{
|
||||
health = 150 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
diriumwall = new Wall("duriumwall") {{
|
||||
health = 190 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
compositewall = new Wall("compositewall") {{
|
||||
health = 270 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
steelwalllarge = new Wall("steelwall-large") {{
|
||||
health = 110 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
titaniumwalllarge = new Wall("titaniumwall-large") {{
|
||||
health = 150 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
diriumwalllarge = new Wall("duriumwall-large") {{
|
||||
health = 190 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall") {{
|
||||
health = 150 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
door = new Door("door") {{
|
||||
health = 90 * wallHealthMultiplier;
|
||||
}},
|
||||
}};
|
||||
|
||||
largedoor = new Door("door-large") {{
|
||||
openfx = BlockFx.dooropenlarge;
|
||||
@@ -64,3 +68,4 @@ public class DefenseBlocks {
|
||||
size = 2;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,55 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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") {{
|
||||
health = 40;
|
||||
speed = 0.02f;
|
||||
}},
|
||||
}};
|
||||
|
||||
steelconveyor = new Conveyor("steelconveyor") {{
|
||||
health = 55;
|
||||
speed = 0.04f;
|
||||
}},
|
||||
}};
|
||||
|
||||
pulseconveyor = new Conveyor("poweredconveyor") {{
|
||||
health = 75;
|
||||
speed = 0.09f;
|
||||
}},
|
||||
}};
|
||||
|
||||
router = new Router("router"),
|
||||
router = new Router("router");
|
||||
|
||||
multiplexer = new Router("multiplexer") {{
|
||||
size = 2;
|
||||
itemCapacity = 80;
|
||||
}},
|
||||
}};
|
||||
|
||||
junction = new Junction("junction") {{
|
||||
speed = 26;
|
||||
capacity = 32;
|
||||
}},
|
||||
}};
|
||||
|
||||
bridgeconveyor = new BufferedItemBridge("bridgeconveyor") {{
|
||||
range = 3;
|
||||
hasPower = false;
|
||||
}},
|
||||
}};
|
||||
|
||||
laserconveyor = new ItemBridge("laserconveyor") {{
|
||||
range = 7;
|
||||
}},
|
||||
}};
|
||||
|
||||
sorter = new Sorter("sorter"),
|
||||
sorter = new Sorter("sorter");
|
||||
|
||||
splitter = new Splitter("splitter"),
|
||||
splitter = new Splitter("splitter");
|
||||
|
||||
overflowgate = new OverflowGate("overflowgate");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,53 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Pump;
|
||||
|
||||
public class LiquidBlocks {
|
||||
public static final Block
|
||||
public class LiquidBlocks implements ContentList{
|
||||
public static Block pump, fluxpump, conduit, pulseconduit, liquidrouter, liquidtank, liquidjunction, bridgeconduit, laserconduit;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
pump = new Pump("pump") {{
|
||||
pumpAmount = 0.1f;
|
||||
}},
|
||||
}};
|
||||
|
||||
fluxpump = new Pump("fluxpump") {{
|
||||
pumpAmount = 0.2f;
|
||||
}},
|
||||
}};
|
||||
|
||||
conduit = new Conduit("conduit") {{
|
||||
health = 45;
|
||||
}},
|
||||
}};
|
||||
|
||||
pulseconduit = new Conduit("pulseconduit") {{
|
||||
liquidCapacity = 16f;
|
||||
liquidFlowFactor = 4.9f;
|
||||
health = 65;
|
||||
}},
|
||||
}};
|
||||
|
||||
liquidrouter = new LiquidRouter("liquidrouter") {{
|
||||
liquidCapacity = 40f;
|
||||
}},
|
||||
}};
|
||||
|
||||
liquidtank = new LiquidRouter("liquidtank") {{
|
||||
size = 3;
|
||||
liquidCapacity = 1500f;
|
||||
health = 500;
|
||||
}},
|
||||
}};
|
||||
|
||||
liquidjunction = new LiquidJunction("liquidjunction"),
|
||||
liquidjunction = new LiquidJunction("liquidjunction");
|
||||
|
||||
bridgeconduit = new LiquidExtendingBridge("bridgeconduit") {{
|
||||
range = 3;
|
||||
hasPower = false;
|
||||
}},
|
||||
}};
|
||||
|
||||
laserconduit = new LiquidBridge("laserconduit") {{
|
||||
range = 7;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,64 +1,67 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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.distribution.Teleporter;
|
||||
import io.anuke.mindustry.world.blocks.types.power.*;
|
||||
|
||||
public class PowerBlocks {
|
||||
public static final Block
|
||||
public class PowerBlocks implements ContentList {
|
||||
public static Block combustiongenerator, thermalgenerator, liquidcombustiongenerator, rtgenerator, solarpanel, largesolarpanel, nuclearReactor, fusionReactor, repairturret, megarepairturret, shieldgenerator, battery, batteryLarge, powernode, powernodelarge, teleporter;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
combustiongenerator = new BurnerGenerator("combustiongenerator") {{
|
||||
powerOutput = 0.04f;
|
||||
powerCapacity = 40f;
|
||||
}},
|
||||
}};
|
||||
|
||||
thermalgenerator = new LiquidHeatGenerator("thermalgenerator") {{
|
||||
maxLiquidGenerate = 0.5f;
|
||||
powerPerLiquid = 0.08f;
|
||||
powerCapacity = 40f;
|
||||
generateEffect = BlockFx.redgeneratespark;
|
||||
}},
|
||||
}};
|
||||
|
||||
liquidcombustiongenerator = new LiquidBurnerGenerator("liquidcombustiongenerator") {{
|
||||
maxLiquidGenerate = 0.4f;
|
||||
powerPerLiquid = 0.12f;
|
||||
powerCapacity = 40f;
|
||||
}},
|
||||
}};
|
||||
|
||||
rtgenerator = new DecayGenerator("rtgenerator") {{
|
||||
powerCapacity = 40f;
|
||||
powerOutput = 0.02f;
|
||||
itemDuration = 500f;
|
||||
}},
|
||||
}};
|
||||
|
||||
solarpanel = new SolarGenerator("solarpanel") {{
|
||||
generation = 0.003f;
|
||||
}},
|
||||
}};
|
||||
|
||||
largesolarpanel = new SolarGenerator("largesolarpanel") {{
|
||||
size = 3;
|
||||
generation = 0.012f;
|
||||
}},
|
||||
}};
|
||||
|
||||
nuclearReactor = new NuclearReactor("nuclearreactor") {{
|
||||
size = 3;
|
||||
health = 600;
|
||||
}},
|
||||
}};
|
||||
|
||||
fusionReactor = new FusionReactor("fusionreactor") {{
|
||||
size = 4;
|
||||
health = 600;
|
||||
}},
|
||||
}};
|
||||
|
||||
repairturret = new RepairTurret("repairturret") {{
|
||||
range = 30;
|
||||
reload = 20f;
|
||||
health = 60;
|
||||
powerUsed = 0.08f;
|
||||
}},
|
||||
}};
|
||||
|
||||
megarepairturret = new RepairTurret("megarepairturret") {{
|
||||
range = 44;
|
||||
@@ -66,26 +69,26 @@ public class PowerBlocks {
|
||||
health = 90;
|
||||
powerUsed = 0.13f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
shieldgenerator = new ShieldBlock("shieldgenerator") {{
|
||||
health = 400;
|
||||
}},
|
||||
}};
|
||||
|
||||
battery = new PowerGenerator("battery") {{
|
||||
powerCapacity = 320f;
|
||||
hasItems = false;
|
||||
}},
|
||||
}};
|
||||
|
||||
batteryLarge = new PowerGenerator("batterylarge") {{
|
||||
size = 3;
|
||||
powerCapacity = 2000f;
|
||||
hasItems = false;
|
||||
}},
|
||||
}};
|
||||
|
||||
powernode = new PowerDistributor("powernode") {{
|
||||
shadow = "shadow-round-1";
|
||||
}},
|
||||
}};
|
||||
|
||||
powernodelarge = new PowerDistributor("powernodelarge") {{
|
||||
size = 2;
|
||||
@@ -93,7 +96,9 @@ public class PowerBlocks {
|
||||
maxNodes = 5;
|
||||
laserRange = 7.5f;
|
||||
shadow = "powernodelarge-shadow";
|
||||
}},
|
||||
}};
|
||||
|
||||
teleporter = new Teleporter("teleporter");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,34 +4,37 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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.Fracker;
|
||||
import io.anuke.mindustry.world.blocks.types.production.SolidPump;
|
||||
|
||||
public class ProductionBlocks {
|
||||
public static final Block
|
||||
public class ProductionBlocks implements ContentList {
|
||||
public static Block ironDrill, reinforcedDrill, steelDrill, titaniumDrill, laserdrill, nucleardrill, plasmadrill, waterextractor, oilextractor, cultivator;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
ironDrill = new Drill("irondrill") {{
|
||||
tier = 1;
|
||||
drillTime = 400;
|
||||
}},
|
||||
}};
|
||||
|
||||
reinforcedDrill = new Drill("reinforceddrill") {{
|
||||
tier = 2;
|
||||
drillTime = 360;
|
||||
}},
|
||||
}};
|
||||
|
||||
steelDrill = new Drill("steeldrill") {{
|
||||
tier = 3;
|
||||
drillTime = 320;
|
||||
}},
|
||||
}};
|
||||
|
||||
titaniumDrill = new Drill("titaniumdrill") {{
|
||||
tier = 4;
|
||||
drillTime = 280;
|
||||
}},
|
||||
}};
|
||||
|
||||
laserdrill = new Drill("laserdrill") {{
|
||||
drillTime = 220;
|
||||
@@ -41,7 +44,7 @@ public class ProductionBlocks {
|
||||
tier = 5;
|
||||
updateEffect = BlockFx.pulverizeMedium;
|
||||
drillEffect = BlockFx.mineBig;
|
||||
}},
|
||||
}};
|
||||
|
||||
nucleardrill = new Drill("nucleardrill") {{
|
||||
drillTime = 160;
|
||||
@@ -55,7 +58,7 @@ public class ProductionBlocks {
|
||||
drillEffect = BlockFx.mineHuge;
|
||||
rotateSpeed = 6f;
|
||||
warmupSpeed = 0.01f;
|
||||
}},
|
||||
}};
|
||||
|
||||
plasmadrill = new Drill("plasmadrill") {{
|
||||
heatColor = Color.valueOf("ff461b");
|
||||
@@ -71,7 +74,7 @@ public class ProductionBlocks {
|
||||
updateEffectChance = 0.04f;
|
||||
drillEffect = BlockFx.mineHuge;
|
||||
warmupSpeed = 0.005f;
|
||||
}},
|
||||
}};
|
||||
|
||||
waterextractor = new SolidPump("waterextractor") {{
|
||||
result = Liquids.water;
|
||||
@@ -80,7 +83,7 @@ public class ProductionBlocks {
|
||||
size = 2;
|
||||
liquidCapacity = 30f;
|
||||
rotateSpeed = 1.4f;
|
||||
}},
|
||||
}};
|
||||
|
||||
oilextractor = new Fracker("oilextractor") {{
|
||||
result = Liquids.oil;
|
||||
@@ -92,7 +95,7 @@ public class ProductionBlocks {
|
||||
pumpAmount = 0.06f;
|
||||
size = 3;
|
||||
liquidCapacity = 30f;
|
||||
}},
|
||||
}};
|
||||
|
||||
cultivator = new Cultivator("cultivator") {{
|
||||
result = Items.biomatter;
|
||||
@@ -103,4 +106,6 @@ public class ProductionBlocks {
|
||||
hasLiquids = true;
|
||||
hasPower = true;
|
||||
}};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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.Unloader;
|
||||
import io.anuke.mindustry.world.blocks.types.storage.Vault;
|
||||
|
||||
public class StorageBlocks {
|
||||
public static final Block
|
||||
public class StorageBlocks implements ContentList {
|
||||
public static Block core, vault, unloader, sortedunloader;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
core = new CoreBlock("core") {{
|
||||
health = 800;
|
||||
}},
|
||||
}};
|
||||
|
||||
vault = new Vault("vault") {{
|
||||
size = 3;
|
||||
health = 600;
|
||||
}},
|
||||
}};
|
||||
|
||||
unloader = new Unloader("unloader") {{
|
||||
speed = 5;
|
||||
}},
|
||||
}};
|
||||
|
||||
sortedunloader = new SortedUnloader("sortedunloader") {{
|
||||
speed = 5;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.units.RepairPoint;
|
||||
import io.anuke.mindustry.world.blocks.types.units.ResupplyPoint;
|
||||
|
||||
public class UnitBlocks {
|
||||
public static final Block
|
||||
public class UnitBlocks implements ContentList {
|
||||
public static Block resupplyPoint, repairPoint, droneFactory;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
/*
|
||||
droneFactory = new UnitFactory("dronefactory") {{
|
||||
type = UnitTypes.drone;
|
||||
@@ -14,33 +18,16 @@ public class UnitBlocks {
|
||||
requirements = new ItemStack[]{
|
||||
new ItemStack(Items.stone, 5)
|
||||
};
|
||||
}},
|
||||
|
||||
vtolFactory = new UnitFactory("vtolfactory"){{
|
||||
type = UnitTypes.vtol;
|
||||
produceTime = 200;
|
||||
size = 2;
|
||||
requirements = new ItemStack[]{
|
||||
new ItemStack(Items.stone, 5)
|
||||
};
|
||||
}},
|
||||
|
||||
walkerFactory = new UnitFactory("walkerfactory"){{
|
||||
type = UnitTypes.scout;
|
||||
produceTime = 20;
|
||||
size = 2;
|
||||
requirements = new ItemStack[]{
|
||||
new ItemStack(Items.stone, 1)
|
||||
};
|
||||
}},*/
|
||||
}};*/
|
||||
|
||||
resupplyPoint = new ResupplyPoint("resupplypoint") {{
|
||||
shadow = "shadow-round-1";
|
||||
itemCapacity = 30;
|
||||
}},
|
||||
}};
|
||||
|
||||
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.fx.ShootFx;
|
||||
import io.anuke.mindustry.type.AmmoType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.turrets.*;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
@@ -11,15 +12,17 @@ import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
public class WeaponBlocks{
|
||||
public static Block
|
||||
public class WeaponBlocks implements ContentList {
|
||||
public static Block duo, scatter, scorch, hail, wave, crux, lancer, arc, swarmer, ripple, cyclone, fuse, spectre, eraser, meltdown;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
duo = new DoubleTurret("duo") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite};
|
||||
reload = 25f;
|
||||
restitution = 0.03f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
}},
|
||||
}};
|
||||
|
||||
scatter = new BurstTurret("scatter") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic};
|
||||
@@ -30,7 +33,7 @@ public class WeaponBlocks{
|
||||
recoil = 1.5f;
|
||||
burstSpacing = 6f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
}},
|
||||
}};
|
||||
|
||||
scorch = new LiquidTurret("scorch") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
|
||||
@@ -40,11 +43,11 @@ public class WeaponBlocks{
|
||||
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);
|
||||
}},
|
||||
}};
|
||||
|
||||
hail = new ItemTurret("hail") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
|
||||
}},
|
||||
}};
|
||||
|
||||
wave = new LiquidTurret("wave") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
|
||||
@@ -64,7 +67,7 @@ public class WeaponBlocks{
|
||||
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
Draw.color();
|
||||
};
|
||||
}},
|
||||
}};
|
||||
|
||||
crux = new ItemTurret("crux") {{
|
||||
size = 2;
|
||||
@@ -90,7 +93,7 @@ public class WeaponBlocks{
|
||||
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
|
||||
}
|
||||
};
|
||||
}},
|
||||
}};
|
||||
|
||||
lancer = new LaserTurret("lancer") {{
|
||||
range = 70f;
|
||||
@@ -107,7 +110,7 @@ public class WeaponBlocks{
|
||||
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
||||
heatColor = Color.RED;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
arc = new LaserTurret("arc") {{
|
||||
shootType = AmmoTypes.lightning;
|
||||
@@ -122,28 +125,28 @@ public class WeaponBlocks{
|
||||
heatColor = Color.RED;
|
||||
recoil = 3f;
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
swarmer = new ItemTurret("swarmer") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary, AmmoTypes.missileSurge};
|
||||
size = 2;
|
||||
}},
|
||||
}};
|
||||
|
||||
ripple = new ItemTurret("ripple") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.artilleryLead, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryPlastic, AmmoTypes.artilleryThorium};
|
||||
size = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
cyclone = new ItemTurret("cyclone") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
|
||||
size = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
fuse = new ItemTurret("fuse") {{
|
||||
//TODO make it use power
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
|
||||
size = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
spectre = new LaserTurret("spectre") {{
|
||||
range = 70f;
|
||||
@@ -160,7 +163,7 @@ public class WeaponBlocks{
|
||||
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
|
||||
heatColor = Color.RED;
|
||||
size = 3;
|
||||
}},
|
||||
}};
|
||||
|
||||
eraser = new ItemTurret("eraser") {{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.bulletIron, AmmoTypes.bulletLead, AmmoTypes.bulletSteel, AmmoTypes.bulletThermite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
|
||||
@@ -168,10 +171,11 @@ public class WeaponBlocks{
|
||||
restitution = 0.03f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
size = 4;
|
||||
}},
|
||||
}};
|
||||
|
||||
meltdown = new PowerTurret("meltdown") {{
|
||||
shootType = AmmoTypes.meltdownLaser;
|
||||
size = 4;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@ package io.anuke.mindustry.content.bullets;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class ArtilleryBullets {
|
||||
public static final BulletType
|
||||
public class ArtilleryBullets implements ContentList{
|
||||
public static BulletType lead, thorium, plastic, homing, incindiary, surge;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
lead = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -17,7 +21,7 @@ public class ArtilleryBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
thorium = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -29,7 +33,7 @@ public class ArtilleryBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
plastic = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -41,7 +45,7 @@ public class ArtilleryBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
homing = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -53,7 +57,7 @@ public class ArtilleryBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
incindiary = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -65,7 +69,7 @@ public class ArtilleryBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
surge = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -79,3 +83,4 @@ public class ArtilleryBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,30 +2,34 @@ package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class FlakBullets {
|
||||
public static final BulletType
|
||||
public class FlakBullets implements ContentList {
|
||||
public static BulletType lead, plastic, explosive, surge;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
lead = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
plastic = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
explosive = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
surge = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
@@ -34,3 +38,4 @@ public class FlakBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,27 @@ package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class MissileBullets {
|
||||
public static final BulletType
|
||||
public class MissileBullets implements ContentList {
|
||||
public static BulletType explosive, incindiary, surge;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
explosive = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
incindiary = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
surge = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
@@ -27,3 +31,4 @@ public class MissileBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,13 @@ import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class ShellBullets {
|
||||
public static final BulletType
|
||||
public class ShellBullets implements ContentList {
|
||||
public static BulletType lead, leadShard, thorium, thoriumShard, plastic, plasticShard, explosive, explosiveShard, incindiary;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
lead = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -19,7 +23,7 @@ public class ShellBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
leadShard = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -32,7 +36,7 @@ public class ShellBullets {
|
||||
bulletHeight = 11f;
|
||||
bulletShrink = 1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
thorium = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -45,7 +49,7 @@ public class ShellBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
thoriumShard = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -58,7 +62,7 @@ public class ShellBullets {
|
||||
bulletHeight = 11f;
|
||||
bulletShrink = 1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
plastic = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -71,7 +75,7 @@ public class ShellBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
plasticShard = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -84,7 +88,7 @@ public class ShellBullets {
|
||||
bulletHeight = 11f;
|
||||
bulletShrink = 1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
explosive = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -97,7 +101,7 @@ public class ShellBullets {
|
||||
bulletSprite = "frag";
|
||||
bulletShrink = 0.1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
explosiveShard = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -110,7 +114,7 @@ public class ShellBullets {
|
||||
bulletHeight = 11f;
|
||||
bulletShrink = 1f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
incindiary = new BasicBulletType(3f, 0) {
|
||||
{
|
||||
@@ -125,3 +129,4 @@ public class ShellBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,44 +2,48 @@ package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class StandardBullets {
|
||||
public static final BulletType
|
||||
public class StandardBullets implements ContentList {
|
||||
public static BulletType iron, lead, steel, thorium, homing, tracer;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
iron = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
lead = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
steel = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
thorium = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
homing = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
tracer = new BasicBulletType(3f, 5) {
|
||||
{
|
||||
@@ -48,3 +52,4 @@ public class StandardBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import io.anuke.mindustry.entities.effect.DamageArea;
|
||||
import io.anuke.mindustry.entities.effect.Fire;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
@@ -23,9 +24,11 @@ import io.anuke.ucore.util.Mathf;
|
||||
|
||||
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) {
|
||||
{
|
||||
@@ -64,7 +67,7 @@ public class TurretBullets {
|
||||
Effects.effect(EnvironmentFx.ballfire, b.x, b.y);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
basicFlame = new BulletType(2f, 0) {
|
||||
{
|
||||
@@ -78,8 +81,9 @@ public class TurretBullets {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b) {}
|
||||
},
|
||||
public void draw(Bullet b) {
|
||||
}
|
||||
};
|
||||
|
||||
lancerLaser = new BulletType(0.001f, 1) {
|
||||
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
|
||||
@@ -115,11 +119,11 @@ public class TurretBullets {
|
||||
}
|
||||
Draw.reset();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
fuseShot = new BulletType(0.01f, 100) {
|
||||
//TODO
|
||||
},
|
||||
};
|
||||
|
||||
waterShot = new LiquidBulletType(Liquids.water) {
|
||||
{
|
||||
@@ -127,13 +131,13 @@ public class TurretBullets {
|
||||
statusIntensity = 0.5f;
|
||||
knockback = 0.65f;
|
||||
}
|
||||
},
|
||||
};
|
||||
cryoShot = new LiquidBulletType(Liquids.cryofluid) {
|
||||
{
|
||||
status = StatusEffects.freezing;
|
||||
statusIntensity = 0.5f;
|
||||
}
|
||||
},
|
||||
};
|
||||
lavaShot = new LiquidBulletType(Liquids.lava) {
|
||||
{
|
||||
damage = 4;
|
||||
@@ -142,7 +146,7 @@ public class TurretBullets {
|
||||
status = StatusEffects.melting;
|
||||
statusIntensity = 0.5f;
|
||||
}
|
||||
},
|
||||
};
|
||||
oilShot = new LiquidBulletType(Liquids.oil) {
|
||||
{
|
||||
speed = 2f;
|
||||
@@ -150,7 +154,7 @@ public class TurretBullets {
|
||||
status = StatusEffects.oiled;
|
||||
statusIntensity = 0.5f;
|
||||
}
|
||||
},
|
||||
};
|
||||
lightning = new BulletType(0.001f, 5) {
|
||||
{
|
||||
lifetime = 1;
|
||||
@@ -159,7 +163,8 @@ public class TurretBullets {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b) {}
|
||||
public void draw(Bullet b) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Bullet b) {
|
||||
@@ -167,3 +172,4 @@ public class TurretBullets {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.fx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@@ -14,8 +15,11 @@ import io.anuke.ucore.util.Tmp;
|
||||
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class BlockFx {
|
||||
public static final Effect
|
||||
public class BlockFx implements ContentList{
|
||||
public static Effect reactorsmoke, nuclearsmoke, nuclearcloud, redgeneratespark, generatespark, fuelburn, plasticburn, pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium, producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, dooropen, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate, mine, mineBig, mineHuge, smelt, teleportActivate, teleport, teleportOut, ripple, bubble;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
reactorsmoke = new Effect(17, e -> {
|
||||
Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> {
|
||||
@@ -24,7 +28,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -32,7 +36,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -40,7 +44,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -49,7 +53,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -57,7 +61,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -65,70 +69,70 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -136,7 +140,7 @@ public class BlockFx {
|
||||
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;
|
||||
@@ -144,79 +148,79 @@ public class BlockFx {
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
});
|
||||
dooropen = new Effect(10, e -> {
|
||||
Lines.stroke(e.fout() * 1.6f);
|
||||
Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
doorclose = new Effect(10, e -> {
|
||||
Lines.stroke(e.fout() * 1.6f);
|
||||
Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
dooropenlarge = new Effect(10, e -> {
|
||||
Lines.stroke(e.fout() * 1.6f);
|
||||
Lines.square(e.x, e.y, tilesize + e.fin() * 2f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
doorcloselarge = new Effect(10, e -> {
|
||||
Lines.stroke(e.fout() * 1.6f);
|
||||
Lines.square(e.x, e.y, tilesize + e.fout() * 2f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
purify = new Effect(10, e -> {
|
||||
Draw.color(Color.ROYAL, Color.GRAY, e.fin());
|
||||
Lines.stroke(2f);
|
||||
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
purifyoil = new Effect(10, e -> {
|
||||
Draw.color(Color.BLACK, Color.GRAY, e.fin());
|
||||
Lines.stroke(2f);
|
||||
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
purifystone = new Effect(10, e -> {
|
||||
Draw.color(Color.ORANGE, Color.GRAY, e.fin());
|
||||
Lines.stroke(2f);
|
||||
Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
generate = new Effect(11, e -> {
|
||||
Draw.color(Color.ORANGE, Color.YELLOW, e.fin());
|
||||
Lines.stroke(1f);
|
||||
Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
mine = new Effect(20, e -> {
|
||||
Angles.randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> {
|
||||
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
|
||||
Fill.poly(e.x + x, e.y + y, 4, e.fout() * 2f, 45);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
});
|
||||
mineBig = new Effect(30, e -> {
|
||||
Angles.randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> {
|
||||
Draw.color(e.color, Color.LIGHT_GRAY, e.fin());
|
||||
Fill.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);
|
||||
|
||||
@@ -232,7 +236,7 @@ public class BlockFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
teleport = new Effect(60, e -> {
|
||||
Draw.color(e.color);
|
||||
Lines.stroke(e.fin() * 2f);
|
||||
@@ -243,7 +247,7 @@ public class BlockFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
teleportOut = new Effect(20, e -> {
|
||||
Draw.color(e.color);
|
||||
Lines.stroke(e.fout() * 2f);
|
||||
@@ -254,13 +258,13 @@ public class BlockFx {
|
||||
});
|
||||
|
||||
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));
|
||||
@@ -271,3 +275,4 @@ public class BlockFx {
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@@ -9,8 +10,11 @@ import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class BulletFx {
|
||||
public static final Effect
|
||||
public class BulletFx implements ContentList {
|
||||
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLancer, despawn, flakExplosion;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
hitBulletSmall = new Effect(14, e -> {
|
||||
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
||||
@@ -22,7 +26,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
hitBulletBig = new Effect(13, e -> {
|
||||
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());
|
||||
@@ -34,7 +38,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
hitFlameSmall = new Effect(14, e -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||
@@ -46,7 +50,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
hitLiquid = new Effect(16, e -> {
|
||||
Draw.color(e.color);
|
||||
@@ -56,7 +60,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
hitLancer = new Effect(12, e -> {
|
||||
Draw.color(Color.WHITE);
|
||||
@@ -68,7 +72,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
despawn = new Effect(12, e -> {
|
||||
Draw.color(Palette.lighterOrange, Color.GRAY, e.fin());
|
||||
@@ -80,7 +84,7 @@ public class BulletFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
flakExplosion = new Effect(20, e -> {
|
||||
|
||||
@@ -105,5 +109,6 @@ public class BulletFx {
|
||||
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,15 +3,18 @@ package io.anuke.mindustry.content.fx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
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 -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||
@@ -21,7 +24,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
fire = new Effect(35f, e -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||
@@ -31,7 +34,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
smoke = new Effect(35f, e -> {
|
||||
Draw.color(Color.GRAY);
|
||||
@@ -41,7 +44,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
steam = new Effect(35f, e -> {
|
||||
Draw.color(Color.LIGHT_GRAY);
|
||||
@@ -51,7 +54,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
fireballsmoke = new Effect(25f, e -> {
|
||||
Draw.color(Color.GRAY);
|
||||
@@ -61,7 +64,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
ballfire = new Effect(25f, e -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());
|
||||
@@ -71,7 +74,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
freezing = new Effect(40f, e -> {
|
||||
Draw.color(Liquids.cryofluid.color);
|
||||
@@ -81,7 +84,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
melting = new Effect(40f, e -> {
|
||||
Draw.color(Liquids.lava.color, Color.WHITE, e.fout() / 5f + Mathf.randomSeedRange(e.id, 0.12f));
|
||||
@@ -91,7 +94,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
wet = new Effect(40f, e -> {
|
||||
Draw.color(Liquids.water.color);
|
||||
@@ -101,7 +104,7 @@ public class EnvironmentFx {
|
||||
});
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
oily = new Effect(42f, e -> {
|
||||
Draw.color(Liquids.oil.color);
|
||||
@@ -113,3 +116,4 @@ public class EnvironmentFx {
|
||||
Draw.color();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@@ -9,29 +10,32 @@ import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class ExplosionFx {
|
||||
public static final Effect
|
||||
public class ExplosionFx implements ContentList {
|
||||
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
shockwave = new Effect(10f, 80f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||
Lines.stroke(e.fout() * 2f + 0.2f);
|
||||
Lines.circle(e.x, e.y, e.fin() * 28f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
bigShockwave = new Effect(10f, 80f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||
Lines.stroke(e.fout() * 3f);
|
||||
Lines.circle(e.x, e.y, e.fin() * 50f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
nuclearShockwave = new Effect(10f, 200f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||
Lines.stroke(e.fout() * 3f + 0.2f);
|
||||
Lines.poly(e.x, e.y, 40, e.fin() * 140f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
explosion = new Effect(30, e -> {
|
||||
e.scaled(7, i -> {
|
||||
@@ -54,7 +58,7 @@ public class ExplosionFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
blockExplosion = new Effect(30, e -> {
|
||||
e.scaled(7, i -> {
|
||||
@@ -77,7 +81,7 @@ public class ExplosionFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
blockExplosionSmoke = new Effect(30, e -> {
|
||||
Draw.color(Color.GRAY);
|
||||
@@ -90,3 +94,4 @@ public class ExplosionFx {
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@@ -10,19 +11,21 @@ import io.anuke.ucore.util.Angles;
|
||||
|
||||
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);
|
||||
@@ -35,14 +38,14 @@ public class Fx{
|
||||
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);
|
||||
@@ -51,3 +54,4 @@ public class Fx{
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.content.fx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
@@ -11,8 +12,11 @@ import io.anuke.ucore.graphics.Shapes;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class ShootFx {
|
||||
public static final Effect
|
||||
public class ShootFx implements ContentList {
|
||||
public static Effect shootSmall, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
shootSmall = new Effect(8, e -> {
|
||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
||||
@@ -20,7 +24,7 @@ public class ShootFx {
|
||||
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 -> {
|
||||
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||
@@ -30,7 +34,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shootBig = new Effect(9, e -> {
|
||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
|
||||
@@ -38,7 +42,7 @@ public class ShootFx {
|
||||
Shapes.tri(e.x, e.y, w, 25f * e.fout(), e.rotation);
|
||||
Shapes.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shootBig2 = new Effect(10, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.GRAY, e.fin());
|
||||
@@ -46,7 +50,7 @@ public class ShootFx {
|
||||
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());
|
||||
@@ -56,7 +60,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shootBigSmoke2 = new Effect(18f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.fin());
|
||||
@@ -66,7 +70,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shootSmallFlame = new Effect(30f, e -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.fin());
|
||||
@@ -76,7 +80,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shootLiquid = new Effect(40f, e -> {
|
||||
Draw.color(e.color, Color.WHITE, e.fout() / 6f + Mathf.randomSeedRange(e.id, 0.1f));
|
||||
@@ -86,7 +90,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
||||
@@ -102,7 +106,7 @@ public class ShootFx {
|
||||
1f, 2f, rot + e.fin() * 50f * i);
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
shellEjectMedium = new GroundEffect(34f, 400f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
||||
@@ -125,7 +129,7 @@ public class ShootFx {
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
shellEjectBig = new GroundEffect(22f, 400f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
|
||||
@@ -149,7 +153,7 @@ public class ShootFx {
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
});
|
||||
|
||||
lancerLaserShoot = new Effect(21f, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
@@ -159,7 +163,7 @@ public class ShootFx {
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
lancerLaserShootSmoke = new Effect(26f, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
@@ -169,7 +173,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
lancerLaserCharge = new Effect(38f, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
@@ -179,7 +183,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
lancerLaserChargeBegin = new Effect(71f, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
@@ -187,7 +191,7 @@ public class ShootFx {
|
||||
|
||||
Draw.color();
|
||||
Fill.circle(e.x, e.y, e.fin() * 2f);
|
||||
}),
|
||||
});
|
||||
|
||||
lightningCharge = new Effect(38f, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
@@ -197,7 +201,7 @@ public class ShootFx {
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
});
|
||||
|
||||
lightningShoot = new Effect(12f, e -> {
|
||||
Draw.color(Color.WHITE, Palette.lancerLaser, e.fin());
|
||||
@@ -210,3 +214,4 @@ public class ShootFx {
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class UnitFx {
|
||||
public static final Effect
|
||||
public class UnitFx implements ContentList {
|
||||
public static Effect vtolHover;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
|
||||
vtolHover = new Effect(40f, e -> {
|
||||
float len = e.finpow() * 10f;
|
||||
@@ -18,3 +22,4 @@ public class UnitFx {
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,20 +3,60 @@ package io.anuke.mindustry.core;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.content.blocks.*;
|
||||
import io.anuke.mindustry.content.bullets.*;
|
||||
import io.anuke.mindustry.content.fx.*;
|
||||
import io.anuke.mindustry.entities.StatusEffect;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.Liquid;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
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.*/
|
||||
public class ContentLoader {
|
||||
|
||||
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
|
||||
new Blocks(),
|
||||
new DefenseBlocks(),
|
||||
@@ -30,40 +70,14 @@ public class ContentLoader {
|
||||
new PowerBlocks(),
|
||||
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
|
||||
new Recipes(),
|
||||
};
|
||||
|
||||
for (ContentList list : content){
|
||||
list.load();
|
||||
}
|
||||
|
||||
for(Block block : Block.getAllBlocks()){
|
||||
block.init();
|
||||
}
|
||||
|
||||
@@ -139,10 +139,6 @@ public class NetClient extends Module {
|
||||
entity.read(data, time);
|
||||
}
|
||||
}
|
||||
|
||||
if(debugNet){
|
||||
clientDebug.setSyncDebug(players, enemies);
|
||||
}
|
||||
});
|
||||
|
||||
Net.handleClient(InvokePacket.class, packet -> {
|
||||
|
||||
@@ -57,6 +57,8 @@ public class Renderer extends RendererModule{
|
||||
public Renderer() {
|
||||
Lines.setCircleVertices(14);
|
||||
|
||||
Shaders.init();
|
||||
|
||||
Core.cameraScale = baseCameraScale;
|
||||
Effects.setEffectProvider((effect, color, x, y, rotation, data) -> {
|
||||
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);
|
||||
Mathf.each(font -> {
|
||||
font.setUseIntegerPositions(false);
|
||||
font.getData().setScale(Vars.fontscale);
|
||||
font.getData().setScale(Vars.fontScale);
|
||||
font.getData().down += Unit.dp.scl(4f);
|
||||
font.getData().lineHeight -= Unit.dp.scl(2f);
|
||||
}, skin.font(), skin.getFont("default-font-chat"), skin.getFont("korean"));
|
||||
|
||||
@@ -242,7 +242,7 @@ public class Player extends Unit implements BlockBuilder {
|
||||
|
||||
Draw.reset();
|
||||
Pools.free(layout);
|
||||
Draw.tscl(fontscale);
|
||||
Draw.tscl(fontScale);
|
||||
}
|
||||
|
||||
public void drawBuildRequests(){
|
||||
|
||||
@@ -70,7 +70,7 @@ public class OverlayRenderer {
|
||||
Draw.color(0f, 0f, 0f, 0.5f);
|
||||
Fill.rect(target.drawx(), target.drawy(), v.x, v.y);
|
||||
Draw.textc(result.toString(), target.drawx(), target.drawy(), v);
|
||||
Draw.tscl(fontscale);
|
||||
Draw.tscl(fontScale);
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.graphics;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.FloatArray;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
@@ -14,18 +13,29 @@ import static io.anuke.mindustry.Vars.tilesize;
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class Shaders{
|
||||
public static final Outline outline = new Outline();
|
||||
public static final BlockBuild blockbuild = new BlockBuild();
|
||||
public static final BlockPreview blockpreview = new BlockPreview();
|
||||
public static final Shield shield = new Shield();
|
||||
public static final SurfaceShader water = new SurfaceShader("water");
|
||||
public static final SurfaceShader lava = new SurfaceShader("lava");
|
||||
public static final SurfaceShader oil = new SurfaceShader("oil");
|
||||
public static final Space space = new Space();
|
||||
public static final UnitBuild build = new UnitBuild();
|
||||
public static final Shader hit = new Shader("hit", "default");
|
||||
public static Outline outline;
|
||||
public static BlockBuild blockbuild;
|
||||
public static BlockPreview blockpreview;
|
||||
public static Shield shield;
|
||||
public static SurfaceShader water;
|
||||
public static SurfaceShader lava;
|
||||
public static SurfaceShader oil;
|
||||
public static Space space;
|
||||
public static UnitBuild build;
|
||||
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{
|
||||
|
||||
@@ -70,7 +80,7 @@ public class Shaders{
|
||||
@Override
|
||||
public void apply(){
|
||||
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.GestureListener;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
@@ -23,6 +25,8 @@ import io.anuke.ucore.util.Mathf;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class AndroidInput extends InputHandler implements GestureListener{
|
||||
private static Rectangle r1 = new Rectangle(), r2 = new Rectangle();
|
||||
|
||||
//gesture data
|
||||
private Vector2 pinch1 = new Vector2(-1, -1), pinch2 = pinch1.cpy();
|
||||
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));
|
||||
}
|
||||
|
||||
/**Returns whether this tile is in the list of requests, or at least colliding with one.*/
|
||||
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){
|
||||
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;
|
||||
}
|
||||
|
||||
/**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
|
||||
public void buildUI(Group group) {
|
||||
|
||||
@@ -122,6 +164,24 @@ public class AndroidInput extends InputHandler implements GestureListener{
|
||||
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
|
||||
public boolean tap(float x, float y, int count, int button) {
|
||||
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;
|
||||
|
||||
//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));
|
||||
}
|
||||
|
||||
@@ -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 longPress(float x, float y) { return false; }
|
||||
@Override public boolean fling(float velocityX, float velocityY, int button) { return false; }
|
||||
|
||||
class PlaceRequest{
|
||||
|
||||
@@ -25,8 +25,8 @@ import io.anuke.ucore.util.Translator;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public abstract class InputHandler extends InputAdapter{
|
||||
public final static float playerSelectRange = Unit.dp.scl(60f);
|
||||
private final static Translator stackTrns = new Translator();
|
||||
float playerSelectRange = Unit.dp.scl(60f);
|
||||
Translator stackTrns = new Translator();
|
||||
|
||||
private float mx, my;
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ import io.anuke.ucore.util.Strings;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Version {
|
||||
public static final String name;
|
||||
public static final String type;
|
||||
public static final String code;
|
||||
public static final int build;
|
||||
public static final String buildName;
|
||||
public static String name;
|
||||
public static String type;
|
||||
public static String code;
|
||||
public static int build;
|
||||
public static String buildName;
|
||||
|
||||
static{
|
||||
public static void init(){
|
||||
try {
|
||||
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.*/
|
||||
public static void handleClientReceived(Object object){
|
||||
if(debugNet) clientDebug.handle(object);
|
||||
|
||||
if(object instanceof StreamBegin) {
|
||||
StreamBegin b = (StreamBegin) object;
|
||||
@@ -198,7 +197,6 @@ public class Net{
|
||||
|
||||
/**Call to handle a packet being recieved for the server.*/
|
||||
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) 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
public class Links {
|
||||
private static final LinkEntry[] links = {
|
||||
private static LinkEntry[] links;
|
||||
|
||||
private static void createLinks(){
|
||||
links = new LinkEntry[]{
|
||||
new LinkEntry("discord", "https://discord.gg/BKADYds", Color.valueOf("7289da")),
|
||||
new LinkEntry("trello", "https://trello.com/b/aE2tcUwF", Color.valueOf("026aa7")),
|
||||
new LinkEntry("wiki", "http://mindustry.wikia.com/wiki/Mindustry_Wiki", Color.valueOf("0f142f")),
|
||||
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")),
|
||||
new LinkEntry("dev-builds", "https://github.com/Anuken/Mindustry/wiki", Color.valueOf("fafbfc"))
|
||||
};
|
||||
}
|
||||
|
||||
public static LinkEntry[] getLinks(){
|
||||
if(links == null){
|
||||
createLinks();
|
||||
}
|
||||
|
||||
return links;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,8 +141,7 @@ public class DebugFragment implements Fragment {
|
||||
"tiles.sleeping: " + TileEntity.sleepingEntities,
|
||||
"time: " + Timers.time(),
|
||||
"state.gameover: " + state.gameOver,
|
||||
"state: " + state.getState(),
|
||||
!Net.server() ? clientDebug.getOut() : serverDebug.getOut()
|
||||
"state: " + state.getState()
|
||||
);
|
||||
|
||||
result.append("players: ");
|
||||
|
||||
@@ -213,7 +213,7 @@ public class HudFragment implements Fragment{
|
||||
new table(){{
|
||||
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();
|
||||
|
||||
|
||||
@@ -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-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);
|
||||
|
||||
@@ -123,10 +123,7 @@ public class MenuFragment implements Fragment{
|
||||
ui.showInfo("$text.multiplayer.web");
|
||||
}
|
||||
}));
|
||||
dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> {
|
||||
control.playMap(world.maps().getByName("tutorial"));
|
||||
dialog.hide();
|
||||
}));
|
||||
dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> {}));
|
||||
|
||||
dialog.content().row();
|
||||
|
||||
|
||||
@@ -16,7 +16,12 @@ public class ColorMapper{
|
||||
|
||||
private static ObjectIntMap<Block> reverseColors = new ObjectIntMap<>();
|
||||
private static Array<BlockPair> pairs = new Array<>();
|
||||
private static IntMap<BlockPair> colors = map(
|
||||
private static IntMap<BlockPair> colors;
|
||||
|
||||
private static void init(){
|
||||
if(colors != null) return;
|
||||
|
||||
colors = map(
|
||||
"323232", pair(Blocks.stone),
|
||||
"646464", pair(Blocks.stone, Blocks.stoneblock),
|
||||
"50965a", pair(Blocks.grass),
|
||||
@@ -39,28 +44,20 @@ public class ColorMapper{
|
||||
"83bc58", pair(Blocks.thorium),
|
||||
"000000", pair(Blocks.space)
|
||||
);
|
||||
}
|
||||
|
||||
public static BlockPair get(int color){
|
||||
init();
|
||||
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(){
|
||||
init();
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public static int getColor(Block block){
|
||||
init();
|
||||
return reverseColors.get(block, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.anuke.mindustry.world;
|
||||
|
||||
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.StorageBlocks;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
@@ -14,12 +13,6 @@ import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
|
||||
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.*/
|
||||
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.ucore.util.Strings;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -42,9 +40,9 @@ public class CrashHandler {
|
||||
}
|
||||
|
||||
try{
|
||||
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 to generate crash report.\nPlease send an image of this crash log to the developer!"));
|
||||
//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 to generate crash report.\nPlease send an image of this crash log to the developer!"));
|
||||
}catch (Throwable i){
|
||||
i.printStackTrace();
|
||||
//what now?
|
||||
|
||||
@@ -6,14 +6,12 @@ import club.minnced.discord.rpc.DiscordRichPresence;
|
||||
import com.badlogic.gdx.utils.Base64Coder;
|
||||
import io.anuke.kryonet.DefaultThreadImpl;
|
||||
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.ThreadHandler.ThreadProvider;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.ucore.core.Settings;
|
||||
import io.anuke.ucore.util.OS;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.net.NetworkInterface;
|
||||
import java.text.DateFormat;
|
||||
import java.text.NumberFormat;
|
||||
@@ -26,7 +24,7 @@ import java.util.Random;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
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 DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
||||
String[] args;
|
||||
@@ -52,7 +50,7 @@ public class DesktopPlatform extends Platform {
|
||||
|
||||
@Override
|
||||
public void showError(String text){
|
||||
JOptionPane.showMessageDialog(null, text);
|
||||
//JOptionPane.showMessageDialog(null, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -157,7 +157,6 @@ public class KryoServer implements ServerProvider {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
UCore.setPrivate(server, "shutdown", true);
|
||||
connections.clear();
|
||||
lastconnection = 0;
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package io.anuke.mindustry.server;
|
||||
|
||||
import io.anuke.mindustry.core.Logic;
|
||||
import io.anuke.mindustry.core.NetCommon;
|
||||
import io.anuke.mindustry.core.NetServer;
|
||||
import io.anuke.mindustry.core.World;
|
||||
import io.anuke.mindustry.core.ContentLoader;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.*;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
import io.anuke.ucore.modules.ModuleCore;
|
||||
|
||||
@@ -19,6 +16,8 @@ public class MindustryServer extends ModuleCore {
|
||||
|
||||
@Override
|
||||
public void init(){
|
||||
Vars.init();
|
||||
|
||||
headless = true;
|
||||
|
||||
BundleLoader.load();
|
||||
|
||||
Reference in New Issue
Block a user