From 4366fbc0ee3e89798da723b5b1d4e5dcd349e396 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:27:03 -0800 Subject: [PATCH 01/46] froggy --- Buffs/Pets/StarSwallowerPetBuff.cs | 27 ++ Buffs/Pets/StarSwallowerPetBuff.png | Bin 0 -> 617 bytes Items/Pets/StarSwallowerUnit.cs | 40 +++ Items/Pets/StarSwallowerUnit.png | Bin 0 -> 796 bytes Projectiles/Pets/StarSwallowerPet.cs | 363 ++++++++++++++++++++++++++ Projectiles/Pets/StarSwallowerPet.png | Bin 0 -> 4518 bytes 6 files changed, 430 insertions(+) create mode 100644 Buffs/Pets/StarSwallowerPetBuff.cs create mode 100644 Buffs/Pets/StarSwallowerPetBuff.png create mode 100644 Items/Pets/StarSwallowerUnit.cs create mode 100644 Items/Pets/StarSwallowerUnit.png create mode 100644 Projectiles/Pets/StarSwallowerPet.cs create mode 100644 Projectiles/Pets/StarSwallowerPet.png diff --git a/Buffs/Pets/StarSwallowerPetBuff.cs b/Buffs/Pets/StarSwallowerPetBuff.cs new file mode 100644 index 0000000000..30c26a7850 --- /dev/null +++ b/Buffs/Pets/StarSwallowerPetBuff.cs @@ -0,0 +1,27 @@ +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class StarSwallowerPetBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().starSwallowerPetFroge = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + } + } + } +} diff --git a/Buffs/Pets/StarSwallowerPetBuff.png b/Buffs/Pets/StarSwallowerPetBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..2c9ccf32bf410be8f8ef89085a6ba029fb43c1f8 GIT binary patch literal 617 zcmV-v0+#)WP)Px#1ZP1_K>z@;j|==^1poj6`AI}UR9HvVm(43gVHC#iNP|q{V^WOdt3;#7s0k~h z6tSCRqewPnLpCgBWhwuJW=E05SV1ucvOmGw+?n zJgT{rdvfMg z9uHXU&IL1xPEfHNRa11dVCWUp-vMS$?Z)F)q%>Gp1upIEgC*ksfznbdQetiVKL?n3 zcQ6Q^oX5bM>r;^8eQGlj0q;dubj%ci`Z}=O{{+g+ef}n}Je&&@)W^H`08+~hlVl8lwd3u&7q^-+aD^fbLW{Io? zirt`}1BbKuV7gN=Gh;W%(=hK#@%^Fidw_fU*sJ<8lX#*@C%N~0bIOyF{SMgmb)4gL z>hN`J7@u(d@K#D*vpfI*01jnXNoGw=04e|g00;m8000000Mb*F00000NkvXXu0mjf DElwK6 literal 0 HcmV?d00001 diff --git a/Items/Pets/StarSwallowerUnit.cs b/Items/Pets/StarSwallowerUnit.cs new file mode 100644 index 0000000000..93e0d26691 --- /dev/null +++ b/Items/Pets/StarSwallowerUnit.cs @@ -0,0 +1,40 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.Projectiles.Pets; +using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class StarSwallowerUnit : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Pets"; + public override void SetDefaults() + { + Item.width = 42; + Item.height = 30; + Item.damage = 0; + Item.useAnimation = 20; + Item.useTime = 20; + Item.useStyle = ItemUseStyleID.Swing; + Item.noMelee = true; + + Item.value = Item.sellPrice(gold: 1); + Item.rare = ModContent.RarityType(); + + Item.shoot = ModContent.ProjectileType(); + Item.buffType = ModContent.BuffType(); + Item.UseSound = SoundID.Item10; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(Item.buffType, 15, true); + } + } + } +} diff --git a/Items/Pets/StarSwallowerUnit.png b/Items/Pets/StarSwallowerUnit.png new file mode 100644 index 0000000000000000000000000000000000000000..9c51f4ae8622100f6568b37a1117c675b46b7279 GIT binary patch literal 796 zcmV+%1LOROP)Px#1ZP1_K>z@;j|==^1poj7tVu*cR9HvNmfuTLVHn5fh#g}?*Ty!r>HL8!F%q;9 zB^sF&-bO~yWpopCQ}h?~gTM=+{~?I9Zi6oD%AhF0=r;^qt+}(YIctMPOK z40dzg`GLdteKvjfe9!Z|KUy3O5;{9#jU2x%mBC#4<5dL2X{l{A`~&UfRy<_m(LFq* znl9pzvE4z#HHb~0fVLa0sKM<;gpQg1WoS#tjk$7h9WiOXgXzgLP^Y&9trpyHu=mt^ z#LIJ=P!r6RFV@zf`3{B$hoGIEJvEuXT=hZS=?vy5y!nB6_c`bfN1%m54i3g|>_g0V zU$1+JItK?LB2$^d))us~y$uJWqvMEIRz&}6E*Iw5$mbEu*zbUuhk`+p!0-Pn|M0j)4T>ePPCg|PP-4G>$yf{nW`25V3h{?{3i>ti5lZ+ydAhU&b?(vN zMAyataXl!hK~3hvW8&mGe)I_R+Vz{zp@A-_?5sO-5X!Fddi`)>t{cSa9bCS02}+*7 zcm-X2_yj7S1MDiTaE$YF)zrU~mHBscC+b8z*l3~CB zIn>bs9hsPbvb)H;*W&)e&sihZAQ~N17z`(rEKTF0000 "Projectiles.Pets"; + private int playerStill = 0; + private bool idleAnimation = false; + private bool fly = false; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 8; + Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(1, 8, 6) + .WithOffset(-18f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); + } + + public override void SetDefaults() + { + Projectile.netImportant = true; + Projectile.width = 54; + Projectile.height = 48; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft *= 5; + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + } + + public override bool PreDraw(ref Color lightColor) + { + /* Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnail").Value; + + int height = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = height * Projectile.frame; + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, + Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);*/ + + return true; + } + + public override void PostDraw(Color lightColor) + { + /* Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value; + + int height = texture.Height / Main.projFrames[Projectile.type]; + int frameHeight = height * Projectile.frame; + SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Color.White, + Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);*/ + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + Player player = Main.player[Projectile.owner]; + Vector2 projCenter = Projectile.Center; + Vector2 playerDirection = player.Center - projCenter; + float playerDistance = playerDirection.Length(); + fallThrough = playerDistance > 200f; + return true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (!player.active) + { + Projectile.active = false; + return; + } + + CalamityPlayer modPlayer = player.Calamity(); + if (player.dead) + { + modPlayer.starSwallowerPetFroge = false; + } + if (modPlayer.starSwallowerPetFroge) + { + Projectile.timeLeft = 2; + } + + Vector2 projPos = Projectile.position; + if (!fly) + { + Projectile.rotation = 0; + Vector2 projCenter = Projectile.Center; + Vector2 playerDirection = player.Center - projCenter; + float playerDistance = playerDirection.Length(); + if (Projectile.velocity.Y == 0 && ((HoleBelow() && playerDistance > 150f) || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X))) + { + Projectile.velocity.Y = -8f; + } + Projectile.velocity.Y += 0.35f; + if (Projectile.velocity.Y > 15f) + { + Projectile.velocity.Y = 15f; + } + if (playerDistance > 520f) + { + fly = true; + Projectile.velocity.X = 0f; + Projectile.velocity.Y = 0f; + } + if (playerDistance > 100f) + { + if (player.position.X - Projectile.position.X > 0f) + { + Projectile.velocity.X += 0.12f; + if (Projectile.velocity.X > 6f) + { + Projectile.velocity.X = 6f; + } + } + else + { + Projectile.velocity.X -= 0.12f; + if (Projectile.velocity.X < -6f) + { + Projectile.velocity.X = -6f; + } + } + } + if (playerDistance < 100f) + { + if (Projectile.velocity.X != 0f) + { + if (Projectile.velocity.X > 0.8f) + { + Projectile.velocity.X -= 0.25f; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.velocity.X += 0.25f; + } + else if (Projectile.velocity.X < 0.8f && Projectile.velocity.X > -0.8f) + { + Projectile.velocity.X = 0f; + } + } + } + if (playerDistance < 70f) + { + Projectile.velocity.X *= 0.5f; + } + + //set frames when idle + if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0) + { + /*if (Main.rand.NextBool(200) && !idleAnimation) + { + idleAnimation = true; + } + + if (idleAnimation) + { + Projectile.frameCounter++; + if (Projectile.frameCounter > 8) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 4) + { + Projectile.frame = 0; + idleAnimation = false; + } + } + else + { + Projectile.frame = 0; + Projectile.frameCounter = 0; + }*/ + Projectile.frame = 0; + } + //falling frame + else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) + { + Projectile.frame = 7; + Projectile.frameCounter = 0; + } + else if (Projectile.velocity.X != 0) + { + if (Projectile.frame < 4) + { + //Projectile.frame = 4; + } + + //moving animation + Projectile.frameCounter++; + if (Projectile.frameCounter >= 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 7) + { + Projectile.frame = 0; + } + } + + if (Projectile.velocity.X > 0.8f) + { + Projectile.spriteDirection = -1; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.spriteDirection = 1; + } + } + else if (fly) + { + float flySpeed = 0.5f; + Projectile.tileCollide = false; + Vector2 flyDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float horiPos = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - flyDirection.X; + float vertiPos = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - flyDirection.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)player.direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + if (playerDistance > 1200f) + { + Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); + Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2); + Projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + flySpeed = 0.5f; + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 10 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + { + fly = false; + Projectile.velocity *= 0.2f; + Projectile.tileCollide = true; + } + } + if (playerDistance < 50f) + { + if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) + { + Projectile.velocity *= 0.90f; + } + flySpeed = 0.02f; + } + else + { + if (playerDistance < 100f) + { + flySpeed = 0.35f; + } + if (playerDistance > 300f) + { + flySpeed = 1f; + } + playerDistance = 18f / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + if (Projectile.velocity.X <= horiPos) + { + Projectile.velocity.X = Projectile.velocity.X + flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.X < 0f) + { + Projectile.velocity.X = Projectile.velocity.X + flySpeed; + } + } + if (Projectile.velocity.X > horiPos) + { + Projectile.velocity.X = Projectile.velocity.X - flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.X > 0f) + { + Projectile.velocity.X = Projectile.velocity.X - flySpeed; + } + } + if (Projectile.velocity.Y <= vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y + flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.Y < 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y + flySpeed * 2f; + } + } + if (Projectile.velocity.Y > vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y - flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.Y > 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y - flySpeed * 2f; + } + } + + Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; + + if (Projectile.Center.X < Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = -1; + } + else if (Projectile.Center.X > Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = 1; + } + + //funny flying animation + Projectile.frame = 7; + /*Projectile.frameCounter++; + if (Projectile.frameCounter > 4) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 11) + { + Projectile.frame = 9; + }*/ + } + } + + private bool HoleBelow() + { + int tileWidth = 4; + int tileX = (int)(Projectile.Center.X / 16f) - tileWidth; + if (Projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((Projectile.position.Y + Projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].HasTile && (Main.tile[x - 1, y].HasTile || Main.tile[x + 1, y].HasTile)) + { + return false; + } + } + } + return true; + } + } +} diff --git a/Projectiles/Pets/StarSwallowerPet.png b/Projectiles/Pets/StarSwallowerPet.png new file mode 100644 index 0000000000000000000000000000000000000000..275fa4ac5d77d8025b299bb51653fccab09533df GIT binary patch literal 4518 zcmXw72{aVm+a6mq$}%DQnzE+slYNqX9kPc=NYofvhCyW#Wf_h2CqpVK`x28qWNb53 zh#A>u%DyvM=0A15@1FOb_ug~Qx#ynudAH{#+1Z$$1_}cK0KjQ;Gh--2s{;T`=^Q5* ztC>evOBjj?4mE`UDhQU>rABWoi7pgN87@Fp7oz^iF)Y~&c}x$+YERBS}(i&pRI z&!fKEV-K_>K2fe-t{66X?lbH*{K&CNxlRF-mG#jjIgaBaM>(`e`D2_}P@vIWOHO68 z4wnw@0A5GOx=i8AKLlkiCz+FPX^FriYMaIfCj-`+{R>FB{?ryV_}=PZIOV8gp`}(Q zVwJo#5KS2X6Y~RAPjz1UE52wKN>9{X&ose2#M7CcQ!aF4 z#_dabd!IQ$uGKZ5&6jF$xRmTg_u4OU)cvnn)*$Rez3uG&!1I_8>P%-%85)V|OTdiR z1b^rXs>E5$23596Z6x*3FT#F(egKk?h;x|zmi8&*_{)fmkrRg@`gE-F$&VGT3vKWm zNbKE->1>xGI}Z6U>WwKhN8wO~n2xM;iFgbI@@?d3&)nl6vq^S$Ss(lZ+mplmS zAQaDmig>cHll7K9I86*v?~>;Ee&KQFfX@cph3A+QcN0yI<#>VCVn38&Q`cKSDiUx~ z(@LuQIsL<-P7sqKt4l7Rrjiycf1eAs!rI-q%Tl^i$T95^y*218`zouGcB0VffJk>^ z%|veFD_Zu;^*v)8%VzP=^dHMxOog{3NUb-dEkH|wI2IRh z2xkp+P|*qBI!GIHe#IMP;u!yF}Y@Z#}d-I?BSh{^B~l?v_EK+u?C_#*|{`*m3?Dxt*!WsK>_ZCH}i+ z&p)ixd35hO|8ahQ!Jll;crRB#y%<4_*Es`n$>5Q3zO8hU4(Q4R$hLWh9`&HgF; zq~Xbs7e*bg!JSxBE+Z+sK(#E3n#$-WAH44Qc}cb75(JnmPRR}^vz4RT!B2=&bX<_^ zEZo_%)qXbDSHj#_q7%PeC(rkY{|f2HKF=Au0CRLx)}xz(PZ+X6x9oHy!OG_mXsjo; zKzxkdPDwni*=J>Okqa3f8Y&&yqHXF6%}~g{fw}~2ZN^E$ZryUR5S`Pu@+O;1@6@3i z38PLlLTf6QtNyR(>q2E(nO|?@GyK>r>2wBNk}%8xdY%c)D@Gq|#qaz%_duO_w||5* z%rO98?0LI&a3E`gy&?;Qd4)ku=PIWJGa~81AgGQo(;hk-jYLMRdAbhaTOoQM$d`3v zwgcvAGeHeg7pv`4zi=WDwC6)K=21g^QrZ+zc2x4)f!$R2O{L1XVy z<(R!3KEj4bIKM*Wl+T-r#l5cZ4p;TzbN`RZN4ohYQkNs3SU_{`8q~Q;llXfSTY%Xg zI^C9zukb!GXO`E-)b60Jqoa6$h{yQWeBfz%#6(abVI!@iUCN?ta;MrBOuqHwTUTk* zEdKzz&z5Z=YY(gkVP?s*(NY47Koc&h2+f@`43g{|2EGG)5FVCr2i$IRHKYmljF~ES z+DUwR?E|uHw|CstHC2ZmzpQ}y4hLdI4NulOvsd*b@^_%)Mdt*r(GXUs>Ct3)J=KcKjs>ivm46~4s&E&5h=2RniemlpTJ^; zQ^3MUr69DWKT6xrkiz%>rRi^hDn&)L=a4BthJ>l{e)kA<;J3H!g?eHs8c*5?#AJMV(Hl4g178 zI4PjKn%-y7M38b+JF{GEtmf7(E`(L3-0Qy?wBh;R+VPLQyCmu zm-v$ZOG~A5T^e;W!Stm;NEcfie=ZwDUUEEGkKzDsigxH?<-Obf3-|mMngVW%$drTc zCpf4Y0E2}E)3uaWR*F2BODCrrC<4p{%Y-gm<&U7gY2BRB@f?Q?~8W_3Lvp%qY@XAyTL;C zUmF`PzAHutS(cBy{63y@10`6#tK&YumpqcTRhr@8&u=Z14n{qHlbUxGR%qKCJ%R(d zyD1b4fc$U2l@$kvn!O5NW~acOo?9jOoIj`+wYZ!9r=nx~dqNkqSN`&4{qt0LPYEQ? z1hRC$z*;Ya3xm8i*1&ZoTloc1Oi<*-LgU2gdDEg45fAKV@&#qIGMhMRe?%otiC3?j z?CWOI`k}bxhQNs2JM(%9=KMTiC}ylN^;;z4W^G}8~0 z@$#?b!+PFSurWz|*4z6j!yBNcvQdf)*JrM$a50kh(vyqnjiHEKIY;uSOn(`lu3ms& zC+t;G3Vvg2J<z-MO>-X^S;KS^Hjm+aYNrbompcoGtQsrcrQjIs7j7e5H)7rs5RtYKT?Wj-%X^#v9d=^goZAGqyZE&DkoWbg%7`dD)1~tj+oB zo}LwvDnDbP%`yt_>3Rm>uHxxVwg~-C71Os3Hz~cFh9R%TPE#k&6mt7g6)Vl=i4W^1 zCu`PB&wCh1g(?^Ti&&$=gtrEmf=vw1-`79cu@qGN3lKN|YEa7=tO1jGM&2xOy8P@N4s63Tv^ez4h3W(4Okz7<-KJ%W<{#DG+-u z>oe@j0U*n~0%a(9$$l^mV&$QXFJEoH%mtB6TDjR=I&%7l27gJ3Od5coF_5l5bC1Z! zY#!7BC|WZ#S1l7Pz&(;-<^!(UsJ9o-zvU@~a+>(>qss=IGvhnd@U9h!E{jh7JZ5&6&m z^yNVEROO2W1R0z*~KotCrG1``w~icsPKq#6N3s|a#2GrZi+g1~dxM;RYcipH66U(!omIRzQBufMq zzkD^cxk)w?A$21w#;DobY?d}Mkj~u(#MUDgt#Y?kKU0aB3-3R zcfgT>521|_kKCz@^EB6Z-)!Xld=@Kyzbfv{7DH0ON3rdp+g?T563mJ$F2f372O2@{ z$4w{-zjDi2iU%)iSN|Fm8DsdX>Av3MwYi1Y>ksUA`I)a}~Xbro_ZfBP*K9t@X7o&#h*&ne+FzLdpj2(BHAhIA+u%Y*aQH#+qYrF*Zv{ z8pL;L@6$DjqGn6r;4P{^?nbn6Jxq2hAHB6 z@!*7^lSRMS7u^#5cX8Z`B3HFCE{<8Of|%^ z8-53)k%WaP#+Mxa9Q9kCK-TX~zq~1Uh+uaZ)CyqkRXQh6u`jk1{l4a!u z86yXA(l@dv4$6^$@wu~;&)h0vQe51kw@v%)P;w3;l#WChCO{=s8}7$4OjW+Ahpv*g ziske9O38|{Su*xP8MdU+5HG-}|0A`3d2Jxnvdu%GP9OD}WJ|h$#XGY)%PCGUv+(oxkCkDQQt4_B>{d>nhcMru1>vZuRK%I@(b@y|v}4!BN9QsnD8Dv>}G zsFn8yxhR*PGQVbHTmkWZ^grFn B)zJU| literal 0 HcmV?d00001 From 9f16e5ec107f5a1090d60ed46de844b61adb90bb Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 31 Mar 2026 21:54:00 -0400 Subject: [PATCH 02/46] The Jailor is a specialist weapon --- Items/Weapons/Ranged/TheJailor.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index 55fc16c5d4..b2cc4f3371 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -12,6 +12,11 @@ namespace CalamityMod.Items.Weapons.Ranged public class TheJailor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public override void SetStaticDefaults() + { + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + } public override void SetDefaults() { Item.width = 102; From 8df2d29296f797863f7752a7887680e25ff5e426 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 31 Mar 2026 22:43:39 -0400 Subject: [PATCH 03/46] Proper fix for Dryad's Tear extra burst not critting Removed logic giving artificial crit chance to BasicBurst Also actually fixed V8000 soul localization --- .../en-US/Mods.CalamityMod.Projectiles.Typeless.hjson | 1 + Projectiles/Ranged/DryadsTearMain.cs | 2 +- Projectiles/Typeless/BasicBurst.cs | 8 -------- Projectiles/Typeless/V8000SoulVisual.cs | 3 ++- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 3c03ba6f79..ee3498a7eb 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -153,6 +153,7 @@ TitanHeartBoom.DisplayName: Titan Heart Boom TransformerAura.DisplayName: Transformer Aura TransformerBlob.DisplayName: Transformer Shard UrsaSlash.DisplayName: Ursa Slash +V8000SoulVisual.DisplayName: V8000 Soul VerstaltiteBobber.DisplayName: Verstaltite Bobber VictideBarrier.DisplayName: Tidal Barrier VictideBobber.DisplayName: Snail Bobber diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index b014d84d92..7af0a84e3d 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -330,7 +330,7 @@ namespace CalamityMod.Projectiles.Ranged int hitsToMinMult = (int)(3 + 5 * damageMult); int knockback = (int)(7 * damageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power int damage = (int)(Projectile.damage * explosionDamageMult * damageMult); - Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 8; blast.DamageType = DamageClass.Ranged; blast.ArmorPenetration = Projectile.ArmorPenetration; diff --git a/Projectiles/Typeless/BasicBurst.cs b/Projectiles/Typeless/BasicBurst.cs index 0633d2b71e..10feff399b 100644 --- a/Projectiles/Typeless/BasicBurst.cs +++ b/Projectiles/Typeless/BasicBurst.cs @@ -72,14 +72,6 @@ namespace CalamityMod.Projectiles.Typeless if (customKnockback != 0) target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); - - if (Projectile.owner != -1) - { - Player Owner = Main.player[Projectile.owner]; - bool crit = Main.rand.Next(0, 100 + 1) < Owner.GetTotalCritChance(Projectile.DamageType); - if (crit) - modifiers.SetCrit(); - } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Typeless/V8000SoulVisual.cs b/Projectiles/Typeless/V8000SoulVisual.cs index 76d526cd24..0507db89f3 100644 --- a/Projectiles/Typeless/V8000SoulVisual.cs +++ b/Projectiles/Typeless/V8000SoulVisual.cs @@ -13,8 +13,9 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class V8000SoulVisual : ModProjectile, IPixelatedPrimitiveRenderer + public class V8000SoulVisual : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { + public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() From 491394c4c942203b05bd79b71f6b8635834b7256 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 1 Apr 2026 12:28:28 -0400 Subject: [PATCH 04/46] Removed Void of Calamity Cal Clone's Expert drop is now Regenerator --- CalPlayer/CalamityPlayer.cs | 2 - Items/Accessories/Regenerator.cs | 1 + Items/Accessories/VoidofCalamity.cs | 42 -------- Items/Accessories/VoidofCalamity.png | Bin 613 -> 0 bytes Items/TreasureBags/CalamitasCloneBag.cs | 3 +- .../Mods.CalamityMod.Items.Accessories.hjson | 9 -- ...ods.CalamityMod.Projectiles.Typeless.hjson | 1 - NPCs/CalClone/CalamitasClone.cs | 3 +- Projectiles/Typeless/StandingFire.cs | 95 ------------------ 9 files changed, 3 insertions(+), 153 deletions(-) delete mode 100644 Items/Accessories/VoidofCalamity.cs delete mode 100644 Items/Accessories/VoidofCalamity.png delete mode 100644 Projectiles/Typeless/StandingFire.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1d01e55f3a..d46cef1e26 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1037,7 +1037,6 @@ namespace CalamityMod.CalPlayer public bool baroclaw = false; public bool IsFirstDashFrame = true; public int fallingBootVelCheckTimer = 0; - public bool voidOfCalamity = false; public bool apollyon = false; public bool eArtifact = false; public bool dArtifact = false; @@ -2466,7 +2465,6 @@ namespace CalamityMod.CalPlayer darkSunRing = false; crawCarapace = false; baroclaw = false; - voidOfCalamity = false; apollyon = false; eArtifact = false; dArtifact = false; diff --git a/Items/Accessories/Regenerator.cs b/Items/Accessories/Regenerator.cs index dc1bc73dd3..20d8e38a39 100644 --- a/Items/Accessories/Regenerator.cs +++ b/Items/Accessories/Regenerator.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; + Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs deleted file mode 100644 index 7289ae6af2..0000000000 --- a/Items/Accessories/VoidofCalamity.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - [LegacyName("CalamityRing")] - public class VoidofCalamity : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public override void SetDefaults() - { - Item.width = 20; - Item.height = 22; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; - Item.rare = ItemRarityID.Lime; - Item.accessory = true; - Item.expert = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.voidOfCalamity = true; - player.GetDamage() += 0.12f; - if (player.whoAmI == Main.myPlayer) - { - var source = player.GetSource_Accessory(Item); - if (player.immune) - { - if (player.miscCounter % 10 == 0) - { - int damage = (int)player.GetBestClassDamage().ApplyTo(30); - CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); - } - } - } - } - } -} diff --git a/Items/Accessories/VoidofCalamity.png b/Items/Accessories/VoidofCalamity.png deleted file mode 100644 index 6054ac92732392d908d64c1a6335fc9515ada3aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 613 zcmV-r0-F7aP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0s2WqK~z{r)t0eK z0#O{t?-G^rG+G^`ATYroYG`S13YuyP`WIS*rXp(UUkKWo8f$9`8jPTzjKG3w2qQ`x zH1P7izOQ&c?{(Mq`ha}z`HrXe@%MXA+tT2wJWr>Qv$Y!E3gl*F1Zx%E-!X3EyZCCL;^B9wY!p&q>a6)XG=#xvE+@?f{wg$PuAzVe z`KuWp7sJC?I~k8-{EUE^N|Iu;qS%a+> z#*J7E`I$^2i`6R9JVUzLiAtCu&g*Ke-OVu9?q-aQG(;oadQ#wh*=3i_Ci1FMLCSeq zJF*68Oq!&re^EmOQyc&{q z_8aEa&~Yk-i}|mwz^;;ABWsGa@?sw$=SSC&64qW=7n-{d@yYol3$}k-T2iO6yl?kz z7fJS~H<9cjcAe}_8abSpK+ctSkmeiG!CH}qi2R>KLpp=27aK^4`CS&(RM_4k&5*3S zh-6pxVE9>fB20xLyMu5aI(gVb>WI7dF!F7WV@%95q*8l$HLN1?&EAS+j)c`p559HH zHKgOY{|Tijt`TT3;a+3DX?INb5V($EhAis`%R0=3=Wi~J00000NkvXXu0mjfIy@fX diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 25b976118d..19173990a8 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -72,8 +72,7 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); - itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); - itemLoot.Add(ModContent.ItemType()); + itemLoot.Add(ModContent.ItemType()); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 8a2cef2d0e..042a8f6b4e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2086,15 +2086,6 @@ VitalJelly: { Tooltip: 12% increased movement and jump speed } -VoidofCalamity: { - DisplayName: Void of Calamity - Tooltip: - ''' - 12% increased damage - Brimstone fire rains down after getting hit - ''' -} - VoltaicJelly: { DisplayName: Voltaic Jelly Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index ee3498a7eb..746145cb29 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -136,7 +136,6 @@ SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye SpringStoolFX.DisplayName: Spring Stool -StandingFire.DisplayName: Flame StarStruckWaterBottle.DisplayName: Bottle StepStoolBonusFX.DisplayName: Step Stool Bonus StickyFeatherAero.DisplayName: Feather diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 7f96e910bc..2a6e8d8d98 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -1052,9 +1052,8 @@ namespace CalamityMod.NPCs.CalClone // Equipment // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss - // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + // normalOnly.Add(ModContent.ItemType()); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs deleted file mode 100644 index b692380ee6..0000000000 --- a/Projectiles/Typeless/StandingFire.cs +++ /dev/null @@ -1,95 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless -{ - public class StandingFire : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 6; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 240; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 7; - } - - public override void AI() - { - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; - if (Projectile.ai[1] == 0f && Projectile.type >= ProjectileID.GreekFire1 && Projectile.type <= ProjectileID.GreekFire3) - { - Projectile.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item13, Projectile.position); - } - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[brimDust]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int brimDusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dusty = Main.dust[brimDusty]; - dusty.position.X -= 2f; - dusty.position.Y += 2f; - dusty.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - dusty.noGravity = true; - dusty.velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); - } -} From fdd39bef7ed7f7735ba7b79e89fde8426c7933c3 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 2 Apr 2026 14:46:05 -0400 Subject: [PATCH 05/46] Reverted Void of Calamity removal for now Maybe we officially decide to remove it later idk, but it was definitely done hastily --- CalPlayer/CalamityPlayer.cs | 2 + Items/Accessories/Regenerator.cs | 1 - Items/Accessories/VoidofCalamity.cs | 42 ++++++++ Items/Accessories/VoidofCalamity.png | Bin 0 -> 613 bytes Items/TreasureBags/CalamitasCloneBag.cs | 3 +- .../Mods.CalamityMod.Items.Accessories.hjson | 9 ++ ...ods.CalamityMod.Projectiles.Typeless.hjson | 1 + NPCs/CalClone/CalamitasClone.cs | 3 +- Projectiles/Typeless/StandingFire.cs | 95 ++++++++++++++++++ 9 files changed, 153 insertions(+), 3 deletions(-) create mode 100644 Items/Accessories/VoidofCalamity.cs create mode 100644 Items/Accessories/VoidofCalamity.png create mode 100644 Projectiles/Typeless/StandingFire.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d46cef1e26..1d01e55f3a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1037,6 +1037,7 @@ namespace CalamityMod.CalPlayer public bool baroclaw = false; public bool IsFirstDashFrame = true; public int fallingBootVelCheckTimer = 0; + public bool voidOfCalamity = false; public bool apollyon = false; public bool eArtifact = false; public bool dArtifact = false; @@ -2465,6 +2466,7 @@ namespace CalamityMod.CalPlayer darkSunRing = false; crawCarapace = false; baroclaw = false; + voidOfCalamity = false; apollyon = false; eArtifact = false; dArtifact = false; diff --git a/Items/Accessories/Regenerator.cs b/Items/Accessories/Regenerator.cs index 20d8e38a39..dc1bc73dd3 100644 --- a/Items/Accessories/Regenerator.cs +++ b/Items/Accessories/Regenerator.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; - Item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs new file mode 100644 index 0000000000..7289ae6af2 --- /dev/null +++ b/Items/Accessories/VoidofCalamity.cs @@ -0,0 +1,42 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Typeless; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + [LegacyName("CalamityRing")] + public class VoidofCalamity : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void SetDefaults() + { + Item.width = 20; + Item.height = 22; + Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.rare = ItemRarityID.Lime; + Item.accessory = true; + Item.expert = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.voidOfCalamity = true; + player.GetDamage() += 0.12f; + if (player.whoAmI == Main.myPlayer) + { + var source = player.GetSource_Accessory(Item); + if (player.immune) + { + if (player.miscCounter % 10 == 0) + { + int damage = (int)player.GetBestClassDamage().ApplyTo(30); + CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); + } + } + } + } + } +} diff --git a/Items/Accessories/VoidofCalamity.png b/Items/Accessories/VoidofCalamity.png new file mode 100644 index 0000000000000000000000000000000000000000..6054ac92732392d908d64c1a6335fc9515ada3aa GIT binary patch literal 613 zcmV-r0-F7aP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0s2WqK~z{r)t0eK z0#O{t?-G^rG+G^`ATYroYG`S13YuyP`WIS*rXp(UUkKWo8f$9`8jPTzjKG3w2qQ`x zH1P7izOQ&c?{(Mq`ha}z`HrXe@%MXA+tT2wJWr>Qv$Y!E3gl*F1Zx%E-!X3EyZCCL;^B9wY!p&q>a6)XG=#xvE+@?f{wg$PuAzVe z`KuWp7sJC?I~k8-{EUE^N|Iu;qS%a+> z#*J7E`I$^2i`6R9JVUzLiAtCu&g*Ke-OVu9?q-aQG(;oadQ#wh*=3i_Ci1FMLCSeq zJF*68Oq!&re^EmOQyc&{q z_8aEa&~Yk-i}|mwz^;;ABWsGa@?sw$=SSC&64qW=7n-{d@yYol3$}k-T2iO6yl?kz z7fJS~H<9cjcAe}_8abSpK+ctSkmeiG!CH}qi2R>KLpp=27aK^4`CS&(RM_4k&5*3S zh-6pxVE9>fB20xLyMu5aI(gVb>WI7dF!F7WV@%95q*8l$HLN1?&EAS+j)c`p559HH zHKgOY{|Tijt`TT3;a+3DX?INb5V($EhAis`%R0=3=Wi~J00000NkvXXu0mjfIy@fX literal 0 HcmV?d00001 diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 19173990a8..25b976118d 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -72,7 +72,8 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); - itemLoot.Add(ModContent.ItemType()); + itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); + itemLoot.Add(ModContent.ItemType()); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 042a8f6b4e..8a2cef2d0e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2086,6 +2086,15 @@ VitalJelly: { Tooltip: 12% increased movement and jump speed } +VoidofCalamity: { + DisplayName: Void of Calamity + Tooltip: + ''' + 12% increased damage + Brimstone fire rains down after getting hit + ''' +} + VoltaicJelly: { DisplayName: Voltaic Jelly Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 746145cb29..ee3498a7eb 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -136,6 +136,7 @@ SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye SpringStoolFX.DisplayName: Spring Stool +StandingFire.DisplayName: Flame StarStruckWaterBottle.DisplayName: Bottle StepStoolBonusFX.DisplayName: Step Stool Bonus StickyFeatherAero.DisplayName: Feather diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 2a6e8d8d98..7f96e910bc 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -1052,8 +1052,9 @@ namespace CalamityMod.NPCs.CalClone // Equipment // 16NOV2025: Ozzatron: item has been chosen as the "Expert gatekept" item for this Calamity boss - // normalOnly.Add(ModContent.ItemType()); + // normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs new file mode 100644 index 0000000000..b692380ee6 --- /dev/null +++ b/Projectiles/Typeless/StandingFire.cs @@ -0,0 +1,95 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Typeless +{ + public class StandingFire : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft = 240; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 7; + } + + public override void AI() + { + if (Projectile.velocity.X != Projectile.velocity.X) + { + Projectile.velocity.X = Projectile.velocity.X * -0.1f; + } + if (Projectile.velocity.X != Projectile.velocity.X) + { + Projectile.velocity.X = Projectile.velocity.X * -0.5f; + } + if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) + { + Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; + } + Projectile.ai[0] += 1f; + if (Projectile.ai[0] > 5f) + { + Projectile.ai[0] = 5f; + if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) + { + Projectile.velocity.X = Projectile.velocity.X * 0.97f; + if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) + { + Projectile.velocity.X = 0f; + Projectile.netUpdate = true; + } + } + Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; + } + Projectile.rotation += Projectile.velocity.X * 0.1f; + if (Projectile.ai[1] == 0f && Projectile.type >= ProjectileID.GreekFire1 && Projectile.type <= ProjectileID.GreekFire3) + { + Projectile.ai[1] = 1f; + SoundEngine.PlaySound(SoundID.Item13, Projectile.position); + } + int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[brimDust]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; + if (Main.rand.NextBool()) + { + int brimDusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); + Dust dusty = Main.dust[brimDusty]; + dusty.position.X -= 2f; + dusty.position.Y += 2f; + dusty.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dusty.noGravity = true; + dusty.velocity *= 0.1f; + } + if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) + { + Projectile.velocity.X = Projectile.velocity.X * 0.8f; + } + Projectile.rotation = -Projectile.velocity.X * 0.05f; + if (Projectile.velocity.Y > 16f) + { + Projectile.velocity.Y = 16f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + } +} From 6ee55f1eeaae38e8d98c60b15fd59477d904fc2c Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 2 Apr 2026 15:55:26 -0400 Subject: [PATCH 06/46] 1 - Fixed weapons spawning holdout when item is held using the wrong source and thus not receiving crit from prefixes 2 - Basher nerf --- CalPlayer/CalamityPlayerMiscEffects.cs | 8 ++++---- Items/Weapons/Melee/Basher.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 8f40b12dd9..47b16f7abb 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -211,22 +211,22 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) { int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) { int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) { int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) { int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } } diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 99890c2b25..17e7676ecb 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 85; + Item.damage = 77; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; From f7ab902fcbe2ab6be0140c2edc00faaa7544ffa2 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 3 Apr 2026 20:50:03 -0400 Subject: [PATCH 07/46] EoL no longer randomly skips attacks in her attack pattern Also adjusted her attack pattern to be the same as vanilla because why was it not lmao --- .../Bosses/EmpressofLightAI.cs | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index 93f63dd357..b2f1cadca3 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -243,30 +243,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses attackType = 2; if (attackPatternLength % attackIncrement == phase1Attack2) - attackType = 6; - - if (attackPatternLength % attackIncrement == phase1Attack3) attackType = 8; + if (attackPatternLength % attackIncrement == phase1Attack3) + attackType = 6; + if (attackPatternLength % attackIncrement == phase1Attack4) - { - attackType = 4; - - // Adjust the upcoming Ethereal Lance attack depending on what random variable is chosen here. - calamityGlobalNPC.newAI[3] = Main.rand.Next(2); - - // Sync the Calamity AI variables. - NPC.SyncExtraAI(); - } + attackType = 8; if (attackPatternLength % attackIncrement == phase1Attack5) attackType = 5; if (attackPatternLength % attackIncrement == phase1Attack6) - attackType = 8; + attackType = 2; if (attackPatternLength % attackIncrement == phase1Attack7) - attackType = 2; + attackType = 8; if (attackPatternLength % attackIncrement == phase1Attack8) { @@ -319,28 +311,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackPatternLength % attackIncrement == phase2Attack3) attackType = 8; + if (attackPatternLength % attackIncrement == phase2Attack4) + attackType = 11; + if (attackPatternLength % attackIncrement == phase2Attack5) attackType = 5; if (attackPatternLength % attackIncrement == phase2Attack6) attackType = 2; - if (attackPatternLength % attackIncrement == phase2Attack7) - { - if (phase3) - { - attackType = 7; - - // Adjust the upcoming Ethereal Lance attack depending on what random variable is chosen here. - calamityGlobalNPC.newAI[2] = Main.rand.Next(2); - - // Sync the Calamity AI variables. - NPC.SyncExtraAI(); - } - else - attackType = 6; - } - if (attackPatternLength % attackIncrement == phase2Attack7) { if (phase3) @@ -371,9 +350,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackPatternLength % attackIncrement == phase2Attack9) attackType = 8; - if (attackPatternLength % attackIncrement == phase2Attack4) - attackType = 11; - if (attackPatternLength % attackIncrement == phase2Attack10) attackType = 12; } @@ -403,7 +379,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.ai[0] = attackType; NPC.ai[1] = 0f; - NPC.ai[2] += Main.rand.Next(2) + 1f; + NPC.ai[2] += 1f; NPC.netUpdate = true; break; From c88c5608c359730df71ff249265d96b8b8196e53 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 4 Apr 2026 00:53:03 -0400 Subject: [PATCH 08/46] Buffed Planebreaker's Pouch crit chance to match Deadshot Brooch --- Items/Accessories/PlanebreakersPouch.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Accessories/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 11de8740a1..30445b7dcc 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage() += 0.15f; - player.GetCritChance() += 5; + player.GetCritChance() += 7; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.deadshotBrooch = true; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index b2ab571ea3..55a075fb84 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1320,7 +1320,7 @@ PlanebreakersPouch: { DisplayName: Planebreaker's Pouch Tooltip: ''' - 15% increased ranged damage, 5% increased ranged critical strike chance and 20% reduced ammo usage + 15% increased ranged damage, 7% increased ranged critical strike chance and 20% reduced ammo usage Grants a 20% chance to not consume arrows Pressing [KEY] will automatically swap the ammos in your ammo slots The ammo type swapped depends on the ammo of the weapon you are holding From 0c57f7284e37683ffb330647b9ac74eca95be9f2 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 4 Apr 2026 13:41:49 -0400 Subject: [PATCH 09/46] Fixed natural Draconic Swarmer localization --- Localization/en-US/Mods.CalamityMod.NPCs.hjson | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index da3390cf62..ac7691f508 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -190,7 +190,7 @@ Stormlion.DisplayName: Stormlion StormlionSentry.DisplayName: Stormlion Sentry Sunskater.DisplayName: Sunskater SuperDummyNPC.DisplayName: Super Dummy -WildBumblefuck.DisplayName: Draconic Swarmer +WildBumblebirb.DisplayName: Draconic Swarmer WulfrumAmplifier.DisplayName: Wulfrum Amplifier WulfrumDrone.DisplayName: Wulfrum Drone WulfrumGyrator.DisplayName: Wulfrum Gyrator @@ -561,7 +561,6 @@ SeaKing: { } } -WildBumblebirb.DisplayName: Wild Bumblebirb DraconicSwarmer.DisplayName: Draconic Swarmer Dragonfolly.DisplayName: Dragonfolly Shoreskipper.DisplayName: Shoreskipper From 22137fd14f97f3d99a7ef0852cae8f8675e5297d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 5 Apr 2026 00:47:51 -0400 Subject: [PATCH 10/46] Fixed Influx Waver beams not inflicting Electrified --- CalPlayer/CalamityPlayerOnHit.cs | 1 - Projectiles/CalamityGlobalProjectile.cs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index f6ea8ea8b2..8a6afe2612 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -276,7 +276,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.OnFire3, 180); break; - case ProjectileID.InfluxWaver: case ProjectileID.UFOLaser: case ProjectileID.Electrosphere: target.AddBuff(BuffID.Electrified, 180); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5aea36abe3..3914fb7714 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4680,6 +4680,10 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage /= 1.5f; } + // Debuff infliction must be placed here as opposed to a more common hook like OnHitNPCWithProj because its on-hit logic breaks the loop before it reaches that hook + if (projectile.type == ProjectileID.InfluxWaver) + target.AddBuff(BuffID.Electrified, 180); + // Create sparks on hit to hammer in the defense shredding. if (deepcoreBullet) { From 7ef5bd1d494edb2a110d076e3bc7b3e1a4622940 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 5 Apr 2026 14:38:34 -0400 Subject: [PATCH 11/46] Removed several debuffs added to vanilla weapons A few rebalances Piranha Gun and Barracuda Gun now have dynamic stat updating --- CalPlayer/CalamityPlayerOnHit.cs | 28 +++-------------------- Items/CalamityGlobalItemTweaks.cs | 6 ++--- Projectiles/CalamityGlobalProjectile.cs | 15 ++++-------- Projectiles/Ranged/MechanicalBarracuda.cs | 1 + 4 files changed, 11 insertions(+), 39 deletions(-) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 8a6afe2612..506a854fc1 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -109,15 +109,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Electrified, 300); break; - case ItemID.BeeKeeper: - case ItemID.BladeofGrass: - target.AddBuff(BuffID.Poisoned, 240); - break; - - case ItemID.FieryGreatsword: - target.AddBuff(BuffID.OnFire3, 90); - break; - case ItemID.IceSickle: case ItemID.Frostbrand: target.AddBuff(BuffID.Frostburn2, 300); @@ -126,11 +117,6 @@ namespace CalamityMod.CalPlayer case ItemID.IceBlade: target.AddBuff(BuffID.Frostburn, 120); break; - - case (>= ItemID.BluePhaseblade and <= ItemID.YellowPhaseblade) or ItemID.OrangePhaseblade: - case (>= ItemID.BluePhasesaber and <= ItemID.YellowPhasesaber) or ItemID.OrangePhasesaber: - // TODO: find an EPIC lightsaber sound - break; } if (flameWakerBoots) @@ -272,6 +258,7 @@ namespace CalamityMod.CalPlayer switch (proj.type) { + // Remove this in 1.4.5 port case ProjectileID.ObsidianSwordfish: target.AddBuff(BuffID.OnFire3, 180); break; @@ -287,11 +274,13 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 90); break; + // Replace with Broken Armor in 1.4.5 port case ProjectileID.GolemFist: target.AddBuff(BuffType(), 180); break; case ProjectileID.ButchersChainsaw: + // Remove this in 1.4.5 port case ProjectileID.MechanicalPiranha: target.AddBuff(BuffType(), 180); break; @@ -300,21 +289,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 180); break; - case ProjectileID.Cascade: case ProjectileID.FlamingMace: target.AddBuff(BuffID.OnFire, 60); break; - case ProjectileID.Bee: - case ProjectileID.GiantBee: - case ProjectileID.BladeOfGrass: - target.AddBuff(BuffID.Poisoned, 120); - break; - - case ProjectileID.Wasp: - target.AddBuff(BuffID.Venom, 60); - break; - case ProjectileID.NorthPoleWeapon: target.AddBuff(BuffID.Frostburn, 300); break; diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index d51e357e31..ee808d4840 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Items { ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB { ItemID.BeeGun, Do(DamageExact(11), ManaExact(4)) }, // VANILLA: 9 DMG, 5 MANA { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, // VANILLA: 30 DMG - { ItemID.Beenade, Do(DamageExact(11), UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 12 DMG, 15 UT, 6 VEL - { ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) }, // VANILLA: 23 DMG, 23 UT + { ItemID.Beenade, Do(UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 15 UT, 6 VEL + { ItemID.BeesKnees, Do(DamageExact(21), UseExact(35)) }, // VANILLA: 23 DMG, 23 UT { ItemID.Bladetongue, Do(UseTurn, DamageExact(120), UseExact(22)) }, // VANILLA: 55 DMG, 28 UT { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, // VANILLA: 58 DMG, 9 MANA { ItemID.BloodyMachete, Do(DamageExact(24)) }, // VANILLA: 20 DMG @@ -271,7 +271,7 @@ namespace CalamityMod.Items { ItemID.Uzi, Do(UseExact(8)) }, // VANILLA: 9 UT { ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // VANILLA: 70 DMG. Has the same stats as Red's Throw { ItemID.VenomStaff, Do(UseExact(27)) }, // VANILLA: 30 UT - { ItemID.WaspGun, Do(DamageExact(44)) }, // VANILLA: 31 DMG + { ItemID.WaspGun, Do(DamageExact(41)) }, // VANILLA: 31 DMG { ItemID.WaterBolt, Do(DamageExact(23)) }, // VANILLA: 19 DMG { ItemID.WhitePhaseblade, phaseblade }, { ItemID.WhitePhasesaber, phasesaber }, diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 3914fb7714..4b2d2048e8 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -420,6 +420,10 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.ZapinatorLaser) projectile.originalDamage = projectile.damage; + // Make Piranha Gun have dynamic stat tweaking + if (projectile.type == ProjectileID.MechanicalPiranha) + projectile.ContinuouslyUpdateDamageStats = true; + // Apply Calamity Global Projectile Tweaks. SetDefaults_ApplyTweaks(projectile); } @@ -3783,17 +3787,6 @@ namespace CalamityMod.Projectiles projectile.damage += 15; } - if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee) - { - if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 - { - if (player.HeldItem.type == ItemID.BeesKnees) - projectile.DamageType = DamageClass.Ranged; - } - } - else if (projectile.type == ProjectileID.SoulDrain) - projectile.DamageType = DamageClass.Magic; - frameOneHacksExecuted = true; } diff --git a/Projectiles/Ranged/MechanicalBarracuda.cs b/Projectiles/Ranged/MechanicalBarracuda.cs index ca668b7d03..f4cdb22e3e 100644 --- a/Projectiles/Ranged/MechanicalBarracuda.cs +++ b/Projectiles/Ranged/MechanicalBarracuda.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 22; Projectile.friendly = true; Projectile.aiStyle = ProjAIStyleID.MechanicalPiranha; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; From 52445e5ea8d004bcd50d1b113b7146c4e97c9bf6 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sat, 4 Apr 2026 23:17:50 -0500 Subject: [PATCH 12/46] iv drip tooltip effect chat tag --- ChatTags/CustomColorEffectHandler.cs | 92 +++++++++++++++++++ Items/CalamityGlobalItemTooltip.cs | 29 ------ .../Mods.CalamityMod.Items.Accessories.hjson | 2 +- 3 files changed, 93 insertions(+), 30 deletions(-) create mode 100644 ChatTags/CustomColorEffectHandler.cs diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs new file mode 100644 index 0000000000..67d630ad9e --- /dev/null +++ b/ChatTags/CustomColorEffectHandler.cs @@ -0,0 +1,92 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.UI.Chat; + +namespace CalamityMod.ChatTags +{ + // This is a tag handler for storing custom color effects for text all within the "ceffect" tag; the parameter determining the actual effect in use. + // i.e [ceffect/darksun:Hello World] would apply darksun effect to "Hello World". + public sealed class CustomColorEffectHandler : AbstractTagHandler + { + protected override string[] TagNames { get; } = ["ceffect"]; + public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) + { + if (options.Equals("darksun", StringComparison.OrdinalIgnoreCase)) + return new DarksunTextSnippet(text); + if (options.Equals("drunk", StringComparison.OrdinalIgnoreCase)) + return new DrunkTextSnippet(text); + return new TextSnippet(text); + } + } + + public sealed class DarksunTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + var BorderColor = new Color(255, 191, 73); + var HazeColor = new Color(238, 226, 153); + + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.05f) + { + ChatManager.DrawColorCodedString(spriteBatch, font, text, position + new Vector2(2, 0).RotatedBy(f + Main.GlobalTimeWrappedHourly), Color.Lerp(BorderColor, HazeColor, (Main.mouseTextColor - 190) / 65f * 0.1f), 0f, Vector2.Zero, new Vector2(scale)); + } + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0f, Vector2.Zero, new Vector2(scale)); + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + + public sealed class DrunkTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + + for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. + { + float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f; + + float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f); + float radius = timer * (3f + i * 6f); + Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern + Vector2 pos = position + offset; + + color = CalamityUtils.MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White); + float opacity = 1f - (i * 0.2f); + float rotation = +(timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended + + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, pos, color * opacity, rotation, Vector2.Zero, new Vector2(scale)); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } +} diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 314a51650a..6b68971444 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1655,35 +1655,6 @@ namespace CalamityMod.Items return false; } - // IV Drip tooltip FX - if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && line.Name == "Tooltip4") - { - Vector2 basePosition = new Vector2(line.X, line.Y); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); - - for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. - { - float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f; - - float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f); - float radius = timer * (3f + i * 6f); - Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern - Vector2 pos = basePosition + offset; - - Color color = MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White); - float opacity = 1f - (i * 0.2f); - float rotation = line.Rotation + (timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended - - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, pos, color * opacity, rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); - } - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); - - return false; - } if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7")) { Color rarityColor = Color.Black; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index b2ab571ea3..74e1213f2a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1032,7 +1032,7 @@ IVDripOnTheRocks: { Multiplies all weapon damage by {1}x Counts as an alcohol stack toward Alcohol Poisoning {$Common.AlcoholWarning} - '(drunken mumbling)' + [ceffect/drunk:'(drunken mumbling)'] ''' } From 74c82a78967879d68d6676f5b5663c06ce2ad399 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 5 Apr 2026 01:45:00 -0500 Subject: [PATCH 13/46] DoG attack chat tag --- ChatTags/CustomColorEffectHandler.cs | 54 +++++++++++++++++++ .../Mods.CalamityMod.Items.SummonItems.hjson | 2 +- ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 2 +- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 6 +-- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 6 +-- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- ...ods.CalamityMod.Items.Weapons.Summon.hjson | 2 +- .../Mods.CalamityMod.Projectiles.Boss.hjson | 6 +-- .../en-US/Mods.CalamityMod.Status.Death.hjson | 12 ++--- 9 files changed, 73 insertions(+), 19 deletions(-) diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs index 67d630ad9e..6bed419cee 100644 --- a/ChatTags/CustomColorEffectHandler.cs +++ b/ChatTags/CustomColorEffectHandler.cs @@ -1,4 +1,7 @@ using System; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; @@ -15,10 +18,14 @@ namespace CalamityMod.ChatTags protected override string[] TagNames { get; } = ["ceffect"]; public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) { + if (!CalamityClientConfig.Instance.TextEffects) + return new TextSnippet(text); if (options.Equals("darksun", StringComparison.OrdinalIgnoreCase)) return new DarksunTextSnippet(text); if (options.Equals("drunk", StringComparison.OrdinalIgnoreCase)) return new DrunkTextSnippet(text); + if (options.Equals("dog", StringComparison.OrdinalIgnoreCase)) + return new DoGTextSnippet(text); return new TextSnippet(text); } } @@ -89,4 +96,51 @@ namespace CalamityMod.ChatTags return size * Scale; } } + + public sealed class DoGTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + string txt = ""; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.UIScaleMatrix); + foreach (var item in text) + { + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + float sin = MathHelper.SmoothStep(0, 1, (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f); + var c = Color.Lerp(Color.Cyan, Color.Fuchsia, sin); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos + new Vector2(0, -2 + sin * 4), c, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in ChatManager.ShadowDirections) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + item * 2, null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 52b51c52c4..8423bc9f44 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -71,7 +71,7 @@ CosmicWorm: { ''' Summons the Devourer of Gods {$Common.NotConsumable} - 'The Nameless Serpent has set out for you.' + [ceffect/dog:'The Nameless Serpent has set out for you.'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 895e42de07..ce22045fcb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -437,7 +437,7 @@ Heresy: { HyperdeathRiftScepter: { DisplayName: Hyperdeath Rift Scepter - Tooltip: Tears space in two with [c/ff00ff:Hyperdeath Rift Ripper] + Tooltip: Tears space in two with [ceffect/dog:Hyperdeath Rift Ripper] } HyphaeRod: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index ec4d7d4bc6..1d68029706 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -849,8 +849,8 @@ MawOfInfinity: { ''' Swings a blade forged from the Devourer's maw in a 3-swing combo The first swing only hits close range - The second swing additionally launches [c/ff00ff:Faith Incinerator] - The third swing unleashes [c/ff00ff:Divinity Devourer] at your cursor, exploding for massive damage + The second swing additionally launches [ceffect/dog:Faith Incinerator] + The third swing unleashes [ceffect/dog:Divinity Devourer] at your cursor, exploding for massive damage ''' } @@ -1380,7 +1380,7 @@ TheObliterator: { {$Common.YoyoStatsInfinite} [GFB] ''' - TooltipNormal: Occasionally performs a miniature [c/ff00ff:Dimensional Drive] at nearby foes + TooltipNormal: Occasionally performs a miniature [ceffect/dog:Dimensional Drive] at nearby foes TooltipGFB: just a slight bit of dust spam on this weapon im afraid } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 3afeaa551b..7a6aa94689 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1406,9 +1406,9 @@ ThreadOfEradication: { DisplayName: Thread of Eradication Tooltip: ''' - Charges up [c/ff00ff:God's Bane Doombeam] - Channelling the weapon causes it to charge up [c/ff00ff:Hyperdeath Rift] instead - While charging [c/ff00ff:Hyperdeath Rift], the bow's turning speed is slowed down + Charges up [ceffect/dog:God's Bane Doombeam] + Channelling the weapon causes it to charge up [ceffect/dog:Hyperdeath Rift] instead + While charging [ceffect/dog:Hyperdeath Rift], the bow's turning speed is slowed down ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 79545b4952..689983fb5d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -308,7 +308,7 @@ DimensionTearingDisk: { Tooltip: ''' Throws a disk that tears space in the direction of the nearest enemy - Stealth strikes stick to enemies and unleash [c/ff00ff:God's Bane Doombeam Array] + Stealth strikes stick to enemies and unleash [ceffect/dog:God's Bane Doombeam Array] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index b4cf866c6f..27a0b40339 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -901,7 +901,7 @@ VoidEaterMarionette: { ''' Contains the power to control a miniature Devourer Repeated summons increase the length and power of the Devourer - The Devourer attacks with [c/ff00ff:Divinity Devourer], [c/ff00ff:Faith Incinerator] and [c/ff00ff:Ultracosmic Maelstrom] + The Devourer attacks with [ceffect/dog:Divinity Devourer], [ceffect/dog:Faith Incinerator] and [ceffect/dog:Ultracosmic Maelstrom] Can play fetch with dropped items Shift- this item in your inventory when the Devourer has been spawned to prioritize fetching ''' diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index c394d0ba93..80ab9a0ac6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -63,9 +63,9 @@ DoGBeam.DisplayName: Portal Laser DoGBeamPortal.DisplayName: Beam Portal DoGDeath.DisplayName: Death Beam DoGDeathBoom.DisplayName: Cosmic Explosion -DoGFire.DisplayName: Faith Incinerator -DoGLaserWalls.DisplayName: God's Bane Doombeam Array -DoGLaserWallsBigBeam.DisplayName: Hyperdeath Rift Ripper +DoGFire.DisplayName: "[ceffect/dog:Faith Incinerator]" +DoGLaserWalls.DisplayName: "[ceffect/dog:God's Bane Doombeam Array]" +DoGLaserWallsBigBeam.DisplayName: "[ceffect/dog:Hyperdeath Rift Ripper]" DoGP1EndPortal.DisplayName: Portal DoGRiftCrack.DisplayName: DoG Distortion Crack DoGTeleportRift.DisplayName: DoG Distortion Rift diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 1e0d926ef4..dd505cfd52 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -61,10 +61,10 @@ Dragonfire1: "{0}'s ashes scatter in the wind." Dragonfire2: "{0}'s embers fade away in a warm glow." Dragonfire3: "{0} can no longer feel the heat of the dragonfire." Dragonfire4: This was a fight {0} could not win. -DimensionalDrive: "{0} was blasted apart into space dust by the Dimensional Drive." -DivinityDevourer1: "{0} fell victim to the Divinity Devourer." -DivinityDevourer2: "{0} was consumed by the Divinity Devourer." -DivinityDevourer3: "{0}'s essence was snuffed by the Divinity Devourer." +DimensionalDrive: "{0} was blasted apart into space dust by [ceffect/dog:Dimensional Drive]." +DivinityDevourer1: "{0} fell victim to [ceffect/dog:Divinity Devourer]." +DivinityDevourer2: "{0} was consumed by [ceffect/dog:Divinity Devourer]." +DivinityDevourer3: "{0}'s essence was snuffed by [ceffect/dog:Divinity Devourer]." ElementalMix1: "{0} was reduced to technicolor confetti." ElementalMix2: "{0} was blasted apart by a harmonized elemental onslaught." ElementalMix3: "{0} was overwhelmed by elemental turbulence." @@ -110,8 +110,8 @@ SulphuricPoisoning1: "{0} was melted by the toxic waste." SulphuricPoisoning2: "{0} ingested too many caustic chemicals." SulphuricPoisoning3: "{0} couldn't handle the industrial backwash." ThornBlossom: "{0} was violently pricked by a flower." -UltracosmicMaelstrom1: "{0} was sublimated by the Ultracosmic Maelstrom." -UltracosmicMaelstrom2: "{0} got cut down to size by the Ultracosmic Maelstrom." +UltracosmicMaelstrom1: "{0} was sublimated by [ceffect/dog:Ultracosmic Maelstrom]." +UltracosmicMaelstrom2: "{0} got cut down to size by [ceffect/dog:Ultracosmic Maelstrom]." Vaporfied: "{0} vaporized into thin air." VermillionFlux1: "{0} burst apart in a shower of scarlet sparks." VermillionFlux2: "{0} went deathly stiff, still crackling with crimson." From 1175098cf50560cea3c4cddf9fe1b0cd55183c1f Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 5 Apr 2026 15:17:02 -0500 Subject: [PATCH 14/46] Calamity Red & Exotic Rainbow, all custom rarities to chat tags --- ChatTags/CustomColorEffectHandler.cs | 24 ++- Items/Accessories/Calamity.cs | 2 +- Items/Accessories/DraedonsHeart.cs | 2 +- Items/Armor/GemTech/GemTechBodyArmor.cs | 2 +- Items/Armor/GemTech/GemTechHeadgear.cs | 2 +- Items/Armor/GemTech/GemTechSchynbaulds.cs | 2 +- Items/CalamityGlobalItemTooltip.cs | 53 ----- Items/Dyes/CalamitousDye.cs | 2 +- Items/Dyes/ExoDye.cs | 2 +- Items/Materials/AshesofAnnihilation.cs | 2 +- Items/Materials/ExoPrism.cs | 2 +- Items/Materials/MiracleMatter.cs | 2 +- Items/Pets/BrimstoneJewel.cs | 2 +- .../CraftingStations/DraedonsForge.cs | 2 +- Items/SummonItems/CeremonialUrn.cs | 2 +- Items/Weapons/Magic/Heresy.cs | 2 +- Items/Weapons/Magic/SubsumingVortex.cs | 2 +- Items/Weapons/Magic/Vehemence.cs | 2 +- Items/Weapons/Magic/VividClarity.cs | 2 +- Items/Weapons/Melee/Exoblade.cs | 2 +- Items/Weapons/Melee/PhotonRipper.cs | 2 +- Items/Weapons/Melee/SpineOfThanatos.cs | 2 +- Items/Weapons/Melee/Violence.cs | 2 +- Items/Weapons/Ranged/Condemnation.cs | 2 +- Items/Weapons/Ranged/HeavenlyGale.cs | 2 +- Items/Weapons/Ranged/MagnomalyCannon.cs | 2 +- Items/Weapons/Ranged/Photoviscerator.cs | 2 +- Items/Weapons/Ranged/SurgeDriver.cs | 2 +- Items/Weapons/Ranged/TheJailor.cs | 2 +- Items/Weapons/Rogue/Celestus.cs | 2 +- Items/Weapons/Rogue/RefractionRotor.cs | 2 +- Items/Weapons/Rogue/Sacrifice.cs | 2 +- Items/Weapons/Rogue/Supernova.cs | 2 +- Items/Weapons/Rogue/TheAtomSplitter.cs | 2 +- Items/Weapons/Summon/AresExoskeleton.cs | 2 +- Items/Weapons/Summon/AtlasMunitionsBeacon.cs | 2 +- Items/Weapons/Summon/CosmicImmaterializer.cs | 2 +- Items/Weapons/Summon/Perdition.cs | 2 +- Items/Weapons/Summon/Vigilance.cs | 2 +- Rarities/BurnishedAuric.cs | 150 ++++++++------ Rarities/CalamityRed.cs | 195 ++++++++++-------- Rarities/ColorTool.cs | 7 + Rarities/CosmicPurple.cs | 89 ++++---- Rarities/ExoticRainbow.cs | 160 ++++++++++++++ 44 files changed, 473 insertions(+), 279 deletions(-) create mode 100644 Rarities/ExoticRainbow.cs diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs index 6bed419cee..b99db87773 100644 --- a/ChatTags/CustomColorEffectHandler.cs +++ b/ChatTags/CustomColorEffectHandler.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.Rarities; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; @@ -15,7 +16,7 @@ namespace CalamityMod.ChatTags // i.e [ceffect/darksun:Hello World] would apply darksun effect to "Hello World". public sealed class CustomColorEffectHandler : AbstractTagHandler { - protected override string[] TagNames { get; } = ["ceffect"]; + protected override string[] TagNames { get; } = ["ceffect", "ce"]; public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) { if (!CalamityClientConfig.Instance.TextEffects) @@ -26,6 +27,14 @@ namespace CalamityMod.ChatTags return new DrunkTextSnippet(text); if (options.Equals("dog", StringComparison.OrdinalIgnoreCase)) return new DoGTextSnippet(text); + if (options.Equals("cosmic", StringComparison.OrdinalIgnoreCase)) + return new CosmicPurple.CustomTextSnippet(text); + if (options.Equals("auric", StringComparison.OrdinalIgnoreCase)) + return new BurnishedAuric.CustomTextSnippet(text); + if (options.Equals("calamity", StringComparison.OrdinalIgnoreCase)) + return new CalamityRed.CustomTextSnippet(text); + if (options.Equals("exo", StringComparison.OrdinalIgnoreCase)) + return new ExoticRainbow.CustomTextSnippet(text); return new TextSnippet(text); } } @@ -65,9 +74,9 @@ namespace CalamityMod.ChatTags if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) { - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + var matrix = spriteBatch.transformMatrix; + Main.spriteBatch.End(out var ss); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, matrix); for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. { @@ -86,7 +95,7 @@ namespace CalamityMod.ChatTags } Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(ss); } return true; } @@ -108,12 +117,13 @@ namespace CalamityMod.ChatTags var pos = position; using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); string txt = ""; + var matrix = spriteBatch.transformMatrix; using (spriteBatch.Scope()) { using (lease.Scope(clearColor: Color.Transparent)) { - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.UIScaleMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); foreach (var item in text) { pos = position; @@ -129,7 +139,7 @@ namespace CalamityMod.ChatTags spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); foreach (var item in ChatManager.ShadowDirections) { - spriteBatch.Draw(lease.Target, Vector2.Zero + item * 2, null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(lease.Target, Vector2.Zero + Vector2.TransformNormal(item * 2,matrix), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); spriteBatch.End(); diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 14c7c7566f..9c76adf1a9 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 44; Item.height = 108; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.accessory = true; Item.expert = true; diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 66d5d7aa9a..e1b1e5d4fe 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.defense = 20; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.expert = true; } diff --git a/Items/Armor/GemTech/GemTechBodyArmor.cs b/Items/Armor/GemTech/GemTechBodyArmor.cs index 29e83fc015..4e5af57b08 100644 --- a/Items/Armor/GemTech/GemTechBodyArmor.cs +++ b/Items/Armor/GemTech/GemTechBodyArmor.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 31; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 2feef341da..cc96471327 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 14; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Armor/GemTech/GemTechSchynbaulds.cs b/Items/Armor/GemTech/GemTechSchynbaulds.cs index a7d5c0fa54..84ba7d24ea 100644 --- a/Items/Armor/GemTech/GemTechSchynbaulds.cs +++ b/Items/Armor/GemTech/GemTechSchynbaulds.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 26; Item.defense = 24; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 6b68971444..ad3ed2a996 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1762,60 +1762,7 @@ namespace CalamityMod.Items // Might be used for Miracle stuff later or something idk /*if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) { - Color rarityColor = Color.White; - Vector2 basePosition = new Vector2(line.X, line.Y); - - float rate = Main.GlobalTimeWrappedHourly * 29; - List eColors = new List() - { - Color.PaleVioletRed, - Color.Coral, - Color.Khaki, - Color.PaleGreen, - Color.Turquoise, - Color.Violet - }; - - int colorIndex = (int)(rate / 2 % eColors.Count); - Color currentColor = eColors[colorIndex]; - Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; - Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); - - float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi); - sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); - Vector2 backScale = line.BaseScale; - Color backColor = usedColor; - Vector2 shake = Main.rand.NextVector2Circular(15, 15) * sine; - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); - - int draws = 20; - for (int i = 0; i < draws; i++) - { - shake = Main.rand.NextVector2Circular(15, 15) * sine; - Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (5 + 0.5f * sine); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake * 4 + backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread); - } - Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Vector2 drawPosition = basePosition; - Color drawColor = backColor; - Vector2 rotationPoint = texture.Size() * 0.5f; - for (int i = 0; i < 6; i++) - { - int length = line.Text.Length; - Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(1 - 0.05f * i * (1 + 0.2f * -sine), 1 + 0.75f * i * (1 + 0.2f * sine) * 1f) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None); - } - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); - - // Draw the front text as usual. - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake + basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); - - return false; }*/ return true; } diff --git a/Items/Dyes/CalamitousDye.cs b/Items/Dyes/CalamitousDye.cs index 89c33691ea..35c48b9192 100644 --- a/Items/Dyes/CalamitousDye.cs +++ b/Items/Dyes/CalamitousDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = Item.sellPrice(gold: 2, silver: 50); } diff --git a/Items/Dyes/ExoDye.cs b/Items/Dyes/ExoDye.cs index 1080879443..e66edbfb7a 100644 --- a/Items/Dyes/ExoDye.cs +++ b/Items/Dyes/ExoDye.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = Item.sellPrice(gold: 2, silver: 50); } diff --git a/Items/Materials/AshesofAnnihilation.cs b/Items/Materials/AshesofAnnihilation.cs index 38efcdd53a..0c52d2ae91 100644 --- a/Items/Materials/AshesofAnnihilation.cs +++ b/Items/Materials/AshesofAnnihilation.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Materials Item.height = 56; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(gold: 6, silver: 66, copper: 66); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawPulsingAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float baseScale) { diff --git a/Items/Materials/ExoPrism.cs b/Items/Materials/ExoPrism.cs index 5b8c11ad99..143248da98 100644 --- a/Items/Materials/ExoPrism.cs +++ b/Items/Materials/ExoPrism.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Materials Item.height = 52; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(gold: 7); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawBackAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float baseScale) { diff --git a/Items/Materials/MiracleMatter.cs b/Items/Materials/MiracleMatter.cs index 4f7392b898..39a7fa9695 100644 --- a/Items/Materials/MiracleMatter.cs +++ b/Items/Materials/MiracleMatter.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Materials Item.height = 80; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(platinum: 1); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawBackAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, Vector2 origin, float baseScale) diff --git a/Items/Pets/BrimstoneJewel.cs b/Items/Pets/BrimstoneJewel.cs index a6b9e00e61..2009e81afd 100644 --- a/Items/Pets/BrimstoneJewel.cs +++ b/Items/Pets/BrimstoneJewel.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Pets { Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); Item.value = Item.sellPrice(gold: 20); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 6c812e8cfd..a186b15911 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(platinum: 4); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/SummonItems/CeremonialUrn.cs b/Items/SummonItems/CeremonialUrn.cs index d0e5bfa47e..6362c8f695 100644 --- a/Items/SummonItems/CeremonialUrn.cs +++ b/Items/SummonItems/CeremonialUrn.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.SummonItems { Item.width = 34; Item.height = 54; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 5b215872ec..659af3c9b6 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 0f21e8bc20..c6784b6a12 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item84; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 72df4ffb67..0e330fb229 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16.5f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index b4ea614361..25647e0b5a 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo projSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 928c535962..eb971fdb5b 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.shoot = ProjectileType(); Item.shootSpeed = 9f; - Item.rare = RarityType(); + Item.rare = RarityType(); } public override bool CanShoot(Player player) diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index ca5701977f..568e60509b 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 1f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs index aeeb946f60..f5c2304a8f 100644 --- a/Items/Weapons/Melee/SpineOfThanatos.cs +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 28; Item.damage = 128; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index 22c0b05054..50406f0118 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.channel = true; diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index b0a3d62c15..6782f1e87a 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 42c7c55d87..0c39c5de41 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; Item.useTurn = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 27c689dd12..9762ad4903 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Rocket; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override Vector2? HoldoutOffset() => new Vector2(-30, -10); diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index 11a20c6147..8edfcfc403 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.noUseGraphic = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 11784019ce..95bb662349 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.knockBack = 8f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index 55fc16c5d4..882a0ad8d3 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 8f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item14; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 2af3d2b3dc..7e37c4614f 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.autoReuse = true; Item.noMelee = true; diff --git a/Items/Weapons/Rogue/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index 6004817676..36c30b998f 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override float StealthDamageMultiplier => 0.3f; diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index cd5c882622..d2c1e803d4 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index abcaa7fee0..81900bf511 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override float StealthDamageMultiplier => 0.7f; diff --git a/Items/Weapons/Rogue/TheAtomSplitter.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs index 7372b085b7..7b43424195 100644 --- a/Items/Weapons/Rogue/TheAtomSplitter.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index f8c8a5a9d7..309102e5a2 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item117; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs index 159b5cb614..c3d384a302 100644 --- a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs +++ b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 10f; Item.noUseGraphic = true; Item.DamageType = DamageClass.Summon; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.sentry = true; } diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 37ff1d6a4a..c2b8cc8f03 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 10; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index d608c2d761..f9a539f18b 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.DD2_EtherianPortalOpen; } diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index ebd6932831..b49cbc32e8 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Rarities/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index 50f86b9814..ad8ea40043 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -1,12 +1,15 @@ using System; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using Terraria.ID; +using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.Rarities { @@ -20,6 +23,80 @@ namespace CalamityMod.Rarities public static Color TextClr = new Color(157, 110, 11, 50); static float lastFlashTime = 0f; static bool isFlashing = false; + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var borderColor = color * 2f; + var coreColor = new Color(77, 0, 33); + var shineColor = new Color(254, 231, 117); + if (isFlashing) + { + shineColor = new Color(90, 207, 255); + position += Main.rand.NextVector2Circular(8f, 4.8f); + } + + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, text, pos, Color.White, 0, Vector2.Zero, new Vector2(scale)); + spriteBatch.End(); + } + + //Draw the base text + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.125f) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2,0).RotatedBy(f), null, borderColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, coreColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + + //Draw the shine character-by-character + using (lease.Scope(clearColor: Color.Transparent)) + { + string txt = ""; + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in text) + { + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f; + var c = shineColor * MathF.Pow(sin, 120); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos, c, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { @@ -38,26 +115,20 @@ namespace CalamityMod.Rarities isFlashing = false; } } - var fontSize = font.MeasureString(text); - var center = fontSize / 2.0f; + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } + } if (Item.expert) textColor = Main.DiscoColor; - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - - float pulsing = 1.5f + (float)Math.Sin(time * 5f); - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) - { - ChatManager.DrawColorCodedString( - spriteBatch, font, text, - new Vector2(X, Y) + new Vector2(pulsing, 0f).RotatedBy(f + time * 2f % MathHelper.TwoPi), - textColor * 0.5f, rotation, origin, baseScale); - if (isFlashing && CalamityClientConfig.Instance.TextEffects) - origin += Main.rand.NextVector2Circular(2f, 1.2f); // Small shake - } - if (isFlashing) { textColor = new Color(0, 183, 241, 50); @@ -65,47 +136,8 @@ namespace CalamityMod.Rarities } textColor.A = 255; - - // Shadow - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - // Outline base - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), new Color(77, 0, 33), rotation, origin, baseScale); - - float shineWidth = 40f; //set to charSize - float shineSpeed = 80f; - - float shineDisp = time * shineSpeed; //predicted current location of the shine based on the time and speed - float shinePos = (shineDisp % (fontSize.X + shineWidth)); - - Vector2 basePos = new Vector2(X, Y); - if (isFlashing && CalamityClientConfig.Instance.TextEffects) - basePos += Main.rand.NextVector2Circular(3f, 10f); // Small shake - - float charOffsetX = 0f; - if (!renderTextSparkles) - return; - for (int i = 0; i < text.Length; i++) - { - string c = text[i].ToString(); - Vector2 charSize = font.MeasureString(c); - Vector2 charOrigin = charSize * 0.5f; - - Vector2 charPos = basePos + new Vector2(charOffsetX, 0f); - - float centerX = charPos.X + (charSize.X * baseScale.X) / 2f + 10.5f; - float dist = Math.Abs(centerX - (X + shinePos - shineWidth * 0.15f)); - float intensity = 1f - MathHelper.Clamp(dist / shineWidth, 0f, 1f); - - if (intensity > 0f) - { - Color shineColor = isFlashing ? new Color(90, 207, 255) * intensity * 2f : new Color(254, 231, 117) * intensity * 1f; - ChatManager.DrawColorCodedString( - spriteBatch, font, c, charPos, shineColor, rotation, origin, baseScale); - } - - charOffsetX += charSize.X - text.Length * 0.0085f; - } + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X,Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + } public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index eb2f0d1920..9ea280216b 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -2,115 +2,136 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using Terraria.ID; namespace CalamityMod.Rarities { public class CalamityRed : ModRarity { // Calamity Red is Rarity 17 - // This rarity should never be assigned to any items. - // It is the equivalent of vanilla's Purple rarity (11): only used for positive reforges on top-rarity items. - //public override Color RarityColor => new Color(163, 25, 26); // #A3191A - // // (139, 0, 0) is the classic donator item color - public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; public static Color BloomClr = new Color(180, 20, 75, 0); public static Color TextClr = new Color(242, 27, 27, 255); + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + var time = Main.GlobalTimeWrappedHourly; + + var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; + var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; + var fontSize = ChatManager.GetStringSize(font, text, new Vector2(1)); + var center = fontSize / 2f; + + var glowPosition = position + new Vector2(size.X * 0.5f, size.Y * 0.5f);// new Vector2(X + center.X, Y + center.Y / 1.5f); + color.A = 0; + float pulsing = 10f + (float)Math.Sin(time * 20f); + float baseScalePulse = 1.03f; + float flameHeight = 5f; + float distortionAmount = 2f; + + + for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + { + float angle = f + (time * 2f % MathHelper.TwoPi); + + float distortion = (float)Math.Sin((position.Y + f * 100f + time * 20f) * 0.05f) * distortionAmount; + + Vector2 offset = new Vector2( + (float)Math.Cos(angle) * pulsing * 0.4f + distortion, + -(float)Math.Abs((float)Math.Sin(angle)) * flameHeight + ); + + float scaleVariation = 0.95f + 0.05f * (float)Math.Sin(time * 15f + f * 2f); + Vector2 vscale = new Vector2(baseScalePulse * scaleVariation) * scale; + + Color flameLayerColor = new Color( + (int)(color.R * 0.5f), + (int)(color.G * 0.5f), + (int)(color.B * 0.5f), + (int)(color.A * 0.5f) + ); + + ChatManager.DrawColorCodedString( + spriteBatch, + font, + text, + position + offset, + flameLayerColor, + 0, + Vector2.Zero, + vscale + ); + } + + // Draw crisp center text + ChatManager.DrawColorCodedString( + spriteBatch, + font, + text, + position, + color, + 0, + Vector2.Zero, + new Vector2(baseScalePulse) + ); + + color.A = 255; + + + var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); + + spriteBatch.Draw(crystalTextGlow, glowPosition, null, BloomClr, MathHelper.PiOver2, new Vector2(6f, 33f), + new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); + + ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, position, Color.Lerp(color,Color.White,0.67f), 0, Vector2.Zero, new(scale)); + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0, Vector2.Zero, new(scale)); + + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { - var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; - var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; - var fontSize = font.MeasureString(text); - var center = fontSize / 2f; + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } + } if (Item.expert) textColor = Main.DiscoColor; - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - float pulsing = 10f + (float)Math.Sin(time * 20f); - float baseScalePulse = 1.03f; - float flameHeight = 5f; - float distortionAmount = 2f; - - if (renderTextSparkles) - - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) - { - float angle = f + (time * 2f % MathHelper.TwoPi); - - float distortion = (float)Math.Sin((Y + f * 100f + time * 20f) * 0.05f) * distortionAmount; - - Vector2 offset = new Vector2( - (float)Math.Cos(angle) * pulsing * 0.4f + distortion, - -(float)Math.Abs((float)Math.Sin(angle)) * flameHeight - ); - - float scaleVariation = 0.95f + 0.05f * (float)Math.Sin(time * 15f + f * 2f); - Vector2 scale = new Vector2(baseScalePulse * scaleVariation); - - Color flameLayerColor = new Color( - (int)(textColor.R * 0.5f), - (int)(textColor.G * 0.5f), - (int)(textColor.B * 0.5f), - (int)(textColor.A * 0.5f) - ); - - ChatManager.DrawColorCodedString( - spriteBatch, - font, - text, - new Vector2(X, Y) + offset, - flameLayerColor, - rotation, - origin, - scale - ); - } - - // Draw crisp center text - ChatManager.DrawColorCodedString( - spriteBatch, - font, - text, - new Vector2(X, Y), - textColor, - rotation, - origin, - new Vector2(baseScalePulse) - ); - - textColor.A = 255; - - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); - - spriteBatch.Draw(crystalTextGlow, glowPosition, null, lightColor, rotation + MathHelper.PiOver2, new Vector2(6f, 33f), - new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); - - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), Color.Black, rotation, origin, baseScale); - - // Is this a scrapped visual feature of the rarity? - /*int sparkleCount = Main.rand.Next((int)fontSize.X / 7, (int)fontSize.X / 5) + 1; - var color2 = lightColor * 1.00f; - color2.A = 0; - var sparkleOrigin = new Vector2(15f, 15f); - for (int i = 0; i < sparkleCount; i++) - { - var v = new Vector2(Main.rand.NextFloat(fontSize.X), Main.rand.NextFloat(fontSize.Y * 0.6f) + 1f); - float lifeTime = Main.GlobalTimeWrappedHourly * 4f + Main.rand.NextFloat(MathHelper.TwoPi * 7f); - lifeTime %= MathHelper.TwoPi * 1f; - }*/ + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); return; } diff --git a/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index 77b3166b5a..45eb3a0820 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Rarities public static int RarityCosmicPurple => ModContent.GetInstance().Type; public static int RarityBurnishedAuric => ModContent.GetInstance().Type; public static int RarityCalamityRed => ModContent.GetInstance().Type; + public static int RarityExoticRainbow => ModContent.GetInstance().Type; public override bool PreDrawTooltipLine(Item Item, DrawableTooltipLine line, ref int yOffset) @@ -30,6 +31,12 @@ namespace CalamityMod.Rarities CalamityRed.Draw(Item, line); return false; } + + if (Item.rare == RarityExoticRainbow) + { + ExoticRainbow.Draw(Item, line); + return false; + } } return true; } diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 0a38e2d428..1c3e382f4a 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -1,13 +1,14 @@ using System; +using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; using Terraria.Utilities; -using Terraria.ID; namespace CalamityMod.Rarities { @@ -19,59 +20,75 @@ namespace CalamityMod.Rarities public static float MaxY = 4.5f; public static Color BloomClr = new Color(65, 38, 87, 0); public static Color TextClr = new Color(103, 66, 138, 255); + public static UnifiedRandom rand = new UnifiedRandom(1); + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + color.A = 255; + float pulsing = 2.5f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 5f); + for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + { + ChatManager.DrawColorCodedString(spriteBatch, font, text, position + new Vector2(pulsing, 0f).RotatedBy(f + Main.GlobalTimeWrappedHourly * 2f % MathHelper.TwoPi), color with { A = 0 } * 0.5f, 0, Vector2.Zero, new(scale)); + } + ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, position, color * 2f, 0, Vector2.Zero, new(scale)); + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0, Vector2.Zero, new(scale)); + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; - var fontSize = font.MeasureString(text); + var fontSize = ChatManager.GetStringSize(font, text, new Vector2(1)); var center = fontSize / 2f; + if (Item.expert) textColor = Main.DiscoColor; - // this was intended behavior. i'm commenting it out for now because it seems like people do not like it. - /* - if (Item.expert) - textColor = Main.DiscoColor; - */ - - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - float pulsing = 2.5f + (float)Math.Sin(time * 5f); - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) { - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y) + new Vector2(pulsing, 0f).RotatedBy(f + time * 2f % MathHelper.TwoPi), textColor * 0.5f, rotation, origin, baseScale); + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } } - if (Item.expert) - textColor = Main.DiscoColor; - - textColor.A = 255; - - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); - + //Draw backglow + var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); spriteBatch.Draw(crystalTextGlow, glowPosition, null, lightColor, rotation + MathHelper.PiOver2, new Vector2(6f, 33f), new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), Color.Black, rotation, origin, baseScale); + //Draw text + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X,Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + //Draw sparkles if (!renderTextSparkles) return; - static int Hash(int x) - { - x ^= x >> 16; - x *= unchecked((int)0x7feb352d); - x ^= x >> 15; - x *= unchecked((int)0x846ca68b); - x ^= x >> 16; - return x; - } - - // why was this using a string hash previously?????? - var rand = new UnifiedRandom(Hash((int)(center.X + center.Y))); + rand.SetSeed(1); + int sparkleCount = rand.Next((int)fontSize.X / 7, (int)fontSize.X / 5) + 1; var color2 = lightColor; color2.A = 0; diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs new file mode 100644 index 0000000000..bc143960ff --- /dev/null +++ b/Rarities/ExoticRainbow.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; + +namespace CalamityMod.Rarities +{ + public class ExoticRainbow : ModRarity + { + // Exotic Rainbow is Rarity 17 (same as Calamity Red) + public override Color RarityColor => TextClr * 2f; + + public static float MaxY = 4.5f; + public static Color BloomClr = new Color(180, 20, 75, 0); + public static Color TextClr = new Color(242, 27, 27, 255); + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public bool IsExpert = false; + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + var time = Main.GlobalTimeWrappedHourly; + + List eColors = new List() + { + new Color(255,107,107), //Ares + new Color(125,196,225), //Thanatos + new Color(211,235,108), //Apollo + //new Color(255,160,71), //Artemis + }; + + if (IsExpert) + eColors = new List() + { + new Color(255,70,70), + new Color(255,70,255), + new Color(70,70,255), + new Color(70,255,255), + new Color(70,255,90), + new Color(255,255,70) + }; + + + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + string txt = ""; + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in text) + { + + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + + float rate = Main.GlobalTimeWrappedHourly * (IsExpert ? 2 : 1) + pos.X * (IsExpert ? 0.01f : 0.005f); + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : MathF.Round(rate % 1f)); + + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos, usedColor, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, matrix); + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi); + sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); + int draws = 16; + for (int i = 0; i < draws; i++) + { + var shake = Main.rand.NextVector2Circular(32, 32) * sine; + Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws).ToRotationVector2() * (4) + shake; + spriteBatch.Draw(lease.Target, Vector2.Zero + backPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + + Main.spriteBatch.End(); + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.125f) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2, 0).RotatedBy(f), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + + return size * Scale; + } + } + + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, + Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) + { + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text) { IsExpert = Item.expert }; + } + } + + + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + + return; + } + + public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) + { + Draw(Item, Main.spriteBatch, text, X, Y, Colors.AlphaDarken(textColor ?? TextClr), lightColor ?? BloomClr, rotation, origin, baseScale, Main.GlobalTimeWrappedHourly, + renderTextSparkles ?? CalamityClientConfig.Instance.TextEffects, FontAssets.MouseText.Value); + } + + public static void Draw(Item Item, DrawableTooltipLine line) + { + Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); + } + + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + { + -2 => ModContent.RarityType(), + -1 => ModContent.RarityType(), + _ => Type, + };*/ + } +} From b92328347b8cd6061c2f5929bbb5274c9788c8dd Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 6 Apr 2026 21:40:54 -0500 Subject: [PATCH 15/46] fix to auric tag + exo rainbow changes --- Rarities/BurnishedAuric.cs | 9 ++++----- Rarities/ExoticRainbow.cs | 19 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Rarities/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index ad8ea40043..dfbc5c0a2c 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -9,7 +9,6 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.Rarities { @@ -20,7 +19,7 @@ namespace CalamityMod.Rarities public static float MaxY = 4.5f; public static Color BloomClr = new Color(48, 33, 4, 0); - public static Color TextClr = new Color(157, 110, 11, 50); + public static Color TextClr = new Color(157, 110, 11, 255); static float lastFlashTime = 0f; static bool isFlashing = false; @@ -61,7 +60,7 @@ namespace CalamityMod.Rarities spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.125f) { - spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2,0).RotatedBy(f), null, borderColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2, 0).RotatedBy(f), null, borderColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } spriteBatch.Draw(lease.Target, Vector2.Zero, null, coreColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); spriteBatch.End(); @@ -136,8 +135,8 @@ namespace CalamityMod.Rarities } textColor.A = 255; - ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X,Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); - + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + } public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs index bc143960ff..3040ea1bd6 100644 --- a/Rarities/ExoticRainbow.cs +++ b/Rarities/ExoticRainbow.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Rarities public static float MaxY = 4.5f; public static Color BloomClr = new Color(180, 20, 75, 0); public static Color TextClr = new Color(242, 27, 27, 255); - + public sealed class CustomTextSnippet(string text) : TextSnippet { public bool IsExpert = false; @@ -49,7 +49,7 @@ namespace CalamityMod.Rarities if (IsExpert) eColors = new List() - { + { new Color(255,70,70), new Color(255,70,255), new Color(70,70,255), @@ -87,13 +87,12 @@ namespace CalamityMod.Rarities } Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, matrix); - float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi); + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2 / MathHelper.Pi); sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); int draws = 16; for (int i = 0; i < draws; i++) { - var shake = Main.rand.NextVector2Circular(32, 32) * sine; - Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws).ToRotationVector2() * (4) + shake; + Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws + Main.GlobalTimeWrappedHourly * 1.7f).ToRotationVector2() * (4 + 24 * sine); spriteBatch.Draw(lease.Target, Vector2.Zero + backPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } @@ -110,12 +109,12 @@ namespace CalamityMod.Rarities } return true; } - public override float GetStringLength(DynamicSpriteFont font) - { - float size = font.MeasureString(text).X; + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; - return size * Scale; - } + return size * Scale; + } } public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, From b45b6bdec9afc66a17259beada6ee78ce70b5923 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Mon, 6 Apr 2026 21:45:02 -0500 Subject: [PATCH 16/46] oops forgot to stage --- Rarities/ExoticRainbow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs index 3040ea1bd6..cf065cc707 100644 --- a/Rarities/ExoticRainbow.cs +++ b/Rarities/ExoticRainbow.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Rarities int draws = 16; for (int i = 0; i < draws; i++) { - Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws + Main.GlobalTimeWrappedHourly * 1.7f).ToRotationVector2() * (4 + 24 * sine); + Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws + Main.GlobalTimeWrappedHourly * 1.7f).ToRotationVector2() * (4 + 16 * sine); spriteBatch.Draw(lease.Target, Vector2.Zero + backPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } From 3b3a3c3d68eb71722199dfc88cddd098cc67e1fb Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Tue, 7 Apr 2026 17:37:20 -0500 Subject: [PATCH 17/46] final cleanups --- Items/Armor/GodSlayer/GodSlayerHeadMelee.cs | 1 - Items/Armor/GodSlayer/GodSlayerHeadRanged.cs | 1 - Items/Armor/GodSlayer/GodSlayerHeadRogue.cs | 1 - Items/Weapons/Magic/HyperdeathRiftScepter.cs | 5 ----- Items/Weapons/Melee/MawOfInfinity.cs | 4 ---- Items/Weapons/Melee/TheObliterator.cs | 2 -- Items/Weapons/Ranged/ThreadOfEradication.cs | 4 ---- Items/Weapons/Rogue/DimensionTearingDisk.cs | 5 ----- Items/Weapons/Summon/VoidEaterMarionette.cs | 5 ----- .../en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson | 6 +++--- 10 files changed, 3 insertions(+), 31 deletions(-) diff --git a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs index 76d20bfa39..b43f8bf6f0 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.godSlayerDamage = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index 1c5617ac58..1eff59c595 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.godSlayerRanged = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs index b5d0b638f5..c89fbe2355 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.wearingRogueArmor = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Weapons/Magic/HyperdeathRiftScepter.cs b/Items/Weapons/Magic/HyperdeathRiftScepter.cs index f8978a184f..2a2bd2e163 100644 --- a/Items/Weapons/Magic/HyperdeathRiftScepter.cs +++ b/Items/Weapons/Magic/HyperdeathRiftScepter.cs @@ -16,11 +16,6 @@ namespace CalamityMod.Items.Weapons.Magic public class HyperdeathRiftScepter : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetStaticDefaults() { Item.staff[Type] = true; diff --git a/Items/Weapons/Melee/MawOfInfinity.cs b/Items/Weapons/Melee/MawOfInfinity.cs index 1cfcd0745f..32073b2d56 100644 --- a/Items/Weapons/Melee/MawOfInfinity.cs +++ b/Items/Weapons/Melee/MawOfInfinity.cs @@ -20,10 +20,6 @@ namespace CalamityMod.Items.Weapons.Melee { base.SetStaticDefaults(); } - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetDefaults() { Item.width = 78; diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 274426a673..25c24004a0 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -20,8 +20,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void ModifyTooltips(List tooltips) { tooltips.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); - if (!Main.zenithWorld) - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); } public override void SetStaticDefaults() diff --git a/Items/Weapons/Ranged/ThreadOfEradication.cs b/Items/Weapons/Ranged/ThreadOfEradication.cs index 722fb0535e..cde4b30f11 100644 --- a/Items/Weapons/Ranged/ThreadOfEradication.cs +++ b/Items/Weapons/Ranged/ThreadOfEradication.cs @@ -22,10 +22,6 @@ namespace CalamityMod.Items.Weapons.Ranged { CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true; } - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetDefaults() { Item.width = 40; diff --git a/Items/Weapons/Rogue/DimensionTearingDisk.cs b/Items/Weapons/Rogue/DimensionTearingDisk.cs index 4a4aeb869d..762b079e8d 100644 --- a/Items/Weapons/Rogue/DimensionTearingDisk.cs +++ b/Items/Weapons/Rogue/DimensionTearingDisk.cs @@ -35,11 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = Speed; } - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Summon/VoidEaterMarionette.cs b/Items/Weapons/Summon/VoidEaterMarionette.cs index 4bfb783090..cbcd6952e3 100644 --- a/Items/Weapons/Summon/VoidEaterMarionette.cs +++ b/Items/Weapons/Summon/VoidEaterMarionette.cs @@ -19,11 +19,6 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public bool FocusFetch = false; - - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetDefaults() { Item.width = 68; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index b55af2186e..7d07b1699f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -422,10 +422,10 @@ GodSlayerChestplate: { Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Press {0} to [c/ff00ff:Dimensional Drive] towards your cursor for 2 seconds + Press {0} to [ceffect/dog:Dimensional Drive] towards your cursor for 2 seconds Enemies you dash through take massive damage - During [c/ff00ff:Dimensional Drive] you are immune to damage and most debuffs - [c/ff00ff:Dimensional Drive] has a {1} second cooldown + During [ceffect/dog:Dimensional Drive] you are immune to damage and most debuffs + [ceffect/dog:Dimensional Drive] has a {1} second cooldown ''' } From 111d7cda69729de982b843a69d1f7e98dd712eea Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:59:32 -0400 Subject: [PATCH 18/46] Flying Carpet recipe requires Loom instead of Anvil --- Systems/Mechanic/RecipeSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 741a5fe91b..50e3decbc7 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -1616,7 +1616,7 @@ namespace CalamityMod.Systems r.AddIngredient(ItemID.Silk, 10); r.AddIngredient(ItemID.AntlionMandible, 2); r.AddIngredient(5); - r.AddTile(TileID.Anvils); + r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); From b9a284881e933c9240e82c309a9f3e134a8c670a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Fri, 10 Apr 2026 17:08:59 -0400 Subject: [PATCH 19/46] Removed deadcode from Cosmic Purple --- Rarities/CosmicPurple.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 0a38e2d428..abbd9074dc 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -27,12 +27,6 @@ namespace CalamityMod.Rarities var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; var fontSize = font.MeasureString(text); var center = fontSize / 2f; - - // this was intended behavior. i'm commenting it out for now because it seems like people do not like it. - /* - if (Item.expert) - textColor = Main.DiscoColor; - */ var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); textColor.A = 0; From 7d08357b2ee22bfe9b82ccfe73208e00830a56cb Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:10:24 +0700 Subject: [PATCH 20/46] hopping on the bandwagon --- Items/Placeables/FurnitureDriftwood/Driftwood.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Items/Placeables/FurnitureDriftwood/Driftwood.cs b/Items/Placeables/FurnitureDriftwood/Driftwood.cs index f041b00d8e..17363b5acd 100644 --- a/Items/Placeables/FurnitureDriftwood/Driftwood.cs +++ b/Items/Placeables/FurnitureDriftwood/Driftwood.cs @@ -22,10 +22,14 @@ namespace CalamityMod.Items.Placeables.FurnitureDriftwood public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - DisableDecraft(). - Register(); + AddIngredient(2). + DisableDecraft(). + Register(); + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); } } } From 58eb4ef9f600ff409d889601b5f9e83a35a29be5 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:34:39 +0700 Subject: [PATCH 21/46] Reverted Power/Berserker Glove nerfs --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/CalamityGlobalItem.cs | 8 ++------ Items/CalamityGlobalItemTooltip.cs | 7 +++++-- Localization/en-US/Mods.CalamityMod.Vanilla.hjson | 3 +-- Systems/Mechanic/RecipeSystem.cs | 3 --- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3d5996fa8f..614fe2e43d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3509,7 +3509,7 @@ namespace CalamityMod.CalPlayer if (gloveLevel > 0) { // Determine the glove the player benefits from in priority of latest in progression - float gloveAttackSpeed = (gloveLevel == 5 ? 0.15f : gloveLevel == 4 ? 0.14f : gloveLevel == 3 ? 0.12f : gloveLevel <= 2 ? 0.10f : 0); + float gloveAttackSpeed = (gloveLevel == 5 ? 0.15f : gloveLevel == 4 ? 0.14f : gloveLevel >= 2 ? 0.12f : gloveLevel == 1 ? 0.10f : 0); Player.GetAttackSpeed() += gloveAttackSpeed; // Give the player attack speed based on the glove they have } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 5f20ad405b..228af0877c 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1153,16 +1153,12 @@ namespace CalamityMod.Items if (modPlayer.gloveLevel < 1) modPlayer.gloveLevel = 1; } - if (item.type == ItemID.PowerGlove) + if (item.type == ItemID.PowerGlove || item.type == ItemID.BerserkerGlove) { - player.GetAttackSpeed() -= 0.12f; // Power Glove 10% + player.GetAttackSpeed() -= 0.12f; // Power/Berserker Glove 12% if (modPlayer.gloveLevel < 2) modPlayer.gloveLevel = 2; } - if (item.type == ItemID.BerserkerGlove) - { - player.GetAttackSpeed() -= 0.12f; // Berserker Glove 0% - } if (item.type == ItemID.MechanicalGlove) { player.GetAttackSpeed() -= 0.12f; // Mechanical Glove 12% diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 314a51650a..1a36871c80 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -782,11 +782,14 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); if (item.type == ItemID.PowerGlove) { - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerBerserkerGlove")); EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); } if (item.type == ItemID.BerserkerGlove) - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove")); + { + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerBerserkerGlove")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); + } if (item.type == ItemID.MechanicalGlove) EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine")); if (item.type == ItemID.FireGauntlet) diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 504863dab8..592bd025bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -158,8 +158,7 @@ EditedTooltip: { */ SunMoonStones: critical strike chance, life regeneration, CelestialStoneShell: Minor increase to damage, - PowerGlove: 10% increased melee speed, does not stack with downgrades - BerserkerGlove: 10% increased true melee damage + PowerBerserkerGlove: 12% increased melee speed, does not stack with downgrades MechanicalGlove: ''' 12% increased melee damage diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 741a5fe91b..91362a7e9a 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -794,9 +794,6 @@ namespace CalamityMod.Systems // Add 20 Souls of Flight to vanilla Luminite wings { VanillaEach(ItemID.WingsSolar, ItemID.WingsVortex, ItemID.WingsNebula, ItemID.WingsStardust), LunarWingsRecipeEdits }, - - // Berserker's Glove recipe change now that it doesn't provide melee speed - { Vanilla(ItemID.BerserkerGlove), ReplaceIngredient(ItemID.PowerGlove, ItemID.TitanGlove) }, }; // Apply all recipe changes. From 0d2bd24fedfc5ce712a4cd09cd54d68dec33c4e3 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:35:08 +0700 Subject: [PATCH 22/46] TML wanted to indent fix this file --- Localization/en-US/Mods.CalamityMod.Buffs.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 5e759c4d25..afe87854fb 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -76,7 +76,7 @@ OldFashionedBuff: { RedWineBuff: { DisplayName: Red Wine Description: Increased vertical speed, reduced flight time - ItemTooltip: Causes Baguette to heal 200 HP, but reduce regeneration by 2 HP/s for 15 seconds + ItemTooltip: Causes Baguette to heal 200 HP, but reduce regeneration by 2 HP/s for 15 seconds } RumBuff: { From 1d6dc5806f6da276aafb0bd18a36e0d7bf337bf6 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 10:52:45 +0700 Subject: [PATCH 23/46] Triactis Hammer flares can disappear --- Projectiles/Melee/TriactisHammerFlare.cs | 13 +++++++++++-- Projectiles/Melee/TriactisHammerProj.cs | 2 -- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Projectiles/Melee/TriactisHammerFlare.cs b/Projectiles/Melee/TriactisHammerFlare.cs index 70af4b6ee0..2fed916b9e 100644 --- a/Projectiles/Melee/TriactisHammerFlare.cs +++ b/Projectiles/Melee/TriactisHammerFlare.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -50,8 +51,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); return; } + // You may swap weapons and keep the flares, but only for a short time + if (Owner.HeldItem.type == ModContent.ItemType()) + Projectile.timeLeft = 180; - Projectile.timeLeft = 2; float rotation = Main.GlobalTimeWrappedHourly * 2f + MathHelper.ToRadians(120f) * FlareType; // Transform into smashy hammers @@ -95,6 +98,12 @@ namespace CalamityMod.Projectiles.Melee } } + public override void OnKill(int timeLeft) + { + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, GetColor(FlareType), Vector2.One, 0f, 0.1f, 0.8f, 10); + GeneralParticleHandler.SpawnParticle(pulse); + } + // Hue-shifted version of the base colours public static Color GetColor(float type) { diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs index e455e9aff9..1b314721e8 100644 --- a/Projectiles/Melee/TriactisHammerProj.cs +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -124,8 +124,6 @@ namespace CalamityMod.Projectiles.Melee Particle sparkle = new CritSpark(Projectile.Center, velocity, Color.White, currentColor, 1f * scale, 24, 0.1f, 2.5f * scale); GeneralParticleHandler.SpawnParticle(sparkle); } - Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, currentColor, Vector2.One, 0f, 0.1f, 0.8f, 10); - GeneralParticleHandler.SpawnParticle(pulse); } if (OrbitRadius > 792f) From ba749387d89d34bcfb83e8bd00fa134371b7ffcf Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:01:17 +0700 Subject: [PATCH 24/46] Hydra tooltip fix/tweaks --- .../en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 3afeaa551b..e4508e5c1b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -603,10 +603,10 @@ Hydra: { DisplayName: Hydra Tooltip: ''' - Fires a spread of 4 [cbuff:Venom] bullets + Fires a spread of 3 blood globs imbued with [cbuff:Venom] Grows a gun-head every 3 seconds, up to a maximum of 3 heads Press to command any existing heads to fire - Press to launch the heads for powerful explosive damage + Press to launch the heads for powerful explosive damage, briefly inflicting [cbuff:CalamityMod/GalvanicCorrosion] [c/9D80B0:Fusion of heavy machinery and Lernaean blood] ''' } From 5539f2ae12534650a4e51cbcb0cf6d67dd5ee032 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:11:19 +0700 Subject: [PATCH 25/46] Standardised average damage tooltip --- Localization/en-US/Mods.CalamityMod.Common.hjson | 1 + .../en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index 77ec346020..9868158c52 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -24,6 +24,7 @@ AbyssBreathLevel2: Moderately reduces breath loss in the abyss AbyssBreathLevel3: Greatly reduces breath loss in the abyss AlcoholWarning: Drinking more than 3 different alcohols might not end well with your liver ArmorPenetration: Ignores {0} points of enemy Defense +AverageDamageInfo: This weapon scales with the average of all your damage stats CanMineUelibloom: Can mine Uelibloom Ore NotConsumable: Not consumable SummonTagDamageFlat: "{0} summon tag damage" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index a93cf238be..6f25f07e11 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -3,7 +3,7 @@ Aestheticus: { Tooltip: ''' Fires crystals that explode and inflict [cbuff:CalamityMod/Vaporfied] - This weapon scales with all your damage stats at once + {$Common.AverageDamageInfo} ''' } @@ -17,6 +17,7 @@ ClaretCannon: { Picking up the blood orbs will reduce [cbuffplr:PotionSickness] when possible If you do not have [cbuffplr:PotionSickness], your natural regeneration will be enhanced Can only fire once every 10 seconds + {$Common.AverageDamageInfo} ''' } @@ -31,7 +32,7 @@ EyeofMagnus: { ''' Fires seeking cosmic masses that restore health and mana on hit Explodes into a nebula cloud which reduces enemy protection - This weapon scales with the average of all your damage stats + {$Common.AverageDamageInfo} ''' } @@ -40,7 +41,7 @@ LunicEye: { Tooltip: ''' Fires seeking energy bolts that reduce enemy protection - This weapon scales with the average of all your damage stats + {$Common.AverageDamageInfo} ''' } @@ -55,6 +56,7 @@ RelicOfDeliverance: { Being inside tiles for too long will warp you back to where you entered Press to dismount Holding out the spear heavily reduces the damage of all summons + {$Common.AverageDamageInfo} [c/FF8C00:Vengeance fueled me, I had no thought other than exactment.] [c/FF8C00:The dragon took everything from me, leaving my broken pieces strewn on the ground.] [c/FF8C00:But when I danced by Her side, I knew there was still something worth fighting for.] @@ -83,6 +85,7 @@ StratusSphere: { Influenced players gain Starbursts over time and will consume Starbursts to fly when out of flight time to cause Starbursts to form a barrier, causing you to lose Starbursts instead of health Launching the singularity deactivates the barrier, and creating a barrier deactivates the singularity + {$Common.AverageDamageInfo} 'Channeling souls into stars, an inane concept' ''' } From c13bebd1937e95d4b7247dab9caf90adac07efc9 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:13:33 +0700 Subject: [PATCH 26/46] Astral Injection recipe tweak --- Items/Potions/AstralInjection.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 11496ee727..b184457a0b 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -50,18 +50,10 @@ namespace CalamityMod.Items.Potions public override void AddRecipes() { CreateRecipe(15). - AddIngredient(ItemID.BottledWater, 15). + AddIngredient(ItemID.SuperManaPotion, 15). AddIngredient(4). AddIngredient(). - AddTile(TileID.AlchemyTable). - AddConsumeIngredientCallback(Recipe.IngredientQuantityRules.Alchemy). - Register(); - - CreateRecipe(15). - AddIngredient(ItemID.BottledWater, 15). - AddIngredient(5). - AddIngredient(). - AddTile(TileID.AlchemyTable). + AddTile(TileID.Bottles). Register() .DisableDecraft(); } From 40460e4cd350e4cf08b3be5bac9a8a9bfd9fc23d Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 12:10:42 +0700 Subject: [PATCH 27/46] Internally renamed bobbers --- CalPlayer/CalamityPlayer.cs | 10 ++-- .../{SkylineBobber.cs => AcrobaticBobber.cs} | 5 +- .../{PerennialBobber.cs => FeralBobber.cs} | 5 +- .../{NavystoneBobber.cs => SunkenSinker.cs} | 5 +- .../{ScoriaBobber.cs => VolcanicSinker.cs} | 5 +- .../{ScrapBobber.cs => WulfrumBobber.cs} | 5 +- .../Mods.CalamityMod.Items.Fishing.hjson | 52 +++++++++---------- Projectiles/CalamityGlobalProjectile.cs | 10 ++-- 8 files changed, 51 insertions(+), 46 deletions(-) rename Items/Accessories/{SkylineBobber.cs => AcrobaticBobber.cs} (88%) rename Items/Accessories/{PerennialBobber.cs => FeralBobber.cs} (89%) rename Items/Accessories/{NavystoneBobber.cs => SunkenSinker.cs} (89%) rename Items/Accessories/{ScoriaBobber.cs => VolcanicSinker.cs} (89%) rename Items/Accessories/{ScrapBobber.cs => WulfrumBobber.cs} (88%) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a3a0320242..d03aa7b1be 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -187,11 +187,11 @@ namespace CalamityMod.CalPlayer public enum FishingMinigames { None, - ScrapBobber, - NavystoneBobber, - SkylineBobber, - PerennialBobber, - ScoriaBobber, + WulfrumBobber, + SunkenSinker, + AcrobaticBobber, + FeralBobber, + VolcanicSinker, DevourerofCods //Not a fishing minigame but uses the same code as the rest } public FishingMinigames SelectedFishingMinigame = FishingMinigames.None; diff --git a/Items/Accessories/SkylineBobber.cs b/Items/Accessories/AcrobaticBobber.cs similarity index 88% rename from Items/Accessories/SkylineBobber.cs rename to Items/Accessories/AcrobaticBobber.cs index 47a9fea7a3..ffd5b98001 100644 --- a/Items/Accessories/SkylineBobber.cs +++ b/Items/Accessories/AcrobaticBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Fishing { - internal class SkylineBobber : ModItem, ILocalizedModType + [LegacyName("SkylineBobber")] + internal class AcrobaticBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/HeronBobber"; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Fishing public override void UpdateAccessory(Player player, bool hideVisual) { player.accFishingBobber = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.SkylineBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.AcrobaticBobber; } public override void AddRecipes() { diff --git a/Items/Accessories/PerennialBobber.cs b/Items/Accessories/FeralBobber.cs similarity index 89% rename from Items/Accessories/PerennialBobber.cs rename to Items/Accessories/FeralBobber.cs index 0705e28791..908249614a 100644 --- a/Items/Accessories/PerennialBobber.cs +++ b/Items/Accessories/FeralBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class PerennialBobber : ModItem, ILocalizedModType + [LegacyName("PerennialBobber")] + internal class FeralBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/FeralDoubleBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories { player.accFishingBobber = true; player.fishingSkill += (int)((player.statLifeMax2 - player.statLife) * 0.25f); - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.PerennialBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.FeralBobber; } public override void AddRecipes() { diff --git a/Items/Accessories/NavystoneBobber.cs b/Items/Accessories/SunkenSinker.cs similarity index 89% rename from Items/Accessories/NavystoneBobber.cs rename to Items/Accessories/SunkenSinker.cs index e78241dccd..0563341a47 100644 --- a/Items/Accessories/NavystoneBobber.cs +++ b/Items/Accessories/SunkenSinker.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class NavystoneBobber : ModItem, ILocalizedModType + [LegacyName("NavystoneBobber")] + internal class SunkenSinker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/NavyBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.accFishingBobber = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.NavystoneBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.SunkenSinker; } public override void AddRecipes() { diff --git a/Items/Accessories/ScoriaBobber.cs b/Items/Accessories/VolcanicSinker.cs similarity index 89% rename from Items/Accessories/ScoriaBobber.cs rename to Items/Accessories/VolcanicSinker.cs index 7ad5e649d2..6843821e45 100644 --- a/Items/Accessories/ScoriaBobber.cs +++ b/Items/Accessories/VolcanicSinker.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class ScoriaBobber : ModItem, ILocalizedModType + [LegacyName("ScoriaBobber")] + internal class VolcanicSinker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/RiftReelerBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories { player.accFishingBobber = true; player.accLavaFishing = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.ScoriaBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.VolcanicSinker; } public override void AddRecipes() { diff --git a/Items/Accessories/ScrapBobber.cs b/Items/Accessories/WulfrumBobber.cs similarity index 88% rename from Items/Accessories/ScrapBobber.cs rename to Items/Accessories/WulfrumBobber.cs index 81a7444885..1a6ee66728 100644 --- a/Items/Accessories/ScrapBobber.cs +++ b/Items/Accessories/WulfrumBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class ScrapBobber : ModItem, ILocalizedModType + [LegacyName("ScrapBobber")] + internal class WulfrumBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/WulfrumBobber"; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.ScrapBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.WulfrumBobber; } public override void AddRecipes() { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index ebc986797d..5cecca83f7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -1,4 +1,4 @@ -// Quest fish tooltips +// Quest fish tooltips CaughtInAstral: Caught in the Astral Infection CaughtInBrimstoneCrag: Caught in the Brimstone Crag CaughtInSnow: Caught in Tundra @@ -397,29 +397,7 @@ GrandMarquisBait: { } // Bobbers -ScrapBobber: { - DisplayName: Wulfrum Bobber - Tooltip: - ''' - Provides a fishing minigame - Hold movement inputs in the indicated directions while fishing to catch items - The rod empowers the longer you go without a mistake, speeding it up - 'There's supposed to be a fish finder installed, but it only beeps when you point it at yourself...' - ''' -} - -NavystoneBobber: { - DisplayName: Sunken Sinker - Tooltip: - ''' - {$ItemTooltip.FishingBobber} - Provides a fishing minigame - The bobber will float at your height underwater, allowing underwater fishing - Move in the indicated direction while fishing to catch items - ''' -} - -SkylineBobber: { +AcrobaticBobber: { DisplayName: Acrobatic Bobber Tooltip: ''' @@ -432,7 +410,7 @@ SkylineBobber: { ''' } -PerennialBobber: { +FeralBobber: { DisplayName: Feral Bobber Tooltip: ''' @@ -444,7 +422,18 @@ PerennialBobber: { ''' } -ScoriaBobber: { +SunkenSinker: { + DisplayName: Sunken Sinker + Tooltip: + ''' + {$ItemTooltip.FishingBobber} + Provides a fishing minigame + The bobber will float at your height underwater, allowing underwater fishing + Move in the indicated direction while fishing to catch items + ''' +} + +VolcanicSinker: { DisplayName: Volcanic Sinker Tooltip: ''' @@ -456,3 +445,14 @@ ScoriaBobber: { When bobbers touch a rift, they automatically reel in the item within ''' } + +WulfrumBobber: { + DisplayName: Wulfrum Bobber + Tooltip: + ''' + Provides a fishing minigame + Hold movement inputs in the indicated directions while fishing to catch items + The rod empowers the longer you go without a mistake, speeding it up + 'There's supposed to be a fish finder installed, but it only beeps when you point it at yourself...' + ''' +} diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 64e0f0e763..76de535cf0 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3063,7 +3063,7 @@ namespace CalamityMod.Projectiles //If hooking an NPC, this is set to the NPC ID but negative. Still need to find how this gets treated upon reeling in. switch (owner.Calamity().SelectedFishingMinigame) { - case CalamityPlayer.FishingMinigames.ScrapBobber: + case CalamityPlayer.FishingMinigames.WulfrumBobber: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3183,7 +3183,7 @@ namespace CalamityMod.Projectiles } - case CalamityPlayer.FishingMinigames.ScoriaBobber: + case CalamityPlayer.FishingMinigames.VolcanicSinker: { if (PersistentFishingData == -1) { @@ -3308,7 +3308,7 @@ namespace CalamityMod.Projectiles } - case CalamityPlayer.FishingMinigames.PerennialBobber: + case CalamityPlayer.FishingMinigames.FeralBobber: if (projectile.ai[0] == 0) { if (projectile.wet) //Fishing in water @@ -3397,7 +3397,7 @@ namespace CalamityMod.Projectiles break; - case CalamityPlayer.FishingMinigames.NavystoneBobber: + case CalamityPlayer.FishingMinigames.SunkenSinker: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3567,7 +3567,7 @@ namespace CalamityMod.Projectiles return false; - case CalamityPlayer.FishingMinigames.SkylineBobber: + case CalamityPlayer.FishingMinigames.AcrobaticBobber: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { From d13f40d5e6ad5de21ada580ff9243b89eaf26287 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 12:21:41 +0700 Subject: [PATCH 28/46] Rift Reeler tooltip tweaks and lava stuff Lava fishing tooltip changed to be verbatim from Hotline Rod --- Items/Fishing/FishingRods/RiftReeler.cs | 3 +-- Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Items/Fishing/FishingRods/RiftReeler.cs b/Items/Fishing/FishingRods/RiftReeler.cs index da0bc6e2f1..7b74df80bf 100644 --- a/Items/Fishing/FishingRods/RiftReeler.cs +++ b/Items/Fishing/FishingRods/RiftReeler.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Items.Fishing.FishingRods { Item.width = 24; Item.height = 28; - Item.useAnimation = 8; - Item.useTime = 8; + Item.useAnimation = Item.useTime = 8; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.fishingPole = 45; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 5cecca83f7..4070a1c761 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -344,8 +344,8 @@ RiftReeler: { DisplayName: Rift Reeler Tooltip: ''' - Fires four lines at once - Can fish in lava + Fires four lines at once. Bobbers deal damage upon contact with enemies + Allows fishing in lava 'The battlefield is a scene of constant chaos. The winner will be the one who controls that chaos, both the pole and the fish.' ''' @@ -355,7 +355,7 @@ SlurperPole: { DisplayName: Slurper Pole Tooltip: ''' - Can fish in lava + Allows fishing in lava 'It is the burning lava of the soul that has a furnace within--a very volcano of grief and sorrow.' ''' } @@ -364,7 +364,7 @@ TheDevourerofCods: { DisplayName: The Devourer of Cods Tooltip: ''' - Fires ten lines at once. Line never snaps and can fish from lava + Fires ten lines at once. Line never breaks and allows fishing in lava Hooked items stay hooked forever Common fish are automatically consumed while fishing Consuming fish allows a bobber to hook a new item and feeds the user From c7c4285542e770bf9d8d3bae6fbac9010d9116e6 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 12:51:40 +0700 Subject: [PATCH 29/46] Transferred several sources of AP to their items --- Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs | 6 ++++++ Items/Weapons/Magic/IonBlaster.cs | 4 ++++ Items/Weapons/Ranged/Infinity.cs | 6 ++++-- Items/Weapons/Ranged/PolarisParrotfish.cs | 13 +++++++------ Items/Weapons/Ranged/Svantechnical.cs | 10 ++++++---- ....CalamityMod.Items.Weapons.DraedonsArsenal.hjson | 1 + .../Mods.CalamityMod.Items.Weapons.Ranged.hjson | 8 ++++++-- Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs | 1 - Projectiles/Magic/IonBlast.cs | 2 -- Projectiles/Ranged/ChargedBlast.cs | 4 ---- Projectiles/Ranged/ChargedBlastSplit.cs | 6 ------ Projectiles/Ranged/PolarStar.cs | 1 - 12 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs index 6aa71e69b2..3e47eb756f 100644 --- a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs +++ b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal @@ -21,6 +22,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public static readonly SoundStyle Sound1 = new("CalamityMod/Sounds/Item/ShrimpSound1"); public static readonly SoundStyle Sound2 = new("CalamityMod/Sounds/Item/ShrimpSound2"); public static readonly SoundStyle Surprise = new("CalamityMod/Sounds/Item/ShrimpSurprise"); + + public static int ArmorPenetration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration); + public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); @@ -29,6 +34,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.height = 32; Item.shootSpeed = 10f; Item.damage = 24; + Item.ArmorPenetration = ArmorPenetration; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index 8126a4a72f..8ed8097342 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Magic public class IonBlaster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + + public static int ArmorPenetration = 40; + public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -20,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 68; Item.height = 38; Item.damage = 24; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.useAnimation = 7; diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 4c6c6151ff..c575c6c3e8 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -18,14 +18,16 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public int SineCounter = 0; + public static int ArmorPenetration = 20; public static int AmmoSavedPercent = 80; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration, AmmoSavedPercent); public override void SetDefaults() { Item.width = 56; Item.height = 24; Item.damage = 75; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; Item.useTime = 1; Item.useAnimation = 4; @@ -57,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged for (int i = -1; i <= 1; i += 2) { Vector2 helixVel = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(i * sine)); - Projectile.NewProjectile(source, position, helixVel, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); + Projectile.NewProjectile(source, position, helixVel, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, 1); } } Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), new Color(229, 49, 39)); diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index 331eec6798..fa94b9ccb1 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -20,6 +20,9 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/PolarisShot") { Volume = 0.6f }; public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f }; + + public static int ArmorPenetration = 15; + public override void SetStaticDefaults() { ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; @@ -31,11 +34,9 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 36; Item.height = 34; Item.damage = 35; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; - - Item.useTime = 9; - Item.useAnimation = 9; - + Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0.5f; @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; } - public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalization(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal").Format(ArmorPenetration)); public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -129,7 +130,7 @@ namespace CalamityMod.Items.Weapons.Ranged SoundEngine.PlaySound(Shot, player.Center); for (int i = 0; i < (Happy ? 3 : 1); i++) - Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ShotNumber); + Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), type, damage, knockback, player.whoAmI, 0f, ShotNumber); if (ShotNumber >= 2) // Cycle the shot color ShotNumber = 0; diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index ae859ea8b6..4a698709e7 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -18,14 +18,16 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public int SineCounter = 0; + public static int ArmorPenetration = 200; public static int AmmoSavedPercent = 80; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration, AmmoSavedPercent); public override void SetDefaults() { Item.width = 60; Item.height = 26; Item.damage = 232; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; Item.useTime = 1; Item.useAnimation = 4; @@ -61,9 +63,9 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); + Projectile.NewProjectile(source, position, helixVel1, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 2f); + Projectile.NewProjectile(source, position, helixVel2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 4f); + Projectile.NewProjectile(source, position, helixVel3, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 3f); } Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), Main.rand.NextBool() ? Color.MediumOrchid : Color.DarkViolet); GeneralParticleHandler.SpawnParticle(spark2); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 0ab28aaaf8..2d89a62599 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -18,6 +18,7 @@ AqueousHunterDrone: { while holding any summon weapon to command the shrimp to launch a vertical missile barrage Vertical missiles aim towards your cursor and leave a lingering blast if they hit solid ground Each shrimp uses 4 minion slots + {$Common.ArmorPenetration} [c/1FFBFF:'When pursuing the adherents of gods, Yharim believed no stone should be left unturned.] [c/1FFBFF:Weaponry for underwater contingencies was an unusually heavy focus, but no models ever saw deployment.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index e4508e5c1b..a9ad6db7c2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -616,7 +616,8 @@ Infinity: { Tooltip: ''' Fires a twin stream of energy bolts that split - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'They say infinity is neverending, yet you hold it in your hands' ''' } @@ -925,12 +926,14 @@ PolarisParrotfish: { ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy + {$Common.ArmorPenetration} 'It carries the mark of the Northern Star' ''' TooltipGFB: ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy + {$Common.ArmorPenetration} to give the little girl some attention 'She is a happy girl' ''' @@ -1303,7 +1306,8 @@ Svantechnical: { Tooltip: ''' Fires a trinity of energy bolts that split into beams that track your cursor - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'The age old balance of trading damage for frames' ''' } diff --git a/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs index ff1bf55236..f9a5e01839 100644 --- a/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs +++ b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.timeLeft = 300; Projectile.extraUpdates = 3; Projectile.penetrate = -1; - Projectile.ArmorPenetration = 15; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Magic/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index 9352beef41..ab93bc31bf 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.ArmorPenetration = 40; } public override void AI() @@ -105,7 +104,6 @@ namespace CalamityMod.Projectiles.Magic Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 10; blast.DamageType = DamageClass.Magic; - blast.ArmorPenetration = 40; } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 5913c8504c..34655082c4 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -52,10 +52,6 @@ namespace CalamityMod.Projectiles.Ranged baseColor = Color.MediumOrchid; } baseVel = Projectile.velocity; - if (Svant) - Projectile.ArmorPenetration = 200; - if (Infinity) - Projectile.ArmorPenetration = 20; } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; if (Projectile.timeLeft == 2) diff --git a/Projectiles/Ranged/ChargedBlastSplit.cs b/Projectiles/Ranged/ChargedBlastSplit.cs index 6aafc4fdff..a9f615012a 100644 --- a/Projectiles/Ranged/ChargedBlastSplit.cs +++ b/Projectiles/Ranged/ChargedBlastSplit.cs @@ -53,15 +53,9 @@ namespace CalamityMod.Projectiles.Ranged baseColor = Color.MediumOrchid; startVel = Projectile.velocity; if (Infinity) - { Projectile.timeLeft = 340; - Projectile.ArmorPenetration = 20; - } if (Svant) - { Projectile.timeLeft = 640; - Projectile.ArmorPenetration = 200; - } direction = Main.rand.NextBool(); homeSpeed = Main.rand.NextFloat(5, 8); } diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 6490f6fa34..bf2fc16015 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.tileCollide = true; - Projectile.ArmorPenetration = 15; } public override void AI() From 63ccd09494b797ed0b2f69859bcc29e15ed1e083 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 11 Apr 2026 13:23:47 +0700 Subject: [PATCH 30/46] Alcohols can now be removed individually --- Buffs/Alcohol/AlcoholPoisoning.cs | 7 +++---- Buffs/Alcohol/BloodyMaryBuff.cs | 2 -- Buffs/Alcohol/CaribbeanRumBuff.cs | 2 -- Buffs/Alcohol/CinnamonRollBuff.cs | 2 -- Buffs/Alcohol/EverclearBuff.cs | 2 -- Buffs/Alcohol/EvergreenGinBuff.cs | 2 -- Buffs/Alcohol/FireballBuff.cs | 2 -- Buffs/Alcohol/GrapeBeerBuff.cs | 2 -- Buffs/Alcohol/ManhattanBuff.cs | 2 -- Buffs/Alcohol/MargaritaBuff.cs | 2 -- Buffs/Alcohol/MoonshineBuff.cs | 2 -- Buffs/Alcohol/MoscowMuleBuff.cs | 2 -- Buffs/Alcohol/OldFashionedBuff.cs | 2 -- Buffs/Alcohol/PurpleHazeBuff.cs | 2 -- Buffs/Alcohol/RedWineBuff.cs | 2 -- Buffs/Alcohol/RumBuff.cs | 2 -- Buffs/Alcohol/ScrewdriverBuff.cs | 2 -- Buffs/Alcohol/StarBeamRyeBuff.cs | 2 -- Buffs/Alcohol/TequilaBuff.cs | 2 -- Buffs/Alcohol/TequilaSunriseBuff.cs | 2 -- Buffs/Alcohol/VodkaBuff.cs | 2 -- Buffs/Alcohol/WhiskeyBuff.cs | 2 -- Buffs/Alcohol/WhiteWineBuff.cs | 2 -- CalPlayer/CalamityPlayer.cs | 26 -------------------------- CalPlayer/CalamityPlayerLifeRegen.cs | 3 +-- 25 files changed, 4 insertions(+), 76 deletions(-) diff --git a/Buffs/Alcohol/AlcoholPoisoning.cs b/Buffs/Alcohol/AlcoholPoisoning.cs index c1736b0e64..1880e891a1 100644 --- a/Buffs/Alcohol/AlcoholPoisoning.cs +++ b/Buffs/Alcohol/AlcoholPoisoning.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -10,10 +11,8 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; - // The nurse technically cannot get rid of this debuff by herself, as it reapplies immediately after if you have alcohol left - // But she also cleanses excess alcohol if you have Alcohol Poisoning (see CalamityPlayer.PostNurseHeal) - // Removing this set means she costs 1 debuff worth of cost to remove excess alcohol - // BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + // The nurse can remove all alcohol debuffs individually, thus removing this by proxy. + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/BloodyMaryBuff.cs b/Buffs/Alcohol/BloodyMaryBuff.cs index af35461b47..266bcbf377 100644 --- a/Buffs/Alcohol/BloodyMaryBuff.cs +++ b/Buffs/Alcohol/BloodyMaryBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/CaribbeanRumBuff.cs b/Buffs/Alcohol/CaribbeanRumBuff.cs index fcdb6422b6..ad63c115e5 100644 --- a/Buffs/Alcohol/CaribbeanRumBuff.cs +++ b/Buffs/Alcohol/CaribbeanRumBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index bb724a3a52..6efc2c936e 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/EverclearBuff.cs b/Buffs/Alcohol/EverclearBuff.cs index 1629143a7f..fa5f3156fe 100644 --- a/Buffs/Alcohol/EverclearBuff.cs +++ b/Buffs/Alcohol/EverclearBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index 1821638bad..c3d27d74b9 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 99c877dc50..94ef554b0f 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index 714c912651..5ab4836351 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/ManhattanBuff.cs b/Buffs/Alcohol/ManhattanBuff.cs index e724375c25..71872b7153 100644 --- a/Buffs/Alcohol/ManhattanBuff.cs +++ b/Buffs/Alcohol/ManhattanBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index 37299b4fb8..d9f0855b5f 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MoonshineBuff.cs b/Buffs/Alcohol/MoonshineBuff.cs index 03faabe66d..32221e2e24 100644 --- a/Buffs/Alcohol/MoonshineBuff.cs +++ b/Buffs/Alcohol/MoonshineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MoscowMuleBuff.cs b/Buffs/Alcohol/MoscowMuleBuff.cs index 21f7569480..33afd8c8a8 100644 --- a/Buffs/Alcohol/MoscowMuleBuff.cs +++ b/Buffs/Alcohol/MoscowMuleBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/OldFashionedBuff.cs b/Buffs/Alcohol/OldFashionedBuff.cs index 68820059d4..8a31d03b48 100644 --- a/Buffs/Alcohol/OldFashionedBuff.cs +++ b/Buffs/Alcohol/OldFashionedBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/PurpleHazeBuff.cs b/Buffs/Alcohol/PurpleHazeBuff.cs index 16aa30d53f..a786be25fb 100644 --- a/Buffs/Alcohol/PurpleHazeBuff.cs +++ b/Buffs/Alcohol/PurpleHazeBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/RedWineBuff.cs b/Buffs/Alcohol/RedWineBuff.cs index 087086ca68..86acc413e4 100644 --- a/Buffs/Alcohol/RedWineBuff.cs +++ b/Buffs/Alcohol/RedWineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/RumBuff.cs b/Buffs/Alcohol/RumBuff.cs index ab842e0649..9f98fe704c 100644 --- a/Buffs/Alcohol/RumBuff.cs +++ b/Buffs/Alcohol/RumBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/ScrewdriverBuff.cs b/Buffs/Alcohol/ScrewdriverBuff.cs index f8f97cd0fe..ae2ddec1cc 100644 --- a/Buffs/Alcohol/ScrewdriverBuff.cs +++ b/Buffs/Alcohol/ScrewdriverBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/StarBeamRyeBuff.cs b/Buffs/Alcohol/StarBeamRyeBuff.cs index 50d6ac0bc8..71d4d85c3b 100644 --- a/Buffs/Alcohol/StarBeamRyeBuff.cs +++ b/Buffs/Alcohol/StarBeamRyeBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index a2b307c605..1db0e76f6c 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/TequilaSunriseBuff.cs b/Buffs/Alcohol/TequilaSunriseBuff.cs index af5a5f174a..650b4478a4 100644 --- a/Buffs/Alcohol/TequilaSunriseBuff.cs +++ b/Buffs/Alcohol/TequilaSunriseBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index 46eaee8329..60676048bf 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/WhiskeyBuff.cs b/Buffs/Alcohol/WhiskeyBuff.cs index 66be5a8a0c..488758eb22 100644 --- a/Buffs/Alcohol/WhiskeyBuff.cs +++ b/Buffs/Alcohol/WhiskeyBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/WhiteWineBuff.cs b/Buffs/Alcohol/WhiteWineBuff.cs index eb47a1056f..f18f1f8cef 100644 --- a/Buffs/Alcohol/WhiteWineBuff.cs +++ b/Buffs/Alcohol/WhiteWineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d03aa7b1be..8f9d1b241b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5920,32 +5920,6 @@ namespace CalamityMod.CalPlayer price /= vanillaPriceMult; } } - - public override void PostNurseHeal(NPC nurse, int health, bool removeDebuffs, int price) - { - // Remove excess alcohol - if (removeDebuffs && alcoholPoisonLevel > 3) - { - List Alcohol = new List(); - for (int i = 0; i < Player.MaxBuffs; i++) - { - int buff = Player.buffType[i]; - if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level)) - Alcohol.Insert(0, new int[] { i, level }); - } - - int poison = alcoholPoisonLevel; - do - { - // Obtain the index:level relationship - int[] relation = Alcohol[0]; - Player.DelBuff(relation[0]); // Remove the alcohol - poison -= relation[1]; // Cancel the poison level - Alcohol.RemoveAt(0); - } - while (poison > 3); - } - } #endregion #region Rogue Stealth diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5e33e56b73..6f769e1c50 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -218,9 +218,8 @@ namespace CalamityMod.CalPlayer // Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning. Player.nebulaLevelLife = 0; - // This has to last over 60 frames for the nurse to count the debuff, so... if (Player.whoAmI == Main.myPlayer) - Player.AddBuff(ModContent.BuffType(), 61, false); + Player.AddBuff(ModContent.BuffType(), 2, false); if (Player.lifeRegen > 0) Player.lifeRegen = 0; From 7274ad319af5617fe290e2694213db64edeecddd Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 6 Apr 2026 22:25:30 -0400 Subject: [PATCH 31/46] Several Storm Weaver tweaks * Decreased size of the worm in Expert+ * Timing of charges and projectile attacks no longer desyncs; projectile attack always triggers right as it charges * Increased speed of frost waves in Expert+ * No longer stops charging in final phase * Slightly revamped tornado attack. Instead of spawning tornadoes evenly spaced apart with little room in between, now spawns tornadoes that are taller but are spaced much farther apart, then spawns extra tornadoes beyond that with less space in between them. This solidifies the attack as a pseudo-arena instead of being a weird mix between pseudo-arena and area denial that fails at both. *Tornadoes last for a shorter amount of time to prevent consecutive tornadoes from overlapping --- NPCs/StormWeaver/StormWeaverBody.cs | 6 +- NPCs/StormWeaver/StormWeaverHead.cs | 186 +++++++++++++--------------- NPCs/StormWeaver/StormWeaverTail.cs | 6 +- Projectiles/Enemy/TornadoHostile.cs | 14 +-- 4 files changed, 102 insertions(+), 110 deletions(-) diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 70d85d9033..f8232470c8 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -63,11 +63,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.dontCountMe = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 9c34dbc2f2..430d0562f5 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -116,11 +116,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.StormWeaver // Start calling down frost waves from the sky in sheets and stop firing lightning during the charge bool phase3 = lifeRatio < 0.55f; - // Lightning strike flash phase, stop charging and start summoning tornadoes + // Lightning strike flash phase, start summoning tornadoes bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings @@ -336,33 +336,21 @@ namespace CalamityMod.NPCs.StormWeaver // Start charging at the player when in phase 2 if (phase2) { - if (!phase4) - { - calamityGlobalNPC.newAI[0] += 1f; - } - else - { - NPC.localAI[1] = 0f; - if (NPC.localAI[3] > 0f) - NPC.localAI[3] -= 1f; - - calamityGlobalNPC.newAI[0] = 0f; - } - + calamityGlobalNPC.newAI[0] += 1f; calamityGlobalNPC.newAI[2] += 1f; // Only use tornadoes in phase 4 and swap between using them or the frost waves bool useTornadoes = calamityGlobalNPC.newAI[3] % 2f != 0f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; if (phase4 && expertMode) - chargePhaseGateValue *= 0.9f; + attackGateValue *= 0.9f; // Gate value for when Storm Weaver fires projectiles - float projectileGateValue = (int)(chargePhaseGateValue * 0.25f); + float resetGateValue = attackGateValue + 100f; // Call down frost waves from the sky if (phase3 && !useTornadoes) @@ -436,10 +424,8 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (calamityGlobalNPC.newAI[2] >= projectileGateValue) + if (calamityGlobalNPC.newAI[2] == attackGateValue) { - calamityGlobalNPC.newAI[2] = -projectileGateValue * 4f; - // Dictates whether Storm Weaver will use frost or tornadoes if (phase4) { @@ -471,14 +457,14 @@ namespace CalamityMod.NPCs.StormWeaver // Start fast at index 0, become slower as each projectile spawns and then become faster past the central wave int centralWave = totalWaves / 2; - float velocityY = 8f; + float velocityY = revenge ? 10f : expertMode ? 9f : 8f; int wavePatternType = revenge ? Main.rand.Next(3) : expertMode ? Main.rand.Next(2) + 1 : 2; float delayBeforeFiring = -60f; for (int x = 0; x < totalWaves; x++) { switch (wavePatternType) { - // Starts at 8, central point is 6 and the end is 8 + // Arrow shape case 0: if (x != 0) @@ -491,7 +477,7 @@ namespace CalamityMod.NPCs.StormWeaver break; - // Starts at 8 and alternates between 6 and 8 + // Alternating waves that arrive at different times case 1: if (x != 0) @@ -504,11 +490,8 @@ namespace CalamityMod.NPCs.StormWeaver break; - // Flat line of slower waves + // Flat line case 2: - - velocityY = 7f; - break; } @@ -526,95 +509,98 @@ namespace CalamityMod.NPCs.StormWeaver // Summon tornadoes if (useTornadoes) { - if (calamityGlobalNPC.newAI[2] >= projectileGateValue) + if (calamityGlobalNPC.newAI[2] == attackGateValue) { - calamityGlobalNPC.newAI[2] = -projectileGateValue * 4f; - // Dictates whether Storm Weaver will use frost or tornadoes calamityGlobalNPC.newAI[3] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ModContent.ProjectileType(); - int totalTornadoes = revenge ? 7 : expertMode ? 5 : 3; - float spawnDistance = revenge ? 750f : expertMode ? 900f : 1050f; - for (int i = 0; i < totalTornadoes; i++) + int totalTornadoes = death ? 10 : revenge ? 6 : expertMode ? 4 : 2; + float spawnDistance = revenge ? 720f : expertMode ? 800f : 880f; // Distance to first tornado from the center point, so actual space is twice this number + for (int i = -totalTornadoes / 2; i <= totalTornadoes / 2; i++) { - Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * spawnDistance * (i - totalTornadoes / 2); + if (i == 0) + continue; + + Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * (spawnDistance * Math.Sign(i) + (i - Math.Sign(i)) * spawnDistance * 0.4f); Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, TornadoDamage, 1f); } } } } + if (calamityGlobalNPC.newAI[2] >= resetGateValue) + calamityGlobalNPC.newAI[2] = 0f; + // Charge - if (!phase4) + if (calamityGlobalNPC.newAI[0] == attackGateValue - 70) { - if (calamityGlobalNPC.newAI[0] == chargePhaseGateValue - 70) + Vector2 soundCenter = Main.player[NPC.target].Center; + SoundStyle lightning = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; + SoundEngine.PlaySound(lightning, soundCenter); + } + if (calamityGlobalNPC.newAI[0] >= attackGateValue) + { + NPC.localAI[3] = 60f; + + if (NPC.localAI[1] == 0f) + NPC.localAI[1] = 1f; + + if (calamityGlobalNPC.newAI[0] >= resetGateValue) { - Vector2 soundCenter = Main.player[NPC.target].Center; - SoundStyle lightning = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; - SoundEngine.PlaySound(lightning, soundCenter); + NPC.TargetClosest(); + NPC.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; } - if (calamityGlobalNPC.newAI[0] >= chargePhaseGateValue) + + if (NPC.localAI[1] == 2f) { - NPC.localAI[3] = 60f; + velocity += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.01f * (1f - (lifeRatio / 0.8f)); + acceleration += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.0001f * (1f - (lifeRatio / 0.8f)); + velocity *= 2f; + acceleration *= 0.85f; - if (NPC.localAI[1] == 0f) - NPC.localAI[1] = 1f; - - if (calamityGlobalNPC.newAI[0] >= chargePhaseGateValue + 100f) + float stopChargeDistance = 800f * NPC.localAI[2]; + if (stopChargeDistance < 0) { - NPC.TargetClosest(); - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - - if (NPC.localAI[1] == 2f) - { - velocity += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.01f * (1f - (lifeRatio / 0.8f)); - acceleration += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.0001f * (1f - (lifeRatio / 0.8f)); - velocity *= 2f; - acceleration *= 0.85f; - - float stopChargeDistance = 800f * NPC.localAI[2]; - if (stopChargeDistance < 0) + if (NPC.Center.X < Main.player[NPC.target].Center.X + stopChargeDistance) { - if (NPC.Center.X < Main.player[NPC.target].Center.X + stopChargeDistance) - { - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } - else - { - if (NPC.Center.X > Main.player[NPC.target].Center.X + stopChargeDistance) - { - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } + NPC.localAI[1] = 0f; + // Prevent the timers from desyncing + calamityGlobalNPC.newAI[0] = calamityGlobalNPC.newAI[2] - resetGateValue; } } - - int dustAmt = 5; - for (int k = 0; k < dustAmt; k++) + else { - Vector2 dustRotation = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; - dustRotation = dustRotation.RotatedBy((k - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + NPC.Center; - Vector2 randDustMovement = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int bluishDust = Dust.NewDust(dustRotation + randDustMovement, 0, 0, DustID.UnusedWhiteBluePurple, randDustMovement.X, randDustMovement.Y, 100, default, 3f); - Main.dust[bluishDust].noGravity = true; - Main.dust[bluishDust].noLight = true; - Main.dust[bluishDust].velocity /= 4f; - Main.dust[bluishDust].velocity -= NPC.velocity; + if (NPC.Center.X > Main.player[NPC.target].Center.X + stopChargeDistance) + { + NPC.localAI[1] = 0f; + // Prevent the timers from desyncing + calamityGlobalNPC.newAI[0] = calamityGlobalNPC.newAI[2] - resetGateValue; + } } } - else + + int dustAmt = 5; + for (int k = 0; k < dustAmt; k++) { - if (NPC.localAI[3] > 0f) - NPC.localAI[3] -= 1f; + Vector2 dustRotation = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; + dustRotation = dustRotation.RotatedBy((k - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + NPC.Center; + Vector2 randDustMovement = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + int bluishDust = Dust.NewDust(dustRotation + randDustMovement, 0, 0, DustID.UnusedWhiteBluePurple, randDustMovement.X, randDustMovement.Y, 100, default, 3f); + Main.dust[bluishDust].noGravity = true; + Main.dust[bluishDust].noLight = true; + Main.dust[bluishDust].velocity /= 4f; + Main.dust[bluishDust].velocity -= NPC.velocity; } } + else + { + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + } } if (Main.getGoodWorld) @@ -640,7 +626,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (phase2 && !phase4) + if (phase2) { if (NPC.localAI[1] == 1f) { @@ -830,16 +816,19 @@ namespace CalamityMod.NPCs.StormWeaver bool phase2 = lifeRatio < 0.8f && !Main.zenithWorld; bool phase3 = lifeRatio < 0.55f; + bool phase4 = lifeRatio < 0.3f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; + if (phase4 && expertMode) + attackGateValue *= 0.9f; Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; - float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; + float chargeTelegraphGateValue = attackGateValue - chargeTelegraphTime; Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; @@ -865,13 +854,16 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; + bool phase4 = lifeRatio < 0.3f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; + if (phase4 && expertMode) + attackGateValue *= 0.9f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 360 : 240; + int buffDuration = NPC.Calamity().newAI[0] >= attackGateValue ? 360 : 240; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 3608b9cc4d..c0f5aef107 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -62,11 +62,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.dontCountMe = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index 002c255f37..128d8bb152 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Enemy public override void AI() { - float projTimer = Projectile.ai[1] == 1f ? 900f : 600f; + float projTimer = Projectile.ai[1] == 1f ? 795f : 600f; if (Projectile.soundDelay == 0) { Projectile.soundDelay = -1; @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Enemy { Projectile.Kill(); } - float expandSizeX = Projectile.ai[1] == 1f ? 90f : 15f; - float expandSizeY = Projectile.ai[1] == 1f ? 90f : 15f; + float expandSizeX = Projectile.ai[1] == 1f ? 150f : 15f; + float expandSizeY = Projectile.ai[1] == 1f ? 150f : 15f; Point projCenterTile = Projectile.Center.ToTileCoordinates(); int sizeMod; int sizeMod2; @@ -101,13 +101,13 @@ namespace CalamityMod.Projectiles.Enemy } } - public override bool CanHitPlayer(Player target) => Projectile.ai[0] >= 60f && Projectile.ai[0] <= (Projectile.ai[1] == 1f ? 840f : 540f); + public override bool CanHitPlayer(Player target) => Projectile.ai[0] >= 60f && Projectile.ai[0] <= (Projectile.ai[1] == 1f ? 735f : 540f); public override bool PreDraw(ref Color lightColor) { - float aiTrackCheck = Projectile.ai[1] == 1f ? 900f : 600f; - float expandSizeX2 = Projectile.ai[1] == 1f ? 90f : 15f; - float expandSizeY2 = Projectile.ai[1] == 1f ? 90f : 15f; + float aiTrackCheck = Projectile.ai[1] == 1f ? 795f : 600f; + float expandSizeX2 = Projectile.ai[1] == 1f ? 150f : 15f; + float expandSizeY2 = Projectile.ai[1] == 1f ? 150f : 15f; float aiTracker = Projectile.ai[0]; float trackerClamp = MathHelper.Clamp(aiTracker / 30f, 0f, 1f); if (aiTracker > aiTrackCheck - 60f) From 4e00a6e983209a822da9741eb546f91ee43907b3 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 10 Apr 2026 15:17:28 -0400 Subject: [PATCH 32/46] Frost wave telegraphs last slightly longer, frost waves take slightly longer to start moving --- NPCs/StormWeaver/StormWeaverHead.cs | 4 ++-- Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 430d0562f5..b87f6185ca 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.StormWeaver int centralWave = totalWaves / 2; float velocityY = revenge ? 10f : expertMode ? 9f : 8f; int wavePatternType = revenge ? Main.rand.Next(3) : expertMode ? Main.rand.Next(2) + 1 : 2; - float delayBeforeFiring = -60f; + float delayBeforeFiring = -70f; // Note the actual delay is half of this number since frost waves have an extra update for (int x = 0; x < totalWaves; x++) { switch (wavePatternType) @@ -496,7 +496,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Telegraph is active for 60 frames - // Frost Waves start moving after 30 frames + // Frost Waves start moving after 35 frames // Frost Waves take 30 frames to reach full velocity Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.5f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, velocityY); Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, FrostWaveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); diff --git a/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs b/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs index 8682e81876..a9af58188f 100644 --- a/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs +++ b/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.tileCollide = false; - Projectile.extraUpdates = 4; + Projectile.extraUpdates = 3; Projectile.Opacity = 1f; } From b9690ada2efc85cccba24d2efacc56925b289a14 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Wed, 8 Apr 2026 19:30:47 -0500 Subject: [PATCH 33/46] Dimensional Drive now works with WASD, no longer infinite with DevilsDev --- CalPlayer/CalamityPlayerDashEffects.cs | 8 ++--- CalPlayer/CalamityPlayerMiscEffects.cs | 8 ++--- CalPlayer/Dashes/GodslayerArmorDash.cs | 45 ++++++++++++++++---------- CalPlayer/Dashes/PlayerDashEffect.cs | 2 ++ 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index cfc495120f..df08aeb84f 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -149,15 +149,11 @@ namespace CalamityMod.CalPlayer // Handle mid-dash effects. UsedDash.MidDashEffects(Player, ref dashSpeed, ref dashSpeedDecelerationFactor, ref runSpeedDecelerationFactor); - int VerticalOmnidashCap = DashID == GodslayerArmorDash.ID ? 75 : 25; - if (UsedDash.IsOmnidirectional && VerticalOmnidashTimer < VerticalOmnidashCap) + if (UsedDash.ForceEndAt > 0) { - VerticalOmnidashTimer++; - if (VerticalOmnidashTimer >= VerticalOmnidashCap) + if (UsedDash.dashTime >= UsedDash.ForceEndAt) { Player.dashDelay = dashDelayToApply; - // Stop the player from going flying - Player.velocity *= 0.2f; } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cadb1be151..c652d14afa 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -350,9 +350,9 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 4 == 0) Player.HealPlayer(1, HealTextType.None); - if (Player.dashDelay > 0) // Reduced dash cooldown + if (Player.dashDelay > 1) // Reduced dash cooldown { - Player.dashDelay = 0; + Player.dashDelay = 1; } if (Player.dashDelay == -1) { @@ -367,9 +367,9 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 5 == 0) Player.HealPlayer(2, HealTextType.None); - if (Player.dashDelay > 0) // Reduced dash cooldown + if (Player.dashDelay > 1) // Reduced dash cooldown { - Player.dashDelay = 0; + Player.dashDelay = 1; } if (Player.dashDelay == -1) { diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index eb9c5f921a..f2f9e49477 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -27,7 +27,8 @@ namespace CalamityMod.CalPlayer.Dashes public override bool IsOmnidirectional => true; - public int Time = 0; + public override int ForceEndAt => 75; + public float Size = 2.2f; public bool SoundOnce = true; @@ -40,7 +41,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnDashEffects(Player player) { - Time = 0; + dashTime = 0; Size = 2.2f; GSDashSlot = SoundEngine.PlaySound(DevourerofGodsHead.DeathAnimationSound, player.Center); SoundOnce = true; @@ -60,24 +61,36 @@ namespace CalamityMod.CalPlayer.Dashes if (SoundEngine.TryGetActiveSound(GSDashSlot, out var Dashsound) && Dashsound.IsPlaying) Dashsound.Position = player.Center; - Time++; Size -= 0.01f; - const int totalDashTime = 75; - // Constantly update the player's velocity direction. - float progress = MathHelper.Clamp(Time / (float)totalDashTime, 0f, 1f); + float progress = MathHelper.Clamp(dashTime / (float)ForceEndAt, 0f, 1f); float ease = 1f - (float)Math.Pow(1f - progress, 0.2f); float finalSpeed = MathHelper.Lerp(32f, 11f, ease); Vector2 dashVel = Main.MouseWorld - player.Center; - Vector2 targetDirection = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2(); - player.velocity = targetDirection * finalSpeed; + + Vector2 direction = Vector2.Zero; + if (player.controlLeft) + direction.X -= 1; + if (player.controlRight) + direction.X += 1; + if (player.controlUp) + direction.Y -= 1; + if (player.controlDown) + direction.Y += 1; + + Vector2 targetDirection = direction == Vector2.Zero ? player.velocity.SafeNormalize(Vector2.Zero) : player.velocity.ToRotation().AngleTowards(direction.ToRotation(), 0.175f).ToRotationVector2(); + + if (targetDirection == Vector2.Zero) + targetDirection = new(player.direction, 0); + + player.velocity = ((dashTime == 1 && direction != Vector2.Zero) ? direction : targetDirection) * finalSpeed; // Fall way, way, faster than usual. player.maxFallSpeed = 50f; - if (Time < 75) + if (dashTime < ForceEndAt) { Particle jaws = new Jaws(player.Center + player.velocity * 0.5f, player.velocity, Color.Fuchsia, new Vector2(0.8f, 1f), player.velocity.ToRotation() + MathHelper.PiOver2, Size, Size, 2); GeneralParticleHandler.SpawnParticle(jaws); @@ -85,11 +98,11 @@ namespace CalamityMod.CalPlayer.Dashes GeneralParticleHandler.SpawnParticle(jaws2); } - float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, Time, true)); + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, dashTime, true)); for (int i = 0; i < 3; i++) { - float offsetRotationAngle = player.velocity.ToRotation() + Time / 20f; - float radius = (30f + (float)Math.Cos(Time / 3f) * 24f) * radiusFactor; + float offsetRotationAngle = player.velocity.ToRotation() + dashTime / 20f; + float radius = (30f + (float)Math.Cos(dashTime / 3f) * 24f) * radiusFactor; Vector2 dustPosition = player.Center + player.velocity * 0.8f; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(5) ? 181 : 295); @@ -100,7 +113,7 @@ namespace CalamityMod.CalPlayer.Dashes dust2.noGravity = true; } - if (Time % 2 == 0) + if (dashTime % 2 == 0) { float sparkscale = Size * 1.3f; Vector2 SparkVelocity1 = player.velocity.RotatedBy(player.direction * -4, default) * 0.08f - player.velocity / 2f; @@ -111,14 +124,12 @@ namespace CalamityMod.CalPlayer.Dashes GeneralParticleHandler.SpawnParticle(spark2); } - if (Time > 75 && Time < 78) + if (dashTime >= ForceEndAt) { Particle pulse = new DirectionalPulseRing(player.Center - player.velocity * 0.52f, player.velocity / 1.5f, Color.Fuchsia, new Vector2(1f, 2f), player.velocity.ToRotation(), 0.82f, 0.32f, 60); GeneralParticleHandler.SpawnParticle(pulse); Particle pulse2 = new DirectionalPulseRing(player.Center - player.velocity * 0.40f, player.velocity / 1.5f * 0.9f, Color.Aqua, new Vector2(0.8f, 1.5f), player.velocity.ToRotation(), 0.58f, 0.28f, 50); GeneralParticleHandler.SpawnParticle(pulse2); - - Time = 95; } // Dash at a much, much faster speed than the default value. @@ -126,7 +137,7 @@ namespace CalamityMod.CalPlayer.Dashes runSpeedDecelerationFactor = 0.8f; // Cooldown for God Slayer Armor dash. - player.AddCooldown(Cooldowns.GodSlayerDash.ID, GodSlayerChestplate.DashCooldown); + player.AddCooldown(Cooldowns.GodSlayerDash.ID, 60);//GodSlayerChestplate.DashCooldown); player.Calamity().godSlayerDashHotKeyPressed = false; } diff --git a/CalPlayer/Dashes/PlayerDashEffect.cs b/CalPlayer/Dashes/PlayerDashEffect.cs index 30e515cd7f..ef477f1cf2 100644 --- a/CalPlayer/Dashes/PlayerDashEffect.cs +++ b/CalPlayer/Dashes/PlayerDashEffect.cs @@ -20,6 +20,8 @@ namespace CalamityMod.CalPlayer.Dashes public abstract bool IsOmnidirectional { get; } + public virtual int ForceEndAt { get; } = -1; + public abstract float CalculateDashSpeed(Player player); /// /// Effects that happen once when the main dash starts From f90454d2951a8b9c3ada42a761ecb962c9f6ce61 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sat, 11 Apr 2026 11:59:46 -0500 Subject: [PATCH 34/46] Fixed int --- CalPlayer/Dashes/GodslayerArmorDash.cs | 2 +- Items/Armor/GodSlayer/GodSlayerChestplate.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index f2f9e49477..20be36951d 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -137,7 +137,7 @@ namespace CalamityMod.CalPlayer.Dashes runSpeedDecelerationFactor = 0.8f; // Cooldown for God Slayer Armor dash. - player.AddCooldown(Cooldowns.GodSlayerDash.ID, 60);//GodSlayerChestplate.DashCooldown); + player.AddCooldown(Cooldowns.GodSlayerDash.ID, GodSlayerChestplate.DashCooldown); player.Calamity().godSlayerDashHotKeyPressed = false; } diff --git a/Items/Armor/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index 5230c288c0..cefd8ea258 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -12,16 +12,16 @@ namespace CalamityMod.Items.Armor.GodSlayer { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; - public static float DamageBoost = 0.15f; - public static int CritBoost = 11; + public static float DamageBoost => 0.15f; + public static int CritBoost => 11; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); // Common Set Bonus - public static int DashCooldown = CalamityUtils.SecondsToFrames(45); - public static int DashDamage = 3000; - public static float DashKnockback = 15f; - public static int DashIFrames = 12; - public static int DashGodSlayerInfernoDuration = CalamityUtils.SecondsToFrames(5); + public static int DashCooldown => CalamityUtils.SecondsToFrames(45); + public static int DashDamage => 3000; + public static float DashKnockback => 15f; + public static int DashIFrames => 12; + public static int DashGodSlayerInfernoDuration => CalamityUtils.SecondsToFrames(5); public override void SetDefaults() { From 5c7a19c1886722063fce5491548c485cdc7e5eaf Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 11 Apr 2026 18:12:11 -0700 Subject: [PATCH 35/46] flying and idle anims --- Buffs/Pets/StarSwallowerPetBuff.png | Bin 617 -> 662 bytes CalPlayer/CalamityPlayer.cs | 2 + .../en-US/Mods.CalamityMod.Buffs.hjson | 5 + .../en-US/Mods.CalamityMod.Items.Pets.hjson | 5 + .../Mods.CalamityMod.Projectiles.Pets.hjson | 1 + Projectiles/Pets/StarSwallowerPet.cs | 104 +++++++++--------- Projectiles/Pets/StarSwallowerPet.png | Bin 4518 -> 2798 bytes Projectiles/Pets/StarSwallowerPetIdle.png | Bin 0 -> 2478 bytes 8 files changed, 64 insertions(+), 53 deletions(-) create mode 100644 Projectiles/Pets/StarSwallowerPetIdle.png diff --git a/Buffs/Pets/StarSwallowerPetBuff.png b/Buffs/Pets/StarSwallowerPetBuff.png index 2c9ccf32bf410be8f8ef89085a6ba029fb43c1f8..7a12cb7a9a2b11efe0520c4cf21f7c9ee5c50ba9 100644 GIT binary patch delta 575 zcmV-F0>J(01eOJmKz{-zNklF+A2_9(gi+9fB3Ks_hT4j;R4Ng~h*%Jfe&F|gzoBnCo{KKd zJNm%k^PY1M&-1*`^PczEZ4&2L;Flb>#s2(*9Q_-gc6RXJ9e+5p5IZCHT#w;GJh~2V zJ?)0c$=FvoxzYtY-nQN+t}9-+{-^?zQ0P0H%ZcAt7GJ>nWMFFPFfN#pS{sz3y*cXs zCP%G!OC`AC^TE0CB&=@@aIT5bobR3zwPAFh=wAbuCVFwfsM>c^ui?L#=@Y(J7M3{T z{cpjcz-zOgcFGfR zyp!i~;YZXD|4d|HMiv}A1D}ly!FLn0@aYp`ZqkGg>l?5dx!M)_uY`n|m>O=~4-~(M_kX5PfQj4Xf>}H48Z|SPXW-8RH1>ea`@qI~ zp6~j096xjr$AHI!!;D7FG}nzjHDI@)^;K}q&CBUj=2q3=4N?g@>)j2_(j44Zu;s&mhkQ{5?9p8@Ir_3PMX`wd-A N?Y4R_HYAfn0w((tB~JhV delta 530 zcmV+t0`2{l1?dEkKz{-GNklgT{rdvfMg9uHXU z&IL1xPEfHNRa11dVCWUp-vMS$?Z)F)q%>Gp1upIEgC*ksfznbdQetiVKL?n3cQ6Q^ zoX5bM>r;^8eSc~*5&`c;S9Hu2f%-bI-2Vj1%zgeQuszTUPEF5)4Yg{PNM|Z4>p|(1 zbi{TCvMpwOhck03G|&TvSJuIWFktl5FvHYNw6rLv4-U3LeQSW?)Z&wK&&S3`LDoV# zrK=Ivf<6w6Y&2tm^O~XqlyrjKK}GiuL9Vk#DE%GS8-G^)FJ}Rrm~8Wd6sMnbinD=T zz^("CalamityMod/Projectiles/Pets/EidolonSnail").Value; + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 scale = Vector2.One; + if (fly) + { + float animRate = Main.GlobalTimeWrappedHourly * 20; + float scaleMod = 0.2f; + scale += new Vector2(MathF.Cos(animRate), MathF.Sin(animRate)) * scaleMod; + } + SpriteEffects fx = fly ? (SpriteEffects.FlipVertically | (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None)) : Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2 / Main.projFrames[Type]), Projectile.scale * scale, fx, 0); - int height = texture.Height / Main.projFrames[Projectile.type]; - int frameHeight = height * Projectile.frame; - SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, - Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);*/ - - return true; - } - - public override void PostDraw(Color lightColor) - { - /* Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value; - - int height = texture.Height / Main.projFrames[Projectile.type]; - int frameHeight = height * Projectile.frame; - SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Color.White, - Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);*/ + return false; } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) @@ -94,6 +84,7 @@ namespace CalamityMod.Projectiles.Pets } Vector2 projPos = Projectile.position; + Vector2 mouthPos = Projectile.Center + new Vector2(-20 * Projectile.spriteDirection, -6f).RotatedBy(Projectile.rotation); if (!fly) { Projectile.rotation = 0; @@ -160,9 +151,12 @@ namespace CalamityMod.Projectiles.Pets //set frames when idle if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0) { - /*if (Main.rand.NextBool(200) && !idleAnimation) + // Idle animation where it opens its mouth and lets out some plasma mist + if (Main.rand.NextBool(600) && !idleAnimation) { idleAnimation = true; + Projectile.frame = 8; + Projectile.frameCounter = 0; } if (idleAnimation) @@ -170,21 +164,36 @@ namespace CalamityMod.Projectiles.Pets Projectile.frameCounter++; if (Projectile.frameCounter > 8) { - Projectile.frame++; + Projectile.frame += (Projectile.ai[0] != -1).ToDirectionInt(); Projectile.frameCounter = 0; } - if (Projectile.frame > 4) + if (Projectile.ai[0] != -1) { - Projectile.frame = 0; - idleAnimation = false; + if (Projectile.frame >= 12) + { + Projectile.ai[0] = -1; + Projectile.frame = 11; + } + } + else + { + if (Projectile.frame <= 7) + { + Projectile.ai[0] = 0; + Projectile.frame = 0; + idleAnimation = false; + } + } + if (Projectile.frame > 8) + { + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(mouthPos, (Vector2.UnitX * -Projectile.spriteDirection).RotatedByRandom(MathHelper.ToRadians(10)) * Main.rand.NextFloat(4, 8), new Color(201, 234, 71), new Color(115, 192, 58), Main.rand.NextFloat(0.8f, 1.1f), 170f, Main.rand.NextFloat(0.1f, 0.2f) * Main.rand.NextFloatDirection())); } } else { Projectile.frame = 0; Projectile.frameCounter = 0; - }*/ - Projectile.frame = 0; + } } //falling frame else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) @@ -194,11 +203,6 @@ namespace CalamityMod.Projectiles.Pets } else if (Projectile.velocity.X != 0) { - if (Projectile.frame < 4) - { - //Projectile.frame = 4; - } - //moving animation Projectile.frameCounter++; if (Projectile.frameCounter >= 6) @@ -223,6 +227,8 @@ namespace CalamityMod.Projectiles.Pets } else if (fly) { + idleAnimation = false; + Projectile.ai[0] = 0; float flySpeed = 0.5f; Projectile.tileCollide = false; Vector2 flyDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); @@ -312,7 +318,7 @@ namespace CalamityMod.Projectiles.Pets } } - Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0); if (Projectile.Center.X < Main.player[Projectile.owner].Center.X) { @@ -323,18 +329,10 @@ namespace CalamityMod.Projectiles.Pets Projectile.spriteDirection = 1; } - //funny flying animation - Projectile.frame = 7; - /*Projectile.frameCounter++; - if (Projectile.frameCounter > 4) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 11) - { - Projectile.frame = 9; - }*/ + Projectile.frame = 12; + + // fly anim particles + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(mouthPos, mouthPos.DirectionTo(Projectile.oldPosition).RotatedByRandom(MathHelper.ToRadians(20)).RotatedBy(MathHelper.ToRadians(10 * Projectile.spriteDirection)) * Main.rand.NextFloat(4, 8), new Color(201, 234, 71), new Color(115, 192, 58), Main.rand.NextFloat(0.7f, 1f), 200f, Main.rand.NextFloat(0.1f, 0.2f) * Main.rand.NextFloatDirection())); } } diff --git a/Projectiles/Pets/StarSwallowerPet.png b/Projectiles/Pets/StarSwallowerPet.png index 275fa4ac5d77d8025b299bb51653fccab09533df..d3812caa71294808eb77d645b9fbb853d9edf1e3 100644 GIT binary patch literal 2798 zcmZuz3pA8l8=f&nuG7pAbuf&+k!z8=90sGA&n-rE*JW?XWq zh$Ip^&X7nhDbo=rq6i(LT#iov*XdvXTL1e0z1H6E-ru|SyPo~L-@Bj9a&sliN&h4b zgTdrL3W*9?V;D^Ap(FyD<^3M+02z2Jm23yAd8RT8EyROuU2I{nx*VC!qey6N<>q|Q zVV9a3R#rCR=uwh2*%|<{4(!k8vWI$wO4L11K9FfhbM=8|=V=_ZY}86-7A`3xlD4``+P?BP#=8Fll9wWP9*5 zZK05L@~t_VG`*9x5WY8i_1m|2caK~6cu)LIDcO2|#FcKv>o;6j^GZEmR%$WNKd}n7 zyIp{nuld$P-+&+Cb-MXO#^;j7 z+<#e&QuaM*KNDu$!P||?K#gpfZ0OFT-RN40dQf4b{}#RPs=Q*0c+S$yNNv`Wy|8mi zt$f};OhAK;8!n_5e?ME2Q9>ui^7>ot*U%0`PQJ_y;4-piD+w%n5CKkh1%}!d((eMa z+E{RkG=`u)HU&$NAeME=sRUUkm0$)27?I-tS~CC!>0bzSN-IUcvpVx(fTbv`adVX8 zgxGRPCR34J9$?$`DV*Kha+*+NG4L)#hB!CE+eqG;ak|2^kTNs1#LDmWYP8#?3y?2D}ES zWL>~e+ypvOoi4z#ye+L-v$bqOz!gnfiDz#1I_;6ncMW|hlm;94|BW$)x+$x5fH_wc zt!mAcxe5fU#o=?$8B5TShy0s?l~l*p{ZEnJ1qNhaN}?Pl*Wdo^a=q#cvtu}JP|8K& zkr$_biW56Ndll_~w#(8?S_-G^aCkc1mnN#SY8}?;(UK3WcUq6f2Pi0q)dm_LOHxP^ zO&`G!O6QN$9~73bGg30}_wI0o<(eDlUpFi4v{^Gh(dsX*hz*<)@Z2j265Ie}bXalx zqVcz#R?^X8a5~Fq>q*+dY1;sFMbCXR1;qI9M0zRm3Ju*`pm<#2k@0$-yysSC`9g9# ztE}{1msb zMx+K+9Y3X#qw_kNA`{}ZJ#g2FYw6d1N2hsOX>Wgx)nHQx5LCfC^*wk(5BwEEgDF8F z`0+mg&cTVMC`0guJI&P5yYu#zGL-h^_?6VK0HU@jKM9LzV)V2!w+r#lN{V*rC5QW; zsou$Ud{3=3kKZl7f_H5@A(*`GKPO(wW_*Y_b3QnjQlT?^8^dv%IPf>M(lmaU9v3!Z zckiZ!;)-)+g305I#&l_4@g||hfRSL5P)@jlV`E7doCE>l0$I~Q+ajB{_EdOr z+bxUN6<^n{N^-CBrk-YwSp}fQT%u#(x&3=~qV)Y1@6Nzq{3wk6G=n44WN!pPy3X)| zQ&nl9DCXuL`WO2Wm@=!x`t0h(@DG(z?$MQ{KF8k(!FX@Y8GDW}#vSdMo9%^;SD5q` zlqw44M{kuX2F_I?O`!f_CPa;?vFt;>8m2b0blNIvF4CL)YFkGDn)dPSk`K98TT=pW zviocJtXBD{x?4f^qn6dTW0*pIuw`|pT}QZTDiin#ueR{nG~16c08 zj|}g5h`hQt(l!%et?*oH*_6R82pp%2Fso;;JiUf?NSup+bJnfVoo0SzPT}L*+$BXu zSIL2T67D00>D;~jU9q`2w$27ljYD|8_6;RK+~rem*Rp7LW`JzRN&Ix*#^&aSDc-(o z>JkScUj?eR^3TBrw^Xy>)75^cjC)bX-aDb9zBLv76pB6@D(2jhv`2yck&}`dK|8of@{8f69na^RAqAeY0<1 zVuM(y7(W~M;&@_VSEB7BQT`PkDwW)#w%n**?wOE=n@)(Xw1#S(sGTe=Of~ppT~EW! zBI5RzvAr4tRBUtEXT4Ch-#H}B^(?^4jVF9K(5%aXB#Tl7V)Z2>rJH;T+6(G;a4t!E zRQ%~!B6W0i{gT2>!eEAa>7xNk*5GCp;KdF+sJ33k5yHfGbb`0IB$-L1ZbUVYBolBU z1M=dbdp^`X&-EVQg*I@)>Ql6NV|;S6uS#{!KXhIfi>COWut2}Wq?&)Fie9Fj+<{@5 z1sM+BOu|mF|J>3?xNJ$BSBAs^)R>k_m-p?UKG23@YP)lo4LXpftR;9PkjsIBfr+U0 zWnI~7!XRUjBUs%0z}JE9WWBacyM7(e7~dLF9hnPcsMGXvA;}qb7ndMHo7e_rzd+H- zY(-iu#e+Qx$%h?FkeCK2EH~hlTq1Y0Q?T(P=i2B@@kSovs49l}yjF;4&y(w2#PfnF zt`-vr2&WV{mJc|Y6#N1P$TPZ55`rqYB`0>>BugDLf{ z6MhhpY<-9T?z^!&CbFgf7R5~kroEWA3ij^di%g;({0P=?k>?V-hQ3$IB~A8IvxrV0 zX@|qIF9hd8Er1~?ch`IuH*EC2COfQtHLL%*kP zT!AltM4x5K=yI;2LRr+vSN>%7mIZliO&_<1LHoS1`b_P2}+J=)(W8l>?MmT+F}Y3o$cpw-zPwLZYhr{29Aju z)gMlELDRDI2mctQh}Y1!ADL|O-0ou5s888GbQAjbhSbA-k{kHc8;f@#luSMW%B@20 g$$`?>&lrCrp0w2LOVO^Ggx-!Y(7}~dW9Lu*7aJ(-X8-^I delta 4511 zcmV;Q5n%4_6{aJQ77GE82nGNE0O5i|r;#Bae-SoGL_t(|UhSQIh#l1##y83C-u=pE z*L61^y5>VMuF*z}V$oXBf>f|Av?`RAmbO@me+ae+tx};awtq-#X+dmD3oS^&Siuiy z5mZ#Pl^QYF7$Y%>N!(;N8*_KFyV=d%Xz#pdp4*vc=e;v?_wLPh=KaCty|X)a?%eat ze|zT4InSJFG7Q5o48t%CW06?q$9ZgCzh2_h^t8k?XU<5RJ$+gt=lav0t zXwK>C^50b_Zad5Um>K3N1Z7qa3`iUq9sR_M$BrMDWw3f+jeK_1%1&86Q7lHT*V5c9 z>y_r_WSQx1Ym?a4+$?c)a#FU#40LtLe|FwIdQ_G*va67$%*{95B+Fp;`@<3seekYC z!0SEt!V3~vv9c2KoilTDAtf$bv&Mht_|le55}(?&PvZE@jC^kA;lr}5k$r{Agp}E` zZL7pbrK&Re^cVqkGhin#??+iRtP|m4Sp>Nwys&_f4_5> zLVj%8;FnmTPzWh>=Uv~C2%yle9Xll=ryhJlLetg#_eos)mAfVO>?lfvQaEpY_lnID z!Oo-O5}^>5pWU@fV!1YyeLXNXCd(SxS7^dN51=FgEB1#+{wNU&O&!=Rao<(F5-%Tf z+q>aG(8Ce|D+E}X0J5+7e{Csn4sq=S#klqZsP&)-;9Pt2%~vI&mc#i5pjP|O z|5^lUC_e8k^@}tn;`b%U1pkyE0zFi_p66vUbhin0QLe_IUr93KGz zD*Nb>-&$_%Ip;{6J$+gf;_DN%iZ^z5M71vP|FmR3hg$spv69~_!`J?t6DalH z-FbsV@TX_?NQ|rPv|PpZSNd0~CuiJIk>6SlXtf>AGZ9ykLNGsqM4V3|i8~TH+S_Gc z4<9=w%NqGnh;s=*32u`?!K69EpGOWsAy8>EmP)d(dxooDZ)IO0f55qf76D2OCCn`a zt%bljhR@&sxoaijb5~xzQR10nA4xnNs+sjf?*hjVHk$- z|4YMK+i|VrdXb-ApPnAq2T&{?kGx{->go=Cc5-qea=kc5V^WeToLz-53ckF#AaP`5 zSV|n@I80#NM&R|df04M()>iq>zK#xAKInT@8LT&z(p{W=g~~{Y4U+#L&d~@GjFk$S zqmldbfc5$$buh)F0r!!Y zk$ru6?_OEZ$i6~7tK2a>eDrAK`QdA~-!8FHj>ZdmdSoAQe~(0d6-w%8L~X@NnWJ%$ zs3@fQ0?s)Ah2k8I4?h2zM9U!!uJszt&_JK;6i+*5*BpqgG|Jf3J|{J=OZv0RJCE^liuHZ4|lf zQ>c^{lxgo+De=_wNl|8y{0D$Xt2Os9uh&s1$ahZ9&L-{W3n`l4ez~NsV0JQM6kD6; z6x(5?csvMbqZT&fMN(I=HqYtSpPrQX&<($k$gW@p<4Bsn0l-rIy~< zA$Kk%wJLy8*KZt@eSPX}*Q(dZu0jAx;hwjNnHfG7Q5o z48t%C!!QiPsD*jGKK1V9N!nXeFS6S&2W2#$Hh{CR(B@{6J#iv>F5z0|2wte7*;6Q~ zPaE*K&Y4IB+*EO1)3`Po zz;@$2u4vO~zPU^*1VTyylpx?*e+#fPF|DH!)aq=^o6-^nCIfaa+j+#SppijJe)wvQ|S}LO!5@%+n zB_26)NTPP^2j+2zB<{{)Ci}G~Bf}btP{du6ze^DD@$h|z;ygm`< zA&}1;swf1`ztKHUwba`x3Vr?VPFY4tqxQr32esWB&p$5_GcN%ie`^KW`A4hWfGMOY zbjPKx1pyzzJ@?)t5oj|n@u<0WJ_5Do4#>Vj>xM3nxN>@#C{*0mBg?E5JUwV-!*Qaa zjmYuy@OWIv+H!uZ^uzV`y7L5_ia2k8zx>e~@MZONss&M^eBO%i$%Vd) zpPkGK1LP{^(2DC(&5uG%TrJ40?!Yk)LM4gqVZ5l-4cIjmr>7&20M0eckUrsW&lCbl zYrz1a??6d1f24C6bkN6G{B?erVyx73r3mQ7dUR0BL78>kuCIJ}Vk-2x@tGO<+@WIl znJY7Y4pV0!p_EWp|Nkr>nldPP9#h3Q4*nnK#_IHy`qbLhvfS6zE!*claVS+*CZrIEQ!4ukl?f?>(Sdro zvG`sGhI6S*Wgk6Ep)!#Q#ksNI>pAkb-$=aqhM!9WP)Zw5Vz^faAehxLtjb&b+goJ**N2A#cY<5z`B8|ES%71geQ=xuOciCY5AwZ0+n%-^^w4Hsp*SA`D+5^3 ze=0ds`OYZVVN!+2?POOW5XdD^wWJbwd_d^Ca6N5)u|iA5b7~4TY6d{$B9!44M}+4zQ7&a)p|$=@<#3X)=LU{Ouvnf` zD8@Ngrm9leS18b5CJJ5r)z8ZUXnpZ57yaktEtcoBN^K`_?+}#ApF*0m@x8zPL!x$l zQ!mdc(0Yf;$ZyE6Lg)iP&fL-~e}A4gZ%@5Fr|iFjLO2rmiq;eY_4b_d=XgELi3MzK zELI4hHjAib1U}~DJg4j}2#=~Jg9LK%>K zg+PQ-ATqaben{&%t@1sQup&%;6k^immU&L=L}GGWG{`RMo?Q5glab#B^ zI2vbXXC+QdPD;sPd}h%16970o;{HF-@9vS98h5@0R)l@r3!Qg6`wEo_l^{x<9gKYM z1N-E#p60B_coJZr1C-)9f9y@6GNKSl9v&RcS&wYY0pR5S7`YP=QH^DOes{`0dv+jn9#5H zV9#mG&CZ3@v%{SSkXz=gZxD$U;(H*>S>GV$DYU__eF}v_WG#2=f1l5jxbp$$J#DnJ z-V|bm;_fg;NjAV)AKF(?k&PDHLkV1i}D-@O0; diff --git a/Projectiles/Pets/StarSwallowerPetIdle.png b/Projectiles/Pets/StarSwallowerPetIdle.png new file mode 100644 index 0000000000000000000000000000000000000000..fd68a85ed701f82800df6ca2125e42492a3d6839 GIT binary patch literal 2478 zcmZ`*eK-?p8{b6OLDZ%bL&@0MuY)l15fvuob?{{C%b!VORK&gVXKmY(h z)$KIGONKDn{-m^9cFrGaD3t*))(hnVsO3Qakp=Q0&S+-Vm;3FMEwznOw4)v|}84x6W;yris^X#pA z{`ejhLhCDSe-!+pMM%Fo<-+@|!^Qj}^HNe2xZ&aW{AJSWYHu`M;`pEAC|e_%pw5}p zVX?j^OLya=FQ#4eTf%q>KXvBxIp4py$E_V;T<-ItqM5B*6K@qW?;`TPgcd-J3U4H2 z)n2IoW#vm$+y0cObtCfA{pRW!11j?&Ar|OLq~k^vkmVGE0OMQh@uUq>Pb{Oe?X^H4 zfT9+f*E}!))S6ge4l*je>1p6MCas&@(0)lgaza?LmZ`_u`=&8z?N@h1$Nb^S4PR1i zT>Y$f=`Hgo0jPEB1JPg_w62rZy3}k8)qzXy&n{GRAQ^dfcouFYBP2*&L2SG$GeJCZ z822+CEZz`XV{}yku0Xg_qdBF9%nxc4yI>?!B@@Wh)z(yxloXdFr-u}gMGHa=@b*;y z`FM}?(oFvDS?ztS(zB?h?AN@hQ|riALpA%}sHFRnmKhDo!`A{$>*{T9p^sWQz}P*p zaa-aM@<@IYoEWG)WZ~e+sN8;FEWFx|f1LIp zqX1&C^B3R_K!Ta0+;C1W8Y%GiN6PvvMtHOAYj81p&CbTAhueKsI@9RaYXrIWXeNfz z*PaINJ?F&2$qNWo<3M+0#S^0BhQs7nqdKg-$CeG>evwx_PpEyx*71kErYiaVQ<6H5 z!MG#AFBpsUv{y({N4JMBfi)v6LYhM`_n`f`1EatfVb}d)hrBdAODF-}6Pq)IAIW<9}WOa2Da&2}i$EPt(8eJvpb_eqbjdK=~4i9*AJA z5V%3)NA_lrL*yWaN&X8^)RgI-s7s@usAq?#YKCp({b08n!l>QgEEyX}0>4H*t@46` zv-SL+*bUe_I`!BtiUTMSd~w+1Y(x~lc=t>maS{hIVShWpd58Iq;jxH_5(CaU3t$s1{6kxvyDj+LdKUGKkYLIMNOu5kn^o%f5!HE%jkQw zz4Z7`g5z9x8qM&2d9qhdoWS1Kd(?nLmV2GQCtv_D*Ic60fPFrUy~C>=0MbtUR;~|F zBNwzS-0|O>l#Y361P+$@hEtUuR$u>f$xDOA3(B^$Jw~KdjYN%n{`|}_GS=2eS2e9% zUzeFZ&bpETP49Of3j-Yx35EIO0-}0YjN&_=9IbSJ-&Y3|DKhqw+`Lzv3vI?kPm`E& z`C&_d=$+;woH6#PQeSNB*xCBKcL+R;dJl!32Lwj5mF=t-p%GLijiL{hkBaCX@1b*n zb0vz*3n5cZ7SBLf<@!kdh1AmlT5>jQNs2qN#T6V{ ze-he&HMn~mCG+qX#0~HltPBmf82I@JnANmMa;D;hsHH%Y-yoF+6jiri5wW@a`_Y4r zY3t^Yp4^WHu!B`olp{n)BHc7jR?4UIC6{R2)qsJ&<&bOS;6(0&GOtZxg&q4PLX)qsV?wn0r`G3FUBK6iKCG_fk@E|QX{%qKk`IeGU=(K0oVf8En4=#xjcJ#O ztFat;Z;1j$>3y3%#CsV8RcB%m&q7gcU&aiZQx>ja3RReYh<-d z;v5POluC`2TpxQ}{8%~GE@Ve{0x4L-h$+8k6562*L3=O*7pfop2>5|06mSgbv zrMPzvqs*S{e(Uu4l@DbORmuWwt=khDtiJv07l;F@^8@yiPrmAO%(x48J1Hur7f7X( zpS~p?HLY&kt)-)@vb|-oAWGYGaw7M%22Z!@!66+?Ra(oA!`+zo&P5v@M>az~z1dRag$!(ZNi*d1vGd8|($;b2xsV*Gor z9Q~fy-;-L)^?%A0&EDqxfY4T~?&6`NnsgXP6L#$=oT!hY1+@6Zb@?u?>c9_@Za=9$ zvUjHCpPBFr+DvR$o+wl^dhhxS5N}B5?$~i*ZjRhf#gZtMtMibID=p2ye>p4`KTcw{ z-TckV0nuteRuE;wO9NXl+ETF*8I>yCKKGZTS>s=UI=yn-$POSgh>6A^2J0cN-+7vG zaq(w0oWMv6W&{BW)Nm?%;m4a%n#>bma zqKNO6`m%gM$<=_G(WNtyOwJaq8=LTM`nj5j5*g+gI--WlL*OY5=|cu|9Y%%rsB?Jp z|G5yhPfePA&i_&2$9~J?iJgvB5SXcFnnSVvHk-e*qF)w>SU* literal 0 HcmV?d00001 From 7d4d0701c43a137edc5b8da16e8dd96f13e91c72 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 15 Mar 2026 00:15:25 -0500 Subject: [PATCH 36/46] see #bosses Message Link: https://discord.com/channels/458428222061936650/458430366139678742/1482606762874900480 --- .../Mods.CalamityMod.Projectiles.Boss.hjson | 2 + NPCs/Providence/Providence.cs | 21 +- Projectiles/Boss/HolyBlast.cs | 5 +- Projectiles/Boss/HolyBlastFrags.cs | 187 ++++++++++++++ Projectiles/Boss/HolyBomb.cs | 3 + Projectiles/Boss/HolyFire2.cs | 63 ++++- Projectiles/Boss/LingeringHolyInferno.cs | 238 ++++++++++++++++++ Projectiles/Boss/MoltenBlast.cs | 3 +- Projectiles/Boss/MoltenBlob.cs | 5 +- 9 files changed, 519 insertions(+), 8 deletions(-) create mode 100644 Projectiles/Boss/HolyBlastFrags.cs create mode 100644 Projectiles/Boss/LingeringHolyInferno.cs diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index 80ab9a0ac6..2c0f14ed7d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -87,6 +87,7 @@ HellfireExplosion.DisplayName: Brimstone Hellfire Explosion HiveBombGoliath.DisplayName: Hive Bomb HolyAura.DisplayName: Holy Aura HolyBlast.DisplayName: Holy Blast +HolyBlastFrags.DisplayName: Holy Blast Frag HolyBomb.DisplayName: Holy Bomb HolyBurnOrb.DisplayName: Holy Orb HolyExplosionBoom.DisplayName: Holy Explosion @@ -107,6 +108,7 @@ Infernado.DisplayName: Infernado Infernado2.DisplayName: Infernado InfernadoRevenge.DisplayName: Infernado JewelProjectile.DisplayName: Ruby Bolt +LingeringHolyInferno.DisplayName: Lingering Holy Inferno LeviathanBomb.DisplayName: Meteor Vomit LeviathanSpawner.DisplayName: Spawner MajesticSparkle.DisplayName: Majestic Sparkle diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 5005f77496..30a8bc1ed6 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1418,6 +1418,15 @@ namespace CalamityMod.NPCs.Providence } } + float shorterFlameCocoonDistance = 2800f - ((CalamityWorld.death || NPC.localAI[1] == (float)BossMode.Enraged) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f); + if (attackerAlive || defenderAlive || healerAlive) + shorterFlameCocoonDistance = 2800f; + if (Main.netMode != NetmodeID.MultiplayerClient) + for (var i = 0; i < 100; i++) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + new Vector2(Main.rand.NextFloat(shorterFlameCocoonDistance, shorterFlameCocoonDistance + (death? 1000 : 500)), 0).RotatedBy(MathHelper.TwoPi * i / 100f + Main.rand.NextFloat(-0.0025f,0.0025f)), Vector2.Zero, ModContent.ProjectileType(), BlobDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, NPC.Center.X, NPC.Center.Y, shorterFlameCocoonDistance); + } + text = false; AIState = (int)Phase.PhaseChange; NPC.localAI[2] = attackDelayAfterCocoon; @@ -1596,6 +1605,16 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; if (NPC.ai[3] >= phaseTime) { + + float shorterSpearCocoonDistance = 2800f - ((CalamityWorld.death || NPC.localAI[1] == (float)BossMode.Enraged) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f); + if (attackerAlive || defenderAlive || healerAlive) + shorterSpearCocoonDistance = 2800f; + if (Main.netMode != NetmodeID.MultiplayerClient) + for (var i = 0; i < 100; i++) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + new Vector2(Main.rand.NextFloat(shorterSpearCocoonDistance, shorterSpearCocoonDistance + (death ? 1000 : 500)),0).RotatedBy(MathHelper.TwoPi * i/100f + Main.rand.NextFloat(-0.0025f, 0.0025f)), Vector2.Zero, ModContent.ProjectileType(), BlobDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, NPC.Center.X,NPC.Center.Y, shorterSpearCocoonDistance); + } + AIState = (int)Phase.PhaseChange; NPC.localAI[2] = attackDelayAfterCocoon; NPC.TargetClosest(); @@ -1930,7 +1949,7 @@ namespace CalamityMod.NPCs.Providence Projectile projectile = Main.projectile[x]; if (projectile.active) { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.Kill(); else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.active = false; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index e1190825cb..3abbfc578f 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = TimeLeft; CooldownSlot = ImmunityCooldownID.Bosses; + Projectile.scale = 0; } public override void OnSpawn(IEntitySource source) @@ -66,6 +67,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (Projectile.scale < 1) + Projectile.scale += 0.05f; ProvUtils.ApplyGFBDamage(Projectile, 180, 20); Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f); @@ -162,7 +165,7 @@ namespace CalamityMod.Projectiles.Boss totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); float velocity = 5f; Vector2 spinningPoint = new Vector2(0f, -velocity); Vector2 additionalVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f; diff --git a/Projectiles/Boss/HolyBlastFrags.cs b/Projectiles/Boss/HolyBlastFrags.cs new file mode 100644 index 0000000000..16c01fc3a1 --- /dev/null +++ b/Projectiles/Boss/HolyBlastFrags.cs @@ -0,0 +1,187 @@ +using System; +using System.Linq; +using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs.Providence; +using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class HolyBlastFrags : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire2"; + + public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + Main.projFrames[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.width = 26; + Projectile.height = 26; + Projectile.hostile = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = 600; + CooldownSlot = ImmunityCooldownID.Bosses; + } + + public override void AI() + { + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); + + Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); + + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + float maxVelocity = Projectile.ai[0] == 0f ? 7f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; + if (Math.Abs(Projectile.velocity.X) < maxVelocity) + Projectile.velocity.X *= 1.05f; + + int playerTracker = Player.FindClosest(Projectile.Center, 1, 1); + + Projectile.ai[1] += 1f; + if (Projectile.ai[1] < 180f && Projectile.ai[1] > 60f) + { + float projVelocityMult = Projectile.velocity.Length(); + Vector2 playerDirection = Main.player[playerTracker].Center - Projectile.Center; + playerDirection.Normalize(); + playerDirection *= projVelocityMult; + float inertia = !ProvUtils.StandardAI() ? 20f : 25f; + Projectile.velocity = (Projectile.velocity * (inertia - 1f) + playerDirection) / inertia; + Projectile.velocity.Normalize(); + Projectile.velocity *= projVelocityMult; + } + + float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f); + + if (Projectile.timeLeft % 3 == 0) + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); + + if (Main.rand.NextBool()) + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); + + Projectile.rotation = MathHelper.Lerp(0f, MathHelper.WrapAngle(Vector2.Zero.AngleTo(Projectile.velocity) + MathHelper.ToRadians(-90f)), Math.Clamp(vel, 0f, 1f)); + } + + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(lightColor); + + public override bool PreDraw(ref Color lightColor) + { + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(12).ToList(); + + list.Insert(0, Projectile.position + (Projectile.rotation+MathHelper.PiOver2 * Projectile.spriteDirection).ToRotationVector2() * 16f); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int framing = texture.Height / Main.projFrames[Type]; + int y6 = framing * Projectile.frame; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + Projectile.position.X = Projectile.position.X + (Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y + (Projectile.height / 2); + Projectile.width = 40; + Projectile.height = 40; + Projectile.position.X = Projectile.position.X - (Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); + int dustType = ProvUtils.GetDustID(); + for (int i = 0; i < 5; i++) + { + int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[holyDust].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[holyDust].scale = 0.5f; + Main.dust[holyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int j = 0; j < 10; j++) + { + int holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 3f); + Main.dust[holyDust2].noGravity = true; + holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[holyDust2].noGravity = true; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + // If the player is dodging, don't apply debuffs + if (info.Damage <= 0 || target.creativeGodMode) + return; + + ProvUtils.ApplyDebuffs(target, 120); + } + } +} diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 33bbb2ddf3..8222ad36d4 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.tileCollide = false; CooldownSlot = ImmunityCooldownID.Bosses; + Projectile.scale = 0; } public override void OnSpawn(IEntitySource source) @@ -46,6 +47,8 @@ namespace CalamityMod.Projectiles.Boss } public override void AI() { + if (Projectile.scale < 1) + Projectile.scale += 0.1f; ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 8cfcd2206d..ca2de7a011 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -1,11 +1,16 @@ using System; +using System.Linq; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -30,10 +35,16 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = 600; CooldownSlot = ImmunityCooldownID.Bosses; + + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void AI() { + + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -68,7 +79,8 @@ namespace CalamityMod.Projectiles.Boss float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f); - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); + if (Projectile.timeLeft % 3 == 0) + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); if (Main.rand.NextBool()) GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); @@ -80,6 +92,30 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(8).ToList(); + + list.Insert(0, Projectile.position + (Projectile.rotation + MathHelper.PiOver2 * Projectile.spriteDirection).ToRotationVector2() * 16f); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; @@ -87,6 +123,31 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 16f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Boss/LingeringHolyInferno.cs b/Projectiles/Boss/LingeringHolyInferno.cs new file mode 100644 index 0000000000..867538eea1 --- /dev/null +++ b/Projectiles/Boss/LingeringHolyInferno.cs @@ -0,0 +1,238 @@ +using System; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs.Providence; +using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.NPCs.Providence.Providence; + +namespace CalamityMod.Projectiles.Boss +{ + public class LingeringHolyInferno : ModProjectile, ILocalizedModType + { + bool started = false; + public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() + { + Projectile.localAI[1] = Main.rand.NextFloat(30f); + Projectile.width = Projectile.height = 32; + Projectile.hostile = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.alpha = 0; + CooldownSlot = ImmunityCooldownID.Bosses; + Projectile.penetrate = 1; + Projectile.timeLeft = CalamityUtils.MinutesToFrames(2); + Projectile.Calamity().DealsDefenseDamage = true; + Projectile.MaxUpdates = 2; + } + Vector2 OrbitPos = new(); + public override void AI() + { + ProvUtils.ApplyGFBDamage(Projectile, 120, 50); + + Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); + + if (!started) + { + started = true; + OrbitPos = new Vector2(Projectile.ai[0], Projectile.ai[1]); + Projectile.ai[0] = OrbitPos.DirectionTo(Projectile.Center).ToRotation(); + Projectile.ai[1] = OrbitPos.Distance(Projectile.Center); + + } + + Projectile.ai[0] += (Projectile.ai[1] - (Projectile.ai[2]-1000)) * 0.0000025f * (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 2 : 1); + + Projectile.Center = OrbitPos + Projectile.ai[0].ToRotationVector2() * Projectile.ai[1]; + + Projectile.position.X = MathHelper.Clamp(Projectile.position.X, 5, (Main.maxTilesX - 5) * 16); + Projectile.position.Y = MathHelper.Clamp(Projectile.position.Y, 5, (Main.maxTilesY - 5) * 16); + Projectile.localAI[1] += 0.1f; + } + + public override bool PreDraw(ref Color lightColor) + { + float totalOpacity = MathHelper.Clamp(1-(Projectile.Distance(Main.LocalPlayer.Center) - 600) / 80f, 0.5f, 1f); + if (totalOpacity == 0) + return false; + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using var mainLease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth, + Main.screenHeight, + RenderTargetDescriptor.Default + ); + + using (mainLease.Scope(clearColor: Color.Transparent)) + { + + using (lease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + + Vector2[] fireCoreLength = Projectile.oldPos.Take(8).ToArray(); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + + float lerpMult = MathHelper.Lerp(0.5f, 1f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; + Color baseColor2 = ProvUtils.GetProjectileColor(255); + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + + + scale = new Vector2(1f, 1f); + texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, baseColor2, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White * totalOpacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); + return false; + } + + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255,true) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 24; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); + Color particleColor = ProvUtils.GetProjectileColor(0); + Color smokeColor = Color.Lerp(particleColor, Color.DarkSlateGray, 0.5f); + Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.06f, 18); + GeneralParticleHandler.SpawnParticle(pulse); + for (int i = 0; i < 7; i++) + { + Particle smoke = new HeavySmokeParticle(Projectile.Center, (Vector2.UnitX).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(7f), smokeColor, 30, Main.rand.NextFloat(0.6f, 1f), 0.5f, Main.rand.NextFloat(-0.03f, 0.03f), true); + GeneralParticleHandler.SpawnParticle(smoke); + } + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Vector2.UnitX).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(1.8f, 10f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1f, 1.8f); + dust.color = particleColor; + dust.noLightEmittence = true; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(ModContent.BuffType(), 180); + } + } +} diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 3ba0c09874..c5a137939a 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -161,10 +161,11 @@ namespace CalamityMod.Projectiles.Boss int blobAmt = !ProvUtils.StandardAI() ? 9 : 6; if (Projectile.owner == Main.myPlayer) { - Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X * 0.1f, Projectile.velocity.Y); + Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X, Projectile.velocity.Y); for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; + velocity.Y = -Math.Abs(velocity.Y); if (Main.getGoodWorld) velocity *= 2f; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index e74a89430b..8a3f8a176c 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 12; Projectile.hostile = true; Projectile.penetrate = -1; - Projectile.timeLeft = 900; + Projectile.timeLeft = 120; Projectile.scale = 1.5f; CooldownSlot = ImmunityCooldownID.Bosses; } @@ -65,9 +65,6 @@ namespace CalamityMod.Projectiles.Boss { if (!inLava) { - if (Projectile.velocity.Y < 0f) - Projectile.velocity.Y = 0f; - Projectile.velocity.Y += 0.15f; } } From 715ba8e59518fc70bdfa0b485ddb8ea5776b8445 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sun, 15 Mar 2026 00:59:58 -0500 Subject: [PATCH 37/46] projectiles now despawn with provi --- NPCs/Providence/Providence.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 30a8bc1ed6..60de9e3c0e 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -364,6 +364,10 @@ namespace CalamityMod.NPCs.Providence public override void AI() { + //ensure projectiles all despawn when she does + if (NPC.timeLeft == 1) + DespawnSpecificProjectiles(true); + // Set the border drawing to true if it isn't set to true // Can happen when another mod sets to false for a difficulty and that difficulty is then toggled off. shouldDrawInfernoBorder = true; From 5f3475eec9b6e4d9c0d0d42a73cb6576e3b10595 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Fri, 20 Mar 2026 14:50:29 -0500 Subject: [PATCH 38/46] Further adjustments - Removed Lingering Holy Inferno and replaced it with Holy Inferno centerpoint being fixed on provi center once a cocoon happens, and remaining there till next cocoon - Made Holy Inferno always visible when on screen, but at low opacity until close - Replaced the old cocoon orb particle trails with better looking primtrails - Made cocoons alternate between clockwise and counter-clockwise --- NPCs/Providence/Providence.cs | 52 +++-- Projectiles/Boss/HolyBurnOrb.cs | 170 ++++++++++++---- Projectiles/Boss/HolyLight.cs | 163 +++++++++++++--- Projectiles/Boss/LingeringHolyInferno.cs | 238 ----------------------- 4 files changed, 292 insertions(+), 331 deletions(-) delete mode 100644 Projectiles/Boss/LingeringHolyInferno.cs diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 60de9e3c0e..086c1d6a9d 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -98,6 +98,9 @@ namespace CalamityMod.NPCs.Providence public bool Dying = false; public int DeathAnimationTimer; public static float borderRadius = 3000f; + int spearDir = 1; + int starDir = 1; + public Vector2? borderPosition = null; // Sounds public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceSpawn") { Volume = 1.2f }; @@ -324,6 +327,7 @@ namespace CalamityMod.NPCs.Providence writer.Write((Half)SoundWarningLevel); writer.Write(DeathAnimationTimer); writer.Write(borderRadius); + writer.WriteVector2(borderPosition ?? Vector2.Zero); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } @@ -353,6 +357,9 @@ namespace CalamityMod.NPCs.Providence SoundWarningLevel = (float)reader.ReadHalf(); DeathAnimationTimer = reader.ReadInt32(); borderRadius = reader.ReadSingle(); + borderPosition = reader.ReadVector2(); + if (borderPosition == Vector2.Zero) + borderPosition = null; for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); @@ -1250,6 +1257,8 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.FlameCocoon: + borderPosition ??= NPC.Center; + borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30); if (!targetDead && !getFuckedAI) { @@ -1283,7 +1292,7 @@ namespace CalamityMod.NPCs.Providence Vector2 spinningPoint = normalSpread ? new Vector2(0f, -cocoonProjVelocity) : new Vector2(-velocityX, -cocoonProjVelocity); for (int i = 0; i < chains; i++) { - Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2])); + Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2]) * starDir); if (Main.rand.NextBool(healingStarChance) && !death) { @@ -1422,16 +1431,8 @@ namespace CalamityMod.NPCs.Providence } } - float shorterFlameCocoonDistance = 2800f - ((CalamityWorld.death || NPC.localAI[1] == (float)BossMode.Enraged) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f); - if (attackerAlive || defenderAlive || healerAlive) - shorterFlameCocoonDistance = 2800f; - if (Main.netMode != NetmodeID.MultiplayerClient) - for (var i = 0; i < 100; i++) - { - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + new Vector2(Main.rand.NextFloat(shorterFlameCocoonDistance, shorterFlameCocoonDistance + (death? 1000 : 500)), 0).RotatedBy(MathHelper.TwoPi * i / 100f + Main.rand.NextFloat(-0.0025f,0.0025f)), Vector2.Zero, ModContent.ProjectileType(), BlobDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, NPC.Center.X, NPC.Center.Y, shorterFlameCocoonDistance); - } - text = false; + starDir *= -1; AIState = (int)Phase.PhaseChange; NPC.localAI[2] = attackDelayAfterCocoon; NPC.TargetClosest(); @@ -1528,6 +1529,10 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.SpearCocoon: + + borderPosition ??= NPC.Center; + borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); + if (!targetDead && !getFuckedAI) { if (NPC.velocity.Length() <= 2f) @@ -1583,7 +1588,7 @@ namespace CalamityMod.NPCs.Providence spearRateIncrease = 1f; float radialOffset = MathHelper.Lerp(0.2f, 0.4f, spearRateIncrease); - calamityGlobalNPC.newAI[1] += radialOffset; + calamityGlobalNPC.newAI[1] += radialOffset * spearDir; } calamityGlobalNPC.newAI[2] += 1f; @@ -1610,16 +1615,8 @@ namespace CalamityMod.NPCs.Providence if (NPC.ai[3] >= phaseTime) { - float shorterSpearCocoonDistance = 2800f - ((CalamityWorld.death || NPC.localAI[1] == (float)BossMode.Enraged) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f); - if (attackerAlive || defenderAlive || healerAlive) - shorterSpearCocoonDistance = 2800f; - if (Main.netMode != NetmodeID.MultiplayerClient) - for (var i = 0; i < 100; i++) - { - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + new Vector2(Main.rand.NextFloat(shorterSpearCocoonDistance, shorterSpearCocoonDistance + (death ? 1000 : 500)),0).RotatedBy(MathHelper.TwoPi * i/100f + Main.rand.NextFloat(-0.0025f, 0.0025f)), Vector2.Zero, ModContent.ProjectileType(), BlobDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, NPC.Center.X,NPC.Center.Y, shorterSpearCocoonDistance); - } - AIState = (int)Phase.PhaseChange; + spearDir *= -1; NPC.localAI[2] = attackDelayAfterCocoon; NPC.TargetClosest(); } @@ -1898,7 +1895,7 @@ namespace CalamityMod.NPCs.Providence public float CalculateBurnIntensity(float attackDelayAfterCocoon = 1f) { - float distanceToTarget = Vector2.Distance(Main.player[NPC.target].Center, NPC.Center); + float distanceToTarget = Vector2.Distance(Main.player[NPC.target].Center, borderPosition ?? NPC.Center); float aiTimer = NPC.ai[3]; // This bool is only relevant for non-Zenith enraged AI @@ -1907,7 +1904,7 @@ namespace CalamityMod.NPCs.Providence float baseDistance = 2800f; float shorterFlameCocoonDistance = (CalamityWorld.death || fullPower) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterSpearCocoonDistance = (CalamityWorld.death || fullPower) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; - float shorterDistance = AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; + float shorterDistance = baseDistance - (AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance); bool guardianAlive = false; if (CalamityGlobalNPC.holyBossAttacker != -1 && Main.npc[CalamityGlobalNPC.holyBossAttacker].active) @@ -1930,11 +1927,10 @@ namespace CalamityMod.NPCs.Providence // Distance does not get shorter if in GFB / Guardians are alive if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Rainbow) { - maxDistance = baseDistance; if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) - maxDistance -= shorterDistance * shorterDistanceFade; + maxDistance = MathHelper.Lerp(baseDistance, shorterDistance, shorterDistanceFade); else if (attackDelayAfterCocoon > 1f) - maxDistance -= shorterDistance * (NPC.localAI[2] / attackDelayAfterCocoon); + maxDistance = MathHelper.Lerp(baseDistance, shorterDistance, (NPC.localAI[2] / attackDelayAfterCocoon)); } float drawFireDistanceStart = maxDistance - 800f; @@ -1953,7 +1949,7 @@ namespace CalamityMod.NPCs.Providence Projectile projectile = Main.projectile[x]; if (projectile.active) { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.Kill(); else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.active = false; @@ -2589,10 +2585,10 @@ namespace CalamityMod.NPCs.Providence shader.Parameters["colorMult"].SetValue(prov.hasBeenGivenFullPower ? 7.65f : 7.35f); //I want you to know it took considerable restraint to deliberately misspell colour. shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); shader.Parameters["radius"].SetValue(borderDistance); - shader.Parameters["anchorPoint"].SetValue(npc.Center); + shader.Parameters["anchorPoint"].SetValue(prov.borderPosition ?? npc.Center); shader.Parameters["screenPosition"].SetValue(Main.screenPosition); shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2()); - shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity); + shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity*0.5f + 0.5f); shader.Parameters["playerPosition"].SetValue(target.Center); shader.Parameters["maxOpacity"].SetValue(maxOpacity); shader.Parameters["day"].SetValue(!prov.hasBeenGivenFullPower); diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index cddfda4371..50e2f81e2b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -1,11 +1,16 @@ using System; +using System.Linq; using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +22,11 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + } public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -24,7 +34,6 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.alpha = 255; CooldownSlot = ImmunityCooldownID.Bosses; Projectile.penetrate = 1; Projectile.timeLeft = 200; @@ -68,50 +77,141 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= 1.01f; Projectile.localAI[1] += (Projectile.velocity.Length() / 20); - - Color col = ProvUtils.GetProjectileColor(255); - float vel = MathHelper.Clamp(Projectile.velocity.Length() / 5, 0, 1.5f); - GlowOrbParticle p = new GlowOrbParticle(Projectile.Center, Projectile.velocity + new Vector2(Main.rand.NextFloat(vel * 2), 0).RotatedByRandom(MathHelper.TwoPi), false, 4, 1f, col); - GeneralParticleHandler.SpawnParticle(p); - //Trail for visibilty - GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center + Projectile.velocity, Vector2.Zero, col, "CalamityMod/Particles/BlastCone", new Vector2(3f, 2f), Vector2.Zero.AngleFrom(Projectile.velocity), 1f, 0f, 3)); } public override bool PreDraw(ref Color lightColor) { - float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; - Color baseColor2 = ProvUtils.GetProjectileColor(255); - baseColor.A = 0; - baseColor *= lerpMult; - baseColor2 *= lerpMult; - Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult-1)*0.5f + 1f); + Projectile.Opacity = 1; + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using var mainLease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth, + Main.screenHeight, + RenderTargetDescriptor.Default + ); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + using (mainLease.Scope(clearColor: Color.Transparent)) + { - Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + using (lease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(5).ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); - float upRight = MathHelper.PiOver4; - float up = MathHelper.PiOver2; - float upLeft = 3f * MathHelper.PiOver4; - float left = MathHelper.Pi; - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Vector2[] fireCoreLength = Projectile.oldPos.Take(5).ToArray(); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); + } + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + + float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; + Color baseColor2 = ProvUtils.GetProjectileColor(255); + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + + scale = new Vector2(1f, 1f); + texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, baseColor2, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255, true) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 24; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index d59abcff35..2cecc9803e 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,12 +1,17 @@ using System; +using System.Linq; using CalamityMod.Dusts; using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +22,11 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + } public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -71,54 +81,147 @@ namespace CalamityMod.Projectiles.Boss NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, index, healAmt); Projectile.Kill(); } - - Color col = new Color(54, 209, 54); - Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.8f, false, 5, 0.06f, col * 0.85f, new Vector2(1, 0.3f), true, false, 1.5f); - GeneralParticleHandler.SpawnParticle(spark); } public override bool PreDraw(ref Color lightColor) { - float vel = Projectile.velocity.Length() / 8; - Projectile.localAI[1] += vel; + Projectile.Opacity = 1; + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using var mainLease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth, + Main.screenHeight, + RenderTargetDescriptor.Default + ); - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Color brightGreen = new Color(54, 209, 54, 0); - Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Vector2 halfTextureSize = drawTexture.Size() / 2f; - Color halfBrightGreen = brightGreen * 0.5f; - float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); - Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; - Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; - brightGreen *= timeLeftColorScale; - halfBrightGreen *= timeLeftColorScale; + using (mainLease.Scope(clearColor: Color.Transparent)) + { - Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + using (lease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(13).ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + Vector2[] fireCoreLength = Projectile.oldPos.Take(13).ToArray(); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); + } - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + float vel = Projectile.velocity.Length() / 8; + Projectile.localAI[1] += vel; + + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Color brightGreen = new Color(54, 209, 54, 0); + Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 halfTextureSize = drawTexture.Size() / 2f; + Color halfBrightGreen = brightGreen * 0.5f; + float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); + Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; + Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; + brightGreen *= timeLeftColorScale; + halfBrightGreen *= timeLeftColorScale; + + Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + var scale = new Vector2(1f, 1f); + var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54), 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = new Color(54, 209, 54) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 24; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = new Color(54, 209, 54); + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Pitch = -0.3f, Volume = 0.7f }, Projectile.Center); SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/PlantyMushMine", 3); SoundEngine.PlaySound(fireHeal with { Volume = 0.5f, Pitch = 0.3f }, Projectile.Center); - Color particleColor = new Color(54, 209, 54); + Color particleColor = new Color(54, 209, 54); Color smokeColor = Color.Lerp(particleColor, Color.DarkSlateGray, 0.5f); Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.06f, 18); GeneralParticleHandler.SpawnParticle(pulse); diff --git a/Projectiles/Boss/LingeringHolyInferno.cs b/Projectiles/Boss/LingeringHolyInferno.cs deleted file mode 100644 index 867538eea1..0000000000 --- a/Projectiles/Boss/LingeringHolyInferno.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System; -using System.Linq; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Graphics.Primitives; -using CalamityMod.NPCs.Providence; -using CalamityMod.Particles; -using CalamityMod.Utilities.Daybreak; -using CalamityMod.Utilities.Daybreak.Buffers; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; -using static CalamityMod.NPCs.Providence.Providence; - -namespace CalamityMod.Projectiles.Boss -{ - public class LingeringHolyInferno : ModProjectile, ILocalizedModType - { - bool started = false; - public new string LocalizationCategory => "Projectiles.Boss"; - public override string Texture => "CalamityMod/Projectiles/StarProj"; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 15; - ProjectileID.Sets.TrailingMode[Type] = 2; - } - public override void SetDefaults() - { - Projectile.localAI[1] = Main.rand.NextFloat(30f); - Projectile.width = Projectile.height = 32; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.alpha = 0; - CooldownSlot = ImmunityCooldownID.Bosses; - Projectile.penetrate = 1; - Projectile.timeLeft = CalamityUtils.MinutesToFrames(2); - Projectile.Calamity().DealsDefenseDamage = true; - Projectile.MaxUpdates = 2; - } - Vector2 OrbitPos = new(); - public override void AI() - { - ProvUtils.ApplyGFBDamage(Projectile, 120, 50); - - Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); - - if (!started) - { - started = true; - OrbitPos = new Vector2(Projectile.ai[0], Projectile.ai[1]); - Projectile.ai[0] = OrbitPos.DirectionTo(Projectile.Center).ToRotation(); - Projectile.ai[1] = OrbitPos.Distance(Projectile.Center); - - } - - Projectile.ai[0] += (Projectile.ai[1] - (Projectile.ai[2]-1000)) * 0.0000025f * (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 2 : 1); - - Projectile.Center = OrbitPos + Projectile.ai[0].ToRotationVector2() * Projectile.ai[1]; - - Projectile.position.X = MathHelper.Clamp(Projectile.position.X, 5, (Main.maxTilesX - 5) * 16); - Projectile.position.Y = MathHelper.Clamp(Projectile.position.Y, 5, (Main.maxTilesY - 5) * 16); - Projectile.localAI[1] += 0.1f; - } - - public override bool PreDraw(ref Color lightColor) - { - float totalOpacity = MathHelper.Clamp(1-(Projectile.Distance(Main.LocalPlayer.Center) - 600) / 80f, 0.5f, 1f); - if (totalOpacity == 0) - return false; - - Main.spriteBatch.End(out var ss); - var device = Main.instance.GraphicsDevice; - using var lease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth / 2, - Main.screenHeight / 2, - RenderTargetDescriptor.Default - ); - using var mainLease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth, - Main.screenHeight, - RenderTargetDescriptor.Default - ); - - using (mainLease.Scope(clearColor: Color.Transparent)) - { - - using (lease.Scope(clearColor: Color.Transparent)) - { - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); - - Vector2[] fireCoreLength = Projectile.oldPos.Take(8).ToArray(); - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); - PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); - } - - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); - Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); - - - float lerpMult = MathHelper.Lerp(0.5f, 1f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; - Color baseColor2 = ProvUtils.GetProjectileColor(255); - baseColor.A = 0; - baseColor *= lerpMult; - baseColor2 *= lerpMult; - Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); - - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); - - float upRight = MathHelper.PiOver4; - float up = MathHelper.PiOver2; - float upLeft = 3f * MathHelper.PiOver4; - float left = MathHelper.Pi; - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - - - scale = new Vector2(1f, 1f); - texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; - using (Main.spriteBatch.Scope()) - { - - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, baseColor2, 0, texture.Size() * 0.5f, 1f, 0, 0f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); - Main.spriteBatch.End(); - } - Main.spriteBatch.End(); - } - - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); - Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White * totalOpacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(ss); - return false; - } - - public float FireWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = 38f * Projectile.scale; - float curveRatio = 0.2f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - // Crop the tip of the trail into a conic shape. - if (completion < curveRatio) - width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - - // Pulse inwards and outwards over time. - float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; - float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); - return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255,true) * 1.3f; - Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; - } - - public float FireCoreWidthFunction(float completion, Vector2 pos) - { - float width; - float maxBodyWidth = Projectile.scale * 24; - float curveRatio = 0.25f; - var positions = Projectile.oldPos.ToList(); - positions.RemoveAll(x => x == Vector2.Zero); - - if (completion < curveRatio) - width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; - else - width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); - return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; - } - - public Color FireCoreColorFunction(float completion, Vector2 pos) - { - Color mainColor = ProvUtils.GetProjectileColor(255); - Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); - Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); - return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - Color particleColor = ProvUtils.GetProjectileColor(0); - Color smokeColor = Color.Lerp(particleColor, Color.DarkSlateGray, 0.5f); - Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.06f, 18); - GeneralParticleHandler.SpawnParticle(pulse); - for (int i = 0; i < 7; i++) - { - Particle smoke = new HeavySmokeParticle(Projectile.Center, (Vector2.UnitX).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(7f), smokeColor, 30, Main.rand.NextFloat(0.6f, 1f), 0.5f, Main.rand.NextFloat(-0.03f, 0.03f), true); - GeneralParticleHandler.SpawnParticle(smoke); - } - for (int i = 0; i < 8; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), (Vector2.UnitX).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(1.8f, 10f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(1f, 1.8f); - dust.color = particleColor; - dust.noLightEmittence = true; - } - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - } - } -} From 45b68054b5d24d50d9c906cc287fb5c5f965c329 Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Fri, 3 Apr 2026 13:49:29 -0500 Subject: [PATCH 39/46] Final Cleanup - Ready To Merge --- Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson | 1 - 1 file changed, 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index 2c0f14ed7d..33b2507e6c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -108,7 +108,6 @@ Infernado.DisplayName: Infernado Infernado2.DisplayName: Infernado InfernadoRevenge.DisplayName: Infernado JewelProjectile.DisplayName: Ruby Bolt -LingeringHolyInferno.DisplayName: Lingering Holy Inferno LeviathanBomb.DisplayName: Meteor Vomit LeviathanSpawner.DisplayName: Spawner MajesticSparkle.DisplayName: Majestic Sparkle From 1343875dea2cb581b5a839e9ed24a1035fa1bc9d Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sat, 11 Apr 2026 12:20:59 -0400 Subject: [PATCH 40/46] Fix holy blast fragment localized projectile name --- Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index 33b2507e6c..927a547bf4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -87,7 +87,7 @@ HellfireExplosion.DisplayName: Brimstone Hellfire Explosion HiveBombGoliath.DisplayName: Hive Bomb HolyAura.DisplayName: Holy Aura HolyBlast.DisplayName: Holy Blast -HolyBlastFrags.DisplayName: Holy Blast Frag +HolyBlastFrags.DisplayName: Holy Blast Fragment HolyBomb.DisplayName: Holy Bomb HolyBurnOrb.DisplayName: Holy Orb HolyExplosionBoom.DisplayName: Holy Explosion From 6401a5c45b23e9eea85dd34a410145240cb2393a Mon Sep 17 00:00:00 2001 From: doze-zoze Date: Sat, 11 Apr 2026 14:39:55 -0500 Subject: [PATCH 41/46] star refactor --- NPCs/Providence/Providence.cs | 9 +++ Projectiles/Boss/HolyBurnOrb.cs | 102 +++++++++++++++++--------------- Projectiles/Boss/HolyLight.cs | 74 +++++++++++------------ 3 files changed, 97 insertions(+), 88 deletions(-) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 086c1d6a9d..39a7dc5f10 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -32,6 +32,7 @@ using CalamityMod.Systems.Graphic; using CalamityMod.Tiles.Ores; using CalamityMod.Utilities; using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -2885,6 +2886,14 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { + /// + /// This lease should be used to draw all of a projectile's effects onto directly, then be drawn onto the screen as one. This is for opacity reasons + /// + public static RenderTargetLease PrimaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } + /// + /// This should be used for secondary effects like trails, then drawn to PrimaryLease. This is for opacity reasons. + /// + public static RenderTargetLease SecondaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; public static int CalculateProvidenceDamage(this int damage) diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 50e2f81e2b..1b5bd9cb67 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailCacheLength[Type] = 32; ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 200; Projectile.Calamity().DealsDefenseDamage = true; + Projectile.MaxUpdates = 4; } public override void AI() @@ -53,66 +54,69 @@ namespace CalamityMod.Projectiles.Boss started = true; } - if (Projectile.ai[0] < 240f) + if (Projectile.FinalExtraUpdate()) { - Projectile.ai[0] += 1f; + if (Projectile.ai[0] < 240f) + { + Projectile.ai[0] += 1f; - if (Projectile.timeLeft < 160) - Projectile.timeLeft = 160; + if (Projectile.timeLeft < 160) + Projectile.timeLeft = 160; + } + + if (Main.getGoodWorld) + { + if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) + { + Projectile.velocity *= 1.02f; + } + else + { + Projectile.ai[1] += 0.05f; + Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); + } + } + else if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; + + Projectile.localAI[1] += (Projectile.velocity.Length() / 20); } - if (Main.getGoodWorld) - { - if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) - { - Projectile.velocity *= 1.02f; - } - else - { - Projectile.ai[1] += 0.05f; - Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); - } - } - else if (Projectile.velocity.Length() < 16f) - Projectile.velocity *= 1.01f; - - Projectile.localAI[1] += (Projectile.velocity.Length() / 20); + Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); } public override bool PreDraw(ref Color lightColor) { - Projectile.Opacity = 1; Main.spriteBatch.End(out var ss); var device = Main.instance.GraphicsDevice; - using var lease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth / 2, - Main.screenHeight / 2, - RenderTargetDescriptor.Default - ); - using var mainLease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth, - Main.screenHeight, - RenderTargetDescriptor.Default - ); - using (mainLease.Scope(clearColor: Color.Transparent)) + using (Main.spriteBatch.Scope()) + { + using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); + var len = Math.Min(Projectile.oldPos.Length, 32); + for (var i = 0; i < len; i++) + { + Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size*0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color color = FireColorFunction(i / (float)len, Projectile.oldPos[i]); + var color2 = ProvUtils.GetProjectileColor(255,true); + float width = FireWidthFunction(i / (float)len, Projectile.oldPos[i]); + Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0}) * (1- i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) /tex.Width * 0.25f, SpriteEffects.None, 0f); + } + Main.spriteBatch.End(); + } + } + + using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) { - using (lease.Scope(clearColor: Color.Transparent)) - { - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(5).ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); - - Vector2[] fireCoreLength = Projectile.oldPos.Take(5).ToArray(); - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); - PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); - } Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); - Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); - + Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); @@ -159,7 +163,7 @@ namespace CalamityMod.Projectiles.Boss } Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); - Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * Projectile.Opacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(ss); return false; @@ -167,7 +171,7 @@ namespace CalamityMod.Projectiles.Boss public float FireWidthFunction(float completion, Vector2 pos) { float width; - float maxBodyWidth = 38f * Projectile.scale; + float maxBodyWidth = 32f * Projectile.scale; float curveRatio = 0.2f; var positions = Projectile.oldPos.ToList(); positions.RemoveAll(x => x == Vector2.Zero); @@ -185,7 +189,7 @@ namespace CalamityMod.Projectiles.Boss public Color FireColorFunction(float completion, Vector2 pos) { - Color mainColor = ProvUtils.GetProjectileColor(255, true) * 1.3f; + Color mainColor = ProvUtils.GetProjectileColor(255) * 1.3f; Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 2cecc9803e..7981939956 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -2,7 +2,7 @@ using System.Linq; using CalamityMod.Dusts; using CalamityMod.Enums; -using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.Utilities.Daybreak; using CalamityMod.Utilities.Daybreak.Buffers; @@ -11,7 +11,6 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -21,10 +20,9 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; - public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailCacheLength[Type] = 32; ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -35,9 +33,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.alpha = 255; Projectile.penetrate = 1; Projectile.timeLeft = 200; + Projectile.MaxUpdates = 4; } public override void OnSpawn(IEntitySource source) @@ -56,17 +54,21 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Lighting.AddLight(Projectile.Center, 0f, 0.6f, 0f); - - if (Projectile.ai[0] < 240f) + if (Projectile.FinalExtraUpdate()) { - Projectile.ai[0] += 1f; + if (Projectile.ai[0] < 240f) + { + Projectile.ai[0] += 1f; - if (Projectile.timeLeft < 160) - Projectile.timeLeft = 160; + if (Projectile.timeLeft < 160) + Projectile.timeLeft = 160; + } + + if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; } - if (Projectile.velocity.Length() < 16f) - Projectile.velocity *= 1.01f; + Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); int index = Player.FindClosest(Projectile.position, Projectile.width, Projectile.height); Player player = Main.player[index]; @@ -85,37 +87,31 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - Projectile.Opacity = 1; Main.spriteBatch.End(out var ss); var device = Main.instance.GraphicsDevice; - using var lease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth / 2, - Main.screenHeight / 2, - RenderTargetDescriptor.Default - ); - using var mainLease = RenderTargetPool.Shared.Rent( - device, - Main.screenWidth, - Main.screenHeight, - RenderTargetDescriptor.Default - ); - using (mainLease.Scope(clearColor: Color.Transparent)) + using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); + var len = Math.Min(Projectile.oldPos.Length, 32); + for (var i = 0; i < len; i++) + { + Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color color = FireCoreColorFunction(i / (float)len, Projectile.oldPos[i]); + var color2 = new Color(0, 25, 0); + float width = FireWidthFunction(i / (float)len, Projectile.oldPos[i]); + Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); + } + Main.spriteBatch.End(); + } + + using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) { - using (lease.Scope(clearColor: Color.Transparent)) - { - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(13).ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); - - Vector2[] fireCoreLength = Projectile.oldPos.Take(13).ToArray(); - GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); - PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); - } - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); - Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); float vel = Projectile.velocity.Length() / 8; @@ -162,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss } Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); - Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * Projectile.Opacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(ss); return false; @@ -170,7 +166,7 @@ namespace CalamityMod.Projectiles.Boss public float FireWidthFunction(float completion, Vector2 pos) { float width; - float maxBodyWidth = 38f * Projectile.scale; + float maxBodyWidth = 32f * Projectile.scale; float curveRatio = 0.2f; var positions = Projectile.oldPos.ToList(); positions.RemoveAll(x => x == Vector2.Zero); From fb7964a965fc959082478a7bab4f6d8b0db30b64 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 11 Apr 2026 18:21:02 -0700 Subject: [PATCH 42/46] recipe --- Items/Pets/StarSwallowerUnit.cs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Items/Pets/StarSwallowerUnit.cs b/Items/Pets/StarSwallowerUnit.cs index 93e0d26691..85fededc2a 100644 --- a/Items/Pets/StarSwallowerUnit.cs +++ b/Items/Pets/StarSwallowerUnit.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Pets; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Pets; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,20 +14,10 @@ namespace CalamityMod.Items.Pets public new string LocalizationCategory => "Items.Pets"; public override void SetDefaults() { - Item.width = 42; - Item.height = 30; - Item.damage = 0; - Item.useAnimation = 20; - Item.useTime = 20; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - + Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); Item.value = Item.sellPrice(gold: 1); Item.rare = ModContent.RarityType(); - - Item.shoot = ModContent.ProjectileType(); - Item.buffType = ModContent.BuffType(); - Item.UseSound = SoundID.Item10; + Item.useStyle = ItemUseStyleID.HoldUp; } public override void UseStyle(Player player, Rectangle heldItemFrame) @@ -36,5 +27,15 @@ namespace CalamityMod.Items.Pets player.AddBuff(Item.buffType, 15, true); } } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Frog). + AddIngredient(8). + AddIngredient(4). + AddTile(TileID.Anvils). + Register(); + } } } From c908a495c84e7fa5e06ddb52c3fcd357496c2a09 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 11 Apr 2026 18:26:37 -0700 Subject: [PATCH 43/46] remove unused sprite --- Projectiles/Pets/StarSwallowerPetIdle.png | Bin 2478 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Projectiles/Pets/StarSwallowerPetIdle.png diff --git a/Projectiles/Pets/StarSwallowerPetIdle.png b/Projectiles/Pets/StarSwallowerPetIdle.png deleted file mode 100644 index fd68a85ed701f82800df6ca2125e42492a3d6839..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2478 zcmZ`*eK-?p8{b6OLDZ%bL&@0MuY)l15fvuob?{{C%b!VORK&gVXKmY(h z)$KIGONKDn{-m^9cFrGaD3t*))(hnVsO3Qakp=Q0&S+-Vm;3FMEwznOw4)v|}84x6W;yris^X#pA z{`ejhLhCDSe-!+pMM%Fo<-+@|!^Qj}^HNe2xZ&aW{AJSWYHu`M;`pEAC|e_%pw5}p zVX?j^OLya=FQ#4eTf%q>KXvBxIp4py$E_V;T<-ItqM5B*6K@qW?;`TPgcd-J3U4H2 z)n2IoW#vm$+y0cObtCfA{pRW!11j?&Ar|OLq~k^vkmVGE0OMQh@uUq>Pb{Oe?X^H4 zfT9+f*E}!))S6ge4l*je>1p6MCas&@(0)lgaza?LmZ`_u`=&8z?N@h1$Nb^S4PR1i zT>Y$f=`Hgo0jPEB1JPg_w62rZy3}k8)qzXy&n{GRAQ^dfcouFYBP2*&L2SG$GeJCZ z822+CEZz`XV{}yku0Xg_qdBF9%nxc4yI>?!B@@Wh)z(yxloXdFr-u}gMGHa=@b*;y z`FM}?(oFvDS?ztS(zB?h?AN@hQ|riALpA%}sHFRnmKhDo!`A{$>*{T9p^sWQz}P*p zaa-aM@<@IYoEWG)WZ~e+sN8;FEWFx|f1LIp zqX1&C^B3R_K!Ta0+;C1W8Y%GiN6PvvMtHOAYj81p&CbTAhueKsI@9RaYXrIWXeNfz z*PaINJ?F&2$qNWo<3M+0#S^0BhQs7nqdKg-$CeG>evwx_PpEyx*71kErYiaVQ<6H5 z!MG#AFBpsUv{y({N4JMBfi)v6LYhM`_n`f`1EatfVb}d)hrBdAODF-}6Pq)IAIW<9}WOa2Da&2}i$EPt(8eJvpb_eqbjdK=~4i9*AJA z5V%3)NA_lrL*yWaN&X8^)RgI-s7s@usAq?#YKCp({b08n!l>QgEEyX}0>4H*t@46` zv-SL+*bUe_I`!BtiUTMSd~w+1Y(x~lc=t>maS{hIVShWpd58Iq;jxH_5(CaU3t$s1{6kxvyDj+LdKUGKkYLIMNOu5kn^o%f5!HE%jkQw zz4Z7`g5z9x8qM&2d9qhdoWS1Kd(?nLmV2GQCtv_D*Ic60fPFrUy~C>=0MbtUR;~|F zBNwzS-0|O>l#Y361P+$@hEtUuR$u>f$xDOA3(B^$Jw~KdjYN%n{`|}_GS=2eS2e9% zUzeFZ&bpETP49Of3j-Yx35EIO0-}0YjN&_=9IbSJ-&Y3|DKhqw+`Lzv3vI?kPm`E& z`C&_d=$+;woH6#PQeSNB*xCBKcL+R;dJl!32Lwj5mF=t-p%GLijiL{hkBaCX@1b*n zb0vz*3n5cZ7SBLf<@!kdh1AmlT5>jQNs2qN#T6V{ ze-he&HMn~mCG+qX#0~HltPBmf82I@JnANmMa;D;hsHH%Y-yoF+6jiri5wW@a`_Y4r zY3t^Yp4^WHu!B`olp{n)BHc7jR?4UIC6{R2)qsJ&<&bOS;6(0&GOtZxg&q4PLX)qsV?wn0r`G3FUBK6iKCG_fk@E|QX{%qKk`IeGU=(K0oVf8En4=#xjcJ#O ztFat;Z;1j$>3y3%#CsV8RcB%m&q7gcU&aiZQx>ja3RReYh<-d z;v5POluC`2TpxQ}{8%~GE@Ve{0x4L-h$+8k6562*L3=O*7pfop2>5|06mSgbv zrMPzvqs*S{e(Uu4l@DbORmuWwt=khDtiJv07l;F@^8@yiPrmAO%(x48J1Hur7f7X( zpS~p?HLY&kt)-)@vb|-oAWGYGaw7M%22Z!@!66+?Ra(oA!`+zo&P5v@M>az~z1dRag$!(ZNi*d1vGd8|($;b2xsV*Gor z9Q~fy-;-L)^?%A0&EDqxfY4T~?&6`NnsgXP6L#$=oT!hY1+@6Zb@?u?>c9_@Za=9$ zvUjHCpPBFr+DvR$o+wl^dhhxS5N}B5?$~i*ZjRhf#gZtMtMibID=p2ye>p4`KTcw{ z-TckV0nuteRuE;wO9NXl+ETF*8I>yCKKGZTS>s=UI=yn-$POSgh>6A^2J0cN-+7vG zaq(w0oWMv6W&{BW)Nm?%;m4a%n#>bma zqKNO6`m%gM$<=_G(WNtyOwJaq8=LTM`nj5j5*g+gI--WlL*OY5=|cu|9Y%%rsB?Jp z|G5yhPfePA&i_&2$9~J?iJgvB5SXcFnnSVvHk-e*qF)w>SU* From b0232b13516ee5d133f26cdd34da72c4a756c11f Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 13 Apr 2026 06:14:17 +0700 Subject: [PATCH 44/46] fixed frog catching an infinite flight loop --- Projectiles/Pets/StarSwallowerPet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Pets/StarSwallowerPet.cs b/Projectiles/Pets/StarSwallowerPet.cs index 17cd7e2f95..31646cbc32 100644 --- a/Projectiles/Pets/StarSwallowerPet.cs +++ b/Projectiles/Pets/StarSwallowerPet.cs @@ -256,7 +256,7 @@ namespace CalamityMod.Projectiles.Pets { playerStill = 0; } - if (playerStill > 10 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + if (playerStill > 10 && Projectile.Center.Y <= player.Center.Y && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) { fly = false; Projectile.velocity *= 0.2f; From ead7747a8a81088267e7250443600085b5d7dd67 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 13 Apr 2026 06:21:31 +0700 Subject: [PATCH 45/46] shortcut --- Buffs/Pets/StarSwallowerPetBuff.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Buffs/Pets/StarSwallowerPetBuff.cs b/Buffs/Pets/StarSwallowerPetBuff.cs index 30c26a7850..210bc1ebf6 100644 --- a/Buffs/Pets/StarSwallowerPetBuff.cs +++ b/Buffs/Pets/StarSwallowerPetBuff.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Pets; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -13,15 +12,6 @@ namespace CalamityMod.Buffs.Pets Main.vanityPet[Type] = true; } - public override void Update(Player player, ref int buffIndex) - { - player.buffTime[buffIndex] = 18000; - player.Calamity().starSwallowerPetFroge = true; - bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; - if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); - } - } + public override void Update(Player player, ref int buffIndex) => player.BuffHandle_SpawnPetIfNeededAndSetTime(buffIndex, ref player.Calamity().starSwallowerPetFroge, ModContent.ProjectileType()); } } From e45955b984d9dfe69409dcbb0b38c775303abb6e Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 13 Apr 2026 06:35:17 +0700 Subject: [PATCH 46/46] tweaked fallthrough logic and made froge little faster --- Projectiles/Pets/StarSwallowerPet.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Projectiles/Pets/StarSwallowerPet.cs b/Projectiles/Pets/StarSwallowerPet.cs index 31646cbc32..7292b421c4 100644 --- a/Projectiles/Pets/StarSwallowerPet.cs +++ b/Projectiles/Pets/StarSwallowerPet.cs @@ -57,10 +57,8 @@ namespace CalamityMod.Projectiles.Pets public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { Player player = Main.player[Projectile.owner]; - Vector2 projCenter = Projectile.Center; - Vector2 playerDirection = player.Center - projCenter; - float playerDistance = playerDirection.Length(); - fallThrough = playerDistance > 200f; + float heightDif = player.Center.Y - Projectile.Center.Y; + fallThrough = fly || heightDif >= 160f; return true; } @@ -100,7 +98,7 @@ namespace CalamityMod.Projectiles.Pets { Projectile.velocity.Y = 15f; } - if (playerDistance > 520f) + if (playerDistance > 480f) { fly = true; Projectile.velocity.X = 0f; @@ -110,18 +108,18 @@ namespace CalamityMod.Projectiles.Pets { if (player.position.X - Projectile.position.X > 0f) { - Projectile.velocity.X += 0.12f; - if (Projectile.velocity.X > 6f) + Projectile.velocity.X += 0.125f; + if (Projectile.velocity.X > 6.75f) { - Projectile.velocity.X = 6f; + Projectile.velocity.X = 6.75f; } } else { - Projectile.velocity.X -= 0.12f; - if (Projectile.velocity.X < -6f) + Projectile.velocity.X -= 0.125f; + if (Projectile.velocity.X < -6.75f) { - Projectile.velocity.X = -6f; + Projectile.velocity.X = -6.75f; } } }