From 94cbce3801314cad8300fb6a866baac1788c8c7f Mon Sep 17 00:00:00 2001 From: sk7725 <58885089+sk7725@users.noreply.github.com> Date: Tue, 19 Jan 2021 10:36:01 +0900 Subject: [PATCH] surge slime & cloner --- assets/bundles/bundle.properties | 7 + assets/bundles/bundle_ko.properties | 13 ++ .../blocks/distribution/surge-slime-core.png | Bin 0 -> 243 bytes .../blocks/distribution/surge-slime.png | Bin 0 -> 480 bytes assets/sprites/blocks/production/cloner-0.png | Bin 0 -> 235 bytes assets/sprites/blocks/production/cloner-1.png | Bin 0 -> 350 bytes assets/sprites/blocks/production/cloner-2.png | Bin 0 -> 270 bytes assets/sprites/blocks/production/cloner-3.png | Bin 0 -> 351 bytes .../sprites/blocks/production/cloner-base.png | Bin 0 -> 422 bytes assets/sprites/blocks/production/cloner.png | Bin 0 -> 515 bytes src/betamindy/content/MindyBlocks.java | 20 +- src/betamindy/graphics/Drawm.java | 14 ++ src/betamindy/util/MobileFunctions.java | 2 +- .../blocks/defense/turrets/DrillTurret.java | 1 - .../world/blocks/distribution/Piston.java | 2 +- .../world/blocks/distribution/SlimeBlock.java | 24 ++- .../world/blocks/production/BlockCloner.java | 193 ++++++++++++++++++ 17 files changed, 268 insertions(+), 8 deletions(-) create mode 100644 assets/sprites/blocks/distribution/surge-slime-core.png create mode 100644 assets/sprites/blocks/distribution/surge-slime.png create mode 100644 assets/sprites/blocks/production/cloner-0.png create mode 100644 assets/sprites/blocks/production/cloner-1.png create mode 100644 assets/sprites/blocks/production/cloner-2.png create mode 100644 assets/sprites/blocks/production/cloner-3.png create mode 100644 assets/sprites/blocks/production/cloner-base.png create mode 100644 assets/sprites/blocks/production/cloner.png create mode 100644 src/betamindy/world/blocks/production/BlockCloner.java diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index d7fc079b..1f5ed6a5 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -11,6 +11,9 @@ block.betamindy-piston-sticky.description = Can push or pull up to 16 blocks. Ca block.betamindy-spore-slime.name = Spore Slime block.betamindy-spore-slime.description = Sticks to adjacent blocks. Does not stick to phase coating. block.betamindy-spore-slime.details = Has a grape flavor, and is very chewy. +block.betamindy-surge-slime.name = Surge Slime +block.betamindy-surge-slime.description = Sticks to adjacent blocks, just like spore slimes. Conducts power to adjacent blocks. Does not stick to phase coating. +block.betamindy-surge-slime.details = Has a lime flavor, and is very chewy. block.betamindy-spore-slime-sided.name = Sided Spore Slime block.betamindy-spore-slime-sided.description = Only one side of it is sticky. Sticks to adjacent blocks. Does not stick to phase coating. block.betamindy-accel.name = Accelerator @@ -58,8 +61,12 @@ block.betamindy-team-wall.description = When broken, alerts everyone about the a # Production block.betamindy-drill-mini.name = Mini Driller block.betamindy-drill-mini.description = Drills nearby ores or blocks automatically. +block.betamindy-drill-mini.details = A mono was sent to brazil by Sharlotte. When it returned... block.betamindy-drill-mega.name = Mega Driller block.betamindy-drill-mega.description = An upgraded version of the mini driller. Drills nearby ores or blocks automatically. Cannot drill items that are too soft. +block.betamindy-cloner.name = Block Cloner +block.betamindy-cloner.description = Clones the [accent]block it is facing[] to [#a9d8ff]the tile behind it[]. Can only clone blocks that you should be able to place by yourself. Consumes items and power. +block.betamindy-cloner.details = A perfect way to make piston flying machine factories. # Stats stat.dphealth = {0}*payload health*distance(blocks) diff --git a/assets/bundles/bundle_ko.properties b/assets/bundles/bundle_ko.properties index 9bf3748f..1833b252 100644 --- a/assets/bundles/bundle_ko.properties +++ b/assets/bundles/bundle_ko.properties @@ -11,6 +11,9 @@ block.betamindy-piston-sticky.description = \uCD5C\uB300 16\uAC1C\uC758 \uBE14\u block.betamindy-spore-slime.name = \uD3EC\uC790 \uC2AC\uB77C\uC784 block.betamindy-spore-slime.description = \uC778\uC811\uD55C \uBE14\uB85D\uC5D0 \uB2EC\uB77C\uBD99\uC2B5\uB2C8\uB2E4. \uBA54\uD0C0 \uCF54\uD305\uC5D0\uB294 \uB2EC\uB77C\uBD99\uC9C0 \uBABB\uD569\uB2C8\uB2E4. block.betamindy-spore-slime.details = \uD3EC\uB3C4\uB9DB \uB9C8\uC774\uCBB8. +block.betamindy-surge-slime.name = \uC11C\uC9C0 \uC2AC\uB77C\uC784 +block.betamindy-surge-slime.description = \uC778\uC811\uD55C \uBE14\uB85D\uC5D0 \uB2EC\uB77C\uBD99\uC2B5\uB2C8\uB2E4. \uC804\uB3C4\uCCB4\uC785\uB2C8\uB2E4. \uBA54\uD0C0 \uCF54\uD305\uC5D0\uB294 \uB2EC\uB77C\uBD99\uC9C0 \uBABB\uD569\uB2C8\uB2E4. +block.betamindy-surge-slime.details = \uB808\uBAAC\uB9DB \uB9C8\uC774\uCBB8. block.betamindy-spore-slime-sided.name = \uBC29\uD5A5\uC131 \uD3EC\uC790 \uC2AC\uB77C\uC784 block.betamindy-spore-slime-sided.description = \uD55C\uCABD \uBA74\uB9CC \uB048\uC801\uC785\uB2C8\uB2E4. \uC778\uC811\uD55C \uBE14\uB85D\uC5D0 \uB2EC\uB77C\uBD99\uC2B5\uB2C8\uB2E4. \uBA54\uD0C0 \uCF54\uD305\uC5D0\uB294 \uB2EC\uB77C\uBD99\uC9C0 \uBABB\uD569\uB2C8\uB2E4. block.betamindy-accel.name = \uAC00\uC18D\uB3C4\uACC4 @@ -57,6 +60,16 @@ block.betamindy-warehouse.details = \uB9C8\uCE58 \uBE44\uD589\uAE30 \uC5EC\uB7EC block.betamindy-team-wall.name = \uD300 \uBE14\uB85D block.betamindy-team-wall.description = \uD30C\uAD34\uB418\uBA74, \uADF8 \uC0AC\uC2E4 \uBC0F \uACF5\uACA9\uC790\uC758 \uC815\uCCB4\uB97C \uBAA8\uB450\uC5D0\uAC8C \uC54C\uB9BD\uB2C8\uB2E4. PvP\uC5D0\uC11C \uB3D9\uB9F9 \uBC0F \uBC30\uC2E0\uC758 \uC99D\uAC70\uB85C \uD65C\uC6A9\uD558\uAC70\uB098, \uC11C\uBC14\uC774\uBC8C\uC5D0\uC11C \uBC29\uC5B4\uC120\uC774 \uB6AB\uB838\uC74C\uC744 \uACBD\uACE0\uD558\uB294 \uC6A9\uB3C4\uB85C \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4. +# Production +block.betamindy-drill-mini.name = \uBBF8\uB2C8 \uB4DC\uB9B4\uB7EC +block.betamindy-drill-mini.description = \uC8FC\uBCC0\uC758 \uC790\uC6D0\uC744 \uC790\uB3D9\uC73C\uB85C \uCC44\uAD74\uD569\uB2C8\uB2E4. +block.betamindy-drill-mini.details = \uC0E4\uB97C\uB85C\uD14C\uC5D0 \uC758\uD574 \uBE0C\uB77C\uC9C8\uB85C \uBCF4\uB0B4\uC9C4 \uBAA8\uB178. \uBB34\uC0AC\uD788 \uB3CC\uC544\uC654\uC9C0\uB9CC... +block.betamindy-drill-mega.name = \uBA54\uAC00 \uB4DC\uB9B4\uB7EC +block.betamindy-drill-mega.description = \uB354 \uBC1C\uC804\uB41C \uB4DC\uB9B4\uB7EC\uC785\uB2C8\uB2E4. \uC8FC\uBCC0\uC758 \uC790\uC6D0\uC744 \uC790\uB3D9\uC73C\uB85C \uCC44\uAD74\uD569\uB2C8\uB2E4. \uB108\uBB34 \uBB34\uB978 \uC790\uC6D0\uC740 \uCC44\uAD74\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +block.betamindy-cloner.name = \uBE14\uB85D \uBCF5\uC0AC\uAE30 +block.betamindy-cloner.description = [accent]\uBC14\uB77C\uBCF4\uB294 \uBE14\uB85D[]\uC744 [#a9d8ff]\uC774 \uBE14\uB85D \uB4A4[]\uB85C \uBCF5\uC0AC\uD569\uB2C8\uB2E4. \uD50C\uB808\uC774\uC5B4\uAC00 \uC9C1\uC811 \uADF8 \uC704\uCE58\uC5D0 \uB193\uC744 \uC218 \uC788\uB294 \uBE14\uB85D\uB9CC \uBCF5\uC0AC\uAC00 \uAC00\uB2A5\uD569\uB2C8\uB2E4. \uC790\uC6D0\uACFC \uC804\uB825\uC744 \uC18C\uBAA8\uD569\uB2C8\uB2E4. +block.betamindy-cloner.details = \uD53C\uC2A4\uD1A4 \uD0C8\uAC83 \uACF5\uC7A5\uC744 \uB9CC\uB4E4\uAE30\uC5D0 \uC548\uC131\uB9DE\uCDA4\uC774\uB2E4. + # Stats stat.dphealth = {0}x\uD654\uBB3C \uCCB4\uB825x\uBE44\uAC70\uB9AC(\uBE14\uB85D) diff --git a/assets/sprites/blocks/distribution/surge-slime-core.png b/assets/sprites/blocks/distribution/surge-slime-core.png new file mode 100644 index 0000000000000000000000000000000000000000..a87d79f41352298f40cb8bc9f675415bd98c5121 GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJU7jwEArYL(do1l|Gm206^ysjv zt7)Oys+lg!92fIR@G^=qWj?oOtV~)eS*UqLob~_yeLs4=zN&_GTw4HWiq_UnxHJvv!RM%xx#i9Z9mHt&L+i%H8aHC1hV(E9mwDS69S>) z4P6NZwGLj9JZr2wR`O?vu^zd$$fTG-=L*MG^$(T|>Be1CW;D3T`fcV|$~Z^LvyjDZ m>klV}`F5*L_F5&FurQSIs<+t9HrxyJ1%s!npUXO@geCwopHkHT literal 0 HcmV?d00001 diff --git a/assets/sprites/blocks/distribution/surge-slime.png b/assets/sprites/blocks/distribution/surge-slime.png new file mode 100644 index 0000000000000000000000000000000000000000..66721c464f280ea067fe5174b998eec269a9b58e GIT binary patch literal 480 zcmV<60U!Q}P)M1vQ7Dp{1Ze6bPXRMG+!n={?Pk->w%-lE!J) z-ue2;v3>A#cXQk9@prh#>^6F$1zK8`r- zrMMShfCXmGxb5ZEh|8XgdjT_JqV2K3_WIUH6L}~1fD&dG)A{MuQD0UTM~U~xuV(qY zS{Ml#T+Sz;;TysH_;PBxKd-m|TnHO*mKR_Gjv-vVt(*1oTcKZ{m!=pN;1T^-3HIbG zNbUgu5fLStvksMgI>(b)_uAmig literal 0 HcmV?d00001 diff --git a/assets/sprites/blocks/production/cloner-0.png b/assets/sprites/blocks/production/cloner-0.png new file mode 100644 index 0000000000000000000000000000000000000000..a581882603ba87924e314891dddad12a4bc983fd GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJO`a}}ArYL(KDoCKH1I6C{Ac1$ z9zLZWjhZ0KaH-9KTQb-?7kro*P{Djavh+X(M^78WLV+LtkLUc9pU<3;XL+J{hm3>x z=|anfylKhB46(ZI92z5yM@X#`BCNg)EBf4Kj|w h2Co_}3P|uWGOYV9I&nj2urko~44$rjF6*2UngFim9b3ZYz-pE_&puI5FlHZ&vVAPwn2mpDQLIMa>g97A2K;|Uc2;|yQcwIYnCg!Ua zHYcN;4ltNzpyjweiXH$Gkc_0Y$V__h0;CWwa}vp&f%GHX#w=9Q0oEvr6=3uZG>_Q< z`iF}*_8yC&y5X*GY^*oL_Ou)BrJHVhl$QUlWdpEM3X*HgI&J_KD2<~JVFjois2xDg z1L_$N*ay@z1M&-00RzCSMF7ad6cRw78WbQG0x~C2WCngeE?mwxbtcxEC2UT@IUQgS w%|Od>eH1+aBp?|{Ymu4s-~~t_T;?S50n^JL4&0xc>Hq)$07*qoM6N<$f-0?vDF6Tf literal 0 HcmV?d00001 diff --git a/assets/sprites/blocks/production/cloner-2.png b/assets/sprites/blocks/production/cloner-2.png new file mode 100644 index 0000000000000000000000000000000000000000..3d8c732d5b4cd9e99b6f4b89b1043be63954553a GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJtDY{7ArYL(doIm5+rYD>*=52` zp3K?2fj_1cExP&3=?E6 zL<0{pTAXz+WAJkgDPjowd{MR`R8Um5A<@o^Jwap9Cgy-M$DcBYxSA9&+^G>`YWqJw zR`h^}18>~RE8BQ~Jo*2ao3Tb}rJB12iv;J7hM;zXN8F5EP4hUWH=YIR+ZDlAq+-T? z;cQV3--6XoU+^v1{qzK%guv-UJ_!RL!Elk8ZNpQhT~=veXFgD5V3@c|vYTCe(R`o> O89ZJ6T-G@yGywnr24hVC literal 0 HcmV?d00001 diff --git a/assets/sprites/blocks/production/cloner-3.png b/assets/sprites/blocks/production/cloner-3.png new file mode 100644 index 0000000000000000000000000000000000000000..4dab7c38904455aca81e82f0e812615e040d3c28 GIT binary patch literal 351 zcmV-l0igbgP)?H1wve^UG8xx4w0dM_xH4D#e|6=NAalT8&M5lXok+A*CXAVw5h8(AT0AZEgz zIAbSb_$IWb76&Z5qp_?2x*_bCs$m3Bjery})`kfA@))y+F0#)B~!uZTr5A3IGpR2ZT=? zT3LsW@F$6N!b#K>*omv*h5f^n4`rcY}NG7WjTm#YSfdIhCO8z?l_#}jCLEr(-_BY$~1Hx%}b9YJ+ QZ2$lO07*qoM6N<$f+yj<<^TWy literal 0 HcmV?d00001 diff --git a/assets/sprites/blocks/production/cloner.png b/assets/sprites/blocks/production/cloner.png new file mode 100644 index 0000000000000000000000000000000000000000..2a69b2516fb2fdcf4d3dc75a6a4d1f9aa17555ab GIT binary patch literal 515 zcmV+e0{s1nP)Y5Qf*o#?B&$0TBxeiH&F#6#S^fCSdCy6KnkeHlmFmprjG8N~4H~5D^Ot!BR7O zyvOYA+-7g@lD%g3W_RX&Zf0*UnK(Q;{+nHxQ?ah3*LzkUukW$+RYJ-!Av8cth)G_1 zssv!TALCYQ5ksd%9%<3e-j?CcDgZBSNJ&WYAtrCjthE3rSstQHLcsXO7%f0BAozXA zm>^v3pqzyOG`X~Ypt^5gsy*MJ+raCj5Tet(N?$`M^YrSbcE6n8X$WbJuTN?RiPI(S z0f*5@ouKlvn?+%uk`zdR|FmVWk+Em<* z)&Q}@2`7mut^w?#jMtM)eLjv<@wVA^=GS{5CPelY#DXx+ffSf+(y2BCGsqq1gP-JLH8O3P1}(Ab5-m!r1~)0>bwn6c3A{@I6e^beKSqbmoqXd3_k002ovPDHLk FV1f(); proxItems = new Seq(); diff --git a/src/betamindy/world/blocks/distribution/Piston.java b/src/betamindy/world/blocks/distribution/Piston.java index c1d18cb0..9d3c4542 100644 --- a/src/betamindy/world/blocks/distribution/Piston.java +++ b/src/betamindy/world/blocks/distribution/Piston.java @@ -193,7 +193,7 @@ public Seq getPowerConnections(Seq out){ } return out; } - //TODO: override conductsTo (I hope) + //TODO: override conductsTo in the next Mindustry build(122.1++) @Override public void onProximityUpdate(){ super.onProximityUpdate(); diff --git a/src/betamindy/world/blocks/distribution/SlimeBlock.java b/src/betamindy/world/blocks/distribution/SlimeBlock.java index d0c9a2e9..a896b2d6 100644 --- a/src/betamindy/world/blocks/distribution/SlimeBlock.java +++ b/src/betamindy/world/blocks/distribution/SlimeBlock.java @@ -3,8 +3,9 @@ import arc.*; import arc.graphics.*; import arc.graphics.g2d.*; -import mindustry.graphics.Layer; +import mindustry.graphics.*; import mindustry.type.Category; +import mindustry.ui.*; import mindustry.world.*; import mindustry.gen.*; import mindustry.world.meta.BlockGroup; @@ -14,7 +15,8 @@ public class SlimeBlock extends Block { public int slimeType; public Color color; - public TextureRegion coreRegion; + public TextureRegion coreRegion, topRegion; + public boolean useTopRegion = false; public SlimeBlock(String name, int stype){ super(name); slimeType = stype; @@ -27,9 +29,21 @@ public SlimeBlock(String name, int stype){ public void load(){ super.load(); coreRegion = atlas.find(name + "-core"); + if(useTopRegion) topRegion = atlas.find(name + "-top"); } - public class SlimeBuild extends Building{ + @Override + public void setBars() { + super.setBars(); + if(hasPower){ + bars.add("power", (SlimeBuild entity) -> new Bar(() -> + Core.bundle.get("bar.power"), + () -> Pal.powerBar, + () -> entity.power.graph.getSatisfaction())); + } + } + + public class SlimeBuild extends Building { @Override public void draw(){ if(Core.settings.getBool("animatedshields") && Core.settings.getBool("slimeeffect")){ @@ -37,6 +51,10 @@ public void draw(){ Draw.z(Layer.shields + 0.0001f); Draw.color(color); Fill.square(x, y, 4f); + if(useTopRegion){ + Draw.color(); + Draw.rect(topRegion, x, y); + } Draw.reset(); } else super.draw(); diff --git a/src/betamindy/world/blocks/production/BlockCloner.java b/src/betamindy/world/blocks/production/BlockCloner.java new file mode 100644 index 00000000..cb7f8a3a --- /dev/null +++ b/src/betamindy/world/blocks/production/BlockCloner.java @@ -0,0 +1,193 @@ +package betamindy.world.blocks.production; + +import arc.Core; +import arc.graphics.*; +import arc.graphics.g2d.*; +import arc.math.*; +import arc.math.geom.*; +import arc.util.*; +import arc.util.io.*; +import betamindy.graphics.Drawm; +import mindustry.Vars; +import mindustry.gen.*; +import mindustry.graphics.*; +import mindustry.type.Item; +import mindustry.type.ItemStack; +import mindustry.ui.*; +import mindustry.world.*; +import mindustry.world.consumers.*; + +import static arc.Core.atlas; +import static mindustry.Vars.tilesize; + +public class BlockCloner extends Block { + public Color color = Pal.lancerLaser; + /** Build speed multiplier */ + public float buildSpeed = 0.8f; + public int maxSize = 1;//TODO: add support for bigger sizes? + public TextureRegion baseRegion; + public TextureRegion[] topRegion = new TextureRegion[4]; + + public BlockCloner(String name){ + super(name); + update = true; + solid = true; + rotate = true; + quickRotate = false; + hasItems = true; + + consumes.add(new ConsumeItemDynamic((ClonerBuild e) -> e.recipe != null ? e.recipe.requirements : ItemStack.empty)); + } + + @Override + public void load() { + super.load(); + baseRegion = atlas.find(name + "-base"); + for(int i = 0; i < 4; i++){ + topRegion[i] = atlas.find(name + "-" + i); + } + } + + @Override + public void setBars() { + super.setBars(); + + bars.add("progress", (ClonerBuild entity) -> new Bar("bar.progress", Pal.ammo, () -> entity.recipe == null ? 0f : (entity.progress / entity.constructTime()))); + } + + @Override + public void drawPlace(int x, int y, int rotation, boolean valid) { + super.drawPlace(x, y, rotation, valid); + int br = (rotation + 2) % 4; + Lines.stroke(1f); + Draw.color(Pal.accent, Mathf.absin(Time.globalTime, 2f, 1f)); + Lines.square((x + Geometry.d4x(rotation)) * tilesize + offset, (y + Geometry.d4y(rotation)) * tilesize + offset, tilesize / 2f); + Draw.color(color, Mathf.absin(Time.globalTime, 2f, 1f)); + Lines.square((x + Geometry.d4x(br)) * tilesize + offset, (y + Geometry.d4y(br)) * tilesize + offset, tilesize / 2f); + Draw.color(); + } + + public class ClonerBuild extends Building { + public float progress, heat, time; + public @Nullable Block recipe, prev; + public int recipeRot = 0; + + @Override + public void onProximityUpdate() { + super.onProximityUpdate(); + Tile t = tile.nearby(rotation); + if(t == null) recipe = null; + else{ + if(t.block() == null) recipe = null; + if(!obstructed(t.block()) && t.block().size <= maxSize){ + recipe = t.block(); + if(recipe.rotate && t.build != null) recipeRot = t.build.rotation; + else recipeRot = 0; + } + else recipe = null; + } + if(recipe == null){ + recipeRot = 0; + } + //Log.info(recipe == null ? "null" : recipe.name); + } + + @Override + public void update() { + super.update(); + boolean produce = recipe != null && consValid(); + if(produce){ + progress += edelta(); + if(progress >= constructTime()){ + if(placeBlock(tile.nearby((rotation + 2) % 4))) consume(); + progress = 0f; + } + } + + if(recipe == null) progress = 0f; + else if(recipe != prev){ + prev = recipe; + progress = 0f; + } + + heat = Mathf.lerpDelta(heat, Mathf.num(progress > 0.001f), 0.3f); + time += edelta(); + } + + public float constructTime(){ + return (recipe == null) ? 8f * buildSpeed : block.buildCost * buildSpeed; + } + + public boolean obstructed(Block b){ + Tile t = tile.nearby((rotation + 2) % 4); + if(t == null) return true; + return !Build.validPlace(b, team, t.x, t.y, recipeRot, true); + } + + public boolean placeBlock(@Nullable Tile t){ + if(obstructed(recipe) || t == null) return false; + Vars.world.tile(t.x, t.y).setBlock(recipe, team, recipeRot); + return true; + } + + @Override + public boolean acceptItem(Building source, Item item){ + return items.get(item) < getMaximumAccepted(item); + } + + @Override + public int getMaximumAccepted(Item item){ + if(recipe == null) return 0; + for(ItemStack stack : recipe.requirements){ + if(stack.item == item) return stack.amount * 2; + } + return 0; + } + + @Override + public void draw() { + Draw.rect(baseRegion, x, y); + Draw.rect(topRegion[rotation], x, y); + if(recipe != null){ + Draw.z(Layer.blockOver); + Draw.blend(Blending.additive); + Draw.color(color, Mathf.absin(2f, 1f)); + float dx = x + Geometry.d4x((rotation + 2) % 4) * tilesize; + float dy = y + Geometry.d4y((rotation + 2) % 4) * tilesize; + Draw.rect(recipe.icon(Cicon.full), dx, dy, recipeRot * 90f); + Draw.blend(); + Draw.reset(); + + if(heat > 0.001f){ + Draw.draw(Layer.blockOver, () -> { + Drawm.constructLineless(dx, dy, recipe.icon(Cicon.full), recipeRot * 90f, progress / constructTime(), heat, time, color); + }); + } + } + } + + @Override + public void drawSelect() { + super.drawSelect(); + int br = (rotation + 2) % 4; + Lines.stroke(1f); + Draw.color(Pal.accent, Mathf.absin(Time.time, 2f, 1f)); + Lines.square(x + Geometry.d4x(rotation) * tilesize, y + Geometry.d4y(rotation) * tilesize, tilesize / 2f); + Draw.color(color, Mathf.absin(Time.time, 2f, 1f)); + Lines.square(x + Geometry.d4x(br) * tilesize, y + Geometry.d4y(br) * tilesize, tilesize / 2f); + Draw.color(); + } + + @Override + public void write(Writes write){ + super.write(write); + write.f(progress); + } + + @Override + public void read(Reads read, byte revision){ + super.read(read, revision); + progress = read.f(); + } + } +}