Source reformat

This commit is contained in:
Anuken
2019-04-08 09:03:18 -04:00
parent 4a96b9bb00
commit b40beb0d1d
331 changed files with 2822 additions and 3274 deletions

View File

@@ -2,18 +2,12 @@ package io.anuke.mindustry.content;
import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.CacheLayer;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.type.Category;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.LiquidStack;
import io.anuke.mindustry.graphics.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.*;
@@ -23,13 +17,8 @@ import io.anuke.mindustry.world.blocks.distribution.*;
import io.anuke.mindustry.world.blocks.power.*;
import io.anuke.mindustry.world.blocks.production.*;
import io.anuke.mindustry.world.blocks.sandbox.*;
import io.anuke.mindustry.world.blocks.storage.CoreBlock;
import io.anuke.mindustry.world.blocks.storage.LaunchPad;
import io.anuke.mindustry.world.blocks.storage.Unloader;
import io.anuke.mindustry.world.blocks.storage.Vault;
import io.anuke.mindustry.world.blocks.units.MechPad;
import io.anuke.mindustry.world.blocks.units.RepairPoint;
import io.anuke.mindustry.world.blocks.units.UnitFactory;
import io.anuke.mindustry.world.blocks.storage.*;
import io.anuke.mindustry.world.blocks.units.*;
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
import io.anuke.mindustry.world.meta.Attribute;
import io.anuke.mindustry.world.modules.LiquidModule;
@@ -91,15 +80,25 @@ public class Blocks implements ContentList{
public void load(){
//region environment
air = new Floor("air"){{
air = new Floor("air"){
{
alwaysReplace = true;
hasShadow = false;
}
public void draw(Tile tile){}
public void load(){}
public void init(){}
public boolean isHidden(){ return true; }
public void draw(Tile tile){
}
public void load(){
}
public void init(){
}
public boolean isHidden(){
return true;
}
public TextureRegion[] variantRegions(){
if(variantRegions == null){
variantRegions = new TextureRegion[]{Core.atlas.find("clear")};
@@ -111,7 +110,8 @@ public class Blocks implements ContentList{
part = new BlockPart();
spawn = new Block("spawn"){
public void drawShadow(Tile tile){}
public void drawShadow(Tile tile){
}
};
//Registers build blocks from size 1-6
@@ -593,10 +593,10 @@ public class Blocks implements ContentList{
separator = new Separator("separator"){{
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.titanium, 50));
results = ItemStack.with(
Items.copper, 5,
Items.lead, 3,
Items.graphite, 2,
Items.titanium, 2
Items.copper, 5,
Items.lead, 3,
Items.graphite, 2,
Items.titanium, 2
);
hasPower = true;
craftTime = 35f;
@@ -630,7 +630,7 @@ public class Blocks implements ContentList{
}
int liquidRegion = reg("-liquid");
int topRegion =reg("-top");
int topRegion = reg("-top");
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-top")};
@@ -638,7 +638,7 @@ public class Blocks implements ContentList{
GenericCrafterEntity entity = tile.entity();
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.rect(reg(frameRegions[(int) Mathf.absin(entity.totalProgress, 5f, 2.999f)]), tile.drawx(), tile.drawy());
Draw.rect(reg(frameRegions[(int)Mathf.absin(entity.totalProgress, 5f, 2.999f)]), tile.drawx(), tile.drawy());
Draw.color(Color.CLEAR, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy());
Draw.color();
@@ -1244,10 +1244,10 @@ public class Blocks implements ContentList{
duo = new DoubleTurret("duo"){{
requirements(Category.turret, ItemStack.with(Items.copper, 70), true);
ammo(
Items.copper, Bullets.standardCopper,
Items.graphite, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming
Items.copper, Bullets.standardCopper,
Items.graphite, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming
);
reload = 20f;
restitution = 0.03f;
@@ -1262,8 +1262,8 @@ public class Blocks implements ContentList{
scatter = new BurstTurret("scatter"){{
requirements(Category.turret, ItemStack.with(Items.copper, 170, Items.lead, 90));
ammo(
Items.scrap, Bullets.flakScrap,
Items.lead, Bullets.flakLead
Items.scrap, Bullets.flakScrap,
Items.lead, Bullets.flakLead
);
reload = 15f;
range = 180f;
@@ -1277,14 +1277,14 @@ public class Blocks implements ContentList{
inaccuracy = 17f;
shootCone = 35f;
health = 260*size*size;
health = 260 * size * size;
}};
scorch = new ItemTurret("scorch"){{
requirements(Category.turret, ItemStack.with(Items.copper, 50, Items.graphite, 45));
ammo(
Items.coal, Bullets.basicFlame,
Items.pyratite, Bullets.pyraFlame
Items.coal, Bullets.basicFlame,
Items.pyratite, Bullets.pyraFlame
);
recoil = 0f;
reload = 4f;
@@ -1298,9 +1298,9 @@ public class Blocks implements ContentList{
hail = new ArtilleryTurret("hail"){{
requirements(Category.turret, ItemStack.with(Items.copper, 80, Items.graphite, 35));
ammo(
Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary
Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary
);
reload = 60f;
recoil = 2f;
@@ -1313,10 +1313,10 @@ public class Blocks implements ContentList{
wave = new LiquidTurret("wave"){{
requirements(Category.turret, ItemStack.with(Items.metaglass, 90, Items.lead, 150));
ammo(
Liquids.water, Bullets.waterShot,
Liquids.slag, Bullets.slagShot,
Liquids.cryofluid, Bullets.cryoShot,
Liquids.oil, Bullets.oilShot
Liquids.water, Bullets.waterShot,
Liquids.slag, Bullets.slagShot,
Liquids.cryofluid, Bullets.cryoShot,
Liquids.oil, Bullets.oilShot
);
size = 2;
recoil = 0f;
@@ -1325,7 +1325,7 @@ public class Blocks implements ContentList{
shootCone = 50f;
shootEffect = Fx.shootLiquid;
range = 110f;
health = 250*size*size;
health = 250 * size * size;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
@@ -1356,7 +1356,7 @@ public class Blocks implements ContentList{
chargeBeginEffect = Fx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
health = 280*size*size;
health = 280 * size * size;
targetAir = false;
}};
@@ -1380,9 +1380,9 @@ public class Blocks implements ContentList{
swarmer = new BurstTurret("swarmer"){{
requirements(Category.turret, ItemStack.with(Items.graphite, 70, Items.titanium, 70, Items.plastanium, 90, Items.silicon, 60));
ammo(
Items.blastCompound, Bullets.missileExplosive,
Items.pyratite, Bullets.missileIncendiary,
Items.surgealloy, Bullets.missileSurge
Items.blastCompound, Bullets.missileExplosive,
Items.pyratite, Bullets.missileIncendiary,
Items.surgealloy, Bullets.missileSurge
);
reload = 50f;
shots = 4;
@@ -1391,17 +1391,17 @@ public class Blocks implements ContentList{
range = 140f;
xRand = 6f;
size = 2;
health = 300*size*size;
health = 300 * size * size;
}};
salvo = new BurstTurret("salvo"){{
requirements(Category.turret, ItemStack.with(Items.copper, 210, Items.graphite, 190, Items.titanium, 120));
ammo(
Items.copper, Bullets.standardCopper,
Items.graphite, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming,
Items.thorium, Bullets.standardThorium
Items.copper, Bullets.standardCopper,
Items.graphite, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming,
Items.thorium, Bullets.standardThorium
);
size = 2;
@@ -1421,11 +1421,11 @@ public class Blocks implements ContentList{
ripple = new ArtilleryTurret("ripple"){{
requirements(Category.turret, ItemStack.with(Items.copper, 300, Items.graphite, 270, Items.titanium, 120));
ammo(
Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary,
Items.blastCompound, Bullets.artilleryExplosive,
Items.plastanium, Bullets.arilleryPlastic
Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary,
Items.blastCompound, Bullets.artilleryExplosive,
Items.plastanium, Bullets.arilleryPlastic
);
size = 3;
shots = 4;
@@ -1446,9 +1446,9 @@ public class Blocks implements ContentList{
cyclone = new ItemTurret("cyclone"){{
requirements(Category.turret, ItemStack.with(Items.copper, 400, Items.titanium, 250, Items.plastanium, 160));
ammo(
Items.blastCompound, Bullets.flakExplosive,
Items.plastanium, Bullets.flakPlastic,
Items.surgealloy, Bullets.flakSurge
Items.blastCompound, Bullets.flakExplosive,
Items.plastanium, Bullets.flakPlastic,
Items.surgealloy, Bullets.flakSurge
);
xRand = 4f;
reload = 6f;
@@ -1478,9 +1478,9 @@ public class Blocks implements ContentList{
spectre = new DoubleTurret("spectre"){{
requirements(Category.turret, ItemStack.with(Items.copper, 700, Items.graphite, 600, Items.surgealloy, 500, Items.plastanium, 350, Items.thorium, 500));
ammo(
Items.graphite, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig,
Items.thorium, Bullets.standardThoriumBig
Items.graphite, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig,
Items.thorium, Bullets.standardThoriumBig
);
reload = 6f;
coolantMultiplier = 0.5f;

View File

@@ -1,20 +1,15 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.entities.Effects;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.CapStyle;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.entities.Damage;
import io.anuke.mindustry.entities.type.Unit;
import io.anuke.mindustry.entities.Effects;
import io.anuke.mindustry.entities.bullet.*;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.entities.effect.*;
import io.anuke.mindustry.entities.type.Unit;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.graphics.Shapes;
@@ -37,7 +32,7 @@ public class Bullets implements ContentList{
//standard
standardCopper, standardDense, standardThorium, standardHoming, standardIncendiary, standardMechSmall,
standardGlaive, standardDenseBig, standardThoriumBig, standardIncendiaryBig,
standardGlaive, standardDenseBig, standardThoriumBig, standardIncendiaryBig,
//electric
lancerLaser, meltdownLaser, lightning, arc, damageLightning,
@@ -562,7 +557,7 @@ public class Bullets implements ContentList{
public void hit(Bullet b, float hitx, float hity){
Effects.effect(hitEffect, colors[2], hitx, hity);
if(Mathf.chance(0.4)){
Fire.create(world.tileWorld(hitx+Mathf.range(5f), hity+Mathf.range(5f)));
Fire.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
}
}
@@ -586,6 +581,7 @@ public class Bullets implements ContentList{
fuseShot = new BulletType(0.01f, 70){
int rays = 3;
float rayLength = 80f;
{
hitEffect = Fx.hitFuse;
lifetime = 13f;
@@ -594,23 +590,23 @@ public class Bullets implements ContentList{
}
@Override
public void init(Bullet b) {
for (int i = 0; i < rays; i++) {
Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays/2))*20f);
public void init(Bullet b){
for(int i = 0; i < rays; i++){
Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays / 2)) * 20f);
}
}
@Override
public void draw(Bullet b) {
public void draw(Bullet b){
super.draw(b);
Draw.color(Color.WHITE, Pal.surge, b.fin());
for(int i = 0; i < 7; i++){
Tmp.v1.trns(b.rot(), i * 8f);
float sl = Mathf.clamp(b.fout()-0.5f) * (80f - i *10);
float sl = Mathf.clamp(b.fout() - 0.5f) * (80f - i * 10);
Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90);
Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90);
}
Shapes.tri(b.x, b.y, 13f, (rayLength+50) * b.fout(), b.rot());
Shapes.tri(b.x, b.y, 13f, (rayLength + 50) * b.fout(), b.rot());
Shapes.tri(b.x, b.y, 13f, 10f * b.fout(), b.rot() + 180f);
Draw.reset();
}
@@ -665,14 +661,16 @@ public class Bullets implements ContentList{
}
};
arc = new BulletType(0.001f, 25){{
arc = new BulletType(0.001f, 25){
{
lifetime = 1;
despawnEffect = Fx.none;
hitEffect = Fx.hitLancer;
}
@Override
public void draw(Bullet b){}
public void draw(Bullet b){
}
@Override
public void init(Bullet b){
@@ -709,7 +707,8 @@ public class Bullets implements ContentList{
incendSpread = 10f;
}};
bombOil = new BombBulletType(2f, 3f, "shell"){{
bombOil = new BombBulletType(2f, 3f, "shell"){
{
bulletWidth = 8f;
bulletHeight = 12f;
hitEffect = Fx.pulverize;
@@ -728,7 +727,8 @@ public class Bullets implements ContentList{
}
};
explode = new BombBulletType(2f, 3f, "clear"){{
explode = new BombBulletType(2f, 3f, "clear"){
{
hitEffect = Fx.pulverize;
lifetime = 23f;
speed = 1f;

View File

@@ -2,9 +2,7 @@ package io.anuke.mindustry.content;
import io.anuke.arc.Core;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.*;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Tmp;
@@ -39,18 +37,19 @@ public class Fx implements ContentList{
@Override
public void load(){
none = new Effect(0, 0f, e -> {});
none = new Effect(0, 0f, e -> {
});
unitSpawn = new Effect(30f, e -> {
if(!(e.data instanceof BaseUnit)) return;
Draw.alpha(e.fin());
float scl = 1f + e.fout()*2f;
float scl = 1f + e.fout() * 2f;
BaseUnit unit = (BaseUnit)e.data;
Draw.rect(unit.getIconRegion(), e.x, e.y,
unit.getIconRegion().getWidth() * Draw.scl * scl, unit.getIconRegion().getWidth() * Draw.scl * scl, 180f);
unit.getIconRegion().getWidth() * Draw.scl * scl, unit.getIconRegion().getWidth() * Draw.scl * scl, 180f);
Draw.reset();
});
@@ -74,7 +73,7 @@ public class Fx implements ContentList{
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) -> {
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();
@@ -113,7 +112,7 @@ public class Fx implements ContentList{
Lines.poly(e.x, e.y, 4, 5f + e.fin() * 60f);
Draw.reset();
});
vtolHover = new Effect(40f, e -> {
float len = e.finpow() * 10f;
float ang = e.rotation + Mathf.randomSeedRange(e.id, 30f);
@@ -179,7 +178,7 @@ public class Fx implements ContentList{
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*5f);
Lines.circle(e.x, e.y, s.fin() * 5f);
});
@@ -198,7 +197,7 @@ public class Fx implements ContentList{
e.scaled(7f, s -> {
Lines.stroke(0.5f + s.fout());
Lines.circle(e.x, e.y, s.fin()*7f);
Lines.circle(e.x, e.y, s.fin() * 7f);
});
@@ -273,7 +272,7 @@ public class Fx implements ContentList{
hitLaser = new Effect(8, e -> {
Draw.color(Color.WHITE, Pal.heal, e.fin());
Lines.stroke(0.5f + e.fout());
Lines.circle(e.x, e.y, e.fin()*5f);
Lines.circle(e.x, e.y, e.fin() * 5f);
Draw.reset();
});
@@ -539,7 +538,7 @@ public class Fx implements ContentList{
Draw.color(Pal.accent);
Angles.randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> {
Fill.square(e.x + x, e.y + y, e.fout() * 2.3f+0.5f);
Fill.square(e.x + x, e.y + y, e.fout() * 2.3f + 0.5f);
});
Draw.color();
@@ -549,7 +548,7 @@ public class Fx implements ContentList{
float length = 20f * e.finpow();
float size = 7f * e.fout();
Draw.rect(((Item) e.data).icon(Icon.large), e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size);
Draw.rect(((Item)e.data).icon(Icon.large), e.x + Angles.trnsx(e.rotation, length), e.y + Angles.trnsy(e.rotation, length), size, size);
});
@@ -614,23 +613,23 @@ public class Fx implements ContentList{
dynamicExplosion = new Effect(30, e -> {
float intensity = e.rotation;
e.scaled(5 + intensity*2, i -> {
e.scaled(5 + intensity * 2, i -> {
Lines.stroke(3.1f * i.fout());
Lines.poly(e.x, e.y, (int)(20 * intensity), (3f + i.fin() * 14f) * intensity);
});
Draw.color(Color.GRAY);
Angles.randLenVectors(e.id, e.finpow(), (int)(6 * intensity), 21f*intensity, (x, y, in, out) -> {
Fill.circle(e.x + x, e.y + y, out * (2f+intensity) * 3 + 0.5f);
Angles.randLenVectors(e.id, e.finpow(), (int)(6 * intensity), 21f * intensity, (x, y, in, out) -> {
Fill.circle(e.x + x, e.y + y, out * (2f + intensity) * 3 + 0.5f);
Fill.circle(e.x + x / 2f, e.y + y / 2f, out * (intensity) * 3);
});
Draw.color(Pal.lighterOrange, Pal.lightOrange, Color.GRAY, e.fin());
Lines.stroke((1.7f * e.fout()) * (1f + (intensity - 1f) / 2f));
Angles.randLenVectors(e.id + 1, e.finpow(), (int)(9*intensity), 40f*intensity, (x, y, in, out) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + out * 4 * (3f+intensity));
Angles.randLenVectors(e.id + 1, e.finpow(), (int)(9 * intensity), 40f * intensity, (x, y, in, out) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + out * 4 * (3f + intensity));
});
Draw.reset();
@@ -772,8 +771,8 @@ public class Fx implements ContentList{
float len = (2f + e.finpow() * 6f) * i;
float lr = rot + e.fin() * 30f * i;
Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f, rot + e.fin() * 50f * i);
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f, rot + e.fin() * 50f * i);
Draw.color();
});
@@ -785,9 +784,9 @@ public class Fx implements ContentList{
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2f, 3f, rot);
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2f, 3f, rot);
}
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
@@ -808,10 +807,10 @@ public class Fx implements ContentList{
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2.5f, 4f,
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2.5f, 4f,
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);
@@ -1178,7 +1177,7 @@ public class Fx implements ContentList{
healBlock = new Effect(20, e -> {
Draw.color(Pal.heal);
Lines.stroke(2f * e.fout() + 0.5f);
Lines.square(e.x, e.y, 1f + (e.fin() * e.rotation * tilesize/2f-1f));
Lines.square(e.x, e.y, 1f + (e.fin() * e.rotation * tilesize / 2f - 1f));
Draw.color();
});

View File

@@ -21,7 +21,7 @@ import io.anuke.mindustry.type.Weapon;
public class Mechs implements ContentList{
public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive;
/**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
@@ -137,7 +137,7 @@ public class Mechs implements ContentList{
if(player.timer.get(Player.timerAbility, healReload)){
wasHealed = false;
rect.setSize(healRange*2f).setCenter(player.x, player.y);
rect.setSize(healRange * 2f).setCenter(player.x, player.y);
Units.getNearby(player.getTeam(), rect, unit -> {
if(unit.dst(player) <= healRange){
if(unit.health < unit.maxHealth()){
@@ -192,7 +192,7 @@ public class Mechs implements ContentList{
@Override
public float spreadX(Player player){
return player.shootHeat*2f;
return player.shootHeat * 2f;
}
@Override
@@ -203,7 +203,7 @@ public class Mechs implements ContentList{
@Override
public void updateAlt(Player player){
float scl = 1f - player.shootHeat/2f;
float scl = 1f - player.shootHeat / 2f;
player.velocity().scl(scl);
}
@@ -257,6 +257,7 @@ public class Mechs implements ContentList{
float minV = 3.6f;
float maxV = 6f;
TextureRegion shield;
{
drillPower = -1;
speed = 0.11f;
@@ -292,7 +293,7 @@ public class Mechs implements ContentList{
@Override
public void updateAlt(Player player){
float scl = scld(player);
if(Mathf.chance(Time.delta() * (0.15*scl))){
if(Mathf.chance(Time.delta() * (0.15 * scl))){
Effects.effect(Fx.hitLancer, Pal.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), Pal.lancerLaser, 10f,
player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14);
@@ -304,9 +305,9 @@ public class Mechs implements ContentList{
float scl = scld(player);
if(scl < 0.01f) return;
Draw.color(Pal.lancerLaser);
Draw.alpha(scl/2f);
Draw.alpha(scl / 2f);
Draw.blend(Blending.additive);
Draw.rect(shield, player.x + Mathf.range(scl/2f), player.y + Mathf.range(scl/2f), player.rotation - 90);
Draw.rect(shield, player.x + Mathf.range(scl / 2f), player.y + Mathf.range(scl / 2f), player.rotation - 90);
Draw.blend();
}

View File

@@ -1,7 +1,7 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.entities.Effects;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.entities.Effects;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.StatusEffect;

View File

@@ -88,7 +88,6 @@ public class TechTree implements ContentList{
});
node(copperWall, () -> {
node(copperWallLarge);
node(titaniumWall, () -> {
@@ -172,7 +171,6 @@ public class TechTree implements ContentList{
});
node(mechanicalPump, () -> {
node(conduit, () -> {
node(liquidJunction, () -> {
@@ -275,12 +273,13 @@ public class TechTree implements ContentList{
for(int i = 0; i < requirements.length; i++){
requirements[i] = new ItemStack(block.buildRequirements[i].item, block.buildRequirements[i].amount * 5);
}
return new TechNode(block, requirements, children);
}
private TechNode node(Block block){
return node(block, () -> {});
return node(block, () -> {
});
}
public static class TechNode{

View File

@@ -8,9 +8,9 @@ import io.anuke.mindustry.type.Weapon;
public class UnitTypes implements ContentList{
public static UnitType
spirit, phantom,
wraith, ghoul, revenant, lich, reaper,
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
spirit, phantom,
wraith, ghoul, revenant, lich, reaper,
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
@Override
public void load(){

View File

@@ -4,9 +4,7 @@ import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.game.Rules;
import io.anuke.mindustry.maps.generators.MapGenerator;
import io.anuke.mindustry.maps.generators.MapGenerator.Decoration;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Zone;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.Block;
public class Zones implements ContentList{
@@ -44,7 +42,7 @@ public class Zones implements ContentList{
}};
frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1)
.decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.02))){{
.decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.02))){{
loadout = Loadouts.basicFoundation;
baseLaunchCost = ItemStack.with();
startingItems = ItemStack.list(Items.copper, 400);
@@ -89,8 +87,8 @@ public class Zones implements ContentList{
}};*/
stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2)
.dist(0f, false)
.decor(new Decoration(Blocks.moss, Blocks.shaleBoulder, 0.02))){{
.dist(0f, false)
.decor(new Decoration(Blocks.moss, Blocks.shaleBoulder, 0.02))){{
loadout = Loadouts.basicFoundation;
baseLaunchCost = ItemStack.with();
startingItems = ItemStack.list(Items.copper, 400, Items.lead, 100);