From 9c2618f2e879d90d21b2a6d7c36dcf088a9bf765 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 28 Dec 2021 21:07:27 -0500 Subject: [PATCH] Regen projection recolor --- .../blocks/defense/regen-projector.png | Bin 2989 -> 2093 bytes core/src/mindustry/content/Blocks.java | 12 +++++++----- core/src/mindustry/content/Fx.java | 2 +- core/src/mindustry/graphics/Pal.java | 2 ++ .../world/blocks/defense/RegenProjector.java | 8 ++++---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/assets-raw/sprites/blocks/defense/regen-projector.png b/core/assets-raw/sprites/blocks/defense/regen-projector.png index 3d610ed2aec33e27418c31e927d4760cad1f7205..f18e5bb857d60b45c63b13917ec8c64b47d2f2c2 100644 GIT binary patch delta 2081 zcmV++2;TRt7p)MGBYyw^b5ch_0Itp)=>Px+=Sf6CRCt{2oj-_OMHI%*E?WjHEd*`e zB0ShaQl*oi76~MTm?}#;LqrfO!7iO(B|>1?Ql6EDWfzhn5lJT&VzKZbyw^mqNExty zR(K3}?&1XT$Lic5m_X&9sVLE5}|lmrt1B3tih%;pF6hM;PMV`+*j5q@K7gIF7) zNP9PE+kd0IKWlYlDgnLBC#vh4=g!TgkyEddpa#&>{2&Vi?wm0}Pyrai{2&bkGjns!SF=3bD8f&u6RHW6>I#{7_GD+s7mu^>dDHy{nTayQ;< z7A^<8l@F3!OF*3HbUGYig7#Xq5K40&Ik9bk1OcroG`*Zy9uTb8utLz7PXsi=B?#W;doG3XN=pkt zYkxiw*b7P_Y_j> z6m%_PZc#A{fJlb${MifB`~jkC*Ke>hYoVtlb$vbR>YOg!x-Bk)msWI(RnYTi zFT{*!=MNAC(@HaIaW_{QrM6fIjD#DI<@8V+&>KSf#HJ8(hWCWvWj>Lj5$*+{R9yrJ zoY6fXc$!btpchmFL8_~fcuh+PEq`96ZPE?3K#=gi90s+zN~yuS*ei0Du_m4Iy`I3ZeJ5G$mC7 z;Hn4B!YnTc(mJL2e5u}Er++3tl18^Qv8G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LARqKn(rjQ$ zLS<3w59V##YP|nkn$Y{A+z?U%ksFL=%+Z0j2drNn^aBg2^6v3Z zl{+z$1+m^|L#IDs&N!c$pJ3uz%kohOwDa{$q*Uu2+J&wGqK8PkqB4oUe2q$A<8r-S zzRNQYSKO`dK}<-#?B`0e3WO~=THfC{VQ4Jf?kvcK+s#e$L)=`qIidyS>QSXlnPASq zmV_eGH){24`8vC4bc*eP6KEEdMM-~*>p`8B&YABH51aTPk~Rd^Zxg@DGaX-?)S-}{ zC6R6;=}O+|!v;Q~d*q(fZ_xe$>B!zXehpwkF-d7TZ~XUOnkhnsHjT4b16FW-l{^JG z&5t+g)S@Vy=TV(jHY^j~oHjW#fw7YBj=^OkVq_R`x9%FSglh<&BaI1Ewiz6)K33AL zA7_!vuYzIaC%rQiWOpVHU1cDl<~6R&1*DalAKFQTRTAo=P{fyilCR!0YZXDKQsFQ) zBao<4ee^~PfImxWc!IK@{KQzj?EN$or_iu+t<~tYIRd3QLe)N~)9AUKI5J zIGVX8`uanSPI1EYu8&deEZRCw3OQ@+Cr*9vJ1YH8>_VURBqp0&EKKK1KJ4%hs;=yYITty9E}(W!rqRUS+~t~%w_^m8IKzwNx8 zU1G;!`z?cuv;EpnFRpt0W0&{Q$;o*IJ60w3o*U33FKfWjlspnam#RD{)b*f)cn-mW z&}M8^HI)^;@ZSShpZ3#FfO;WHngj(qUp!r&_(kP5W(o*A)kjtHiJP} z(4T6}2|z*ikg?DN5?9=0{iP8}l55cof9u7E1 zhxl4&OTg0QC*GEy46L&;la+jX*W1nPL#VO-;BEi4g0gs_wi3@bl;ab>g%^b9wJvuE zIvWMY^(vr+SdXk=rglSc8o{$37i9Ax*CVB#=B S*fIh { - color(Pal.accent); + color(Pal.regen); Fill.square(e.x, e.y, e.fslope() * 1.5f + 0.14f, 45f); }), diff --git a/core/src/mindustry/graphics/Pal.java b/core/src/mindustry/graphics/Pal.java index 58ebf19794..0d72059161 100644 --- a/core/src/mindustry/graphics/Pal.java +++ b/core/src/mindustry/graphics/Pal.java @@ -16,6 +16,8 @@ public class Pal{ sapBullet = Color.valueOf("bf92f9"), sapBulletBack = Color.valueOf("6d56bf"), + regen = Color.valueOf("d1efff"), + reactorPurple = Color.valueOf("bf92f9"), reactorPurple2 = Color.valueOf("8a73c6"), diff --git a/core/src/mindustry/world/blocks/defense/RegenProjector.java b/core/src/mindustry/world/blocks/defense/RegenProjector.java index 470fc27cdd..95c3df59ac 100644 --- a/core/src/mindustry/world/blocks/defense/RegenProjector.java +++ b/core/src/mindustry/world/blocks/defense/RegenProjector.java @@ -30,7 +30,7 @@ public class RegenProjector extends Block{ public DrawBlock drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawSideRegion(true)); - public float effectChance = 0.013f; + public float effectChance = 0.003f; public Color baseColor = Pal.accent; public Effect effect = Fx.regenParticle; @@ -53,7 +53,7 @@ public class RegenProjector extends Block{ x *= tilesize; y *= tilesize; - Drawf.dashSquare(Pal.accent, x, y, range * tilesize); + Drawf.dashSquare(baseColor, x, y, range * tilesize); indexer.eachBlock(Vars.player.team(), Tmp.r1.setCentered(x, y, range * tilesize), b -> true, t -> { Drawf.selected(t, Tmp.c1.set(baseColor).a(Mathf.absin(4f, 1f))); }); @@ -111,7 +111,7 @@ public class RegenProjector extends Block{ if(consValid()){ //use Math.max to prevent stacking - for(Building build : targets){ + for(var build : targets){ if(!build.damaged() || build.isHealSuppressed()) continue; didRegen = true; @@ -121,7 +121,7 @@ public class RegenProjector extends Block{ float value = mendMap.get(pos); mendMap.put(pos, Math.min(Math.max(value, healPercent * edelta() * build.block.health / 100f), build.block.health - build.health)); - if(Mathf.chanceDelta(effectChance)){ + if(value <= 0 && Mathf.chanceDelta(effectChance * build.block.size * build.block.size)){ effect.at(build.x + Mathf.range(build.block.size * tilesize/2f - 1f), build.y + Mathf.range(build.block.size * tilesize/2f - 1f)); } }