From 947864269bd5e2b9b3e8b36770aa300a0ed2caec Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 22 Nov 2021 14:48:26 -0500 Subject: [PATCH] Slag-based incinerator --- .../production/slag-incinerator-liquid.png | Bin 0 -> 138 bytes .../production/slag-incinerator-top.png | Bin 0 -> 141 bytes .../blocks/production/slag-incinerator.png | Bin 0 -> 601 bytes core/assets/icons/icons.properties | 2 + core/assets/logicids.dat | Bin 3453 -> 3490 bytes core/src/mindustry/content/Blocks.java | 54 ++++++++++++-- core/src/mindustry/content/Fx.java | 13 ++-- .../blocks/production/ItemIncinerator.java | 68 ++++++++++++++++++ 8 files changed, 128 insertions(+), 9 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/production/slag-incinerator-liquid.png create mode 100644 core/assets-raw/sprites/blocks/production/slag-incinerator-top.png create mode 100644 core/assets-raw/sprites/blocks/production/slag-incinerator.png create mode 100644 core/src/mindustry/world/blocks/production/ItemIncinerator.java diff --git a/core/assets-raw/sprites/blocks/production/slag-incinerator-liquid.png b/core/assets-raw/sprites/blocks/production/slag-incinerator-liquid.png new file mode 100644 index 0000000000000000000000000000000000000000..4759ece2ce30be0746d355317315eb89b94f20e4 GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E}kxqArY-_ zFB|d!RXGQK_*cGevl>r`_~ZKOh0HDt40Y4<0wzs!oOw-0dyBrk=0(1c(|3gyM?Wy* j+Ed;V%K4p_kzq!`ei5D{KQvYW&13L%^>bP0l+XkKBn~T9 literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/production/slag-incinerator-top.png b/core/assets-raw/sprites/blocks/production/slag-incinerator-top.png new file mode 100644 index 0000000000000000000000000000000000000000..5fd4aef51101a642756c30718ad7a8c87af551e0 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}?w&4=ArY-_ zFBtLxRk1jJ{9kV;ovgEhA-TuecEdtbh6C?)jCDM-Cq`z3TO`=e>wIyMpPx%6G=otR9JGc8G2AC!6)bw6fgGRONcqQ zFVR3Q=28%RgdXidHcVz`X4ka-K`@&!^ULgftjSCMda~9)NY8`1`Mx>w_Axe8X}vF@ zs_L+%;7D7G0ssK`D@0f4002GrrQVkS06@2+0UPKLRPJ}7?M?9ojl`u<(Lf|6clVDc zx@d+Y)_8Rr=QRKH*Q7|K>?$K`O;l!Yj)rw6MZyE%-X1?tgTVJ$S`0+b zvp{l{K_6D^worK1B}}F>7D7wJx10lD1L7bw=bNKB zM<52m>3zKtZ7D>^IRM%M4dTCrOE$U_UP}!C4fQpJw` z51gb(U_duJ0Q?DvBcx74GaRuH#ct~*F5NN-p2|BDau8Hp;>MOS%?~dJLJ*oGd@ppe z5&<-bn73T^PthkU5rBi>&IppIZM`qW>QHAvY$C-zgM(13p!I;hf6rw;w>1(x{Rh^0 n8sf6Mbd=*rbOPWUc7^x_UpO3}{svJJ00000NkvXXu0mjfFChfJ literal 0 HcmV?d00001 diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 70b201e130..b69beefcda 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -455,3 +455,5 @@ 63251=gallium|liquid-gallium-ui 63250=slag-centrifuge|block-slag-centrifuge-ui 63249=slag-heater|block-slag-heater-ui +63248=slag-incinerator|block-slag-incinerator-ui +63247=phase-synthesizer|block-phase-synthesizer-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 4116860eb8b0324e6fc0a1ae399acbf04e9b0085..d2181074789ee3d2d21f44fc3491bc3f425be517 100644 GIT binary patch delta 51 zcmew>wMd$Y;lM^FZf+%k;+({E-ORk?%)Hd1#FG3X2El@i#Nt%l;>x^|jMU=Hs?A*7 G#Y_Oe$q|77 delta 16 XcmZ1^{a1>KVc$k3Ztl%S+yzVkE|Ubn diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 780f81c5c4..2d41190ded 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -60,7 +60,7 @@ public class Blocks implements ContentList{ //crafting siliconSmelter, siliconCrucible, siliconArcFurnace, kiln, graphitePress, plastaniumCompressor, multiPress, phaseWeaver, surgeSmelter, pyratiteMixer, blastMixer, cryofluidMixer, melter, separator, disassembler, sporePress, pulverizer, incinerator, coalCentrifuge, - electrolyzer, oxidationChamber, slagHeater, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, + electrolyzer, oxidationChamber, slagHeater, slagIncinerator, heatReactor, carbideCrucible, slagCentrifuge, surgeCrucible, cyanogenSynthesizer, phaseSynthesizer, cellSynthesisChamber, //sandbox @@ -105,7 +105,7 @@ public class Blocks implements ContentList{ duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami, //turrets - erekir - breach, fracture, + breach, fracture, sublimate, //units commandCenter, @@ -120,10 +120,8 @@ public class Blocks implements ContentList{ message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank, //campaign - launchPad, interplanetaryAccelerator, + launchPad, interplanetaryAccelerator - //nuclear? - nuclearWarhead, warheadAssembler, ballisticSilo //TODO ; /** @deprecated use the blocks with proper names */ @@ -1022,6 +1020,12 @@ public class Blocks implements ContentList{ consumes.power(0.5f / 60f); }}; + slagIncinerator = new ItemIncinerator("slag-incinerator"){{ + requirements(Category.crafting, with(Items.tungsten, 15)); + size = 1; + consumes.liquid(Liquids.slag, 2f / 60f); + }}; + heatReactor = new HeatProducer("heat-reactor"){{ //TODO quadvent? //TODO coolant? @@ -1149,6 +1153,39 @@ public class Blocks implements ContentList{ liquidCapacity = 40f; }}; + //TODO bad name + phaseSynthesizer = new HeatCrafter("phase-synthesizer"){{ + requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 60, Items.carbide, 30)); + + size = 3; + + itemCapacity = 30; + heatRequirement = 8f; + craftTime = 60f * 5f; + liquidCapacity = 80f * 5; + + ambientSound = Sounds.techloop; + ambientSoundVolume = 0.07f; + + outputItem = new ItemStack(Items.phaseFabric, 1); + + drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawCircles(){{ + color = Color.valueOf("ffc073").a(0.24f); + strokeMax = 2.5f; + radius = 10f; + amount = 3; + }}, new DrawLiquidRegion(Liquids.slag), new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion(){{ + heatColor = Color.valueOf("ff6060ff"); + }}, new DrawHeatRegion("-vents"){{ + heatColor.a = 1f; + }}); + iconOverride = new String[]{"-bottom", ""}; + + consumes.items(with(Items.thorium, 1, Items.sand, 4)); + consumes.liquid(Liquids.ozone, 4f / 60f); + consumes.power(10f); + }}; + //TODO needs to be completely redone from the ground up cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{ //TODO booster mechanics? @@ -2641,6 +2678,13 @@ public class Blocks implements ContentList{ limitRange(); }}; + //TODO bad name + if(false) + sublimate = new ContinuousTurret("sublimate"){{ + //TODO requirements + requirements(Category.turret, with(Items.tungsten, 35, Items.silicon, 35), true); + }}; + //endregion //region units diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 639b2fb98d..4d06a5eec1 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -1687,17 +1687,22 @@ public class Fx{ generatespark = new Effect(18, e -> { randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> { - float len = e.fout() * 4f; color(Pal.orangeSpark, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, len/2f); + Fill.circle(e.x + x, e.y + y, e.fout() * 4f /2f); }); }), fuelburn = new Effect(23, e -> { randLenVectors(e.id, 5, e.fin() * 9f, (x, y) -> { - float len = e.fout() * 4f; color(Color.lightGray, Color.gray, e.fin()); - Fill.circle(e.x + x, e.y + y, len/2f); + Fill.circle(e.x + x, e.y + y, e.fout() * 2f); + }); + }), + + incinerateSlag = new Effect(34, e -> { + randLenVectors(e.id, 4, e.finpow() * 5f, (x, y) -> { + color(Pal.slagOrange, Color.gray, e.fin()); + Fill.circle(e.x + x, e.y + y, e.fout() * 1.7f); }); }), diff --git a/core/src/mindustry/world/blocks/production/ItemIncinerator.java b/core/src/mindustry/world/blocks/production/ItemIncinerator.java new file mode 100644 index 0000000000..bfc4cca07a --- /dev/null +++ b/core/src/mindustry/world/blocks/production/ItemIncinerator.java @@ -0,0 +1,68 @@ +package mindustry.world.blocks.production; + +import arc.graphics.g2d.*; +import arc.math.*; +import mindustry.annotations.Annotations.*; +import mindustry.content.*; +import mindustry.entities.*; +import mindustry.gen.*; +import mindustry.graphics.*; +import mindustry.type.*; +import mindustry.world.*; +import mindustry.world.meta.*; + +/** Incinerator that accepts only items and optionally requires a liquid, e.g. slag. */ +public class ItemIncinerator extends Block{ + public Effect effect = Fx.incinerateSlag; + public float effectChance = 0.2f; + + public @Load("@-liquid") TextureRegion liquidRegion; + public @Load("@-top") TextureRegion topRegion; + + public ItemIncinerator(String name){ + super(name); + update = true; + solid = true; + } + + @Override + public TextureRegion[] icons(){ + return new TextureRegion[]{region, topRegion}; + } + + public class ItemIncineratorBuild extends Building{ + + @Override + public void updateTile(){ + } + + @Override + public BlockStatus status(){ + return consValid() ? BlockStatus.active : BlockStatus.noInput; + } + + @Override + public void draw(){ + super.draw(); + + if(liquidRegion.found()){ + Drawf.liquid(liquidRegion, x, y, liquids.currentAmount() / liquidCapacity, liquids.current().color); + } + if(topRegion.found()){ + Draw.rect(topRegion, x, y); + } + } + + @Override + public void handleItem(Building source, Item item){ + if(Mathf.chance(effectChance)){ + effect.at(x, y); + } + } + + @Override + public boolean acceptItem(Building source, Item item){ + return consValid(); + } + } +}