From fdfdd6410c56e0ddef4fb886c3052f736c145944 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 30 Jun 2021 05:12:29 -0500 Subject: [PATCH 01/22] 1 - T Hanos adjustments. 2 - Fixed some laser issues. --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 7 ++-- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 7 ++-- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 34 +++++++++++-------- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 7 ++-- Projectiles/Boss/BirbAura.cs | 4 +-- Projectiles/Boss/BrimstoneRay.cs | 4 +-- Projectiles/Boss/ExoDestroyerBeamStart.cs | 32 ++++++++--------- Projectiles/Boss/ExoDestroyerBeamTelegraph.cs | 2 +- Projectiles/Boss/ExoDestroyerLaser.cs | 2 +- Projectiles/Boss/ProvidenceHolyRay.cs | 4 +-- 10 files changed, 52 insertions(+), 51 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index f4777b1b0f..336c494def 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -332,17 +332,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 33d377f148..3c72d6c064 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -332,17 +332,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 933b025751..1ba60c4c5a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -52,6 +52,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Whether the head is venting heat or not, it is vulnerable to damage during venting private bool vulnerable = false; + // Max time in vent phase + public const float ventDuration = 180f; + + // Spawn rate for vent clouds + public const int ventCloudSpawnRate = 5; + // Default life ratio for the other mechs private const float defaultLifeRatio = 5f; @@ -315,11 +321,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Phase gate values float velocityAdjustTime = 20f; - float speedUpTime = 480f; - float slowDownTime = 120f; + float speedUpTime = berserk ? 360f : 480f; + float slowDownTime = berserk ? 90f : 120f; float chargePhaseGateValue = speedUpTime + slowDownTime; - float laserBarrageDuration = 420f; + float laserBarrageDuration = berserk ? 330f : 420f; // Adjust opacity bool invisiblePhase = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune; @@ -361,8 +367,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float turnDegrees = baseVelocity * 0.11f; if (berserk) { - baseVelocity *= 1.2f; - turnDegrees *= 1.2f; + baseVelocity *= 1.25f; + turnDegrees *= 1.25f; } float turnSpeed = MathHelper.ToRadians(turnDegrees); float chargeVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar); @@ -380,7 +386,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float deathrayVelocityScalarIncrement = 1f / deathrayDuration; // Scalar to use during laser barrage, passive and immune phases - float laserBarrageVelocityScalarIncrement = 0.01f; + float laserBarrageVelocityScalarIncrement = berserk ? 0.02f : 0.01f; float laserBarrageVelocityScalarDecrement = 1f / velocityAdjustTime; // Distance from target @@ -547,7 +553,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= velocityAdjustTime) { - npc.localAI[0] = /*berserk ? 1f : 0f*/ 1f; + npc.localAI[0] = (berserk || otherExoMechsAlive == 0) ? 1f : 0f; AIState = (float)Phase.Charge; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; @@ -567,7 +573,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos vulnerable = true; // If close enough to the target, prepare to fire deathray - bool readyToFireDeathray = distanceFromTarget < 800f; + bool readyToFireDeathray = distanceFromTarget < 960f; if (readyToFireDeathray) npc.localAI[2] = 1f; @@ -599,8 +605,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Gradually turn and move slower if within 50 tiles of the target if (npc.localAI[2] == 1f) { - baseVelocity *= distanceFromTarget / 800f; - turnSpeed *= distanceFromTarget / 800f; + float velocityScale = distanceFromTarget / 960f; + baseVelocity *= velocityScale; + turnSpeed *= velocityScale; if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) { @@ -638,7 +645,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI); + int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, npc.whoAmI); if (Main.projectile.IndexInRange(laser)) Main.projectile[laser].ai[0] = npc.whoAmI; } @@ -680,12 +687,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent"), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[1] += 1f; - if (npc.localAI[1] < maxSteamTime) + if (npc.localAI[1] < ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ventCloudSpawnRate; } } else diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 2f718d7be1..fefee3b33b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -331,17 +331,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.25f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); // Steam - float maxSteamTime = 180f; npc.localAI[0] += 1f; - if (npc.localAI[0] < maxSteamTime) + if (npc.localAI[0] < ThanatosHead.ventDuration) { SmokeDrawer.BaseMoveRotation = npc.rotation - MathHelper.PiOver2; - SmokeDrawer.ParticleSpawnRate = 3; + SmokeDrawer.ParticleSpawnRate = ThanatosHead.ventCloudSpawnRate; } } else diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index a57b17780b..908b1c6c34 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 0, texture.Width, texture.Height); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Boss spriteBatch.Draw(texture, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += texture.Height; if (rectangle7.Y + rectangle7.Height > texture.Height) { rectangle7.Y = 0; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 20fca4c374..642067453c 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 0, texture2D20.Width, texture2D20.Height); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Boss spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += texture2D20.Height; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { rectangle7.Y = 0; diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 1c88e0cb97..7f8be06b35 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -24,14 +24,13 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Thanatos Deathray"); - Main.projFrames[projectile.type] = 4; } public override void SetDefaults() { projectile.Calamity().canBreakPlayerDefense = true; - projectile.width = 32; - projectile.height = 32; + projectile.width = 30; + projectile.height = 30; projectile.hostile = true; projectile.alpha = 255; projectile.penetrate = -1; @@ -71,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); // Offset to move the beam forward so that it starts inside the NPC's mouth. - float beamStartForwardsOffset = -18f; + float beamStartForwardsOffset = -8f; // Set the starting location of the beam to the center of the NPC. projectile.Center = ThingToAttachTo.Center; @@ -80,11 +79,6 @@ namespace CalamityMod.Projectiles.Boss // Add the forwards offset, measured in pixels. projectile.position += hostNPCDirection * beamStartForwardsOffset; - projectile.rotation = ThingToAttachTo.velocity.ToRotation(); - - Time++; - - float scale = 1f; Time++; if (Time >= Lifetime) { @@ -92,13 +86,16 @@ namespace CalamityMod.Projectiles.Boss return; } - projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; + float scale = 1f; + projectile.scale = (float)Math.Sin(Time * MathHelper.Pi / Lifetime) * 10f * scale; if (projectile.scale > scale) projectile.scale = scale; projectile.rotation = ThingToAttachTo.velocity.ToRotation(); projectile.velocity = projectile.rotation.ToRotationVector2(); + projectile.rotation = ThingToAttachTo.velocity.ToRotation() - MathHelper.PiOver2; + float arraySize = 3f; Vector2 samplingPoint = projectile.Center; float[] samples = new float[(int)arraySize]; @@ -121,6 +118,7 @@ namespace CalamityMod.Projectiles.Boss float divisor = expertMode ? 80f : 160f; if (ThingToAttachTo.Calamity().newAI[2] % divisor == 0f && projectile.owner == Main.myPlayer) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), ThingToAttachTo.Center); Vector2 velocity = projectile.velocity; velocity.Normalize(); float distanceBetweenProjectiles = malice ? 160f : death ? 256f : revenge ? 288f : 320f; @@ -134,7 +132,7 @@ namespace CalamityMod.Projectiles.Boss float radians = MathHelper.TwoPi / totalProjectiles; for (int j = 0; j < totalProjectiles; j++) { - Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); + Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; Projectile.NewProjectile(fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); } fireFrom += velocity * distanceBetweenProjectiles; @@ -197,11 +195,11 @@ namespace CalamityMod.Projectiles.Boss Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamEnd"); float drawLength = LengthOfLaser; - Color color = new Color(250, 0, 0, 0); + Color color = new Color(250, 100, 100, 0); // Draw start of beam Vector2 vector = projectile.Center - Main.screenPosition; - Rectangle? sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamStart.Width, 16); + Rectangle? sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamStart.Width, 30); spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, beamStart.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); // Draw middle of beam @@ -211,7 +209,7 @@ namespace CalamityMod.Projectiles.Boss if (drawLength > 0f) { float i = 0f; - Rectangle rectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamMiddle.Width, 16); + Rectangle rectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamMiddle.Width, 30); while (i + 1f < drawLength) { if (drawLength - i < rectangle.Height) @@ -222,7 +220,7 @@ namespace CalamityMod.Projectiles.Boss i += rectangle.Height * projectile.scale; center += projectile.velocity * rectangle.Height * projectile.scale; - rectangle.Y += 16; + rectangle.Y += 30; if (rectangle.Y + rectangle.Height > beamMiddle.Height) rectangle.Y = 0; } @@ -230,7 +228,7 @@ namespace CalamityMod.Projectiles.Boss // Draw end of beam Vector2 vector2 = center - Main.screenPosition; - sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / Main.projFrames[projectile.type] % 5), beamEnd.Width, 16); + sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamEnd.Width, 30); spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, beamEnd.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); return false; @@ -249,7 +247,7 @@ namespace CalamityMod.Projectiles.Boss return true; float collisionPoint = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 22f * projectile.scale, ref collisionPoint)) + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LengthOfLaser, 30f * projectile.scale, ref collisionPoint)) return true; return false; diff --git a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs index cd9d0560cf..2d4932b5a6 100644 --- a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs +++ b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); // Offset to move the beam forward so that it starts inside the NPC's mouth. - float beamStartForwardsOffset = -18f; + float beamStartForwardsOffset = -8f; // Set the starting location of the beam to the center of the NPC. projectile.Center = ThingToAttachTo.Center; diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index f3456966c7..ea2ae5c374 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return new Color(255, 255, 255, projectile.alpha); + return new Color(255, 100, 100, projectile.alpha); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index bd24c91aed..e83c2fa25c 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss if (num223 > 0f) { float num224 = 0f; - Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); + Rectangle rectangle7 = new Rectangle(0, 36 * (projectile.timeLeft / 3 % 4), texture2D20.Width, 36); while (num224 + 1f < num223) { if (num223 - num224 < rectangle7.Height) @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); num224 += rectangle7.Height * projectile.scale; value20 += projectile.velocity * rectangle7.Height * projectile.scale; - rectangle7.Y += 16; + rectangle7.Y += 36; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { rectangle7.Y = 0; From 99949c4cfb6e536dd283a9ba0b965ff0a8320e0d Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 30 Jun 2021 05:53:12 -0500 Subject: [PATCH 02/22] 1 - T Hanos beam fix. --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 3 ++- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 3 ++- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 3 ++- Projectiles/Boss/ExoDestroyerBeamStart.cs | 14 +++++++------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 336c494def..7272862e21 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -191,6 +191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center); for (int i = 0; i < numProjectiles; i++) { // Normal laser @@ -332,7 +333,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 3c72d6c064..d8cbd65c2d 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -191,6 +191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center); for (int i = 0; i < numProjectiles; i++) { // Normal laser @@ -332,7 +333,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index fefee3b33b..4a46235a1b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -190,6 +190,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon").WithVolume(0.1f), npc.Center); for (int i = 0; i < numProjectiles; i++) { // Normal laser @@ -331,7 +332,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (vulnerable) { // Noise - float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.15f : 1f; + float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (npc.localAI[0] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ThanatosVent").WithVolume(volume), npc.Center); diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 7f8be06b35..18cb45e199 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -194,18 +194,18 @@ namespace CalamityMod.Projectiles.Boss Texture2D beamMiddle = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamMiddle"); Texture2D beamEnd = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ExoDestroyerBeamEnd"); - float drawLength = LengthOfLaser; + float drawLength = LengthOfLaser; Color color = new Color(250, 100, 100, 0); // Draw start of beam Vector2 vector = projectile.Center - Main.screenPosition; Rectangle? sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamStart.Width, 30); - spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, beamStart.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(beamStart, vector, sourceRectangle, color, projectile.rotation, new Vector2(32f, 30f) / 2f, projectile.scale, SpriteEffects.None, 0f); // Draw middle of beam - drawLength -= (beamStart.Height / 2 + beamEnd.Height) * projectile.scale; + drawLength -= (beamStart.Height / 4 / 2 + beamEnd.Height / 4) * projectile.scale; Vector2 center = projectile.Center; - center += projectile.velocity * projectile.scale * beamStart.Height / 2f; + center += projectile.velocity * projectile.scale * beamStart.Height / 4f / 2f; if (drawLength > 0f) { float i = 0f; @@ -215,13 +215,13 @@ namespace CalamityMod.Projectiles.Boss if (drawLength - i < rectangle.Height) rectangle.Height = (int)(drawLength - i); - spriteBatch.Draw(beamMiddle, center - Main.screenPosition, rectangle, color, projectile.rotation, new Vector2(rectangle.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(beamMiddle, center - Main.screenPosition, rectangle, color, projectile.rotation, new Vector2(rectangle.Width / 2f, 0f), projectile.scale, SpriteEffects.None, 0f); i += rectangle.Height * projectile.scale; center += projectile.velocity * rectangle.Height * projectile.scale; rectangle.Y += 30; - if (rectangle.Y + rectangle.Height > beamMiddle.Height) + if (rectangle.Y + rectangle.Height > beamMiddle.Height / 4) rectangle.Y = 0; } } @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Boss // Draw end of beam Vector2 vector2 = center - Main.screenPosition; sourceRectangle = new Rectangle(0, 30 * (projectile.timeLeft / 3 % 4), beamEnd.Width, 30); - spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, beamEnd.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(beamEnd, vector2, sourceRectangle, color, projectile.rotation, new Vector2(28f, 30f) / 2f, projectile.scale, SpriteEffects.None, 0f); return false; } From e680a17471c9544aaf471b63c1c18a350cd61a10 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 30 Jun 2021 05:57:10 -0500 Subject: [PATCH 03/22] 1 - T Hanos worm deathray velocity adjustment. --- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 1ba60c4c5a..f8d5f87797 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -573,7 +573,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos vulnerable = true; // If close enough to the target, prepare to fire deathray - bool readyToFireDeathray = distanceFromTarget < 960f; + float slowDownDistance = 800f; + bool readyToFireDeathray = distanceFromTarget < slowDownDistance; if (readyToFireDeathray) npc.localAI[2] = 1f; @@ -605,7 +606,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Gradually turn and move slower if within 50 tiles of the target if (npc.localAI[2] == 1f) { - float velocityScale = distanceFromTarget / 960f; + // Exponentially scale down velocity if close to the target + float velocityScale = distanceFromTarget / slowDownDistance; + if (velocityScale < 1f) + velocityScale *= velocityScale; + baseVelocity *= velocityScale; turnSpeed *= velocityScale; From 946818b1d4f13a3b5a69239c2780edb0cfb900b4 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 30 Jun 2021 14:11:27 -0500 Subject: [PATCH 04/22] T Hanos --- Projectiles/Boss/ExoDestroyerBeamStart.cs | 2 +- Projectiles/Boss/ExoDestroyerLaser.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 18cb45e199..b1c4ec134c 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos Deathray"); + DisplayName.SetDefault("T Hanos Deathray"); } public override void SetDefaults() diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index ea2ae5c374..25ff49f22e 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos Beam"); + DisplayName.SetDefault("T Hanos Beam"); Main.projFrames[projectile.type] = 4; } From 0983b00bcb475400f5bb276d1286f3f1f0e76e91 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 30 Jun 2021 23:39:00 -0400 Subject: [PATCH 05/22] Removed Enchanted Metal. --- Items/Materials/EnchantedMetal.cs | 42 ----------------------------- Items/Materials/EnchantedMetal.png | Bin 332 -> 0 bytes NPCs/TownNPCs/DILF.cs | 2 -- 3 files changed, 44 deletions(-) delete mode 100644 Items/Materials/EnchantedMetal.cs delete mode 100644 Items/Materials/EnchantedMetal.png diff --git a/Items/Materials/EnchantedMetal.cs b/Items/Materials/EnchantedMetal.cs deleted file mode 100644 index d5bfd938e7..0000000000 --- a/Items/Materials/EnchantedMetal.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class EnchantedMetal : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Metal"); - } - public override void SetDefaults() - { - item.width = 26; - item.height = 20; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = ItemRarityID.Pink; - item.maxStack = 99; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(item.type, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.MechanicalEye); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(item.type, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.MechanicalSkull); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(item.type, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.MechanicalWorm); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Materials/EnchantedMetal.png b/Items/Materials/EnchantedMetal.png deleted file mode 100644 index bd175ca8e906b79bf547c5f41ef8fcc6bef192ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)i!3HEJJLv8MQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjKtYKT*NBqf{Irtt#G+J&g2c?c61}|C5(N`I zLp{S}tvTL6HG4f>978<3kMg8*N7H74gxP0- zx`xEwn}1L0r`@R3Z;3Bn(O2vBR>#(R!`fRjaGoQJPz7~ToAGQa&>?5%&&U;ISdrI4y@*SFjf4cW9u76L*+}h<%=6q z#5HF`es2(bSzXcgUu||rJj;TFv|VaZq7#yoxFTAub~8=#brD#0?cDct&P~h9-l??k ZuhyI^w0O?s5THjGJYD@<);T3K0RSYfe&hfE diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index a6c895266a..9f787d9d47 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -183,8 +183,6 @@ namespace CalamityMod.NPCs.TownNPCs nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; - shop.item[nextSlot].SetDefaults(ModContent.ItemType()); - nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(5, 0, 0, 0); nextSlot++; From 77298336bd43cfd628c74c7b997fb889bd71f574 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 29 Jun 2021 07:52:21 -0500 Subject: [PATCH 06/22] Tainted slasher draw issue fixes --- Projectiles/Melee/TaintedBladeSlasher.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 7d493cda46..30b8eace4f 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -16,7 +16,16 @@ namespace CalamityMod.Projectiles.Melee public ref float SwordItemID => ref projectile.ai[1]; public ref float VerticalOffset => ref projectile.localAI[0]; public ref float Time => ref projectile.localAI[1]; - public float AttackCompletionRatio => 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; + public float AttackCompletionRatio + { + get + { + float completionRatio = 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; + if (float.IsNaN(completionRatio) || float.IsInfinity(completionRatio)) + completionRatio = 0f; + return completionRatio; + } + } public Player Owner => Main.player[projectile.owner]; public int Variant => (int)projectile.ai[0] % 2; @@ -124,6 +133,9 @@ namespace CalamityMod.Projectiles.Melee return; } + if (Owner.itemAnimationMax == 0) + Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.meleeSpeed); + float swingOffsetAngle = MathHelper.SmoothStep(-1.87f, 3.79f, AttackCompletionRatio); // Offset a little bit angularly if the secondary variant to prevent complete overlap. From 4e14bc143293f4d5e76192f2116d6150acb7bdea Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 29 Jun 2021 18:25:23 -0500 Subject: [PATCH 07/22] Atom splitter multi-hit problem fix --- Projectiles/Rogue/TheAtomSplitterProjectile.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index abc384ed25..cb23b8ba13 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -158,9 +158,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { ReleaseHitDust(target.Center - projectile.velocity * 3f); - HitTargetIndex = target.whoAmI; - projectile.timeLeft = projectile.Calamity().stealthStrike ? 100 : 60; - projectile.netUpdate = true; + if (!Main.npc.IndexInRange((int)HitTargetIndex)) + { + HitTargetIndex = target.whoAmI; + projectile.timeLeft = projectile.Calamity().stealthStrike ? 100 : 60; + projectile.netUpdate = true; + } } } } From 041c5b249b1b8035aa171010687c7c800bb3d096 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 29 Jun 2021 18:25:34 -0500 Subject: [PATCH 08/22] Universe Splitter fixes --- Projectiles/Summon/UniverseSplitterHugeBeam.cs | 8 ++++---- Projectiles/Summon/UniverseSplitterSmallBeam.cs | 17 +---------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Projectiles/Summon/UniverseSplitterHugeBeam.cs b/Projectiles/Summon/UniverseSplitterHugeBeam.cs index 5a211b41f3..fa8adf72e8 100644 --- a/Projectiles/Summon/UniverseSplitterHugeBeam.cs +++ b/Projectiles/Summon/UniverseSplitterHugeBeam.cs @@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = MathHelper.Lerp(LaserSize, 0f, 1f - (projectile.timeLeft / (float)TotalFadeoutTime)); } - Vector2 samplingPoint = projectile.Center; + Vector2 samplingPoint = projectile.Top; - float[] samples = new float[3]; + float[] samples = new float[12]; float determinedLength = 0f; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength + 72f, samples); + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength, samples); for (int i = 0; i < samples.Length; i++) { determinedLength += samples[i]; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.3f, MaximumLength); float lerpDelta = 0.5f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength - 20f, lerpDelta); if (projectile.localAI[0] < 30f) { projectile.localAI[1] = MathHelper.Lerp(72f, projectile.localAI[1], projectile.localAI[0] / 30f); diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.cs b/Projectiles/Summon/UniverseSplitterSmallBeam.cs index 02d9aad775..8a177e8a5a 100644 --- a/Projectiles/Summon/UniverseSplitterSmallBeam.cs +++ b/Projectiles/Summon/UniverseSplitterSmallBeam.cs @@ -87,22 +87,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = MathHelper.Lerp(3.25f, 0.01f, (projectile.localAI[0] - (TimeLeft - 15f)) / 15f); } - Vector2 samplingPoint = projectile.Center; - - float[] samples = new float[3]; - - float determinedLength = 0f; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength, samples); - for (int i = 0; i < samples.Length; i++) - { - determinedLength += samples[i]; - } - determinedLength /= samples.Length; - - determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.5f, MaximumLength); - - float lerpDelta = 0.5f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], MaximumLength, 0.5f); Vector2 beamEndPosiiton = projectile.Center + projectile.velocity * (projectile.localAI[1] - 6f); // Draw white light across the laser From 938d8802caf7475b59164a2d9a85c2e094a103d5 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 1 Jul 2021 08:36:13 -0500 Subject: [PATCH 09/22] 1 - A few more Thanatos changes. --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 9 +-- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 9 +-- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 58 +++++++++++++++++-- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 9 +-- Projectiles/Boss/ExoDestroyerBeamStart.cs | 2 +- Projectiles/Boss/ExoDestroyerBeamTelegraph.cs | 2 +- 6 files changed, 71 insertions(+), 18 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 7272862e21..d362e877f6 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -139,8 +139,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.localAI[2] == 0f) npc.localAI[2] = npc.ai[0]; - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; - if (shootTrackingLasers) + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + if (shootLasers && !invisiblePhase) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -423,9 +423,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; npc.frameCounter += 1D; - if (shootTrackingLasers) + if (shootLasers && !invisiblePhase) { if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index d8cbd65c2d..83fb0b7418 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -139,8 +139,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.localAI[2] == 0f) npc.localAI[2] = npc.ai[0]; - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; - if (shootTrackingLasers) + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + if (shootLasers && !invisiblePhase) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -423,9 +423,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; npc.frameCounter += 1D; - if (shootTrackingLasers) + if (shootLasers && !invisiblePhase) { if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index f8d5f87797..f99e7db5b4 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -402,7 +402,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (phase2 && !berserk) { + // Reset everything SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); + if (Main.netMode != NetmodeID.MultiplayerClient) { // Spawn code here @@ -416,14 +424,29 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Do not run this if any exo mech is dead if ((anyOtherExoMechPassive || lessThan70PercentLife) && !berserk && totalOtherExoMechLifeRatio < 5f) { - // Tells Thanatos to return to the battle in passive state + // Tells Thanatos to return to the battle in passive state and reset everything SecondaryAIState = (float)SecondaryPhase.Passive; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); } // Go passive and immune if one of the other mechs is berserk // This is only called if two exo mechs are alive if (otherMechIsBerserk) + { + // Reset everything SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); + } } break; @@ -436,13 +459,28 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Enter passive and invincible phase if one of the other exo mechs is berserk if (otherMechIsBerserk) + { + // Reset everything SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); + } // If Thanatos is the first mech to go berserk if (berserk) { - // Reset + // Reset everything AIState = (float)Phase.Charge; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); // Never be passive if berserk SecondaryAIState = (float)SecondaryPhase.Nothing; @@ -459,15 +497,27 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Enter the fight again if any of the other exo mechs is below 70% and the other mechs aren't berserk if ((exoPrimeLifeRatio < 0.7f || exoSpazLifeRatio < 0.7f || exoRetLifeRatio < 0.7f) && !otherMechIsBerserk) { - // Tells Thanatos to return to the battle in passive state + // Tells Thanatos to return to the battle in passive state and reset everything // Return to normal phases if one or more mechs have been downed SecondaryAIState = totalOtherExoMechLifeRatio > 5f ? (float)SecondaryPhase.Nothing : (float)SecondaryPhase.Passive; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); } if (berserk) { - // Reset + // Reset everything AIState = (float)Phase.Charge; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + npc.TargetClosest(); // Never be passive if berserk SecondaryAIState = (float)SecondaryPhase.Nothing; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 4a46235a1b..1d3724bd5b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -138,8 +138,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.localAI[2] == 0f) npc.localAI[2] = npc.ai[0]; - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; - if (shootTrackingLasers) + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + if (shootLasers && !invisiblePhase) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -422,9 +422,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Swap between venting and non-venting frames CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)npc.ai[2]].Calamity(); - bool shootTrackingLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; + bool invisiblePhase = calamityGlobalNPC_Head.newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; + bool shootLasers = (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge || calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.UndergroundLaserBarrage) && calamityGlobalNPC_Head.newAI[2] > 0f; npc.frameCounter += 1D; - if (shootTrackingLasers) + if (shootLasers && !invisiblePhase) { if (npc.Calamity().newAI[1] == 0f && npc.Calamity().newAI[0] > 0f) { diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index b1c4ec134c..82544af0bf 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Boss bool expertMode = Main.expertMode || malice; // Die if the thing to attach to disappears. - if (ThingToAttachTo is null || !ThingToAttachTo.active) + if (ThingToAttachTo is null || !ThingToAttachTo.active || ThingToAttachTo.Calamity().newAI[0] != 2f) { projectile.Kill(); return; diff --git a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs index 2d4932b5a6..0bc632e560 100644 --- a/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs +++ b/Projectiles/Boss/ExoDestroyerBeamTelegraph.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { // Die if the thing to attach to disappears. - if (ThingToAttachTo is null || !ThingToAttachTo.active) + if (ThingToAttachTo is null || !ThingToAttachTo.active || ThingToAttachTo.Calamity().newAI[0] != 2f) { projectile.Kill(); return; From e29e50bc6a42cc1e46534aec02beb799b8e04bd3 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 1 Jul 2021 08:52:14 -0500 Subject: [PATCH 10/22] 1 - Despawn fixes. --- NPCs/Abyss/EidolonWyrmHeadHuge.cs | 39 ++++++++------ NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 72 +++++++++++++++----------- 2 files changed, 65 insertions(+), 46 deletions(-) diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 4ecf4c442c..6caecaa131 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -214,12 +214,14 @@ namespace CalamityMod.NPCs.Abyss } // Despawn if target is dead + bool targetDead = false; if (player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; if (player.dead) { + targetDead = true; npc.ai[3] = 0f; npc.localAI[0] = 0f; npc.localAI[1] = 0f; @@ -1303,26 +1305,29 @@ namespace CalamityMod.NPCs.Abyss } } - // Increase velocity if velocity is ever zero - if (npc.velocity == Vector2.Zero) - npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity; - - // Acceleration - if (!((destination - npc.Center).Length() < turnDistance)) + if (!targetDead) { - float targetAngle = npc.AngleTo(destination); - float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); - npc.velocity = f.ToRotationVector2() * baseVelocity; + // Increase velocity if velocity is ever zero + if (npc.velocity == Vector2.Zero) + npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity; + + // Acceleration + if (!((destination - npc.Center).Length() < turnDistance)) + { + float targetAngle = npc.AngleTo(destination); + float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); + npc.velocity = f.ToRotationVector2() * baseVelocity; + } + + // Velocity upper limit + if (npc.velocity.Length() > baseVelocity) + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; + + // Reduce Y velocity if it's less than 1 + if (Math.Abs(npc.velocity.Y) < 1f) + npc.velocity.Y -= 0.1f; } - // Velocity upper limit - if (npc.velocity.Length() > baseVelocity) - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; - - // Reduce Y velocity if it's less than 1 - if (Math.Abs(npc.velocity.Y) < 1f) - npc.velocity.Y -= 0.1f; - // Storm code if (calamityGlobalNPC.newAI[3] == 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index f99e7db5b4..22bfd7e3c3 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -274,20 +274,31 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Despawn if target is dead - if (player.dead) - { - npc.TargetClosest(false); - - npc.velocity.Y += 2f; - if (npc.position.Y > Main.worldSurface * 16.0) - npc.velocity.Y += 2f; - - if (npc.position.Y > Main.rockLayer * 16.0) + bool targetDead = false; + if (player.dead) + { + npc.TargetClosest(false); + player = Main.player[npc.target]; + if (player.dead) { - for (int a = 0; a < Main.maxNPCs; a++) + targetDead = true; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + chargeVelocityScalar = 0f; + + npc.velocity.Y += 2f; + if (npc.position.Y > Main.worldSurface * 16.0) + npc.velocity.Y += 2f; + + if (npc.position.Y > Main.rockLayer * 16.0) { - if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) - Main.npc[a].active = false; + for (int a = 0; a < Main.maxNPCs; a++) + { + if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) + Main.npc[a].active = false; + } } } } @@ -754,25 +765,28 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos SmokeDrawer.Update(); - // Increase velocity if velocity is ever zero - if (npc.velocity == Vector2.Zero) - npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity; - - // Acceleration - if (!((destination - npc.Center).Length() < turnDistance)) + if (!targetDead) { - float targetAngle = npc.AngleTo(destination); - float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); - npc.velocity = f.ToRotationVector2() * baseVelocity; + // Increase velocity if velocity is ever zero + if (npc.velocity == Vector2.Zero) + npc.velocity = Vector2.Normalize(player.Center - npc.Center).SafeNormalize(Vector2.Zero) * baseVelocity; + + // Acceleration + if (!((destination - npc.Center).Length() < turnDistance)) + { + float targetAngle = npc.AngleTo(destination); + float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); + npc.velocity = f.ToRotationVector2() * baseVelocity; + } + + // Velocity upper limit + if (npc.velocity.Length() > baseVelocity) + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; + + // Reduce Y velocity if it's less than 1 + if (Math.Abs(npc.velocity.Y) < 1f) + npc.velocity.Y -= 0.1f; } - - // Velocity upper limit - if (npc.velocity.Length() > baseVelocity) - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; - - // Reduce Y velocity if it's less than 1 - if (Math.Abs(npc.velocity.Y) < 1f) - npc.velocity.Y -= 0.1f; } public override bool CanHitPlayer(Player target, ref int cooldownSlot) From d90975cc9b4fa054d5ad37623920e774517f3bc4 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 2 Jul 2021 12:24:28 -0500 Subject: [PATCH 11/22] 1 - Thanatos and Wyrm fix. 2 - Buffed Briny Baron true melee. --- Items/Weapons/Melee/BrinyBaron.cs | 4 ++-- NPCs/Abyss/EidolonWyrmHeadHuge.cs | 16 ++++++++-------- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 0af9ef496d..d7851ac814 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -78,12 +78,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.5f), knockback, player.whoAmI); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.5f), item.knockBack, player.whoAmI); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI); } } } diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 6caecaa131..0b85bae021 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -1318,16 +1318,16 @@ namespace CalamityMod.NPCs.Abyss float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); npc.velocity = f.ToRotationVector2() * baseVelocity; } - - // Velocity upper limit - if (npc.velocity.Length() > baseVelocity) - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; - - // Reduce Y velocity if it's less than 1 - if (Math.Abs(npc.velocity.Y) < 1f) - npc.velocity.Y -= 0.1f; } + // Velocity upper limit + if (npc.velocity.Length() > baseVelocity) + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; + + // Reduce Y velocity if it's less than 1 + if (Math.Abs(npc.velocity.Y) < 1f) + npc.velocity.Y -= 0.1f; + // Storm code if (calamityGlobalNPC.newAI[3] == 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 22bfd7e3c3..1c77ac9bb2 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -778,15 +778,15 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float f = npc.velocity.ToRotation().AngleTowards(targetAngle, turnSpeed); npc.velocity = f.ToRotationVector2() * baseVelocity; } - - // Velocity upper limit - if (npc.velocity.Length() > baseVelocity) - npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; - - // Reduce Y velocity if it's less than 1 - if (Math.Abs(npc.velocity.Y) < 1f) - npc.velocity.Y -= 0.1f; } + + // Velocity upper limit + if (npc.velocity.Length() > baseVelocity) + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * baseVelocity; + + // Reduce Y velocity if it's less than 1 + if (Math.Abs(npc.velocity.Y) < 1f) + npc.velocity.Y -= 0.1f; } public override bool CanHitPlayer(Player target, ref int cooldownSlot) From b5eb789fa8d1d23eb6fad717c0a34d3d6aea58a0 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 3 Jul 2021 07:59:29 -0500 Subject: [PATCH 12/22] 1 - Adjusted some DR values. 2 - Adjusted polter's rotation code. --- CalamityMod.cs | 10 +++++----- NPCs/Polterghast/PolterPhantom.cs | 11 ++++++++--- NPCs/Polterghast/Polterghast.cs | 11 ++++++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 68f5bea4fb..ffefc5e402 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -410,14 +410,14 @@ namespace CalamityMod { NPCID.Crab, 0.05f }, { NPCID.Crawdad, 0.2f }, { NPCID.Crawdad2, 0.2f }, - { NPCID.CultistBoss, 0.1f }, + { NPCID.CultistBoss, 0.15f }, { NPCID.DD2Betsy, 0.1f }, { NPCID.DD2OgreT2, 0.1f }, { NPCID.DD2OgreT3, 0.15f }, { NPCID.DeadlySphere, 0.4f }, { NPCID.DiabolistRed, 0.2f }, { NPCID.DiabolistWhite, 0.2f }, - { NPCID.DukeFishron, 0.1f }, + { NPCID.DukeFishron, 0.15f }, { NPCID.DungeonGuardian, 0.999999f }, { NPCID.DungeonSpirit, 0.2f }, { NPCID.ElfCopter, 0.15f }, @@ -451,9 +451,9 @@ namespace CalamityMod { NPCID.MartianTurret, 0.2f }, { NPCID.MartianWalker, 0.35f }, { NPCID.Mimic, 0.3f }, - { NPCID.MoonLordCore, 0.05f }, - { NPCID.MoonLordHand, 0.05f }, - { NPCID.MoonLordHead, 0.05f }, + { NPCID.MoonLordCore, 0.15f }, + { NPCID.MoonLordHand, 0.15f }, + { NPCID.MoonLordHead, 0.15f }, { NPCID.Mothron, 0.2f }, { NPCID.MothronEgg, 0.5f }, { NPCID.MourningWood, 0.1f }, diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index c4f8ab0315..2e03fb5649 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -148,9 +148,14 @@ namespace CalamityMod.NPCs.Polterghast Vector2 rotationVector = lookAt - vector; // Rotation - float num740 = player.Center.X + predictionVector.X - vector.X; - float num741 = player.Center.Y + predictionVector.Y - vector.Y; - npc.rotation = (float)Math.Atan2(num741, num740) + MathHelper.PiOver2; + if (npc.Calamity().newAI[3] == 0f) + { + float num740 = player.Center.X + predictionVector.X - vector.X; + float num741 = player.Center.Y + predictionVector.Y - vector.Y; + npc.rotation = (float)Math.Atan2(num741, num740) + MathHelper.PiOver2; + } + else + npc.rotation = npc.velocity.ToRotation() + MathHelper.PiOver2; npc.damage = npc.defDamage; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 07781cbfa9..e1f13ad9d5 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -340,9 +340,14 @@ namespace CalamityMod.NPCs.Polterghast Vector2 rotationVector = lookAt - vector; // Rotation - float num740 = player.Center.X + predictionVector.X - vector.X; - float num741 = player.Center.Y + predictionVector.Y - vector.Y; - npc.rotation = (float)Math.Atan2(num741, num740) + MathHelper.PiOver2; + if (calamityGlobalNPC.newAI[3] == 0f) + { + float num740 = player.Center.X + predictionVector.X - vector.X; + float num741 = player.Center.Y + predictionVector.Y - vector.Y; + npc.rotation = (float)Math.Atan2(num741, num740) + MathHelper.PiOver2; + } + else + npc.rotation = npc.velocity.ToRotation() + MathHelper.PiOver2; if (!chargePhase) { From 3c879309a2db8b68be8abd2875dd1e10585fb05a Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 3 Jul 2021 16:30:44 -0500 Subject: [PATCH 13/22] 1 - Nerfed the damage bonus that true melee projectile weapons get from melee speed by 50%. --- CalPlayer/CalamityPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 280eac5611..1244d33c78 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5345,7 +5345,7 @@ namespace CalamityMod.CalPlayer { // Add more true melee damage to the true melee projectile that scales with melee speed // This is done because melee speed does nothing to melee weapons that are purely projectiles - damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f); + damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f * 0.5f); } if (screwdriver) From ced92dad2bb150d0f3824b0472f1d803c09448e8 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 4 Jul 2021 08:30:43 -0500 Subject: [PATCH 14/22] 1 - Increased Plantera and Golem body HP. 2 - Nerfed the true melee projectile melee speed damage increase a bit more. --- CalPlayer/CalamityPlayer.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1244d33c78..8446a8b92a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5345,7 +5345,7 @@ namespace CalamityMod.CalPlayer { // Add more true melee damage to the true melee projectile that scales with melee speed // This is done because melee speed does nothing to melee weapons that are purely projectiles - damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f * 0.5f); + damageMult += trueMeleeDamage + ((1f - player.meleeSpeed) * (100f / player.meleeSpeed) / 100f * 0.25f); } if (screwdriver) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 093719ee1f..a5b03df850 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1218,7 +1218,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.Golem) { - npc.lifeMax = (int)(npc.lifeMax * 3.5); + npc.lifeMax = (int)(npc.lifeMax * 4.0); npc.npcSlots = 64f; } else if (npc.type == NPCID.GolemHead) @@ -1232,7 +1232,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.Plantera) { - npc.lifeMax = (int)(npc.lifeMax * 2.35); + npc.lifeMax = (int)(npc.lifeMax * 2.6); npc.npcSlots = 32f; } else if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye) From 3f8a6c175f7dd195df28d52a3bff96de0b6e0729 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 4 Jul 2021 08:59:08 -0500 Subject: [PATCH 15/22] 1 - No more pointless data being saved on items that don't require it. --- Items/CalamityGlobalItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index babd4bca52..fedf738286 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -506,7 +506,7 @@ namespace CalamityMod.Items #region SavingAndLoading public override bool NeedsSaving(Item item) { - return true; + return rogue || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0; } public override TagCompound Save(Item item) From 204b7bc4f298399e6059aa9a2e392a0e5da676fd Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 4 Jul 2021 11:50:30 -0500 Subject: [PATCH 16/22] 1 - Edited Evil Smasher to only lose 1 stack when you get hit and no longer creates fossil spikes on hit, buffed damage to compensate. 2 - Aegis Blade, Gauss Dagger, Galvanizing Glaive, Brimlance, Anarchy Blade, Ancient Crusher, Nebulash, Grand Guardian and Terra-cotta on hit projectiles now use ID static i-frames to avoid stacking damage potential on stationary/slow targets. 3 - Death Mode lightning should lag less now. 4 - Comet Quasher, Feralthorn Claymore and Greentide generate less projectiles on hit. --- CalPlayer/CalamityPlayer.cs | 4 ++- Items/Weapons/Melee/AegisBlade.cs | 10 +++---- Items/Weapons/Melee/CometQuasher.cs | 3 +- Items/Weapons/Melee/EvilSmasher.cs | 17 ++--------- Items/Weapons/Melee/FeralthornClaymore.cs | 12 +++----- Items/Weapons/Melee/Greentide.cs | 3 +- NPCs/Abyss/EidolonWyrmHeadHuge.cs | 9 ++++-- Projectiles/CalamityGlobalProjectile.cs | 2 +- Projectiles/DraedonsArsenal/GaussFlux.cs | 4 +-- Projectiles/Melee/AegisBlast.cs | 6 ++-- .../Melee/BrimlanceHellfireExplosion.cs | 6 ++-- Projectiles/Melee/BrimstoneBoom.cs | 4 ++- Projectiles/Melee/FossilSpike.cs | 9 +++--- Projectiles/Melee/Nebudust.cs | 30 +++---------------- Projectiles/Melee/RainbowBoom.cs | 4 +-- Projectiles/Melee/Spears/DiseasedPikeSpear.cs | 2 +- Projectiles/Melee/TerracottaExplosion.cs | 4 ++- 17 files changed, 49 insertions(+), 80 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8446a8b92a..f08afc88e9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7390,7 +7390,9 @@ namespace CalamityMod.CalPlayer } } - evilSmasherBoost = 0; + if (evilSmasherBoost > 0) + evilSmasherBoost -= 1; + hellbornBoost = 0; if (amidiasBlessing) diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index da53e41c6b..a6de95ecd1 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -66,26 +66,24 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 0.6), knockBack, player.whoAmI); return false; } public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(3)) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246, 0f, 0f, 0, new Color(255, Main.DiscoG, 53)); - } + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246, 0f, 0f, 0, new Color(255, Main.DiscoG, 53)); } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/CometQuasher.cs b/Items/Weapons/Melee/CometQuasher.cs index 0c68934528..dd5aa04bda 100644 --- a/Items/Weapons/Melee/CometQuasher.cs +++ b/Items/Weapons/Melee/CometQuasher.cs @@ -56,8 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee num80 = num72 / num80; } - int num112 = 3; - for (int num113 = 0; num113 < num112; num113++) + for (int num113 = 0; num113 < 2; num113++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index f8d13e7b1e..1f1d31d5d1 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Melee Tooltip.SetDefault("EViL! sMaSH eVIl! SmAsh...ER!\n" + "For every enemy you kill this hammer gains stat bonuses\n" + "These bonuses stack until a cap is reached\n" + - "The bonuses will reset if you get hit or select a different item\n" + + "The bonus stacks will reset if you select a different item\n" + + "The bonus stacks will be reduced by 1 every time you get hit\n" + "Summons fossil spikes on enemy hits"); } @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 64; item.height = 66; item.scale = 2f; - item.damage = 50; + item.damage = 80; item.melee = true; item.useAnimation = item.useTime = 38; item.useStyle = ItemUseStyleID.SwingThrow; @@ -44,20 +45,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - OnHitEffect(target.Center, player, knockback); - if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10) player.Calamity().evilSmasherBoost += 1; } - - public override void OnHitPvp(Player player, Player target, int damage, bool crit) - { - OnHitEffect(target.Center, player, item.knockBack); - } - - private void OnHitEffect(Vector2 targetPos, Player player, float knockback) - { - Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); - } } } diff --git a/Items/Weapons/Melee/FeralthornClaymore.cs b/Items/Weapons/Melee/FeralthornClaymore.cs index c118675f4c..039b478069 100644 --- a/Items/Weapons/Melee/FeralthornClaymore.cs +++ b/Items/Weapons/Melee/FeralthornClaymore.cs @@ -51,20 +51,16 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.Venom, 300); - for (int x = 0; x < 2; x++) - Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); - for (int x = 0; x < 2; x++) - Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(BuffID.Venom, 300); - for (int x = 0; x < 2; x++) - Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); - for (int x = 0; x < 2; x++) - Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index f14af05113..90963a5a7d 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -60,8 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee num80 = num72 / num80; } - int num107 = 4; - for (int num108 = 0; num108 < num107; num108++) + for (int num108 = 0; num108 < 3; num108++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 0b85bae021..c55de5c02b 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.Abyss Vector2 lightningChargeVectorFlipped = lightningChargeVector * -1f; float lightningSpawnY = 540f; Vector2 lightningSpawnLocation = new Vector2(lightningChargeVector.X, -lightningSpawnY); - int numLightningBolts = 10; + int numLightningBolts = 8; float distanceBetweenBolts = lightningSpawnY * 2f / numLightningBolts; // Velocity and turn speed values @@ -1089,16 +1089,21 @@ namespace CalamityMod.NPCs.Abyss // Lightning barrage if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[3] == 0f) { + if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < soundDistance) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), Main.player[Main.myPlayer].Center); + npc.localAI[3] = 1f; int type = ProjectileID.CultistBossLightningOrbArc; int damage = npc.GetProjectileDamage(type); for (int i = 0; i < numLightningBolts; i++) { - lightningSpawnLocation.Y += distanceBetweenBolts * i; Vector2 projectileDestination = player.Center - lightningSpawnLocation; float ai = Main.rand.Next(100); int proj = Projectile.NewProjectile(lightningSpawnLocation, npc.velocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; + lightningSpawnLocation.Y += distanceBetweenBolts; + if (i == numLightningBolts / 2) + lightningSpawnLocation.Y += distanceBetweenBolts; } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e5b2eb1430..92dbedfac3 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -416,7 +416,7 @@ namespace CalamityMod.Projectiles adultWyrmAlive = true; } - if (adultWyrmAlive) + if (adultWyrmAlive || (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses)) { if (projectile.type == ProjectileID.CultistBossFireBallClone) { diff --git a/Projectiles/DraedonsArsenal/GaussFlux.cs b/Projectiles/DraedonsArsenal/GaussFlux.cs index f89011b425..2fce06a109 100644 --- a/Projectiles/DraedonsArsenal/GaussFlux.cs +++ b/Projectiles/DraedonsArsenal/GaussFlux.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.melee = true; projectile.penetrate = -1; projectile.timeLeft = 180; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 14; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/AegisBlast.cs b/Projectiles/Melee/AegisBlast.cs index 49dc6b08a8..92d09a151d 100644 --- a/Projectiles/Melee/AegisBlast.cs +++ b/Projectiles/Melee/AegisBlast.cs @@ -23,10 +23,10 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = false; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.timeLeft = 90; + projectile.timeLeft = 60; projectile.melee = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/BrimlanceHellfireExplosion.cs b/Projectiles/Melee/BrimlanceHellfireExplosion.cs index d66774aac3..2df66b4e13 100644 --- a/Projectiles/Melee/BrimlanceHellfireExplosion.cs +++ b/Projectiles/Melee/BrimlanceHellfireExplosion.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.timeLeft = 60; projectile.melee = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 20; - } + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } public override void AI() { diff --git a/Projectiles/Melee/BrimstoneBoom.cs b/Projectiles/Melee/BrimstoneBoom.cs index 456aafe56b..b599a16e14 100644 --- a/Projectiles/Melee/BrimstoneBoom.cs +++ b/Projectiles/Melee/BrimstoneBoom.cs @@ -24,7 +24,9 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.penetrate = -1; projectile.timeLeft = 5; - } + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } public override void AI() { diff --git a/Projectiles/Melee/FossilSpike.cs b/Projectiles/Melee/FossilSpike.cs index 79a514c741..1281e38dee 100644 --- a/Projectiles/Melee/FossilSpike.cs +++ b/Projectiles/Melee/FossilSpike.cs @@ -19,14 +19,15 @@ namespace CalamityMod.Projectiles.Melee projectile.tileCollide = false; projectile.timeLeft = 300; projectile.melee = true; - } + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } public override void AI() { if (Main.rand.NextBool(5)) - { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } + projectile.frameCounter++; if (projectile.frameCounter > 4) { @@ -34,9 +35,7 @@ namespace CalamityMod.Projectiles.Melee projectile.frameCounter = 0; } if (projectile.frame > 3) - { projectile.frame = 0; - } } } } diff --git a/Projectiles/Melee/Nebudust.cs b/Projectiles/Melee/Nebudust.cs index c64faaa877..83edf2475c 100644 --- a/Projectiles/Melee/Nebudust.cs +++ b/Projectiles/Melee/Nebudust.cs @@ -24,35 +24,13 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; - } + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 6; + } public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f); - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } + Lighting.AddLight(projectile.Center, 0.5f, 0.5f, 0f); float num461 = 25f; if (projectile.ai[0] > 60f) { diff --git a/Projectiles/Melee/RainbowBoom.cs b/Projectiles/Melee/RainbowBoom.cs index c32d92735a..32bf60c5d0 100644 --- a/Projectiles/Melee/RainbowBoom.cs +++ b/Projectiles/Melee/RainbowBoom.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.timeLeft = 20; projectile.melee = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 5; } public override void AI() diff --git a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs index de846691bf..c320e0737f 100644 --- a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs +++ b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 4; i++) { - int proj = Projectile.NewProjectile(projectile.Center, projectile.velocity * 1.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner); + int proj = Projectile.NewProjectile(projectile.Center, projectile.velocity * 0.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner); Main.projectile[proj].extraUpdates += i; } } diff --git a/Projectiles/Melee/TerracottaExplosion.cs b/Projectiles/Melee/TerracottaExplosion.cs index db7dc1e6e4..9a82fbc045 100644 --- a/Projectiles/Melee/TerracottaExplosion.cs +++ b/Projectiles/Melee/TerracottaExplosion.cs @@ -23,7 +23,9 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.penetrate = -1; projectile.timeLeft = 5; - } + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } public override void AI() { From 817a82a4ce1efa34779f6dc1953e9829afaaf9e4 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 5 Jul 2021 17:38:06 -0400 Subject: [PATCH 17/22] 1 - Rage lasts less time, especially with upgrades. 2 - Prevented people from stacking rage infinitely with Shattered Community. --- CalPlayer/CalamityPlayer.cs | 4 +- CalPlayer/CalamityPlayerMiscEffects.cs | 59 ++++++++++--------- Items/PermanentBoosters/InfernalBlood.cs | 2 +- Items/PermanentBoosters/MushroomPlasmaRoot.cs | 2 +- .../RedLightningContainer.cs | 2 +- 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index f08afc88e9..04524cef87 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -345,8 +345,8 @@ namespace CalamityMod.CalPlayer public bool rageModeActive = false; public float rage = 0f; public float rageMax = 100f; // 0 to 100% by default - public static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(10); - public static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(2); + public static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default. + public static readonly int RageDurationPerBooster = CalamityUtils.SecondsToFrames(1); // Each booster is +1 second: 10, 11, 12. public int RageDuration = DefaultRageDuration; public int rageGainCooldown = 0; public static readonly int DefaultRageGainCooldown = 10; // It is pretty hard to have less than 10 iframes for any reason diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f7e789e900..9dbbd22ac4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -297,8 +297,8 @@ namespace CalamityMod.CalPlayer if (modPlayer.rageGainCooldown > 0) --modPlayer.rageGainCooldown; - // This is how much Rage will be changed by this frame. - float rageDiff = 0; + // This is how much Rage will be changed by this frame. + float rageDiff = 0; // If the player equips multiple rage generation accessories they get the max possible effect without stacking any of them. { @@ -407,42 +407,47 @@ namespace CalamityMod.CalPlayer bool rageFading = modPlayer.rageCombatFrames <= 0 && !modPlayer.heartOfDarkness && !modPlayer.shatteredCommunity; - // If Rage Mode is currently active, you smoothly lose all rage over the duration. - if (modPlayer.rageModeActive) + // If Rage Mode is currently active, you smoothly lose all rage over the duration. + if (modPlayer.rageModeActive) rageDiff -= modPlayer.rageMax / modPlayer.RageDuration; // If out of combat and NOT using Heart of Darkness or Shattered Community, Rage fades away. else if (!modPlayer.rageModeActive && rageFading) rageDiff -= modPlayer.rageMax / CalamityPlayer.RageFadeTime; - // Apply the rage change and cap rage in both directions. - modPlayer.rage += rageDiff; - if (modPlayer.rage < 0) - modPlayer.rage = 0; + // Apply the rage change and cap rage in both directions. + modPlayer.rage += rageDiff; + if (modPlayer.rage < 0) + modPlayer.rage = 0; - if (modPlayer.rage >= modPlayer.rageMax) - { - // Rage IS NOT capped while active. It can go above 100%. + if (modPlayer.rage >= modPlayer.rageMax) + { + // If Rage is not active, it is capped at 100%. if (!modPlayer.rageModeActive) - modPlayer.rage = modPlayer.rageMax; + modPlayer.rage = modPlayer.rageMax; - // Play a sound when the Rage Meter is full - if (modPlayer.playFullRageSound) - { - modPlayer.playFullRageSound = false; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y); - } - } - else - modPlayer.playFullRageSound = true; + // If using the Shattered Community, Rage is capped at 200% while it's active. + // This prevents infinitely stacking rage before a fight by standing on spikes/lava with a regen build or the Nurse handy. + else if (modPlayer.shatteredCommunity && modPlayer.rage >= 2f * modPlayer.rageMax) + modPlayer.rage = 2f * modPlayer.rageMax; - // This is how much Adrenaline will be changed by this frame. - float adrenalineDiff = 0; - bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType()); - bool wofAndNotHell = Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16); + // Play a sound when the Rage Meter is full + if (modPlayer.playFullRageSound) + { + modPlayer.playFullRageSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y); + } + } + else + modPlayer.playFullRageSound = true; - // If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration. - if (modPlayer.adrenalineModeActive) + // This is how much Adrenaline will be changed by this frame. + float adrenalineDiff = 0; + bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType()); + bool wofAndNotHell = Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16); + + // If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration. + if (modPlayer.adrenalineModeActive) adrenalineDiff = -modPlayer.adrenalineMax / modPlayer.AdrenalineDuration; else diff --git a/Items/PermanentBoosters/InfernalBlood.cs b/Items/PermanentBoosters/InfernalBlood.cs index 8a6ea3caff..9a47a6ab2f 100644 --- a/Items/PermanentBoosters/InfernalBlood.cs +++ b/Items/PermanentBoosters/InfernalBlood.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void SetStaticDefaults() { DisplayName.SetDefault("Infernal Blood"); - Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" + + Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" + "Revengeance drop"); } diff --git a/Items/PermanentBoosters/MushroomPlasmaRoot.cs b/Items/PermanentBoosters/MushroomPlasmaRoot.cs index 15498ba769..4dd9b8c833 100644 --- a/Items/PermanentBoosters/MushroomPlasmaRoot.cs +++ b/Items/PermanentBoosters/MushroomPlasmaRoot.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void SetStaticDefaults() { DisplayName.SetDefault("Mushroom Plasma Root"); - Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" + + Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" + "Revengeance drop"); } diff --git a/Items/PermanentBoosters/RedLightningContainer.cs b/Items/PermanentBoosters/RedLightningContainer.cs index c22629e1eb..51fedc6db7 100644 --- a/Items/PermanentBoosters/RedLightningContainer.cs +++ b/Items/PermanentBoosters/RedLightningContainer.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void SetStaticDefaults() { DisplayName.SetDefault("Red Lightning Container"); - Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 2 seconds\n" + + Tooltip.SetDefault("Permanently increases the duration of Rage Mode by 1 second\n" + "Revengeance drop"); } From 40f25fa72e50b939641a85fdc0bcdfc0570fac33 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 5 Jul 2021 17:48:09 -0400 Subject: [PATCH 18/22] Shattered Community no longer hides tooltip because it's exhumed. --- Items/Accessories/ShatteredCommunity.cs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index 731ab8fe33..9276cd363e 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -20,8 +20,6 @@ namespace CalamityMod.Items.Accessories private static readonly Color rarityColorOne = new Color(128, 62, 128); private static readonly Color rarityColorTwo = new Color(245, 105, 245); - private bool everInInventory = false; - // Base level cost is 400,000 damage dealt while Rage is active. // Each successive level costs (400,000 * level) MORE damage, so the total required goes up quadratically. // Total required to reach level 60 is 732,000,000 damage dealt. @@ -61,7 +59,6 @@ namespace CalamityMod.Items.Accessories public override ModItem Clone() { var clone = (ShatteredCommunity)base.Clone(); - clone.everInInventory = everInInventory; clone.level = level; clone.totalRageDamage = totalRageDamage; return clone; @@ -69,7 +66,6 @@ namespace CalamityMod.Items.Accessories public override ModItem Clone(Item item) { var clone = (ShatteredCommunity)base.Clone(); - clone.everInInventory = everInInventory; clone.level = level; clone.totalRageDamage = totalRageDamage; return clone; @@ -99,8 +95,6 @@ namespace CalamityMod.Items.Accessories public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().community; public override bool CanUseItem(Player player) => false; - public override void UpdateInventory(Player player) => everInInventory = true; - // Produces purple light while in the world. public override void PostUpdate() { @@ -164,16 +158,6 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List tooltips) { - // Shattered Community hides its full tooltip when viewed via Recipe Browser or similar. - // Instead, it notifies the player that it must be crafted with a full-power Community. - // Once it has entered a player's inventory, it permanently behaves normally. - if (!everInInventory) - { - tooltips.RemoveAll(line => line.Name != "Tooltip0" && line.Name != "Tooltip1" && line.Name != "Tooltip2" && line.Name.StartsWith("Tooltip")); - tooltips.Find(line => line.Name == "Tooltip2").text = "Must be crafted with a fully powered Community"; - return; - } - // Stat tooltips are added dynamically. StringBuilder sb = new StringBuilder(256); @@ -211,7 +195,6 @@ namespace CalamityMod.Items.Accessories { TagCompound tag = new TagCompound { - { "real", everInInventory }, { "level", level }, { "totalDamage", totalRageDamage } }; @@ -220,21 +203,18 @@ namespace CalamityMod.Items.Accessories public override void Load(TagCompound tag) { - everInInventory = tag.GetBool("real"); level = tag.GetInt("level"); totalRageDamage = tag.GetLong("totalDamage"); } public override void NetSend(BinaryWriter writer) { - writer.Write(everInInventory); writer.Write(level); writer.Write(totalRageDamage); } public override void NetRecieve(BinaryReader reader) { - everInInventory = reader.ReadBoolean(); level = reader.ReadInt32(); totalRageDamage = reader.ReadInt64(); } From 937d13bc5091fc7040f87b946540c2555babc5dc Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Tue, 6 Jul 2021 11:01:56 -0500 Subject: [PATCH 19/22] 1 - Adjusted a shitload of debuff durations for hostile NPCs and projectiles. 2 - Gave Banshee Hook explosions id-static i-frames. 3 - Heat Spirits only spawn in the brimstone crag and only drop Essence of Chaos in hardmode. 4 - Nerfed Beetle Might buffs by 50%. --- Buffs/CalamityGlobalBuff.cs | 14 +++++++++++- CalPlayer/CalamityPlayer.cs | 16 ++++++------- NPCs/Abyss/Bloatfish.cs | 2 +- NPCs/Abyss/BobbitWormHead.cs | 1 - NPCs/Abyss/ChaoticPuffer.cs | 2 +- NPCs/Abyss/ColossalSquid.cs | 3 +-- NPCs/Abyss/EidolonWyrmHead.cs | 2 +- NPCs/Abyss/GulperEelBody.cs | 1 - NPCs/Abyss/GulperEelBodyAlt.cs | 1 - NPCs/Abyss/GulperEelHead.cs | 1 - NPCs/Abyss/GulperEelTail.cs | 1 - NPCs/Abyss/MorayEel.cs | 1 - NPCs/Abyss/OarfishHead.cs | 5 ++--- NPCs/Abyss/Reaper.cs | 3 --- NPCs/Abyss/ToxicMinnow.cs | 2 +- NPCs/Abyss/Viperfish.cs | 1 - NPCs/AcidRain/AcidEel.cs | 2 +- NPCs/AcidRain/GammaSlime.cs | 2 +- NPCs/AcidRain/IrradiatedSlime.cs | 2 +- NPCs/AcidRain/NuclearToad.cs | 2 +- NPCs/AcidRain/Skyfin.cs | 2 +- NPCs/AquaticScourge/AquaticParasite.cs | 3 ++- NPCs/AquaticScourge/AquaticScourgeBody.cs | 4 ++-- NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs | 4 ++-- NPCs/AquaticScourge/AquaticScourgeHead.cs | 4 ++-- NPCs/AquaticScourge/AquaticScourgeTail.cs | 4 ++-- NPCs/AquaticScourge/AquaticSeekerHead.cs | 3 +-- NPCs/AquaticScourge/AquaticUrchin.cs | 5 ++--- NPCs/Astral/Atlas.cs | 2 +- NPCs/Calamitas/Calamitas.cs | 2 +- NPCs/Calamitas/CalamitasRun.cs | 2 +- NPCs/Calamitas/CalamitasRun2.cs | 2 +- NPCs/Calamitas/CalamitasRun3.cs | 2 +- NPCs/Calamitas/LifeSeeker.cs | 5 ----- NPCs/Crags/CalamityEye.cs | 1 - NPCs/Crags/CharredSlime.cs | 9 ++++++-- NPCs/Crags/CultistAssassin.cs | 9 ++++++-- NPCs/Crags/DespairStone.cs | 9 ++++++-- NPCs/{NormalNPCs => Crags}/HeatSpirit.cs | 21 +++++++----------- NPCs/{NormalNPCs => Crags}/HeatSpirit.png | Bin NPCs/Crags/Scryllar.cs | 10 ++++++--- NPCs/Crags/ScryllarRage.cs | 10 ++++++--- NPCs/Crags/SoulSlurper.cs | 9 ++++++-- NPCs/DevourerofGods/DevourerofGodsBody.cs | 1 - NPCs/DevourerofGods/DevourerofGodsBody2.cs | 1 - NPCs/DevourerofGods/DevourerofGodsBodyS.cs | 1 - NPCs/DevourerofGods/DevourerofGodsHead.cs | 1 - NPCs/DevourerofGods/DevourerofGodsHead2.cs | 1 - NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 1 - NPCs/DevourerofGods/DevourerofGodsTail.cs | 1 - NPCs/DevourerofGods/DevourerofGodsTail2.cs | 1 - NPCs/DevourerofGods/DevourerofGodsTailS.cs | 1 - NPCs/GreatSandShark/GreatSandShark.cs | 3 +-- NPCs/Leviathan/AquaticAberration.cs | 2 +- NPCs/Leviathan/Leviathan.cs | 2 +- NPCs/Leviathan/Parasea.cs | 2 +- NPCs/Leviathan/Siren.cs | 5 ----- NPCs/NormalNPCs/AngryDog.cs | 2 +- NPCs/NormalNPCs/ArmoredDiggerBody.cs | 6 ----- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 6 ----- NPCs/NormalNPCs/ArmoredDiggerTail.cs | 6 ----- NPCs/NormalNPCs/BlightedEye.cs | 2 +- NPCs/NormalNPCs/CrimulanBlightSlime.cs | 3 +-- NPCs/NormalNPCs/CryoSlime.cs | 8 ++++++- NPCs/NormalNPCs/Cryon.cs | 9 +++----- NPCs/NormalNPCs/EbonianBlightSlime.cs | 1 - NPCs/NormalNPCs/IceClasper.cs | 7 ++---- NPCs/NormalNPCs/MantisShrimp.cs | 5 ++--- NPCs/NormalNPCs/OverloadedSoldier.cs | 2 +- NPCs/NormalNPCs/PhantomDebris.cs | 2 +- NPCs/NormalNPCs/ProfanedEnergyLantern.cs | 8 ++++++- NPCs/NormalNPCs/ScornEater.cs | 7 +++++- NPCs/NormalNPCs/ShockstormShuttle.cs | 5 ----- NPCs/NormalNPCs/SunBat.cs | 1 - NPCs/NormalNPCs/Sunskater.cs | 1 - NPCs/NormalNPCs/ThiccWaifu.cs | 7 +++++- NPCs/OldDuke/OldDuke.cs | 5 +---- NPCs/OldDuke/OldDukeSharkron.cs | 5 +---- NPCs/OldDuke/OldDukeToothBall.cs | 4 +--- NPCs/Perforator/PerforatorBodyLarge.cs | 1 - NPCs/Perforator/PerforatorBodyMedium.cs | 1 - NPCs/Perforator/PerforatorBodySmall.cs | 1 - NPCs/Perforator/PerforatorHeadLarge.cs | 1 - NPCs/Perforator/PerforatorHeadMedium.cs | 1 - NPCs/Perforator/PerforatorHeadSmall.cs | 1 - NPCs/Perforator/PerforatorHive.cs | 8 ++++++- NPCs/Perforator/PerforatorTailLarge.cs | 1 - NPCs/Perforator/PerforatorTailMedium.cs | 1 - NPCs/Perforator/PerforatorTailSmall.cs | 1 - NPCs/PlagueEnemies/PlagueBee.cs | 2 +- NPCs/PlagueEnemies/PlaguedDerpling.cs | 2 +- NPCs/PlagueEnemies/PlaguedFlyingFox.cs | 2 +- NPCs/PlagueEnemies/PlaguedJungleSlime.cs | 2 +- NPCs/PlagueEnemies/PlaguedTortoise.cs | 2 +- NPCs/PlaguebringerGoliath/PlagueMine.cs | 7 +++++- .../PlaguebringerShade.cs | 2 +- .../ProfanedGuardianBoss2.cs | 2 +- .../ProfanedGuardianBoss3.cs | 2 +- NPCs/Providence/ProvSpawnDefense.cs | 2 +- NPCs/Providence/ProvSpawnHealer.cs | 5 ----- NPCs/SlimeGod/SlimeGod.cs | 2 +- NPCs/SlimeGod/SlimeGodRun.cs | 2 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 2 +- NPCs/SlimeGod/SlimeGodSplit.cs | 2 +- NPCs/SlimeGod/SlimeSpawnCrimson.cs | 2 +- NPCs/SlimeGod/SlimeSpawnCrimson2.cs | 2 +- NPCs/StormWeaver/StormWeaverBody.cs | 7 +++++- NPCs/StormWeaver/StormWeaverBodyNaked.cs | 2 +- NPCs/StormWeaver/StormWeaverHead.cs | 7 +++++- NPCs/StormWeaver/StormWeaverHeadNaked.cs | 2 +- NPCs/StormWeaver/StormWeaverTail.cs | 7 +++++- NPCs/StormWeaver/StormWeaverTailNaked.cs | 2 +- NPCs/SulphurousSea/AnthozoanCrab.cs | 8 ++++++- NPCs/SulphurousSea/BelchingCoral.cs | 8 ++++++- NPCs/SulphurousSea/Catfish.cs | 6 ++--- NPCs/SulphurousSea/Flounder.cs | 5 +++-- NPCs/SulphurousSea/Gnasher.cs | 6 ++--- NPCs/SulphurousSea/Mauler.cs | 6 ++--- NPCs/SulphurousSea/Trasher.cs | 6 ++--- Projectiles/Enemy/CragmawBeam.cs | 12 +++++----- Projectiles/Enemy/FlameBurstHostile.cs | 8 ++++++- Projectiles/Enemy/GammaBeam.cs | 12 +++++----- Projectiles/Enemy/InkBombHostile.cs | 3 +-- Projectiles/Enemy/InkPoisonCloud.cs | 3 +-- Projectiles/Enemy/InkPoisonCloud2.cs | 3 +-- Projectiles/Enemy/InkPoisonCloud3.cs | 3 +-- Projectiles/Enemy/NuclearBulletLarge.cs | 4 ++-- Projectiles/Enemy/NuclearBulletMedium.cs | 4 ++-- Projectiles/Enemy/NuclearToadGoo.cs | 2 +- Projectiles/Enemy/SulphuricAcidBubble.cs | 5 +++-- Projectiles/Enemy/SulphuricAcidMist.cs | 3 ++- Projectiles/Enemy/ToxicMinnowCloud.cs | 4 ++-- Projectiles/Melee/BansheeHookBoom.cs | 4 ++-- Projectiles/Melee/Spears/BansheeHookProj.cs | 4 ++-- 134 files changed, 261 insertions(+), 255 deletions(-) rename NPCs/{NormalNPCs => Crags}/HeatSpirit.cs (84%) rename NPCs/{NormalNPCs => Crags}/HeatSpirit.png (100%) diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index d675ac0b01..0fae2bfeae 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -113,7 +113,19 @@ namespace CalamityMod.Buffs tip = "22.5% increased damage"; break; - case BuffID.BeetleEndurance1: + case BuffID.BeetleMight1: + tip = "Melee damage and speed increase by 5%"; + break; + + case BuffID.BeetleMight2: + tip = "Melee damage and speed increase by 10%"; + break; + + case BuffID.BeetleMight3: + tip = "Melee damage and speed increase by 15%"; + break; + + case BuffID.BeetleEndurance1: tip = "Damage taken reduced by 10%"; break; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index f08afc88e9..60d09d2ed3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3712,9 +3712,7 @@ namespace CalamityMod.CalPlayer if (bloodyMary) { if (Main.bloodMoon) - { meleeSpeedMult += 0.15f; - } } if (community) { @@ -3747,6 +3745,11 @@ namespace CalamityMod.CalPlayer else meleeSpeedMult += 0.05f; } + if (player.beetleOffense && player.beetleOrbs > 0) + { + player.meleeDamage -= 0.05f * player.beetleOrbs; + meleeSpeedMult -= 0.05f * player.beetleOrbs; + } if (CalamityConfig.Instance.Proficiency) { meleeSpeedMult += GetMeleeSpeedBonus(); @@ -6798,15 +6801,11 @@ namespace CalamityMod.CalPlayer } else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2) { - player.AddBuff(BuffID.Poisoned, 180); - player.AddBuff(BuffID.Venom, 180); - player.AddBuff(BuffID.Bleeding, 300); + player.AddBuff(BuffID.Poisoned, 300); } else if (npc.type == NPCID.PlanterasTentacle) { - player.AddBuff(BuffID.Poisoned, 120); - player.AddBuff(BuffID.Venom, 120); - player.AddBuff(BuffID.Bleeding, 180); + player.AddBuff(BuffID.Poisoned, 180); } else if (npc.type == NPCID.AncientDoom) { @@ -6860,7 +6859,6 @@ namespace CalamityMod.CalPlayer else if (proj.type == ProjectileID.ThornBall) { player.AddBuff(BuffID.Poisoned, 240); - player.AddBuff(BuffID.Venom, 120); } else if (proj.type == ProjectileID.CultistBossIceMist) { diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index ae9c089056..da2b8cac3b 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 900, true); + player.AddBuff(ModContent.BuffType(), 300, true); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 672541c0f1..eaefbf7dcc 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -232,7 +232,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 300, true); player.AddBuff(ModContent.BuffType(), 300, true); } diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 444abd85a8..c560f7e961 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300); + player.AddBuff(ModContent.BuffType(), 180); if (puffedUp) { diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 18d1160721..6b35083632 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -544,8 +544,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 600, true); - player.AddBuff(BuffID.Darkness, 600, true); + player.AddBuff(ModContent.BuffType(), 300, true); } public override void NPCLoot() diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 7515be8701..ad12776944 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 1200, true); + player.AddBuff(ModContent.BuffType(), 300, true); } } } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index a8a8cf7e47..aafb72f870 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -162,7 +162,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } } diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index e5a02e6d21..cc7938f5b2 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -162,7 +162,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } } diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index d022691127..2149a4dcfe 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -380,7 +380,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 300, true); player.AddBuff(ModContent.BuffType(), 300, true); } } diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index 9ffad34b42..6062317091 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -161,7 +161,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 60, true); player.AddBuff(ModContent.BuffType(), 60, true); } } diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 0af989517b..7bef66a3c8 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -69,7 +69,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); player.AddBuff(BuffID.Venom, 90, true); } diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 6d439fa7b1..d920ff7068 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -348,7 +347,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); + player.AddBuff(ModContent.BuffType(), 90); } } } diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 7e679ff5b5..7c447ec42e 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -627,9 +627,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Darkness, 300, true); - player.AddBuff(BuffID.Bleeding, 300, true); - player.AddBuff(BuffID.Rabies, 300, true); player.AddBuff(ModContent.BuffType(), 300, true); } diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 519f43f74c..bde527ebfc 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 120, true); + player.AddBuff(BuffID.Poisoned, 120, true); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index bd3f24e2a3..fd343b31b2 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -96,7 +96,6 @@ namespace CalamityMod.NPCs.Abyss public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 1f25d972ac..513b166b73 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -154,6 +154,6 @@ namespace CalamityMod.NPCs.AcidRain } } - public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 120); } } diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 817b571180..01d52e8b43 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -189,6 +189,6 @@ namespace CalamityMod.NPCs.AcidRain public override void NPCLoot() => DropHelper.DropItemChance(npc, ModContent.ItemType(), 30); - public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 22c2f99d1a..2f74df3527 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.AcidRain public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index d31261d687..fee70fb9dd 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.AcidRain } } - public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 120); public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) => CalamityGlobalNPC.DrawGlowmask(npc, spriteBatch, ModContent.GetTexture(Texture + "Glow"), true); } diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index e7754f40b8..8a775663ad 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -244,6 +244,6 @@ namespace CalamityMod.NPCs.AcidRain } } - public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 120); } } diff --git a/NPCs/AquaticScourge/AquaticParasite.cs b/NPCs/AquaticScourge/AquaticParasite.cs index 720f0b824a..d83d57199d 100644 --- a/NPCs/AquaticScourge/AquaticParasite.cs +++ b/NPCs/AquaticScourge/AquaticParasite.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using System; @@ -193,7 +194,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 120, true); + player.AddBuff(ModContent.BuffType(), 120, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 0e341dc802..3d1f279382 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -139,8 +140,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); - player.AddBuff(BuffID.Venom, 180, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 59f2339a34..a8ed986573 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -137,8 +138,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); - player.AddBuff(BuffID.Venom, 180, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index e7bb9fe125..4f024cb160 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.LoreItems; @@ -260,8 +261,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 360, true); - player.AddBuff(BuffID.Venom, 360, true); + player.AddBuff(ModContent.BuffType(), 360, true); } } } diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 147fd4bd66..7cb06929d0 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -136,8 +137,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); - player.AddBuff(BuffID.Venom, 120, true); + player.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index 49f2ccd77d..43de2652ed 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -300,8 +300,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); - player.AddBuff(BuffID.Venom, 120, true); + player.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/AquaticScourge/AquaticUrchin.cs b/NPCs/AquaticScourge/AquaticUrchin.cs index 18727ea594..b8e1710feb 100644 --- a/NPCs/AquaticScourge/AquaticUrchin.cs +++ b/NPCs/AquaticScourge/AquaticUrchin.cs @@ -1,7 +1,6 @@ -using CalamityMod.Events; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +39,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 120, true); + player.AddBuff(ModContent.BuffType(), 120, true); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 2cb13bbad4..5d0dd8115c 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -627,7 +627,7 @@ namespace CalamityMod.NPCs.Astral public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 180, true); + player.AddBuff(ModContent.BuffType(), 300, true); } public override void NPCLoot() diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 8f17bfe511..cfdf6e8a5d 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Calamitas public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index bcbe90e9e1..0129bfff98 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Calamitas public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 4f297c5c02..e08fe2fdad 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.Calamitas public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index 47d4ebff58..ca2069c807 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.Calamitas public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index ecae78c18f..d676ab6f0a 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -108,11 +108,6 @@ namespace CalamityMod.NPCs.Calamitas return false; } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 120, true); - } - public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index f012c62c28..2e4c4648f3 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -116,7 +116,6 @@ namespace CalamityMod.NPCs.Crags public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } diff --git a/NPCs/Crags/CharredSlime.cs b/NPCs/Crags/CharredSlime.cs index cebba881d9..ab5b668108 100644 --- a/NPCs/Crags/CharredSlime.cs +++ b/NPCs/Crags/CharredSlime.cs @@ -1,5 +1,5 @@ using CalamityMod.World; -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; @@ -54,7 +54,12 @@ namespace CalamityMod.NPCs.Crags return spawnInfo.player.Calamity().ZoneCalamity ? 0.08f : 0f; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index 517778560e..7b03fe74f4 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -45,7 +45,12 @@ namespace CalamityMod.NPCs.Crags return (spawnInfo.player.Calamity().ZoneCalamity || spawnInfo.player.ZoneDungeon) && Main.hardMode ? 0.04f : 0f; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index aa43a3ece5..ab1a5ec815 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -57,7 +57,12 @@ namespace CalamityMod.NPCs.Crags DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 3, 1, 1); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/NormalNPCs/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs similarity index 84% rename from NPCs/NormalNPCs/HeatSpirit.cs rename to NPCs/Crags/HeatSpirit.cs index 3467711ba5..4d066baeb4 100644 --- a/NPCs/NormalNPCs/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -6,7 +6,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.NormalNPCs +namespace CalamityMod.NPCs.Crags { public class HeatSpirit : ModNPC { @@ -32,16 +32,12 @@ namespace CalamityMod.NPCs.NormalNPCs bannerItem = ModContent.ItemType(); } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.playerSafe || !Main.hardMode) - { - return 0f; - } - return SpawnCondition.Underworld.Chance * 0.065f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + return spawnInfo.player.Calamity().ZoneCalamity ? 0.125f : 0f; + } - public override void FindFrame(int frameHeight) + public override void FindFrame(int frameHeight) { if (npc.velocity.X < 0f) { @@ -73,7 +69,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.OnFire, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } @@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - DropHelper.DropItemChance(npc, ModContent.ItemType(), 0.25f); - } + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 4, 1, 1); + } } } diff --git a/NPCs/NormalNPCs/HeatSpirit.png b/NPCs/Crags/HeatSpirit.png similarity index 100% rename from NPCs/NormalNPCs/HeatSpirit.png rename to NPCs/Crags/HeatSpirit.png diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 88c833e11a..9376752557 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -1,8 +1,7 @@ using CalamityMod.Dusts; -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -257,7 +256,12 @@ namespace CalamityMod.NPCs.Crags DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 3, 1, 1); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 688a356851..2742b488c7 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -1,8 +1,7 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -257,7 +256,12 @@ namespace CalamityMod.NPCs.Crags DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 3, 1, 1); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index b6dffd4fc4..2f880ba559 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -280,7 +280,12 @@ namespace CalamityMod.NPCs.Crags DropHelper.DropItemChance(npc, ModContent.ItemType(), (Main.hardMode ? 30 : 10)); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 120, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) { diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index f40071661d..3acb7e383c 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -257,7 +257,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 240, true); player.AddBuff(ModContent.BuffType(), 300, true); - player.AddBuff(BuffID.Frostburn, 240, true); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody2.cs b/NPCs/DevourerofGods/DevourerofGodsBody2.cs index 2a8e7670cc..cceaf8c976 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody2.cs @@ -220,7 +220,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 120, true); - player.AddBuff(BuffID.Frostburn, 120, true); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs index 8e95007eec..62a457b27d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs @@ -283,7 +283,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 240, true); player.AddBuff(ModContent.BuffType(), 300, true); - player.AddBuff(BuffID.Frostburn, 240, true); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 70d762a4dc..e8f5e17eef 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -988,7 +988,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 300, true); player.AddBuff(ModContent.BuffType(), 420, true); - player.AddBuff(BuffID.Frostburn, 300, true); /*if (CalamityWorld.death && !player.Calamity().lol) { player.KillMe(PlayerDeathReason.ByCustomReason(player.name + "'s essence was consumed by the devourer."), 1000.0, 0, false); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead2.cs b/NPCs/DevourerofGods/DevourerofGodsHead2.cs index 345e53a3f7..d254c887a4 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead2.cs @@ -393,7 +393,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 180, true); - player.AddBuff(BuffID.Frostburn, 180, true); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 627b9464c0..91e34ed629 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1366,7 +1366,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 300, true); player.AddBuff(ModContent.BuffType(), 420, true); - player.AddBuff(BuffID.Frostburn, 300, true); /*if ((CalamityWorld.death || BossRushEvent.BossRushActive) && (npc.alpha <= 0 || postTeleportTimer > 0) && !player.Calamity().lol && preventBullshitHitsAtStartofFinalPhaseTimer <= 0) { player.KillMe(PlayerDeathReason.ByCustomReason(player.name + "'s essence was consumed by the devourer."), 1000.0, 0, false); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 09348e7048..e7375417c3 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -247,7 +247,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 180, true); player.AddBuff(ModContent.BuffType(), 240, true); - player.AddBuff(BuffID.Frostburn, 180, true); if (player.Calamity().dogTextCooldown <= 0) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTail2.cs b/NPCs/DevourerofGods/DevourerofGodsTail2.cs index 56d963d099..935e392980 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail2.cs @@ -217,7 +217,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 90, true); - player.AddBuff(BuffID.Frostburn, 90, true); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsTailS.cs b/NPCs/DevourerofGods/DevourerofGodsTailS.cs index 2bc0b738b9..7d1e991d65 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTailS.cs @@ -319,7 +319,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 180, true); player.AddBuff(ModContent.BuffType(), 240, true); - player.AddBuff(BuffID.Frostburn, 180, true); if (player.Calamity().dogTextCooldown <= 0) { diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 128392b785..3ed9eed015 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -613,8 +613,7 @@ namespace CalamityMod.NPCs.GreatSandShark public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Rabies, 240, true); - player.AddBuff(BuffID.Bleeding, 240, true); + player.AddBuff(BuffID.Bleeding, 300, true); } } } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index b706b04af9..661ff91b49 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.Leviathan public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Wet, 120, true); + player.AddBuff(BuffID.Bleeding, 120, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 19ffe9175f..e7a7dae482 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -769,7 +769,7 @@ namespace CalamityMod.NPCs.Leviathan public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Wet, 240, true); + target.AddBuff(BuffID.Bleeding, 240, true); } public override bool CheckActive() diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index ed5662c6a6..8f882d9ddc 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.Leviathan public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Wet, 60, true); + player.AddBuff(BuffID.Bleeding, 60, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 2b69aa12f4..59e5c088a1 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -781,11 +781,6 @@ namespace CalamityMod.NPCs.Leviathan Leviathan.DropSirenLeviLoot(npc); } - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Wet, 120, true); - } - public override bool CheckActive() { return false; diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index 13b0d03839..39bc9c7303 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); + player.AddBuff(BuffID.Frostburn, 120, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index f05c040215..7fade23b01 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -141,12 +141,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.Chilled, 180, true); - player.AddBuff(BuffID.Electrified, 120, true); - } - public override bool CheckActive() { return false; diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 8f38f46cd6..e4e919b725 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -386,12 +386,6 @@ namespace CalamityMod.NPCs.NormalNPCs return false; } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.Chilled, 240, true); - player.AddBuff(BuffID.Electrified, 180, true); - } - public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 44ce657a2e..c42785cc4e 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -99,12 +99,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.Chilled, 120, true); - player.AddBuff(BuffID.Electrified, 90, true); - } - public override bool CheckActive() { return false; diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index b44f7eddd0..72a085368e 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 120, true); + player.AddBuff(BuffID.Weak, 180, true); } public override void NPCLoot() diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 18f5ccedc2..577d48c3b2 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -64,8 +64,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.ManaSickness, 120, true); - player.AddBuff(BuffID.Confused, 120, true); + player.AddBuff(BuffID.Cursed, 60, true); } public override void NPCLoot() diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 521cef9d8f..e623d647c6 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -46,7 +46,13 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.Cavern.Chance * 0.08f; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Frostburn, 120, true); + player.AddBuff(BuffID.Chilled, 90, true); + } + + public override void HitEffect(int hitDirection, double damage) { // TODO -- This dust was an invalid dust. Replaced with a random dust. int dustType = 91; diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 355d71b86c..67a6bedab7 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -74,12 +74,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Frostburn, 300, true); - if (Main.rand.NextBool(3)) - { - player.AddBuff(ModContent.BuffType(), 30, true); - } - } + player.AddBuff(BuffID.Frostburn, 120, true); + player.AddBuff(BuffID.Chilled, 90, true); + } public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index e2c6130047..308a6c6d61 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -61,7 +61,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.ManaSickness, 120, true); player.AddBuff(BuffID.Weak, 120, true); } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index eed82d34ff..eae55024b2 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -246,11 +246,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Frostburn, 300, true); - if (Main.rand.NextBool(3)) - { - player.AddBuff(ModContent.BuffType(), 30, true); - } + player.AddBuff(BuffID.Frostburn, 180, true); + player.AddBuff(BuffID.Chilled, 120, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index f6c13c649d..d90e8276de 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -79,9 +80,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.netMode != NetmodeID.MultiplayerClient) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, 0, 0f, Main.myPlayer); - } + Projectile.NewProjectile(player.Center, Vector2.Zero, ProjectileID.SolarWhipSwordExplosion, 0, 0f, Main.myPlayer); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 4f8350d4a1..f2712b0592 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -410,7 +410,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 60); + player.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index 9a9aab2596..7bba946c20 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -404,7 +404,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 60); + player.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index ed4f99cf74..7304c27f16 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; @@ -222,7 +223,12 @@ namespace CalamityMod.NPCs.NormalNPCs return true; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 180, true); + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index f87c92d4b2..4d454791a3 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -159,7 +159,12 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.OverworldHallow.Chance / 4f; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 180, true); + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.soundDelay == 0) { diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 02603db49e..b6cca2936c 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -386,11 +386,6 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.Sky.Chance * 0.1f; } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.Electrified, 120, true); - } - public override void NPCLoot() { DropHelper.DropItemCondition(npc, ItemID.MartianConduitPlating, NPC.downedGolemBoss, 1, 10, 30); diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index ff1056a975..b99d1cc2a2 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -64,7 +64,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.OnFire, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index cfb9ab90f9..a07e784564 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -215,7 +215,6 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.OnFire, 120, true); player.AddBuff(ModContent.BuffType(), 120, true); } diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 7b3083e45e..ebf827fcd5 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -280,7 +280,12 @@ namespace CalamityMod.NPCs.NormalNPCs return SpawnCondition.Sky.Chance * 0.1f; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 180, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 18fc5484d2..9459854e2b 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -417,10 +417,7 @@ namespace CalamityMod.NPCs.OldDuke public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 300, true); - player.AddBuff(BuffID.Rabies, 300, true); - player.AddBuff(BuffID.Poisoned, 300, true); - player.AddBuff(ModContent.BuffType(), 300); + player.AddBuff(ModContent.BuffType(), 480); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index 12988856b5..2e009de779 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -204,10 +204,7 @@ namespace CalamityMod.NPCs.OldDuke public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 180, true); - player.AddBuff(BuffID.Rabies, 180, true); - player.AddBuff(BuffID.Poisoned, 180, true); - player.AddBuff(ModContent.BuffType(), 180); + player.AddBuff(ModContent.BuffType(), 240); } public override bool CheckDead() diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 82f0f46799..ea7aece799 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -178,9 +178,7 @@ namespace CalamityMod.NPCs.OldDuke public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 180, true); - player.AddBuff(BuffID.Poisoned, 180, true); - player.AddBuff(ModContent.BuffType(), 180); + player.AddBuff(ModContent.BuffType(), 240); } public override bool CheckDead() diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 4d31e22e11..453aab72e3 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -134,7 +134,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 180, true); - player.AddBuff(BuffID.Bleeding, 180, true); } } } diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index d581177a2d..7d42766093 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -217,7 +217,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 120, true); - player.AddBuff(BuffID.Bleeding, 120, true); } } } diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 6bb0b5b173..6d10b3d5b3 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -137,7 +137,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 90, true); - player.AddBuff(BuffID.Bleeding, 90, true); } } } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index f99789bd6f..41f1d79ba1 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -561,7 +561,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 300, true); - player.AddBuff(BuffID.Bleeding, 300, true); } } } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 74a3e72e3a..9a425cdc1d 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -457,7 +457,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 240, true); - player.AddBuff(BuffID.Bleeding, 240, true); } } } diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 9b8705e5c8..86ef2253d7 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -500,7 +500,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 180, true); - player.AddBuff(BuffID.Bleeding, 180, true); } } } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index ba94da2886..52221159cb 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -502,7 +503,12 @@ namespace CalamityMod.NPCs.Perforator CalamityNetcode.SyncWorld(); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 180, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 100.0; k++) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 6b15f31b17..7b44de8380 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -122,7 +122,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 90, true); - player.AddBuff(BuffID.Bleeding, 90, true); } } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 28b35c0ac9..eb3985e6cb 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -184,7 +184,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 60, true); - player.AddBuff(BuffID.Bleeding, 60, true); } } } diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 354aa2f694..c1880d42a1 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -127,7 +127,6 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 60, true); - player.AddBuff(BuffID.Bleeding, 60, true); } } } diff --git a/NPCs/PlagueEnemies/PlagueBee.cs b/NPCs/PlagueEnemies/PlagueBee.cs index 337d08d151..1771277b48 100644 --- a/NPCs/PlagueEnemies/PlagueBee.cs +++ b/NPCs/PlagueEnemies/PlagueBee.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 180, true); + player.AddBuff(ModContent.BuffType(), 120, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/PlagueEnemies/PlaguedDerpling.cs b/NPCs/PlagueEnemies/PlaguedDerpling.cs index 9ac9335c55..1bbcb275e6 100644 --- a/NPCs/PlagueEnemies/PlaguedDerpling.cs +++ b/NPCs/PlagueEnemies/PlaguedDerpling.cs @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs index dc0f7e1d3f..10d5c7aa54 100644 --- a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs +++ b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs index a8ca82cdbd..e1d1facfc2 100644 --- a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs +++ b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/PlagueEnemies/PlaguedTortoise.cs b/NPCs/PlagueEnemies/PlaguedTortoise.cs index 7feecda54e..6fb5c503cb 100644 --- a/NPCs/PlagueEnemies/PlaguedTortoise.cs +++ b/NPCs/PlagueEnemies/PlaguedTortoise.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.PlagueEnemies public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } public override void NPCLoot() diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 12ce326a39..5e18cbe21d 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -1,5 +1,5 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -157,6 +157,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override bool PreNPCLoot() => false; + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 240, true); + } + public override bool CheckDead() { Main.PlaySound(SoundID.Item14, npc.position); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 2ada7a26c3..3677e079a6 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -640,7 +640,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 120, true); + player.AddBuff(ModContent.BuffType(), 240, true); } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 5beea4876f..d9d07d853a 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 240, true); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 8f0f4d1d9b..d43081d6b8 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 180, true); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 2e44c17f11..31fa7133e5 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.Providence public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(ModContent.BuffType(), 300, true); + player.AddBuff(ModContent.BuffType(), 240, true); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 059aa6a8af..828be9aa02 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -187,11 +187,6 @@ namespace CalamityMod.NPCs.Providence return true; } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(BuffID.OnFire, 600, true); - } - public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index c934236acc..d191adca3f 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -621,7 +621,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 180, true); + player.AddBuff(BuffID.Weak, 300, true); } } } diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 45a09f2b30..83216147d2 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -631,7 +631,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 90, true); + player.AddBuff(BuffID.Cursed, 120, true); } } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index e549251fd3..e696bad571 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -627,7 +627,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 90, true); + player.AddBuff(BuffID.Cursed, 45, true); } } } diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 190827cb5c..655062459a 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -620,7 +620,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 180, true); + player.AddBuff(BuffID.Weak, 120, true); } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index b65ef0b378..e279b841b3 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 60, true); + player.AddBuff(BuffID.Cursed, 30, true); } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index e872db3e4e..6396750e57 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 60, true); + player.AddBuff(BuffID.Cursed, 30, true); } } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 0e1b456c93..5ab2867cfe 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -191,7 +191,12 @@ namespace CalamityMod.NPCs.StormWeaver } } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 90, true); + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index 61728c5214..8d0e61ccc6 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - int buffDuration = Main.npc[(int)npc.ai[2]].Calamity().newAI[0] >= 400f ? 200 : 60; + int buffDuration = Main.npc[(int)npc.ai[2]].Calamity().newAI[0] >= 400f ? 180 : 90; player.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 7b7a42732c..4f3eb1bc61 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -470,7 +470,12 @@ namespace CalamityMod.NPCs.StormWeaver return false; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 180, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index de834511bd..ea90959448 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -606,7 +606,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - int buffDuration = npc.Calamity().newAI[0] >= 400f ? 300 : 90; + int buffDuration = npc.Calamity().newAI[0] >= 400f ? 360 : 180; player.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 467d5c8dfe..654d78c3db 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -165,7 +165,12 @@ namespace CalamityMod.NPCs.StormWeaver return true; } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 60, true); + } + + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index cb35add269..fbb13857cc 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - int buffDuration = Main.npc[(int)npc.ai[2]].Calamity().newAI[0] >= 400f ? 100 : 30; + int buffDuration = Main.npc[(int)npc.ai[2]].Calamity().newAI[0] >= 400f ? 120 : 60; player.AddBuff(BuffID.Electrified, buffDuration, true); } diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 841ac5bf93..fe6fe9394b 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Enemy; using CalamityMod.Items.Materials; @@ -191,7 +192,12 @@ namespace CalamityMod.NPCs.SulphurousSea DropHelper.DropItemChance(npc, ModContent.ItemType(), 15); // Rarer to encourage fighting Acid Rain } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 180); + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 7da6e84a8c..35ba753fd7 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Enemy; using CalamityMod.Items.Materials; @@ -66,7 +67,12 @@ namespace CalamityMod.NPCs.SulphurousSea DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); } - public override void HitEffect(int hitDirection, double damage) + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(ModContent.BuffType(), 180); + } + + public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { diff --git a/NPCs/SulphurousSea/Catfish.cs b/NPCs/SulphurousSea/Catfish.cs index 48bd63fd84..100534b6c9 100644 --- a/NPCs/SulphurousSea/Catfish.cs +++ b/NPCs/SulphurousSea/Catfish.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using System.IO; using Terraria; @@ -72,9 +73,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); - player.AddBuff(BuffID.Venom, 180, true); - } + player.AddBuff(ModContent.BuffType(), 180); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/NPCs/SulphurousSea/Flounder.cs b/NPCs/SulphurousSea/Flounder.cs index 4661cc92d8..529296adaa 100644 --- a/NPCs/SulphurousSea/Flounder.cs +++ b/NPCs/SulphurousSea/Flounder.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Potions; using Terraria; @@ -80,8 +81,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Venom, 120, true); - } + player.AddBuff(ModContent.BuffType(), 120); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 0346d252de..5fa4d702ab 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; @@ -87,9 +88,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 120, true); - player.AddBuff(BuffID.Venom, 120, true); - } + player.AddBuff(ModContent.BuffType(), 120); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/NPCs/SulphurousSea/Mauler.cs b/NPCs/SulphurousSea/Mauler.cs index feea79b679..858b238003 100644 --- a/NPCs/SulphurousSea/Mauler.cs +++ b/NPCs/SulphurousSea/Mauler.cs @@ -335,10 +335,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 300, true); - player.AddBuff(BuffID.Venom, 300, true); - player.AddBuff(BuffID.Rabies, 300, true); - } + player.AddBuff(ModContent.BuffType(), 420); + } public override void NPCLoot() { diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index f08dc8781f..089b5b9941 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -311,9 +312,8 @@ namespace CalamityMod.NPCs.SulphurousSea public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Bleeding, 180, true); - player.AddBuff(BuffID.Venom, 180, true); - } + player.AddBuff(ModContent.BuffType(), 180); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/Projectiles/Enemy/CragmawBeam.cs b/Projectiles/Enemy/CragmawBeam.cs index a61e2a6847..6be4f2ca40 100644 --- a/Projectiles/Enemy/CragmawBeam.cs +++ b/Projectiles/Enemy/CragmawBeam.cs @@ -1,10 +1,10 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.ID; using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy @@ -203,9 +203,9 @@ namespace CalamityMod.Projectiles.Enemy } return false; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Electrified, 300); - } - } + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + } } diff --git a/Projectiles/Enemy/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs index b479571d64..9378955fb3 100644 --- a/Projectiles/Enemy/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -86,7 +87,12 @@ namespace CalamityMod.Projectiles.Enemy } } - public override void Kill(int timeLeft) + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + + public override void Kill(int timeLeft) { for (int k = 0; k < 5; k++) { diff --git a/Projectiles/Enemy/GammaBeam.cs b/Projectiles/Enemy/GammaBeam.cs index a26cbce6ad..b42f69b30a 100644 --- a/Projectiles/Enemy/GammaBeam.cs +++ b/Projectiles/Enemy/GammaBeam.cs @@ -1,10 +1,10 @@ +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.ID; using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy @@ -208,9 +208,9 @@ namespace CalamityMod.Projectiles.Enemy } return false; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Electrified, 300); - } - } + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600); + } + } } diff --git a/Projectiles/Enemy/InkBombHostile.cs b/Projectiles/Enemy/InkBombHostile.cs index 404587d035..b244786920 100644 --- a/Projectiles/Enemy/InkBombHostile.cs +++ b/Projectiles/Enemy/InkBombHostile.cs @@ -84,8 +84,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.Darkness, 600, true); + target.AddBuff(BuffID.Darkness, 300, true); projectile.Kill(); } } diff --git a/Projectiles/Enemy/InkPoisonCloud.cs b/Projectiles/Enemy/InkPoisonCloud.cs index b959629ee3..37cc8d4d20 100644 --- a/Projectiles/Enemy/InkPoisonCloud.cs +++ b/Projectiles/Enemy/InkPoisonCloud.cs @@ -65,8 +65,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.Darkness, 600, true); + target.AddBuff(BuffID.Darkness, 300, true); } } } diff --git a/Projectiles/Enemy/InkPoisonCloud2.cs b/Projectiles/Enemy/InkPoisonCloud2.cs index 8bf7f57d92..cde0aa66e1 100644 --- a/Projectiles/Enemy/InkPoisonCloud2.cs +++ b/Projectiles/Enemy/InkPoisonCloud2.cs @@ -65,8 +65,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.Darkness, 600, true); + target.AddBuff(BuffID.Darkness, 300, true); } } } diff --git a/Projectiles/Enemy/InkPoisonCloud3.cs b/Projectiles/Enemy/InkPoisonCloud3.cs index 2950babbc5..5456625367 100644 --- a/Projectiles/Enemy/InkPoisonCloud3.cs +++ b/Projectiles/Enemy/InkPoisonCloud3.cs @@ -65,8 +65,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.Darkness, 600, true); + target.AddBuff(BuffID.Darkness, 300, true); } } } diff --git a/Projectiles/Enemy/NuclearBulletLarge.cs b/Projectiles/Enemy/NuclearBulletLarge.cs index fdf3d549d9..341228dfc2 100644 --- a/Projectiles/Enemy/NuclearBulletLarge.cs +++ b/Projectiles/Enemy/NuclearBulletLarge.cs @@ -1,5 +1,5 @@ using Microsoft.Xna.Framework; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); } public override void Kill(int timeLeft) { diff --git a/Projectiles/Enemy/NuclearBulletMedium.cs b/Projectiles/Enemy/NuclearBulletMedium.cs index b3c5df79b6..3a2d7b8606 100644 --- a/Projectiles/Enemy/NuclearBulletMedium.cs +++ b/Projectiles/Enemy/NuclearBulletMedium.cs @@ -1,5 +1,5 @@ using Microsoft.Xna.Framework; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using System; using Terraria; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } public override void Kill(int timeLeft) { diff --git a/Projectiles/Enemy/NuclearToadGoo.cs b/Projectiles/Enemy/NuclearToadGoo.cs index aab0150aad..f2d030ddec 100644 --- a/Projectiles/Enemy/NuclearToadGoo.cs +++ b/Projectiles/Enemy/NuclearToadGoo.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } public override void Kill(int timeLeft) { diff --git a/Projectiles/Enemy/SulphuricAcidBubble.cs b/Projectiles/Enemy/SulphuricAcidBubble.cs index b1790cb1b5..c886df086b 100644 --- a/Projectiles/Enemy/SulphuricAcidBubble.cs +++ b/Projectiles/Enemy/SulphuricAcidBubble.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -103,8 +104,8 @@ namespace CalamityMod.Projectiles.Enemy { return; } - target.AddBuff(BuffID.Venom, 120); - projectile.Kill(); + target.AddBuff(ModContent.BuffType(), 120); + projectile.Kill(); } public override void Kill(int timeLeft) diff --git a/Projectiles/Enemy/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs index 62fd008508..ed4519027d 100644 --- a/Projectiles/Enemy/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using System; using Terraria; using Terraria.ID; @@ -76,7 +77,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Venom, 120); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 82efe42b9e..6449e63664 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -83,14 +83,14 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Poisoned, 600); + target.AddBuff(BuffID.Poisoned, 120); } public override bool? CanHitNPC(NPC target) => projectile.timeLeft > 40; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Poisoned, 600); + target.AddBuff(BuffID.Poisoned, 120); } } } diff --git a/Projectiles/Melee/BansheeHookBoom.cs b/Projectiles/Melee/BansheeHookBoom.cs index fa73f834cd..7cdd4761db 100644 --- a/Projectiles/Melee/BansheeHookBoom.cs +++ b/Projectiles/Melee/BansheeHookBoom.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = 6; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 16; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Melee/Spears/BansheeHookProj.cs b/Projectiles/Melee/Spears/BansheeHookProj.cs index 40853f457b..90d4974778 100644 --- a/Projectiles/Melee/Spears/BansheeHookProj.cs +++ b/Projectiles/Melee/Spears/BansheeHookProj.cs @@ -109,12 +109,12 @@ namespace CalamityMod.Projectiles.Melee.Spears public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - float angle = projectile.rotation - MathHelper.PiOver4 * Math.Sign(projectile.velocity.X) + + float angle = projectile.rotation - MathHelper.PiOver4 * Math.Sign(projectile.velocity.X) + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; float areaCheck = -95f; float reduntantVariable = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + angle.ToRotationVector2() * areaCheck, (TravelSpeed + 1f) * projectile.scale, ref reduntantVariable)) From 85f07a573811261144d9b885ea3bf28d50bef004 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Tue, 6 Jul 2021 11:54:29 -0500 Subject: [PATCH 20/22] 1 - Warbanner fix, hopefully. --- CalPlayer/CalamityPlayer.cs | 64 ++++++++++++++++++-------- CalPlayer/CalamityPlayerMiscEffects.cs | 59 ++---------------------- Items/Accessories/SamuraiBadge.cs | 2 +- 3 files changed, 48 insertions(+), 77 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index b3fed87ac9..b52d46cbbf 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -419,7 +419,10 @@ namespace CalamityMod.CalPlayer public bool evasionScarf = false; public bool badgeOfBravery = false; public bool badgeOfBraveryRare = false; - public bool scarfCooldown = false; + public float warBannerBonus = 0f; + private const float maxWarBannerBonus = 0.2f; + private const float maxWarBannerDistance = 480f; + public bool scarfCooldown = false; public bool eScarfCooldown = false; public bool cryogenSoul = false; public bool yInsignia = false; @@ -1440,6 +1443,7 @@ namespace CalamityMod.CalPlayer accStealthGenBoost = 0f; trueMeleeDamage = 0D; + warBannerBonus = 0f; dashMod = 0; externalAbyssLight = 0; @@ -3675,31 +3679,51 @@ namespace CalamityMod.CalPlayer } if (badgeOfBraveryRare) { - float maxDistance = 480f; // 30 tile distance - float meleeSpeedBoost = 0f; - for (int l = 0; l < Main.maxNPCs; l++) - { - NPC nPC = Main.npc[l]; + int closestNPC = -1; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC nPC = Main.npc[i]; + if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage) + { + closestNPC = i; + break; + } + } + float distance = -1f; + for (int j = 0; j < Main.maxNPCs; j++) + { + NPC nPC = Main.npc[j]; + if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage) + { + float distance2 = Math.Abs(nPC.position.X + (float)(nPC.width / 2) - (player.position.X + (float)(player.width / 2))) + Math.Abs(nPC.position.Y + (float)(nPC.height / 2) - (player.position.Y + (float)(player.height / 2))); + if (distance == -1f || distance2 < distance) + { + distance = distance2; + closestNPC = j; + } + } + } - // Take the longer of the two directions for the NPC's hitbox to be generous. - float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f); - float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth; + if (closestNPC != -1) + { + NPC actualClosestNPC = Main.npc[closestNPC]; + + float generousHitboxWidth = Math.Max(actualClosestNPC.Hitbox.Width / 2f, actualClosestNPC.Hitbox.Height / 2f); + float hitboxEdgeDist = actualClosestNPC.Distance(player.Center) - generousHitboxWidth; if (hitboxEdgeDist < 0) hitboxEdgeDist = 0; - if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance) - { - meleeSpeedBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance)); + if (hitboxEdgeDist < maxWarBannerDistance) + { + warBannerBonus = MathHelper.Lerp(0f, maxWarBannerBonus, 1f - (hitboxEdgeDist / maxWarBannerDistance)); - if (meleeSpeedBoost >= 0.3f) - { - meleeSpeedBoost = 0.3f; - break; - } - } - } - meleeSpeedMult += meleeSpeedBoost; + if (warBannerBonus > maxWarBannerBonus) + warBannerBonus = maxWarBannerBonus; + } + + meleeSpeedMult += warBannerBonus; + } } if (eGauntlet) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9dbbd22ac4..b83e14bd8c 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3054,33 +3054,7 @@ namespace CalamityMod.CalPlayer } if (modPlayer.badgeOfBraveryRare) - { - float maxDistance = 480f; // 30 tile distance - float damageBoost = 0f; - for (int l = 0; l < Main.maxNPCs; l++) - { - NPC nPC = Main.npc[l]; - - // Take the longer of the two directions for the NPC's hitbox to be generous. - float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f); - float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth; - - if (hitboxEdgeDist < 0) - hitboxEdgeDist = 0; - - if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance) - { - damageBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance)); - - if (damageBoost >= 0.3f) - { - damageBoost = 0.3f; - break; - } - } - } - player.meleeDamage += damageBoost; - } + player.meleeDamage += modPlayer.warBannerBonus; // The player's true max life value with Calamity adjustments modPlayer.actualMaxLife = player.statLifeMax2; @@ -3756,35 +3730,8 @@ namespace CalamityMod.CalPlayer ((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) + (player.kbGlove ? 0.1 : 0) + (modPlayer.eGauntlet ? 0.1 : 0) + - (modPlayer.yInsignia ? 0.1 : 0); - if (modPlayer.badgeOfBraveryRare) - { - float maxDistance = 480f; // 30 tile distance - float damageBoost = 0f; - for (int l = 0; l < Main.maxNPCs; l++) - { - NPC nPC = Main.npc[l]; - - // Take the longer of the two directions for the NPC's hitbox to be generous. - float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f); - float hitboxEdgeDist = nPC.Distance(player.Center) - generousHitboxWidth; - - if (hitboxEdgeDist < 0) - hitboxEdgeDist = 0; - - if (nPC.active && !nPC.friendly && (nPC.damage > 0 || nPC.boss) && !nPC.dontTakeDamage && hitboxEdgeDist < maxDistance) - { - damageBoost += MathHelper.Lerp(0f, 0.3f, 1f - (hitboxEdgeDist / maxDistance)); - - if (damageBoost >= 0.3f) - { - damageBoost = 0.3f; - break; - } - } - } - damageAdd += damageBoost; - } + (modPlayer.yInsignia ? 0.1 : 0) + + (modPlayer.badgeOfBraveryRare ? modPlayer.warBannerBonus : 0); modPlayer.trueMeleeDamage += damageAdd; // Amalgam boosts diff --git a/Items/Accessories/SamuraiBadge.cs b/Items/Accessories/SamuraiBadge.cs index 56798d087e..2fa867eade 100644 --- a/Items/Accessories/SamuraiBadge.cs +++ b/Items/Accessories/SamuraiBadge.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Warbanner of the Sun"); Tooltip.SetDefault("Increases melee damage, true melee damage and melee speed the closer you are to enemies\n" + - "Max boost is 30% increased melee damage, true melee damage and melee speed"); + "Max boost is 20% increased melee damage, true melee damage and melee speed"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 5)); } From 97976adf9eadb7c8c3c1453b8f5a7f2702af15fa Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Tue, 6 Jul 2021 12:17:32 -0500 Subject: [PATCH 21/22] 1 - Debuff duration fixes for boss projectiles. --- Projectiles/Boss/AbyssBallVolley2.cs | 2 +- Projectiles/Boss/AbyssMine.cs | 2 +- Projectiles/Boss/AstralShot2.cs | 2 +- Projectiles/Boss/BrimstoneFire.cs | 2 +- Projectiles/Boss/BrimstoneHellfireball.cs | 2 +- Projectiles/Boss/DeusMine.cs | 2 +- Projectiles/Boss/DoGFire.cs | 4 +--- Projectiles/Boss/EssenceDust.cs | 3 +-- Projectiles/Boss/ExoDestroyerBeamStart.cs | 1 - Projectiles/Boss/ExoDestroyerLaser.cs | 1 - Projectiles/Boss/FrostMist.cs | 5 ++--- Projectiles/Boss/HellfireExplosion.cs | 2 +- Projectiles/Boss/HiveBombGoliath.cs | 2 +- Projectiles/Boss/HolySpear.cs | 2 +- Projectiles/Boss/IceBlast.cs | 1 - Projectiles/Boss/MoltenBlast.cs | 2 +- Projectiles/Boss/OldDukeGore.cs | 1 - Projectiles/Boss/PhantomGhostShot.cs | 8 +++++++- Projectiles/Boss/PhantomHookShot.cs | 8 +++++++- Projectiles/Boss/PlagueExplosion.cs | 2 +- Projectiles/Boss/ProfanedSpear.cs | 2 +- Projectiles/Boss/ProvidenceHolyRay.cs | 2 +- Projectiles/Boss/SandPoisonCloud.cs | 6 +++--- Projectiles/Boss/SandPoisonCloudOldDuke.cs | 6 +++--- Projectiles/Boss/ShadeNimbusHostile.cs | 8 +++++++- Projectiles/Boss/SignusScythe.cs | 2 +- Projectiles/Boss/SporeGasPlantera.cs | 3 --- Projectiles/Boss/WaterSpear.cs | 8 -------- 28 files changed, 45 insertions(+), 46 deletions(-) diff --git a/Projectiles/Boss/AbyssBallVolley2.cs b/Projectiles/Boss/AbyssBallVolley2.cs index 4ed1a4f3ec..eda2d5205d 100644 --- a/Projectiles/Boss/AbyssBallVolley2.cs +++ b/Projectiles/Boss/AbyssBallVolley2.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.timeLeft < 60) return; - target.AddBuff(BuffID.Cursed, 90); + target.AddBuff(BuffID.Cursed, 45); } } } diff --git a/Projectiles/Boss/AbyssMine.cs b/Projectiles/Boss/AbyssMine.cs index 7519b4d99b..e84b0b6669 100644 --- a/Projectiles/Boss/AbyssMine.cs +++ b/Projectiles/Boss/AbyssMine.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Weak, 120); + target.AddBuff(BuffID.Weak, 240); } } } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 782ccaa384..a495cc4825 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 853e2cbe38..1bded359eb 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index fe9e600933..cfa0eeaa1a 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 8cff3cf48d..13c18ddd2a 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.timeLeft > 815 || projectile.timeLeft < 85) return; - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index 5a4b4d38f6..62abfb3a55 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -75,9 +75,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Frostburn, 300, true); - target.AddBuff(BuffID.Darkness, 300, true); + target.AddBuff(ModContent.BuffType(), 240); } public override void Kill(int timeLeft) diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index 14558e7405..31db43e494 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -28,8 +28,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.975f; + projectile.velocity *= 0.985f; Lighting.AddLight(projectile.Center, 0.45f, 0f, 0.55f); for (int num468 = 0; num468 < 5; num468++) { diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 82544af0bf..5a90c4d052 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -256,7 +256,6 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 360); - target.AddBuff(BuffID.OnFire, 360); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index 25ff49f22e..c24cd45435 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -231,7 +231,6 @@ namespace CalamityMod.Projectiles.Boss if (TelegraphDelay > TelegraphTotalTime) { target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(BuffID.OnFire, 180); } } diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 5daa2dcf3c..7736aa2a9d 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -128,9 +128,8 @@ namespace CalamityMod.Projectiles.Boss if (projectile.Opacity != 1f) return; - target.AddBuff(BuffID.Frostburn, 240, true); - target.AddBuff(BuffID.Chilled, 120, true); - target.AddBuff(BuffID.Frozen, 30, true); + target.AddBuff(BuffID.Frostburn, 120, true); + target.AddBuff(BuffID.Chilled, 90, true); } } } diff --git a/Projectiles/Boss/HellfireExplosion.cs b/Projectiles/Boss/HellfireExplosion.cs index 24f72c7dd7..db3c29b3be 100644 --- a/Projectiles/Boss/HellfireExplosion.cs +++ b/Projectiles/Boss/HellfireExplosion.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 0cbc03c00d..fc4c722210 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 92108c0a14..f9641760f0 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(buffType, 120); + target.AddBuff(buffType, 180); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index e1d7ebcd08..a7d08fc10b 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -94,7 +94,6 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(BuffID.Frostburn, 90, true); target.AddBuff(BuffID.Chilled, 60, true); - target.AddBuff(BuffID.Frozen, 30, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 3ac4dda5a5..244187f9e9 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(buffType, 180); + target.AddBuff(buffType, 240); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index 87ff7367a9..d898d09bd5 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -89,7 +89,6 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Poisoned, 180, true); target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index d6f8c332ce..4eab148cd1 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using System.IO; @@ -69,7 +70,12 @@ namespace CalamityMod.Projectiles.Boss } } - public override Color? GetAlpha(Color lightColor) + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, projectile.alpha); } diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index a13b28c632..34f9397844 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using System.IO; @@ -69,7 +70,12 @@ namespace CalamityMod.Projectiles.Boss } } - public override Color? GetAlpha(Color lightColor) + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, projectile.alpha); } diff --git a/Projectiles/Boss/PlagueExplosion.cs b/Projectiles/Boss/PlagueExplosion.cs index 4d7bcfa5ef..9ed2a0abd3 100644 --- a/Projectiles/Boss/PlagueExplosion.cs +++ b/Projectiles/Boss/PlagueExplosion.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 357df6ea35..2bb342cb8b 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index e83c2fa25c..6cd9c2ba04 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(buffType, 300); + target.AddBuff(buffType, 420); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 9b04d5e972..38e835c8eb 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -1,5 +1,5 @@ +using CalamityMod.Buffs.StatDebuffs; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { if (projectile.timeLeft >= 180) - target.AddBuff(BuffID.Venom, 300); - } + target.AddBuff(ModContent.BuffType(), 240, true); + } } } diff --git a/Projectiles/Boss/SandPoisonCloudOldDuke.cs b/Projectiles/Boss/SandPoisonCloudOldDuke.cs index 81d18da39e..753fce4136 100644 --- a/Projectiles/Boss/SandPoisonCloudOldDuke.cs +++ b/Projectiles/Boss/SandPoisonCloudOldDuke.cs @@ -1,5 +1,5 @@ +using CalamityMod.Buffs.StatDebuffs; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { if (projectile.timeLeft >= 180) - target.AddBuff(BuffID.Venom, 300); - } + target.AddBuff(ModContent.BuffType(), 240, true); + } } } diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index a060978836..e4979333ed 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -55,5 +56,10 @@ namespace CalamityMod.Projectiles.Boss } } } - } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 90); + } + } } diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index 857e4854e0..9391090f77 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } public override void Kill(int timeLeft) diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 5dadbdb9cc..0b7b154d92 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -100,10 +100,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { if (projectile.ai[1] <= 1800f && projectile.ai[1] > 120f) - { target.AddBuff(BuffID.Poisoned, 240); - target.AddBuff(BuffID.Venom, 120); - } } } } diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 68d25bc384..7215b9f2b7 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -87,13 +87,5 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } } - - public override void OnHitPlayer(Player target, int damage, bool crit) - { - if (projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.Wet, 240); - } } } From 585fa44d1f2c75a91019d0a23c48445f7bd0e588 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 1 Jul 2021 10:53:46 -0500 Subject: [PATCH 22/22] Added SCal's expert box and vanity set Also changed drops accordingly --- Items/Armor/Vanity/AshenHorns.cs | 24 ++++++++ Items/Armor/Vanity/AshenHorns.png | Bin 0 -> 323 bytes Items/Armor/Vanity/AshenHorns_Head.png | Bin 0 -> 726 bytes Items/Armor/Vanity/SCalBoots.cs | 19 +++++++ Items/Armor/Vanity/SCalBoots.png | Bin 0 -> 438 bytes Items/Armor/Vanity/SCalBoots_Legs.png | Bin 0 -> 3603 bytes Items/Armor/Vanity/SCalMask.cs | 21 +++++++ Items/Armor/Vanity/SCalMask.png | Bin 0 -> 281 bytes Items/Armor/Vanity/SCalMask_Head.png | Bin 0 -> 1044 bytes Items/Armor/Vanity/SCalRobes.cs | 19 +++++++ Items/Armor/Vanity/SCalRobes.png | Bin 0 -> 710 bytes Items/Armor/Vanity/SCalRobes_Arms.png | Bin 0 -> 4080 bytes Items/Armor/Vanity/SCalRobes_Body.png | Bin 0 -> 5872 bytes Items/TreasureBags/SCalBag.cs | 66 ++++++++++++++++++++++ Items/TreasureBags/SCalBag.png | Bin 0 -> 605 bytes Items/Weapons/Summon/Perdition.cs | 3 +- ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 53 ++++++++--------- 18 files changed, 178 insertions(+), 29 deletions(-) create mode 100644 Items/Armor/Vanity/AshenHorns.cs create mode 100644 Items/Armor/Vanity/AshenHorns.png create mode 100644 Items/Armor/Vanity/AshenHorns_Head.png create mode 100644 Items/Armor/Vanity/SCalBoots.cs create mode 100644 Items/Armor/Vanity/SCalBoots.png create mode 100644 Items/Armor/Vanity/SCalBoots_Legs.png create mode 100644 Items/Armor/Vanity/SCalMask.cs create mode 100644 Items/Armor/Vanity/SCalMask.png create mode 100644 Items/Armor/Vanity/SCalMask_Head.png create mode 100644 Items/Armor/Vanity/SCalRobes.cs create mode 100644 Items/Armor/Vanity/SCalRobes.png create mode 100644 Items/Armor/Vanity/SCalRobes_Arms.png create mode 100644 Items/Armor/Vanity/SCalRobes_Body.png create mode 100644 Items/TreasureBags/SCalBag.cs create mode 100644 Items/TreasureBags/SCalBag.png diff --git a/Items/Armor/Vanity/AshenHorns.cs b/Items/Armor/Vanity/AshenHorns.cs new file mode 100644 index 0000000000..ef4b0359fe --- /dev/null +++ b/Items/Armor/Vanity/AshenHorns.cs @@ -0,0 +1,24 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class AshenHorns : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Ashen Horns"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = true; + } + } +} diff --git a/Items/Armor/Vanity/AshenHorns.png b/Items/Armor/Vanity/AshenHorns.png new file mode 100644 index 0000000000000000000000000000000000000000..0085c11cf3f3c52456d4b17782be729b76708f00 GIT binary patch literal 323 zcmV-J0lfZ+P)Px#{YgYYR5*>jl(A|8K@f(&4OX{R>;ywVImlV~6k-Ued;&XdQlyPZ8S!zfL=>MQ zjpA`Jl7RRCYne^q4epBAn7h9kX7~SR{+(e}@A(OU`FvsVp#X-H8RyWtZ%F9zqv%cn zT%BeA0}9gl>)Q(e{rAB|f{u=bJRC@{*>3z3wXa)sQd=m@fRa9u1aIJ|kg+qp<^IvN8Yx|usr&UPICMZjT;jM*LMN%JRpq%+Ih!5>20 VPsXQHvqt~`002ovPDHLkV1k2Lj|Bh# literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/AshenHorns_Head.png b/Items/Armor/Vanity/AshenHorns_Head.png new file mode 100644 index 0000000000000000000000000000000000000000..12cc0083ee5706a253a22895dab9e78b908f0650 GIT binary patch literal 726 zcmeAS@N?(olHy`uVBq!ia0vp^8Vn392^?%d*6dv(^+1ZTILO_JVcj{ImkbO{6FglU zLn`LHy|p(h#8Kwh!}4bN*4_$6p#Z@m-YnG!ZbsIPo=L+x@7ZFWRjw+2##7&B`BtB?;aE;=^Sk@IXRBDwwA0^OKWm?g=e={!>+f#A zD*O7)-015IZkOk&ddBUu_%l<*UA}L!inX=bvwq*duK)}KAUKeA z>FkygW8J$x-sYDtorMT8^mu|eFmYyxsDT<(5m=lDB6wg1LNibtsy`W_nSh}=YFFL8 zzg`Tg-4Y_NdzGDJLl0<8ao2qs=v{dwNN(#CcarVL>ZuJgL5_jDi)2F?RtJC_19KN6 f!~miLHD^_PbP0l+XkKzV8;J literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/SCalBoots.cs b/Items/Armor/Vanity/SCalBoots.cs new file mode 100644 index 0000000000..5557bb0bdc --- /dev/null +++ b/Items/Armor/Vanity/SCalBoots.cs @@ -0,0 +1,19 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Legs)] + public class SCalBoots : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Boots"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + } +} diff --git a/Items/Armor/Vanity/SCalBoots.png b/Items/Armor/Vanity/SCalBoots.png new file mode 100644 index 0000000000000000000000000000000000000000..2c4283bcd3998dea6c38372ede9f39b202fd8cfd GIT binary patch literal 438 zcmV;n0ZIOeP)Px$a7jc#R5*>rm9a}gQ5431SIs08F+)gR4L#{iZ7m87kz+%fYg1!OQ-4Hjb8B0F zfYA^%1+@xEkdh#1h#~eeU&DD9y$_=Xd40>f=bVr4-S3|B-c|T0kkm_$`9J|Y@eV*_ zPNKgerk$iB^3MKv3_v-h3}VBL&lFgTyGC5?dxjn&7osD*SV=?y$bT&WVC75)4>8Gi zYFz-b&N2YSk;!vhap*?HN?{-;7M`P=@9BB)=>Z(tDTB~#%hZt1%oMoKrUBUQ^Z+PY z;_#v_&C11O`oeS69?5s3r>wChJFM)=^Ypw0z-oF4fDTBZE21VG+O0Pxxz8a>=8WfZ{e-J2KS gE1z%Zgnl1=1FubMUFX;)zW@LL07*qoM6N<$f@jvh(EtDd literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/SCalBoots_Legs.png b/Items/Armor/Vanity/SCalBoots_Legs.png new file mode 100644 index 0000000000000000000000000000000000000000..867d3c73ea9ed65b7010e17afaab6c25c760028a GIT binary patch literal 3603 zcmZ`*Xio26LW(Um)xMSX){L)7eG=g zMRRc95I1tl6_HYN1t}L)+)CUKmq#=CWp@N2{~j3Okf0B}y#FdCRM}pUrUX0+bdNo4@c( z{Lul;5e@bV2jwZJLH8~_1swa~>XY3{uRh+1RC@rAv{AoG`hJgNp;M7@^11Bb@z<2I zHd>2k8Vjs{JZiifn7e;>Pqt}50g36x@F2!ikgxz~!o zyO(9nH5=`B9YqJ|gC?)#bur(?uwXs@Ao_Z1O;H3;n@x|i%TR(W{<{oeSyryYbMgm9jVH3L@f{fq z9Y|XI?Toz1^x0iIXAcSF)h&SfR&3K_5R;%5r{N^_+)BMg)Id#KU9;Yt+fz`Tcq1M( zxkeY=r}^hQBxe+Pj5=J0m1JM2S;yChA=2+EuWMzyM%Kq}1xt4N!FUf-iAhlxcZ*8-)f&?sy=D1_q6Jdh6Zo%@y9 znoMvT@On8>xznGD&-Rh4TG#D>MK{~Y%B@zSxTg>tOvz{!24NL*G*d;3aL9mdCL|kafFMUYs%l~>=VB$9e39AMKsCOND6<*(P)GT$VLZT^MeW!0>BuA# zKxR14a7%oBbu`TJe&KKnK<+ns^hZB$0~D%h`58F8hCM6}?{!hJz=V{mL4+{39)p!f zcrGCABg1dF)aI?3d0A%TRx;G6p5w?N?cc%|-U5rjaf{^sY4FG-533g^!f}uLmRHrQ ztU)uE$cS~kmc7}dYMIg8SSUTl zUFLJ@K847j0bF5B$;Xby*74eUy&d31qQr_baFZ9#KYN=;N~q2zt~tFsznC5|<{gfE zW;S!y<$CMOqmrm5TzPH73)g^VDs~Bhw!w1d-Sv8A2+J+lDk-2T5WX_Ra>wL-&#wF0 zGbN58x=zPo>Wd;1$T>f#MxShBU-^qTqrLCaQ`0H22ZNma^#=<3Ss&og>+q~c zL&R3B)Lp&c)SiQZ!c&BtTKm2316jCS8RxNSb6UCkF5AlBl(O1*?|m;d!xkPIg-*Ce zwcKWBwP1=Ji==a?BCX}l=|hlC`Yt#mHoS3f|2=ckQ~4fo%l0l6!sZzAuJhdCslq)y zJ0TI0b7xDkZAH~BhBr@9z6Xc2Y7M;|_-T8N1%gUVi^Pct?J!M9N`PoTy})Jo!|j@n_(fGYJ3X&g7i^A8}?0kK}&AX6+`=khs8ks1`Mk@ zi&)HwFTuR$n>5;~Ek;Ypk0befx9a0W!pU@d^)|HBUCdN$it(3nFu}e~5UHd-p_SAH zNJFvwVJ^71tN@^&?L%Mop2i~J|TuWUWJZK72q7ng6r<50; zixabm9<*d+duGXGE5MC_S%ep_WU^a z$|@-0sy2NY`?=~OMk&VYtfQW;uoZ!>FxBZp^H-G#)E(|Dk%P**U}XfK{pC81nWBrP zwX=RzkF!=GDbPs?L+7wsH}QPra9e=X79*X3hSu7b_KV;66ZaT?iW|L5WDTj3Pv zDpGaM2M8c1flf_v6?8dfv(c9Z@XJf|Ks7->K7NDZ3`B<3Wf>8T20_&)6;y0Tu#p*voJA!369t zVu#{0tjrs*dcDvGXP0a>7{Ky2XNDrii$gi1&^eNIMdFIPxfDUGah?5%3pHk^^q!n(!I>zP~6z8{Y>^X6tb~mRn17AL_SFtk-pAcff8NOr;i+B0HfZs zRSnLMvWY0<)ll}=2om&N9QuFAIinNEQ-AO0i`Cqpnpu)z#eXanu48XLKIXGp@8xjm zDpo=l*c>)^Y5UJ(KJF3yTvZ6*wT-;0xi}3RFuwG-#TBIx z9Fbbl2X@)eycVeMk`dLg7EiI%$i%`O6LMujXO!Xv7Q*+LhFz*6K`Oo~wu>>O3o$Vq z>G+w+hHreSM_Vx2+c5?~l0H(6MDbsD-?GG~?j520f^lvrY+*5^x9aZpRh8RZQ&FD>m%J(yxT;b4iD_ zjpS?nXcUXuN3gPA`iZrsbhOh?ynRJ^R=q7uLi{<$IcbinH|p~5l&)+ zvl~l^4*Leoc~{ue$E-Wk!L!KXh0GfKsc5;d82hfFM~;?wlrC-aZHt{CYYLN=9~`8m zKpEHi;af~!XW>_H%?YwHE2^rOdXqCYkK=}c;bexs!Rh@|YQcK0eGWrmGdfk@Z8|s3 zpy=dR3lCcnQnVZU24?r!;$As^QSK#B)A29Mc3yY8(mp{1&py<;smhUd9Ywm#`oL!X zz(>jOkr|7@dI$vkrgf+ANLbC0+UW##0P;{MieJHV5LaeN+~mkL3cz3ILpoW~NGZ4) z=6q91g1GGlxaPwm$My)j&Izg2Cy_1@fHRl+db}}Uh(m7u(K3Y6_gGfN`5>@J6L-DhjCf86GBIvs=K;LN^ zUDh_NwSo-h$|#aGZn#}(N;K=4j}YgMzt@!xyNK6ZtkyO1GA5}pS=+V31qCtqwAO6S zf@$QFKiLbZwelLH=PRkLe^k*5dKPh-54C`$QtOLgOcZ!?sxhZ)^!>x-s(B083x9FA z0VvNjyes3SL(gN^hbg9MN2^2mPYq~@#RpON?BEBwsZ2oSOrN~rC%=xV(DTh1dA>By z`l^p}V?T!f@u5kFwjMZ^Gdv*zG`R<58k=ZB(io9NhahwH7KiglmM1pXK3nm^PDGSr zYxu~~wO+Rmq)pJ|=`xQLF_TA#5i8^TZ1EuiC!QFXkTL zZ0uVy1m!Jx_j}9xZ6ug6zt=$|kw-7%0joXJe;~)Ucc~I`IDS4SB9cV_^KwqSQ{id2 zwsmJ@s9DcrZ$|9(yj^8xx+9rg3hgWz1vk6ku971`f;aH>2{5nHsZ#^q|G__)K%QLD zl;eAEe6%YElyc(x+ga`0_TKFOevJRgf|()Seuq(m)xYN})b*R36iR5R7g9ZhZc2v2 zhhGgBgh9d6-CpyshU4p=o@2;VgS3g?NNY~F-q!f-0lW^&&Km;(*%d zfR!9slE;{~QP!6w#Ro@4)aN_g3wB;aiIsJ&Fg@g328yS3W}`KdcmNeMVK#bj{)FLV zTYJV*hvnRt_9)oAftGgYeS;Z)pADt+E}POyLibeckCFJV;f4Hcf4=anN9=z9C9o>) literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/SCalMask.cs b/Items/Armor/Vanity/SCalMask.cs new file mode 100644 index 0000000000..b5776465da --- /dev/null +++ b/Items/Armor/Vanity/SCalMask.cs @@ -0,0 +1,21 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class SCalMask : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Hood"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + + public override bool DrawHead() => false; + } +} diff --git a/Items/Armor/Vanity/SCalMask.png b/Items/Armor/Vanity/SCalMask.png new file mode 100644 index 0000000000000000000000000000000000000000..bdb80ee25ad08805280846952017b8850ec0e25a GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc3?z4jzqJQajKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilo1AIbUz1f9rw51ohXziP5{$OKHdVq!s1J9Ymdoy@>dwaTDlqLI$^?_=m zO-0p#6mLn8U+{kS>O>_%)r2R7=#&*=dVZs3MP5FIEH8h_g=6TJD|Yf z64+z(Bk}+1-sZJx`PlT_xkAWZ0jl!DOb zj=jR+tKuVG%XZy)Smkyu=HCSNkmC;?|L8NG#5n2qEa{SZ#>>+CA8gDyb9k>eyKn|CZ*Na`i?U>TfJR@jzKymt zQ0>g=_alK6Z%L3}@P8!0VEaO;4Jg4`;1OBOz`%D1gc(IOyc!r7m}5O%978JN-rl~L z_sBuOB~YJHNd4#k_p#e|yC*t`_`ctu^z0tHi0`@IQ+Vd>o6MNHU&v4W=*1{ezsvKN z-o14Dc3!zx_J)mr|83ZE|G)N}Wsfi3Fxk7`|MJ6x`5)IWmHHE5^y2JiZHLztci!^! zw0!>a^XFER^YQV@556`SE#T2$KGm?P-FbgkRN;=W*7oM}{j+zga~^*`ufPAx9M8jN z&&)L0a>KUPK{9}C3S+9nP025-SBSP}o4(-pyftU$bBnmu2jr(!^-OMhGf(hB)s=S} z_Xq7h{x9i!1XRab>82z z#-d}@hO_+jJ<57ZRAly72lW@eYg)N-gJH(UJ=)}6PA zTjf}GzSybz?qzn6uOtJurM?h%*XFyvYQpyQ>*5a2ZW7a83fFAiTqnBqQNdcazZ2bN z8}F&z8k@1P`WHO(j9-LL6n78gz2)%XXJPU858tkaTKqCU?B?!_FrRITt<0~d&p-ij zvT;fq2$%D!Oq`g#w|8yDf6hec8em|6bggUj8=tS!MNp@Etbmlt#g{}b-rFuWxZ*uyx{1&m(Z|fK6P$Eylb3{t7!)F!RN=%-aULf zJpAE{`#jRJyt-wGX#FO?AU;1##wGN|x+G~2+qDO;|9+P9XHpf*mh(p(yqx=0ufifD z_r>&yqU?d9YR`S7HdW6PzNNk!H7dcOG+X{(>x>-}CKdd7=UJ;*Chp_g+Uxkb&+_m) iOI~oYR{8VqA9vS;FtM*Z`<;QgkHOQ`&t;ucLK6VglhsxL literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/SCalRobes.cs b/Items/Armor/Vanity/SCalRobes.cs new file mode 100644 index 0000000000..912ca647e9 --- /dev/null +++ b/Items/Armor/Vanity/SCalRobes.cs @@ -0,0 +1,19 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Body)] + public class SCalRobes : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Robes"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + } +} diff --git a/Items/Armor/Vanity/SCalRobes.png b/Items/Armor/Vanity/SCalRobes.png new file mode 100644 index 0000000000000000000000000000000000000000..3ddf36518f44bb483a817064eebf4eac2ef082a5 GIT binary patch literal 710 zcmV;%0y+JOP)Px%fJsC_R7i=P18b}DDqmQsS(LikPa#cVxSZUJ1IgzU5e-+ zR*)*v!9|x24t3~am4aBXcGDr^A0R@P4An%WK19+8ZK@$jt<<|L0Q|^q0`UC)H2{v?ngn1tngrlr zsvCd@6BYmihlc@Jn0%%9pU-arUSdGzZZ$7*X}?)l3}uez9;X0!`F>N;-@Td!Aboxw zXw--`8WZP)S~E*;i-4CH(9x>OWv$2>k$5!z41mm*qu9x+m;cw%b_RTap~;kfAS2Lm zLJbtwkuAlFZF6UIAdr)sNqM4M0Q?(0&H$ecK74;qT`kzyl2Y1Ngz!cUr-{O#lD@07*qoM6N<$f^kGXUjP6A literal 0 HcmV?d00001 diff --git a/Items/Armor/Vanity/SCalRobes_Arms.png b/Items/Armor/Vanity/SCalRobes_Arms.png new file mode 100644 index 0000000000000000000000000000000000000000..9e678c99741d0ca2b91e7bf596a8c62c174d2a98 GIT binary patch literal 4080 zcmZWsd0bOT*2R&QM!Rta?9Wj)Z32i0OtUH&XcQYBOG1Mh*->QQR3H&BL{Ov=0SO2~ zfPm~vf=Ylu2#72;$QpJ@g2*OI!cGVw$vj-z`DWff_3Bquud2>D_uTtptzo7=?mxO; zL`39Az|6!3Y)^=Yh`N5i4}8Pb9m0Uko**03b0WlUnK==WgQb9p@x|MjEJmQ069@ff zrKfKYZ}wsea_i7ArmoY5VX4Wo1zaAyn`&Cu*uxh`8`G zN8^L4rp>TzB!!#2l$qwl`Qy_Ty^?e6n@t3APH?bG1!S&GHm$d|Htgq71ylSZi1+-t zA|W$lG*mXg{XdQ&Aum5yQObjmj7?QQM?uN~`XuNX_sN0%M)SVVNfPX)~@cw*H zTO9(Uw$rq}__4h*2xFn0i=*cGN|*NQPJ4Xw~V zY!I%SD6@SL0xSs!oPJ+zczMXM$pay2QKhbM`A z{N=K^?vC~(J`O1%7<9m-lE=sS3ugdYZl57Q<1W$7&U(CoJe@8&0?^Whf+WbC3$q?e z=J)#MapjVV>cta+DM9TKK4(6n(Ht`6mP|rL`>fvdviW1z`6bAvpB!|H44LbghG#hE z!TGKCA#-u~@Sm~yE>@?^=5su6`a~(QW=+;!Pvo9xaIz5-z-XGrlfuoJw+3fyw?y}V zjNJF)8nhp7;}Cfp!gO-_Sd+Hx);M4zMVi`VBULT+0yPvPT3YT8Aoxdwy-+78a@tDJvAof+mD)2LNQ7UpGB*F9 zhf((i$hK?qnbSrr=cO>QlSvRpHW`tYk75Q@#Po4z5D&#FWy2&28zdxtAZw^G!0iKe zZrEc_&pzf@ehf$2mtr1oBsIR!Q%c_DSJ^y@A2hNqUkMd!uDs@;ve;R({!{H!o z{)z@v&70+@9kWe`8=w%ER}FOmcUUixfK>d&KzivYKqIoZa!a|gnHQr(9f;(m+wZd6 z_$vj-=N}r1vbj_JA(ii5MZ^ET8y;XZSJ1=vh3Y-oFBG^2EI?esr)wZUI1;J|Y*!o* zrri$Yt@SKf?TmM1Oy%KovVv0S1d9Bi;vAuopVz{NMerDP5Eg?W4bTox37pCxAPURi zJ&LlEAZmt#4DB;QTasrt(`u*20{{L&k1?)L(>e$~#Ip@xo@3&lsbQj02drDwUaJi= zyeSIKxAB6IDs@8F-+qa(Z9i)1`Juwo|Kt}_;onv@V*<%*iMAKx8U z2&bQYU{FJ!ee8f%A}x!1u%9<3KX{@vSIe=)tRp*9#U(0YZ$B|N zP%wS*PU6N}hg7;N0s#SPQW>?Bz8?8Bjix6TP_1O>O&6@TH+25=k%jhuQqW`@Ak$at z66bU-p00i;s-)lMx6O46ESqlcrC-}QQmczNU@%Ne(J=1!Ie9lxWj8WDKe9?esItKZ zD_Nd6D^=Y7Rx_U+o^DsHc-bh1$MBi$jB;R+HYQ0`2I2MPv4;(t28Ln?$j!~#SEtT2 zdIwKDz?JIh4jl$;gqPB$BKPQxUJErAEE zza0|-*caE{_m^nqGum6m{P%)iO*N<=X~{N<#hF&SBy)Mm!lCuZg*T33ixrJwXK(V_ z11WYlhxRpuj#bUku%|FlL;3V0sEhF%-}9aRc+@DJWTdL@D@_KW&DIMtXkY}&+3~vI znuH&BHgv~cfi6qTb*n6kC99fD!G_x}=q37U%GJ2XIyX*q0|t5reIP4jLAJhUiWOH< zy9{XSnUAhglT`5b?@qOf%P6@l)jl*?lII;hzr$RjpxMOEawGpza5JXDn^|SQ?2+ki z04F=^i-KpZDvuD$3ALt$-~I3f-;v@@LgM9*U0aKc?LKD?G}shsH4NRR&=W8RbWn}; z$)`ZJ2nQYFC@-hBHQ$IOt1ce20!l1sfe}o?u{l%ORM)rNQ3NqweBR+kt~Wp{aH&&o zF6gguidlf&+R$9j1mO^bRcv_p72;S8Gw{W^IC^FHi|o!EhRIue&dQjaH#MDf#H>di zql?WKQfIam5<5lTY)Gb%hBmJh4@>p1lk~Ip|}RtS!8=4VS`< zdwISE^FZpF7-CGeY7nB}O^CdHs;^$(p>Rk1s1ZQOYP>o5r%rrAs4yTeOKt5V#4AHP z0Sn9wjA};1|3wZ>38C3hb_bNbR@r{(ua&J&Rg3$q|P#ufpAJKXoU znl#DAB}2W<+YrDhi6_^{WKzq+g61?Q@Ixjq$4 zlvLx>WJo-w-74~BP~V6-#j5;Ihft~Y*{-Kq@u+x+Hv+X|J-8zQJ82xHW>8*Ta}{%^ zM7Er~)IQ^rp5VV{?-zNA1eXpxDP(19x$SSHrMS0J=R9?0ecmPwY{j-9jY3DvxsoK4 zy2(9IRrTUQZx!9x4|GRp(qd8`{5Pz2NUklI2c1u!g#ckfnqNOZT_Rim7@+?T&VGMp zXRADhq#|}DTQpuVP1kc~zA6qow0&<-e+PGiEt9h>UI>dn8e2)N#NKhT#6_*P_CUc}rb0=7G32>BuS-To z`Z2^QyAE#_oM&tO@?>CC!{vVKRao~SL*viT!}Bvv+%0n`HO^A7Z=5gIKF_A~lnB@;a;qgS@k#P*wT9qTS9$cW<|c zJTxd6^k4&{g>BvOur=jcIaiP?X;W|iLgTP8Fn{Rt#lPzdvPn}N?rz}#d$VNI{}h*jGBI^OkBOSXkhBuLTmlz!S=x}6qAy+ zMH$DPS^Z#(&9BjL?Aa|3z?s(T9_RXS;uivy4t?!>asIpU&-A1ohHB;7gll!;+Kb%- zAB1YDU1xWZGW5;|K45n4`>%E2M|NxQ-RHTJeS;~ZG}2`4&&DQ6>C%ge02=xeKwG~z z)gjfDcjf$=m;X?bg&(GM!!v=M7dmk9{F>PT2D4m2X|r6F8oJ)~qD9tQt{^A$(8HPE zPh^XGTe7Wx^bH}*bbp3n;W*EfrwF8}Qy>X!3*_N1a;-qp za4Ui2;Lrwj9b$mo?aeBo0B@z8c`sFln*In>!7d|A%M)Q*xnDb9lZf9geRh{KK6aHWSLyXL zCZil~8WY(1CV_3||AX8ANAx$sK01;N&-HD8e_=u45FydJBrCd{kT?$Ij+$X-7_RbJ zXkQx}W#S-L+jPSF2Gz_&2^2K5)cii}17 zrR8fyW!8(qKb_QRI*%sCx%(e%h9R;CRDq$Xk-3h>iS~!QZkG8~=n-U{dEaxy$Q2!K zf9yD8^+o>^%sr}{1j2E!xZ*8TB~Wd6WUdsPwZ9dH_$w?vsSGJ`sT7+(>J!cE3egTQJTe(bspYRBiam|AT)HGL(`Q~@~3?zYMIbpd}>SY7{IIOP}O(zg3!r<_n= zpH^L=;ntD--e;kiQXPPBX-iRVLi!^=O&DNynq{)Go)EHnCskddJSaTP!g}%T>N*X# q{rF>_Pjk2XKb_?pB>(FXJlvW6Jv}qzq{vo-{13Gzw5oO-#_1TU)TMeGv_|%bI$pk6MNMR&c`dt3jhEg z; z&k9Z`yJEZz?bY&qPkiGn{-btcg3BO$a3E^yUGG7nv_Vhoz6ApRtzCQnB^WpweR{2&7 zEnn*vIDxxwxRZUH zw;h~7{}EHI#E>Ol4&X^il|Bi#*Xbt!Y>kmEfT&n=Z$_UL!93bzr9^itma;7Q2j{1n zYA8%eU2o(FFcdf{3Y@3Ar2tVb7$^YDzi*g4jhT&;WsezW3ctct6}|=lHX}YB_|oaR zCumeT(7Xe+Cq$1{llcJ6aSSK0w!PR}jPM}!Sx1k2w$|g6kU5gpB zJWjBVZaK;GhD&Qdjy@u#)#G2ZJm$ckQ|UM*&^fmqwJcSqe@dlsF`cOE@O>LXgoS%-YGM?I3OHHXV ztbT4cyDQ1+Y)L*%o(qf6N$8b7zH8Q69Lh|n0-~Iwn=^}tP(i=2^_#(C_4Y{l&>SyX zH1SdMQ{`i6Y%@WVXWc$z_dzD%h=YGK|LUThEf7@@jqZ?=V$7#Ew(QDwP1~d|wGMU- znFs)q;nPUBI`VZ(7pxLN7?@~l?g3t6Optml6Pp+01~=~%4ydX+q|6dQ%jbqnB3?MF zPD3xW=H2s2zh#lQN2>vVN0f-Ek;aP0yRw?09-=@g(q1|0n})lCt>jW2SI*r5iX*D7 zJ0kjyEjjBP?M_EbacRr6gHG*d>x2R0`a@neo`-<7mab#M>|9NL`5J=3@NsdmYL>md zOArUJKm3d^$HY6-@Ls83(MFPUK;Fjj-5-G=0AR-QJ`VI@0={VF*W4hUsb%*%M(34% z&8k<^I|Llxh8pMO2B-@8XdG>C4jV+wGZ}M06oKNa#QDja?J>s~RZ+TraLWG?`S7TTd^zdKsXqJt}BH@6*kV`#fAhPsC&duZ4R z=hyzfZy}_#KU1neD?u5TYdKlw4X?KwB2H5#Yy&%WV!yvE9u+Grar-! zp7sPAiHOy#D#EDL%$c-2l%jy#5Nt*?-5gFjsI=B)8{NX1*i}^x_^=zMlCqZabG=EV zRTYnlm)XEN9n8|A^nY~^wyVUr>M?cNzR{8Qyy-Y)a&^zv{aXcN_!BgqGdrHZ$MMRl z5o=R)Cc0yMRFngdSgvM!`<8bu;D2URdO>x^UuCq^q957I!i06R8)z+F0lIGmjjJxH zW#{}^&jyiV$KVO* zRjmu0(^ujA)l`F{6nj88u=SKBeSOb6+9=nMC=5(!!6 zo{BTjmQW$ux5I#w>(CXMqVCMJ%J$u9vu01r&UjkT?ZWuopUTF`vE}Ka@L3^~rBXdL ztphpz$`28YCcOyv*zKDH!f27c=_Y%4$U$r6=(+?6ofUpQHDmSr^Mcn~u+^pJ0*Z-% z!X|cM_o5j-w_LS0B>ric2Gvsnlb)$C=@cM;CWEV#cL)FcX-nE4qXqlJd+Qe8!X@69 z()?{&bix_r>nb8;y^xgUGG=J{1z z+RE(^Oe&76n{#vg2Dx`}0Xnss__7CUt;<3hP5>nwDnK;wk)hd&42zK&`qb zMR^{dAyQ6Rz-Q>Ypph%JZn{w$kr0i*Em^nxf{i1xG#&>is$&&um_D+2=sZK{3$$OH@(r@8iO-Sm9RQ8}o60II4I| zGEAQhKF57?KG*r;gTY03{LNm1S%VE`t8(Dtr8kip-%SSy8&xh9Ux`|C>tkV%Sfv$z zn#Nbe8cQTNUpn$#d|I&AX5gZU*=pYr(qgLk>Y|%)3QZ#k7r7yoNwE%nCr^umx)D++ zH4gsj=?M}dT_K%W?cnFzTNorn>x(5(loAHab{<%%&I;VVlbPAGKerPNZ^>Sdd*D6s zPFJipsBqJIyOAC6nVy6L+lDq6_dkI1=$06-)#nRhO-Wa~jfh6@=ZqtI?ja6?+1DSP zTg&i>V-yE>gh9p%-o+hKw4=GHnp7X(Oya?RFr4(B=#@{smmuD1Zi0$|a~ZUKGml&A z`W-@)LIVWMdjM5($4?h?M07yhrL^s+6rcZFNON58`*Wi$|dxfF7f3Hq?{i zy7#kB3$~BAe7x}o`N^z@;9ph#S0pB5l7@C38()Fnj44|Ez6FkIL5r}>`=CJ%#zITb1WTSN?KR=G18SQvQW{?>mNG@ zy>O59d&HDG1yaM|x6=tI48-#YkvE>61Kw%{dukV(1;{AsJk(CTqt`NI13EsMe7NDw zbEIQMUh0t79QnZ2MQFvzMOKVLcUB@?2ydCj;Bx7dMvRP}?B5sL6PP8pwVm3iZVyC- z?2l1wZn2X;2)IA?PKOf-OLw=8t9XaitUg^Xu2Ke(Xw?hOySN^hr9Sv zKgVW1BskARLLS7*1y!ey;Lr0u)lFt|p?4!8V~T0>ktoKqimDBm=FTR#7Q?uyCZzJDaL);Ue;BVOJ(|F{v z#G+&Ut8)sGd^V-dm4)9|jxx8WXE=f0n}eDk#cuh3K}EM`m+e{o)O1tR+?^FWRKi~B zS>*tln|oGxnM;NZ#Du}3a6L(TKNi@>y*j-}!@3!b)k{Rt=|TO;60MNRVXFOy0v&lH zckseIv1GlqaBDmMK#h^{ka=+a@h9h6YnczQg@qY|2yN=sJweyyqLQ+a1;MrNHQuHC2!^Hiw z^1lsL6ziSQ0%@{~1c~uw`wr~Qlc&Vf9$EPq%{y)cM5iQ}cB+QKfl*Q_4Rc(;)0I6|K=f5S*O6K8XN;uXFB zck+QxFR!eLZa!Us7^-2OY9li9-Xy4MyRigzd7oo8voNvUmULWtT%=>@(X&Dep5@wI zy_GP1AukjhKJK)-mpsn0flZT{&3cQSltH(nJZ=&;;LVf<&r8upG>Ggnw5>$Rj=Wm) zjBO^|y!?ZbOVES7W10gB*5Z-;dC#CzOtm5?YJB(x5VhxEs~=Kvm|N&nWQ_vu(3cwi zU9R&1C}d}g4}n%0zlw3cj~5AU(fAgaChcGCtgj_^k(h2w1DpoAtwp zWE&|a&gF#yY0FB=0dm%tV9>9jhzm;Aq~1rA9S{$flC9D+C{2hM%zDWQG>-bb_(Lv@ z!iAnva1Hl+vcY(^xxPh-+@JGYeVIQ2VQGqHo@DdLRq58g(EG*gHtrrDqTb(huD5-g z;2whlnOMt2l51IY=e7X$!(!FR7sdQiTM@8(U6CDkUGE#a?f>yuxxQMq z)39aZjnVt<)>0g6m)ueiECB8IszrAsatjTL#GP>5tL{N&#x^-qnDy^NML7B%-F zW|P=}kk^MSZlHfKeNIhh!7|HL^5XL}_*)0~ODlL)=vlf?Qs|AOoX}~yc5>+N(vVpJ zigBb+qr>dAsoZ7Y%hTNPkkp2t$PTi_-p*+|6|kupWcWYFa(!$FecrEm0xUZ10cmjm z4gt`;gX213BVr9QQwmVq^&m*1o|a3~7+7jfB>5X{yviYh7md-Gz48iw?G664*sAHh zi@8lnXs2W|*|pHNKaO_i@}A%mDlG5?bgBrB$`5w`5*ooGffHzR^M?}vI6jDG>mM-M z!=EInYFC5PeZ9Gj1>MJgoI6-c>$jV*j~mE0?MWm0U`uOHhcKZBq_($}#*Uw9Tk_#GB4j5ubD3^EO^ z3D0vT@>8@fkD&6Sq5E>C@pt)ek;SG}E_7k7#W#@OPN3wJ|F8ImPk(d%(1k@9Ctpcv zOnZ3HGQB>%Xhjub?}wB~hEB=+m*4)a@Y3Iid^`|elvvrdbJ^HB+9WTZ6pby*QM8sa zE3ees;sgDBtKn;X$>Ad=Fwy}*2PvX?G@>~1GePYx(g~c9*)Yr4H_O*x=dkm9;IKnQ zqW$Wo_RS6yjSgG|qSy<~2chhuD)fk^@y#RG8vYr8vuzaUH*{*_E%ze@`x0U ze%Y1-@Evz&wh=O`9lCZNSLj~e6Z&ag&?I1^LO2S7`=7xahzElSy7-siTJ4J&bo_|M!0gx_|d*}GN z$xgFEr^W7vSf*8!eyAo5UqLhPw=*EkP($Wamae7zp7+Qy?*wS)eYjw7KTjR63?{}_ zsb;YzS9LKQqSC1S3D+0RYy%6Tt<+ee|6vfC2;)7$Q}~-V!FrTgp5W4S&9MCQ4yZAu z|CJ0lclm$h-+?&x%2BggJ6XPeoa&eOERW+!epW0nM^vxu*Y3fM`Y;W{)K1Y!oo|{% zlB>h7So}Q$|AL3}=6}QA-x&G_Hvb7qgE0kH$+s70ui5+(5c{_?G5EU!)q_{)=wr%1 zb_e5GTp^@Uos-S@YCDL%e`J1%&p9_Mq6Zdt3P)3CoH9M*D*g~zKXR;?K6$}bk8u8r zV>GpJIc4qg1@lV~du|1+Qc)mD7q&jGEQP--9Oi5o1g=*u&3T)DOe^7Z&o8WW&sX}3 z5&vbDl_Ho!f<-BnH?Y^ws@W=|kTTIMB$$!S#!ASz^L1FiyZwAG$tKHv&uQB`#a_gcWVbbgf@9adV|>uzw>`R`=4JBf-x2nM?hqv6Kj z{Bw`!8MfyjjpGs2KIGqgSef5Ox}A>PRqfTLvG{#T7v~;|0B?)6U-1aKDIH;`!D?*L zL-ae3SMhz;IZ#9Q6YIJ&axDSWHsgT02obd*7hU}$lI7X{dnS>BcBesw;8Fy`(!_vN zb3YL|lI#5lnH)4f%zp3lVr*3a=R*8WPUT}j>W1Tl=sLU%HF~5Engg(b4wVJ3N*b5e zb?b$9VP$@)6Z(l5eeL#v>h_-j;!k(AFJ2^@*i7T|{(tccB+!@a1F_S$t8d1uD}yU+ O0CCaGsKmf2`hNiQ5RCW$ literal 0 HcmV?d00001 diff --git a/Items/TreasureBags/SCalBag.cs b/Items/TreasureBags/SCalBag.cs new file mode 100644 index 0000000000..0478b55c4a --- /dev/null +++ b/Items/TreasureBags/SCalBag.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.Pets; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas; + +namespace CalamityMod.Items.TreasureBags +{ + public class SCalBag : ModItem + { + public override int BossBagNPC => ModContent.NPCType(); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Coffer"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + + public override void SetDefaults() + { + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + item.rare = ItemRarityID.Purple; + item.expert = true; + } + + public override bool CanRightClick() => true; + + public override void OpenBossBag(Player player) + { + player.TryGettingDevArmor(); + + // Weapons + float w = DropHelper.BagWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(player, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); + + // Vanity + if (Main.rand.NextBool(7)) + { + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + } + } + } +} diff --git a/Items/TreasureBags/SCalBag.png b/Items/TreasureBags/SCalBag.png new file mode 100644 index 0000000000000000000000000000000000000000..2fc6a926b0a32814a6c46d8d8b8e1e64ad6aa7f7 GIT binary patch literal 605 zcmeAS@N?(olHy`uVBq!ia0vp^dO)nj!3-pSf14=`q!^2X+?^QKos)S9M+NwVxTXha*l0`dn`quwte?Tl+ses4PekPXq5A*-etWYEb8+zo8afsl z+qfudxU$UG78aN1(|=U;+D*hG(A`B(RrQCbr=Ff=NkN{sxwn+0a+Vp$8GY`pKr-~? zbP*sWR}$nG{2w1+cq1Vb2UN*f;1OBOz`%DHgc*EyRX%?bjp zKPO1t6zWJ?<5~Ovy3X{YYQDeNZH#A~y?1!SnFTk5l$2Fpl`nZBQ@U4gX;755YU+3W z{ym}WK~kSTwi)*CaTQ;5-XpR{9H^pw?bVG}H5Zm%SA4VU;q<+WO?i5P*Dto2yT;Xm z$7Md}^ABoLY%i{Dy1eK$Pf2n_`Ma89OfQZ(q%U`U&V6LpcL}AI)2b{X_cot9XSnzE zj|Gn<4p}Txa{4}Fok+?2#tv7Ph$FTy3T~Aoyfr!cB8KDho4v*N&KGl>J8I$k+u-H) zpzZYql1kZ~JMC#wUK?V zuC0@dF^-9U!En-0w%&k8PUE`vJ&D%#O3SRN>q73ocduoyy03k8)#J^gOt+JJVhU^VbwI&2cH&|`)vOf*YR=Mk8=yUHnNmQ=>9TRtzN{^s#SZtj=|F~wbejt SyACi47(8A5T-G@yGywn~Y6dL; literal 0 HcmV?d00001 diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index ed08789e23..7bc6ada075 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -12,8 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Perdition"); Tooltip.SetDefault("Summons a beacon at the position of the mouse\n" + - "When a target is manually selected via right click it releases torrents of souls from below onto the target\n" + - "The beacon does not move"); + "When a target is manually selected via right click it releases torrents of souls from below onto the target"); } public override void SetDefaults() diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 2a0af9787e..d7798bcc38 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -577,7 +577,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 8669ddac3f..d438591214 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2,12 +2,14 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools; +using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -200,6 +202,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; music = CalamityMod.Instance.GetMusicFromMusicMod("SCG") ?? MusicID.Boss2; + bossBag = ModContent.ItemType(); } public override void BossHeadSlot(ref int index) @@ -2736,6 +2739,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Make the town NPC spawn. NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 12, ModContent.NPCType()); + DropHelper.DropBags(npc); + // Increase the player's SCal kill count if (Main.player[npc.target].Calamity().sCalKillCount < 5) Main.player[npc.target].Calamity().sCalKillCount++; @@ -2748,32 +2753,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas int essenceMax = Main.expertMode ? 40 : 30; DropHelper.DropItem(npc, ModContent.ItemType(), true, essenceMin, essenceMax); - // Weapons - // Rejoice! Hybrid weapons are no more, so this list is no longer cluttered. - DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), // Flamsteed Ring - ModContent.ItemType(), // Illustrious Knives - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), // Staff of Blushie - ModContent.ItemType(), - ModContent.ItemType(), // Temporal Umbrella - ModContent.ItemType(), // The Dance of Light - ModContent.ItemType(), - ModContent.ItemType() // Voidragon - ); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.revenge); + if (!Main.expertMode) + { + // Weapons. + float w = DropHelper.NormalWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(npc, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Vanity. + if (Main.rand.NextBool(7)) + { + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + } + } // Vanity DropHelper.DropItem(npc, ModContent.ItemType(), Main.expertMode);