From ddd4de7b7b914e0195361b6842b7c4cd2ecf4e08 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 12 Jan 2025 17:08:51 -0500 Subject: [PATCH] Scathe surge missiles --- .../weapons/scathe-missile-surge-cell.png | Bin 0 -> 236 bytes .../scathe-missile-surge-split-cell.png | Bin 0 -> 236 bytes .../weapons/scathe-missile-surge-split.png | Bin 0 -> 789 bytes .../units/weapons/scathe-missile-surge.png | Bin 0 -> 1399 bytes core/assets/icons/icons.properties | 2 + core/src/mindustry/ai/types/MissileAI.java | 2 +- core/src/mindustry/content/Blocks.java | 119 ++++++++++++------ core/src/mindustry/content/Fx.java | 57 +++++++++ .../mindustry/entities/bullet/BulletType.java | 4 +- .../src/mindustry/entities/comp/UnitComp.java | 4 + 10 files changed, 146 insertions(+), 42 deletions(-) create mode 100644 core/assets-raw/sprites/units/weapons/scathe-missile-surge-cell.png create mode 100644 core/assets-raw/sprites/units/weapons/scathe-missile-surge-split-cell.png create mode 100644 core/assets-raw/sprites/units/weapons/scathe-missile-surge-split.png create mode 100644 core/assets-raw/sprites/units/weapons/scathe-missile-surge.png diff --git a/core/assets-raw/sprites/units/weapons/scathe-missile-surge-cell.png b/core/assets-raw/sprites/units/weapons/scathe-missile-surge-cell.png new file mode 100644 index 0000000000000000000000000000000000000000..7854083dfd74dba7e77b2fd1d17ee5880abd5ac5 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^RzMuj!3HFEHeERgq!^2X+?^QKos)S9=r(bs;R}>g{VzTcy9C4e->|M!o^wXunx*Dd`ao4; z_KUL}qbG*yU*@ivbDqD};r;T=r(bs;R}>g{VzTcy9C4e->|M!o^wXunx*Dd`ao4; z_KUL}qbG*yU*@ivbDqD};r;TPx%&q+ih?=Kxnv>G{A#4OfZmAJfln&9kLv)A=QKz+{M7CRc z+DLBVS3p930FG*<^=jsJZ}&G7gXXJpzWp=b?cUzpUWgpWaU92S9LI4S$8j9TasCS? zmYse3e$&Ut@87*O>)))SR5D;CYto4%8L*I5?;w@j?+-*o)OFL7a@w-0jZ2aNOIfvs zbCLlo*=HJ!a->4iZ(5j%QX*z4NmioqwC%d-iKH~8(Wr|C5l(3692!;8R3JVcI;X*N zt%jw*hlDg`RhIIr>lK>`eg6383ZOj4koK&Xk<1g{%}EaRF_xyxW4>7SL`2hzOZI%%P3h%}pG9qLjx#Z- zKRiAV5z%hDu8y~QM1y1;NXnSEk(^}O=UA#lxehs5=>l++)~}U?K3?L$!rz z;p(G+zj$*2ZjLkYUQI6qS} zQjo3nOMyK{htB7MY^`5{>J9^q2(q<)4z(QystB^RzT-HK<2a7vIF92ujxK)z-3N*| T5T=fV00000NkvXXu0mjfUl@GV literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/units/weapons/scathe-missile-surge.png b/core/assets-raw/sprites/units/weapons/scathe-missile-surge.png new file mode 100644 index 0000000000000000000000000000000000000000..fd05b27d08dabf614e74fe8921275d84cdb8a84c GIT binary patch literal 1399 zcmV--1&I2IP)Px)F-b&0RCt{2o4;!mK@`U)VjVf3H|}b>V>&?@Au4XRQ3y3-0jSJ-_OqM{Mg$~Y1F7uqehMT=e2Mi zN#DNvc$$BIy#8=-AA={v(4e8=2TjI7gNB43ERhBc8VY`pBvxq95b(_tc%eb9;V-ld z{x@p`A3|N%hmN(-VBi2o0ZPYOX%KJ>lz*3wwbaGd2{@4R?)FWm44BHiAk*n2rN&cQ zv%q-%w!#B6s1Zm!Kth3z$?!$`OHgO##%di!$8UMr*J@W>7RYVY#gZ|hq}DW#P9!+o)?1g1elY{;c~(iCd(JP|e$ zfww|aIU~@iWUc;c?=lP7AMU5g(v6hP=Hl4_NCVB+;araOt)sIX5t&+?+Usg9+aK*m^JT8M{P|8oR=VpZK8ixd$A?~;Y z&mFVo@~+p-;CP+R8PbeWfLd>`=JGstVgly^;=yIIbi=epzjEu+%tuq#^<*xOS1c7= z`yUJp?;q%U?IWydjNW0q-S+a65v4^hf zXBsLA@aAhgU$j6%%JAyifoZ*-f3&>Rt_D9IX9jg^q7$HQL*vK zdV2GxJ71Ok`0?(^T&v{M+m~O<=2&@IJXf!-9k^x)Np5gzKYaDUo0&B-wYadrQ)O^0 zoQw0MDb(V5A~5pp>-GX=G?xS~9fO#VBZrSbr;@I|zI9}3X)FrR(i^Cjk3uI79L}sH zOBqgIel5>@qAKypwzw3OI;O3ZYKY3=^$8NYI#p4Et}%sig4kAgtv9IGcpkvg(k>%u<4m}s<(iJbTcJTw_|S9~8OS0J|FrUwA}wxB1oy+N z5A|^6@NSEfx8+@hz0e@XrOan9H?tqr@4ZZvI&$-Q3i2f~v0ExbCBw$QL24 z%I2~TZdIl;&Lm~7RoUd6&Z=DFlo9Enffi-Gs`iRy{uD&y5B(Z(J*xU{X{-Hsi@43! z>O-sPS{+mhk4@H&XHnDrI3>O6R u.checkTarget(air, ground), t -> ground && (!t.block.underBullets || (shooter != null && t == Vars.world.buildWorld(shooter.aimX, shooter.aimY)))); + return Units.closestTarget(unit.team, x, y, range, u -> u.checkTarget(air, ground) && !u.isMissile(), t -> ground && (!t.block.underBullets || (shooter != null && t == Vars.world.buildWorld(shooter.aimX, shooter.aimY)))); } @Override diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 1bf9c9783c..013497374f 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -4752,7 +4752,8 @@ public class Blocks{ ammo( Items.carbide, new BulletType(){{ shootEffect = Fx.shootBig; - smokeEffect = Fx.shootSmokeMissile; + smokeEffect = Fx.shootSmokeMissileColor; + hitColor = Pal.redLight; ammoMultiplier = 1f; spawnUnit = new MissileUnitType("scathe-missile"){{ @@ -4838,7 +4839,8 @@ public class Blocks{ //TODO - needs balancing Items.phaseFabric, new BulletType(){{ shootEffect = Fx.shootBig; - smokeEffect = Fx.shootSmokeMissile; + smokeEffect = Fx.shootSmokeMissileColor; + hitColor = Color.valueOf("ffd37f"); ammoMultiplier = 1f; reloadMultiplier = 0.8f; @@ -4925,24 +4927,27 @@ public class Blocks{ }}; }}, - //TODO finish this Items.surgeAlloy, new BulletType(){{ shootEffect = Fx.shootBig; - smokeEffect = Fx.shootSmokeMissile; + smokeEffect = Fx.shootSmokeMissileColor; + hitColor = Color.valueOf("f7e97e"); + ammoMultiplier = 1f; + rangeChange = -8f*9f; + reloadMultiplier = 0.9f; spawnUnit = new MissileUnitType("scathe-missile-surge"){{ - speed = 4.6f; + speed = 4.4f; maxRange = 6f; - lifetime = 60f * 5.5f; + lifetime = 60f * 1.4f; outlineColor = Pal.darkOutline; - engineColor = trailColor = Pal.redLight; + engineColor = trailColor = Color.valueOf("f7e97e"); engineLayer = Layer.effect; engineSize = 3.1f; engineOffset = 10f; rotateSpeed = 0.25f; trailLength = 18; - missileAccelTime = 50f; + missileAccelTime = 30f; lowAltitude = true; loopSound = Sounds.missileTrail; loopSoundVolume = 0.6f; @@ -4952,7 +4957,7 @@ public class Blocks{ fogRadius = 6f; - health = 210; + health = 400; weapons.add(new Weapon(){{ shootCone = 360f; @@ -4961,42 +4966,78 @@ public class Blocks{ deathExplosionEffect = Fx.massiveExplosion; shootOnDeath = true; shake = 10f; - bullet = new ExplosionBulletType(1500f, 65f){{ - hitColor = Pal.redLight; - shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosion, Fx.scatheLight, new WaveEffect(){{ - lifetime = 10f; - strokeFrom = 4f; - sizeTo = 130f; - }}); + bullet = new ExplosionBulletType(400f, 40f){{ + hitColor = engineColor; + shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosionSmall); collidesAir = false; buildingDamageMultiplier = 0.25f; ammoMultiplier = 1f; fragLifeMin = 0.1f; - fragBullets = 7; - fragBullet = new ArtilleryBulletType(3.4f, 32){{ - buildingDamageMultiplier = 0.3f; - drag = 0.02f; - hitEffect = Fx.massiveExplosion; - despawnEffect = Fx.scatheSlash; - knockback = 0.8f; - lifetime = 23f; - width = height = 18f; - collidesTiles = false; - splashDamageRadius = 40f; - splashDamage = 160f; - backColor = trailColor = hitColor = Pal.redLight; - frontColor = Color.white; - smokeEffect = Fx.shootBigSmoke2; - despawnShake = 7f; - lightRadius = 30f; - lightColor = Pal.redLight; - lightOpacity = 0.5f; + fragBullets = 5; + fragRandomSpread = 0f; + fragSpread = 37f; + fragBullet = new BulletType(){{ + shootEffect = Fx.shootBig; + smokeEffect = Fx.shootSmokeMissile; + ammoMultiplier = 1f; - trailLength = 20; - trailWidth = 3.5f; - trailEffect = Fx.none; + spawnUnit = new MissileUnitType("scathe-missile-surge-split"){{ + speed = 4.8f; + maxRange = 6f; + lifetime = 60f * 3.5f; + outlineColor = Pal.darkOutline; + engineColor = trailColor = Color.valueOf("f7e97e"); + engineLayer = Layer.effect; + engineSize = 2.2f; + engineOffset = 8f; + rotateSpeed = 1.35f; + trailLength = 12; + //missileAccelTime = 20f; + lowAltitude = true; + loopSound = Sounds.missileTrail; + loopSoundVolume = 0.6f; + deathSound = Sounds.largeExplosion; + targetAir = false; + targetUnderBlocks = false; + + fogRadius = 6f; + + health = 100; + + weapons.add(new Weapon(){{ + shootCone = 360f; + mirror = false; + reload = 1f; + deathExplosionEffect = Fx.massiveExplosion; + shootOnDeath = true; + shake = 10f; + bullet = new ExplosionBulletType(340f, 35f){{ + lightning = 5; + lightningDamage = 35f; + lightningLength = 8; + + hitColor = engineColor; + shootEffect = new MultiEffect(Fx.massiveExplosion, Fx.scatheExplosionSmall, Fx.scatheLightSmall, new WaveEffect(){{ + lifetime = 10f; + strokeFrom = 4f; + sizeTo = 100f; + }}); + + collidesAir = false; + buildingDamageMultiplier = 0.2f; + }}; + }}); + + abilities.add(new MoveEffectAbility(){{ + effect = Fx.missileTrailSmokeSmall; + rotation = 180f; + y = -9f; + color = Color.grays(0.6f).lerp(Color.valueOf("f7e97e"), 0.5f).a(0.4f); + interval = 5f; + }}); + }}; }}; }}; }}); @@ -5005,7 +5046,7 @@ public class Blocks{ effect = Fx.missileTrailSmoke; rotation = 180f; y = -9f; - color = Color.grays(0.6f).lerp(Pal.redLight, 0.5f).a(0.4f); + color = Color.grays(0.6f).lerp(Color.valueOf("f7e97e"), 0.5f).a(0.4f); interval = 7f; }}); }}; diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 9fdbe7ac4d..3709d935f9 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -519,6 +519,26 @@ public class Fx{ } }).layer(Layer.bullet - 1f), + missileTrailSmokeSmall = new Effect(120f, 200f, b -> { + float intensity = 1.3f; + + color(b.color, 0.7f); + for(int i = 0; i < 3; i++){ + rand.setSeed(b.id*2 + i); + float lenScl = rand.random(0.5f, 1f); + int fi = i; + b.scaled(b.lifetime * lenScl, e -> { + randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 13f * intensity, (x, y, in, out) -> { + float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f); + float rad = fout * ((2f + intensity) * 2.35f); + + Fill.circle(e.x + x, e.y + y, rad); + Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f); + }); + }); + } + }).layer(Layer.bullet - 1f), + neoplasmSplat = new Effect(400f, 300f, b -> { float intensity = 3f; @@ -557,6 +577,24 @@ public class Fx{ } }), + scatheExplosionSmall = new Effect(40f, 160f, e -> { + color(e.color); + stroke(e.fout() * 4f); + float circleRad = 6f + e.finpow() * 40f; + Lines.circle(e.x, e.y, circleRad); + + rand.setSeed(e.id); + for(int i = 0; i < 16; i++){ + float angle = rand.random(360f); + float lenRand = rand.random(0.5f, 1f); + Tmp.v1.trns(angle, circleRad); + + for(int s : Mathf.signs){ + Drawf.tri(e.x + Tmp.v1.x, e.y + Tmp.v1.y, e.foutpow() * 30f, e.fout() * 25f * lenRand + 6f, angle + 90f + s * 90f); + } + } + }), + scatheLight = new Effect(60f, 160f, e -> { float circleRad = 6f + e.finpow() * 60f; @@ -564,6 +602,13 @@ public class Fx{ Fill.circle(e.x, e.y, circleRad); }).layer(Layer.bullet + 2f), + scatheLightSmall = new Effect(60f, 160f, e -> { + float circleRad = 6f + e.finpow() * 40f; + + color(e.color, e.foutpow()); + Fill.circle(e.x, e.y, circleRad); + }).layer(Layer.bullet + 2f), + scatheSlash = new Effect(40f, 160f, e -> { Draw.color(e.color); for(int s : Mathf.signs){ @@ -1737,6 +1782,18 @@ public class Fx{ } }), + shootSmokeMissileColor = new Effect(130f, 300f, e -> { + color(e.color); + alpha(0.5f); + rand.setSeed(e.id); + for(int i = 0; i < 35; i++){ + v.trns(e.rotation + 180f + rand.range(21f), rand.random(e.finpow() * 90f)).add(rand.range(3f), rand.range(3f)); + e.scaled(e.lifetime * rand.random(0.2f, 1f), b -> { + Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 9f + 0.3f); + }); + } + }), + regenParticle = new Effect(100f, e -> { color(Pal.regen); diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 2c18fa158a..a4ad4fff13 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -527,7 +527,7 @@ public class BulletType extends Content implements Cloneable{ if(fragBullet != null && (fragOnAbsorb || !b.absorbed) && !(b.frags >= pierceFragCap && pierceFragCap > 0)){ for(int i = 0; i < fragBullets; i++){ float len = Mathf.random(fragOffsetMin, fragOffsetMax); - float a = b.rotation() + Mathf.range(fragRandomSpread / 2) + fragAngle + ((i - fragBullets/2) * fragSpread); + float a = b.rotation() + Mathf.range(fragRandomSpread / 2) + fragAngle + fragSpread * i - (fragBullets - 1) * fragSpread / 2f; fragBullet.create(b, x + Angles.trnsx(a, len), y + Angles.trnsy(a, len), a, Mathf.random(fragVelocityMin, fragVelocityMax), Mathf.random(fragLifeMin, fragLifeMax)); } b.frags++; @@ -819,7 +819,7 @@ public class BulletType extends Content implements Cloneable{ Bullet bullet = Bullet.create(); bullet.type = this; - bullet.owner = owner; + bullet.owner = shooter == null ? owner : shooter; bullet.team = team; bullet.time = 0f; bullet.originX = x; diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 548e34965e..ef479e2956 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -445,6 +445,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I } } + public boolean isMissile(){ + return this instanceof TimedKillc; + } + public int count(){ return team.data().countType(type); }