From 693e420074c497246075184c775a2cee7fdc316f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 23 Oct 2021 14:25:32 -0400 Subject: [PATCH] WIP breach turret --- build.gradle | 4 +- .../turrets/bases/reinforced-block-2.png | Bin 0 -> 889 bytes .../sprites/blocks/turrets/breach.png | Bin 0 -> 827 bytes core/assets/icons/icons.properties | 1 + core/assets/logicids.dat | Bin 2904 -> 2912 bytes core/src/mindustry/content/Blocks.java | 38 ++++++++++++++++++ core/src/mindustry/content/Fx.java | 31 +++++++++++++- core/src/mindustry/graphics/Pal.java | 8 +++- .../world/blocks/defense/turrets/Turret.java | 10 +++++ .../world/blocks/distribution/Duct.java | 4 +- 10 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/turrets/bases/reinforced-block-2.png create mode 100644 core/assets-raw/sprites/blocks/turrets/breach.png diff --git a/build.gradle b/build.gradle index e351da8c9d..29729eebe0 100644 --- a/build.gradle +++ b/build.gradle @@ -23,8 +23,8 @@ buildscript{ } plugins{ - id 'org.jetbrains.kotlin.jvm' version '1.5.31' - id "org.jetbrains.kotlin.kapt" version "1.5.31" + id 'org.jetbrains.kotlin.jvm' version '1.6.0-RC' + id "org.jetbrains.kotlin.kapt" version "1.6.0-RC" } allprojects{ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/reinforced-block-2.png b/core/assets-raw/sprites/blocks/turrets/bases/reinforced-block-2.png new file mode 100644 index 0000000000000000000000000000000000000000..8abd51e2a1f6807127b990980ffd7c84622b3def GIT binary patch literal 889 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEk44ofy`glX=O&z-;X4 z;uumf=k9FlzS|BwZJNpbO6F`e6PNhBzEvRlM(`U)cS!e@%wRQf!wtQ)(|tFa9D7{( zN5(GY`TCqlp_Bes&IC+RfA!++^Y#7r>^k^<-&MJ3e=6^@yS92j`m_zve-GZ`JTg=D zjhK0r<;CJO&fTkP4u5|x9_GY%q!#jeb?k_Q@SpvBGad{3Nv2UScSCY8*z5c{9~CsFrcLQv;Tppj!SaCjAaBFc$MXd4@)+|uCN15<)}&IgD2K;Ep(kTW-v_Pj zpWj_LtB}F#80-@1+z^%QQa5wMlB~Zc+9SEDS8_P~TJS|MEl()!qW@ z7%F0a3Ub6M!{cERLR_|IglToZOGxQY8=}R|D6rWr)JY{^as*=atEnsP^igsm+ z*y&Wwn*P0qXWhwS^yZl75ZkTDeSGiclY6DEum}`tcit0}lI?M0y13<`s&{6F*a>O5 ziHx38*!s3zZ~w(K@A9P;Ug5EOMc$d(ymOuPT_UvkfvrP=yxVGzuU-LGYF`#)o;!M9 zwK?I1b71a#!L5oXSxgynzej9df3&(si$U(7cmGAFhTVr(Je;H~Rk?S*!=8nir|@f?hcN&E literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/turrets/breach.png b/core/assets-raw/sprites/blocks/turrets/breach.png new file mode 100644 index 0000000000000000000000000000000000000000..5b54984d55f31ee516d269f0ce8205f12af599dd GIT binary patch literal 827 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEk44ofy`glX=O&!1UGA z#WAE}&fD1=i!M6|wACBiFl;f=EYMQZckn%UWTuJdLFNm`W~g@@=4P2RNqj+r+T#bC)<8|XFu8fe)AUfwK@xyEqhjfuH)8)ZEIgUtdE<& zmEps?KP9PWE@qT+{hqv7j3F=IZesE0Gkb-aSt@*+I_{j*Q((1Q($cbqNsaw@TEokn zd7(~bjB+0oEmczlA8^V~@^0GQAoD@dQe_9%2~PP(x(iPj?KruTscqhY3oDt5_%G;) zpZwid{#_>h(tIU%hprZ(4-N-|9h4V}*aYlg^H7=6!k#5~g*zfYA*VWoiRsUN6-QNt zEhqQfPIY!uO(-h36BH}8>T|MYR>;LA&kW|CjedJ}QUpW!a`Eiyr5+t?C1Q5_C_Abg zV3J=nQDJY|hY13r4;bZ@CN9{UwZ$uewc^n89#f}F5()Xv~c#vclYLZ9#bj!aJFcn-Pt7{8j3_Gc)j@Ds=;|FK2FP# znP24#OR~_8!^AKlxFuRnUdk7t>e1e4r}AGhXw;oP)^ ie**KqWy_X5Gw-;Vzh&~vlfn!P3=E#GelF{r5}E+EiF7pp literal 0 HcmV?d00001 diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 0dd6821c6d..c4ad3a214f 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -406,3 +406,4 @@ 63302=dormant-cyst|item-dormant-cyst-ui 63301=neoplasm|liquid-neoplasm-ui 63300=scuttler|unit-scuttler-ui +63299=breach|block-breach-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 8e2ad1517c1389409d707f5d0224dc807344c784..720717c1702d580dbdb4537296b2a33e5bbdd5d9 100644 GIT binary patch delta 24 fcmca1_CSn@VaY}&8%}n%q@vWsoYG7HV890p delta 16 XcmaDLc0-JbVev*L8_vycoKj2xFUbU; diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 6fd87e2061..ed605bfe58 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -89,6 +89,9 @@ public class Blocks implements ContentList{ //turrets duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, foreshadow, spectre, meltdown, segment, parallax, tsunami, + //turrets - erekir + breach, + //units commandCenter, groundFactory, airFactory, navalFactory, @@ -2120,6 +2123,41 @@ public class Blocks implements ContentList{ consumes.add(new ConsumeCoolant(0.5f)).update(false); }}; + breach = new ItemTurret("breach"){{ + requirements(Category.turret, with(Items.beryllium, 35), true); + ammo( + Items.beryllium, new BasicBulletType(7f, 20){{ + width = 8f; + height = 14f; + shootEffect = Fx.berylSpark; + smokeEffect = Fx.shootBigSmoke; + ammoMultiplier = 2; + pierce = true; + pierceBuilding = true; + hitColor = backColor = trailColor = Pal.berylShot; + frontColor = Color.white; + trailWidth = 1.5f; + trailLength = 10; + //TODO different effect? + hitEffect = despawnEffect = Fx.hitBulletColor; + }} + ); + + shootLength = 0.5f; + outlineColor = Color.valueOf("2d2f39"); + size = 2; + envEnabled |= Env.space; + basePrefix = "reinforced"; + reloadTime = 40f; + restitution = 0.03f; + range = 180; + shootCone = 3f; + health = 300 * size * size; + rotateSpeed = 2f; + + limitRange(); + }}; + //endregion //region units diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index d18da8b0a3..7b5ccfbd42 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -437,6 +437,24 @@ public class Fx{ Drawf.light(e.x, e.y, 20f, Pal.lightOrange, 0.6f * e.fout()); }), + hitBulletColor = new Effect(14, e -> { + color(Color.white, e.color, e.fin()); + + e.scaled(7f, s -> { + stroke(0.5f + s.fout()); + Lines.circle(e.x, e.y, s.fin() * 5f); + }); + + stroke(0.5f + e.fout()); + + randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> { + float ang = Mathf.angle(x, y); + lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); + }); + + Drawf.light(e.x, e.y, 20f, e.color, 0.6f * e.fout()); + }), + hitFuse = new Effect(14, e -> { color(Color.white, Pal.surge, e.fin()); @@ -981,7 +999,7 @@ public class Fx{ }), muddy = new Effect(80f, e -> { - color(Color.valueOf("432722")); + color(Pal.muddy); alpha(Mathf.clamp(e.fin() * 2f)); Fill.circle(e.x, e.y, e.fout()); @@ -1300,6 +1318,15 @@ public class Fx{ }); }), + berylSpark = new Effect(21f, e -> { + color(Color.white, Pal.berylShot, e.fin()); + stroke(e.fout() * 1.1f + 0.5f); + + randLenVectors(e.id, 5, 27f * e.fin(), e.rotation, 9f, (x, y) -> { + lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f); + }); + }), + shootPayloadDriver = new Effect(30f, e -> { color(Pal.accent); Lines.stroke(0.5f + 0.5f*e.fout()); @@ -1620,7 +1647,7 @@ public class Fx{ plasticburn = new Effect(40, e -> { randLenVectors(e.id, 5, 3f + e.fin() * 5f, (x, y) -> { - color(Color.valueOf("e9ead3"), Color.gray, e.fin()); + color(Pal.plasticBurn, Color.gray, e.fin()); Fill.circle(e.x + x, e.y + y, e.fout()); }); }), diff --git a/core/src/mindustry/graphics/Pal.java b/core/src/mindustry/graphics/Pal.java index 9eef727dba..073fb01f9d 100644 --- a/core/src/mindustry/graphics/Pal.java +++ b/core/src/mindustry/graphics/Pal.java @@ -112,5 +112,11 @@ public class Pal{ logicControl = Color.valueOf("6bb2b2"), logicOperations = Color.valueOf("877bad"), logicIo = Color.valueOf("a08a8a"), - logicUnits = Color.valueOf("c7b59d"); + logicUnits = Color.valueOf("c7b59d"), + + berylShot = Color.valueOf("b1dd7e"), + + plasticBurn = Color.valueOf("e9ead3"), + + muddy = Color.valueOf("432722"); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 29236505ab..f1f1be0755 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -81,6 +81,7 @@ public class Turret extends ReloadTurret{ protected Vec2 tr = new Vec2(); protected Vec2 tr2 = new Vec2(); + public @Nullable String basePrefix; public @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion; public @Load("@-heat") TextureRegion heatRegion; public float elevation = -1f; @@ -130,6 +131,15 @@ public class Turret extends ReloadTurret{ super.init(); } + @Override + public void load(){ + super.load(); + + if(basePrefix != null){ + baseRegion = Core.atlas.find(basePrefix + "-block-" + size); + } + } + @Override public TextureRegion[] icons(){ return new TextureRegion[]{baseRegion, region}; diff --git a/core/src/mindustry/world/blocks/distribution/Duct.java b/core/src/mindustry/world/blocks/distribution/Duct.java index b485fe6341..1c1d6049b8 100644 --- a/core/src/mindustry/world/blocks/distribution/Duct.java +++ b/core/src/mindustry/world/blocks/distribution/Duct.java @@ -65,7 +65,7 @@ public class Duct extends Block implements Autotiler{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock); + return (otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock)) || (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasItems); } @Override @@ -93,7 +93,7 @@ public class Duct extends Block implements Autotiler{ //draw extra ducts facing this one for tiling purposes for(int i = 0; i < 4; i++){ - if((blending & (1 << i)) != 0 && !(i == 0 && nextc != null)){ + if((blending & (1 << i)) != 0){ int dir = r - i; float rot = i == 0 ? rotation : (dir)*90; drawAt(x + Geometry.d4x(dir) * tilesize*0.75f, y + Geometry.d4y(dir) * tilesize*0.75f, 0, rot, i != 0 ? SliceMode.bottom : SliceMode.top);