From 7d6428fcf2126f643871b087aa669241d21c728b Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 5 Dec 2021 18:19:43 -0500 Subject: [PATCH] Titan recolor + complaining --- .../sprites/blocks/turrets/horde.png | Bin 0 -> 1262 bytes .../blocks/turrets/titan/titan-barrel.png | Bin 899 -> 918 bytes .../blocks/turrets/titan/titan-preview.png | Bin 1357 -> 1367 bytes .../blocks/turrets/titan/titan-side1.png | Bin 566 -> 566 bytes .../blocks/turrets/titan/titan-side2.png | Bin 600 -> 601 bytes .../sprites/blocks/turrets/titan/titan.png | Bin 629 -> 627 bytes core/assets/icons/icons.properties | 1 + core/assets/logicids.dat | Bin 3681 -> 3688 bytes core/src/mindustry/content/Blocks.java | 87 +++++++++++++---- core/src/mindustry/content/Fx.java | 12 +-- core/src/mindustry/type/Weapon.java | 6 +- .../blocks/defense/turrets/BaseTurret.java | 3 +- .../world/blocks/defense/turrets/Turret.java | 88 +++++++++++------- 13 files changed, 133 insertions(+), 64 deletions(-) create mode 100644 core/assets-raw/sprites/blocks/turrets/horde.png diff --git a/core/assets-raw/sprites/blocks/turrets/horde.png b/core/assets-raw/sprites/blocks/turrets/horde.png new file mode 100644 index 0000000000000000000000000000000000000000..b871ef644c5f74a846f107dc73d371c98ce0c383 GIT binary patch literal 1262 zcmVPx(s7XXYRCt{2oxM&KK@`VliG?pf;sZ#@BUsr9R{8*xRD4v#gak-Th!tRE=>te5 z&{^>amiPcBz5tci>gaf#nLTsne2vU6q2LmB=l*}YJ7@M|HiW@oFc=I5CQQ~1h}qdY zUZg&Me|}7A=ZlS3$>rT#U%L6;E7lDFa^Xvm6Jvo30h-|hUL<4%EEWruA50LX|8K!U z{4%C{z{cil^8lghZ;oIHUQ}{qmf^^6HNNT~9@N*$h$*n85 zo{|LW3Bfr;_5ez$$sK+P${r}SC$J0f9zNhj0;_;t!UsG^U=u(YWF0=a=UP3PtL=IT zoYfJF07|J@6Fx<5O-LmP(j{uM0O|1O){}w~j+KNa0b1eDtuLk}6blJt0hBtQAIN==DsC;q|`=WHm|5k*3k059PK zJA20q$rEN863_y?g|CIQ1eAbY2U%Q54%TJ`XqTE^kt$J(0x02Ip4*Xz^1bIIWCe`y z({M|us)D$~fBXHh`9=B75B2Tl%mFPxB7DrUrHI>XDWUmfTxKq5Yanx60!nD_px5vLuM$uKdJiA)D4}^A zU>W}5ll$uP@0t=YxEY91!UrrRwBkZQOZY&q63hi~gb(y6!BhZe_&{$G%mhe;5A-C# zM1W-YKra&11=NP$5{%}$sHh6C2*kStH361Ec$T0dz(W8Y+K@tAfTu6+sV#u0fYP%7 zDKwt0tgVhH&kWQcCctC(fF}te0#*-Br;D>A^elrG&lT55xVgTZR$g{8YvSs`>F;;jMgw)G^xFxU&NQDoiB-C#CH43C1752#U-Ix0499k;_PT@J?57rwBDt5wY^^Tjxi1i zO#-g3K2_4`?qbmj* zemr=?hJ_UtFAx3vmQd~g*E*zEfMt2)EO}>~^y!5fR0Pa*)Vb3ZlJ|zrNzmB(Lr~lU zauT*~??k6BC{0U{>pQf<4?+15v@9X+NF}E)C{0VSEI~8;5DfYNkdP`RC8sYaO-le0 zw8Iasm6!8-iGU@#aA27`yo YFKIFb-ZIj1W&i*H07*qoM6N<$f|o2P4FCWD literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/turrets/titan/titan-barrel.png b/core/assets-raw/sprites/blocks/turrets/titan/titan-barrel.png index f9c7a4f5548a98fa66129be81c8e74026596e00c..a04e3afd076175b3a35f2ae888d4db602294c295 100644 GIT binary patch delta 882 zcmZo>pT<7Hus*=k#WAE}&f7V*c~>1oTF)no>L|QC!57dqg_E~Q^@1YnrAsO%nLj7K zh+q=rUAUyX*m@S?utKOQa>Bo?XiAqFzM?A(F@8o&XG+^8sqS}^Tf=sZ9dVGI|S3v=O?D9u+1O?fBgI!{Mj&W?jBSF zcYcWe#RxKTOG|#mBn8z4?mybZIfIy%b<{CTe8DcziA=FXAD`NQE(lhFgu0g(c0yDC~fn?z1~x* zS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>?3SE)JTr=0s_FBmP|63ZrN1icF;`cfI-h$XqNmKq?DK#`s z;$Sh@WWvPAquc4gkX)=Ru%O9OkYhro^&7r?egB*D=hsU&GDvPa{LbRp91cqkgNG%5 z4j3^p3LQJfzeY*mfF$D_K`^0kIcx95zmGTnEajY#xb>cl{kA@b2F~S=*{1Ws_9AQiC;2ql5Cs z=iNdJ8m}CVSo5090|I-Keb$gb(!ZeZCZdr3#u{`>N72H~Xt3Au**TpD!tD@XL|3o1l+ pBv=BukwNW0#olYO0b|PK6Yq||-aGwf9~40G=IQF^vd$@?2>?3F%)|fy delta 509 zcmdnSvW;beRsF$0CPRs~hyK}-eI`uquO@6{@haFN`MbczQ}@x)Hw*GM-8?)0Pfz9i z$?S=9-m~(j#i}qsK|yz4|MKpu#djlZ1NGM(udlNbeed4Dx-9PJQo(oLay_5o-B}C* zgc=##uDK~REHoA5NXW@#VG7xx!o+Cw_FMbu4HoxS#){xb7`=T>eCl|(0=W)H%ozgLsw9}FE2;H%@`IYlL^+xFBNgZlhH{nyH->Z|0kreG zxT*v5%GtYx7HryS{aR?jqB*yvghAdb5dHFrTD{RC9)2ux&yLnI{OVIkMd<+>zn`kozj7x8}<>=J^F$Qr{8mg0lj)cOeq5B n?}Uk0689ZV?_vZ-RBsLA@`sb|h%9%o1Vx*ttDnm{r-UW|(ErS@ diff --git a/core/assets-raw/sprites/blocks/turrets/titan/titan-side2.png b/core/assets-raw/sprites/blocks/turrets/titan/titan-side2.png index 69082ddedf4444c6d5c0463f0f1514851c605eeb..8830ec81b9bd1b61d31951007eaf33413dece710 100644 GIT binary patch delta 553 zcmcb?a+76(VZE@Yi(^Q|oVRx!^;jGw+8*Z5X89G z!nf}>T<+50*dTcKWArpZ4uK2ib*HtM80QEckc1FQx#rn>ZEa`N$1u6v$h)?C`&wmz z1efwZ(^6TOSibb$-_+&Mz!;XkFPY=Q;%h&I7{6VSiB~#czV-NYjt6}VtgUskZz(w> zCJS-|IBGC4)@w<2IWVNN7)&U(@oezfnSPk%L_(o~e}hYm=);cJP5%U$ER-D_7Yc6` zW8{+Vc4**o0_r>&zycI*FoqEa#QVL2RG2(INyjTSoctmGe*MYsb4wZCe_Sfb{)6|i zw=wUB=ws8EP9!V7t%cF~g-T91A}t>m8Ccdd(0N(-QR9n`MGX-vq0=H;c7@ zwqJ}l`y$`_i|21+>8T&xNB^C*VRE~3|L&W$X&>j_S8`~{V>$g%bzYMir|h%i@;&#z fi?9G=(BcQnv}7iafRB^vK=JA6>gTe~DWM4fQ0n0- delta 532 zcmcb~a)V`pVV01mi(^Q|oVRx!^;jGw+8*Z5Y1pgkZSB6nsO*mOGZrItf$tkqo{LR0 zmR5hjmb-ZA%y+L|t=j)e{#UJ#qOfw!ddbc#MMee)Xb_sU>}1u>m^gFI@2`skerEsw zJT2VZ_j{=xlh23hiE|X|UzTmnv(xKabl={LiBaj!x@-57{W=Aj8I*TD-mar8ps*nS z&$Lh$CJW^TV+i4LD=)6}$EUo1g`5J3yDR_J-L_(4bSpWYAL*vx;Bfzk?rIJeiGsfL&Je zafgblQiIBVpj9(^>i?C^sktA?{y{E&R$)V}MEtDGhFVDw858!{o29^=Asu98I?IYD z^*>)0UM#m})RK^jS8^y^2-GiPYPQdXp&YDYGmpUMJ2p?Ad^z(ecxF0-rf$>MAD4QV zJuWM?9P8i7QGQ|#vqzzz7tosyK^9K0er)Vt_e9>U{^o^xlUK%H*sp0m))(7t{+UDK zV?q7)&9jb{*L5=p?h@2FKD~l#mP*MCd3ocy`@sUh$a?TVII;4trR>!WCqYr?>FVdQ I&MBb@0F?~aKL7v# diff --git a/core/assets-raw/sprites/blocks/turrets/titan/titan.png b/core/assets-raw/sprites/blocks/turrets/titan/titan.png index 6afc336be48f51d3cf6edfe80017acc33bea7110..58b4fad36ce5775e34801673b9cde1a018fbfbe8 100644 GIT binary patch delta 589 zcmey$@|k6VVZE-Wi(^Q|oVRyu{iFjWS|1v7MtgEyo6t2WBygL9IA^;VZyKx0#7#XN zTwxPr0|I7<1_-3GI+wQo5bRq!vv{BOJ@-Xld(LU6UJG9W+#_hXBH*Uvw^{`7^_ z^1uD_bB{+o_x;79l37@iB)`O~rJ~`;58qafi}egAKh7>`iD=+@Y<`ksGrL4v;ydRO z-8%k?w;Td)4F*gtQ@I{gn9ixY^)q56!=*ift9tcCc@)kHFMRYP=pw_VErP51^k*{V z{7%a0;+T4T`V!gejcth+Eb{gp-NkWz_35?eS2Dd;?bxn5Z_|C|jt>`ZA94KuPg-ra z-u-*`d_GycufO+RFMRdt$)0jK%-`-aJfAOTK6OW8G;@gD{zCT+tS=J(9FsgKv|#y1 z>F}1D%wH_(9(M$MTibEHi6N1NL)k%s@etIRu1tR{Z2e@uxyswscFJ6rTkzw%L2@~ delta 572 zcmV-C0>l0D1oZ@vF@G;fL_t(|obB8_QWQ}bh2hiU0(1=`f$K2B&~>P=0tYvsKm+ z-|FY(!D@D$)BdyPwqxDoUit(i>DA$peUK^<;sFxlHx(j81AipPZ_*KB0V<5&BqMYW zFilhMLkul`54h_H5JrG70)&+c;P^D0e%txCQURpC5vq+Z6$~KtiBNHTsb~Oc*$7p~ zmrMb+{V=vfgv#Sf(tX!~rfJeVZ@$G%5zf|Mw?3x|td}4jOZ>}z4QJAy612;(=-2$ldNjo-K; zbPq7%_>Ch%*+&s~1p&ec5JrG70)!DDi~wN-2#W;ReQ}jI?6tl>eHb~eJwV0rn?wX_ zfXd@H?g+L3BaGiTBUl2AG=AfX&^^G2<2Q~7ybTQ_KwcOD!Uzx+32=5=uls|~myzSz zm#8>?lZaqlqw@HTJ3{|&MLc>lNn?!PvG7ok0i;ZX3gZI+fS{jS1i(yW--T}g0000< KMNUMnLSTX& Math.max(Mathf.slope(v), 0.8f); shrinkX = 0.2f; shrinkY = 0.1f; @@ -2992,27 +3043,23 @@ public class Blocks{ acceptCoolant = false; draw = new DrawTurret("reinforced-"){{ - Color heatc = Color.valueOf("f03b0e"); - Interp in = Interp.pow2In; - parts.addAll( new RegionPart("-barrel"){{ moveY = -5f; - heatColor = heatc; + heatColor = Color.valueOf("f03b0e"); mirror = false; - interp = in; + interp = Interp.pow2In; }}, new RegionPart("-side"){{ + moveX = 2f; moveY = -1f; rotMove = -40f; - moveX = 2f; useReload = false; under = true; - heatColor = Pal.berylShot.cpy().mul(1.1f); + heatColor = Color.valueOf("768a9a"); useProgressHeat = true; interp = Interp.pow2Out; - }} - ); + }}); }}; restitution = 0.02f; diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 6c28dc1ff9..e9dbada86d 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -340,7 +340,7 @@ public class Fx{ }), titanExplosion = new Effect(30f, 160f, e -> { - color(Pal.berylShot); + color(e.color); stroke(e.fout() * 3f); float circleRad = 6f + e.finpow() * 60f; Lines.circle(e.x, e.y, circleRad); @@ -356,7 +356,7 @@ public class Fx{ titanSmoke = new Effect(300f, 300f, b -> { float intensity = 3f; - color(Pal.berylShot, 0.7f); + color(b.color, 0.7f); for(int i = 0; i < 4; i++){ rand.setSeed(b.id*2 + i); float lenScl = rand.random(0.5f, 1f); @@ -1372,7 +1372,7 @@ public class Fx{ }), shootTitan = new Effect(10, e -> { - color(Pal.lightOrange, Pal.berylShot, e.fin()); + color(Pal.lightOrange, e.color, e.fin()); float w = 1.3f + 10 * e.fout(); Drawf.tri(e.x, e.y, w, 35f * e.fout(), e.rotation); Drawf.tri(e.x, e.y, w, 6f * e.fout(), e.rotation + 180f); @@ -1399,7 +1399,7 @@ public class Fx{ for(int i = 0; i < 13; i++){ v.trns(e.rotation + rand.range(30f), rand.random(e.finpow() * 40f)); e.scaled(e.lifetime * rand.random(0.3f, 1f), b -> { - color(Pal.berylShot, Pal.lightishGray, b.fin()); + color(e.color, Pal.lightishGray, b.fin()); Fill.circle(e.x + v.x, e.y + v.y, b.fout() * 3.4f + 0.3f); }); } @@ -1441,8 +1441,8 @@ public class Fx{ } }), - berylSpark = new Effect(21f, e -> { - color(Color.white, Pal.berylShot, e.fin()); + colorSpark = new Effect(21f, e -> { + color(Color.white, e.color, e.fin()); stroke(e.fout() * 1.1f + 0.5f); randLenVectors(e.id, 5, 27f * e.fin(), e.rotation, 9f, (x, y) -> { diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 31a56f0623..b40cd4aa09 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -350,6 +350,8 @@ public class Weapon implements Cloneable{ BulletType ammo = bullet; float lifeScl = ammo.scaleVelocity ? Mathf.clamp(Mathf.dst(shootX, shootY, aimX, aimY) / ammo.range()) : 1f; + //TODO far too complicated and similar to Turret + sequenceNum = 0; if(delay){ Angles.shotgun(shots, spacing, rotation, f -> { @@ -396,8 +398,8 @@ public class Weapon implements Cloneable{ } ejectEffect.at(mountX, mountY, rotation * side); - ammo.shootEffect.at(shootX, shootY, rotation, parentize ? unit : null); - ammo.smokeEffect.at(shootX, shootY, rotation, parentize ? unit : null); + ammo.shootEffect.at(shootX, shootY, rotation, ammo.hitColor, parentize ? unit : null); + ammo.smokeEffect.at(shootX, shootY, rotation, ammo.hitColor, parentize ? unit : null); unit.apply(shootStatus, shootStatusDuration); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java index ea04cf0b88..f8013c677f 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java @@ -16,6 +16,7 @@ public class BaseTurret extends Block{ public float range = 80f; public float rotateSpeed = 5; + public float coolantUsage = 0.2f; public boolean acceptCoolant = true; /** Effect displayed when coolant is used. */ public Effect coolEffect = Fx.fuelburn; @@ -38,7 +39,7 @@ public class BaseTurret extends Block{ public void init(){ if(acceptCoolant && !consumes.has(ConsumeType.liquid)){ hasLiquids = true; - consumes.add(new ConsumeCoolant(0.2f)).update(false).boost(); + consumes.add(new ConsumeCoolant(coolantUsage)).update(false).boost(); } super.init(); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 3aca805667..fb47b45758 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -23,7 +23,6 @@ import mindustry.graphics.*; import mindustry.logic.*; import mindustry.type.*; import mindustry.world.blocks.*; -import mindustry.world.consumers.*; import mindustry.world.draw.*; import mindustry.world.meta.*; @@ -42,54 +41,74 @@ public class Turret extends ReloadTurret{ public Effect ammoUseEffect = Fx.none; public Sound shootSound = Sounds.shoot; - //general info - public int maxAmmo = 30; - public int ammoPerShot = 1; + public Effect chargeEffect = Fx.none; + public Effect chargeBeginEffect = Fx.none; + public Sound chargeSound = Sounds.none; + + //visuals public float ammoEjectBack = 1f; - public float inaccuracy = 0f; - public float velocityInaccuracy = 0f; public float shootWarmupSpeed = 0.1f; - public int shots = 1; - public float spread = 4f; public float recoilAmount = 1f; public float restitution = 0.02f; public float cooldown = 0.02f; - public float coolantUsage = 0.2f; - public float shootCone = 8f; + public float elevation = -1f; public float shootShake = 0f; + + public int maxAmmo = 30; + public int ammoPerShot = 1; + + //TODO all the fields below should be deprecated and moved into a ShootPattern class or similar + //TODO ...however, it would be nice to unify the weapon and turret systems into one. + + // below + /** Bullet angle randomness in degrees. */ + public float inaccuracy = 0f; + /** Fraction of bullet velocity that is random. */ + public float velocityInaccuracy = 0f; + /** Number of bullets fired per volley. */ + public int shots = 1; + /** + * Spread between bullets in degrees. + * For some dumb reason, this is also used for the "alternation width", and it's too late to change anything. + * */ + public float spread = 4f; + /** Maximum angle difference in degrees at which turret will still try to shoot. */ + public float shootCone = 8f; + /** Length of turret shoot point. */ public float shootLength = -1; + /** Random spread of projectile across width. This looks stupid. */ public float xRand = 0f; /** Currently used for artillery only. */ public float minRange = 0f; + /** Ticks between shots if shots > 1. */ public float burstSpacing = 0; + /** An inflexible and terrible idea. */ public boolean alternate = false; /** If true, this turret will accurately target moving targets with respect to charge time. */ public boolean accurateDelay = false; - public boolean targetAir = true; - public boolean targetGround = true; - public boolean targetHealing = false; - public boolean playerControllable = true; - public boolean displayAmmoMultiplier = true; //charging public float chargeTime = -1f; public int chargeEffects = 5; public float chargeMaxDelay = 10f; - public Effect chargeEffect = Fx.none; - public Effect chargeBeginEffect = Fx.none; - public Sound chargeSound = Sounds.none; + //see above + + public boolean targetAir = true; + public boolean targetGround = true; + public boolean targetHealing = false; + public boolean playerControllable = true; + public boolean displayAmmoMultiplier = true; public Sortf unitSort = UnitSorts.closest; - /** @deprecated loaded in {@link #draw} instead, unused */ - public @Deprecated @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion; - /** @deprecated loaded in {@link #draw} instead, unused */ - public @Deprecated @Load("@-heat") TextureRegion heatRegion; - - public float elevation = -1f; - public DrawBlock draw = new DrawTurret(); + /** @deprecated loaded in {@link #draw} instead, unused */ + @Deprecated + public @Load(value = "@-base", fallback = "block-@size") TextureRegion baseRegion; + /** @deprecated loaded in {@link #draw} instead, unused */ + @Deprecated + public @Load("@-heat") TextureRegion heatRegion; /** @deprecated use bulletOffset; this will always be zero. **/ @Deprecated protected Vec2 tr = new Vec2(); @@ -128,11 +147,6 @@ public class Turret extends ReloadTurret{ @Override public void init(){ - if(acceptCoolant && !consumes.has(ConsumeType.liquid)){ - hasLiquids = true; - consumes.add(new ConsumeCoolant(coolantUsage)).update(false).boost(); - } - if(shootLength < 0) shootLength = size * tilesize / 2f; if(elevation < 0) elevation = size / 2f; @@ -436,6 +450,7 @@ public class Turret extends ReloadTurret{ } protected void shoot(BulletType type){ + //TODO absolute disaster here, combining shot patterns fails in unpredictable ways and I don't want to touch anything in case it breaks mods //when charging is enabled, use the charge shoot pattern if(chargeTime > 0){ @@ -470,6 +485,7 @@ public class Turret extends ReloadTurret{ int ii = i; Time.run(burstSpacing * i, () -> { if(dead || !hasAmmo()) return; + bulletOffset.trns(rotation, shootLength, Mathf.range(xRand)); bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (ii - (int)(shots / 2f)) * spread); effects(); @@ -485,7 +501,7 @@ public class Turret extends ReloadTurret{ if(alternate){ float i = (shotCounter % shots) - (shots-1)/2f; - bulletOffset.trns(rotation - 90, spread * i + Mathf.range(xRand), shootLength); + bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength); bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy)); }else{ bulletOffset.trns(rotation, shootLength, Mathf.range(xRand)); @@ -511,11 +527,13 @@ public class Turret extends ReloadTurret{ } protected void effects(){ - Effect fshootEffect = shootEffect == Fx.none ? peekAmmo().shootEffect : shootEffect; - Effect fsmokeEffect = smokeEffect == Fx.none ? peekAmmo().smokeEffect : smokeEffect; + var bullet = peekAmmo(); + //TODO "shoot" and "smoke" should just be MultiEffects there's no reason to have them separate + Effect fshootEffect = shootEffect == Fx.none ? bullet.shootEffect : shootEffect; + Effect fsmokeEffect = smokeEffect == Fx.none ? bullet.smokeEffect : smokeEffect; - fshootEffect.at(x + bulletOffset.x, y + bulletOffset.y, rotation); - fsmokeEffect.at(x + bulletOffset.x, y + bulletOffset.y, rotation); + fshootEffect.at(x + bulletOffset.x, y + bulletOffset.y, rotation, bullet.hitColor); + fsmokeEffect.at(x + bulletOffset.x, y + bulletOffset.y, rotation, bullet.hitColor); shootSound.at(x + bulletOffset.x, y + bulletOffset.y, Mathf.random(0.9f, 1.1f)); if(shootShake > 0){