From 6b3dfa60365310b628c99d2dcd62fc0a72c9bd4a Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 5 Nov 2021 16:41:08 -0400 Subject: [PATCH] Carbide, surge conveyors --- .../blocks/distribution/ducts/duct-top-0.png | Bin 329 -> 2049 bytes .../distribution/ducts/surge-duct-glow-0.png | Bin 0 -> 2058 bytes .../distribution/ducts/surge-duct-top-0.png | Bin 0 -> 708 bytes .../stack-conveyors/surge-conveyor-0.png | Bin 0 -> 312 bytes .../stack-conveyors/surge-conveyor-1.png | Bin 0 -> 687 bytes .../stack-conveyors/surge-conveyor-2.png | Bin 0 -> 706 bytes .../stack-conveyors/surge-conveyor-edge.png | Bin 0 -> 591 bytes .../stack-conveyors/surge-conveyor-glow.png | Bin 0 -> 2058 bytes .../stack-conveyors/surge-conveyor-stack.png | Bin 0 -> 298 bytes .../stack-conveyors/surge-conveyor.png | Bin 0 -> 668 bytes .../assets-raw/sprites/items/item-carbide.png | Bin 0 -> 457 bytes core/assets/icons/icons.properties | 5 ++ core/assets/logicids.dat | Bin 3013 -> 3056 bytes core/src/mindustry/content/Blocks.java | 40 +++++++++++++-- core/src/mindustry/content/Items.java | 4 +- .../mindustry/entities/comp/BuildingComp.java | 2 +- core/src/mindustry/graphics/Layer.java | 3 ++ core/src/mindustry/world/Block.java | 1 + .../src/mindustry/world/blocks/Autotiler.java | 3 +- .../blocks/distribution/StackConveyor.java | 47 +++++++++++++++--- .../world/blocks/production/BurstDrill.java | 7 ++- 21 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/distribution/ducts/surge-duct-glow-0.png create mode 100644 core/assets-raw/sprites/blocks/distribution/ducts/surge-duct-top-0.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-0.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-1.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-2.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-edge.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-glow.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-stack.png create mode 100644 core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor.png create mode 100644 core/assets-raw/sprites/items/item-carbide.png diff --git a/core/assets-raw/sprites/blocks/distribution/ducts/duct-top-0.png b/core/assets-raw/sprites/blocks/distribution/ducts/duct-top-0.png index 04cd2abceb6eecdd02b35ac78e0f74612565667b..eae68cbeafb92452f6ab5b4805710f58e3e090b3 100644 GIT binary patch delta 2036 zcmX@f)F?1Pxt^7yDkP#LD6w3jpeR2rGbdG{q_QAYA+;hije()!*4gmLX)5YGf1Zoj zF$r-TDU7)PnYX5fU1jFnt)=JBd~Vma=Jw)HRBBr4`~Ug-#D9m{J#SWYN(FI<$uZ!Z_Fv%hin>H!1GDerzre*SiT!|Cw$VxD@f{<6ipTT9uMej99= zt$e;}w>qb_eAy@KfLHFSD!t!BPV*#)- zJ2fX$_k6x>)hKVd|5Zvr#q=@*hEE22H*fjIcY*mt`dORB^;hQ|c)sWDJI>P^44t0l zGM}7$H}>#{+Jy4dBmKMyCiVM#()TBu$S#)OeA6Rx-Am~ZwTuda#G2d8o#^n9c2~n!E zwTjK&cBM%D^2Xqj`%By9c7MC_x#3!yblnLKWj@)=C*51mzB>I`ddT@OZvs0mf$bJnRP`QB!5on zT=FX}_e*N3?yA+c=Z&kTJzKL!GyS`%c0yDxf2FC)rSi{*ujs5@c|zpc`Jc5~XXlsw z+0RlGdwA8o4LT|TlPBIdHp5g$pmG|!8-yZaR z{cuu&!P9^k*Hg;_P5A3sf7d=M2-(IG9&`0kVe-xw^A)6zK06t*@x0o_YtMNu+_6%7D4Cvmak*#1tDN7@H$rdCZy~BE6#`6%0~>C4~M9yT|4A6{ZZSZCAao1|8?Qm zu@dRCo3Af=I{A&95BsbbuenQRXEPjH#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git a/core/assets-raw/sprites/blocks/distribution/ducts/surge-duct-glow-0.png b/core/assets-raw/sprites/blocks/distribution/ducts/surge-duct-glow-0.png new file mode 100644 index 0000000000000000000000000000000000000000..469de3074286ab983f166c989bf1ec8935dd365a GIT binary patch literal 2058 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANOK=2amPB|(Yh3I#>^X_+~x z3MG{VsS2qTnQ06R6}R3_kDm5egQx9&q^mxoC&!VZ9rKK>XFUDRUl!xJN`LCC%AQVL z9fwI@6MgRd_&)z--Gc>l&anE575B)wpHM7zJo=~bNv*2+k9^HO-a z!}sZ%_yyPd8O`NGb%yTU_9%bnw{Lbh zTb?gyE$t|MFDJqo`HIW^kWI^x_p44nMxTx1Of0RF|`%!1$}>$>Orv#WMck zPA+bbEf<$A^LTTx0_*n4fCgWv)60%8X2zeac{H|on^8u=ZZkm zgM*xtb~0YMG*ji=ohJ`koF-3Bd6|@Ov%*4f#m}zRZTI*5H8rYu*RsyXz)j-Q?MMHv z{O~F)-ZoX~Q`u9l!jH4Ab0klU4*$X=FiYM1F6X|f!u$8nwx6*|VTJYCHg=tTa%!tC z9ltZ_Y~%%h#s2V)m{-dgmvHP8J@`PB{F;) zr0U7#8SJAOd1~d12!pK|C(mq}dM0uMTUMWC>S@dAht?ekY+T#)k9F3m(5w|v$-Y;! z)-6r^wdKN=qtj+>z2o&|NZ&HCysZkiG6WiGsBnsDqHhaTp}iYOL?g_VY%-4s74ZJ+V;OoiqY z!6kZT>nUebM+eW!k5aaR1JWA)0<#diH~p2NKB{GB?-wd>!<+&mI_+?ERP7H@iVA>r-p zi8acLX6sxlUGT2<<}T-5=|{_--oAiPZgItXJBJn1XQq|*Fwe@Hz0xJ-OiK9CbKzeUTIyH?Cd^Dd;~6Bh z?`x@lZAiJ{yr=iSr+-~#+0Do}v0|F!GT%LpHhVLr=X~!}UZb)4$nzt~YOxc3OnlvS zJbwijOy*s_fnzwr^qEiaA3ZarmlMYuJs`hWjukJ;~{*BYa0P^7bfiFea$_W#ZIH*ftk zSvW4pg0Ce`=6N#9i#x1RrpJHUmCZTEDNw_BW=d7K3vk;M!Q+`=Ht$S`Y; z1Oo#Ddx@v7EBjM!Rv{+F2?vhsU|?W6?CIhd5^?xwcx?V<2Z1@oZzgQ<(+vI3_V>U3 z)F1o`^JZ;RQBY{Qpt4T*cwhhYomr7{YtvT>O$(d;E$8f=x-;))-oDMhV`pXm>(|;W za?Kx-mG2!q?mypf|L)`GuW~J07rkU>;VkhV-#dkRt!AGZV1A{zF?iRkjcZ+vf9b~TfA-(& ze2zelTddWE4<@XgQ|FcKNxM^SD=M&tY4tJP>)c!qzr`MLC=#hX!2M47LH1Gig-L#C z?L8^m@(tc*yBVcTRS4#j@M^wXczy4Kt;aq+$dIcx^t|#bOMLReaO3-5eVE;v<@^X_+~x z3=A3*YbV-z91aj^^$+e|B%Y64Z+U(7g zp7Xs^d5y;EBhQZ{tHni_+tJ!Zd) zUTci1L6Ob^Cf-f2+5b1+-@NtHWZ}3V3%-^(ndiwYFYd5PnI8XXS2pJur$7zcx-ZlA z2eGHwd9L5O<%Qsd?YuED+f7pWcidrQo6mD|O01@b_lf6?-;IAQ(=jOEE?Hk$oIUUH z7er_ z$bhFccgn(7Jx6Xx7D}%>s3;)*$mmbWQfuub6K>~A*H%uxG4t0pv&?(q$2Vr}iT7ja z;XAHtE^_tpFR}A?GjyM5v)XV4FeeEfkYajSmR7u=%|$SRQKxl&{tTvE=7x^Roi0b7 zahVEE+e z;usRqy7#)F&>;l@)(fpC6)hU3ZIf~G?oZ6mKYj7iEIfBNbVBFsC#?oW8aep1TsODXq~ za3;xr%o43X&flq`YV6tH`c>^^$!J Q0|Nttr>mdKI;Vst05e>A`~Uy| literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-1.png b/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-1.png new file mode 100644 index 0000000000000000000000000000000000000000..ef69e2600be485ac5b15b24e835245bcb41cd87d GIT binary patch literal 687 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4kiW$hCdQ-7c($0wq!ax2Y5O=D-;yvr)B1( zGB9XNtet4XSy_5!jg?XvF5(V=G{BxtM zp4UDy(Dvl|X!&u4qqs`llU;8CD(69z2SIqpG|Mw?OA)+W8N`LRF5@Map$`5MV#xvZ^_zVK8YQyRoCy_i~4O* z%V2aR^c9`INaa0|Ub|PZ!4!kItvl4EYWj z@VGW7K4zLbBO&GO(i=A;tC!wu5H*vCm|(%cp5V}>bll9o(CFdHwU56~IWle6j(L2J zosWMmT^ix@c)`*W{@cY*H!1CkRpQWk;if1aa(QdfrptBgnVn&LS$^pbuN?hlPam(k z-2AWi=g%u>56<0E7QobG``luh^-~r1}5K1i2fk=7k0v@0FG- u>xXSy_5!jg?XvF5(V=G{BxtM zp4UDy(Dvl|X!&u4qqs`llU;8CD(69z2SIqpG|Mw?OA)+W8N`LRF5@Map$`5MV#xvZ^_zVK8YQyRoCy_i~4O* z%V2aR^c9`INaa0|UcPPZ!4!kIuE%7786Q z;9+~9_n=^QgeaFvnSSf>Ed8v^vA`ppt=M6%UoZ3hZPE^=S&{*^w%jqFUe11-_v=I5 zZV{=(58cPJ&gyg(=IpkszEM`&liXQYweMu_H~lYv7tQBcTX`Tugi&mh{c?{DsMlVS~7>{Z2gqxYr7C*x4*7Yh6MMc7Q8@=PWk)cMDdn~`U|dBeVU3=9km Mp00i_>zopr0DP4-ssI20 literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-edge.png b/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor-edge.png new file mode 100644 index 0000000000000000000000000000000000000000..8144b95cbefcef48e58c1d6f6156c81557393903 GIT binary patch literal 591 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANNfEt$^F0iMpz3IRp=X_+~x z3=A3*YbV-z9Cna78h?3OSBUJHfFp{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RrpJHUmCZTEDNw_BW=d7K3vk;M!Q+`=Ht$S`Y; z1Oo#Ddx@v7EBjM!Rv{+F2?vhsU|?W6?CIhd5^?xwcx?V<2Z1@oZzgQ<(+vI3_V>U3 z)F1o`^JZ;RQBY{Qpt4T*cwhhYomr7{YtvT>O$(d;E$8f=x-;))-oDMhV`pXm>(|;W za?Kx-mG2!q?mypf|L)`GuW~J07rkU>;VkhV-#dkRt!AGZV1A{zF?iRkjcZ+vf9b~TfA-(& ze2zelTddWE4<@XgQ|FcKNxM^SD=M&tY4tJP>)c!qzr`MLC=#hX!2M47LH1Gig-L#C z?L8^m@(tc*yBVcTRS4#j@M^wXczy4Kt;aq+$dIcx^t|#bOMLReaO3-5eVE;v<@V0hx` z;usRqnw%iPx;UYMQF*7-dXu#O$JN&d+fUWl+*x+u%gpXToh`M6O$+3bWE`h3U(j8? zOnJtMt#cY18y{|HVRd8|V5*31KVOuiaQGEpUU!M~##^nI8F%RHuluX#=dGspxLn`N zU7&|4NjE(qA>qXQZhOza`(yeaIxUiQI8l@&+sGH;5#+0KV*cq93s$b|QJOYWuKQ}L ziYue;ffdYdvJR7D7&IpYcpv4-kZg#P5R_$lag%HR(<9827Bx&zKB3vgo}cQnMww$P zr$!$C11+b{jdLUnOlGCrVAv|Pba8?Rj|Bt6W`Q7qUjAPR3=9kmp00i_>zopr0L&0> A5&!@I literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor.png b/core/assets-raw/sprites/blocks/distribution/stack-conveyors/surge-conveyor.png new file mode 100644 index 0000000000000000000000000000000000000000..10a38a7a833365c2bf1599812353f5fa632f688f GIT binary patch literal 668 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4kiW$hCdQ-7c($0wq!ax2Y5O=D+Cnfr)B1( zGB9XNtet4XSy_5!jg?XvF5(V=G{BxtM zp4UDy(Dvl|X!&u4qqs`llU;8CD(69z2SIqpG|Mw?OA)+W8N`LRF5@Map$`5MV#xvZ^_zVK8YQyRoCy_i~4O* z%V2aR^c9O^I$z&y=9K0k|Vj82CM5AI5`;*UiS8{6Qdj5ZTa?<+R9%tk2cPsDi z__n8ZpI=zdk^Nnd9DpAjg7@T1}tToDhxM1+49U` Z__a0Azd&l)YX$}e22WQ%mvv4FO#nqeBvb$Z literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/items/item-carbide.png b/core/assets-raw/sprites/items/item-carbide.png new file mode 100644 index 0000000000000000000000000000000000000000..20d65e08bd2821a30f8c4c8b6bc96aca7eb9b01d GIT binary patch literal 457 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}jKx9jP7LeL$-HD>U~Kku zaSVxQeLKxC?63h(+y6G_18nLZ$EN8vAscdd;7l~wqLHVV{C|Yv5`H0z5AlvJX1x6w=OFi(tSA; z#LxY#GW@)Tld+=cr72(F)4Gc4e-fSVcL|r>)nqxqpUgC<g#AcXIzq%?W<%B5z;W zf8_SEumsK~VX=`!|)SNn58o;uA@KX1&8OW%GDlluuljmno)bP6~tohze-!5&gXV4ZGB$-?IbW3&=7s PFfe$!`njxgN@xNAw#~^N literal 0 HcmV?d00001 diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index a2ea6fb873..dc3f50f422 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -419,3 +419,8 @@ 63289=tungsten|item-tungsten-ui 63288=ore-tungsten|block-ore-tungsten-ui 63287=impact-drill|block-impact-drill-ui +63286=carbide|item-carbide-ui +63285=evoke|unit-evoke-ui +63284=carbide-crucible|block-carbide-crucible-ui +63283=surge-duct|block-surge-duct-ui +63282=surge-conveyor|block-surge-conveyor-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index b80d250d0859069822f09aa7132e70863dbba6cd..4f09d2749f843cf326554e9056d60389c3bf467f 100644 GIT binary patch delta 75 zcmX>q{z06HVa-OS8Jvm&$%#ctnJKBd$wj5fnMpaR41C3=f@(FGY0KPU0tpET3 diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 54013dcb68..7348863fb4 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1,7 +1,6 @@ package mindustry.content; import arc.graphics.*; -import arc.math.*; import arc.struct.*; import mindustry.*; import mindustry.ctype.*; @@ -60,6 +59,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, + carbideCrucible, cellSynthesisChamber, //sandbox @@ -75,6 +75,7 @@ public class Blocks implements ContentList{ conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, underflowGate, massDriver, duct, ductRouter, ductBridge, + surgeConveyor, //liquid mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidContainer, liquidTank, liquidJunction, bridgeConduit, phaseConduit, @@ -939,6 +940,22 @@ public class Blocks implements ContentList{ consumes.power(0.50f); }}; + carbideCrucible = new GenericCrafter("carbide-crucible"){{ + requirements(Category.crafting, with(Items.tungsten, 60, Items.graphite, 30)); + craftEffect = Fx.smeltsmoke; + outputItem = new ItemStack(Items.carbide, 1); + craftTime = 30f; + size = 2; + hasPower = hasItems = true; + drawer = new DrawSmelter(Color.valueOf("ffc099")); + ambientSound = Sounds.smelter; + ambientSoundVolume = 0.07f; + + //TODO use heat! + consumes.items(with(Items.tungsten, 1, Items.graphite, 2)); + consumes.power(2f); + }}; + cellSynthesisChamber = new LiquidConverter("cell-synthesis-chamber"){{ //TODO booster mechanics? requirements(Category.crafting, with(Items.thorium, 100, Items.phaseFabric, 120, Items.titanium, 150, Items.surgeAlloy, 70)); @@ -1277,20 +1294,35 @@ public class Blocks implements ContentList{ //special transport blocks duct = new Duct("duct"){{ - requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 5)); + requirements(Category.distribution, with(Items.graphite, 5)); speed = 4f; }}; ductRouter = new DuctRouter("duct-router"){{ - requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 10)); + requirements(Category.distribution, with(Items.graphite, 10)); speed = 4f; }}; ductBridge = new DuctBridge("duct-bridge"){{ - requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 20)); + requirements(Category.distribution, with(Items.graphite, 20)); speed = 4f; }}; + surgeConveyor = new StackConveyor("surge-conveyor"){{ + requirements(Category.distribution, with(Items.surgeAlloy, 3, Items.graphite, 5)); + health = 90; + //TODO different base speed/item capacity? + speed = 5f / 60f; + itemCapacity = 10; + + outputRouter = false; + hasPower = true; + consumesPower = true; + conductivePower = true; + baseEfficiency = 1f; + consumes.power(1f / 60f); + }}; + //endregion //region liquid diff --git a/core/src/mindustry/content/Items.java b/core/src/mindustry/content/Items.java index 4e09984dbf..5c3d285f20 100644 --- a/core/src/mindustry/content/Items.java +++ b/core/src/mindustry/content/Items.java @@ -111,9 +111,7 @@ public class Items implements ContentList{ cost = 1.2f; }}; - //TODO carbide impl - - carbide = new Item("carbide", Color.valueOf("768a9a")){{ + carbide = new Item("carbide", Color.valueOf("89769a")){{ cost = 1.3f; }}; } diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 99a891ab48..6774862c35 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -845,7 +845,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(Building other : proximity){ if(other != null && other.power != null && other.team == team - && !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower) + && !(block.consumesPower && other.block.consumesPower && !block.outputsPower && !other.block.outputsPower && !block.conductivePower && !other.block.conductivePower) && conductsTo(other) && other.conductsTo(self()) && !power.links.contains(other.pos())){ out.add(other); } diff --git a/core/src/mindustry/graphics/Layer.java b/core/src/mindustry/graphics/Layer.java index cf465dc300..59d4808945 100644 --- a/core/src/mindustry/graphics/Layer.java +++ b/core/src/mindustry/graphics/Layer.java @@ -26,6 +26,9 @@ public class Layer{ //base block layer - most blocks go here block = 30, + //informal layer used for additive blending overlay, grouped together to reduce draw calls + blockAdditive = 31, + //things drawn over blocks (intermediate layer) blockOver = 35, diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index f75d256bef..86cf53f335 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -47,6 +47,7 @@ public class Block extends UnlockableContent{ public boolean outputsLiquid = false; public boolean consumesPower = true; public boolean outputsPower = false; + public boolean conductivePower = false; public boolean outputsPayload = false; public boolean acceptsPayload = false; public boolean acceptsItems = false; diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index 3c5c1cb503..03e0b7e01a 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -189,7 +189,8 @@ public interface Autotiler{ default boolean blendsArmored(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ return Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery) || ((!otherblock.rotatedOutput(otherx, othery) && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null && - Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotatedOutput(otherx, othery) && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))); + Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || + (otherblock.rotatedOutput(otherx, othery) && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))); } /** @return whether this other block is *not* looking at this one. */ diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index fa7d2427e3..cce5470752 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.distribution; +import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; import arc.struct.*; @@ -25,9 +26,15 @@ public class StackConveyor extends Block implements Autotiler{ public @Load(value = "@-#", length = 3) TextureRegion[] regions; public @Load("@-edge") TextureRegion edgeRegion; public @Load("@-stack") TextureRegion stackRegion; + /** requires power to work properly */ + public @Load(value = "@-glow") TextureRegion glowRegion; + public float glowAlpha = 1f; + public Color glowColor = Pal.redLight; + + public float baseEfficiency = 1f; public float speed = 0f; - public boolean splitOut = true; + public boolean outputRouter = true; /** (minimum) amount of loading docks needed to fill a line. */ public float recharge = 2f; public Effect loadEffect = Fx.plasticburn; @@ -61,7 +68,7 @@ public class StackConveyor extends Block implements Autotiler{ int state = b.state; if(state == stateLoad){ //standard conveyor mode return otherblock.outputsItems() && lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock); - }else if(state == stateUnload){ //router mode + }else if(state == stateUnload && !outputRouter){ //router mode return otherblock.acceptsItems && (!otherblock.noSideBlend || lookingAtEither(tile, rotation, otherx, othery, otherrot, otherblock)) && (notLookingAt(tile, rotation, otherx, othery, otherrot, otherblock) || @@ -105,6 +112,7 @@ public class StackConveyor extends Block implements Autotiler{ public int link = -1; public float cooldown; public Item lastItem; + public float glow; boolean proxUpdating = false; @@ -124,6 +132,17 @@ public class StackConveyor extends Block implements Autotiler{ Tile from = world.tile(link); + //TODO do not draw for certain configurations? + if(glowRegion.found() && glow > 0f){ + Draw.z(Layer.blockAdditive); + Draw.color(glowColor, glowAlpha * glow); + Draw.blend(Blending.additive); + Draw.rect(glowRegion, x, y, rotation * 90); + Draw.blend(); + Draw.color(); + Draw.z(Layer.block - 0.1f); + } + if(link == -1 || from == null || lastItem == null) return; int fromRot = from.build == null ? rotation : from.build.rotation; @@ -139,6 +158,10 @@ public class StackConveyor extends Block implements Autotiler{ if((fromRot%4) == 3 && (rotation%4) == 0) a = -1 * 90; if((fromRot%4) == 0 && (rotation%4) == 3) a = 4 * 90; + if(glowRegion.found()){ + Draw.z(Layer.blockAdditive + 0.01f); + } + //stack Draw.rect(stackRegion, Tmp.v1.x, Tmp.v1.y, Mathf.lerp(a, b, Interp.smooth.apply(1f - Mathf.clamp(cooldown * 2, 0f, 1f)))); @@ -169,13 +192,14 @@ public class StackConveyor extends Block implements Autotiler{ int[] bits = buildBlending(tile, rotation, null, true); if(bits[0] == 0 && blends(tile, rotation, 0) && !blends(tile, rotation, 2)) state = stateLoad; // a 0 that faces into a conveyor with none behind it - if(bits[0] == 0 && !blends(tile, rotation, 0) && blends(tile, rotation, 2)) state = stateUnload; // a 0 that faces into none with a conveyor behind it + if(outputRouter && bits[0] == 0 && !blends(tile, rotation, 0) && blends(tile, rotation, 2)) state = stateUnload; // a 0 that faces into none with a conveyor behind it + if(!outputRouter && !(front() instanceof StackConveyorBuild)) state = stateUnload; // a 0 that faces into none with a conveyor behind it if(!headless){ blendprox = 0; for(int i = 0; i < 4; i++){ - if(blends(tile, rotation, i)){ + if(blends(tile, rotation, i) && (state != stateUnload || outputRouter || i == 0 || nearby(Mathf.mod(rotation - i, 4)) instanceof StackConveyorBuild)){ blendprox |= (1 << i); } } @@ -210,7 +234,7 @@ public class StackConveyor extends Block implements Autotiler{ @Override public float efficiency(){ - return 1f; + return baseEfficiency + (power == null ? 0f : power.status); } @Override @@ -229,12 +253,21 @@ public class StackConveyor extends Block implements Autotiler{ lastItem = items.first(); } + if(power != null) glow = Mathf.lerpDelta(glow, power.status, 0.6f); + //do not continue if disabled, will still allow one to be reeled in to prevent visual stacking if(!enabled) return; if(state == stateUnload){ //unload - while(lastItem != null && (!splitOut ? moveForward(lastItem) : dump(lastItem))){ - if(items.empty()) poofOut(); + while(lastItem != null && (!outputRouter ? moveForward(lastItem) : dump(lastItem))){ + if(!outputRouter){ + items.remove(lastItem, 1); + } + + if(items.empty()){ + poofOut(); + lastItem = null; + } } }else{ //transfer if(state != stateLoad || (items.total() >= getMaximumAccepted(lastItem))){ diff --git a/core/src/mindustry/world/blocks/production/BurstDrill.java b/core/src/mindustry/world/blocks/production/BurstDrill.java index 86c12320bc..1e13ef29df 100644 --- a/core/src/mindustry/world/blocks/production/BurstDrill.java +++ b/core/src/mindustry/world/blocks/production/BurstDrill.java @@ -7,6 +7,7 @@ import arc.util.*; import mindustry.annotations.Annotations.*; import mindustry.content.*; import mindustry.entities.*; +import mindustry.graphics.*; public class BurstDrill extends Drill{ public float shake = 2f; @@ -104,8 +105,6 @@ public class BurstDrill extends Drill{ Draw.color(); } - float z = Draw.z(); - float fract = smoothProgress; int arrows = 3; Draw.color(arrowColor); @@ -116,13 +115,13 @@ public class BurstDrill extends Drill{ Tmp.v1.trns(i * 90 + 45, j * arrowSpacing); //TODO maybe just use arrow alpha and that drawn on the base? - Draw.z(z); + Draw.z(Layer.block); Draw.color(baseArrowColor, arrowColor, a); Draw.rect(arrowRegion, x + Tmp.v1.x, y + Tmp.v1.y, i * 90); Draw.color(arrowColor); - Draw.z(z + 0.001f); + 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);