5x5 burst drill

This commit is contained in:
Anuken
2021-12-28 19:18:16 -05:00
parent 37bc06d14a
commit 0ede0dbf0c
18 changed files with 139 additions and 39 deletions

View File

@@ -110,7 +110,7 @@ public class Blocks{
//production
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
cliffCrusher, plasmaBore, largePlasmaBore, impactDrill,
cliffCrusher, plasmaBore, largePlasmaBore, impactDrill, eruptionDrill,
//storage
coreShard, coreFoundation, /*TODO core foundation is a bad name, rename to fragment */ coreNucleus, vault, container, unloader,
@@ -998,7 +998,7 @@ public class Blocks{
//TODO better name
electrolyzer = new GenericCrafter("electrolyzer"){{
requirements(Category.crafting, with(Items.silicon, 50, Items.graphite, 40, Items.beryllium, 40));
requirements(Category.crafting, with(Items.silicon, 50, Items.graphite, 40, Items.beryllium, 50));
size = 3;
craftTime = 10f;
@@ -1007,7 +1007,7 @@ public class Blocks{
liquidCapacity = 50f;
consumes.liquid(Liquids.water, 10f / 60f);
consumes.power(2f);
consumes.power(1f);
drawer = new DrawMulti(
new DrawRegion("-bottom"),
@@ -1036,7 +1036,7 @@ public class Blocks{
}};
atmosphericConcentrator = new HeatCrafter("atmospheric-concentrator"){{
requirements(Category.crafting, with(Items.oxide, 50, Items.beryllium, 30, Items.silicon, 40));
requirements(Category.crafting, with(Items.oxide, 50, Items.beryllium, 60, Items.silicon, 40));
size = 3;
craftTime = 10f;
hasLiquids = true;
@@ -1060,14 +1060,14 @@ public class Blocks{
}};
oxidationChamber = new HeatProducer("oxidation-chamber"){{
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 40, Items.silicon, 50));
requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 40, Items.silicon, 50, Items.beryllium, 50));
size = 3;
outputItem = new ItemStack(Items.oxide, 1);
consumes.liquid(Liquids.ozone, 2f / 60f);
consumes.item(Items.beryllium);
consumes.power(1f);
consumes.power(0.5f);
rotateDraw = false;
@@ -1091,7 +1091,7 @@ public class Blocks{
}};
phaseHeater = new HeatProducer("phase-heater"){{
requirements(Category.crafting, with(Items.oxide, 30, Items.carbide, 30));
requirements(Category.crafting, with(Items.oxide, 30, Items.carbide, 30, Items.beryllium, 30));
drawer = new DrawMulti(new DrawHeatOutput(true));
drawer.iconOverride = new String[]{""};
@@ -1207,7 +1207,7 @@ public class Blocks{
cyanogenSynthesizer = new HeatCrafter("cyanogen-synthesizer"){{
//TODO requirements
requirements(Category.crafting, with(Items.carbide, 50, Items.silicon, 80, Items.beryllium, 80));
requirements(Category.crafting, with(Items.carbide, 50, Items.silicon, 80, Items.beryllium, 90));
heatRequirement = 5f;
@@ -1238,7 +1238,7 @@ public class Blocks{
//TODO bad name, and there's no use for phase yet...
phaseSynthesizer = new HeatCrafter("phase-synthesizer"){{
requirements(Category.crafting, with(Items.surgeAlloy, 60, Items.carbide, 40, Items.silicon, 80, Items.thorium, 80));
requirements(Category.crafting, with(Items.surgeAlloy, 70, Items.carbide, 90, Items.silicon, 100, Items.thorium, 100, Items.beryllium, 200));
size = 3;
@@ -1272,7 +1272,6 @@ public class Blocks{
}};
heatReactor = new HeatProducer("heat-reactor"){{
//TODO gas/liquid requirement?
requirements(Category.crafting, with(Items.oxide, 70, Items.graphite, 20, Items.carbide, 10, Items.thorium, 80));
size = 3;
craftTime = 60f * 10f;
@@ -1549,7 +1548,7 @@ public class Blocks{
//TODO green looks bad switch to orange
//TODO orange also looks bad hhhh
regenProjector = new RegenProjector("regen-projector"){{
requirements(Category.effect, with(Items.silicon, 60, Items.tungsten, 60, Items.oxide, 30));
requirements(Category.effect, with(Items.silicon, 60, Items.tungsten, 60, Items.oxide, 30, Items.beryllium, 80));
size = 3;
consumes.power(1f);
range = 28;
@@ -2303,12 +2302,12 @@ public class Blocks{
//TODO should be crusher or something
impactDrill = new BurstDrill("impact-drill"){{
requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50));
requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 60));
drillTime = 60f * 12f;
size = 4;
hasPower = true;
tier = 6;
drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam);
drillEffect = new MultiEffect(Fx.mineImpact, Fx.drillSteam, Fx.mineImpactWave.wrap(Pal.redLight, 40f));
shake = 4f;
itemCapacity = 40;
@@ -2316,7 +2315,31 @@ public class Blocks{
consumes.liquid(Liquids.water, 0.2f);
}};
//TODO higher tier impact drill, 5x5
//TODO bad name
eruptionDrill = new BurstDrill("eruption-drill"){{
requirements(Category.production, with(Items.silicon, 200, Items.beryllium, 250, Items.oxide, 80, Items.carbide, 80));
drillTime = 60f * 9f;
size = 5;
hasPower = true;
tier = 7;
//TODO better effect
drillEffect = new MultiEffect(
Fx.mineImpact,
Fx.drillSteam,
Fx.dynamicSpikes.wrap(Liquids.hydrogen.color, 30f),
Fx.mineImpactWave.wrap(Liquids.hydrogen.color, 45f)
);
shake = 4f;
itemCapacity = 50;
arrowOffset = 2f;
arrowSpacing = 5f;
arrows = 2;
glowColor.a = 0.6f;
//TODO different requirements
consumes.power(6f);
consumes.liquids(LiquidStack.with(Liquids.water, 0.5f, Liquids.hydrogen, 4f / 60f));
}};
//endregion
//region storage
@@ -2375,7 +2398,7 @@ public class Blocks{
coreCitadel = new CoreBlock("core-citadel"){{
//TODO cost
requirements(Category.effect, with(Items.silicon, 5000, Items.beryllium, 7000, Items.tungsten, 5000, Items.carbide, 5000));
requirements(Category.effect, with(Items.silicon, 5000, Items.beryllium, 8000, Items.tungsten, 5000, Items.carbide, 5000));
unitType = UnitTypes.incite;
health = 18000;
@@ -2389,7 +2412,7 @@ public class Blocks{
coreAcropolis = new CoreBlock("core-acropolis"){{
//TODO cost
requirements(Category.effect, with(Items.beryllium, 11000, Items.silicon, 11000, Items.tungsten, 9000, Items.carbide, 10000, Items.oxide, 8000));
requirements(Category.effect, with(Items.beryllium, 12000, Items.silicon, 11000, Items.tungsten, 9000, Items.carbide, 10000, Items.oxide, 8000));
unitType = UnitTypes.emanate;
health = 30000;
@@ -2423,7 +2446,7 @@ public class Blocks{
}};
reinforcedContainer = new StorageBlock("reinforced-container"){{
requirements(Category.effect, with(Items.tungsten, 100, Items.graphite, 50));
requirements(Category.effect, with(Items.tungsten, 100, Items.graphite, 50, Items.beryllium, 50));
size = 3;
//TODO should it really be kept the same, at 1000?
itemCapacity = 1200;
@@ -2431,7 +2454,7 @@ public class Blocks{
}};
reinforcedVault = new StorageBlock("reinforced-vault"){{
requirements(Category.effect, with(Items.tungsten, 250, Items.carbide, 125));
requirements(Category.effect, with(Items.tungsten, 250, Items.carbide, 125, Items.beryllium, 100));
size = 4;
itemCapacity = 2500;
scaledHealth = 120;
@@ -2954,7 +2977,7 @@ public class Blocks{
//TODO bad name
sublimate = new ContinuousTurret("sublimate"){{
//TODO requirements
requirements(Category.turret, with(Items.tungsten, 150, Items.silicon, 160, Items.oxide, 50));
requirements(Category.turret, with(Items.tungsten, 150, Items.silicon, 160, Items.oxide, 50, Items.beryllium, 200));
draw = new DrawTurret("reinforced-"){{
liquidDraw = Liquids.ozone;

View File

@@ -139,7 +139,9 @@ public class ErekirTechTree{
node(impactDrill, erekirSector, () -> {
node(largePlasmaBore, () -> {
node(eruptionDrill, () -> {
});
});
});
});

View File

@@ -409,6 +409,24 @@ public class Fx{
}
}).layer(Layer.bullet - 4f),
dynamicSpikes = new Effect(40f, 100f, e -> {
color(e.color);
stroke(e.fout() * 2f);
float circleRad = 4f + e.finpow() * e.rotation;
Lines.circle(e.x, e.y, circleRad);
for(int i = 0; i < 4; i++){
Drawf.tri(e.x, e.y, 6f, e.rotation * 1.5f * e.fout(), i*90);
}
color();
for(int i = 0; i < 4; i++){
Drawf.tri(e.x, e.y, 3f, e.rotation * 1.45f / 3f * e.fout(), i*90);
}
Drawf.light(e.x, e.y, circleRad * 1.6f, Pal.heal, e.fout());
}),
greenBomb = new Effect(40f, 100f, e -> {
color(Pal.heal);
stroke(e.fout() * 2f);
@@ -2073,22 +2091,21 @@ public class Fx{
randLenVectors(e.id, 12, 5f + e.finpow() * 22f, (x, y) -> {
Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45);
});
}),
color(Pal.redLight);
mineImpactWave = new Effect(50f, e -> {
color(e.color);
e.scaled(50f, b -> {
stroke(b.fout() * 1.5f);
stroke(e.fout() * 1.5f);
randLenVectors(e.id, 12, 4f + b.finpow() * 40f, (x, y) -> {
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), b.fout() * 5 + 1f);
});
randLenVectors(e.id, 12, 4f + e.finpow() * e.rotation, (x, y) -> {
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 5 + 1f);
});
e.scaled(30f, b -> {
Lines.stroke(5f * b.fout());
Lines.circle(e.x, e.y, b.finpow() * 28f);
});
}),
payloadReceive = new Effect(30, e -> {

View File

@@ -9,8 +9,6 @@ import mindustry.game.Objectives.*;
import mindustry.gen.*;
import mindustry.type.*;
import java.util.*;
/** Class for storing a list of TechNodes with some utility tree builder methods; context dependent. See {@link SerpuloTechTree#load} source for example usage. */
public class TechTree{
private static TechNode context = null;
@@ -126,8 +124,6 @@ public class TechTree{
for(ItemStack requirement : requirements){
requirement.amount = (int)(requirement.amount * researchCostMultipliers.get(requirement.item, 1));
}
Log.info("@ = @", content, Arrays.toString(requirements));
}
setupRequirements(requirements);

View File

@@ -10,6 +10,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.entities.effect.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.world.*;
@@ -93,6 +94,14 @@ public class Effect{
return this;
}
public WrapEffect wrap(Color color){
return new WrapEffect(this, color);
}
public WrapEffect wrap(Color color, float rotation){
return new WrapEffect(this, color, rotation);
}
public void at(Position pos){
create(this, pos.getX(), pos.getY(), 0, Color.white, null);
}

View File

@@ -0,0 +1,40 @@
package mindustry.entities.effect;
import arc.graphics.*;
import mindustry.entities.*;
/** Wraps an effect with some parameters. */
public class WrapEffect extends Effect{
public Effect effect;
public Color color = Color.white.cpy();
public float rotation = Float.NaN;
public WrapEffect(){
}
public WrapEffect(Effect effect, Color color){
this.effect = effect;
this.color = color;
}
public WrapEffect(Effect effect, Color color, float rotation){
this.effect = effect;
this.color = color;
this.rotation = rotation;
}
@Override
public void init(){
effect.init();
clip = effect.clip;
lifetime = effect.lifetime;
}
@Override
public void render(EffectContainer e){
e.color = color;
if(!Float.isNaN(rotation)) e.rotation = rotation;
effect.render(e);
clip = Math.max(clip, effect.clip);
}
}

View File

@@ -95,6 +95,10 @@ public class Drawf{
}
}
public static void additive(TextureRegion region, Color color, float x, float y){
additive(region, color, x, y, 0f, Layer.blockAdditive);
}
public static void additive(TextureRegion region, Color color, float x, float y, float rotation){
additive(region, color, x, y, rotation, Layer.blockAdditive);
}

View File

@@ -14,12 +14,15 @@ public class BurstDrill extends Drill{
public Interp speedCurve = Interp.pow2In;
public @Load("@-top-invert") TextureRegion topInvertRegion;
public @Load("@-glow") TextureRegion glowRegion;
public @Load("@-arrow") TextureRegion arrowRegion;
public @Load("@-arrow-blur") TextureRegion arrowBlurRegion;
public float invertedTime = 200f;
public float arrowSpacing = 4f;
public float arrowSpacing = 4f, arrowOffset = 0f;
public int arrows = 3;
public Color arrowColor = Color.valueOf("feb380"), baseArrowColor = Color.valueOf("6e7080");
public Color glowColor = arrowColor.cpy();
public BurstDrill(String name){
super(name);
@@ -93,7 +96,7 @@ public class BurstDrill extends Drill{
drawDefaultCracks();
Draw.rect(topRegion, x, y);
if(invertTime > 0){
if(invertTime > 0 && topInvertRegion.found()){
Draw.alpha(Interp.pow3Out.apply(invertTime));
Draw.rect(topInvertRegion, x, y);
Draw.color();
@@ -106,13 +109,12 @@ public class BurstDrill extends Drill{
}
float fract = smoothProgress;
int arrows = 3;
Draw.color(arrowColor);
for(int i = 0; i < 4; i++){
for(int j = 0; j < arrows; j++){
float arrowFract = (arrows - 1 - j);
float a = Mathf.clamp(fract * arrows - arrowFract);
Tmp.v1.trns(i * 90 + 45, j * arrowSpacing);
Tmp.v1.trns(i * 90 + 45, j * arrowSpacing + arrowOffset);
//TODO maybe just use arrow alpha and draw gray on the base?
Draw.z(Layer.block);
@@ -121,14 +123,20 @@ public class BurstDrill extends Drill{
Draw.color(arrowColor);
Draw.z(Layer.blockAdditive);
Draw.blend(Blending.additive);
Draw.alpha(Mathf.pow(a, 10f));
Draw.rect(arrowBlurRegion, x + Tmp.v1.x, y + Tmp.v1.y, i * 90);
Draw.blend();
if(arrowBlurRegion.found()){
Draw.z(Layer.blockAdditive);
Draw.blend(Blending.additive);
Draw.alpha(Mathf.pow(a, 10f));
Draw.rect(arrowBlurRegion, x + Tmp.v1.x, y + Tmp.v1.y, i * 90);
Draw.blend();
}
}
}
Draw.color();
if(glowRegion.found()){
Drawf.additive(glowRegion, Tmp.c2.set(glowColor).a(Mathf.pow(fract, 3f) * glowColor.a), x, y);
}
}
}
}