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 zcmV-<1BU#GP)Px&Gf6~2RCt`-n>&u%Kn#W{V~-*?27HmEOzYZk73>lA2#ZvU)M-;D7csDneV0wM zG{)n3{2V@H=dWy863I{0%utjk>ges~uaDk7hz|SRB-ua8Zu3VgCs1dWuv`7X+6ly& zCF~YAdO6W^W(m8ie8czW7gr~U%7JvPT8N%@4*T6S)q-a&2_XXV%^;ZTd^%PgK@FpUj2xrQ zur2_icnDF!6M+DT+7M77$7^j!)g1$Js~KkHk{7>H(90I&{TGjmukdrJ_m0C-*b5eQz@Uk>2{K(iV| zB!Qp_9+^2(2rDB0;8|#05z&ES2vBFJ7rZpZk-7qTKf$7|80rg*?31blEZ^441gpBD znE@7oX;sPu%hK6&A>`39$}_=wc?>s3P^DcYD|uuV%VjBikG;d1+-d^RI6z(-V z?nRpS7*&JdJwRX|Myp8mN>Dl`^q^_Z#or}^VCX|pZJ!afA;|C3I6gw_5xTX2v>iZVMRmW7F>kg6hiS&Q>-WmdH*pA z!jIRNE4#&pp|>-&=Iau6t6g9(XL_CIXuF}#pl$a^yIqH@oRPkB5M}ot1s?grSO}6( P00000NkvXXu0mjfW8a4{ 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 zcmV-B1H}A^P)Px%^+`lQRCt{2o3V1!KoEw1GduvaG%0W@CNDru!Ni#~Nx=iq#+WCF!wUqGk{6(W zCX=M1rK59c4HZKRPY_WZBOC4B?(N>mhWkrv)v?r}Bpr)qgf6j>7(6+7XK(Ah( zwE*z${B&i^(P(uF`;(&<0B&zSk#qCRy%K{2cuj(c+{rE=1wN#NgscK42ghcB>1>`= zLN);&@F6)RWD(#AACgOgyMP?Ym*h6~2zY++#4@Li$k(0k z?Dl94*k%bactE%cY@-ATJfOG^*d_^5ctCk2*p*=E^mwPcylUV9M!<)wAHAP%ngj{_ zi^E6c{_GL3=@P8)fZ!CMBy^*Zz+FIT9*0Y=Dr4|~um)Hp^nKnZp%0#d^nwQzMNlH4 zoAK`6pNYmKaPZA?p+3!|@PKj^kV@$Lg(wNqUtTIf0}mwh1Y;7o!_(Roj_t372N(fg zX79gP%TrL$a_(04Kq_)s>@l2JrBJ;1sY(XqF57diIdq)+`q*#qzK3 zKe-c)K_vzc2x~x!gzm&B30%e}cd9YgBY_7LMNlK5Z(oYG7HV890p 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);