From cae9054c03a9d3e9240a42b977ff0b2ab1784936 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 6 Jun 2026 20:48:25 -0700 Subject: [PATCH 1/6] The Rework --- CalPlayer/CalamityPlayer.cs | 3 + CalPlayer/CalamityPlayerMiscEffects.cs | 23 ++ Items/CalamityGlobalItem.cs | 4 + Items/CalamityGlobalItemTooltip.cs | 4 + .../en-US/Mods.CalamityMod.NPCs.hjson | 1 + .../en-US/Mods.CalamityMod.Vanilla.hjson | 6 + NPCs/Other/VolatileChain.png | Bin 0 -> 3025 bytes NPCs/Other/VolatileSlime.cs | 285 ++++++++++++++++++ Projectiles/CalamityGlobalProjectile.cs | 129 ++++++++ 9 files changed, 455 insertions(+) create mode 100644 NPCs/Other/VolatileChain.png create mode 100644 NPCs/Other/VolatileSlime.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e8e6ac4798..216a8a02a1 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -882,6 +882,7 @@ namespace CalamityMod.CalPlayer public bool eGauntlet = false; /// public bool eGauntletVisuals = true; + public bool volatileGelatinVisuals = true; /// /// Used to prevent melee speed stacking with Feral Claws and its upgrades.
/// Feral Claws = 1, Power Glove = 2, Mechanical Glove = 3, Fire Gauntlet = 4, Elemental Gauntlet = 5 @@ -1174,6 +1175,7 @@ namespace CalamityMod.CalPlayer public int voidFrameCounter = 0; /// public int voidFrame = 0; + public int volatileGelHits = 0; public bool rottenDogTooth = false; public bool angelicAlliance = false; public int angelicActivate = -1; @@ -2449,6 +2451,7 @@ namespace CalamityMod.CalPlayer ascendantInsignia = false; fishStocks = false; magmaStoneVisuals = true; + volatileGelatinVisuals = true; eGauntlet = false; eGauntletVisuals = true; gloveLevel = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1f005b6c9d..3ebb1c94af 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2951,6 +2951,29 @@ namespace CalamityMod.CalPlayer } } + if (Player.volatileGelatin) + { + Player.volatileGelatinCounter++; + + int npcCount = 0; + int npcType = ModContent.NPCType(); + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + if (npc.active && npc.type == npcType && npc.ai[1] == Player.whoAmI && npc.ai[3] == 0) + npcCount++; + } + int wingFlatBoost = 15; // 0.3 seconds of flight + float jumpSpeedBoost = 0.25f; // 5% jump speed + + if (Player.wingTimeMax > 0) + Player.wingTimeMax += (wingFlatBoost * npcCount); + Player.jumpSpeedBoost += (jumpSpeedBoost * npcCount); + } + else + volatileGelHits = 0; + + // Vortex Armor nerf if (Player.vortexStealthActive && Player.HeldItem.type != ItemID.PsychoKnife) { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 17967c5c79..9d3c100af6 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1117,6 +1117,10 @@ namespace CalamityMod.Items { modPlayer.magmaStoneVisuals = !hideVisual; // hides the fire dust when hiding the accessory } + if (item.type == ItemID.VolatileGelatin) + { + modPlayer.volatileGelatinVisuals = !hideVisual; + } // The Frog Leg line is prevented from stacking. // Additionally, Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 22fc80190d..033c6153d1 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -857,6 +857,10 @@ namespace CalamityMod.Items if (item.type == ItemID.GravityGlobe) EditTooltipByNum(1, (line) => line.Text = EditedTooltip("GravityGlobe")); + // Reworked Volatile Gelatin + if (item.type == ItemID.VolatileGelatin) + EditTooltipByNum(0, (line) => line.Text += "\n" + EditedTooltip("VolatileGelatin")); + // Flame Waker Boots now has a functional effect which inherits to Hellfire Treads. if (item.type == ItemID.FlameWakerBoots) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 1323a80e94..0565c7d7ae 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -311,6 +311,7 @@ SupremeCalamitas.DisplayName: Supreme Witch, Calamitas SupremePermafrost: Supreme Ultramage, Permafrost SupremeCataclysm.DisplayName: Cataclysm SupremeCatastrophe.DisplayName: Catastrophe +VolatileSlime.DisplayName: Volatile Slime Yharon.DisplayName: Yharon, Dragon of Rebirth YharonPhase2: Yharon, Resplendent Phoenix // Town NPCs, Pets, etc diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 4ce439ea10..d823e02884 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -199,6 +199,12 @@ EditedTooltip: { All attacks light enemies on fire 'Never get cold feet again' ''' + VolatileGelatin: + ''' + Every 5 gelatin blobs that hit, a winged Volatile Slime will spawn, up to a max of 6 + Each Volatile Slime provides 5% increased jump speed and 0.3 seconds of flight time + Running out of flight time will remove the Volatile Slime's wings and detatch them from you + ''' /* Armor */ diff --git a/NPCs/Other/VolatileChain.png b/NPCs/Other/VolatileChain.png new file mode 100644 index 0000000000000000000000000000000000000000..32644e4fcee505c782eaf2a886d2decf4476be1a GIT binary patch literal 3025 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%0Dy!50Qvv` z0D$NK0Cg|`0P0`>06Lfe02gqax=}m;000SaNLh0L01FZT01FZU(%pXi0000RbVXQn zQ*UN;cVTj607GSLb9r+hQ*?D?X>TA@Z*OeDr{R16007-dL_t(2kz@S-|33pVu;I)6 z&%nUIAkSsYz`(%3@bKGN1_lNOh9jS*Ga{>Fq*xZy0jh?z`3=9km3^j6x8K|QXCV}oGm=}(whCobsc9lvR zk7QIp0%=AEY9QFB{byicU?}N=7}!&mMxn;V4E6sR7#JAbMQs=u7#JAD1e+mFl2Atp z90rqc2z_QHg&JWAU $"Terraria/Images/NPC_{NPCID.QueenSlimeMinionPurple}"; + public ref float time => ref NPC.ai[0]; + public ref float playerID => ref NPC.ai[1]; + public Player owner => Main.player[(int)playerID]; + public bool released => NPC.ai[3] != 0; + public bool doOnSpawnEffects = true; + public Color effectColor = Color.BlueViolet; + public List oldVelocities = new List(); + public Vector2 randPos = Vector2.Zero; + public Vector2 goalPositionRand = Vector2.Zero; + public float travelSpeed = 25; + public float glowScale = 1; + public bool drawChains = true; + public float gravIntensity = 1; + public override void SetStaticDefaults() + { + this.HideFromBestiary(); + Main.npcFrameCount[Type] = 4; + } + public override void SetDefaults() + { + NPC.width = NPC.height = 40; + NPC.damage = 0; + NPC.defense = 0; + NPC.lifeMax = 75; + NPC.noGravity = true; + NPC.noTileCollide = true; + NPC.knockBackResist = 0.8f; + NPC.netAlways = true; + NPC.aiStyle = -1; + NPC.Opacity = 0; + NPC.dontTakeDamage = true; + NPC.chaseable = false; + NPC.lavaImmune = true; + NPC.noGravity = true; + NPC.HitSound = SoundID.NPCHit1; + NPC.DeathSound = SoundID.NPCDeath1; + + NPC.Calamity().ProvidesProximityRage = false; + NPC.Calamity().DoesNotDisappearInBossRush = true; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = false; + } + public override void FindFrame(int frameHeight) + { + NPC.frameCounter += 1.0; + if (NPC.frameCounter >= 6.0) + { + NPC.frame.Y += 1; + NPC.frameCounter = 0.0; + } + if (NPC.frame.Y >= (released ? Main.npcFrameCount[Type] / 2 : Main.npcFrameCount[Type])) + NPC.frame.Y = 0; + } + public override void AI() + { + if (doOnSpawnEffects) + { + NPC.Opacity = 1; + NPC.scale = 0; + doOnSpawnEffects = false; + } + float rate = (time * 0.05f); + List eColors = new List() + { + Color.SlateBlue, + Color.BlueViolet + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + effectColor = Color.Lerp(currentColor, nextColor, rate % 2f >= 1f ? 1f : rate % 1f); + glowScale = MathHelper.Lerp(glowScale, 1, 0.13f); + + + if (owner.wingTime <= 0 && !released) + { + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 10 }, NPC.Center); + time = 0; + NPC.dontTakeDamage = false; + NPC.noTileCollide = false; + NPC.lavaImmune = false; + NPC.frame.Y = 0; + glowScale = 5f; + gravIntensity = Main.rand.NextFloat(0.8f, 1.3f); + + NPC.ai[3] = 1; // release the slimes + NPC.netUpdate = true; + } + + if (released) + { + float sine = (float)Math.Sin(time * 0.6f / MathHelper.Pi); + if (NPC.velocity.Y < 12 * gravIntensity) + NPC.velocity.Y += 0.4f * gravIntensity; + if (Math.Abs(NPC.velocity.X) < 5 && time < 120) + NPC.velocity.X *= 1.03f; + else + NPC.velocity.X *= 0.987f; + } + else + { + if (time % 120 == 0) + goalPositionRand = Main.rand.NextVector2Circular(90, 90); + randPos = Vector2.Lerp(randPos, goalPositionRand, 0.04f); + + float sineX = (float)Math.Sin(time * 0.4f / MathHelper.Pi); + float sineY = (float)Math.Sin(time * 0.6f / MathHelper.Pi); + + NPC.velocity += owner.velocity; + Vector2 destination = owner.Center - Vector2.UnitY * 120 + randPos + new Vector2(10 * sineX, 15 * sineY); + + // Anticlump + int npcType = ModContent.NPCType(); + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + float distFromNPC = Vector2.Distance(NPC.Center, npc.Center); + if (npc != NPC && npc.active && npc.type == npcType && npc.ai[1] == owner.whoAmI && npc.ai[3] == 0 && distFromNPC < 150) + destination += Utils.DirectionFrom(NPC.Center, npc.Center) * Utils.GetLerpValue(150, 0, distFromNPC) * 25; + } + travelSpeed = MathHelper.Lerp(travelSpeed, (owner.controlJump ? 2 : 25), 0.03f); + + NPC.velocity = (destination - NPC.Center) / travelSpeed; + + //NPC.velocity = owner.velocity; + //NPC.Center = owner.Center + Vector2.UnitX * (40 + 35 * NPC.ai[2]); + } + if (NPC.velocity.X > 0 || NPC.velocity.X < 0) + NPC.spriteDirection = Math.Sign(NPC.velocity.X); + + if (NPC.scale < 1) + NPC.scale += 0.05f; + + if (NPC.collideX) + { + NPC.velocity.X *= -1.2f; + } + if (NPC.collideY) + { + NPC.velocity.Y += -5.5f * gravIntensity - NPC.velocity.Y; + } + + // Kill slime after enough time freed + if (Main.netMode != NetmodeID.MultiplayerClient && ((time >= 600f && released) || (!owner.volatileGelatin) || (owner.dead && !released))) + { + NPC.StrikeInstantKill(); + //NPC.active = false; + NPC.netUpdate = true; + } + + time++; + + oldVelocities.Add(NPC.velocity); + int maxSaves = 18; + if (oldVelocities.Count > maxSaves) + oldVelocities.RemoveAt(0); + } + public override void OnKill() + { + if (owner.Calamity().volatileGelatinVisuals) + { + for (int i = 0; i <= 22; i++) + { + Vector2 vel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(3f, 8f); + + Dust dust2 = Dust.NewDustPerfect(NPC.Center, ModContent.DustType(), vel); + dust2.scale = Main.rand.NextFloat(0.8f, 1.7f); + bool gravity = !Main.rand.NextBool(5); + dust2.noGravity = gravity; + if (!gravity) + dust2.velocity /= 2; + dust2.alpha = Main.rand.Next(70, 150 + 1); + dust2.color = Main.rand.NextBool() ? Color.BlueViolet : Color.SlateBlue; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + } + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + return false; + } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + Texture2D texture = released ? Terraria.GameContent.TextureAssets.Npc[NPCID.QueenSlimeMinionBlue].Value : Terraria.GameContent.TextureAssets.Npc[NPCID.QueenSlimeMinionPurple].Value; + Vector2 drawPosition = NPC.Center - screenPos + (Vector2.UnitY * (released ? 8 : 0)); + Rectangle frame = Utils.Frame(texture, verticalFrames: (released ? Main.npcFrameCount[Type] / 2 : Main.npcFrameCount[Type]), frameY: NPC.frame.Y); + Vector2 origin = frame.Size() * 0.5f; + + if (drawChains) + { + Texture2D chain = ModContent.Request("CalamityMod/NPCs/Other/VolatileChain").Value; + Vector2 end = NPC.Center; + + Vector2 drawStart = owner.Center; + List controlPoints = new List + { + drawStart + }; + for (int i = 0; i < oldVelocities.Count; i++) + { + float swayResponsiveness = Utils.GetLerpValue(0f, 18f, i, true) * Utils.GetLerpValue(oldVelocities.Count, oldVelocities.Count - 18f, i, true) * Utils.GetLerpValue(5, 20, Utils.Distance(drawStart, end), true); + Vector2 swayTotalOffset = oldVelocities.ElementAt(i) * swayResponsiveness * -15; + controlPoints.Add(Vector2.Lerp(drawStart, end, i / (float)oldVelocities.Count) + swayTotalOffset); + } + controlPoints.Add(end); + + int chainPointCount = (int)(Vector2.Distance(controlPoints.First(), controlPoints.Last()) / 11f); + if (chainPointCount < 14) + chainPointCount = 14; + + + BezierCurve bezierCurve = new BezierCurve(controlPoints.ToArray()); + List chainPoints = bezierCurve.GetPoints(chainPointCount); + + for (int i = 0; i < chainPoints.Count; i++) + { + float completion = Utils.GetLerpValue(chainPoints.Count * 0.2f, chainPoints.Count, i, true); + Vector2 positionAtPoint = chainPoints[i]; + Color color = Color.Lerp(Lighting.GetColor(positionAtPoint.ToTileCoordinates()), effectColor with { A = 0 }, completion); + + if (Vector2.Distance(owner.Center, positionAtPoint) > 1400) + continue; + if (Vector2.Distance(positionAtPoint, NPC.Center) < 10f) + continue; + float angleAtPoint = i == chainPoints.Count - 1 ? (end - chainPoints[i]).ToRotation() : (chainPoints[i + 1] - chainPoints[i]).ToRotation(); + angleAtPoint += MathHelper.PiOver2; + + SpriteEffects sprfx = (i % 2 == 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + if (i % 4 < 2) + sprfx |= SpriteEffects.FlipVertically; + + if (released) + { + Vector2 vel = Main.rand.NextVector2Circular(2, 2) + NPC.velocity; + if (owner.Calamity().volatileGelatinVisuals) + { + Particle chainfx = new CustomSpark(positionAtPoint, vel, "CalamityMod/NPCs/Other/VolatileChain", Main.rand.NextBool(3), Main.rand.Next(30, 65), 1f, color, Vector2.One, false, false, -vel.ToRotation() + angleAtPoint, false, false, noShrink: false, spin: Main.rand.NextFloat(0, 0.08f) * Math.Sign(vel.X)); + GeneralParticleHandler.SpawnParticle(chainfx); + } + + drawChains = false; + } + + Main.EntitySpriteDraw(chain, positionAtPoint - Main.screenPosition, null, color * (owner.Calamity().volatileGelatinVisuals ? 1 : 0.05f), angleAtPoint, chain.Size() / 2f, 1.1f - (0.3f * (1 - completion)), sprfx, 0); + } + } + + float sine = (float)Math.Sin(time * 0.2f / MathHelper.Pi); + int draws = 12; + for (int i = 0; i < draws; i++) + { + float rotPoint = MathHelper.TwoPi / draws * i; + float dist = (2.5f + sine) * glowScale; + if (owner.Calamity().volatileGelatinVisuals) + spriteBatch.Draw(texture, drawPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly * 0.2f) * dist, frame, effectColor with { A = 0 } * NPC.Opacity * 0.6f, NPC.rotation, origin, NPC.scale, NPC.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + } + spriteBatch.Draw(texture, drawPosition, frame, Color.Lerp(drawColor, effectColor with { A = 0 }, Utils.GetLerpValue(1, 3, glowScale)) * NPC.Opacity * (owner.Calamity().volatileGelatinVisuals ? 1f : 0.6f), NPC.rotation, origin, NPC.scale, NPC.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); + return false; + } + } +} diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index aa0bbd5249..99b3dfc2b7 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -24,12 +24,15 @@ using CalamityMod.Items.SummonItems; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; +using CalamityMod.Packets; using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Healing; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; @@ -346,6 +349,25 @@ namespace CalamityMod.Projectiles projectile.Calamity().supercritHits = -1; } + if (projectile.type == ProjectileID.VolatileGelatinBall) + { + projectile.DamageType = AverageDamageClass.Instance; + projectile.usesIDStaticNPCImmunity = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + if (projectile.extraUpdates == 0) + projectile.extraUpdates = 1; + if (projectile.timeLeft > 700) + projectile.timeLeft = 700; + projectile.damage = (int)(projectile.damage * 0.95f); // 5% damage nerf + NPC closeTarget = projectile.Center.ClosestNPCAt(640); + Vector2 velocity = (projectile.Center.DirectionTo(closeTarget.Center) + closeTarget.velocity * 0.03f).SafeNormalize(Vector2.UnitX); + projectile.velocity = velocity * 12; + projectile.penetrate = 6; // this is for bounces, actually has pierce 4 + Player player = Main.player[projectile.owner]; + projectile.ApplyStatsFromSource(player.GetSource_FromThis()); + } + void ApplyGrapeBeer() { grapeBeer = true; @@ -564,6 +586,45 @@ namespace CalamityMod.Projectiles } } + if (projectile.type == ProjectileID.VolatileGelatinBall) + { + Player player = Main.player[projectile.owner]; + if (projectile.timeLeft == 699 && projectile.FinalExtraUpdate() && player.Calamity().volatileGelatinVisuals) + { + for (int i = 0; i <= 14; i++) + { + float variance = Main.rand.NextFloat(-0.4f, 0.4f); + Vector2 vel = projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(variance) * Main.rand.NextFloat(12f, 17f) * (1 - Math.Abs(variance * 1.5f)); + + Dust dust2 = Dust.NewDustPerfect(player.Center, ModContent.DustType(), vel); + dust2.scale = Main.rand.NextFloat(1.7f, 2.5f) * (1 - Math.Abs(variance * 1.5f)); + bool gravity = !Main.rand.NextBool(5); + dust2.noGravity = gravity; + if (!gravity) + dust2.velocity /= 2; + dust2.alpha = Main.rand.Next(70, 150 + 1); + dust2.color = Main.rand.NextBool() ? Color.BlueViolet : Color.SlateBlue; + dust2.noLight = true; + dust2.noLightEmittence = true; + } + + } + if (projectile.timeLeft > 600 && projectile.numHits == 0) + projectile.velocity.Y -= 0.065f; + else if (projectile.velocity.Y < 14) + projectile.velocity.Y += 0.15f; + + float fade = Utils.GetLerpValue(600, 700, projectile.timeLeft, true); + if (fade > 0 && projectile.timeLeft < 695 && Main.player[projectile.owner].Calamity().volatileGelatinVisuals) + { + Particle spark = new CustomSpark(projectile.Center, -projectile.velocity * 0.05f, "CalamityMod/Particles/BloomCircle", false, 11, 0.52f, Color.BlueViolet * 0.5f * fade, new Vector2(0.7f, 1.2f), true, true, glowCenterScale: 0.7f, glowOpacity: 0.5f * fade, shrinkSpeed: 0.14f); + GeneralParticleHandler.SpawnParticle(spark, false, GeneralDrawLayer.BeforeProjectiles); + } + + if (projectile.numHits > 4) + projectile.Kill(); + } + if (projectile.type == ProjectileID.Skull) { bool fromRevSkeletron = projectile.ai[0] < 0f; @@ -4734,6 +4795,47 @@ namespace CalamityMod.Projectiles if (forcedCrit) modifiers.SetCrit(); + if (projectile.type == ProjectileID.VolatileGelatinBall && player.volatileGelatin) + { + target.AddBuff(BuffID.GelBalloonBuff, 180); + + float minMult = 0.2f; + int hitsToMinMult = 5; + float damageMult = Utils.Remap(projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + if (projectile.numHits == 0) + player.Calamity().volatileGelHits++; + if (player.Calamity().volatileGelHits == 5) + { + player.Calamity().volatileGelHits = 0; + Vector2 spawnPosition = player.Center; + int npcType = ModContent.NPCType(); + + int slimeCap = 6; + int npcCount = 0; + for (int x = 0; x < Main.maxNPCs; x++) + { + NPC npc = Main.npc[x]; + if (npc.active && npc.type == npcType && npc.ai[1] == player.whoAmI && npc.ai[3] == 0) + npcCount++; + } + + if (npcCount < slimeCap && player.wingTime > 0) + { + if (Main.netMode == NetmodeID.SinglePlayer) + { + NPC.NewNPC(new EntitySource_WorldEvent(), (int)spawnPosition.X, (int)spawnPosition.Y, npcType, ai1: player.whoAmI, ai2: npcCount); + return; + } + else if (Main.netMode == NetmodeID.MultiplayerClient) + { + SpawnNPCOnPlayerPacket.Send(player, (int)spawnPosition.X, (int)spawnPosition.Y, npcType); + } + } + } + } + if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike && !modPlayer.vampiricTalisman) target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); else if (modPlayer.vampiricTalisman && projectile.Calamity().stealthStrike) @@ -5110,6 +5212,33 @@ namespace CalamityMod.Projectiles } #endregion + if (projectile.type == ProjectileID.VolatileGelatinBall && Main.player[projectile.owner].Calamity().volatileGelatinVisuals) + { + Texture2D texture = TextureAssets.Projectile[projectile.type].Value; + float rate = (projectile.timeLeft * 0.05f); + List eColors = new List() + { + Color.SlateBlue, + Color.BlueViolet + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color finalColor = Color.Lerp(currentColor, nextColor, rate % 2f >= 1f ? 1f : rate % 1f); + + float fade = Utils.GetLerpValue(600, 700, projectile.timeLeft, true); + int draws = 12; + for (int i = 0; i < draws; i++) + { + float rotPoint = MathHelper.TwoPi / draws * i; + float dist = 3.5f * fade; + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly) * dist, null, finalColor with { A = 0 } * 0.6f * fade, MathF.Pow(projectile.rotation, 2), texture.Size() / 2f, projectile.scale * 1.2f, SpriteEffects.None); + } + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, fade), projectile.rotation, texture.Size() / 2f, projectile.scale, SpriteEffects.None); + + shouldDrawBool = false; + } + if (projectile.type == ProjectileID.DeerclopsIceSpike && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) { bool death = CalamityWorld.death || BossRushEvent.BossRushActive; From e0b8aca74f17cfb926c17a389214945d0415b596 Mon Sep 17 00:00:00 2001 From: Critaquil Date: Sun, 7 Jun 2026 00:50:51 -0400 Subject: [PATCH 2/6] We live in a world where volatile gelatin needs a 40% damage nerf --- Projectiles/CalamityGlobalProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 99b3dfc2b7..227813c36e 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -359,7 +359,7 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 1; if (projectile.timeLeft > 700) projectile.timeLeft = 700; - projectile.damage = (int)(projectile.damage * 0.95f); // 5% damage nerf + projectile.damage = (int)(projectile.damage * 0.60f); // 40% damage nerf NPC closeTarget = projectile.Center.ClosestNPCAt(640); Vector2 velocity = (projectile.Center.DirectionTo(closeTarget.Center) + closeTarget.velocity * 0.03f).SafeNormalize(Vector2.UnitX); projectile.velocity = velocity * 12; From bb4c27af4463e460d9ce2d6b77c6e3d5802a9c50 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 8 Jun 2026 22:16:55 -0700 Subject: [PATCH 3/6] Multiplayer Fixes --- NPCs/Other/VolatileSlime.cs | 32 +++++++++++++++++++++---- Projectiles/CalamityGlobalProjectile.cs | 17 +++++++------ 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/NPCs/Other/VolatileSlime.cs b/NPCs/Other/VolatileSlime.cs index 6940fe86f2..62bc630d5c 100644 --- a/NPCs/Other/VolatileSlime.cs +++ b/NPCs/Other/VolatileSlime.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net; using System.Security.Principal; @@ -63,6 +64,18 @@ namespace CalamityMod.NPCs.Other NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(travelSpeed); + writer.Write(gravIntensity); + writer.WriteVector2(goalPositionRand); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + travelSpeed = reader.ReadSingle(); + gravIntensity = reader.ReadSingle(); + goalPositionRand = reader.ReadVector2(); + } public override void FindFrame(int frameHeight) { NPC.frameCounter += 1.0; @@ -78,9 +91,14 @@ namespace CalamityMod.NPCs.Other { if (doOnSpawnEffects) { + // In multiplayer, the spawned npc won't spawn with the proper owner, so it just sets it to be the player it spawns on top of + int player = NPC.FindClosestPlayer(); + NPC.ai[1] = player; + NPC.Opacity = 1; NPC.scale = 0; doOnSpawnEffects = false; + NPC.netUpdate = true; } float rate = (time * 0.05f); List eColors = new List() @@ -108,6 +126,7 @@ namespace CalamityMod.NPCs.Other NPC.ai[3] = 1; // release the slimes NPC.netUpdate = true; + NPC.SyncMotionToServer(); } if (released) @@ -123,7 +142,10 @@ namespace CalamityMod.NPCs.Other else { if (time % 120 == 0) + { goalPositionRand = Main.rand.NextVector2Circular(90, 90); + NPC.netUpdate = true; + } randPos = Vector2.Lerp(randPos, goalPositionRand, 0.04f); float sineX = (float)Math.Sin(time * 0.4f / MathHelper.Pi); @@ -142,11 +164,11 @@ namespace CalamityMod.NPCs.Other destination += Utils.DirectionFrom(NPC.Center, npc.Center) * Utils.GetLerpValue(150, 0, distFromNPC) * 25; } travelSpeed = MathHelper.Lerp(travelSpeed, (owner.controlJump ? 2 : 25), 0.03f); - + NPC.velocity = (destination - NPC.Center) / travelSpeed; - //NPC.velocity = owner.velocity; - //NPC.Center = owner.Center + Vector2.UnitX * (40 + 35 * NPC.ai[2]); + if (owner.controlJump && time % 3 == 0) + NPC.netUpdate = true; } if (NPC.velocity.X > 0 || NPC.velocity.X < 0) NPC.spriteDirection = Math.Sign(NPC.velocity.X); @@ -157,17 +179,18 @@ namespace CalamityMod.NPCs.Other if (NPC.collideX) { NPC.velocity.X *= -1.2f; + NPC.netUpdate = true; } if (NPC.collideY) { NPC.velocity.Y += -5.5f * gravIntensity - NPC.velocity.Y; + NPC.netUpdate = true; } // Kill slime after enough time freed if (Main.netMode != NetmodeID.MultiplayerClient && ((time >= 600f && released) || (!owner.volatileGelatin) || (owner.dead && !released))) { NPC.StrikeInstantKill(); - //NPC.active = false; NPC.netUpdate = true; } @@ -198,6 +221,7 @@ namespace CalamityMod.NPCs.Other dust2.noLightEmittence = true; } } + NPC.netUpdate = true; } public override bool CanHitPlayer(Player target, ref int cooldownSlot) { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 227813c36e..6cd3578709 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -32,7 +32,6 @@ using CalamityMod.Packets.Entities; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Healing; -using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; @@ -366,6 +365,7 @@ namespace CalamityMod.Projectiles projectile.penetrate = 6; // this is for bounces, actually has pierce 4 Player player = Main.player[projectile.owner]; projectile.ApplyStatsFromSource(player.GetSource_FromThis()); + projectile.netUpdate = true; } void ApplyGrapeBeer() @@ -623,6 +623,8 @@ namespace CalamityMod.Projectiles if (projectile.numHits > 4) projectile.Kill(); + if (projectile.timeLeft % 5 == 0) + projectile.netUpdate = true; } if (projectile.type == ProjectileID.Skull) @@ -4823,17 +4825,18 @@ namespace CalamityMod.Projectiles if (npcCount < slimeCap && player.wingTime > 0) { - if (Main.netMode == NetmodeID.SinglePlayer) - { - NPC.NewNPC(new EntitySource_WorldEvent(), (int)spawnPosition.X, (int)spawnPosition.Y, npcType, ai1: player.whoAmI, ai2: npcCount); - return; - } - else if (Main.netMode == NetmodeID.MultiplayerClient) + if (Main.netMode == NetmodeID.MultiplayerClient) { SpawnNPCOnPlayerPacket.Send(player, (int)spawnPosition.X, (int)spawnPosition.Y, npcType); } + else if (Main.netMode == NetmodeID.SinglePlayer) + { + NPC slime = NPC.NewNPCDirect(player.GetSource_FromThis(), (int)spawnPosition.X, (int)spawnPosition.Y, npcType, ai1: player.whoAmI, ai2: npcCount); + } } } + + projectile.netUpdate = true; } if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike && !modPlayer.vampiricTalisman) From ff46e94de7e25a8640f130c67f06f77de94a5463 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 3 Aug 2026 20:28:46 -0700 Subject: [PATCH 4/6] Fixes --- Localization/en-US/Mods.CalamityMod.Vanilla.hjson | 4 ++-- Projectiles/CalamityGlobalProjectile.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index d823e02884..0fe39ada77 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -201,9 +201,9 @@ EditedTooltip: { ''' VolatileGelatin: ''' - Every 5 gelatin blobs that hit, a winged Volatile Slime will spawn, up to a max of 6 + Every 5 volatile gelatins that hit, a winged Volatile Slime will spawn, up to a max of 6 Each Volatile Slime provides 5% increased jump speed and 0.3 seconds of flight time - Running out of flight time will remove the Volatile Slime's wings and detatch them from you + Running out of flight time will remove the Volatile Slime's wings and detach them from you ''' /* Armor diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 6cd3578709..2b1a9a0db7 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -348,7 +348,7 @@ namespace CalamityMod.Projectiles projectile.Calamity().supercritHits = -1; } - if (projectile.type == ProjectileID.VolatileGelatinBall) + if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) { projectile.DamageType = AverageDamageClass.Instance; projectile.usesIDStaticNPCImmunity = false; @@ -586,7 +586,7 @@ namespace CalamityMod.Projectiles } } - if (projectile.type == ProjectileID.VolatileGelatinBall) + if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) { Player player = Main.player[projectile.owner]; if (projectile.timeLeft == 699 && projectile.FinalExtraUpdate() && player.Calamity().volatileGelatinVisuals) @@ -4797,7 +4797,7 @@ namespace CalamityMod.Projectiles if (forcedCrit) modifiers.SetCrit(); - if (projectile.type == ProjectileID.VolatileGelatinBall && player.volatileGelatin) + if (projectile.type == ProjectileID.VolatileGelatinBall && player.volatileGelatin && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) { target.AddBuff(BuffID.GelBalloonBuff, 180); @@ -5215,7 +5215,7 @@ namespace CalamityMod.Projectiles } #endregion - if (projectile.type == ProjectileID.VolatileGelatinBall && Main.player[projectile.owner].Calamity().volatileGelatinVisuals) + if (projectile.type == ProjectileID.VolatileGelatinBall && Main.player[projectile.owner].Calamity().volatileGelatinVisuals && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) { Texture2D texture = TextureAssets.Projectile[projectile.type].Value; float rate = (projectile.timeLeft * 0.05f); From 4d92f042b0ce7b11497d6a1b7d82b8ce2514c437 Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 4 Aug 2026 13:01:09 -0700 Subject: [PATCH 5/6] Actual Source fixes thanks shark --- Projectiles/CalamityGlobalProjectile.cs | 47 ++++++++++++++----------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5a4cf5ece1..332af6e24a 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -354,24 +354,31 @@ namespace CalamityMod.Projectiles if (Main.player[projectile.owner].Calamity().spiritOrigin && projectile.CountsAsClass()) projectile.Calamity().supercritHits = -1; - if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) + IEntitySource sourceItemAcc = source as EntitySource_ItemUse; + + + if (projectile.type == ProjectileID.VolatileGelatinBall && source is EntitySource_ItemUse { Item: Item acc }) { - projectile.DamageType = AverageDamageClass.Instance; - projectile.usesIDStaticNPCImmunity = false; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = -1; - if (projectile.extraUpdates == 0) - projectile.extraUpdates = 1; - if (projectile.timeLeft > 700) - projectile.timeLeft = 700; - projectile.damage = (int)(projectile.damage * 0.60f); // 40% damage nerf - NPC closeTarget = projectile.Center.ClosestNPCAt(640); - Vector2 velocity = (projectile.Center.DirectionTo(closeTarget.Center) + closeTarget.velocity * 0.03f).SafeNormalize(Vector2.UnitX); - projectile.velocity = velocity * 12; - projectile.penetrate = 6; // this is for bounces, actually has pierce 4 - Player player = Main.player[projectile.owner]; - projectile.ApplyStatsFromSource(player.GetSource_FromThis()); - projectile.netUpdate = true; + if (acc == Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin)) + { + projectile.DamageType = AverageDamageClass.Instance; + projectile.usesIDStaticNPCImmunity = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + if (projectile.extraUpdates == 0) + projectile.extraUpdates = 1; + if (projectile.timeLeft > 700) + projectile.timeLeft = 700; + projectile.damage = (int)(projectile.damage * 0.60f); // 40% damage nerf + NPC closeTarget = projectile.Center.ClosestNPCAt(640); + Vector2 velocity = (projectile.Center.DirectionTo(closeTarget.Center) + closeTarget.velocity * 0.03f).SafeNormalize(Vector2.UnitX); + projectile.velocity = velocity * 12; + projectile.penetrate = 6; // this is for bounces, actually has pierce 4 + Player player = Main.player[projectile.owner]; + projectile.ApplyStatsFromSource(player.GetSource_FromThis()); + projectile.netUpdate = true; + projectile.ai[2] = 5; // Mark them as Volatile Gelatin origin + } } void ApplyGrapeBeer() @@ -596,7 +603,7 @@ namespace CalamityMod.Projectiles } } - if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) + if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) { Player player = Main.player[projectile.owner]; if (projectile.timeLeft == 699 && projectile.FinalExtraUpdate() && player.Calamity().volatileGelatinVisuals) @@ -4832,7 +4839,7 @@ namespace CalamityMod.Projectiles if (forcedCrit) modifiers.SetCrit(); - if (projectile.type == ProjectileID.VolatileGelatinBall && player.volatileGelatin && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) + if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) { target.AddBuff(BuffID.GelBalloonBuff, 180); @@ -5269,7 +5276,7 @@ namespace CalamityMod.Projectiles } #endregion - if (projectile.type == ProjectileID.VolatileGelatinBall && Main.player[projectile.owner].Calamity().volatileGelatinVisuals && projectile.GetSource_FromThis() == Main.player[projectile.owner].GetSource_Accessory(Main.player[projectile.owner].Calamity().FindAccessory(ItemID.VolatileGelatin))) + if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) { Texture2D texture = TextureAssets.Projectile[projectile.type].Value; float rate = (projectile.timeLeft * 0.05f); From 35127248c0c73c04b8d6416760fd813aac0426e6 Mon Sep 17 00:00:00 2001 From: Xyk Date: Tue, 4 Aug 2026 13:12:11 -0700 Subject: [PATCH 6/6] Final Fixes --- Projectiles/CalamityGlobalProjectile.cs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 332af6e24a..9d961e3dc6 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -213,6 +213,11 @@ namespace CalamityMod.Projectiles ///
public bool grapeBeer = false; + /// + /// If this proj was spawned from the Volatile Gelatin accessory + /// + public bool volatileGelatinSpawned = false; + /// /// How strong grape beer homing is on this. It speeds up the longer the target is targeted. /// @@ -377,7 +382,7 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; projectile.ApplyStatsFromSource(player.GetSource_FromThis()); projectile.netUpdate = true; - projectile.ai[2] = 5; // Mark them as Volatile Gelatin origin + volatileGelatinSpawned = true; // Mark them as Volatile Gelatin origin } } @@ -603,7 +608,7 @@ namespace CalamityMod.Projectiles } } - if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) + if (volatileGelatinSpawned) { Player player = Main.player[projectile.owner]; if (projectile.timeLeft == 699 && projectile.FinalExtraUpdate() && player.Calamity().volatileGelatinVisuals) @@ -4839,7 +4844,7 @@ namespace CalamityMod.Projectiles if (forcedCrit) modifiers.SetCrit(); - if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) + if (volatileGelatinSpawned) { target.AddBuff(BuffID.GelBalloonBuff, 180); @@ -5276,7 +5281,7 @@ namespace CalamityMod.Projectiles } #endregion - if (projectile.type == ProjectileID.VolatileGelatinBall && projectile.ai[2] == 5) + if (volatileGelatinSpawned) { Texture2D texture = TextureAssets.Projectile[projectile.type].Value; float rate = (projectile.timeLeft * 0.05f); @@ -5292,12 +5297,16 @@ namespace CalamityMod.Projectiles float fade = Utils.GetLerpValue(600, 700, projectile.timeLeft, true); int draws = 12; - for (int i = 0; i < draws; i++) + if (Main.player[projectile.owner].Calamity().volatileGelatinVisuals) { - float rotPoint = MathHelper.TwoPi / draws * i; - float dist = 3.5f * fade; - Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly) * dist, null, finalColor with { A = 0 } * 0.6f * fade, MathF.Pow(projectile.rotation, 2), texture.Size() / 2f, projectile.scale * 1.2f, SpriteEffects.None); + for (int i = 0; i < draws; i++) + { + float rotPoint = MathHelper.TwoPi / draws * i; + float dist = 1.5f * fade; + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition + rotPoint.ToRotationVector2().RotatedBy(Main.GlobalTimeWrappedHourly) * dist, null, finalColor with { A = 0 } * 0.6f * fade, MathF.Pow(projectile.rotation, 2), texture.Size() / 2f, projectile.scale * 1.2f, SpriteEffects.None); + } } + Main.EntitySpriteDraw(texture, projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, fade), projectile.rotation, texture.Size() / 2f, projectile.scale, SpriteEffects.None); shouldDrawBool = false;