From 21601af2214f61efb4bf2e33eddfe9ec2268c141 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 15 May 2021 01:22:53 -0500 Subject: [PATCH] 1 - Tried to fix Leviathan circular hitboxes so that they actually work. 2 - Adjusted some Malice Mode bosses again. 3 - Nerfed Septic Skewer bacteria damage and spawn rate. 4 - The Hive rockets no longer fall. 5 - Life steal now works on Rev+ Golem. --- CalPlayer/CalamityPlayer.cs | 2 +- CalamityLists.cs | 4 --- NPCs/AstrumAureus/AstrumAureus.cs | 2 -- NPCs/CalamityAI.cs | 4 +-- NPCs/CalamityGlobalAI.cs | 8 ++--- NPCs/Leviathan/Leviathan.cs | 39 ++++++++++++----------- NPCs/Ravager/RavagerClawLeft.cs | 2 +- NPCs/Ravager/RavagerClawRight.cs | 2 +- NPCs/Ravager/RavagerHead.cs | 2 +- NPCs/Ravager/RavagerLegLeft.cs | 2 +- NPCs/Ravager/RavagerLegRight.cs | 2 +- Projectiles/Ranged/BeeRPG.cs | 15 --------- Projectiles/Ranged/GoliathRocket.cs | 15 --------- Projectiles/Ranged/HiveBomb.cs | 15 --------- Projectiles/Ranged/HiveMissile.cs | 15 --------- Projectiles/Ranged/SepticSkewerHarpoon.cs | 8 ++--- 16 files changed, 36 insertions(+), 101 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6507d4e910..3929117707 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2847,7 +2847,7 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int damage = (int)(600 * player.RangedDamage()); + int damage = (int)(400 * player.RangedDamage()); if (player.whoAmI == Main.myPlayer) { for (int i = 0; i < 8; i++) diff --git a/CalamityLists.cs b/CalamityLists.cs index 9790add389..76b97c1a93 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1695,10 +1695,6 @@ namespace CalamityMod NPCID.TheDestroyerTail, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistRight, - NPCID.GolemFistLeft, NPCID.MoonLordCore }; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index d3ecee70e6..200ba62047 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -20,7 +19,6 @@ using System.IO; using System.Threading; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.NPCs.AstrumAureus diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 1acdeea8ed..1401877ea7 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3264,8 +3264,8 @@ namespace CalamityMod.NPCs void CustomGravity() { - float gravity = 0.3f + 0.15f * enrageScale; - float maxFallSpeed = 10f + 5f * enrageScale; + float gravity = 0.36f + 0.12f * enrageScale; + float maxFallSpeed = 12f + 4f * enrageScale; if (calamityGlobalNPC.newAI[0] > 1f) maxFallSpeed *= calamityGlobalNPC.newAI[0]; diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 036ac820d7..3289485f8e 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -10098,7 +10098,7 @@ namespace CalamityMod.NPCs velocity *= 1.5f; if (enrage) - velocity *= 2f; + velocity *= 1.5f; int type = ProjectileID.Fireball; int damage = npc.GetProjectileDamage(type); @@ -10288,7 +10288,7 @@ namespace CalamityMod.NPCs npc.ai[1] = 0f; Vector2 vector81 = new Vector2(npc.Center.X, npc.Center.Y + 10f); - float num655 = enrage ? 16f : 8f; + float num655 = turboEnrage ? 16f : enrage ? 12f : 8f; float num656 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector81.X; float num657 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector81.Y; float num658 = (float)Math.Sqrt(num656 * num656 + num657 * num657); @@ -10338,7 +10338,7 @@ namespace CalamityMod.NPCs npc.ai[1] = 0f; - float num663 = enrage ? 18f : 12f; + float num663 = turboEnrage ? 18f : enrage ? 15f : 12f; float num664 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector82.X; float num665 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector82.Y; float num666 = (float)Math.Sqrt(num664 * num664 + num665 * num665); @@ -10683,7 +10683,7 @@ namespace CalamityMod.NPCs npc.ai[1] = 0f; Vector2 vector88 = new Vector2(npc.Center.X, npc.Center.Y - 10f); - float num706 = enrage ? 10f : 5f; + float num706 = turboEnrage ? 10f : enrage ? 7.5f : 5f; float num709 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector88.X; float num710 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector88.Y; float num711 = (float)Math.Sqrt(num709 * num709 + num710 * num710); diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index c2e6a42993..cd51f3d827 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -619,38 +619,27 @@ namespace CalamityMod.NPCs.Leviathan // Can only hit the target if within certain distance. public override bool CanHitPlayer(Player target, ref int cooldownSlot) { - Rectangle npcHitbox = npc.Hitbox; - Rectangle targetHitbox = target.Hitbox; - - Vector2 npcHitboxCenter = new Vector2(npcHitbox.X + (npcHitbox.Width / 2), npcHitbox.Y + (npcHitbox.Height / 2)); + Vector2 npcCenter = npc.Center; // NOTE: Tail and mouth hitboxes are interchangeable, each hitbox is the same size and is located to the right or left of the body hitbox. // Width = 225, Height = 225 - Rectangle mouthHitbox = new Rectangle((int)(npcHitboxCenter.X - (npc.width / 2f)), (int)(npcHitboxCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); + Rectangle mouthHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 2f)), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); // Width = 450, Height = 450 - Rectangle bodyHitbox = new Rectangle((int)(npcHitboxCenter.X - (npc.width / 4f)), (int)(npcHitboxCenter.Y - (npc.height / 2f)), npc.width / 2, npc.height); + Rectangle bodyHitbox = new Rectangle((int)(npcCenter.X - (npc.width / 4f)), (int)(npcCenter.Y - (npc.height / 2f)), npc.width / 2, npc.height); // Width = 225, Height = 225 - Rectangle tailHitbox = new Rectangle((int)(npcHitboxCenter.X + (npc.width / 2f)), (int)(npcHitboxCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); + Rectangle tailHitbox = new Rectangle((int)(npcCenter.X + (npc.width / 2f)), (int)(npcCenter.Y - (npc.height / 4f)), npc.width / 4, npc.height / 2); Vector2 mouthHitboxCenter = new Vector2(mouthHitbox.X + (mouthHitbox.Width / 2), mouthHitbox.Y + (mouthHitbox.Height / 2)); Vector2 bodyHitboxCenter = new Vector2(bodyHitbox.X + (bodyHitbox.Width / 2), bodyHitbox.Y + (bodyHitbox.Height / 2)); Vector2 tailHitboxCenter = new Vector2(tailHitbox.X + (tailHitbox.Width / 2), tailHitbox.Y + (tailHitbox.Height / 2)); + Rectangle targetHitbox = target.Hitbox; + float mouthDist1 = Vector2.Distance(mouthHitboxCenter, targetHitbox.TopLeft()); float mouthDist2 = Vector2.Distance(mouthHitboxCenter, targetHitbox.TopRight()); float mouthDist3 = Vector2.Distance(mouthHitboxCenter, targetHitbox.BottomLeft()); float mouthDist4 = Vector2.Distance(mouthHitboxCenter, targetHitbox.BottomRight()); - float bodyDist1 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopLeft()); - float bodyDist2 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopRight()); - float bodyDist3 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomLeft()); - float bodyDist4 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomRight()); - - float tailDist1 = Vector2.Distance(tailHitboxCenter, targetHitbox.TopLeft()); - float tailDist2 = Vector2.Distance(tailHitboxCenter, targetHitbox.TopRight()); - float tailDist3 = Vector2.Distance(tailHitboxCenter, targetHitbox.BottomLeft()); - float tailDist4 = Vector2.Distance(tailHitboxCenter, targetHitbox.BottomRight()); - float minMouthDist = mouthDist1; if (mouthDist2 < minMouthDist) minMouthDist = mouthDist2; @@ -659,6 +648,13 @@ namespace CalamityMod.NPCs.Leviathan if (mouthDist4 < minMouthDist) minMouthDist = mouthDist4; + bool insideMouthHitbox = minMouthDist <= 225f; + + float bodyDist1 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopLeft()); + float bodyDist2 = Vector2.Distance(bodyHitboxCenter, targetHitbox.TopRight()); + float bodyDist3 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomLeft()); + float bodyDist4 = Vector2.Distance(bodyHitboxCenter, targetHitbox.BottomRight()); + float minBodyDist = bodyDist1; if (bodyDist2 < minBodyDist) minBodyDist = bodyDist2; @@ -667,6 +663,13 @@ namespace CalamityMod.NPCs.Leviathan if (bodyDist4 < minBodyDist) minBodyDist = bodyDist4; + bool insideBodyHitbox = minBodyDist <= 450f; + + float tailDist1 = Vector2.Distance(tailHitboxCenter, targetHitbox.TopLeft()); + float tailDist2 = Vector2.Distance(tailHitboxCenter, targetHitbox.TopRight()); + float tailDist3 = Vector2.Distance(tailHitboxCenter, targetHitbox.BottomLeft()); + float tailDist4 = Vector2.Distance(tailHitboxCenter, targetHitbox.BottomRight()); + float minTailDist = tailDist1; if (tailDist2 < minTailDist) minTailDist = tailDist2; @@ -675,8 +678,6 @@ namespace CalamityMod.NPCs.Leviathan if (tailDist4 < minTailDist) minTailDist = tailDist4; - bool insideMouthHitbox = minMouthDist <= 225f; - bool insideBodyHitbox = minBodyDist <= 450f; bool insideTailHitbox = minTailDist <= 225f; return insideMouthHitbox || insideBodyHitbox || insideTailHitbox; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index ca25ad36b3..117b9b1bbf 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.Ravager if (npc.ai[0] == 0f) { npc.noTileCollide = true; - float num659 = 21f; + float num659 = 40f; if (npc.life < npc.lifeMax / 2 || death) { num659 += 1f; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index b4b7f3fdfc..ae0ad548c3 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.Ravager if (npc.ai[0] == 0f) { npc.noTileCollide = true; - float num659 = 21f; + float num659 = 40f; if (npc.life < npc.lifeMax / 2 || death) { num659 += 1f; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 93f133cc31..f4116b7adf 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Ravager if (npc.timeLeft < 1800) npc.timeLeft = 1800; - float speed = 21f; + float speed = 40f; float centerX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - npc.Center.X; float centerY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - npc.Center.Y; centerY -= 20f; diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 5418d3c79f..bf52614699 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.Ravager } if (npc.ai[0] == 0f) { - float num659 = 21f; + float num659 = 40f; Vector2 vector79 = new Vector2(center.X, center.Y); float num660 = Main.npc[CalamityGlobalNPC.scavenger].Center.X - vector79.X; float num661 = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - vector79.Y; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 7058a5d0e2..2d9b684dbe 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.Ravager } if (npc.ai[0] == 0f) { - float num659 = 21f; + float num659 = 40f; Vector2 vector79 = new Vector2(center.X, center.Y); float num660 = Main.npc[CalamityGlobalNPC.scavenger].Center.X - vector79.X; float num661 = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - vector79.Y; diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 2db72bac8b..9807488816 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -63,22 +63,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num252].noGravity = true; Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } - projectile.ai[0] += 1f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.ai[0] > 10f || projectile.ai[0] > 5f) - { - projectile.ai[0] = 10f; - if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) - { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) - { - projectile.velocity.X = 0f; - projectile.netUpdate = true; - } - } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; - } } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index dfbcb6a23f..39b5d5bf4e 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -79,22 +79,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } - projectile.ai[0] += 1f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.ai[0] > 10f || projectile.ai[0] > 5f) - { - projectile.ai[0] = 10f; - if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) - { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) - { - projectile.velocity.X = 0f; - projectile.netUpdate = true; - } - } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 64c904726e..3af34311f0 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -79,22 +79,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } - projectile.ai[0] += 1f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.ai[0] > 10f || projectile.ai[0] > 5f) - { - projectile.ai[0] = 10f; - if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) - { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) - { - projectile.velocity.X = 0f; - projectile.netUpdate = true; - } - } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 8509bd1db0..dc20218bae 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -79,22 +79,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } - projectile.ai[0] += 1f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.ai[0] > 10f || projectile.ai[0] > 5f) - { - projectile.ai[0] = 10f; - if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) - { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) - { - projectile.velocity.X = 0f; - projectile.netUpdate = true; - } - } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index 3112b9b18d..d003c0e40f 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -39,13 +39,13 @@ namespace CalamityMod.Projectiles.Ranged { projectile.alpha = 0; } - if ((int)projectile.ai[1] % 4 == 0 && projectile.owner == Main.myPlayer && Main.rand.NextBool(5)) + if (projectile.ai[1] % 8f == 0f && projectile.owner == Main.myPlayer && Main.rand.NextBool(5)) { Vector2 vector63 = vector62 * -1f; vector63.Normalize(); - vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; - vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * MathHelper.PiOver2, default); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); + vector63 *= Main.rand.Next(45, 65) * 0.1f; + vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * MathHelper.PiOver2); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); } if (player.dead) {