Formatting

This commit is contained in:
Anuken
2018-07-12 20:37:14 -04:00
parent a3bda3a941
commit baaeb229cf
379 changed files with 17470 additions and 16215 deletions

View File

@@ -9,7 +9,7 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.type.ContentList;
public class AmmoTypes implements ContentList {
public class AmmoTypes implements ContentList{
public static AmmoType bulletTungsten, bulletLead, bulletCarbide, bulletThorium, bulletSilicon, bulletPyratite,
shotgunTungsten, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile,
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
@@ -17,41 +17,41 @@ public class AmmoTypes implements ContentList {
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
@Override
public void load() {
public void load(){
//weapon specific
shotgunTungsten = new AmmoType(Items.tungsten, WeaponBullets.tungstenShotgun, 2) {{
shotgunTungsten = new AmmoType(Items.tungsten, WeaponBullets.tungstenShotgun, 2){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
recoil = 1f;
}};
shellCarbide = new AmmoType(Items.carbide, WeaponBullets.shellCarbide, 2) {{
shellCarbide = new AmmoType(Items.carbide, WeaponBullets.shellCarbide, 2){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
bombExplosive = new AmmoType(Items.blastCompound, WeaponBullets.bombExplosive, 3) {{
bombExplosive = new AmmoType(Items.blastCompound, WeaponBullets.bombExplosive, 3){{
shootEffect = Fx.none;
smokeEffect = Fx.none;
}};
bombIncendiary = new AmmoType(Items.pyratite, WeaponBullets.bombIncendiary, 3) {{
bombIncendiary = new AmmoType(Items.pyratite, WeaponBullets.bombIncendiary, 3){{
shootEffect = Fx.none;
smokeEffect = Fx.none;
}};
bombOil = new AmmoType(Items.coal, WeaponBullets.bombOil, 3) {{
bombOil = new AmmoType(Items.coal, WeaponBullets.bombOil, 3){{
shootEffect = Fx.none;
smokeEffect = Fx.none;
}};
flamerThermite = new AmmoType(Items.pyratite, TurretBullets.basicFlame, 3) {{
flamerThermite = new AmmoType(Items.pyratite, TurretBullets.basicFlame, 3){{
shootEffect = ShootFx.shootSmallFlame;
}};
weaponMissile = new AmmoType(Items.carbide, MissileBullets.javelin, 2) {{
weaponMissile = new AmmoType(Items.carbide, MissileBullets.javelin, 2){{
shootEffect = BulletFx.hitBulletSmall;
smokeEffect = Fx.none;
reloadMultiplier = 1.2f;
@@ -59,37 +59,37 @@ public class AmmoTypes implements ContentList {
//bullets
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
reloadMultiplier = 1.6f;
inaccuracy = 5f;
}};
bulletTungsten = new AmmoType(Items.tungsten, StandardBullets.tungsten, 2) {{
bulletTungsten = new AmmoType(Items.tungsten, StandardBullets.tungsten, 2){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
reloadMultiplier = 0.8f;
}};
bulletCarbide = new AmmoType(Items.carbide, StandardBullets.carbide, 2) {{
bulletCarbide = new AmmoType(Items.carbide, StandardBullets.carbide, 2){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
reloadMultiplier = 0.6f;
}};
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 2) {{
bulletThorium = new AmmoType(Items.thorium, StandardBullets.thorium, 2){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
}};
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5) {{
bulletSilicon = new AmmoType(Items.silicon, StandardBullets.homing, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
reloadMultiplier = 1.4f;
}};
bulletPyratite = new AmmoType(Items.pyratite, StandardBullets.tracer, 3) {{
bulletPyratite = new AmmoType(Items.pyratite, StandardBullets.tracer, 3){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
inaccuracy = 3f;
@@ -97,71 +97,71 @@ public class AmmoTypes implements ContentList {
//flak
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5) {{
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5) {{
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5) {{
flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5) {{
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
shootEffect = ShootFx.shootSmall;
smokeEffect = ShootFx.shootSmallSmoke;
}};
//missiles
missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1) {{
missileExplosive = new AmmoType(Items.blastCompound, MissileBullets.explosive, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.2f;
}};
missileIncindiary = new AmmoType(Items.pyratite, MissileBullets.incindiary, 1) {{
missileIncindiary = new AmmoType(Items.pyratite, MissileBullets.incindiary, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.0f;
}};
missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1) {{
missileSurge = new AmmoType(Items.surgealloy, MissileBullets.surge, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}};
//artillery
artilleryCarbide = new AmmoType(Items.carbide, ArtilleryBullets.carbide, 2) {{
artilleryCarbide = new AmmoType(Items.carbide, ArtilleryBullets.carbide, 2){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
}};
artilleryPlastic = new AmmoType(Items.plastanium, ArtilleryBullets.plastic, 2) {{
artilleryPlastic = new AmmoType(Items.plastanium, ArtilleryBullets.plastic, 2){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.4f;
}};
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1) {{
artilleryHoming = new AmmoType(Items.silicon, ArtilleryBullets.homing, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 0.9f;
}};
artilleryIncindiary = new AmmoType(Items.pyratite, ArtilleryBullets.incindiary, 2) {{
artilleryIncindiary = new AmmoType(Items.pyratite, ArtilleryBullets.incindiary, 2){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.2f;
}};
artilleryExplosive = new AmmoType(Items.blastCompound, ArtilleryBullets.explosive, 1) {{
artilleryExplosive = new AmmoType(Items.blastCompound, ArtilleryBullets.explosive, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.6f;
@@ -169,7 +169,7 @@ public class AmmoTypes implements ContentList {
//flame
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f) {{
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f){{
shootEffect = ShootFx.shootSmallFlame;
}};
@@ -198,7 +198,7 @@ public class AmmoTypes implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return AmmoType.all();
}
}

View File

@@ -12,41 +12,41 @@ public class Items implements ContentList{
biomatter, sand, blastCompound, pyratite;
@Override
public void load() {
public void load(){
stone = new Item("stone", Color.valueOf("777777")) {{
stone = new Item("stone", Color.valueOf("777777")){{
hardness = 3;
}};
tungsten = new Item("tungsten", Color.valueOf("a0b0c8")) {{
tungsten = new Item("tungsten", Color.valueOf("a0b0c8")){{
type = ItemType.material;
hardness = 1;
cost = 0.75f;
}};
lead = new Item("lead", Color.valueOf("8e85a2")) {{
lead = new Item("lead", Color.valueOf("8e85a2")){{
type = ItemType.material;
hardness = 1;
cost = 0.6f;
}};
coal = new Item("coal", Color.valueOf("272727")) {{
coal = new Item("coal", Color.valueOf("272727")){{
explosiveness = 0.2f;
flammability = 0.5f;
hardness = 2;
}};
carbide = new Item("carbide", Color.valueOf("e2e2e2")) {{
carbide = new Item("carbide", Color.valueOf("e2e2e2")){{
type = ItemType.material;
}};
titanium = new Item("titanium", Color.valueOf("8da1e3")) {{
titanium = new Item("titanium", Color.valueOf("8da1e3")){{
type = ItemType.material;
hardness = 3;
cost = 1.1f;
}};
thorium = new Item("thorium", Color.valueOf("f9a3c7")) {{
thorium = new Item("thorium", Color.valueOf("f9a3c7")){{
type = ItemType.material;
explosiveness = 0.1f;
hardness = 4;
@@ -54,49 +54,49 @@ public class Items implements ContentList{
cost = 1.2f;
}};
silicon = new Item("silicon", Color.valueOf("53565c")) {{
silicon = new Item("silicon", Color.valueOf("53565c")){{
type = ItemType.material;
cost = 0.9f;
}};
plastanium = new Item("plastanium", Color.valueOf("e9ead3")) {{
plastanium = new Item("plastanium", Color.valueOf("e9ead3")){{
type = ItemType.material;
flammability = 0.1f;
explosiveness = 0.1f;
cost = 1.5f;
}};
phasematter = new Item("phase-matter", Color.valueOf("f4ba6e")) {{
phasematter = new Item("phase-matter", Color.valueOf("f4ba6e")){{
type = ItemType.material;
cost = 1.5f;
}};
surgealloy = new Item("surge-alloy", Color.valueOf("b4d5c7")) {{
surgealloy = new Item("surge-alloy", Color.valueOf("b4d5c7")){{
type = ItemType.material;
}};
biomatter = new Item("biomatter", Color.valueOf("648b55")) {{
biomatter = new Item("biomatter", Color.valueOf("648b55")){{
flammability = 0.4f;
fluxiness = 0.2f;
}};
sand = new Item("sand", Color.valueOf("e3d39e")) {{
sand = new Item("sand", Color.valueOf("e3d39e")){{
fluxiness = 0.5f;
}};
blastCompound = new Item("blast-compound", Color.valueOf("ff795e")) {{
blastCompound = new Item("blast-compound", Color.valueOf("ff795e")){{
flammability = 0.2f;
explosiveness = 0.6f;
}};
pyratite = new Item("pyratite", Color.valueOf("ffaa5f")) {{
pyratite = new Item("pyratite", Color.valueOf("ffaa5f")){{
flammability = 0.7f;
explosiveness = 0.2f;
}};
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Item.all();
}
}

View File

@@ -6,13 +6,13 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Liquid;
public class Liquids implements ContentList {
public class Liquids implements ContentList{
public static Liquid water, lava, oil, cryofluid;
@Override
public void load() {
public void load(){
water = new Liquid("water", Color.valueOf("486acd")) {
water = new Liquid("water", Color.valueOf("486acd")){
{
heatCapacity = 0.4f;
tier = 0;
@@ -20,7 +20,7 @@ public class Liquids implements ContentList {
}
};
lava = new Liquid("lava", Color.valueOf("e37341")) {
lava = new Liquid("lava", Color.valueOf("e37341")){
{
temperature = 0.8f;
viscosity = 0.8f;
@@ -29,7 +29,7 @@ public class Liquids implements ContentList {
}
};
oil = new Liquid("oil", Color.valueOf("313131")) {
oil = new Liquid("oil", Color.valueOf("313131")){
{
viscosity = 0.7f;
flammability = 0.6f;
@@ -39,7 +39,7 @@ public class Liquids implements ContentList {
}
};
cryofluid = new Liquid("cryofluid", Color.SKY) {
cryofluid = new Liquid("cryofluid", Color.SKY){
{
heatCapacity = 0.9f;
temperature = 0.25f;
@@ -50,7 +50,7 @@ public class Liquids implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Liquid.all();
}
}

View File

@@ -8,14 +8,16 @@ import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.type.Upgrade;
public class Mechs implements ContentList {
public class Mechs implements ContentList{
public static Mech alpha, delta, tau, omega, dart, javelin, trident, halberd;
/**These are not new mechs, just re-assignments for convenience.*/
/**
* These are not new mechs, just re-assignments for convenience.
*/
public static Mech starterDesktop, starterMobile;
@Override
public void load() {
public void load(){
alpha = new Mech("alpha-mech", false){{
drillPower = 1;
@@ -85,7 +87,7 @@ public class Mechs implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Upgrade.all();
}
}

View File

@@ -12,19 +12,19 @@ import static io.anuke.mindustry.type.Category.*;
public class Recipes implements ContentList{
@Override
public void load (){
public void load(){
//WALLS
new Recipe(defense, DefenseBlocks.tungstenWall, new ItemStack(Items.tungsten, 12));
new Recipe(defense, DefenseBlocks.tungstenWallLarge, new ItemStack(Items.tungsten, 12*4));
new Recipe(defense, DefenseBlocks.tungstenWallLarge, new ItemStack(Items.tungsten, 12 * 4));
new Recipe(defense, DefenseBlocks.carbideWall, new ItemStack(Items.carbide, 12));
new Recipe(defense, DefenseBlocks.carbideWallLarge, new ItemStack(Items.carbide, 12*4));
new Recipe(defense, DefenseBlocks.carbideWallLarge, new ItemStack(Items.carbide, 12 * 4));
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12*4));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.carbide, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.carbide, 12*4), new ItemStack(Items.silicon, 8*4));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.carbide, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
//TURRETS
new Recipe(weapon, TurretBlocks.duo, new ItemStack(Items.tungsten, 40));
@@ -171,7 +171,6 @@ public class Recipes implements ContentList{
new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.titanium, 40), new ItemStack(Items.surgealloy, 40));*/
//new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.carbide, 1));
@@ -282,7 +281,7 @@ public class Recipes implements ContentList{
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Recipe.all();
}
}

View File

@@ -3,30 +3,30 @@ package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.fx.EnvironmentFx;
import io.anuke.mindustry.entities.StatusController.StatusEntry;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.StatusEffect;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.StatusEffect;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
public class StatusEffects implements ContentList {
public class StatusEffects implements ContentList{
public static StatusEffect none, burning, freezing, wet, melting, tarred, overdrive, shielded;
@Override
public void load() {
public void load(){
none = new StatusEffect(0);
burning = new StatusEffect(4 * 60f) {
burning = new StatusEffect(4 * 60f){
{
oppositeScale = 0.5f;
}
@Override
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result) {
if (to == tarred) {
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){
if(to == tarred){
unit.damage(1f);
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
return result.set(this, Math.min(time + newTime, baseDuration + tarred.baseDuration));
@@ -36,45 +36,45 @@ public class StatusEffects implements ContentList {
}
@Override
public void update(Unit unit, float time) {
public void update(Unit unit, float time){
unit.damagePeriodic(0.04f);
if (Mathf.chance(Timers.delta() * 0.2f)) {
if(Mathf.chance(Timers.delta() * 0.2f)){
Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
};
freezing = new StatusEffect(5 * 60f) {
freezing = new StatusEffect(5 * 60f){
{
oppositeScale = 0.4f;
speedMultiplier = 0.7f;
}
@Override
public void update(Unit unit, float time) {
public void update(Unit unit, float time){
if (Mathf.chance(Timers.delta() * 0.15f)) {
if(Mathf.chance(Timers.delta() * 0.15f)){
Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
};
wet = new StatusEffect(3 * 60f) {
wet = new StatusEffect(3 * 60f){
{
oppositeScale = 0.5f;
speedMultiplier = 0.999f;
}
@Override
public void update(Unit unit, float time) {
if (Mathf.chance(Timers.delta() * 0.15f)) {
public void update(Unit unit, float time){
if(Mathf.chance(Timers.delta() * 0.15f)){
Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
};
melting = new StatusEffect(5 * 60f) {
melting = new StatusEffect(5 * 60f){
{
oppositeScale = 0.2f;
speedMultiplier = 0.8f;
@@ -82,8 +82,8 @@ public class StatusEffects implements ContentList {
}
@Override
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result) {
if (to == tarred) {
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){
if(to == tarred){
return result.set(this, Math.min(time + newTime / 2f, baseDuration));
}
@@ -91,30 +91,30 @@ public class StatusEffects implements ContentList {
}
@Override
public void update(Unit unit, float time) {
public void update(Unit unit, float time){
unit.damagePeriodic(0.3f);
if (Mathf.chance(Timers.delta() * 0.2f)) {
if(Mathf.chance(Timers.delta() * 0.2f)){
Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
};
tarred = new StatusEffect(4 * 60f) {
tarred = new StatusEffect(4 * 60f){
{
speedMultiplier = 0.6f;
}
@Override
public void update(Unit unit, float time) {
if (Mathf.chance(Timers.delta() * 0.15f)) {
public void update(Unit unit, float time){
if(Mathf.chance(Timers.delta() * 0.15f)){
Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
}
}
@Override
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result) {
if (to == melting || to == burning) {
public StatusEntry getTransition(Unit unit, StatusEffect to, float time, float newTime, StatusEntry result){
if(to == melting || to == burning){
return result.set(to, newTime + time);
}
@@ -122,7 +122,7 @@ public class StatusEffects implements ContentList {
}
};
overdrive = new StatusEffect(6f) {
overdrive = new StatusEffect(6f){
{
armorMultiplier = 0.95f;
speedMultiplier = 1.05f;
@@ -130,13 +130,13 @@ public class StatusEffects implements ContentList {
}
@Override
public void update(Unit unit, float time) {
public void update(Unit unit, float time){
//idle regen boosted
unit.health += 0.01f * Timers.delta();
}
};
shielded = new StatusEffect(6f) {
shielded = new StatusEffect(6f){
{
armorMultiplier = 3f;
}
@@ -149,7 +149,7 @@ public class StatusEffects implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return StatusEffect.all();
}
}

View File

@@ -6,11 +6,11 @@ import io.anuke.mindustry.entities.units.types.*;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
public class UnitTypes implements ContentList {
public class UnitTypes implements ContentList{
public static UnitType drone, scout, vtol, monsoon, titan, fabricator;
@Override
public void load() {
public void load(){
drone = new UnitType("drone", Drone.class, Drone::new){{
isFlying = true;
drag = 0.01f;
@@ -73,7 +73,7 @@ public class UnitTypes implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return UnitType.all();
}
}

View File

@@ -8,13 +8,13 @@ import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Upgrade;
import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList {
public class Weapons implements ContentList{
public static Weapon blaster, chainBlaster, shockgun, sapper, swarmer, bomber, flakgun, flamethrower, missiles;
@Override
public void load() {
public void load(){
blaster = new Weapon("blaster") {{
blaster = new Weapon("blaster"){{
length = 1.5f;
reload = 15f;
roundrobin = true;
@@ -22,7 +22,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletLead);
}};
missiles = new Weapon("missiles") {{
missiles = new Weapon("missiles"){{
length = 1.5f;
reload = 40f;
shots = 2;
@@ -33,7 +33,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.weaponMissile);
}};
chainBlaster = new Weapon("chain-blaster") {{
chainBlaster = new Weapon("chain-blaster"){{
length = 1.5f;
reload = 30f;
roundrobin = true;
@@ -41,7 +41,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletTungsten, AmmoTypes.bulletSilicon, AmmoTypes.bulletThorium);
}};
shockgun = new Weapon("shockgun") {{
shockgun = new Weapon("shockgun"){{
length = 1f;
reload = 50f;
roundrobin = true;
@@ -53,7 +53,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.shotgunTungsten);
}};
flakgun = new Weapon("flakgun") {{
flakgun = new Weapon("flakgun"){{
length = 1f;
reload = 70f;
roundrobin = true;
@@ -65,7 +65,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.shellCarbide);
}};
flamethrower = new Weapon("flamethrower") {{
flamethrower = new Weapon("flamethrower"){{
length = 1f;
reload = 14f;
roundrobin = true;
@@ -74,7 +74,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.flamerThermite);
}};
sapper = new Weapon("sapper") {{
sapper = new Weapon("sapper"){{
length = 1.5f;
reload = 12f;
roundrobin = true;
@@ -82,7 +82,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletCarbide);
}};
swarmer = new Weapon("swarmer") {{
swarmer = new Weapon("swarmer"){{
length = 1.5f;
reload = 10f;
roundrobin = true;
@@ -90,7 +90,7 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletPyratite);
}};
bomber = new Weapon("bomber") {{
bomber = new Weapon("bomber"){{
length = 0f;
width = 2f;
reload = 5f;
@@ -103,7 +103,7 @@ public class Weapons implements ContentList {
}
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Upgrade.all();
}
}

View File

@@ -5,10 +5,10 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.world.Block;
public abstract class BlockList implements ContentList {
public abstract class BlockList implements ContentList{
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Block.all();
}
}

View File

@@ -15,26 +15,31 @@ public class Blocks extends BlockList implements ContentList{
public static Block air, spawn, blockpart, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock;
@Override
public void load() {
air = new Floor("air") {
public void load(){
air = new Floor("air"){
{
blend = false;
}
//don't draw
public void draw(Tile tile) {}
public void load() {}
public void init() {}
public void draw(Tile tile){
}
public void load(){
}
public void init(){
}
};
blockpart = new BlockPart();
for(int i = 1; i <= 6; i ++){
for(int i = 1; i <= 6; i++){
new BuildBlock("build" + i);
}
space = new Floor("space") {{
space = new Floor("space"){{
placeableOn = false;
variants = 0;
cacheLayer = CacheLayer.space;
@@ -43,11 +48,11 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("000001");
}};
metalfloor = new Floor("metalfloor") {{
metalfloor = new Floor("metalfloor"){{
variants = 6;
}};
deepwater = new Floor("deepwater") {{
deepwater = new Floor("deepwater"){{
liquidColor = Color.valueOf("546bb3");
speedMultiplier = 0.2f;
variants = 0;
@@ -60,7 +65,7 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("465a96");
}};
water = new Floor("water") {{
water = new Floor("water"){{
liquidColor = Color.valueOf("546bb3");
speedMultiplier = 0.5f;
variants = 0;
@@ -72,7 +77,7 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("506eb4");
}};
lava = new Floor("lava") {{
lava = new Floor("lava"){{
liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f;
damageTaken = 0.5f;
@@ -85,7 +90,7 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("ed5334");
}};
oil = new Floor("oil") {{
oil = new Floor("oil"){{
liquidColor = Color.valueOf("292929");
status = StatusEffects.tarred;
statusIntensity = 1f;
@@ -97,7 +102,7 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("292929");
}};
stone = new Floor("stone") {{
stone = new Floor("stone"){{
hasOres = true;
drops = new ItemStack(Items.stone, 1);
blends = block -> block != this && !(block instanceof Ore);
@@ -105,7 +110,7 @@ public class Blocks extends BlockList implements ContentList{
playerUnmineable = true;
}};
blackstone = new Floor("blackstone") {{
blackstone = new Floor("blackstone"){{
drops = new ItemStack(Items.stone, 1);
minimapColor = Color.valueOf("252525");
playerUnmineable = true;
@@ -115,14 +120,14 @@ public class Blocks extends BlockList implements ContentList{
minimapColor = Color.valueOf("6e501e");
}};
sand = new Floor("sand") {{
sand = new Floor("sand"){{
drops = new ItemStack(Items.sand, 1);
minimapColor = Color.valueOf("988a67");
hasOres = true;
playerUnmineable = true;
}};
ice = new Floor("ice") {{
ice = new Floor("ice"){{
dragMultiplier = 0.3f;
speedMultiplier = 0.4f;
minimapColor = Color.valueOf("c4e3e7");
@@ -143,15 +148,15 @@ public class Blocks extends BlockList implements ContentList{
shadow = "shrubshadow";
}};
rock = new Rock("rock") {{
rock = new Rock("rock"){{
variants = 2;
}};
icerock = new Rock("icerock") {{
icerock = new Rock("icerock"){{
variants = 2;
}};
blackrock = new Rock("blackrock") {{
blackrock = new Rock("blackrock"){{
variants = 1;
}};
}

View File

@@ -10,14 +10,14 @@ import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.production.*;
public class CraftingBlocks extends BlockList implements ContentList {
public class CraftingBlocks extends BlockList implements ContentList{
public static Block smelter, arcsmelter, siliconsmelter, plastaniumCompressor, phaseWeaver, alloysmelter, alloyfuser,
pyratiteMixer, blastMixer,
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, solidifier, incinerator;
@Override
public void load() {
smelter = new Smelter("smelter") {{
public void load(){
smelter = new Smelter("smelter"){{
health = 70;
result = Items.carbide;
craftTime = 45f;
@@ -28,7 +28,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.item(Items.coal);
}};
arcsmelter = new PowerSmelter("arc-smelter") {{
arcsmelter = new PowerSmelter("arc-smelter"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.carbide;
@@ -42,7 +42,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.1f);
}};
siliconsmelter = new PowerSmelter("silicon-smelter") {{
siliconsmelter = new PowerSmelter("silicon-smelter"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.silicon;
@@ -55,7 +55,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.05f);
}};
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor") {{
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
hasItems = true;
liquidCapacity = 60f;
craftTime = 80f;
@@ -72,7 +72,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.item(Items.titanium, 2);
}};
phaseWeaver = new PhaseWeaver("phase-weaver") {{
phaseWeaver = new PhaseWeaver("phase-weaver"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.phasematter;
@@ -83,7 +83,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.5f);
}};
alloysmelter = new PowerSmelter("alloy-smelter") {{
alloysmelter = new PowerSmelter("alloy-smelter"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.surgealloy;
@@ -97,7 +97,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.items(new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.plastanium, 2)});
}};
alloyfuser = new PowerSmelter("alloy-fuser") {{
alloyfuser = new PowerSmelter("alloy-fuser"){{
health = 90;
craftEffect = BlockFx.smeltsmoke;
result = Items.surgealloy;
@@ -111,7 +111,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.4f);
}};
cryofluidmixer = new LiquidMixer("cryofluidmixer") {{
cryofluidmixer = new LiquidMixer("cryofluidmixer"){{
health = 200;
outputLiquid = Liquids.cryofluid;
liquidPerItem = 50f;
@@ -124,7 +124,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.liquid(Liquids.water, 0.3f);
}};
blastMixer = new GenericCrafter("blast-mixer") {{
blastMixer = new GenericCrafter("blast-mixer"){{
itemCapacity = 20;
hasItems = true;
hasPower = true;
@@ -137,7 +137,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.04f);
}};
pyratiteMixer = new PowerSmelter("pyratite-mixer") {{
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
flameColor = Color.CLEAR;
itemCapacity = 20;
hasItems = true;
@@ -150,7 +150,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)});
}};
melter = new PowerCrafter("melter") {{
melter = new PowerCrafter("melter"){{
health = 200;
outputLiquid = Liquids.lava;
outputLiquidAmount = 0.75f;
@@ -162,7 +162,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.item(Items.stone, 2);
}};
separator = new Separator("separator") {{
separator = new Separator("separator"){{
results = new Item[]{
null, null, null, null, null, null, null, null, null, null,
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
@@ -180,7 +180,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.liquid(Liquids.water, 0.3f);
}};
centrifuge = new Separator("centrifuge") {{
centrifuge = new Separator("centrifuge"){{
results = new Item[]{
null, null, null, null, null, null, null, null, null, null, null, null, null,
Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand, Items.sand,
@@ -207,7 +207,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.liquid(Liquids.water, 0.5f);
}};
biomatterCompressor = new Compressor("biomattercompressor") {{
biomatterCompressor = new Compressor("biomattercompressor"){{
liquidCapacity = 60f;
itemCapacity = 50;
craftTime = 25f;
@@ -221,7 +221,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.06f);
}};
pulverizer = new Pulverizer("pulverizer") {{
pulverizer = new Pulverizer("pulverizer"){{
itemCapacity = 40;
output = Items.sand;
health = 80;
@@ -234,7 +234,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.power(0.2f);
}};
solidifier = new GenericCrafter("solidifer") {{
solidifier = new GenericCrafter("solidifer"){{
liquidCapacity = 21f;
craftTime = 14;
output = Items.stone;
@@ -246,7 +246,7 @@ public class CraftingBlocks extends BlockList implements ContentList {
consumes.liquid(Liquids.lava, 1f);
}};
incinerator = new Incinerator("incinerator") {{
incinerator = new Incinerator("incinerator"){{
health = 90;
}};
}

View File

@@ -28,45 +28,52 @@ import java.io.IOException;
public class DebugBlocks extends BlockList implements ContentList{
public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid;
@Remote(targets = Loc.both, called = Loc.both, in = In.blocks, forward = true)
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
LiquidSourceEntity entity = tile.entity();
entity.source = liquid;
}
@Override
public void load() {
powerVoid = new PowerBlock("powervoid") {
public void load(){
powerVoid = new PowerBlock("powervoid"){
{
powerCapacity = Float.MAX_VALUE;
}
};
powerInfinite = new PowerNode("powerinfinite") {
powerInfinite = new PowerNode("powerinfinite"){
{
powerCapacity = 10000f;
powerSpeed = 100f;
}
@Override
public void update(Tile tile) {
public void update(Tile tile){
super.update(tile);
tile.entity.power.amount = powerCapacity;
}
};
itemSource = new Sorter("itemsource") {
itemSource = new Sorter("itemsource"){
{
hasItems = true;
}
@Override
public void update(Tile tile) {
public void update(Tile tile){
SorterEntity entity = tile.entity();
entity.items.set(entity.sortItem, 1);
tryDump(tile, entity.sortItem);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source) {
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
};
liquidSource = new Block("liquidsource") {
liquidSource = new Block("liquidsource"){
{
update = true;
solid = true;
@@ -76,7 +83,7 @@ public class DebugBlocks extends BlockList implements ContentList{
}
@Override
public void update(Tile tile) {
public void update(Tile tile){
LiquidSourceEntity entity = tile.entity();
tile.entity.liquids.add(entity.source, liquidCapacity);
@@ -84,7 +91,7 @@ public class DebugBlocks extends BlockList implements ContentList{
}
@Override
public void draw(Tile tile) {
public void draw(Tile tile){
super.draw(tile);
LiquidSourceEntity entity = tile.entity();
@@ -95,7 +102,7 @@ public class DebugBlocks extends BlockList implements ContentList{
}
@Override
public void buildTable(Tile tile, Table table) {
public void buildTable(Tile tile, Table table){
LiquidSourceEntity entity = tile.entity();
Array<Liquid> items = Liquid.all();
@@ -103,8 +110,8 @@ public class DebugBlocks extends BlockList implements ContentList{
ButtonGroup<ImageButton> group = new ButtonGroup<>();
Table cont = new Table();
for (int i = 0; i < items.size; i++) {
if (i == 0) continue;
for(int i = 0; i < items.size; i++){
if(i == 0) continue;
final int f = i;
ImageButton button = cont.addImageButton("white", "toggle", 24, () -> {
CallBlocks.setLiquidSourceLiquid(null, tile, items.get(f));
@@ -112,7 +119,7 @@ public class DebugBlocks extends BlockList implements ContentList{
button.getStyle().imageUpColor = items.get(i).color;
button.setChecked(entity.source.id == f);
if (i % 4 == 3) {
if(i % 4 == 3){
cont.row();
}
}
@@ -121,43 +128,37 @@ public class DebugBlocks extends BlockList implements ContentList{
}
@Override
public TileEntity getEntity() {
public TileEntity getEntity(){
return new LiquidSourceEntity();
}
};
itemVoid = new Block("itemvoid") {
itemVoid = new Block("itemvoid"){
{
update = solid = true;
}
@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) {
public boolean acceptItem(Item item, Tile tile, Tile source){
return true;
}
};
}
@Remote(targets = Loc.both, called = Loc.both, in = In.blocks, forward = true)
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
LiquidSourceEntity entity = tile.entity();
entity.source = liquid;
}
class LiquidSourceEntity extends TileEntity {
class LiquidSourceEntity extends TileEntity{
public Liquid source = Liquids.water;
@Override
public void write(DataOutputStream stream) throws IOException {
public void write(DataOutputStream stream) throws IOException{
stream.writeByte(source.id);
}
@Override
public void read(DataInputStream stream) throws IOException {
public void read(DataInputStream stream) throws IOException{
source = Liquid.getByID(stream.readByte());
}
}

View File

@@ -8,65 +8,65 @@ import io.anuke.mindustry.world.blocks.defense.DeflectorWall;
import io.anuke.mindustry.world.blocks.defense.Door;
import io.anuke.mindustry.world.blocks.defense.PhaseWall;
public class DefenseBlocks extends BlockList implements ContentList {
public class DefenseBlocks extends BlockList implements ContentList{
public static Block tungstenWall, tungstenWallLarge, carbideWall, carbideWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, deflectorwall, deflectorwalllarge,
phasewall, phasewalllarge;
phasewall, phasewalllarge;
@Override
public void load() {
public void load(){
int wallHealthMultiplier = 4;
tungstenWall = new Wall("tungsten-wall") {{
tungstenWall = new Wall("tungsten-wall"){{
health = 80 * wallHealthMultiplier;
}};
tungstenWallLarge = new Wall("tungsten-wall-large") {{
tungstenWallLarge = new Wall("tungsten-wall-large"){{
health = 80 * 4 * wallHealthMultiplier;
size = 2;
}};
carbideWall = new Wall("carbide-wall") {{
carbideWall = new Wall("carbide-wall"){{
health = 110 * wallHealthMultiplier;
}};
carbideWallLarge = new Wall("carbide-wall-large") {{
health = 110 * wallHealthMultiplier*4;
carbideWallLarge = new Wall("carbide-wall-large"){{
health = 110 * wallHealthMultiplier * 4;
size = 2;
}};
thoriumWall = new Wall("thorium-wall") {{
thoriumWall = new Wall("thorium-wall"){{
health = 200 * wallHealthMultiplier;
}};
thoriumWallLarge = new Wall("thorium-wall-large") {{
health = 200 * wallHealthMultiplier*4;
thoriumWallLarge = new Wall("thorium-wall-large"){{
health = 200 * wallHealthMultiplier * 4;
size = 2;
}};
deflectorwall = new DeflectorWall("deflector-wall") {{
deflectorwall = new DeflectorWall("deflector-wall"){{
health = 150 * wallHealthMultiplier;
}};
deflectorwalllarge = new DeflectorWall("deflector-wall-large") {{
deflectorwalllarge = new DeflectorWall("deflector-wall-large"){{
health = 150 * 4 * wallHealthMultiplier;
size = 2;
}};
phasewall = new PhaseWall("phase-wall") {{
phasewall = new PhaseWall("phase-wall"){{
health = 150 * wallHealthMultiplier;
}};
phasewalllarge = new PhaseWall("phase-wall-large") {{
phasewalllarge = new PhaseWall("phase-wall-large"){{
health = 150 * 4 * wallHealthMultiplier;
size = 2;
regenSpeed = 0.5f;
}};
door = new Door("door") {{
door = new Door("door"){{
health = 100 * wallHealthMultiplier;
}};
doorLarge = new Door("door-large") {{
doorLarge = new Door("door-large"){{
openfx = BlockFx.dooropenlarge;
closefx = BlockFx.doorcloselarge;
health = 100 * 4 * wallHealthMultiplier;

View File

@@ -5,50 +5,50 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.distribution.*;
public class DistributionBlocks extends BlockList implements ContentList{
public static Block conveyor, titaniumconveyor, distributor, junction,
bridgeConveyor, phaseConveyor, sorter, splitter, overflowGate, massDriver;
public static Block conveyor, titaniumconveyor, distributor, junction,
bridgeConveyor, phaseConveyor, sorter, splitter, overflowGate, massDriver;
@Override
public void load() {
@Override
public void load(){
conveyor = new Conveyor("conveyor") {{
health = 45;
speed = 0.03f;
}};
conveyor = new Conveyor("conveyor"){{
health = 45;
speed = 0.03f;
}};
titaniumconveyor = new Conveyor("titanium-conveyor") {{
health = 65;
speed = 0.07f;
}};
titaniumconveyor = new Conveyor("titanium-conveyor"){{
health = 65;
speed = 0.07f;
}};
junction = new Junction("junction") {{
speed = 26;
capacity = 32;
}};
junction = new Junction("junction"){{
speed = 26;
capacity = 32;
}};
bridgeConveyor = new BufferedItemBridge("bridge-conveyor") {{
range = 3;
hasPower = false;
}};
bridgeConveyor = new BufferedItemBridge("bridge-conveyor"){{
range = 3;
hasPower = false;
}};
phaseConveyor = new ItemBridge("phase-conveyor") {{
range = 7;
}};
phaseConveyor = new ItemBridge("phase-conveyor"){{
range = 7;
}};
sorter = new Sorter("sorter");
sorter = new Sorter("sorter");
splitter = new Splitter("splitter");
splitter = new Splitter("splitter");
distributor = new Splitter("distributor") {{
size = 2;
}};
distributor = new Splitter("distributor"){{
size = 2;
}};
overflowGate = new OverflowGate("overflow-gate");
overflowGate = new OverflowGate("overflow-gate");
massDriver = new MassDriver("mass-driver"){{
size = 3;
itemCapacity = 80;
range = 300f;
}};
}
massDriver = new MassDriver("mass-driver"){{
size = 3;
itemCapacity = 80;
range = 300f;
}};
}
}

View File

@@ -9,15 +9,15 @@ public class LiquidBlocks extends BlockList implements ContentList{
public static Block mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidtank, liquidJunction, bridgeConduit, phaseConduit;
@Override
public void load() {
public void load(){
mechanicalPump = new Pump("mechanical-pump") {{
mechanicalPump = new Pump("mechanical-pump"){{
shadow = "shadow-round-1";
pumpAmount = 0.1f;
tier = 0;
}};
rotaryPump = new Pump("rotary-pump") {{
rotaryPump = new Pump("rotary-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.25f;
consumes.power(0.015f);
@@ -27,7 +27,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
tier = 1;
}};
thermalPump = new Pump("thermal-pump") {{
thermalPump = new Pump("thermal-pump"){{
pumpAmount = 0.3f;
consumes.power(0.05f);
liquidCapacity = 40f;
@@ -35,21 +35,21 @@ public class LiquidBlocks extends BlockList implements ContentList{
tier = 2;
}};
conduit = new Conduit("conduit") {{
conduit = new Conduit("conduit"){{
health = 45;
}};
pulseConduit = new Conduit("pulse-conduit") {{
pulseConduit = new Conduit("pulse-conduit"){{
liquidCapacity = 16f;
liquidFlowFactor = 4.9f;
health = 90;
}};
liquidRouter = new LiquidRouter("liquid-router") {{
liquidRouter = new LiquidRouter("liquid-router"){{
liquidCapacity = 40f;
}};
liquidtank = new LiquidRouter("liquid-tank") {{
liquidtank = new LiquidRouter("liquid-tank"){{
size = 3;
liquidCapacity = 1500f;
health = 500;
@@ -57,12 +57,12 @@ public class LiquidBlocks extends BlockList implements ContentList{
liquidJunction = new LiquidJunction("liquid-junction");
bridgeConduit = new LiquidExtendingBridge("bridge-conduit") {{
bridgeConduit = new LiquidExtendingBridge("bridge-conduit"){{
range = 3;
hasPower = false;
}};
phaseConduit = new LiquidBridge("phase-conduit") {{
phaseConduit = new LiquidBridge("phase-conduit"){{
range = 7;
}};
}

View File

@@ -7,11 +7,18 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.OreBlock;
public class OreBlocks extends BlockList {
public class OreBlocks extends BlockList{
private static final ObjectMap<Item, ObjectMap<Block, Block>> oreBlockMap = new ObjectMap<>();
public static Block get(Block floor, Item item){
if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!");
if(!oreBlockMap.get(item).containsKey(floor))
throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!");
return oreBlockMap.get(item).get(floor);
}
@Override
public void load() {
public void load(){
Item[] ores = {Items.tungsten, Items.lead, Items.coal, Items.titanium, Items.thorium};
for(Item item : ores){
@@ -25,10 +32,4 @@ public class OreBlocks extends BlockList {
}
}
}
public static Block get(Block floor, Item item){
if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!");
if(!oreBlockMap.get(item).containsKey(floor)) throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!");
return oreBlockMap.get(item).get(floor);
}
}

View File

@@ -7,19 +7,19 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.distribution.WarpGate;
import io.anuke.mindustry.world.blocks.power.*;
public class PowerBlocks extends BlockList implements ContentList {
public class PowerBlocks extends BlockList implements ContentList{
public static Block combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel,
nuclearReactor, fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, warpGate;
@Override
public void load() {
combustionGenerator = new BurnerGenerator("combustion-generator") {{
public void load(){
combustionGenerator = new BurnerGenerator("combustion-generator"){{
powerOutput = 0.09f;
powerCapacity = 40f;
itemDuration = 40f;
}};
thermalGenerator = new LiquidHeatGenerator("thermal-generator") {{
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
maxLiquidGenerate = 0.5f;
powerPerLiquid = 0.08f;
powerCapacity = 40f;
@@ -28,7 +28,7 @@ public class PowerBlocks extends BlockList implements ContentList {
size = 2;
}};
turbineGenerator = new TurbineGenerator("turbine-generator") {{
turbineGenerator = new TurbineGenerator("turbine-generator"){{
powerOutput = 0.28f;
powerCapacity = 40f;
itemDuration = 30f;
@@ -37,46 +37,46 @@ public class PowerBlocks extends BlockList implements ContentList {
size = 2;
}};
rtgGenerator = new DecayGenerator("rtg-generator") {{
rtgGenerator = new DecayGenerator("rtg-generator"){{
powerCapacity = 40f;
powerOutput = 0.02f;
itemDuration = 500f;
}};
solarPanel = new SolarGenerator("solar-panel") {{
solarPanel = new SolarGenerator("solar-panel"){{
generation = 0.0045f;
}};
largeSolarPanel = new SolarGenerator("solar-panel-large") {{
largeSolarPanel = new SolarGenerator("solar-panel-large"){{
size = 3;
generation = 0.055f;
}};
nuclearReactor = new NuclearReactor("nuclear-reactor") {{
nuclearReactor = new NuclearReactor("nuclear-reactor"){{
size = 3;
health = 700;
powerMultiplier = 0.8f;
}};
fusionReactor = new FusionReactor("fusion-reactor") {{
fusionReactor = new FusionReactor("fusion-reactor"){{
size = 4;
health = 600;
}};
battery = new PowerDistributor("battery") {{
battery = new PowerDistributor("battery"){{
powerCapacity = 320f;
}};
batteryLarge = new PowerDistributor("battery-large") {{
batteryLarge = new PowerDistributor("battery-large"){{
size = 3;
powerCapacity = 2000f;
}};
powerNode = new PowerNode("power-node") {{
powerNode = new PowerNode("power-node"){{
shadow = "shadow-round-1";
}};
powerNodeLarge = new PowerNode("power-node-large") {{
powerNodeLarge = new PowerNode("power-node-large"){{
size = 2;
powerSpeed = 1f;
maxNodes = 5;

View File

@@ -11,22 +11,22 @@ import io.anuke.mindustry.world.blocks.production.Drill;
import io.anuke.mindustry.world.blocks.production.Fracker;
import io.anuke.mindustry.world.blocks.production.SolidPump;
public class ProductionBlocks extends BlockList implements ContentList {
public class ProductionBlocks extends BlockList implements ContentList{
public static Block tungstenDrill, carbideDrill, laserdrill, blastdrill, plasmadrill, waterextractor, oilextractor, cultivator;
@Override
public void load() {
tungstenDrill = new Drill("tungsten-drill") {{
public void load(){
tungstenDrill = new Drill("tungsten-drill"){{
tier = 2;
drillTime = 340;
}};
carbideDrill = new Drill("carbide-drill") {{
carbideDrill = new Drill("carbide-drill"){{
tier = 3;
drillTime = 280;
}};
laserdrill = new Drill("laser-drill") {{
laserdrill = new Drill("laser-drill"){{
drillTime = 180;
size = 2;
hasPower = true;
@@ -37,7 +37,7 @@ public class ProductionBlocks extends BlockList implements ContentList {
consumes.power(0.2f);
}};
blastdrill = new Drill("blast-drill") {{
blastdrill = new Drill("blast-drill"){{
drillTime = 120;
size = 3;
drawRim = true;
@@ -52,7 +52,7 @@ public class ProductionBlocks extends BlockList implements ContentList {
consumes.power(0.5f);
}};
plasmadrill = new Drill("plasma-drill") {{
plasmadrill = new Drill("plasma-drill"){{
heatColor = Color.valueOf("ff461b");
drillTime = 90;
size = 4;
@@ -69,7 +69,7 @@ public class ProductionBlocks extends BlockList implements ContentList {
consumes.power(0.7f);
}};
waterextractor = new SolidPump("water-extractor") {{
waterextractor = new SolidPump("water-extractor"){{
result = Liquids.water;
pumpAmount = 0.1f;
size = 2;
@@ -79,7 +79,7 @@ public class ProductionBlocks extends BlockList implements ContentList {
consumes.power(0.2f);
}};
oilextractor = new Fracker("oil-extractor") {{
oilextractor = new Fracker("oil-extractor"){{
result = Liquids.oil;
updateEffect = BlockFx.pulverize;
liquidCapacity = 50f;
@@ -93,7 +93,7 @@ public class ProductionBlocks extends BlockList implements ContentList {
consumes.liquid(Liquids.water, 0.3f);
}};
cultivator = new Cultivator("cultivator") {{
cultivator = new Cultivator("cultivator"){{
result = Items.biomatter;
drillTime = 260;
size = 2;

View File

@@ -7,26 +7,26 @@ import io.anuke.mindustry.world.blocks.storage.SortedUnloader;
import io.anuke.mindustry.world.blocks.storage.Unloader;
import io.anuke.mindustry.world.blocks.storage.Vault;
public class StorageBlocks extends BlockList implements ContentList {
public class StorageBlocks extends BlockList implements ContentList{
public static Block core, vault, unloader, sortedunloader;
@Override
public void load() {
core = new CoreBlock("core") {{
public void load(){
core = new CoreBlock("core"){{
health = 800;
}};
vault = new Vault("vault") {{
vault = new Vault("vault"){{
size = 3;
health = 600;
itemCapacity = 2000;
}};
unloader = new Unloader("unloader") {{
unloader = new Unloader("unloader"){{
speed = 5;
}};
sortedunloader = new SortedUnloader("sortedunloader") {{
sortedunloader = new SortedUnloader("sortedunloader"){{
speed = 5;
}};
}

View File

@@ -12,22 +12,23 @@ import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Strings;
public class TurretBlocks extends BlockList implements ContentList {
public static Block duo, /*scatter,*/ scorch, hail, wave, lancer, arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown;
public class TurretBlocks extends BlockList implements ContentList{
public static Block duo, /*scatter,*/
scorch, hail, wave, lancer, arc, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown;
@Override
public void load() {
duo = new DoubleTurret("duo") {{
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
range = 90f;
shootCone = 15f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 80;
inaccuracy = 2f;
rotatespeed = 10f;
}};
@Override
public void load(){
duo = new DoubleTurret("duo"){{
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
range = 90f;
shootCone = 15f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 80;
inaccuracy = 2f;
rotatespeed = 10f;
}};
/*
scatter = new BurstTurret("scatter") {{
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic};
@@ -41,165 +42,165 @@ public class TurretBlocks extends BlockList implements ContentList {
ammoUseEffect = ShootFx.shellEjectSmall;
}};*/
hail = new ArtilleryTurret("hail") {{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
reload = 100f;
recoil = 2f;
range = 200f;
inaccuracy = 5f;
health = 120;
}};
hail = new ArtilleryTurret("hail"){{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary};
reload = 100f;
recoil = 2f;
range = 200f;
inaccuracy = 5f;
health = 120;
}};
scorch = new LiquidTurret("scorch") {{
scorch = new LiquidTurret("scorch"){{
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
recoil = 0f;
reload = 4f;
shootCone = 50f;
ammoUseEffect = ShootFx.shellEjectSmall;
health = 160;
health = 160;
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}};
wave = new LiquidTurret("wave") {{
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
size = 2;
recoil = 0f;
reload = 4f;
inaccuracy = 5f;
shootCone = 50f;
shootEffect = ShootFx.shootLiquid;
range = 70f;
health = 360;
wave = new LiquidTurret("wave"){{
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
size = 2;
recoil = 0f;
reload = 4f;
inaccuracy = 5f;
shootCone = 50f;
shootEffect = ShootFx.shootLiquid;
range = 70f;
health = 360;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color(entity.liquids.current().color);
Draw.alpha(entity.liquids.total() / liquidCapacity);
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color();
};
}};
Draw.color(entity.liquids.current().color);
Draw.alpha(entity.liquids.total() / liquidCapacity);
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color();
};
}};
lancer = new LaserTurret("lancer") {{
range = 90f;
chargeTime = 60f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = AmmoTypes.lancerLaser;
recoil = 2f;
reload = 100f;
cooldown = 0.03f;
powerUsed = 20f;
powerCapacity = 60f;
shootShake = 2f;
shootEffect = ShootFx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke;
chargeEffect = ShootFx.lancerLaserCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
health = 320;
}};
lancer = new LaserTurret("lancer"){{
range = 90f;
chargeTime = 60f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = AmmoTypes.lancerLaser;
recoil = 2f;
reload = 100f;
cooldown = 0.03f;
powerUsed = 20f;
powerCapacity = 60f;
shootShake = 2f;
shootEffect = ShootFx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke;
chargeEffect = ShootFx.lancerLaserCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
health = 320;
}};
arc = new LaserTurret("arc") {{
shootType = AmmoTypes.lightning;
reload = 100f;
chargeTime = 70f;
shootShake = 1f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootEffect = ShootFx.lightningShoot;
chargeEffect = ShootFx.lightningCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
recoil = 3f;
size = 2;
}};
arc = new LaserTurret("arc"){{
shootType = AmmoTypes.lightning;
reload = 100f;
chargeTime = 70f;
shootShake = 1f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootEffect = ShootFx.lightningShoot;
chargeEffect = ShootFx.lightningCharge;
chargeBeginEffect = ShootFx.lancerLaserChargeBegin;
heatColor = Color.RED;
recoil = 3f;
size = 2;
}};
swarmer = new BurstTurret("swarmer") {{
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary/*, AmmoTypes.missileSurge*/};
reload = 60f;
shots = 4;
burstSpacing = 5;
inaccuracy = 10f;
range = 140f;
xRand = 6f;
size = 2;
health = 380;
}};
swarmer = new BurstTurret("swarmer"){{
ammoTypes = new AmmoType[]{AmmoTypes.missileExplosive, AmmoTypes.missileIncindiary/*, AmmoTypes.missileSurge*/};
reload = 60f;
shots = 4;
burstSpacing = 5;
inaccuracy = 10f;
range = 140f;
xRand = 6f;
size = 2;
health = 380;
}};
salvo = new BurstTurret("salvo") {{
size = 2;
range = 120f;
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 40f;
restitution = 0.03f;
ammoEjectBack = 3f;
cooldown = 0.03f;
recoil = 3f;
shootShake = 2f;
burstSpacing = 4;
shots = 3;
ammoUseEffect = ShootFx.shellEjectBig;
salvo = new BurstTurret("salvo"){{
size = 2;
range = 120f;
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 40f;
restitution = 0.03f;
ammoEjectBack = 3f;
cooldown = 0.03f;
recoil = 3f;
shootShake = 2f;
burstSpacing = 4;
shots = 3;
ammoUseEffect = ShootFx.shellEjectBig;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
float offsetx = (int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
float offsety = -(int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
float offsetx = (int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
float offsety = -(int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
for (int i : Mathf.signs) {
float rot = entity.rotation + 90 * i;
Draw.rect(name + "-panel-" + Strings.dir(i),
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
}
};
for(int i : Mathf.signs){
float rot = entity.rotation + 90 * i;
Draw.rect(name + "-panel-" + Strings.dir(i),
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
}
};
health = 360;
}};
health = 360;
}};
ripple = new ArtilleryTurret("ripple") {{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryExplosive, AmmoTypes.artilleryPlastic};
size = 3;
shots = 4;
inaccuracy = 12f;
reload = 60f;
ammoEjectBack = 5f;
ripple = new ArtilleryTurret("ripple"){{
ammoTypes = new AmmoType[]{AmmoTypes.artilleryCarbide, AmmoTypes.artilleryHoming, AmmoTypes.artilleryIncindiary, AmmoTypes.artilleryExplosive, AmmoTypes.artilleryPlastic};
size = 3;
shots = 4;
inaccuracy = 12f;
reload = 60f;
ammoEjectBack = 5f;
ammoUseEffect = ShootFx.shellEjectBig;
cooldown = 0.03f;
velocityInaccuracy = 0.2f;
velocityInaccuracy = 0.2f;
restitution = 0.02f;
recoil = 6f;
shootShake = 2f;
range = 300f;
health = 550;
}};
health = 550;
}};
cyclone = new ItemTurret("cyclone") {{
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
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;
}};
fuse = new ItemTurret("fuse"){{
//TODO make it use power
ammoTypes = new AmmoType[]{AmmoTypes.fuseShotgun};
size = 3;
}};
spectre = new ItemTurret("spectre") {{
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
size = 4;
}};
spectre = new ItemTurret("spectre"){{
ammoTypes = new AmmoType[]{AmmoTypes.bulletTungsten, AmmoTypes.bulletLead, AmmoTypes.bulletCarbide, AmmoTypes.bulletPyratite, AmmoTypes.bulletThorium, AmmoTypes.bulletSilicon};
reload = 25f;
restitution = 0.03f;
ammoUseEffect = ShootFx.shellEjectSmall;
size = 4;
}};
meltdown = new PowerTurret("meltdown") {{
shootType = AmmoTypes.meltdownLaser;
size = 4;
}};
}
meltdown = new PowerTurret("meltdown"){{
shootType = AmmoTypes.meltdownLaser;
size = 4;
}};
}
}

View File

@@ -7,12 +7,12 @@ import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.*;
public class UnitBlocks extends BlockList implements ContentList {
public class UnitBlocks extends BlockList implements ContentList{
public static Block resupplyPoint, repairPoint, droneFactory, fabricatorFactory, dropPoint, reconstructor, overdriveProjector, shieldProjector;
@Override
public void load() {
droneFactory = new UnitFactory("drone-factory") {{
public void load(){
droneFactory = new UnitFactory("drone-factory"){{
type = UnitTypes.drone;
produceTime = 800;
size = 2;
@@ -20,7 +20,7 @@ public class UnitBlocks extends BlockList implements ContentList {
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)});
}};
fabricatorFactory = new UnitFactory("fabricator-factory") {{
fabricatorFactory = new UnitFactory("fabricator-factory"){{
type = UnitTypes.fabricator;
produceTime = 1600;
size = 2;
@@ -28,30 +28,30 @@ public class UnitBlocks extends BlockList implements ContentList {
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)});
}};
resupplyPoint = new ResupplyPoint("resupply-point") {{
resupplyPoint = new ResupplyPoint("resupply-point"){{
shadow = "shadow-round-1";
itemCapacity = 30;
}};
dropPoint = new DropPoint("drop-point") {{
dropPoint = new DropPoint("drop-point"){{
shadow = "shadow-round-1";
itemCapacity = 40;
}};
repairPoint = new RepairPoint("repair-point") {{
repairPoint = new RepairPoint("repair-point"){{
shadow = "shadow-round-1";
repairSpeed = 0.1f;
}};
reconstructor = new Reconstructor("reconstructor") {{
reconstructor = new Reconstructor("reconstructor"){{
size = 2;
}};
overdriveProjector = new OverdriveProjector("overdrive-projector") {{
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
size = 2;
}};
shieldProjector = new ShieldProjector("shieldprojector") {{
shieldProjector = new ShieldProjector("shieldprojector"){{
size = 2;
}};
}

View File

@@ -4,11 +4,11 @@ import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.MechFactory;
public class UpgradeBlocks extends BlockList {
public class UpgradeBlocks extends BlockList{
public static Block deltaFactory, tauFactory, omegaFactory, dartFactory, javelinFactory, tridentFactory, halberdFactory;
@Override
public void load() {
public void load(){
deltaFactory = new MechFactory("delta-mech-factory"){{
mech = Mechs.delta;
size = 2;

View File

@@ -11,9 +11,9 @@ public class ArtilleryBullets extends BulletList implements ContentList{
public static BulletType carbide, plastic, plasticFrag, homing, incindiary, explosive, surge;
@Override
public void load() {
public void load(){
carbide = new ArtilleryBulletType(3f, 0, "shell") {
carbide = new ArtilleryBulletType(3f, 0, "shell"){
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -25,7 +25,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
plasticFrag = new BasicBulletType(2.5f, 6, "bullet") {
plasticFrag = new BasicBulletType(2.5f, 6, "bullet"){
{
bulletWidth = 10f;
bulletHeight = 12f;
@@ -36,7 +36,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
plastic = new ArtilleryBulletType(3.3f, 0, "shell") {
plastic = new ArtilleryBulletType(3.3f, 0, "shell"){
{
hiteffect = BulletFx.plasticExplosion;
knockback = 1f;
@@ -52,7 +52,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
homing = new ArtilleryBulletType(3f, 0, "shell") {
homing = new ArtilleryBulletType(3f, 0, "shell"){
{
hiteffect = BulletFx.flakExplosion;
knockback = 0.8f;
@@ -66,7 +66,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
incindiary = new ArtilleryBulletType(3f, 0, "shell") {
incindiary = new ArtilleryBulletType(3f, 0, "shell"){
{
hiteffect = BulletFx.blastExplosion;
knockback = 0.8f;
@@ -83,7 +83,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
explosive = new ArtilleryBulletType(2f, 0, "shell") {
explosive = new ArtilleryBulletType(2f, 0, "shell"){
{
hiteffect = BulletFx.blastExplosion;
knockback = 0.8f;
@@ -97,7 +97,7 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
surge = new ArtilleryBulletType(3f, 0, "shell") {
surge = new ArtilleryBulletType(3f, 0, "shell"){
{
//TODO
}

View File

@@ -5,10 +5,10 @@ import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.type.ContentList;
public abstract class BulletList implements ContentList {
public abstract class BulletList implements ContentList{
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return BulletType.all();
}
}

View File

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

View File

@@ -6,13 +6,13 @@ import io.anuke.mindustry.entities.bullet.MissileBulletType;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.ContentList;
public class MissileBullets extends BulletList implements ContentList {
public class MissileBullets extends BulletList implements ContentList{
public static BulletType explosive, incindiary, surge, javelin;
@Override
public void load() {
public void load(){
explosive = new MissileBulletType(1.8f, 10, "missile") {
explosive = new MissileBulletType(1.8f, 10, "missile"){
{
bulletWidth = 8f;
bulletHeight = 8f;
@@ -26,7 +26,7 @@ public class MissileBullets extends BulletList implements ContentList {
}
};
incindiary = new MissileBulletType(2f, 12, "missile") {
incindiary = new MissileBulletType(2f, 12, "missile"){
{
frontColor = Palette.lightishOrange;
backColor = Palette.lightOrange;
@@ -44,14 +44,14 @@ public class MissileBullets extends BulletList implements ContentList {
}
};
surge = new MissileBulletType(3f, 5, "bullet") {
surge = new MissileBulletType(3f, 5, "bullet"){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
javelin = new MissileBulletType(2.5f, 10, "missile") {
javelin = new MissileBulletType(2.5f, 10, "missile"){
{
bulletWidth = 8f;
bulletHeight = 8f;

View File

@@ -5,27 +5,27 @@ import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.ContentList;
public class StandardBullets extends BulletList implements ContentList {
public class StandardBullets extends BulletList implements ContentList{
public static BulletType tungsten, lead, carbide, thorium, homing, tracer;
@Override
public void load() {
public void load(){
tungsten = new BasicBulletType(3.2f, 10, "bullet") {
tungsten = new BasicBulletType(3.2f, 10, "bullet"){
{
bulletWidth = 9f;
bulletHeight = 11f;
}
};
lead = new BasicBulletType(2.5f, 5, "bullet") {
lead = new BasicBulletType(2.5f, 5, "bullet"){
{
bulletWidth = 7f;
bulletHeight = 9f;
}
};
carbide = new BasicBulletType(3.5f, 18, "bullet") {
carbide = new BasicBulletType(3.5f, 18, "bullet"){
{
bulletWidth = 9f;
bulletHeight = 12f;
@@ -33,7 +33,7 @@ public class StandardBullets extends BulletList implements ContentList {
}
};
thorium = new BasicBulletType(4f, 29, "bullet") {
thorium = new BasicBulletType(4f, 29, "bullet"){
{
bulletWidth = 10f;
bulletHeight = 13f;
@@ -41,7 +41,7 @@ public class StandardBullets extends BulletList implements ContentList {
}
};
homing = new BasicBulletType(3f, 9, "bullet") {
homing = new BasicBulletType(3f, 9, "bullet"){
{
bulletWidth = 7f;
bulletHeight = 9f;
@@ -49,7 +49,7 @@ public class StandardBullets extends BulletList implements ContentList {
}
};
tracer = new BasicBulletType(3.2f, 11, "bullet") {
tracer = new BasicBulletType(3.2f, 11, "bullet"){
{
bulletWidth = 10f;
bulletHeight = 12f;

View File

@@ -29,13 +29,13 @@ import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.world;
public class TurretBullets extends BulletList implements ContentList {
public class TurretBullets extends BulletList implements ContentList{
public static BulletType fireball, basicFlame, lancerLaser, fuseShot, waterShot, cryoShot, lavaShot, oilShot, lightning, driverBolt;
@Override
public void load() {
public void load(){
fireball = new BulletType(1f, 4) {
fireball = new BulletType(1f, 4){
{
pierce = true;
hitTiles = false;
@@ -45,12 +45,12 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void init(Bullet b) {
public void init(Bullet b){
b.getVelocity().setLength(0.6f + Mathf.random(2f));
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
//TODO add color to the bullet depending on the color of the flame it came from
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, b.fin());
Fill.circle(b.x, b.y, 3f * b.fout());
@@ -58,25 +58,25 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void update(Bullet b) {
if (Mathf.chance(0.04 * Timers.delta())) {
public void update(Bullet b){
if(Mathf.chance(0.04 * Timers.delta())){
Tile tile = world.tileWorld(b.x, b.y);
if (tile != null) {
if(tile != null){
Fire.create(tile);
}
}
if (Mathf.chance(0.1 * Timers.delta())) {
if(Mathf.chance(0.1 * Timers.delta())){
Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y);
}
if (Mathf.chance(0.1 * Timers.delta())) {
if(Mathf.chance(0.1 * Timers.delta())){
Effects.effect(EnvironmentFx.ballfire, b.x, b.y);
}
}
};
basicFlame = new BulletType(2f, 5) {
basicFlame = new BulletType(2f, 5){
{
hitsize = 7f;
lifetime = 30f;
@@ -88,11 +88,11 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
}
};
lancerLaser = new BulletType(0.001f, 110) {
lancerLaser = new BulletType(0.001f, 110){
Color[] colors = {Palette.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Palette.lancerLaser, Color.WHITE};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
@@ -107,19 +107,19 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void init(Bullet b) {
public void init(Bullet b){
Damage.collideLine(b, b.getTeam(), hiteffect, b.x, b.y, b.angle(), length);
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
float f = Mathf.curve(b.fin(), 0f, 0.2f);
float baseLen = length * f;
Lines.lineAngle(b.x, b.y, b.angle(), baseLen);
for (int s = 0; s < 3; s++) {
for(int s = 0; s < 3; s++){
Draw.color(colors[s]);
for (int i = 0; i < tscales.length; i++) {
for(int i = 0; i < tscales.length; i++){
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
Lines.lineAngle(b.x, b.y, b.angle(), baseLen * lenscales[i]);
}
@@ -128,24 +128,24 @@ public class TurretBullets extends BulletList implements ContentList {
}
};
fuseShot = new BulletType(0.01f, 100) {
fuseShot = new BulletType(0.01f, 100){
//TODO
};
waterShot = new LiquidBulletType(Liquids.water) {
waterShot = new LiquidBulletType(Liquids.water){
{
status = StatusEffects.wet;
statusIntensity = 0.5f;
knockback = 0.65f;
}
};
cryoShot = new LiquidBulletType(Liquids.cryofluid) {
cryoShot = new LiquidBulletType(Liquids.cryofluid){
{
status = StatusEffects.freezing;
statusIntensity = 0.5f;
}
};
lavaShot = new LiquidBulletType(Liquids.lava) {
lavaShot = new LiquidBulletType(Liquids.lava){
{
damage = 4;
speed = 1.9f;
@@ -154,7 +154,7 @@ public class TurretBullets extends BulletList implements ContentList {
statusIntensity = 0.5f;
}
};
oilShot = new LiquidBulletType(Liquids.oil) {
oilShot = new LiquidBulletType(Liquids.oil){
{
speed = 2f;
drag = 0.03f;
@@ -162,7 +162,7 @@ public class TurretBullets extends BulletList implements ContentList {
statusIntensity = 0.5f;
}
};
lightning = new BulletType(0.001f, 10) {
lightning = new BulletType(0.001f, 10){
{
lifetime = 1;
despawneffect = Fx.none;
@@ -170,16 +170,16 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
}
@Override
public void init(Bullet b) {
public void init(Bullet b){
Lightning.create(b.getTeam(), hiteffect, Palette.lancerLaser, damage, b.x, b.y, b.angle(), 30);
}
};
driverBolt = new BulletType(5f, 20) {
driverBolt = new BulletType(5f, 20){
{
collidesTiles = false;
lifetime = 200f;
@@ -189,7 +189,7 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
Draw.color(Color.LIGHT_GRAY);
Fill.square(b.x, b.y, 3f, b.angle());
@@ -199,7 +199,7 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void update(Bullet b) {
public void update(Bullet b){
//data MUST be an instance of DriverBulletData
if(!(b.getData() instanceof DriverBulletData)){
hit(b);
@@ -208,7 +208,7 @@ public class TurretBullets extends BulletList implements ContentList {
float hitDst = 7f;
DriverBulletData data = (DriverBulletData)b.getData();
DriverBulletData data = (DriverBulletData) b.getData();
//if the target is dead, just keep flying until the bullet explodes
if(data.to.isDead()){
@@ -245,15 +245,15 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void despawned(Bullet b) {
public void despawned(Bullet b){
super.despawned(b);
if(!(b.getData() instanceof DriverBulletData)) return;
DriverBulletData data = (DriverBulletData)b.getData();
DriverBulletData data = (DriverBulletData) b.getData();
data.to.isRecieving = false;
for(int i = 0; i < data.items.length; i ++){
for(int i = 0; i < data.items.length; i++){
int amountDropped = Mathf.random(0, data.items[i]);
if(amountDropped > 0){
float angle = b.angle() + Mathf.range(100f);
@@ -264,7 +264,7 @@ public class TurretBullets extends BulletList implements ContentList {
}
@Override
public void hit(Bullet b, float hitx, float hity) {
public void hit(Bullet b, float hitx, float hity){
super.hit(b, hitx, hity);
despawned(b);
}

View File

@@ -16,12 +16,12 @@ import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.world;
public class WeaponBullets extends BulletList {
public class WeaponBullets extends BulletList{
public static BulletType tungstenShotgun, bombExplosive, bombIncendiary, bombOil, shellCarbide;
@Override
public void load() {
tungstenShotgun = new BasicBulletType(5f, 8, "bullet") {
public void load(){
tungstenShotgun = new BasicBulletType(5f, 8, "bullet"){
{
bulletWidth = 8f;
bulletHeight = 9f;
@@ -49,10 +49,10 @@ public class WeaponBullets extends BulletList {
}
@Override
public void hit(Bullet b, float x, float y) {
public void hit(Bullet b, float x, float y){
super.hit(b, x, y);
for (int i = 0; i < 3; i++) {
for(int i = 0; i < 3; i++){
float cx = x + Mathf.range(10f);
float cy = y + Mathf.range(10f);
Tile tile = world.tileWorld(cx, cy);
@@ -73,17 +73,17 @@ public class WeaponBullets extends BulletList {
}
@Override
public void hit(Bullet b, float x, float y) {
public void hit(Bullet b, float x, float y){
super.hit(b, x, y);
for (int i = 0; i < 3; i++) {
for(int i = 0; i < 3; i++){
Tile tile = world.tileWorld(x + Mathf.range(8f), y + Mathf.range(8f));
Puddle.deposit(tile, Liquids.oil, 5f);
}
}
};
shellCarbide = new BasicBulletType(3.4f, 20, "bullet") {
shellCarbide = new BasicBulletType(3.4f, 20, "bullet"){
{
bulletWidth = 10f;
bulletHeight = 12f;

View File

@@ -19,7 +19,7 @@ public class BlockFx extends FxList implements ContentList{
public static Effect reactorsmoke, nuclearsmoke, nuclearcloud, redgeneratespark, generatespark, fuelburn, plasticburn, pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium, producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, dooropen, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate, mine, mineBig, mineHuge, smelt, teleportActivate, teleport, teleportOut, ripple, bubble;
@Override
public void load() {
public void load(){
reactorsmoke = new Effect(17, e -> {
Angles.randLenVectors(e.id, 4, e.fin() * 8f, (x, y) -> {

View File

@@ -10,12 +10,12 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class BulletFx extends FxList implements ContentList {
public class BulletFx extends FxList implements ContentList{
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
artilleryTrail, incendTrail, missileTrail;
@Override
public void load() {
public void load(){
hitBulletSmall = new Effect(14, e -> {
Draw.color(Color.WHITE, Palette.lightOrange, e.fin());

View File

@@ -10,11 +10,11 @@ import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class EnvironmentFx extends FxList implements ContentList {
public class EnvironmentFx extends FxList implements ContentList{
public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily;
@Override
public void load() {
public void load(){
burning = new Effect(35f, e -> {
Draw.color(Palette.lightFlame, Palette.darkFlame, e.fin());

View File

@@ -10,11 +10,11 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class ExplosionFx extends FxList implements ContentList {
public class ExplosionFx extends FxList implements ContentList{
public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke;
@Override
public void load() {
public void load(){
shockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());

View File

@@ -11,59 +11,59 @@ import io.anuke.ucore.util.Angles;
import static io.anuke.mindustry.Vars.tilesize;
public class Fx extends FxList implements ContentList {
public static Effect none, placeBlock, breakBlock, smoke, spawn, tapBlock, select;
public class Fx extends FxList implements ContentList{
public static Effect none, placeBlock, breakBlock, smoke, spawn, tapBlock, select;
@Override
public void load() {
@Override
public void load(){
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 * e.rotation + e.fin() * 3f);
Draw.reset();
});
placeBlock = new Effect(16, e -> {
Draw.color(Palette.accent);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f);
Draw.reset();
});
tapBlock = new Effect(12, e -> {
Draw.color(Palette.accent);
Lines.stroke(3f - e.fin() * 2f);
Lines.circle(e.x, e.y, 4f + (tilesize/1.5f * e.rotation) * e.fin());
Draw.reset();
});
tapBlock = new Effect(12, e -> {
Draw.color(Palette.accent);
Lines.stroke(3f - e.fin() * 2f);
Lines.circle(e.x, e.y, 4f + (tilesize / 1.5f * e.rotation) * e.fin());
Draw.reset();
});
breakBlock = new Effect(12, e -> {
Draw.color(Palette.remove);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f);
breakBlock = new Effect(12, e -> {
Draw.color(Palette.remove);
Lines.stroke(3f - e.fin() * 2f);
Lines.square(e.x, e.y, tilesize / 2f * e.rotation + e.fin() * 3f);
Angles.randLenVectors(e.id, 3 + (int) (e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> {
Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation));
});
Draw.reset();
});
Angles.randLenVectors(e.id, 3 + (int) (e.rotation * 3), e.rotation * 2f + (tilesize * e.rotation) * e.finpow(), (x, y) -> {
Fill.square(e.x + x, e.y + y, 1f + e.fout() * (3f + e.rotation));
});
Draw.reset();
});
select = new Effect(23, e -> {
Draw.color(Palette.accent);
Lines.stroke(e.fout() * 3f);
Lines.circle(e.x, e.y, 3f + e.fin() * 14f);
Draw.reset();
});
select = new Effect(23, e -> {
Draw.color(Palette.accent);
Lines.stroke(e.fout() * 3f);
Lines.circle(e.x, e.y, 3f + e.fin() * 14f);
Draw.reset();
});
smoke = new Effect(100, e -> {
Draw.color(Color.GRAY, Palette.darkishGray, e.fin());
float size = 7f - e.fin() * 7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
smoke = new Effect(100, e -> {
Draw.color(Color.GRAY, Palette.darkishGray, e.fin());
float size = 7f - e.fin() * 7f;
Draw.rect("circle", e.x, e.y, size, size);
Draw.reset();
});
spawn = new Effect(23, e -> {
Lines.stroke(2f * e.fout());
Draw.color(Palette.accent);
Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f);
Draw.reset();
});
}
spawn = new Effect(23, e -> {
Lines.stroke(2f * e.fout());
Draw.color(Palette.accent);
Lines.poly(e.x, e.y, 4, 3f + e.fin() * 8f);
Draw.reset();
});
}
}

View File

@@ -7,7 +7,7 @@ import io.anuke.mindustry.type.ContentList;
public abstract class FxList implements ContentList{
@Override
public Array<? extends Content> getAll() {
public Array<? extends Content> getAll(){
return Array.with();
}
}

View File

@@ -12,11 +12,11 @@ import io.anuke.ucore.graphics.Shapes;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class ShootFx extends FxList implements ContentList {
public class ShootFx extends FxList implements ContentList{
public static Effect shootSmall, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot;
@Override
public void load() {
public void load(){
shootSmall = new Effect(8, e -> {
Draw.color(Palette.lighterOrange, Palette.lightOrange, e.fin());
@@ -111,7 +111,7 @@ public class ShootFx extends FxList implements ContentList {
shellEjectMedium = new GroundEffect(34f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for (int i : Mathf.signs) {
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect("casing",
@@ -122,7 +122,7 @@ public class ShootFx extends FxList implements ContentList {
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
for (int i : Mathf.signs) {
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, 1f + e.finpow() * 11f, e.rotation + 90f * i, 20f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f);
});
@@ -134,7 +134,7 @@ public class ShootFx extends FxList implements ContentList {
shellEjectBig = new GroundEffect(22f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for (int i : Mathf.signs) {
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect("casing",
@@ -146,7 +146,7 @@ public class ShootFx extends FxList implements ContentList {
Draw.color(Color.LIGHT_GRAY);
for (int i : Mathf.signs) {
for(int i : Mathf.signs){
Angles.randLenVectors(e.id, 4, -e.finpow() * 15f, e.rotation + 90f * i, 25f, (x, y) -> {
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
@@ -158,7 +158,7 @@ public class ShootFx extends FxList implements ContentList {
lancerLaserShoot = new Effect(21f, e -> {
Draw.color(Palette.lancerLaser);
for (int i : Mathf.signs) {
for(int i : Mathf.signs){
Shapes.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i);
}

View File

@@ -10,11 +10,11 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class UnitFx extends FxList implements ContentList {
public class UnitFx extends FxList implements ContentList{
public static Effect vtolHover, unitDrop, unitPickup, pickup;
@Override
public void load() {
public void load(){
vtolHover = new Effect(40f, e -> {
float len = e.finpow() * 10f;