From cc3ec862ba6a51d6edce25686ac691be61a98efb Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 5 Jul 2024 14:37:05 -0400 Subject: [PATCH 01/28] Increased Wulfrum enemy spawn rates in Hardmode --- NPCs/NormalNPCs/WulfrumAmplifier.cs | 4 ++-- NPCs/NormalNPCs/WulfrumDrone.cs | 2 +- NPCs/NormalNPCs/WulfrumGyrator.cs | 2 +- NPCs/NormalNPCs/WulfrumHovercraft.cs | 2 +- NPCs/NormalNPCs/WulfrumRover.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 316dc14574..24b60695c5 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -217,9 +217,9 @@ namespace CalamityMod.NPCs.NormalNPCs // Spawn less frequently in the inner third of the world. if (spawnInfo.PlayerFloorX > Main.maxTilesX * 0.333f && spawnInfo.PlayerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.01f : 0.06f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.015f : 0.06f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f); - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.033f : 0.15f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.0375f : 0.15f) * (!NPC.AnyNPCs(NPC.type) ? 1.3f : 1f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 8131fe0a1e..e3d97d8ecd 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld)) return 0f; - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index adb4b9b685..6c40b1dd86 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld)) return 0f; - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 38fdb46dda..a63b1c1fc8 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld)) return 0f; - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index bbaee7f27e..52be53013a 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur || (!spawnInfo.Player.ZoneOverworldHeight && !Main.remixWorld) || (!spawnInfo.Player.ZoneNormalCaverns && spawnInfo.Player.ZoneGlowshroom && Main.remixWorld)) return 0f; - return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.010f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); + return (Main.remixWorld ? SpawnCondition.Cavern.Chance : SpawnCondition.OverworldDaySlime.Chance) * (Main.hardMode ? 0.055f : 0.135f) * (NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f); } public override void HitEffect(NPC.HitInfo hit) From cc56b632805e2ad3dee0b5ac5788c2477f980c52 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 5 Jul 2024 15:25:16 -0400 Subject: [PATCH 02/28] Cal Clone bros now despawn instead of being killed when Cal Clone despawns Fixes them dropping items when "despawning" --- NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs index 3eda2702e2..083413d028 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs @@ -740,9 +740,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) { - if (Main.netMode != NetmodeID.MultiplayerClient) - npc.StrikeInstantKill(); - + npc.active = false; return; } @@ -1058,9 +1056,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) { - if (Main.netMode != NetmodeID.MultiplayerClient) - npc.StrikeInstantKill(); - + npc.active = false; return; } From cfc119e26921364ceca2e8a149067fb07d313811 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 5 Jul 2024 17:01:27 -0500 Subject: [PATCH 03/28] Cal Clone brothers fade out when Cal Clone is dead. --- .../CalamityBossAIs/CalamitasCloneAI.cs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs index 083413d028..d8d4f485ee 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs @@ -740,6 +740,24 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) { + if (npc.alpha < 255) + { + npc.velocity *= 0.9f; + + npc.alpha += 2; + if (npc.alpha > 255) + npc.alpha = 255; + + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 1f; + } + } + else + npc.active = false; + npc.active = false; return; } @@ -1056,7 +1074,24 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) { - npc.active = false; + if (npc.alpha < 255) + { + npc.velocity *= 0.9f; + + npc.alpha += 2; + if (npc.alpha > 255) + npc.alpha = 255; + + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 1f; + } + } + else + npc.active = false; + return; } From 104a1ba086b2d34b6122616194efc797998bbb19 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 5 Jul 2024 21:06:38 -0400 Subject: [PATCH 04/28] Change method of Draedon's Forge recipe recognition for Magic Storage compatibility --- Items/CalamityGlobalItem.cs | 10 ++++++++++ .../Furniture/CraftingStations/DraedonsForge.cs | 14 -------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 52e8fc8117..c2fa066fe6 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -20,6 +20,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; @@ -1766,10 +1767,19 @@ namespace CalamityMod.Items #endregion #region On Create + private static int cachedForgeID = -1; public override void OnCreated(Item item, ItemCreationContext context) { // ChoosePrefix also happens on craft so go reset it here too storedPrefix = -1; + + // 05JUL2024: Ozzatron: Register the usage of Draedon's Forge for the purposes of his dialogue. + // This was moved out of an On edit in the DraedonsForge item for Magic Storage compatibility. + Player p = Main.LocalPlayer; + if (cachedForgeID < 0) + cachedForgeID = ModContent.TileType(); + if (context is RecipeItemCreationContext && p.adjTile[cachedForgeID]) + p.Calamity().HasCraftedDraedonsForge = true; } #endregion diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 60d8f1eb10..229205fecf 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -9,20 +9,6 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public class DraedonsForge : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; - public override void SetStaticDefaults() - { - Terraria.On_Recipe.ConsumeForCraft += DraeforgeUnlockDetour; - } - - private static bool DraeforgeUnlockDetour(On_Recipe.orig_ConsumeForCraft orig, Recipe self, Item item, Item requiredItem, ref int stackRequired) - { - if (self.HasTile(ModContent.TileType())) - { - Main.LocalPlayer.Calamity().HasCraftedDraedonsForge = true; - } - return orig(self, item, requiredItem, ref stackRequired); - } - public override void SetDefaults() { Item.width = 58; From f3a37277d2ef7511ff1e75c51e3edcf80fecb0dd Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 5 Jul 2024 21:13:17 -0500 Subject: [PATCH 05/28] 1 - Rev+ Golem can now use the new jump slam attack from Master Rev+ when the head is detached. --- NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs | 67 +++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index cbcf4efead..7b0f064e88 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -350,7 +350,72 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } else - NormalJump(); + { + if (npc.ai[3] == 0f) + npc.ai[3] = !headAlive ? Main.rand.Next(2) + 1f : 1f; + + switch ((int)npc.ai[3]) + { + default: + case 0: + case 1: + NormalJump(); + break; + + // Jump directly above the target's head and slam down + case 2: + + npc.noTileCollide = true; + + npc.ai[2] += 1f; + float jumpVelocity = death ? 23f : 21f; + if (enrage) + jumpVelocity *= 1.25f; + if (turboEnrage) + jumpVelocity *= 1.5f; + + float minJumpTime = 15f; + float maxJumpTime = 45f; + if ((npc.ai[2] >= minJumpTime && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= jumpVelocity) || npc.ai[2] >= maxJumpTime) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 1f; + npc.velocity.Y = -3f; + npc.netUpdate = true; + } + + Vector2 center = npc.Center; + if (!Main.player[npc.target].dead && Main.player[npc.target].active && Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) <= despawnDistance) + center = Main.player[npc.target].Center; + + center.Y -= 480f; + if (npc.velocity.Y == 0f) + { + npc.velocity = center - npc.Center; + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); + npc.velocity *= jumpVelocity; + + float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); + float speedMult = 1f; + + float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; + if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) + speedMult += distanceBelowTarget * multiplier; + + float speedMultLimit = turboEnrage ? 3.5f : enrage ? 3f : 2.5f; + if (speedMult > speedMultLimit) + speedMult = speedMultLimit; + + if (Main.player[npc.target].position.Y < npc.Bottom.Y) + npc.velocity.Y *= speedMult; + } + else + npc.velocity.Y *= 0.95f; + + break; + } + } void NormalJump() { From 0e9ab797e408d1b4d9d929fb3b078bd5cb360543 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 7 Jul 2024 02:52:37 -0400 Subject: [PATCH 06/28] Fixed The Bee's cooldown being applied if the hit was dodged --- CalPlayer/CalamityPlayer.cs | 1 + CalPlayer/CalamityPlayerHitHurt.cs | 20 ++++++++++++++++++-- Items/Accessories/TheBee.cs | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d839638068..28dffb79b1 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -488,6 +488,7 @@ namespace CalamityMod.CalPlayer public bool unstableGraniteCore = false; public bool regenator = false; public bool theBee = false; + public bool shouldTriggerBeeCooldown = false; public int theBeeCooldown = 0; public bool alluringBait = false; public bool enchantedPearl = false; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index b511891b08..e724297fec 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -839,7 +839,7 @@ namespace CalamityMod.CalPlayer if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition) { contactDamageReduction += 0.5; - theBeeCooldown = 600; + shouldTriggerBeeCooldown = true; } // Apply Adrenaline DR if available @@ -1078,7 +1078,7 @@ namespace CalamityMod.CalPlayer if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition) { projectileDamageReduction += 0.5; - theBeeCooldown = 600; + shouldTriggerBeeCooldown = true; } // Apply Adrenaline DR if available @@ -1176,6 +1176,14 @@ namespace CalamityMod.CalPlayer if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0) Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, "default"); + // Same thing with The Bee + if (theBee && shouldTriggerBeeCooldown) + { + shouldTriggerBeeCooldown = false; + if (hurtInfo.Damage > 0) + theBeeCooldown = TheBee.CooldownLength; + } + if (NPC.AnyNPCs(ModContent.NPCType())) Player.AddBuff(ModContent.BuffType(), 15, true); @@ -1299,6 +1307,14 @@ namespace CalamityMod.CalPlayer } } + // Apply The Bee cooldown, must be applied here so that it does not apply on dodges + if (theBee && shouldTriggerBeeCooldown) + { + shouldTriggerBeeCooldown = false; + if (hurtInfo.Damage > 0) + theBeeCooldown = TheBee.CooldownLength; + } + if (proj.hostile && hurtInfo.Damage > 0) { if (proj.type == ProjectileID.TorchGod) diff --git a/Items/Accessories/TheBee.cs b/Items/Accessories/TheBee.cs index 8d9aac1e0c..71dd921abe 100644 --- a/Items/Accessories/TheBee.cs +++ b/Items/Accessories/TheBee.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Items.Accessories { public class TheBee : ModItem, ILocalizedModType { + public static int CooldownLength = 600; public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { From 88f40ff5dd60748523329c2713551c53628d76a5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 7 Jul 2024 03:21:25 -0400 Subject: [PATCH 07/28] Fixed two bugs related to Red Wine + Baguette: 1. Red Wine's healing tooltip does not update while Baguette is active 2. Red Wine does not restore the correct amount of health when used with Quick Heal while Baguette is active Thank goodness for this very convenient hook lol --- Items/Potions/Alcohol/RedWine.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index a0f4c67292..06a09a61b2 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -31,10 +31,9 @@ namespace CalamityMod.Items.Potions.Alcohol Item.value = Item.sellPrice(silver: 30); } - public override bool? UseItem(Player player) + public override void GetHealLife(Player player, bool quickHeal, ref int healValue) { - Item.healLife = player.Calamity().baguette ? 250 : 200; - return null; + healValue = player.Calamity().baguette ? 250 : 200; } public override void OnConsumeItem(Player player) From 1c6b500994af9ae698f2b96d009f3d784baae2d8 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 7 Jul 2024 03:43:17 -0500 Subject: [PATCH 08/28] Rev+ Golem Free Head is slower and removed its Rev+ HP buff to encourage players to kill it. --- NPCs/CalamityGlobalNPC.cs | 1 - NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 7e79e0de7c..e10b14bd7c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1409,7 +1409,6 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.GolemHeadFree) { - npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.7); npc.dontTakeDamage = false; } else if (npc.type == NPCID.HallowBoss) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 7b0f064e88..e4c312fd4c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -1393,21 +1393,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } npc.ai[3] -= 1f + - ((phase2 || turboEnrage) ? 1f : 0f) + - ((phase3 || turboEnrage) ? 1f : 0f) + - ((phase4 || turboEnrage) ? 2f : 0f); + (turboEnrage ? 1f : phase2 ? 0.5f : 0f) + + (turboEnrage ? 1f : phase3 ? 0.5f : 0f) + + (turboEnrage ? 2f : phase4 ? 1f : 0f); float offsetX = calamityGlobalNPC.newAI[0]; float offsetY = calamityGlobalNPC.newAI[1]; Vector2 destination = Main.player[npc.target].Center + new Vector2(offsetX, offsetY); // Velocity and acceleration - float velocity = 16f + - ((phase2 || turboEnrage) ? 8f : 0f) + - ((phase3 || turboEnrage) ? 8f : 0f); + float velocity = (turboEnrage ? 15f : 10f) + + (turboEnrage ? 7.5f : phase2 ? 5f : 0f) + + (turboEnrage ? 7.5f : phase3 ? 5f : 0f); if (enrage) - velocity = (phase3 || turboEnrage) ? 40f : 32f; + velocity = (phase3 || turboEnrage) ? 35f : 25f; float acceleration = phase3 ? 0f : turboEnrage ? 6f : enrage ? 4.8f : phase2 ? 1.2f : 0.8f; From 718d2ffbd349421a7f4236f3bacaf95cfc88f1c8 Mon Sep 17 00:00:00 2001 From: enamoured_ Date: Sun, 7 Jul 2024 16:01:15 -0400 Subject: [PATCH 09/28] accessory tooltip fixes dark sun ring shiftable text colour, elysian aegis flavour text, old duke scales stamina tooltip red colour adjustment pls dont break --- Items/Accessories/DarkSunRing.cs | 1 + Items/Accessories/ElysianAegis.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index e42faa21c3..030506fa76 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; public bool HasFlavorTooltip => true; + public Color? TooltipExtensionColor => new(195, 223, 255); public override void SetStaticDefaults() { diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index c9c6108f35..549733c0b9 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public class ElysianAegis : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; - + public bool HasFlavorTooltip => true; public Color? TooltipExtensionColor => new(195, 223, 255); public const int ShieldSlamDamage = 500; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index bd9fd2d3e7..4fda6ed14d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -689,13 +689,13 @@ ElysianAegis: { Allows the ability to dash, empowered by holy fire This dash can ram through enemies without taking damage Grants immunity to knockback, fire blocks, as well as multiple debuffs - Blessed by the Profaned Flame ''' HoldShiftTooltip: ''' On Fire!, Hellfire, Cursed Inferno, Shadowflame, Daybroken, Holy Flames, Brimstone Flames, Burning ''' + FlavorTooltip: "'Blessed by the Profaned Flame'" } EnchantedPearl: { @@ -1199,8 +1199,8 @@ OldDukeScales: { [c/c3dfff: Stamina will gradually restore after not dashing for 1 second] [c/c3dfff: Stamina recovers faster when you are stationary] [c/c3dfff: If your stamina reaches 0%, you become exhausted] - [c/CE0E18: While exhausted, this item's damage reduction and movement bonuses are negated] - [c/CE0E18: Being exhausted reduces movement speed by 30% and dash velocity by 50%] + [c/e3545c: While exhausted, this item's damage reduction and movement bonuses are negated] + [c/e3545c: Being exhausted reduces movement speed by 30% and dash velocity by 50%] [c/c3dfff: This debuff lasts until your stamina reaches 100% again] ''' } From 8e3937060c4a19b610b5a61b6773c9e0e33c3df6 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 8 Jul 2024 01:35:33 -0400 Subject: [PATCH 10/28] Bunch of Astral Ore changes: * Meteorite now avoids Astral Ore * Astral Ore can now convert nearby Meteorite into Astral Ore * Astral Ore can now be blown up * Astral Ore can now be destroyed at all times instead of only after defeating Astrum Deus; destroying it before defeating Astrum Deus drops 1-2 Starblight Soot --- Tiles/Ores/AstralOre.cs | 20 ++++++++++++++++---- World/AstralBiome.cs | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 2b9da5ece9..b882d20a33 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using CalamityMod.Dusts; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Astral; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -37,6 +39,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; + TileID.Sets.AvoidedByMeteorLanding[Type] = true; this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AstralDirtMerge"); } @@ -57,14 +60,23 @@ namespace CalamityMod.Tiles.Ores } } - public override bool CanKillTile(int i, int j, ref bool blockDamaged) + public override void RandomUpdate(int i, int j) { - return DownedBossSystem.downedAstrumDeus; + if (Main.rand.NextBool(4)) + { + int xRandom = Main.rand.Next(-3, 3); + int yRandom = Main.rand.Next(-3, 3); + if (Main.tile[i + xRandom, j + yRandom].TileType == TileID.Meteorite) + AstralBiome.ConvertToAstral(i + xRandom, j + yRandom, true); + } } - public override bool CanExplode(int i, int j) + public override IEnumerable GetItemDrops(int i, int j) { - return false; + if (!DownedBossSystem.downedAstrumDeus) + yield return new Item(ModContent.ItemType(), Main.rand.Next(1, 2 + 1)); + else + yield return new Item(ModContent.ItemType()); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index bc1389ee03..b38c4b12b4 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -723,6 +723,7 @@ namespace CalamityMod.World case TileID.Lead: case TileID.Tungsten: case TileID.Platinum: + case TileID.Meteorite: if (convertOre) { Main.tile[x, y].TileType = (ushort)ModContent.TileType(); From 394c6cd37708ba5fe495423389a2acd1dc73690c Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 8 Jul 2024 01:40:15 -0400 Subject: [PATCH 11/28] Changed "mine" in Deus status message to "harvest" To reflect previous commit's changes to Astral Ore --- Localization/en-US/Mods.CalamityMod.Status.Progression.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Status.Progression.hjson b/Localization/en-US/Mods.CalamityMod.Status.Progression.hjson index ab3f2729d1..3501e19e70 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Progression.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Progression.hjson @@ -28,7 +28,7 @@ AureusBossText2: A faint ethereal click can be heard from the dungeon. // Golem BabyBossText: A plague has befallen the Jungle. // Astrum Deus -AstralBossText: The seal of the stars has been broken! You can now mine Astral Ore. +AstralBossText: The seal of the stars has been broken! You can now harvest Astral Ore. // Moon Lord MoonBossText: The profaned flame blazes fiercely! FutureOreText: A cold and dark energy has materialized in space. From 02aa014c6104fe788ee2148ad533633dbbe4a143 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 8 Jul 2024 05:51:55 -0500 Subject: [PATCH 12/28] Cal Clone brother dust fade amount scales with alpha. --- NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs index d8d4f485ee..33e2529e3d 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs @@ -748,7 +748,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (npc.alpha > 255) npc.alpha = 255; - for (int i = 0; i < 5; i++) + int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f)); + for (int i = 0; i < dustAmount; i++) { int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); Main.dust[dust].noGravity = true; @@ -1082,7 +1083,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs if (npc.alpha > 255) npc.alpha = 255; - for (int i = 0; i < 5; i++) + int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f)); + for (int i = 0; i < dustAmount; i++) { int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); Main.dust[dust].noGravity = true; From 803ff3027bf556a66b3fad715e73f61c4cc597e4 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 9 Jul 2024 06:31:44 -0500 Subject: [PATCH 13/28] CIT suggestion for reducing boss laser max velocity. --- Projectiles/Boss/DestroyerCursedLaser.cs | 17 ++++++++--------- Projectiles/Boss/DestroyerElectricLaser.cs | 17 ++++++++--------- Projectiles/CalamityGlobalProjectile.cs | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Projectiles/Boss/DestroyerCursedLaser.cs b/Projectiles/Boss/DestroyerCursedLaser.cs index f9ffe4065f..31fc250b1a 100644 --- a/Projectiles/Boss/DestroyerCursedLaser.cs +++ b/Projectiles/Boss/DestroyerCursedLaser.cs @@ -4,11 +4,13 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class DestroyerCursedLaser : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetDefaults() { Projectile.width = 4; @@ -25,32 +27,29 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.75f / 255f, 0f); + if (Projectile.alpha > 0) - { Projectile.alpha -= 125; - } if (Projectile.alpha < 0) - { Projectile.alpha = 0; - } + if (Projectile.localAI[1] == 0f) { SoundEngine.PlaySound(SoundID.Item33, Projectile.Center); Projectile.localAI[1] = 1f; } - if (Projectile.velocity.Length() < 12f) - { + + if (Projectile.velocity.Length() < CalamityGlobalProjectile.AcceleratingBossLaserVelocityCap) Projectile.velocity *= 1.0025f; - } } public override Color? GetAlpha(Color lightColor) { if (Projectile.alpha < 200) - { return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0); - } + return Color.Transparent; } diff --git a/Projectiles/Boss/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index 75ff1f1ed5..5a30ce18b1 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -5,11 +5,13 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class DestroyerElectricLaser : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetDefaults() { Projectile.ignoreWater = true; @@ -26,32 +28,29 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.35f / 255f); + if (Projectile.alpha > 0) - { Projectile.alpha -= 125; - } if (Projectile.alpha < 0) - { Projectile.alpha = 0; - } + if (Projectile.localAI[1] == 0f) { SoundEngine.PlaySound(SoundID.Item33, Projectile.Center); Projectile.localAI[1] = 1f; } - if (Projectile.velocity.Length() < 12f) - { + + if (Projectile.velocity.Length() < CalamityGlobalProjectile.AcceleratingBossLaserVelocityCap) Projectile.velocity *= 1.0025f; - } } public override Color? GetAlpha(Color lightColor) { if (Projectile.alpha < 200) - { return new Color(255 - Projectile.alpha, 255 - Projectile.alpha, 255 - Projectile.alpha, 0); - } + return Color.Transparent; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 54bd91cfab..b0f5b94fb5 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles public bool CreatedByPlayerDash = false; // Speed cap for accelerating boss laser projectiles with 2 extraUpdates. - public const float AcceleratingBossLaserVelocityCap = 10f; + public const float AcceleratingBossLaserVelocityCap = 8f; // Damage Adjusters public const float PierceResistHarshness = 0.12f; From f4a6f658e97ff69bf678a58c169d493b767eed3e Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 9 Jul 2024 07:18:49 -0500 Subject: [PATCH 14/28] CIT suggestion, slowed PBG's ass and gave more leeway on her movement distances. --- .../PlaguebringerGoliath.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 2476cf67ac..19b77b18ec 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -628,9 +628,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer bool canHitTarget = Collision.CanHit(NPC.Center, 1, 1, player.position, player.width, player.height); float distanceAboveTarget = !canHitTarget ? 0f : 400f; - float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f; + float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f; float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y; - float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f; + float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f; bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX; bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway; bool tooFar = tooFarX || tooFarY; @@ -711,9 +711,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer float distanceAboveTarget = !canHitTarget ? 0f : 400f; - float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f; + float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f; float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y; - float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f; + float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f; bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX; bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway; bool tooFar = tooFarX || tooFarY; @@ -800,9 +800,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer float distanceAboveTarget = !canHitTarget ? 0f : 400f; - float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f; + float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f; float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y; - float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f; + float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f; bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX; bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway; bool tooFar = tooFarX || tooFarY; @@ -892,9 +892,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer float distanceAboveTarget = !canHitTarget ? 0f : 400f; - float distanceAwayFromTargetX = !canHitTarget ? 36f : 144f; + float distanceAwayFromTargetX = !canHitTarget ? 80f : 240f; float distanceAwayFromTargetY = player.Center.Y - NPC.Center.Y; - float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 48f; + float distanceAwayFromTargetYLeeway = !canHitTarget ? 16f : 80f; bool tooFarX = Math.Abs(player.Center.X - NPC.Center.X) > distanceAwayFromTargetX; bool tooFarY = distanceAwayFromTargetY > distanceAboveTarget + distanceAwayFromTargetYLeeway || distanceAwayFromTargetY < distanceAboveTarget - distanceAwayFromTargetYLeeway; bool tooFar = tooFarX || tooFarY; @@ -1164,8 +1164,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath private void Movement(float distanceAboveTarget, Player player, float enrageScale) { - float acceleration = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 0.24f : 0.48f; // Reduce acceleration while spawning minions - float velocity = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 12f : (NPC.ai[0] == 2f ? 18f : 24f); // Reduce velocity while preparing to spawn minions and spawning minions + float acceleration = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 0.12f : (NPC.ai[0] == 2f ? 0.15f : 0.18f); // Reduce acceleration while spawning minions + float velocity = (NPC.ai[0] == 1f || NPC.ai[0] == 5f) ? 12f : (NPC.ai[0] == 2f ? 15f : 18f); // Reduce velocity while preparing to spawn minions and spawning minions acceleration *= 0.5f * enrageScale + 1f; velocity *= 1f + enrageScale * 0.5f; Vector2 hoverDestination = player.Center - Vector2.UnitY * distanceAboveTarget; From 0587c1cd057099e7d4d15051e2335d6be0ce626f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 9 Jul 2024 07:53:37 -0500 Subject: [PATCH 15/28] Slowed PBG charge line up. --- NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 19b77b18ec..319e3020ab 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -464,8 +464,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.rotation = NPC.velocity.X * 0.02f; charging = false; - float maxLineUpSpeed = revenge ? 25f : 20f; - float lineUpAccel = revenge ? 0.75f : 0.6f; + float maxLineUpSpeed = revenge ? 20f : 16f; + float lineUpAccel = revenge ? 0.4f : 0.3f; if (phase2) { maxLineUpSpeed += 3f; @@ -1039,8 +1039,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.rotation = NPC.velocity.X * 0.02f; charging = false; - float maxLineUpSpeed = revenge ? 31f : 26f; - float lineUpAccel = revenge ? 1.05f : 0.9f; + float maxLineUpSpeed = revenge ? 26f : 22f; + float lineUpAccel = revenge ? 0.7f : 0.6f; maxLineUpSpeed += 7f * enrageScale; lineUpAccel += 0.35f * enrageScale; From 56dcbca5553b315f60d4440dd4d83e1122238692 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 9 Jul 2024 08:52:30 -0500 Subject: [PATCH 16/28] PBG attack red backglows for visibility. --- .../PlagueHomingMissile.cs | 27 ++++++++++++------- NPCs/PlaguebringerGoliath/PlagueMine.cs | 17 ++++++++---- .../PlaguebringerGoliath.cs | 3 +++ Projectiles/Boss/HiveBombGoliath.cs | 2 ++ Projectiles/Boss/PlagueStingerGoliath.cs | 7 +++++ Projectiles/Boss/PlagueStingerGoliathV2.cs | 7 +++++ 6 files changed, 48 insertions(+), 15 deletions(-) diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 4fd355c97a..9b7de91cea 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -164,10 +164,18 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2)); int afterimageAmt = 5; + Vector2 drawLocation = NPC.Center - screenPos; + Color backAfterimageColor = PlaguebringerGoliath.BackglowColor * NPC.Opacity; + for (int i = 0; i < 10; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4f; + spriteBatch.Draw(texture, drawLocation + drawOffset, NPC.frame, backAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + if (CalamityConfig.Instance.Afterimages) { for (int i = 1; i < afterimageAmt; i += 2) @@ -177,18 +185,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (float)(afterimageAmt - i) / 15f; Vector2 afterimagePos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + afterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + drawLocation -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - texture2D15 = GlowTexture.Value; + texture = GlowTexture.Value; Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f); if (CalamityConfig.Instance.Afterimages) @@ -199,13 +206,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath secondAfterimageColor = Color.Lerp(secondAfterimageColor, Color.White, 0.5f); secondAfterimageColor *= (float)(afterimageAmt - j) / 15f; Vector2 secondAfterimagePos = NPC.oldPos[j] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - secondAfterimagePos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; + secondAfterimagePos -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[NPC.type])) * NPC.scale / 2f; secondAfterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, secondAfterimagePos, NPC.frame, secondAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); } } - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 79ab47cdae..f9a10891e9 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -121,18 +121,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Texture2D texture = TextureAssets.Npc[NPC.type].Value; Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2); Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawLocation -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + Color backAfterimageColor = PlaguebringerGoliath.BackglowColor * NPC.Opacity; + for (int i = 0; i < 10; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * 4f; + spriteBatch.Draw(texture, drawLocation + drawOffset, NPC.frame, backAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } - texture2D15 = GlowTexture.Value; + spriteBatch.Draw(texture, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + + texture = GlowTexture.Value; Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, drawLocation, NPC.frame, redLerpColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 319e3020ab..0d37d654b4 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -36,6 +36,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath [AutoloadBossHead] public class PlaguebringerGoliath : ModNPC { + // Use for all projectiles and spawned enemies. + public static Color BackglowColor => new Color(255, 100, 24, 80) * 0.6f; + private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private const float MissileAngleSpread = 60; private const int MissileProjectiles = 8; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index fb00892801..2b4199bdcb 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -83,6 +84,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { + Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f); CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index f8cb269e5c..c2b3dffdb8 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.PlaguebringerGoliath; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -52,6 +53,12 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 90); } + public override bool PreDraw(ref Color lightColor) + { + Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f); + return false; + } + public override void PostDraw(Color lightColor) { Vector2 center = new Vector2(Projectile.Center.X, Projectile.Center.Y); diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index d379ddf72f..822a848f4f 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs.PlaguebringerGoliath; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -42,6 +43,12 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 90); } + public override bool PreDraw(ref Color lightColor) + { + Projectile.DrawProjectileWithBackglow(PlaguebringerGoliath.BackglowColor, lightColor, 4f); + return false; + } + public override void PostDraw(Color lightColor) { Texture2D glow = ModContent.Request("CalamityMod/Projectiles/Boss/PlagueStingerGoliathGlow").Value; From 09a47cc96ca61ab992eae95cd9930ea1efabd042 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 9 Jul 2024 12:37:16 -0400 Subject: [PATCH 17/28] Holy Collider shrink-a-nator --- Items/Weapons/Melee/HolyCollider.png | Bin 4846 -> 3784 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/Weapons/Melee/HolyCollider.png b/Items/Weapons/Melee/HolyCollider.png index 713bd1e425b34583e4784e2d823e2d479b23272b..44fc67fa0173646dd76da6a3de186f9ea90ad922 100644 GIT binary patch literal 3784 zcmXw6dpy(o8`l+;>P+q=woz_j#5l9lFms8@{SunBxh&dTOHmYw(a2?Nq;kpJ@0XC{ zHZh0fPEKt_Wo`@2^*5c@?~l*-`99z8>;1ew&-?v+pXc+9yKHSHazy%wfPjFAIm+ZJ z-xB#NS?DnTN}*)$^3A@$t7Zs+(tg=*eCHtU;-!lM0u@O|x2_-J`@*+S&Vd2~$J_VT zzV3iR4FBeuxyePlFn12^=+m?tV)rFT@fs3`+{7;v6m-QzF1wt?$)-pmFTb~Alp~+M z(R`KcWqtjx_n5>{NekmZq@LJf7&wohCZcC4bj32oQdsRw;lMj}P;21MY&xuWa(!_( zviHk0x9@J?ue9kK=V#iXi?`25(zOfD)5;{lf2{rgA-j^5bP}lQ@*_zDqcpE! zJk3De0>;1cgiKClY(`h^#I%F3Hw$H?g#9sbPLSBuEfjjSUBW^wd{>NgP0$Cg^dG_! z6ISMr#*`%rGVU?@I9!~?)Gk95>|$KkS||^{cQrKblI{>G;hH?ja9O=OPD+r{ z(*|l15%SC%Vzi%ThR?TS0oNCf$OT+@m)g*8Jw8I$ak)y&`^^t>;FFZo;FX2g)7#Lv zassCtaC6~LKejTUx6BQ!m81&+JN}oZkepmOH<|rTSN>bmxXKzMF$?Sfudqhvj=6n9 zBBNxSK^gjQLK~*MrszL(BwQfI+-Hk;Z)H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Changed Frozen Wings extra effects Now gives 4% melee and ranged damage and multiplies cold debuff damage by 1.25x --- CalPlayer/CalamityPlayer.cs | 2 ++ CalPlayer/CalamityPlayerOnHit.cs | 2 ++ Items/CalamityGlobalItem.cs | 7 +++---- Items/CalamityGlobalItemTooltip.cs | 5 ++--- NPCs/CalamityGlobalNPC.cs | 8 ++++++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 28dffb79b1..75ddc0033c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -512,6 +512,7 @@ namespace CalamityMod.CalPlayer public int ascendantInsigniaBuffTime = 0; public int ascendantInsigniaCooldown = 0; public bool ascendantTrail = false; + public bool frozenWingsCold = false; public bool magmaStoneVisuals = true; public bool eGauntlet = false; public bool eGauntletVisuals = true; // Used to control dust spawned when swinging @@ -1738,6 +1739,7 @@ namespace CalamityMod.CalPlayer cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; + frozenWingsCold = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index a00e5a4ff0..c8dae6d018 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -71,6 +71,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet; + target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold; target.Calamity().IncreasedColdEffects_CryoStone = CryoStone; target.Calamity().IncreasedElectricityEffects_Transformer = transformer; @@ -212,6 +213,7 @@ namespace CalamityMod.CalPlayer witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D)); cgn.IncreasedColdEffects_EskimoSet = eskimoSet; + cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold; cgn.IncreasedColdEffects_CryoStone = CryoStone; cgn.IncreasedElectricityEffects_Transformer = transformer; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c2fa066fe6..47319bfbf7 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1418,10 +1418,9 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings) { - player.GetDamage() += 0.02f; - player.GetDamage() += 0.02f; - player.GetCritChance() += 1; - player.GetCritChance() += 1; + player.GetDamage() += 0.04f; + player.GetDamage() += 0.04f; + player.Calamity().frozenWingsCold = true; } } else if (item.type == ItemID.FlameWings) // Bonus to melee stats diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index f444e8be4c..0c4058647f 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1301,9 +1301,8 @@ namespace CalamityMod.Items AddWingStats(7.5f, 1f, 1, 160, "5% increased melee damage and critical strike chance"); if (item.type == ItemID.FrozenWings) - AddWingStats(6.75f, 1f, 1, 130, "2% increased melee and ranged damage\n" + - "and 1% increased melee and ranged critical strike chance\n" + - "while wearing the Frost Armor"); + AddWingStats(6.75f, 1f, 1, 130, "4% increased melee and ranged damage\n" + + "and multiplies all cold debuff damage by 1.25x while wearing Frost armor"); if (item.type == ItemID.GhostWings) AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Spectre Hood set\n" + diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index e10b14bd7c..21421bce2c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -117,14 +117,15 @@ namespace CalamityMod.NPCs public const double VulnerableToDoTDamageMult = 2D; public const double VulnerableToDoTDamageMult_Worms_SlimeGod = 1.5; - // Eskimo Set and Cryo Stone effects + // Cold debuff effects public bool IncreasedColdEffects_EskimoSet = false; + public bool IncreasedColdEffects_FrozenWings = false; public bool IncreasedColdEffects_CryoStone = false; // Transformer effect public bool IncreasedElectricityEffects_Transformer = false; - // Fireball, Cinnamon Roll and Hellfire Treads effects + // Heat debuff effects public bool IncreasedHeatEffects_Fireball = false; public bool IncreasedHeatEffects_CinnamonRoll = false; public bool IncreasedHeatEffects_FlameWakerBoots = false; @@ -411,6 +412,7 @@ namespace CalamityMod.NPCs myClone.VulnerableToWater = VulnerableToWater; myClone.IncreasedColdEffects_EskimoSet = IncreasedColdEffects_EskimoSet; + myClone.IncreasedColdEffects_FrozenWings = IncreasedColdEffects_FrozenWings; myClone.IncreasedColdEffects_CryoStone = IncreasedColdEffects_CryoStone; myClone.IncreasedElectricityEffects_Transformer = IncreasedElectricityEffects_Transformer; myClone.IncreasedHeatEffects_Fireball = IncreasedHeatEffects_Fireball; @@ -842,6 +844,8 @@ namespace CalamityMod.NPCs if (IncreasedColdEffects_EskimoSet) coldDamageMult += 0.25; + if (IncreasedColdEffects_FrozenWings) + coldDamageMult += 0.25; if (IncreasedColdEffects_CryoStone) coldDamageMult += 0.5; From a67ea7cf06b668f48961c6fc6655962e3e1102de Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 10 Jul 2024 15:21:01 -0400 Subject: [PATCH 19/28] Two more Astral Ore changes I overlooked: * Decreased pick power requirement * Can now be blockswapped --- Tiles/Ores/AstralOre.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index b882d20a33..0b1f23af65 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.OreMergesWithMud[Type] = true; - MinPick = 210; + MinPick = 110; DustType = 173; AddMapEntry(new Color(255, 153, 255), CreateMapEntryName()); MineResist = 3f; @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores TileID.Sets.Ore[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; - TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; + // TileID.Sets.DoesntGetReplacedWithTileReplacement[Type] = true; TileID.Sets.AvoidedByMeteorLanding[Type] = true; this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AstralDirtMerge"); From b4674f38a846ccbfc15ca15b5affe5b0befb0412 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:42:29 +0700 Subject: [PATCH 20/28] spark code merger and cleanup navy fish rod inflicts static discharge stormjaw sparks always inflict static discharge and always applies tag made amid spark/transformer circles even --- CalPlayer/CalamityPlayerHitHurt.cs | 37 ++------ CalPlayer/CalamityPlayerMiscEffects.cs | 10 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 2 - ...ods.CalamityMod.Projectiles.Typeless.hjson | 1 + Projectiles/Melee/EutrophicSpark.cs | 88 ------------------ .../Melee/Shortswords/SubmarineShockerProj.cs | 14 +-- Projectiles/Melee/Spark.cs | 93 ------------------- Projectiles/Summon/StormjawBaby.cs | 15 +-- Projectiles/Summon/StormjawSpark.cs | 67 ++++++------- Projectiles/Typeless/GenericElectricSpark.cs | 72 ++++++++++++++ 10 files changed, 120 insertions(+), 279 deletions(-) delete mode 100644 Projectiles/Melee/EutrophicSpark.cs delete mode 100644 Projectiles/Melee/Spark.cs create mode 100644 Projectiles/Typeless/GenericElectricSpark.cs diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index e724297fec..fddbf4e15d 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2531,10 +2531,6 @@ namespace CalamityMod.CalPlayer if (hurtInfo.Damage > 0) { SoundEngine.PlaySound(SoundID.Item93, Player.Center); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; // Start with base damage, then apply the best damage class you can int sDamage = 6; @@ -2545,32 +2541,17 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < (transformer ? 5 : 4); i++) + float sparkCount = transformer ? 10f : 8f; + for (float i = 0f; i < sparkCount; i++) { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f); - int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI, 0f, 0f); - if (spark1.WithinBounds(Main.maxProjectiles)) + Vector2 velocity = (MathHelper.TwoPi * i / sparkCount).ToRotationVector2() * 5f; + Projectile spark = Projectile.NewProjectileDirect(source, Player.Center, velocity, ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI); + spark.timeLeft = 120; + if (transformer) { - Main.projectile[spark1].timeLeft = 120; - Main.projectile[spark1].DamageType = DamageClass.Generic; - if (transformer) - { - Main.projectile[spark1].timeLeft = 240; - Main.projectile[spark1].extraUpdates = 1; - Main.projectile[spark1].penetrate = 10; - } - } - if (spark2.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark2].timeLeft = 120; - Main.projectile[spark2].DamageType = DamageClass.Generic; - if (transformer) - { - Main.projectile[spark2].timeLeft = 240; - Main.projectile[spark2].extraUpdates = 1; - Main.projectile[spark2].penetrate = 10; - } + spark.timeLeft = 240; + spark.extraUpdates = 1; + spark.penetrate = 10; } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ba743f5ccc..0e083e7e7b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3327,13 +3327,9 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(10)) { Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); - int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].DamageType = DamageClass.Generic; - Main.projectile[spark].localNPCHitCooldown = -2; - Main.projectile[spark].penetrate = 5; - } + Projectile spark = Projectile.NewProjectileDirect(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI); + spark.localNPCHitCooldown = -2; + spark.timeLeft = 30; } } } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index cf339d0bda..435f7da56d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -107,7 +107,6 @@ EonBolt.DisplayName: Eon Bolt EssenceFlame2.DisplayName: Essence Flame EssenceScythe.DisplayName: Essence Scythe EutrophicScimitarProj.DisplayName: Scimitar Zap -EutrophicSpark.DisplayName: Eutrophic Spark ExcelsusBlue.DisplayName: Excelsus ExcelsusMain.DisplayName: Excelsus ExcelsusPink.DisplayName: Excelsus @@ -230,7 +229,6 @@ SolarNeedle.DisplayName: Solar Needle SolsticeBeam.DisplayName: Solstice Beam SoulScythe.DisplayName: Soul Scythe SoulScytheExplosion.DisplayName: Soul Explosion -Spark.DisplayName: Spark SpatialSpear.DisplayName: Elemental Spear SpatialSpear2.DisplayName: Elemental Spear SpatialSpear3.DisplayName: Elemental Spear diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 9466199407..54849a57f6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -59,6 +59,7 @@ FlameLickedHellblast.DisplayName: Flame Licked Hellblast FuckYou.DisplayName: Explosion FungalClumpMinion.DisplayName: Fungal Clump GemTechArmorGem.DisplayName: Trireme's Gem +GenericElectricSpark.DisplayName: Electric Spark GhostlyBolt.DisplayName: Bolt GodKiller.DisplayName: God Killer GodSlayerShrapnel.DisplayName: Flame diff --git a/Projectiles/Melee/EutrophicSpark.cs b/Projectiles/Melee/EutrophicSpark.cs deleted file mode 100644 index c305f82456..0000000000 --- a/Projectiles/Melee/EutrophicSpark.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class EutrophicSpark : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 6; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.penetrate = 2; - Projectile.timeLeft = 30; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int eutrophicDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[eutrophicDust]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[eutrophicDust]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[eutrophicDust].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[eutrophicDust].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[eutrophicDust]; - expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int eutrophicDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[eutrophicDust2]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[eutrophicDust2]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[eutrophicDust2].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[eutrophicDust2].noGravity = true; - Main.dust[eutrophicDust2].velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs b/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs index d14369a186..20871afe34 100644 --- a/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs +++ b/Projectiles/Melee/Shortswords/SubmarineShockerProj.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -48,16 +49,15 @@ namespace CalamityMod.Projectiles.Melee.Shortswords Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Electric); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - var source = Projectile.GetSource_FromThis(); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSparks(target); - public override void OnHitPlayer(Player target, Player.HurtInfo info) + public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSparks(target); + + public void SpawnSparks(Entity target) { var source = Projectile.GetSource_FromThis(); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); + Projectile spark = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7f), Projectile.knockBack, Main.myPlayer); + spark.DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs deleted file mode 100644 index 682e49ad7d..0000000000 --- a/Projectiles/Melee/Spark.cs +++ /dev/null @@ -1,93 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class Spark : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 6; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.penetrate = 5; - Projectile.timeLeft = 60; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; - Projectile.DamageType = DamageClass.Melee; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - } - - public override void AI() - { - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[sparky]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[sparky]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparky].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[sparky]; - expr_89E7_cp_0.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[sparkier]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[sparkier]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparkier].noGravity = true; - Main.dust[sparkier].velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 1b27ab23b2..e196726c0a 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -1,6 +1,5 @@ using System; using CalamityMod.Buffs.Summon; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -280,7 +279,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.rand.Next(1, 4); i++) { Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } sparkCounter = 0; } @@ -313,17 +312,7 @@ namespace CalamityMod.Projectiles.Summon for (int j = 0; j < Main.rand.Next(1, 4); j++) { Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].DamageType = DamageClass.Summon; - Main.projectile[spark].originalDamage = Projectile.originalDamage; - Main.projectile[spark].timeLeft = 120; - Main.projectile[spark].penetrate = 3; - Main.projectile[spark].usesIDStaticNPCImmunity = true; - Main.projectile[spark].idStaticNPCHitCooldown = 10; - Main.projectile[spark].usesLocalNPCImmunity = false; - } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkS, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } sparkCounter = 0; } diff --git a/Projectiles/Summon/StormjawSpark.cs b/Projectiles/Summon/StormjawSpark.cs index 0758cf42e9..6c06785a0a 100644 --- a/Projectiles/Summon/StormjawSpark.cs +++ b/Projectiles/Summon/StormjawSpark.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - //literally had to make another projectile cuz whips exist + // Clone of Typeless/GenericElectricSpark but specfically benefits from whips public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Projectile.type] = true; public override void SetDefaults() @@ -24,65 +26,48 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void AI() { if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; - } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } + Projectile.velocity.X *= -0.1f; if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; + Projectile.velocity.Y *= -0.5f; + + Projectile.ai[0]++; if (Projectile.ai[0] > 5f) { Projectile.ai[0] = 5f; if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) + Projectile.velocity.X *= 0.97f; + if (MathF.Abs(Projectile.velocity.X) < 0.01f) { Projectile.velocity.X = 0f; Projectile.netUpdate = true; } } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; + Projectile.velocity.Y += 0.2f; } - Projectile.rotation += Projectile.velocity.X * 0.1f; - int sparky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[sparky]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[sparky]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[sparky].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparky].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[sparky]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0f, 0.5f); + spark.noGravity = true; + spark.velocity.Y -= 2f; if (Main.rand.NextBool()) { - int sparkier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[sparkier]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[sparkier]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[sparkier].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[sparkier].noGravity = true; - Main.dust[sparkier].velocity *= 0.1f; + spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0.3f, 0.8f); + spark.noGravity = true; + spark.velocity *= 0.1f; } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; + if (Projectile.velocity.Y > 16f) - { Projectile.velocity.Y = 16f; - } } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/GenericElectricSpark.cs b/Projectiles/Typeless/GenericElectricSpark.cs new file mode 100644 index 0000000000..607550060d --- /dev/null +++ b/Projectiles/Typeless/GenericElectricSpark.cs @@ -0,0 +1,72 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class GenericElectricSpark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.penetrate = 5; + Projectile.timeLeft = 60; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + + public override void AI() + { + if (Projectile.velocity.X != Projectile.velocity.X) + Projectile.velocity.X *= -0.1f; + if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) + Projectile.velocity.Y *= -0.5f; + + Projectile.ai[0]++; + if (Projectile.ai[0] > 5f) + { + Projectile.ai[0] = 5f; + if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) + { + Projectile.velocity.X *= 0.97f; + if (MathF.Abs(Projectile.velocity.X) < 0.01f) + { + Projectile.velocity.X = 0f; + Projectile.netUpdate = true; + } + } + Projectile.velocity.Y += 0.2f; + } + Dust spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0f, 0.5f); + spark.noGravity = true; + spark.velocity.Y -= 2f; + if (Main.rand.NextBool()) + { + spark = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedWhiteBluePurple, Alpha: 100); + spark.position.X -= 2f; + spark.position.Y += 2f; + spark.scale += Main.rand.NextFloat(0.3f, 0.8f); + spark.noGravity = true; + spark.velocity *= 0.1f; + } + + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + } +} From 8ecfce0a8941ab0059fb01f176ec86bb18d45665 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 11 Jul 2024 11:02:29 -0500 Subject: [PATCH 21/28] Master Rev+ Wall of Flesh Eyes move further towards their target on the Y axis if they cannot see their target. --- NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 20bcd90c8e..1ddca86ab0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -724,6 +724,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shouldFireLasers = true; float phase2LifeRatio = 0.5f; bool masterModeDetach = lifeRatio < phase2LifeRatio && masterMode; + bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); if (!masterModeDetach) { npc.position.X = Main.npc[Main.wofNPCIndex].position.X; @@ -759,7 +760,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - float distanceAboveTarget = 240f * npc.ai[0]; + float distanceAboveTarget = (canHit ? 240f : 120f) * npc.ai[0]; float distanceAwayFromTargetX = 560f; float distanceAwayFromTargetXLeeway = 40f; float distanceAwayFromTargetY = Main.player[npc.target].Center.Y - npc.Center.Y; @@ -864,8 +865,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float shootBoost = fireEnragedLasers ? (death ? 5f : 4f) : (death ? 3f : 3f * (1f - lifeRatio)); npc.localAI[1] += 1f + shootBoost; - bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (npc.localAI[2] == 0f) { if (npc.localAI[1] > LaserShootGateValue) From ce1772d210d8228f58ededdeb350cc5f09d75efd Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 12 Jul 2024 12:59:36 -0500 Subject: [PATCH 22/28] Better Destroyer Probes. --- .../Bosses/DestroyerAI.cs | 277 ++++-------------- 1 file changed, 53 insertions(+), 224 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 2075680e34..e43191bd38 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -1756,34 +1756,26 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocity = bossRush ? 12f : masterMode ? 8.4f : 7.2f; float acceleration = bossRush ? 0.1f : masterMode ? 0.07f : 0.06f; + float deceleration = 1f - acceleration; - Vector2 probeCenter = npc.Center; - float probeTargetX = targetData.Center.X; - float probeTargetY = targetData.Center.Y; - probeTargetX = (int)(probeTargetX / 8f) * 8; - probeTargetY = (int)(probeTargetY / 8f) * 8; - probeCenter.X = (int)(probeCenter.X / 8f) * 8; - probeCenter.Y = (int)(probeCenter.Y / 8f) * 8; - probeTargetX -= probeCenter.X; - probeTargetY -= probeCenter.Y; - float distanceFromTarget = (float)Math.Sqrt(probeTargetX * probeTargetX + probeTargetY * probeTargetY); - float distance2 = distanceFromTarget; - - bool farAwayFromTarget = false; - if (distanceFromTarget > 600f) - farAwayFromTarget = true; - - if (distanceFromTarget == 0f) + if (targetDead) { - probeTargetX = npc.velocity.X; - probeTargetY = npc.velocity.Y; + Vector2 destination = npc.Center - Vector2.UnitY; + Vector2 idealVelocity = npc.SafeDirectionTo(destination) * velocity * 0.5f; + idealVelocity.X *= npc.direction; + idealVelocity.Y *= 2.5f; + npc.SimpleFlyMovement(idealVelocity, acceleration); + + if (npc.timeLeft > 10) + npc.timeLeft = 10; + } + else if (npc.Distance(targetData.Center) > 400f) + { + Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity; + npc.SimpleFlyMovement(idealVelocity, acceleration); } else - { - distanceFromTarget = velocity / distanceFromTarget; - probeTargetX *= distanceFromTarget; - probeTargetY *= distanceFromTarget; - } + npc.velocity *= deceleration; for (int i = 0; i < Main.maxNPCs; i++) { @@ -1806,29 +1798,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (distance2 > 100f) - { - npc.ai[0] += 1f; - if (npc.ai[0] > 0f) - npc.velocity.Y += 0.023f; - else - npc.velocity.Y -= 0.023f; - - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - npc.velocity.X += 0.023f; - else - npc.velocity.X -= 0.023f; - - if (npc.ai[0] > 200f) - npc.ai[0] = -200f; - } - - if (targetDead) - { - probeTargetX = npc.direction * velocity / 2f; - probeTargetY = -velocity / 2f; - } - if (npc.ai[3] != 0f) { if (NPC.IsMechQueenUp) @@ -1882,20 +1851,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } else - { npc.dontTakeDamage = false; - if (npc.velocity.X < probeTargetX) - npc.velocity.X += acceleration; - else if (npc.velocity.X > probeTargetX) - npc.velocity.X -= acceleration; - - if (npc.velocity.Y < probeTargetY) - npc.velocity.Y += acceleration; - else if (npc.velocity.Y > probeTargetY) - npc.velocity.Y -= acceleration; - } - npc.localAI[0] += 1f; if (npc.justHit && !masterMode) npc.localAI[0] = 0f; @@ -1921,12 +1878,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int totalProjectiles = oblivionAlive ? 2 : (CalamityWorld.death || bossRush) ? 3 : 1; - Vector2 npcCenter = new Vector2(probeTargetX, probeTargetY); + Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) { Vector2 v = targetData.Center - npc.Center - targetData.Velocity * 20f; - float projectileVelocity = 8f; - npcCenter = v.SafeNormalize(Vector2.UnitY) * projectileVelocity; + projectileVelocity = v.SafeNormalize(Vector2.UnitY) * 8f; } for (int i = 0; i < totalProjectiles; i++) { @@ -1936,14 +1892,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses case 0: break; case 1: - velocityMultiplier = 0.9f; + velocityMultiplier = 0.95f; break; case 2: - velocityMultiplier = 0.8f; + velocityMultiplier = 0.9f; break; } - Vector2 laserVelocity = npcCenter * velocityMultiplier; - Projectile.NewProjectile(npc.GetSource_FromAI(), probeCenter + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer); + Vector2 laserVelocity = projectileVelocity * velocityMultiplier; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer); } npc.netUpdate = true; @@ -1955,47 +1911,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (WorldGen.InWorld(x, y) && !WorldGen.SolidTile(x, y)) Lighting.AddLight((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f), 0.3f, 0.1f, 0.05f); - if (probeTargetX > 0f) + if (targetData.Center.X - npc.Center.X > 0f) { npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2(probeTargetY, probeTargetX); + npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X); } - if (probeTargetX < 0f) + else { npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2(probeTargetY, probeTargetX) + MathHelper.Pi; - } - - float tilePosX = -0.7f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * tilePosX; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - npc.velocity.X = 2f; - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - npc.velocity.X = -2f; - } - - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * tilePosX; - if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5) - npc.velocity.Y = 2f; - if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5) - npc.velocity.Y = -2f; - } - - if (farAwayFromTarget) - { - if ((npc.velocity.X > 0f && probeTargetX > 0f) || (npc.velocity.X < 0f && probeTargetX < 0f)) - { - if (Math.Abs(npc.velocity.X) < (NPC.IsMechQueenUp ? 5f : 12f)) - npc.velocity.X *= 1.05f; - } - else - npc.velocity.X *= 0.9f; + npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X) + MathHelper.Pi; } if (NPC.IsMechQueenUp && npc.ai[2] == 0f) @@ -2006,13 +1930,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.Center = center - v2.SafeNormalize(Vector2.UnitY) * 120; } - if (targetDead) - { - npc.velocity.Y -= acceleration * 2f; - if (npc.timeLeft > 10) - npc.timeLeft = 10; - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) npc.netUpdate = true; @@ -2025,62 +1942,32 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, default); NPCAimedTarget targetData = npc.GetTargetData(); - bool flag = false; + bool targetDead = false; if (targetData.Type == NPCTargetType.Player) - flag = Main.player[npc.target].dead; + targetDead = Main.player[npc.target].dead; - float num = Main.zenithWorld ? 3f : Main.expertMode ? 7.2f : 6f; - float num2 = Main.expertMode ? 0.06f : 0.05f; + float velocity = Main.zenithWorld ? 3f : Main.expertMode ? 7.2f : 6f; + float acceleration = Main.expertMode ? 0.06f : 0.05f; + float deceleration = 1f - acceleration; - Vector2 vector = npc.Center; - float num4 = targetData.Center.X; - float num5 = targetData.Center.Y; - num4 = (int)(num4 / 8f) * 8; - num5 = (int)(num5 / 8f) * 8; - vector.X = (int)(vector.X / 8f) * 8; - vector.Y = (int)(vector.Y / 8f) * 8; - num4 -= vector.X; - num5 -= vector.Y; - float num6 = (float)Math.Sqrt(num4 * num4 + num5 * num5); - float num7 = num6; - bool flag2 = false; - if (num6 > 600f) - flag2 = true; - - if (num6 == 0f) + if (targetDead || Main.IsItDay()) { - num4 = npc.velocity.X; - num5 = npc.velocity.Y; + Vector2 destination = npc.Center - Vector2.UnitY; + Vector2 idealVelocity = npc.SafeDirectionTo(destination) * velocity * 0.5f; + idealVelocity.X *= npc.direction; + idealVelocity.Y *= 2.5f; + npc.SimpleFlyMovement(idealVelocity, acceleration); + + if (npc.timeLeft > 10) + npc.timeLeft = 10; + } + else if (npc.Distance(targetData.Center) > 400f) + { + Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity; + npc.SimpleFlyMovement(idealVelocity, acceleration); } else - { - num6 = num / num6; - num4 *= num6; - num5 *= num6; - } - - if (num7 > 100f) - { - npc.ai[0] += 1f; - if (npc.ai[0] > 0f) - npc.velocity.Y += 0.023f; - else - npc.velocity.Y -= 0.023f; - - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - npc.velocity.X += 0.023f; - else - npc.velocity.X -= 0.023f; - - if (npc.ai[0] > 200f) - npc.ai[0] = -200f; - } - - if (flag) - { - num4 = (float)npc.direction * num / 2f; - num5 = (0f - num) / 2f; - } + npc.velocity *= deceleration; if (npc.ai[3] != 0f) { @@ -2135,20 +2022,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } else - { npc.dontTakeDamage = false; - if (npc.velocity.X < num4) - npc.velocity.X += num2; - else if (npc.velocity.X > num4) - npc.velocity.X -= num2; - - if (npc.velocity.Y < num5) - npc.velocity.Y += num2; - else if (npc.velocity.Y > num5) - npc.velocity.Y -= num2; - } - npc.localAI[0] += 1f; if (npc.ai[3] != 0f) npc.localAI[0] += 2f; @@ -2179,15 +2054,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - Vector2 vector3 = new Vector2(num4, num5); + Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) { Vector2 v = targetData.Center - npc.Center - targetData.Velocity * 20f; - float num12 = 8f; - vector3 = v.SafeNormalize(Vector2.UnitY) * num12; + projectileVelocity = v.SafeNormalize(Vector2.UnitY) * 8f; } - Projectile.NewProjectile(npc.GetSource_FromAI(), vector + vector3.SafeNormalize(Vector2.UnitY) * 50f, vector3, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer); } } @@ -2198,54 +2072,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (WorldGen.InWorld(num13, num14) && !WorldGen.SolidTile(num13, num14)) Lighting.AddLight((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f), 0.3f, 0.1f, 0.05f); - if (num4 > 0f) + if (targetData.Center.X - npc.Center.X > 0f) { npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2(num5, num4); + npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X); } - - if (num4 < 0f) + else { npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2(num5, num4) + MathHelper.Pi; - } - - float num15 = 0.7f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * (0f - num15); - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - npc.velocity.X = 2f; - - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - npc.velocity.X = -2f; - } - - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * (0f - num15); - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) - npc.velocity.Y = 2f; - - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) - npc.velocity.Y = -2f; - } - - if (flag2) - { - if ((npc.velocity.X > 0f && num4 > 0f) || (npc.velocity.X < 0f && num4 < 0f)) - { - int num27 = 12; - if (NPC.IsMechQueenUp) - num27 = 5; - - if (Math.Abs(npc.velocity.X) < (float)num27) - npc.velocity.X *= 1.05f; - } - else - npc.velocity.X *= 0.9f; + npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X) + MathHelper.Pi; } if (NPC.IsMechQueenUp && npc.ai[2] == 0f) @@ -2257,12 +2092,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.Center = center - v2.SafeNormalize(Vector2.UnitY) * num28; } - if (Main.IsItDay() || flag) - { - npc.velocity.Y -= num2 * 2f; - npc.EncourageDespawn(10); - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) npc.netUpdate = true; From 888e83772769a828584183e9e4376a67d0bc0f10 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 12 Jul 2024 13:02:48 -0500 Subject: [PATCH 23/28] A couple changes I missed. --- NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index e43191bd38..a3edcd3290 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -1765,9 +1765,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idealVelocity.X *= npc.direction; idealVelocity.Y *= 2.5f; npc.SimpleFlyMovement(idealVelocity, acceleration); - - if (npc.timeLeft > 10) - npc.timeLeft = 10; + npc.EncourageDespawn(10); } else if (npc.Distance(targetData.Center) > 400f) { @@ -1854,7 +1852,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.dontTakeDamage = false; npc.localAI[0] += 1f; - if (npc.justHit && !masterMode) + if ((npc.justHit && !masterMode) || targetDead) npc.localAI[0] = 0f; float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev; @@ -1957,9 +1955,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idealVelocity.X *= npc.direction; idealVelocity.Y *= 2.5f; npc.SimpleFlyMovement(idealVelocity, acceleration); - - if (npc.timeLeft > 10) - npc.timeLeft = 10; + npc.EncourageDespawn(10); } else if (npc.Distance(targetData.Center) > 400f) { @@ -2028,7 +2024,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] != 0f) npc.localAI[0] += 2f; - if (npc.justHit && !Main.masterMode) + if ((npc.justHit && !Main.masterMode) || targetDead) npc.localAI[0] = 0f; float num10 = ProbeLaserGateValue; From ef117737197c04166bef7f820019d5e2b9a39bc2 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 12 Jul 2024 15:40:29 -0500 Subject: [PATCH 24/28] Destroyer Probe move away. --- .../Bosses/DestroyerAI.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index a3edcd3290..66835d789d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -1773,7 +1773,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity, acceleration); } else - npc.velocity *= deceleration; + { + if (npc.Distance(targetData.Center) < 160f) + { + Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity; + npc.SimpleFlyMovement(-idealVelocity, acceleration); + } + else + npc.velocity *= deceleration; + } for (int i = 0; i < Main.maxNPCs; i++) { @@ -1963,7 +1971,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity, acceleration); } else - npc.velocity *= deceleration; + { + if (npc.Distance(targetData.Center) < 160f) + { + Vector2 idealVelocity = npc.SafeDirectionTo(targetData.Center) * velocity; + npc.SimpleFlyMovement(-idealVelocity, acceleration); + } + else + npc.velocity *= deceleration; + } if (npc.ai[3] != 0f) { From 8b748434db6cd63be008f3ec9419f483dcdf8a24 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 12 Jul 2024 16:02:22 -0500 Subject: [PATCH 25/28] Wall of Flesh slowdown adjustments, basically just makes it more lenient. --- .../Bosses/WallOfFleshAI.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 1ddca86ab0..b03669fa73 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses distanceFromTarget = targetPosition - npcPosition; float halfAverageScreenWidth = 960f; - float distanceBeforeSlowingDown = 400f; + float distanceBeforeSlowingDown = 480f; float timeBeforeEnrage = (masterMode ? 150f : 600f) - (death ? (masterMode ? 130f : 390f) * (1f - lifeRatio) : 0f); float speedMult = 1f; @@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses calamityGlobalNPC.newAI[0] -= 1f; } - speedMult = MathHelper.Clamp(speedMult, 0.75f, 2f); + speedMult = MathHelper.Clamp(speedMult, 0.4f, 2f); } // Enrage if target is off screen for too long @@ -1110,6 +1110,24 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y = 0f; npc.position.Y = num368; + float targetPosition = Main.player[npc.target].Center.X; + float npcPosition = npc.Center.X; + + // Slow down if close + float distanceFromTarget; + if (npc.velocity.X < 0f) + distanceFromTarget = npcPosition - targetPosition; + else + distanceFromTarget = targetPosition - npcPosition; + + float distanceBeforeSlowingDown = 480f; + float speedMult = 1f; + + if (distanceFromTarget < distanceBeforeSlowingDown) + speedMult += (distanceFromTarget - distanceBeforeSlowingDown) * 0.002f; + + speedMult = MathHelper.Clamp(speedMult, 0.4f, 1f); + float masterModeVelocityBoost = 0f; if (Main.masterMode) { @@ -1174,6 +1192,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses num369 += 0.2f; } + num369 *= speedMult; + if (npc.velocity.X == 0f) { npc.TargetClosest(); From 577df59a019e8c06c3666375c1e487df714f202b Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 12 Jul 2024 18:28:41 -0700 Subject: [PATCH 26/28] Small changes --- Balancing/BalancingChangesManager.cs | 3 +++ Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson | 2 +- Projectiles/Summon/BrittleStarMinion.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 17046163cc..1db3befd52 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -341,6 +341,9 @@ namespace CalamityMod.Balancing // 35% resist to Venusian Trident's explosions. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType(), ProjectileType())))); + // 25% resist to Corinth Prime's Grenades. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType())))); + // 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index d357ccd042..d51e5d1554 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -90,7 +90,7 @@ BrittleStarStaff: { Summons a small brittle starfish that will dash through enemies until it shatters Starfish will quickly regenerate after shattering Holding right click will swap starfish between dashing and circling you - When the starfish are circling, each one provides you with 3 defense + When the starfish are circling, each one provides you with 4 defense ''' } diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index 1e2568e1ea..9ec49d7203 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.Center = Vector2.Lerp(Projectile.Center, idleDestination, 0.15f); AITimer++; - Owner.statDefense += 5; + Owner.statDefense += 4; Projectile.rotation += MoveWidth * 0.2f; } if (!MinionBuffMode && !Reforming) // Minion when ramming From e6d3a413a80afacba4544b8f0ca52b0a1184b3da Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 12 Jul 2024 20:36:32 -0500 Subject: [PATCH 27/28] Less egregious Wall of Flesh Hungry respawning in Expert+. --- .../Bosses/WallOfFleshAI.cs | 172 +++++++++--------- 1 file changed, 91 insertions(+), 81 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index b03669fa73..2124eb4498 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -450,51 +450,56 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.rand.NextBool(chance)) { - int hungryAmt = 0; - float[] array = new float[10]; - for (int j = 0; j < Main.maxNPCs; j++) + int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(2f, 8f, npc.life / (float)npc.lifeMax)); + if (NPC.CountNPCS(NPCID.TheHungry) < maxHungriesBasedOnHP) { - if (hungryAmt < 10 && Main.npc[j].active && Main.npc[j].type == NPCID.TheHungry) + int hungryAmt = 0; + int maxHungries = 10; + float[] array = new float[maxHungries]; + for (int j = 0; j < Main.maxNPCs; j++) { - array[hungryAmt] = Main.npc[j].ai[0]; - hungryAmt++; - } - } - - int maxValue = 1 + hungryAmt * 2; - if (masterMode) - maxValue /= 2; - - if (maxValue < 2) - maxValue = 2; - - if (hungryAmt < 10 && Main.rand.Next(maxValue) <= 1) - { - int spawnHungryControl = -1; - for (int k = 0; k < 1000; k++) - { - int randomHungrySpawnValue = Main.rand.Next(10); - float hungryArrayValue = randomHungrySpawnValue * 0.1f - 0.05f; - bool shouldRespawnHungry = true; - for (int i = 0; i < hungryAmt; i++) + if (hungryAmt < maxHungries && Main.npc[j].active && Main.npc[j].type == NPCID.TheHungry) { - if (hungryArrayValue == array[i]) + array[hungryAmt] = Main.npc[j].ai[0]; + hungryAmt++; + } + } + + int maxValue = 1 + hungryAmt * 2; + if (masterMode) + maxValue /= 2; + + if (maxValue < 2) + maxValue = 2; + + if (hungryAmt < maxHungries && Main.rand.Next(maxValue) <= 1) + { + int spawnHungryControl = -1; + for (int k = 0; k < 1000; k++) + { + int randomHungrySpawnValue = Main.rand.Next(maxHungries); + float hungryArrayValue = randomHungrySpawnValue * 0.1f - 0.05f; + bool shouldRespawnHungry = true; + for (int i = 0; i < hungryAmt; i++) { - shouldRespawnHungry = false; + if (hungryArrayValue == array[i]) + { + shouldRespawnHungry = false; + break; + } + } + if (shouldRespawnHungry) + { + spawnHungryControl = randomHungrySpawnValue; break; } } - if (shouldRespawnHungry) + if (spawnHungryControl >= 0) { - spawnHungryControl = randomHungrySpawnValue; - break; + int hungryRespawns = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.TheHungry, npc.whoAmI); + Main.npc[hungryRespawns].ai[0] = spawnHungryControl * 0.1f - 0.05f; } } - if (spawnHungryControl >= 0) - { - int hungryRespawns = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)mouthYPosition, NPCID.TheHungry, npc.whoAmI); - Main.npc[hungryRespawns].ai[0] = spawnHungryControl * 0.1f - 0.05f; - } } } } @@ -1274,66 +1279,71 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.expertMode && Main.netMode != NetmodeID.MultiplayerClient) { - int num378 = (int)(1f + (float)npc.life / (float)npc.lifeMax * 10f); - num378 *= num378; - if (num378 < 400) - num378 = (num378 * 19 + 400) / 20; + int chanceToSpawnHungry = (int)(1f + (float)npc.life / (float)npc.lifeMax * 10f); + chanceToSpawnHungry *= chanceToSpawnHungry; + if (chanceToSpawnHungry < 400) + chanceToSpawnHungry = (chanceToSpawnHungry * 19 + 400) / 20; - if (num378 < 60) - num378 = (num378 * 3 + 60) / 4; + if (chanceToSpawnHungry < 60) + chanceToSpawnHungry = (chanceToSpawnHungry * 3 + 60) / 4; - if (num378 < 20) - num378 = (num378 + 20) / 2; + if (chanceToSpawnHungry < 20) + chanceToSpawnHungry = (chanceToSpawnHungry + 20) / 2; - num378 = (int)((double)num378 * (Main.masterMode ? 0.5 : 0.7)); - if (num378 < 2) - num378 = 2; + chanceToSpawnHungry = (int)((double)chanceToSpawnHungry * (Main.masterMode ? 0.5 : 0.7)); + if (chanceToSpawnHungry < 2) + chanceToSpawnHungry = 2; - if (Main.rand.NextBool(num378)) + if (Main.rand.NextBool(chanceToSpawnHungry)) { - int num379 = 0; - float[] array = new float[10]; - for (int num380 = 0; num380 < Main.maxNPCs; num380++) + int maxHungriesBasedOnHP = (int)Math.Round(MathHelper.Lerp(2f, 8f, npc.life / (float)npc.lifeMax)); + if (NPC.CountNPCS(NPCID.TheHungry) < maxHungriesBasedOnHP) { - if (num379 < 10 && Main.npc[num380].active && Main.npc[num380].type == NPCID.TheHungry) + int hungryCount = 0; + int maxHungries = 10; + float[] hungryArray = new float[maxHungries]; + for (int i = 0; i < Main.maxNPCs; i++) { - array[num379] = Main.npc[num380].ai[0]; - num379++; - } - } - - int maxValue = 1 + num379 * 2; - if (Main.masterMode) - maxValue /= 2; - if (maxValue < 2) - maxValue = 2; - - if (num379 < 10 && Main.rand.Next(maxValue) <= 1) - { - int num381 = -1; - for (int num382 = 0; num382 < 1000; num382++) - { - int num383 = Main.rand.Next(10); - float num384 = (float)num383 * 0.1f - 0.05f; - bool flag26 = true; - for (int num385 = 0; num385 < num379; num385++) + if (hungryCount < maxHungries && Main.npc[i].active && Main.npc[i].type == NPCID.TheHungry) { - if (num384 == array[num385]) + hungryArray[hungryCount] = Main.npc[i].ai[0]; + hungryCount++; + } + } + + int maxValue = 1 + hungryCount * 2; + if (Main.masterMode) + maxValue /= 2; + if (maxValue < 2) + maxValue = 2; + + if (hungryCount < maxHungries && Main.rand.Next(maxValue) <= 1) + { + int ai0 = -1; + for (int i = 0; i < 1000; i++) + { + int randomHungryLocation = Main.rand.Next(maxHungries); + float hungryLocation = (float)randomHungryLocation * 0.1f - 0.05f; + bool spawnHungry = true; + for (int j = 0; j < hungryCount; j++) { - flag26 = false; + if (hungryLocation == hungryArray[j]) + { + spawnHungry = false; + break; + } + } + + if (spawnHungry) + { + ai0 = randomHungryLocation; break; } } - if (flag26) - { - num381 = num383; - break; - } + if (ai0 >= 0) + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num368, NPCID.TheHungry, npc.whoAmI, (float)ai0 * 0.1f - 0.05f); } - - if (num381 >= 0) - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.position.X, (int)num368, NPCID.TheHungry, npc.whoAmI, (float)num381 * 0.1f - 0.05f); } } } From 1eaddecce01340070b5407e76c4bd8ed86475464 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 12 Jul 2024 21:34:46 -0700 Subject: [PATCH 28/28] aw dangit (Tooltip) --- Items/Weapons/Ranged/TheSevensStriker.cs | 3 ++- Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/TheSevensStriker.cs b/Items/Weapons/Ranged/TheSevensStriker.cs index 745e017d1c..236639769c 100644 --- a/Items/Weapons/Ranged/TheSevensStriker.cs +++ b/Items/Weapons/Ranged/TheSevensStriker.cs @@ -10,8 +10,9 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class TheSevensStriker : ModItem, ILocalizedModType + public class TheSevensStriker : ModItem, ILocalizedModType, IHoldShiftTooltipItem { + public bool ShowExtensionIndicator => false; public new string LocalizationCategory => "Items.Weapons.Ranged"; public static readonly SoundStyle RouletteSound = new("CalamityMod/Sounds/Item/SevensStrikerRoulette") { Volume = 0.6f, SoundLimitBehavior = SoundLimitBehavior.ReplaceOldest }; public static readonly SoundStyle RouletteTickSound = new("CalamityMod/Sounds/Item/SevensStrikerRouletteTick") { Volume = 0.5f }; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 40446e5cd3..1eb75ba619 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -1339,6 +1339,7 @@ TheSevensStriker: { 'A gun given to a great gunslinger Forged by the arms of a man given no name' ''' + HoldShiftTooltip: "[c/ADD8E6:'LET'S GO GAMBLING!']" } TheStorm: {