Payload cleanup / Reconstructor implementation

This commit is contained in:
Anuken
2022-02-26 22:49:30 -05:00
parent 966161f98a
commit 5689a55e54
33 changed files with 93 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 710 B

View File

@@ -548,3 +548,4 @@
63155=locus|unit-locus-ui 63155=locus|unit-locus-ui
63154=avert|unit-avert-ui 63154=avert|unit-avert-ui
63153=latum|unit-latum-ui 63153=latum|unit-latum-ui
63152=tank-reconstructor|block-tank-reconstructor-ui

Binary file not shown.

View File

@@ -136,8 +136,9 @@ public class Blocks{
additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor, additiveReconstructor, multiplicativeReconstructor, exponentialReconstructor, tetrativeReconstructor,
repairPoint, repairTurret, repairPoint, repairTurret,
//unit - erekir //units - erekir
fabricator, fabricator,
tankReconstructor, shipReconstructor, mechReconstructor,
tankAssembler, shipAssembler, mechAssembler, tankAssembler, shipAssembler, mechAssembler,
//TODO maybe making it 5x5 would be more appropriate, seems kinda cheap. //TODO maybe making it 5x5 would be more appropriate, seems kinda cheap.
basicAssemblerModule, basicAssemblerModule,
@@ -3664,11 +3665,45 @@ public class Blocks{
configurable = false; configurable = false;
plans.add(new UnitPlan(UnitTypes.stell, 60f * 60f, with(Items.beryllium, 100f, Items.silicon, 60f))); plans.add(new UnitPlan(UnitTypes.stell, 60f * 60f, with(Items.beryllium, 100f, Items.silicon, 60f)));
researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80); researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80);
regionSuffix = "-dark";
consumePower(2f); consumePower(2f);
}}; }};
tankReconstructor = new Reconstructor("tank-reconstructor"){{
requirements(Category.units, with(Items.graphite, 250, Items.tungsten, 120, Items.silicon, 200));
regionSuffix = "-dark";
size = 3;
consumePower(3f);
consumeLiquid(Liquids.hydrogen, 3f / 60f);
consumeItems(with(Items.silicon, 100, Items.tungsten, 100));
constructTime = 60f * 20f;
upgrades.addAll(
new UnitType[]{UnitTypes.stell, UnitTypes.locus}
);
}};
mechReconstructor = new Reconstructor("mech-reconstructor"){{
requirements(Category.units, with(Items.graphite, 250, Items.tungsten, 120, Items.silicon, 200));
regionSuffix = "-dark";
size = 3;
consumePower(3f);
consumeLiquid(Liquids.hydrogen, 3f / 60f);
consumeItems(with(Items.silicon, 100, Items.tungsten, 100));
constructTime = 60f * 20f;
upgrades.addAll(
new UnitType[]{UnitTypes.stell, UnitTypes.latum}
);
}};
tankAssembler = new UnitAssembler("tank-assembler"){{ tankAssembler = new UnitAssembler("tank-assembler"){{
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 250, Items.tungsten, 400, Items.silicon, 500)); requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 250, Items.tungsten, 400, Items.silicon, 500));
regionSuffix = "-dark";
size = 5; size = 5;
//TODO remove ducts and crushers, replace with 2-3 high cost special blocks with silicon requirements //TODO remove ducts and crushers, replace with 2-3 high cost special blocks with silicon requirements
plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 50f, PayloadStack.list(UnitTypes.stell, 4, Blocks.tungstenWallLarge, 10))); plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 50f, PayloadStack.list(UnitTypes.stell, 4, Blocks.tungstenWallLarge, 10)));
@@ -3682,6 +3717,7 @@ public class Blocks{
//TODO requirements //TODO requirements
shipAssembler = new UnitAssembler("ship-assembler"){{ shipAssembler = new UnitAssembler("ship-assembler"){{
requirements(Category.units, with(Items.beryllium, 700, Items.oxide, 300, Items.tungsten, 500, Items.silicon, 800)); requirements(Category.units, with(Items.beryllium, 700, Items.oxide, 300, Items.tungsten, 500, Items.silicon, 800));
regionSuffix = "-dark";
size = 5; size = 5;
//TODO not stell //TODO not stell
plans.add(new AssemblerUnitPlan(UnitTypes.quell, 60f * 60f, PayloadStack.list(Blocks.berylliumWallLarge, 20, UnitTypes.stell, 2))); plans.add(new AssemblerUnitPlan(UnitTypes.quell, 60f * 60f, PayloadStack.list(Blocks.berylliumWallLarge, 20, UnitTypes.stell, 2)));
@@ -3695,6 +3731,7 @@ public class Blocks{
//TODO requirements //TODO requirements
mechAssembler = new UnitAssembler("mech-assembler"){{ mechAssembler = new UnitAssembler("mech-assembler"){{
requirements(Category.units, with(Items.graphite, 500, Items.thorium, 600, Items.oxide, 200, Items.tungsten, 500, Items.silicon, 900)); requirements(Category.units, with(Items.graphite, 500, Items.thorium, 600, Items.oxide, 200, Items.tungsten, 500, Items.silicon, 900));
regionSuffix = "-dark";
size = 5; size = 5;
//TODO different reqs //TODO different reqs
//TODO not stell //TODO not stell
@@ -3711,6 +3748,7 @@ public class Blocks{
basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{ basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{
requirements(Category.units, with(Items.graphite, 10)); requirements(Category.units, with(Items.graphite, 10));
consumePower(0.5f); consumePower(0.5f);
regionSuffix = "-dark";
size = 3; size = 3;
}}; }};
@@ -3758,6 +3796,7 @@ public class Blocks{
payloadMassDriver = new PayloadMassDriver("payload-mass-driver"){{ payloadMassDriver = new PayloadMassDriver("payload-mass-driver"){{
requirements(Category.units, with(Items.tungsten, 120, Items.silicon, 120, Items.oxide, 70)); requirements(Category.units, with(Items.tungsten, 120, Items.silicon, 120, Items.oxide, 70));
regionSuffix = "-dark";
size = 3; size = 3;
reloadTime = 130f; reloadTime = 130f;
chargeTime = 90f; chargeTime = 90f;
@@ -3768,6 +3807,7 @@ public class Blocks{
payloadPropulsionTower = new PayloadMassDriver("payload-propulsion-tower"){{ payloadPropulsionTower = new PayloadMassDriver("payload-propulsion-tower"){{
requirements(Category.units, with(Items.thorium, 300, Items.silicon, 200, Items.plastanium, 200, Items.phaseFabric, 50)); requirements(Category.units, with(Items.thorium, 300, Items.silicon, 200, Items.plastanium, 200, Items.phaseFabric, 50));
regionSuffix = "-dark";
size = 5; size = 5;
reloadTime = 130f; reloadTime = 130f;
chargeTime = 100f; chargeTime = 100f;
@@ -3778,6 +3818,7 @@ public class Blocks{
smallDeconstructor = new PayloadDeconstructor("small-deconstructor"){{ smallDeconstructor = new PayloadDeconstructor("small-deconstructor"){{
requirements(Category.units, with(Items.beryllium, 100, Items.silicon, 100, Items.oxide, 40, Items.graphite, 80)); requirements(Category.units, with(Items.beryllium, 100, Items.silicon, 100, Items.oxide, 40, Items.graphite, 80));
regionSuffix = "-dark";
itemCapacity = 100; itemCapacity = 100;
consumePower(1f); consumePower(1f);
size = 3; size = 3;
@@ -3786,6 +3827,7 @@ public class Blocks{
deconstructor = new PayloadDeconstructor("deconstructor"){{ deconstructor = new PayloadDeconstructor("deconstructor"){{
requirements(Category.units, with(Items.beryllium, 250, Items.oxide, 100, Items.silicon, 250, Items.carbide, 250)); requirements(Category.units, with(Items.beryllium, 250, Items.oxide, 100, Items.silicon, 250, Items.carbide, 250));
regionSuffix = "-dark";
itemCapacity = 250; itemCapacity = 250;
consumePower(3f); consumePower(3f);
size = 5; size = 5;
@@ -3794,6 +3836,7 @@ public class Blocks{
constructor = new Constructor("constructor"){{ constructor = new Constructor("constructor"){{
requirements(Category.units, with(Items.silicon, 100, Items.beryllium, 150, Items.tungsten, 80)); requirements(Category.units, with(Items.silicon, 100, Items.beryllium, 150, Items.tungsten, 80));
regionSuffix = "-dark";
hasPower = true; hasPower = true;
buildSpeed = 0.3f; buildSpeed = 0.3f;
consumePower(2f); consumePower(2f);
@@ -3805,16 +3848,19 @@ public class Blocks{
//yes this block is pretty much useless //yes this block is pretty much useless
largeConstructor = new Constructor("large-constructor"){{ largeConstructor = new Constructor("large-constructor"){{
requirements(Category.units, with(Items.silicon, 150, Items.oxide, 150, Items.tungsten, 200, Items.phaseFabric, 40)); requirements(Category.units, with(Items.silicon, 150, Items.oxide, 150, Items.tungsten, 200, Items.phaseFabric, 40));
regionSuffix = "-dark";
hasPower = true; hasPower = true;
consumePower(2f);
buildSpeed = 0.3f; buildSpeed = 0.3f;
maxBlockSize = 4; maxBlockSize = 4;
minBlockSize = 3; minBlockSize = 3;
size = 5; size = 5;
consumePower(2f);
}}; }};
payloadLoader = new PayloadLoader("payload-loader"){{ payloadLoader = new PayloadLoader("payload-loader"){{
requirements(Category.units, with(Items.graphite, 50, Items.silicon, 50, Items.tungsten, 80)); requirements(Category.units, with(Items.graphite, 50, Items.silicon, 50, Items.tungsten, 80));
regionSuffix = "-dark";
hasPower = true; hasPower = true;
consumePower(2f); consumePower(2f);
size = 3; size = 3;
@@ -3822,6 +3868,7 @@ public class Blocks{
payloadUnloader = new PayloadUnloader("payload-unloader"){{ payloadUnloader = new PayloadUnloader("payload-unloader"){{
requirements(Category.units, with(Items.graphite, 50, Items.silicon, 50, Items.oxide, 30)); requirements(Category.units, with(Items.graphite, 50, Items.silicon, 50, Items.oxide, 30));
regionSuffix = "-dark";
hasPower = true; hasPower = true;
consumePower(2f); consumePower(2f);
size = 3; size = 3;

View File

@@ -1471,7 +1471,18 @@ public class Fx{
}); });
}), }),
shootSmokeTris = new Effect(30f, e -> { shootSmokeSquare = new Effect(20f, e -> {
color(Color.white, e.color, e.fin());
rand.setSeed(e.id);
for(int i = 0; i < 6; i++){
float rot = e.rotation + rand.range(22f);
v.trns(rot, rand.random(e.finpow() * 21f));
Fill.poly(e.x + v.x, e.y + v.y, 4, e.fout() * 2f + 0.2f, rand.random(360f));
}
}),
shootSmokeSquareBig = new Effect(30f, e -> {
color(Color.white, e.color, e.fin()); color(Color.white, e.color, e.fin());
rand.setSeed(e.id); rand.setSeed(e.id);

View File

@@ -135,7 +135,7 @@ public class Items{
); );
erekirItems.addAll( erekirItems.addAll(
scrap, graphite, thorium, silicon, phaseFabric, surgeAlloy, sand, graphite, thorium, silicon, phaseFabric, surgeAlloy, sand,
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst
); );
} }

View File

@@ -2830,16 +2830,22 @@ public class UnitTypes{
lifetime = 40f; lifetime = 40f;
trailWidth = 2f; trailWidth = 2f;
trailLength = 4; trailLength = 4;
shake = 0.5f; shake = 1f;
recoil = 0.1f; recoil = 0.1f;
trailEffect = Fx.missileTrail; trailEffect = Fx.missileTrail;
trailParam = 1.8f; trailParam = 1.8f;
trailInterval = 8f; trailInterval = 6f;
hitEffect = despawnEffect = Fx.hitBulletColor; hitEffect = despawnEffect = Fx.hitBulletColor;
shootEffect = new MultiEffect(Fx.shootBigColor, Fx.hitLaserColor); shootEffect = new MultiEffect(Fx.shootBigColor, new Effect(9, e -> {
smokeEffect = Fx.shootSmallSmoke; color(Color.white, e.color, e.fin());
stroke(0.7f + e.fout());
Lines.square(e.x, e.y, e.fin() * 5f, e.rotation + 45f);
Drawf.light(e.x, e.y, 23f, e.color, e.fout() * 0.7f);
}));
smokeEffect = Fx.shootSmokeSquare;
ammoMultiplier = 2; ammoMultiplier = 2;
}}; }};
}}); }});
@@ -2857,7 +2863,7 @@ public class UnitTypes{
shootEffect = Fx.sparkShoot; shootEffect = Fx.sparkShoot;
hitEffect = Fx.pointHit; hitEffect = Fx.pointHit;
maxRange = 100f; maxRange = 100f;
damage = 30f; damage = 35f;
}}; }};
}}); }});
}}; }};
@@ -3034,7 +3040,7 @@ public class UnitTypes{
moveX = fi * 0.3f; moveX = fi * 0.3f;
moveRot = -45f - fi * 17f; moveRot = -45f - fi * 17f;
moves.add(new PartMove(PartProgress.reload.inv().mul(1.8f).inv().curve(fi / 5f, 0.2f), 0f, 0f, 40f)); moves.add(new PartMove(PartProgress.reload.inv().mul(1.8f).inv().curve(fi / 5f, 0.2f), 0f, 0f, 36f));
}}); }});
} }
@@ -3044,7 +3050,7 @@ public class UnitTypes{
lifetime = 30f; lifetime = 30f;
shootEffect = Fx.shootBigColor; shootEffect = Fx.shootBigColor;
smokeEffect = Fx.shootSmokeTris; smokeEffect = Fx.shootSmokeSquareBig;
frontColor = Color.white; frontColor = Color.white;
hitSound = Sounds.none; hitSound = Sounds.none;
width = 12f; width = 12f;
@@ -3093,8 +3099,8 @@ public class UnitTypes{
engineSize = 0; engineSize = 0;
setEnginesMirror( setEnginesMirror(
new UnitEngine(21 / 4f, 19 / 4f, 2.2f, 45f), new UnitEngine(34 / 4f, 31 / 4f, 3f, 45f),
new UnitEngine(23 / 4f, -22 / 4f, 2.2f, 315f) new UnitEngine(35 / 4f, -38 / 4f, 3f, 315f)
); );
}}; }};

View File

@@ -1,11 +1,11 @@
package mindustry.world.blocks.payloads; package mindustry.world.blocks.payloads;
import arc.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
import arc.math.geom.*; import arc.math.geom.*;
import arc.util.*; import arc.util.*;
import arc.util.io.*; import arc.util.io.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.world.*; import mindustry.world.*;
@@ -16,9 +16,8 @@ import static mindustry.Vars.*;
public class PayloadBlock extends Block{ public class PayloadBlock extends Block{
public float payloadSpeed = 0.7f, payloadRotateSpeed = 5f; public float payloadSpeed = 0.7f, payloadRotateSpeed = 5f;
public @Load(value = "@-top", fallback = "factory-top-@size") TextureRegion topRegion; public String regionSuffix = "";
public @Load(value = "@-out", fallback = "factory-out-@size") TextureRegion outRegion; public TextureRegion topRegion, outRegion, inRegion;
public @Load(value = "@-in", fallback = "factory-in-@size") TextureRegion inRegion;
public PayloadBlock(String name){ public PayloadBlock(String name){
super(name); super(name);
@@ -29,6 +28,15 @@ public class PayloadBlock extends Block{
envEnabled |= Env.space | Env.underwater; envEnabled |= Env.space | Env.underwater;
} }
@Override
public void load(){
super.load();
topRegion = Core.atlas.find(name + "-top", "factory-top-" + size + regionSuffix);
outRegion = Core.atlas.find(name + "-out", "factory-out-" + size + regionSuffix);
inRegion = Core.atlas.find(name + "-in", "factory-in-" + size + regionSuffix);
}
public static boolean blends(Building build, int direction){ public static boolean blends(Building build, int direction){
int size = build.block.size; int size = build.block.size;
int trns = build.block.size/2 + 1; int trns = build.block.size/2 + 1;
@@ -164,9 +172,9 @@ public class PayloadBlock extends Block{
updatePayload(); updatePayload();
if(rotate){ if(rotate){
payRotation = Angles.moveToward(payRotation, rotate ? rotdeg() : 90f, payloadRotateSpeed * edelta()); payRotation = Angles.moveToward(payRotation, rotate ? rotdeg() : 90f, payloadRotateSpeed * delta());
} }
payVector.approach(Vec2.ZERO, payloadSpeed * edelta()); payVector.approach(Vec2.ZERO, payloadSpeed * delta());
return hasArrived(); return hasArrived();
} }
@@ -179,7 +187,7 @@ public class PayloadBlock extends Block{
Vec2 dest = Tmp.v1.trns(rotdeg(), size * tilesize/2f); Vec2 dest = Tmp.v1.trns(rotdeg(), size * tilesize/2f);
payRotation = Angles.moveToward(payRotation, rotdeg(), payloadRotateSpeed * edelta()); payRotation = Angles.moveToward(payRotation, rotdeg(), payloadRotateSpeed * edelta());
payVector.approach(dest, payloadSpeed * delta()); payVector.approach(dest, payloadSpeed * edelta());
Building front = front(); Building front = front();
boolean canDump = front == null || !front.tile().solid(); boolean canDump = front == null || !front.tile().solid();