From 7f13b535d67371a9ce871be39781bd43ac880928 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 1 Jul 2022 11:13:56 -0400 Subject: [PATCH 01/31] vine stack overflow hopefully removed, kinda impossible to test --- Tiles/Abyss/SulphurousVines.cs | 85 ++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index ee32273fb9..1080cb8706 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Abyss public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) { //GIVE VINE ROPE IF SPECIAL VINE BOOK - if (WorldGen.genRand.Next(2) == 0 && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) + if (WorldGen.genRand.NextBool(2) && Main.player[(int)Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)].cordage) { Item.NewItem(new EntitySource_TileBreak(i, j), new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope); } @@ -50,47 +50,60 @@ namespace CalamityMod.Tiles.Abyss } } + // Ozzatron 01JUL2022: infinite tile framing recursion in rusty chests caused by sulphurous vines + // heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore. + private const int MaxVineHeight = 10; public override void RandomUpdate(int i, int j) { - if (Main.tile[i, j + 1] != null) + int rustyChest = ModContent.TileType(); + Tile below = Main.tile[i, j + 1]; + if (!below.HasTile && below.LiquidType == LiquidID.Water && below.LiquidAmount >= 128) { - if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType()) + bool growVine = false; + for (int vineOriginYPos = j; vineOriginYPos > j - MaxVineHeight; j--) { - if (Main.tile[i, j + 1].LiquidAmount >= 128 && Main.tile[i, j + 1].LiquidType != LiquidID.Lava) + Tile consideredVineOrigin = Main.tile[i, vineOriginYPos]; + // Vines won't grow if they are coming out of a bottom-sloped block (which they shouldn't be able to anyway) + if (consideredVineOrigin.BottomSlope) { - bool flag13 = false; - for (int num52 = j; num52 > j - 10; j--) - { - if (Main.tile[i, num52].BottomSlope) - { - flag13 = false; - break; - } - if (Main.tile[i, num52].HasTile && !Main.tile[i, num52].BottomSlope) - { - flag13 = true; - break; - } - } - if (flag13) - { - int num53 = i; - int num54 = j + 1; - Main.tile[num53, num54].TileType = (ushort)ModContent.TileType(); - Main.tile[num53, num54].TileFrameX = (short)(WorldGen.genRand.Next(8) * 18); - Main.tile[num53, num54].TileFrameY = (short)(4 * 18); - Main.tile[num53, num54 - 1].TileFrameX = (short)(WorldGen.genRand.Next(12) * 18); - Main.tile[num53, num54 - 1].TileFrameY = (short)(WorldGen.genRand.Next(4) * 18); - Main.tile[num53, num54].Get().HasTile = true; - WorldGen.SquareTileFrame(num53, num54, true); - WorldGen.SquareTileFrame(num53, num54 - 1, true); - if (Main.netMode == NetmodeID.Server) - { - NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); - NetMessage.SendTileSquare(-1, num53, num54 - 1, 3, TileChangeType.None); - } - } + growVine = false; + break; } + // Vines can continue to grow unimpeded out of any solid block that isn't bottom-sloped. + if (Main.tile[i, vineOriginYPos].HasTile && !Main.tile[i, vineOriginYPos].BottomSlope) + { + growVine = true; + break; + } + } + + if (growVine) + { + int x = i; + int y = j + 1; + + // zero faith that code using local variables works with struct tiles, from experience + + // Spawn the new vine + Main.tile[x, y].TileType = (ushort)ModContent.TileType(); + Main.tile[x, y].TileFrameX = (short)(WorldGen.genRand.Next(8) * 18); + Main.tile[x, y].TileFrameY = 4 * 18; + Main.tile[x, y].Get().HasTile = true; // .HasTile = true; refuses to work + + // Reframe the current vine + Main.tile[i, j].TileFrameX = (short)(WorldGen.genRand.Next(12) * 18); + Main.tile[i, j].TileFrameY = (short)(WorldGen.genRand.Next(4) * 18); + + // Reframe both vines UNLESS ONE OF THEM IS A CHEST FOR SOME REASON YEAH THAT WOULD BE BAD + if (Main.tile[x, y].TileType != rustyChest && Main.tile[i, j].TileType != rustyChest) + { + WorldGen.SquareTileFrame(x, y, true); + WorldGen.SquareTileFrame(i, j, true); + } + + // Send update packets as needed + if (Main.netMode == NetmodeID.Server) + NetMessage.SendTileSquare(-1, x, y, 3, TileChangeType.None); } } } From 9f7ed202dd54b12ff1ba1557d13b4718ee63c3b8 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 1 Jul 2022 13:11:05 -0400 Subject: [PATCH 02/31] the problem was atalya scrap piles sulphur vines are innocent, they just cause floating chests to reframe which instantly destroys the universe --- Tiles/Abyss/SulphurousVines.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index 1080cb8706..8a8efab045 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -50,12 +50,10 @@ namespace CalamityMod.Tiles.Abyss } } - // Ozzatron 01JUL2022: infinite tile framing recursion in rusty chests caused by sulphurous vines - // heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore. + // Ozzatron 01JUL2022: heavily refactored this code to not suck. also, sulphurous vines won't grow in honey anymore. private const int MaxVineHeight = 10; public override void RandomUpdate(int i, int j) { - int rustyChest = ModContent.TileType(); Tile below = Main.tile[i, j + 1]; if (!below.HasTile && below.LiquidType == LiquidID.Water && below.LiquidAmount >= 128) { @@ -90,16 +88,13 @@ namespace CalamityMod.Tiles.Abyss Main.tile[x, y].TileFrameY = 4 * 18; Main.tile[x, y].Get().HasTile = true; // .HasTile = true; refuses to work - // Reframe the current vine + // Pick a new sprite for the current vine Main.tile[i, j].TileFrameX = (short)(WorldGen.genRand.Next(12) * 18); Main.tile[i, j].TileFrameY = (short)(WorldGen.genRand.Next(4) * 18); - // Reframe both vines UNLESS ONE OF THEM IS A CHEST FOR SOME REASON YEAH THAT WOULD BE BAD - if (Main.tile[x, y].TileType != rustyChest && Main.tile[i, j].TileType != rustyChest) - { - WorldGen.SquareTileFrame(x, y, true); - WorldGen.SquareTileFrame(i, j, true); - } + // Reframe both vines the correct vanilla way + WorldGen.SquareTileFrame(x, y, true); + WorldGen.SquareTileFrame(i, j, true); // Send update packets as needed if (Main.netMode == NetmodeID.Server) From a20f8583c71b6881c004889856e7b3c16a6cfe66 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 1 Jul 2022 12:27:43 -0500 Subject: [PATCH 03/31] Changed Rusty Chest worldgen placement order --- World/SulphurousSea.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/World/SulphurousSea.cs b/World/SulphurousSea.cs index fcf2a57ce1..bfc27b0afe 100644 --- a/World/SulphurousSea.cs +++ b/World/SulphurousSea.cs @@ -91,9 +91,9 @@ namespace CalamityMod.World { PlaceStalactites(); PlaceColumns(); - PlaceRustyChests(); CreateBeachNearSea(); PlaceScrapPiles(); + PlaceRustyChests(); } #endregion From 61939beeed033d24e9026d64216c36e9163b27f9 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Fri, 1 Jul 2022 17:14:10 -0500 Subject: [PATCH 04/31] Step Stool sell price 1gc --> 20cc --- Items/CalamityGlobalItemTweaks.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 8a3152d62f..c5a7c3074d 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -474,6 +474,7 @@ namespace CalamityMod.Items { ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.Starfury, autoReuse }, { ItemID.StarWrath, Do(DamageRatio(0.9f)) }, + { ItemID.PortableStool, Do(Value(Item.sellPrice(copper: 20))) }, // Step Stool { ItemID.StickyBomb, maxStack999 }, { ItemID.StickyDynamite, maxStack999 }, { ItemID.SwordWhip, autoReuse }, From d964216742182e5aee766fe75d145115e8d1ee78 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Fri, 1 Jul 2022 20:06:48 -0500 Subject: [PATCH 05/31] Increased Uelibloom ore spawns since long jungles don't generate enough. --- NPCs/Providence/Providence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 88f50761ac..d0d751114a 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1527,7 +1527,7 @@ namespace CalamityMod.NPCs.Providence string key3 = "Mods.CalamityMod.TreeOreText"; Color messageColor3 = Color.LightGreen; - CalamityUtils.SpawnOre(ModContent.TileType(), 15E-05, 0.5f, 09f, 3, 8, TileID.Mud); + CalamityUtils.SpawnOre(ModContent.TileType(), 17E-05, 0.55f, 0.85f, 5, 9, TileID.Mud); CalamityUtils.DisplayLocalizedText(key2, messageColor2); CalamityUtils.DisplayLocalizedText(key3, messageColor3); From a60c959a16a94bdf46de2dce7d12ad18b385c5ac Mon Sep 17 00:00:00 2001 From: NycroV <83246959+NycroV@users.noreply.github.com> Date: Fri, 1 Jul 2022 22:21:00 -0400 Subject: [PATCH 06/31] Fixed Falcon Blade's tooltip edit to properly show the 20% move speed bonus --- Items/CalamityGlobalItemTooltip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index acce745e30..412665795b 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -653,7 +653,7 @@ namespace CalamityMod.Items // Falcon Blade +20% move speed while holding if (item.type == ItemID.FalconBlade) - EditTooltipByNum(0, (line) => line.Text += "\nHolding this item increases move speed by 20%"); + EditTooltipByName("Knockback", (line) => line.Text += "\nHolding this item grants +20% increased movement speed"); #endregion // Pre-Hardmode ore armor tooltip edits From fad054955d208560f2ef128054af9898c9d75ae3 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 16:42:53 -0400 Subject: [PATCH 07/31] 1 - Add True Melee damage classes. 2 - Add Luck to the Stat Meter. Note this commit does not compile. --- DamageClasses/TrueMeleeDamageClasses.cs | 48 +++++++++++++++++++++++++ Items/Accessories/StatMeter.cs | 31 ++++++++++------ 2 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 DamageClasses/TrueMeleeDamageClasses.cs diff --git a/DamageClasses/TrueMeleeDamageClasses.cs b/DamageClasses/TrueMeleeDamageClasses.cs new file mode 100644 index 0000000000..bd86f3a221 --- /dev/null +++ b/DamageClasses/TrueMeleeDamageClasses.cs @@ -0,0 +1,48 @@ +using Terraria.ModLoader; + +namespace CalamityMod +{ + // True Melee is a subclass of Melee, NOT MeleeNoSpeed. It is affected by melee speed. + public class TrueMeleeDamageClass : DamageClass + { + internal static TrueMeleeDamageClass Instance; + + public override void Load() => Instance = this; + public override void Unload() => Instance = null; + + public override StatInheritanceData GetModifierInheritance(DamageClass damageClass) + { + if (damageClass == Melee || damageClass == Generic) + return StatInheritanceData.Full; + + return StatInheritanceData.None; + } + + public override bool GetEffectInheritance(DamageClass damageClass) => + damageClass == Melee || damageClass == MeleeNoSpeed; + + // SetDefaultStats not included, because the player gets 4% Melee crit by default, which carries over to this + } + + // True Melee is a subclass of MeleeNoSpeed, NOT Melee. It is NOT affected by melee speed. + public class TrueMeleeNoSpeedDamageClass : DamageClass + { + internal static TrueMeleeNoSpeedDamageClass Instance; + + public override void Load() => Instance = this; + public override void Unload() => Instance = null; + + public override StatInheritanceData GetModifierInheritance(DamageClass damageClass) + { + if (damageClass == MeleeNoSpeed || damageClass == Generic) + return StatInheritanceData.Full; + + return StatInheritanceData.None; + } + + public override bool GetEffectInheritance(DamageClass damageClass) => + damageClass == Melee || damageClass == MeleeNoSpeed; + + // SetDefaultStats not included, because the player gets 4% Melee crit by default, which carries over to this + } +} diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index fe9eed9509..b6951f3973 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Accessories static string TwoPlaces(float f) => f.ToString("n2"); // - // RAW STATS (as obtained from the game engine, not yet modified for display + // RAW STATS (as obtained from the game engine, not yet modified for display) // // Defense @@ -68,8 +68,12 @@ namespace CalamityMod.Items.Accessories float jumpBoost = player.GetJumpBoost(); float wingFlightTime = player.wingTimeMax; - // Melee - float trueMeleeDamage = (float)modPlayer.trueMeleeDamage; + // Luck + // Does not use NormalizedLuck. Presents the player's luck exactly as it is used by the game engine. + // NormalizedLuck is only used in one place: the Wizard's luck report. Which is entirely obsoleted by this Meter. + float luck = player.luck; + + // No melee-specific stats anymore, because True Melee is its own class // Ranged float rangedAmmoConsumption = player.GetRangedAmmoCostReduction(); @@ -81,20 +85,20 @@ namespace CalamityMod.Items.Accessories // Summon int minionSlots = player.maxMinions; - // rogue + // Rogue float rogueStealth = modPlayer.rogueStealthMax; float standingRegen = player.GetStandingStealthRegen(); float movingRegen = player.GetMovingStealthRegen(); float rogueVelocity = modPlayer.rogueVelocity - 1f; float rogueAmmoConsumption = modPlayer.rogueAmmoCost; - // rippers + // Rippers float rageDamage = modPlayer.RageDamageBoost; float adrenalineDamage = modPlayer.GetAdrenalineDamage(); int numAdrenBoosters = (modPlayer.adrenalineBoostOne ? 1 : 0) + (modPlayer.adrenalineBoostTwo ? 1 : 0) + (modPlayer.adrenalineBoostThree ? 1 : 0); float adrenalineDR = BalancingConstants.FullAdrenalineDR + numAdrenBoosters * BalancingConstants.AdrenalineDRPerBooster; - // abyss + // Abyss int lightLevel = player.GetCurrentAbyssLightLevel(); float breathLoss = modPlayer.abyssBreathLossStat; float breathLossRate = modPlayer.abyssBreathLossRateStat; @@ -129,6 +133,8 @@ namespace CalamityMod.Items.Accessories damageClassName = "Classless"; else if (dc == AverageDamageClass.Instance) damageClassName = "Averaged"; + else if (dc == TrueMeleeDamageClass.Instance || dc == TrueMeleeNoSpeedDamageClass.Instance) + damageClassName = "True Melee"; else if (dc == DamageClass.Melee || dc == DamageClass.MeleeNoSpeed) damageClassName = "Melee"; else if (dc == DamageClass.Ranged) @@ -186,10 +192,6 @@ namespace CalamityMod.Items.Accessories sb.Append(' ').Append(sign).Append(OnePlace(flatDamage)).Append(" flat"); } - // If melee, display true melee damage - if (dc == DamageClass.Melee) - sb.Append('\n').Append("True Melee Damage: ").Append(TwoPlaces(100f * trueMeleeDamage)).Append('%'); - // Newline between damage and crit sb.Append('\n').Append(damageClassName).Append(" Crit Chance: "); sb.Append(TwoPlaces(totalCrit)).Append('%'); @@ -266,7 +268,14 @@ namespace CalamityMod.Items.Accessories sb.Append('+'); sb.Append(TwoPlaces(100f * moveSpeedBoost)).Append('%'); sb.Append(" | Jump Boost: ").Append(TwoPlaces(20f * jumpBoost)).Append('%'); - sb.Append(" | Wing Flight Time: ").Append(TwoPlaces(wingFlightTime / 60f)).Append(" seconds\n\n"); + sb.Append(" | Wing Flight Time: ").Append(TwoPlaces(wingFlightTime / 60f)).Append(" seconds\n"); + + sb.Append("Luck: "); + // Positive boosts need a + prefix, negative will have its own - sign automatically. + // There's a "clever" way to do this with formatting but it's harder. + if (luck >= 0f) + sb.Append('+'); + sb.Append(TwoPlaces(100f * luck)).Append("%\n\n"); // Detailed Abyss stats only render if the player is in the Abyss. sb.Append("Abyss Light Strength: ").Append(lightLevel).Append('\n'); From 664c10ae010f164acbc59c5e3ee7b80483e1e795 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 18:13:54 -0400 Subject: [PATCH 08/31] 1 - No Gravity is no longer a list; each item declares it individually. 2 - True Melee is now two dedicated damage classes. One of them does not use melee speed. 3 - Fixed a bug where Warbanner of the Sun was only giving melee speed. 4 - Standardized defining whether an item is true melee. If it's one of the classes, it's true melee. Otherwise it's not. 5 - All items which are "classic true melee" (projectile-less melee) are re-classed as True Melee automatically. 6 - Renamed Yharon Soul Fragments internally. 7 - Can Fish In Lava is no longer a list; each item declares it individually. 8 - Removed the special true melee damage tooltip, as you will always see true melee damage on applicable weapons now. --- CalPlayer/CalamityPlayer.cs | 64 +++++++------- CalPlayer/CalamityPlayerMiscEffects.cs | 15 ---- CalamityLists.cs | 80 ------------------ DamageClasses/TrueMeleeDamageClasses.cs | 20 +++-- DataStructures/GemTechArmorState.cs | 3 +- Items/Accessories/CounterScarf.cs | 3 +- Items/Accessories/ElementalGauntlet.cs | 1 + Items/Accessories/EvasionScarf.cs | 3 +- Items/Accessories/FungalSymbiote.cs | 3 +- Items/Accessories/GodlySoulArtifact.cs | 2 +- Items/Accessories/HideofAstrumDeus.cs | 2 + Items/Accessories/WarbanneroftheSun.cs | 7 +- Items/Accessories/Wings/SoulofCryogen.cs | 1 + Items/Accessories/YharimsInsignia.cs | 1 + Items/CalamityGlobalItem.cs | 23 +++-- Items/CalamityGlobalItemTooltip.cs | 32 ------- Items/CalamityGlobalItemTweaks.cs | 70 ++++++++------- Items/Dyes/DragonSoulDye.cs | 2 +- Items/Fishing/FishingRods/RiftReeler.cs | 2 + Items/Fishing/FishingRods/SlurperPole.cs | 2 + .../Fishing/FishingRods/TheDevourerofCods.cs | 2 + Items/LoreItems/KnowledgeAquaticScourge.cs | 1 + Items/LoreItems/KnowledgeAstralInfection.cs | 1 + Items/LoreItems/KnowledgeAstrumAureus.cs | 1 + Items/LoreItems/KnowledgeAstrumDeus.cs | 1 + Items/LoreItems/KnowledgeBloodMoon.cs | 1 + Items/LoreItems/KnowledgeBrainofCthulhu.cs | 1 + Items/LoreItems/KnowledgeBrimstoneCrag.cs | 1 + .../LoreItems/KnowledgeBrimstoneElemental.cs | 1 + Items/LoreItems/KnowledgeCalamitas.cs | 1 + Items/LoreItems/KnowledgeCalamitasClone.cs | 1 + Items/LoreItems/KnowledgeCorruption.cs | 1 + Items/LoreItems/KnowledgeCrabulon.cs | 1 + Items/LoreItems/KnowledgeCrimson.cs | 1 + Items/LoreItems/KnowledgeCryogen.cs | 1 + Items/LoreItems/KnowledgeDesertScourge.cs | 1 + Items/LoreItems/KnowledgeDestroyer.cs | 1 + Items/LoreItems/KnowledgeDevourerofGods.cs | 1 + Items/LoreItems/KnowledgeDragonfolly.cs | 1 + Items/LoreItems/KnowledgeDukeFishron.cs | 1 + Items/LoreItems/KnowledgeEaterofWorlds.cs | 1 + Items/LoreItems/KnowledgeExoMechs.cs | 1 + Items/LoreItems/KnowledgeEyeofCthulhu.cs | 1 + Items/LoreItems/KnowledgeGolem.cs | 1 + Items/LoreItems/KnowledgeHiveMind.cs | 1 + Items/LoreItems/KnowledgeKingSlime.cs | 1 + Items/LoreItems/KnowledgeLeviathanAnahita.cs | 1 + Items/LoreItems/KnowledgeLunaticCultist.cs | 1 + Items/LoreItems/KnowledgeMechs.cs | 1 + Items/LoreItems/KnowledgeMoonLord.cs | 1 + Items/LoreItems/KnowledgeOcean.cs | 1 + Items/LoreItems/KnowledgeOldDuke.cs | 1 + Items/LoreItems/KnowledgePerforators.cs | 1 + .../KnowledgePlaguebringerGoliath.cs | 1 + Items/LoreItems/KnowledgePlantera.cs | 1 + Items/LoreItems/KnowledgePolterghast.cs | 1 + Items/LoreItems/KnowledgeProfanedGuardians.cs | 1 + Items/LoreItems/KnowledgeProvidence.cs | 1 + Items/LoreItems/KnowledgeQueenBee.cs | 1 + Items/LoreItems/KnowledgeRavager.cs | 1 + Items/LoreItems/KnowledgeSentinels.cs | 1 + Items/LoreItems/KnowledgeSkeletron.cs | 1 + Items/LoreItems/KnowledgeSkeletronPrime.cs | 1 + Items/LoreItems/KnowledgeSlimeGod.cs | 1 + Items/LoreItems/KnowledgeSulphurSea.cs | 1 + Items/LoreItems/KnowledgeTwins.cs | 1 + Items/LoreItems/KnowledgeUnderworld.cs | 1 + Items/LoreItems/KnowledgeWallofFlesh.cs | 1 + Items/LoreItems/KnowledgeYharon.cs | 1 + Items/Materials/AscendantSpiritEssence.cs | 1 + Items/Materials/AuricBar.cs | 4 +- Items/Materials/CoreofCalamity.cs | 2 + Items/Materials/CoreofChaos.cs | 2 + Items/Materials/CoreofEleum.cs | 2 + Items/Materials/CoreofSunlight.cs | 2 + Items/Materials/DarkPlasma.cs | 1 + Items/Materials/DarksunFragment.cs | 1 + Items/Materials/EndothermicEnergy.cs | 1 + Items/Materials/EssenceofChaos.cs | 2 + Items/Materials/EssenceofEleum.cs | 2 + Items/Materials/EssenceofSunlight.cs | 2 + Items/Materials/GalacticaSingularity.cs | 1 + Items/Materials/NightmareFuel.cs | 1 + Items/Materials/TwistingNether.cs | 2 + Items/Materials/UnholyEssence.cs | 1 + ...asterFragment.cs => YharonSoulFragment.cs} | 9 +- ...terFragment.png => YharonSoulFragment.png} | Bin Items/PermanentBoosters/Dragonfruit.cs | 2 +- Items/Potions/DraconicElixir.cs | 4 +- Items/Tools/MarniteObliterator.cs | 3 +- Items/TreasureBags/YharonBag.cs | 2 +- .../MoltenArmorSetChange.cs | 3 +- .../DraedonsArsenal/HydraulicVoltCrasher.cs | 3 +- Items/Weapons/Magic/TheWand.cs | 2 +- Items/Weapons/Melee/AstralPike.cs | 3 +- Items/Weapons/Melee/Brimlance.cs | 3 +- Items/Weapons/Melee/DevilsSunrise.cs | 3 +- Items/Weapons/Melee/DiseasedPike.cs | 3 +- Items/Weapons/Melee/DragonPow.cs | 2 +- Items/Weapons/Melee/DragonRage.cs | 3 +- Items/Weapons/Melee/GildedProboscis.cs | 3 +- Items/Weapons/Melee/MarniteSpear.cs | 3 +- Items/Weapons/Melee/Murasama.cs | 3 +- Items/Weapons/Melee/Omniblade.cs | 3 +- Items/Weapons/Melee/PhosphorescentGauntlet.cs | 3 +- Items/Weapons/Melee/SausageMaker.cs | 3 +- Items/Weapons/Melee/VulcaniteLance.cs | 3 +- Items/Weapons/Melee/YateveoBloom.cs | 3 +- Items/Weapons/Ranged/Drataliornus.cs | 2 +- Localization/enUS.hjson | 6 +- ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/Yharon/Yharon.cs | 2 +- .../EnchantmentManager.cs | 6 +- Utilities/ItemUtils.cs | 25 +++--- Utilities/PlayerUtils.cs | 9 +- Utilities/ProjectileUtils.cs | 7 ++ 116 files changed, 251 insertions(+), 290 deletions(-) rename Items/Materials/{HellcasterFragment.cs => YharonSoulFragment.cs} (84%) rename Items/Materials/{HellcasterFragment.png => YharonSoulFragment.png} (100%) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 981c84a756..84e8a78029 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1,23 +1,33 @@ -using CalamityMod.Balancing; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Balancing; +using CalamityMod.BiomeManagers; using CalamityMod.Buffs; using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Pets; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; using CalamityMod.Dusts; +using CalamityMod.EntitySources; using CalamityMod.Events; +using CalamityMod.FluidSimulation; using CalamityMod.Items.Accessories; -using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Bloodflare; +using CalamityMod.Items.Armor.Brimflame; +using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.GemTech; +using CalamityMod.Items.Armor.OmegaBlue; +using CalamityMod.Items.Armor.PlagueReaper; +using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Dyes; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; -using CalamityMod.Items.Tools; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; @@ -43,11 +53,9 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; using Terraria; +using Terraria.Audio; +using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameInput; using Terraria.Graphics.Shaders; @@ -55,19 +63,6 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Audio; -using CalamityMod.BiomeManagers; -using Terraria.Chat; -using CalamityMod.EntitySources; -using CalamityMod.CalPlayer.Dashes; -using CalamityMod.FluidSimulation; -using CalamityMod.Items.Armor.Bloodflare; -using CalamityMod.Items.Armor.Brimflame; -using CalamityMod.Items.Armor.Demonshade; -using CalamityMod.Items.Armor.GemTech; -using CalamityMod.Items.Armor.OmegaBlue; -using CalamityMod.Items.Armor.PlagueReaper; -using CalamityMod.Items.Armor.Silva; namespace CalamityMod.CalPlayer { @@ -95,7 +90,6 @@ namespace CalamityMod.CalPlayer public float KameiTrailXScale = 0.1f; public int KameiBladeUseDelay = 0; public Vector2[] OldPositions = new Vector2[4]; - public double trueMeleeDamage = 0D; public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f; @@ -1484,9 +1478,6 @@ namespace CalamityMod.CalPlayer rogueAmmoCost = 1f; accStealthGenBoost = 0f; - trueMeleeDamage = 0D; - warBannerBonus = 0f; - DashID = string.Empty; externalAbyssLight = 0; externalColdImmunity = externalHeatImmunity = false; @@ -3539,7 +3530,16 @@ namespace CalamityMod.CalPlayer #endregion #region PostUpdateEquips - public override void PostUpdateEquips() => ForceVariousEffects(); + public override void PostUpdateEquips() + { + // True melee damage from various vanilla equipment placed here. + + // Titan Glove and ALL upgrades + if (Player.kbGlove) + Player.GetDamage() += 0.1f; + + ForceVariousEffects(); + } #endregion #region PostUpdate @@ -4377,9 +4377,6 @@ namespace CalamityMod.CalPlayer { #region MultiplierBoosts double damageMult = 1.0; - bool isTrueMelee = item.CountsAsClass() && item.type != ModContent.ItemType() && item.type != ModContent.ItemType(); - if (isTrueMelee) - damageMult += trueMeleeDamage; if (enraged) damageMult += 1.25; @@ -4388,7 +4385,7 @@ namespace CalamityMod.CalPlayer damageMult += 0.6; // Rippers are always checked for application, because there are ways to get rippers outside of Rev now - CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); + CalamityUtils.ApplyRippersToDamage(this, item.IsTrueMelee(), ref damageMult); damage = (int)(damage * damageMult); #endregion @@ -4460,14 +4457,11 @@ namespace CalamityMod.CalPlayer if (proj.npcProj || proj.trap) return; - bool isTrueMelee = proj.Calamity().trueMelee; bool isSummon = proj.IsSummon(); Item heldItem = Player.ActiveItem(); #region MultiplierBoosts double damageMult = 1D; - if (isTrueMelee) - damageMult += trueMeleeDamage; if (screwdriver) { @@ -4493,7 +4487,7 @@ namespace CalamityMod.CalPlayer damageMult += 0.6; // Rippers are always checked for application, because there are ways to get rippers outside of Rev now - CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); + CalamityUtils.ApplyRippersToDamage(this, proj.IsTrueMelee(), ref damageMult); if (filthyGlove && proj.Calamity().stealthStrike && proj.CountsAsClass()) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 33dc104cd2..f323ade63b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2817,9 +2817,6 @@ namespace CalamityMod.CalPlayer Player.statDefense += 10; } - if (warbannerOfTheSun) - Player.GetDamage() += warBannerBonus; - // The player's true max life value with Calamity adjustments actualMaxLife = Player.statLifeMax2; @@ -3468,18 +3465,6 @@ namespace CalamityMod.CalPlayer if (CalamityConfig.Instance.Proficiency) GetStatBonuses(); - // True melee damage bonuses - double damageAdd = (dodgeScarf ? 0.1 : 0) + - (evasionScarf ? 0.05 : 0) + - ((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 0.5 : 0) + - (fungalSymbiote ? 0.15 : 0) + - ((Player.head == ArmorIDs.Head.MoltenHelmet && Player.body == ArmorIDs.Body.MoltenBreastplate && Player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) + - (Player.kbGlove ? 0.1 : 0) + - (eGauntlet ? 0.1 : 0) + - (yInsignia ? 0.1 : 0) + - (warbannerOfTheSun ? warBannerBonus : 0); - trueMeleeDamage += damageAdd; - // Amalgam boosts if (Main.myPlayer == Player.whoAmI) { diff --git a/CalamityLists.cs b/CalamityLists.cs index be9f382782..68a6ef8a65 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -119,7 +119,6 @@ namespace CalamityMod public static List daggerProjList; public static List flaskBombProjList; public static List spikyBallProjList; - public static List noGravityList; public static List lavaFishList; public static List highTestFishList; public static List flamethrowerList; @@ -1625,84 +1624,6 @@ namespace CalamityMod ProjectileType() }; - noGravityList = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - }; - - lavaFishList = new List() - { - ItemType(), - ItemType(), - ItemType() - }; - highTestFishList = new List() { ItemID.GoldenFishingRod, @@ -2810,7 +2731,6 @@ namespace CalamityMod daggerProjList = null; flaskBombProjList = null; spikyBallProjList = null; - noGravityList = null; lavaFishList = null; highTestFishList = null; flamethrowerList = null; diff --git a/DamageClasses/TrueMeleeDamageClasses.cs b/DamageClasses/TrueMeleeDamageClasses.cs index bd86f3a221..6c5427ab5d 100644 --- a/DamageClasses/TrueMeleeDamageClasses.cs +++ b/DamageClasses/TrueMeleeDamageClasses.cs @@ -2,7 +2,9 @@ namespace CalamityMod { - // True Melee is a subclass of Melee, NOT MeleeNoSpeed. It is affected by melee speed. + // True Melee is a subclass of Melee that is affected by melee speed. + // You can give players regular melee speed and it will affect true melee weapons of this damage class. + // If you want to give players attack speed which only affects true melee weapons, give them TrueMeleeDamageClass attack speed. public class TrueMeleeDamageClass : DamageClass { internal static TrueMeleeDamageClass Instance; @@ -18,13 +20,15 @@ namespace CalamityMod return StatInheritanceData.None; } - public override bool GetEffectInheritance(DamageClass damageClass) => - damageClass == Melee || damageClass == MeleeNoSpeed; + // Does not inherit effects from MeleeNoSpeed, because that class already inherits directly from Melee itself. + public override bool GetEffectInheritance(DamageClass damageClass) => damageClass == Melee; // SetDefaultStats not included, because the player gets 4% Melee crit by default, which carries over to this } - // True Melee is a subclass of MeleeNoSpeed, NOT Melee. It is NOT affected by melee speed. + // True Melee No Speed is a subclass of True Melee that, like MeleeNoSpeed, is NOT affected by melee speed. + // You should never give the player stat boosts to this class. + // Simply give them stat boosts to TrueMeleeDamageClass. This class will inherit everything but melee speed. public class TrueMeleeNoSpeedDamageClass : DamageClass { internal static TrueMeleeNoSpeedDamageClass Instance; @@ -32,16 +36,18 @@ namespace CalamityMod public override void Load() => Instance = this; public override void Unload() => Instance = null; + // This code lifted from the definition of MeleeNoSpeed, with the added change that it benefits from standard True Melee. public override StatInheritanceData GetModifierInheritance(DamageClass damageClass) { - if (damageClass == MeleeNoSpeed || damageClass == Generic) - return StatInheritanceData.Full; + if (damageClass == Generic || damageClass == Melee || damageClass == TrueMeleeDamageClass.Instance) + return StatInheritanceData.Full with { attackSpeedInheritance = 0 }; return StatInheritanceData.None; } + // True Melee No Speed inherits effects from regular Melee, MeleeNoSpeed and regular True Melee. public override bool GetEffectInheritance(DamageClass damageClass) => - damageClass == Melee || damageClass == MeleeNoSpeed; + damageClass == Melee || damageClass == MeleeNoSpeed || damageClass == TrueMeleeDamageClass.Instance; // SetDefaultStats not included, because the player gets 4% Melee crit by default, which carries over to this } diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index 3cf53074f2..adb167e9e2 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -125,8 +125,7 @@ namespace CalamityMod.DataStructures MeleeCrystalCountdown--; // Make the crystal fire countdown go down faster if holding a true melee item. - bool isHoldingMeleeItem = Owner.ActiveItem().CountsAsClass() && !Owner.ActiveItem().accessory; - if (isHoldingMeleeItem && (Owner.ActiveItem().shoot == ProjectileID.None || Owner.ActiveItem().Calamity().trueMelee)) + if (Owner.ActiveItem().IsTrueMelee()) MeleeCrystalCountdown--; // Ensure the crystal cooldown does not go below 0 due to the second decrement. diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 8d1ae863a6..e540a1815d 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { SacrificeTotal = 1; DisplayName.SetDefault("Counter Scarf"); - Tooltip.SetDefault("True melee strikes deal 10% more damage\n" + + Tooltip.SetDefault("10% increased true melee damage\n" + "Grants the ability to dash; dashing into an attack will cause you to dodge it\n" + "After a successful dodge you must wait 30 seconds before you can dodge again"); } @@ -31,6 +31,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + player.GetDamage() += 0.1f; CalamityPlayer modPlayer = player.Calamity(); modPlayer.dodgeScarf = true; modPlayer.DashID = CounterScarfDash.ID; diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index badf0d03e3..e182d3a910 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Accessories player.autoReuseGlove = true; player.meleeScaleGlove = true; player.GetAttackSpeed() += 0.15f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index 593d7401bd..1119e7d099 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { SacrificeTotal = 1; DisplayName.SetDefault("Evasion Scarf"); - Tooltip.SetDefault("True melee strikes deal 15% more damage\n" + + Tooltip.SetDefault("15% increased true melee damage\n" + "Grants the ability to dash; dashing into an attack will cause you to dodge it\n" + "After a successful dodge you must wait 30 seconds before you can dodge again\n"); } @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + player.GetDamage() += 0.15f; CalamityPlayer modPlayer = player.Calamity(); modPlayer.dodgeScarf = true; modPlayer.evasionScarf = true; diff --git a/Items/Accessories/FungalSymbiote.cs b/Items/Accessories/FungalSymbiote.cs index f10691e35d..9d311596df 100644 --- a/Items/Accessories/FungalSymbiote.cs +++ b/Items/Accessories/FungalSymbiote.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories SacrificeTotal = 1; DisplayName.SetDefault("Fungal Symbiote"); Tooltip.SetDefault("Various melee weapons emit mushrooms in true melee range\n" + - "True melee strikes deal 15% more damage"); + "15% increased true melee damage"); } public override void SetDefaults() @@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + player.GetDamage() += 0.15f; CalamityPlayer modPlayer = player.Calamity(); modPlayer.fungalSymbiote = true; } diff --git a/Items/Accessories/GodlySoulArtifact.cs b/Items/Accessories/GodlySoulArtifact.cs index 420eeb31df..6a401398e9 100644 --- a/Items/Accessories/GodlySoulArtifact.cs +++ b/Items/Accessories/GodlySoulArtifact.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(25). AddIngredient(25). - AddIngredient(5). + AddIngredient(5). AddTile(TileID.DemonAltar). Register(); } diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index 4032f1d0d8..19f7ad2cb2 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); player.buffImmune[ModContent.BuffType()] = true; modPlayer.aBulwarkRare = true; + if (modPlayer.aBulwarkRareMeleeBoostTimer > 0) + player.GetDamage() += 0.5f; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Frostburn] = true; diff --git a/Items/Accessories/WarbanneroftheSun.cs b/Items/Accessories/WarbanneroftheSun.cs index 02c368c466..b2122d0518 100644 --- a/Items/Accessories/WarbanneroftheSun.cs +++ b/Items/Accessories/WarbanneroftheSun.cs @@ -39,10 +39,13 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.warbannerOfTheSun = true; - player.GetAttackSpeed() += CalculateMeleeSpeedBonus(player); + float bonus = CalculateBonus(player); + player.GetAttackSpeed() += bonus; + player.GetDamage() += bonus; + player.GetDamage() += bonus; } - private static float CalculateMeleeSpeedBonus(Player player) + private static float CalculateBonus(Player player) { float bonus = 0f; diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 473d4a3030..8d1c827959 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Accessories.Wings "Icicles rain down as you fly"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 3)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 6.25f, 1f); } diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index 22ca50b43d..8f9a9f76ed 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.yInsignia = true; player.GetAttackSpeed() += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index ecf9165244..e584afe592 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -85,7 +85,6 @@ namespace CalamityMod.Items public bool donorItem = false; public bool devItem = false; public bool canFirePointBlankShots = false; - public bool trueMelee = false; public static readonly Color ExhumedTooltipColor = new Color(198, 27, 64); @@ -136,7 +135,6 @@ namespace CalamityMod.Items myClone.donorItem = donorItem; myClone.devItem = devItem; myClone.canFirePointBlankShots = canFirePointBlankShots; - myClone.trueMelee = trueMelee; return myClone; } @@ -208,15 +206,17 @@ namespace CalamityMod.Items break; } + // Apply Calamity Global Item Tweaks. SetDefaults_ApplyTweaks(item); - // TODO -- these properties should be some sort of dictionary. - // Perhaps the solution here is to just apply all changes of all kinds using the "Balance" system. - if (CalamityLists.noGravityList.Contains(item.type)) - ItemID.Sets.ItemNoGravity[item.type] = true; - - if (CalamityLists.lavaFishList.Contains(item.type)) - ItemID.Sets.CanFishInLava[item.type] = true; + // Items which are "classic true melee" (melee items with no fired projectile) are automatically reclassed as True Melee class. + if (item.shoot == ProjectileID.None) + { + if (item.DamageType == DamageClass.Melee) + item.DamageType = TrueMeleeDamageClass.Instance; + else if (item.DamageType == DamageClass.MeleeNoSpeed) + item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + } } #endregion @@ -530,13 +530,11 @@ namespace CalamityMod.Items tag.Add("enchantmentID", AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); tag.Add("DischargeEnchantExhaustion", DischargeEnchantExhaustion); tag.Add("canFirePointBlankShots", canFirePointBlankShots); - tag.Add("trueMelee", trueMelee); } public override void LoadData(Item item, TagCompound tag) { canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); - trueMelee = tag.GetBool("trueMelee"); timesUsed = tag.GetInt("timesUsed"); customRarity = (CalamityRarity)tag.GetInt("rarity"); @@ -561,7 +559,7 @@ namespace CalamityMod.Items { BitsByte flags = new BitsByte(); flags[0] = canFirePointBlankShots; - flags[1] = trueMelee; + // rip, no other flags. what a byte. writer.Write(flags); writer.Write((int)customRarity); @@ -576,7 +574,6 @@ namespace CalamityMod.Items { BitsByte flags = reader.ReadByte(); canFirePointBlankShots = flags[0]; - trueMelee = flags[1]; customRarity = (CalamityRarity)reader.ReadInt32(); timesUsed = reader.ReadInt32(); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 412665795b..a7e858ef55 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -34,10 +34,6 @@ namespace CalamityMod.Items if (nameLine != null) ApplyRarityColor(item, nameLine); - // If the item is true melee, add a true melee damage number adjacent to the standard damage number. - if (item.IsTrueMelee() && item.damage > 0 && Main.LocalPlayer.Calamity().trueMeleeDamage > 0D) - TrueMeleeDamageTooltip(item, tooltips); - // Modify all vanilla tooltips before appending mod mechanics (if any). ModifyVanillaTooltips(item, tooltips); @@ -1102,34 +1098,6 @@ namespace CalamityMod.Items } #endregion - #region True Melee Damage Tooltip - private void TrueMeleeDamageTooltip(Item item, IList tooltips) - { - TooltipLine line = tooltips.FirstOrDefault((l) => l.Mod == "Terraria" && l.Name == "Damage"); - - // If there somehow isn't a damage tooltip line, do not try to perform any edits. - if (line is null) - return; - - // Start with the existing line of melee damage. - StringBuilder sb = new StringBuilder(64); - sb.Append(line.Text).Append(" : "); - - // TODO -- True Melee should be its own class that extends Melee, so we can give people True Melee specific stats! - Player p = Main.LocalPlayer; - float itemCurrentDamage = p.GetTotalDamage().ApplyTo(item.damage); - double trueMeleeBoost = 1D + p.Calamity().trueMeleeDamage; - double imprecisionRoundingCorrection = 5E-06D; - int damageToDisplay = (int)(itemCurrentDamage * trueMeleeBoost + imprecisionRoundingCorrection); - sb.Append(damageToDisplay); - - // These two pieces are split apart for ease of translation - sb.Append(' '); - sb.Append("true melee damage"); - line.Text = sb.ToString(); - } - #endregion - #region Stealth Generation Prefix Accessory Tooltip private void StealthGenAccessoryTooltip(Item item, IList tooltips) { diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index c5a7c3074d..8bad55765c 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items { // Various shorthands for items which receive very simple changes, such as setting one flag. IItemTweak[] trueMelee = Do(TrueMelee); + IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); IItemTweak[] pointBlank = Do(PointBlank); IItemTweak[] autoReuse = Do(AutoReuse); IItemTweak[] maxStack999 = Do(MaxStack(999)); @@ -29,8 +30,8 @@ namespace CalamityMod.Items { { ItemID.Abeemination, nonConsumableBossSummon }, { ItemID.AbigailsFlower, autoReuse }, - { ItemID.AdamantiteChainsaw, Do(TrueMelee, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, - { ItemID.AdamantiteDrill, Do(TrueMelee, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(65), ShootSpeedRatio(1.25f)) }, { ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(18), DamageExact(61)) }, @@ -43,7 +44,7 @@ namespace CalamityMod.Items { ItemID.AnkhShield, Do(DefenseDelta(+8)) }, { ItemID.AntlionClaw, Do(ScaleRatio(1.5f), DamageRatio(1.5f), UseExact(14)) }, { ItemID.AquaScepter, Do(DamageExact(21), ShootSpeedExact(25f)) }, - { ItemID.Arkhalis, trueMelee }, + { ItemID.Arkhalis, trueMeleeNoSpeed }, { ItemID.BabyBirdStaff, Do(AutoReuse, UseExact(35)) }, { ItemID.Bananarang, Do(DamageExact(98), UseExact(14)) }, { ItemID.BatBat, autoReuse }, @@ -79,7 +80,7 @@ namespace CalamityMod.Items { ItemID.BouncyBomb, maxStack999 }, { ItemID.BouncyDynamite, maxStack999 }, { ItemID.BreakerBlade, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), DamageExact(97)) }, - { ItemID.ButchersChainsaw, Do(TrueMelee, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, { ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) }, { ItemID.CactusSword, Do(AutoReuse, UseTurn) }, { ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe, intentionally not in alphabetical order to correct for typo @@ -94,10 +95,10 @@ namespace CalamityMod.Items // { ItemID.ChargedBlasterCannon, Do(DamageRatio(1.33f)) }, { ItemID.Chik, autoReuse }, { ItemID.ChlorophyteArrow, Do(DamageRatio(1.1f)) }, - { ItemID.ChlorophyteChainsaw, Do(TrueMelee, AxePower(120), UseTimeExact(3), TileBoostExact(+0)) }, - { ItemID.ChlorophyteDrill, Do(TrueMelee, PickPower(200), UseTimeExact(4), TileBoostExact(+2)) }, + { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0)) }, + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2)) }, { ItemID.ChlorophyteGreataxe, Do(AxePower(165), UseTimeExact(7), TileBoostExact(+2)) }, - { ItemID.ChlorophyteJackhammer, Do(TrueMelee, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) }, + { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) }, { ItemID.ChlorophytePartisan, Do(AutoReuse, UseRatio(0.8f), DamageExact(100)) }, { ItemID.ChlorophytePickaxe, Do(PickPower(200), UseTimeExact(7), TileBoostExact(+2)) }, { ItemID.ChlorophyteSaber, Do(DamageExact(80), UseExact(10)) }, @@ -107,8 +108,8 @@ namespace CalamityMod.Items { ItemID.ClingerStaff, Do(DamageExact(118)) }, { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, { ItemID.CobaltBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.CobaltChainsaw, Do(TrueMelee, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.CobaltDrill, Do(TrueMelee, PickPower(130), UseTimeExact(5)) }, + { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, + { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) }, { ItemID.CobaltHat, Do(DefenseDelta(+2)) }, { ItemID.CobaltHelmet, Do(DefenseDelta(+4)) }, { ItemID.CobaltLeggings, Do(DefenseDelta(+2)) }, @@ -170,7 +171,7 @@ namespace CalamityMod.Items { ItemID.DemonBow, Do(PointBlank, DamageExact(12), AutoReuse) }, { ItemID.DemonScythe, Do(AutoReuse, DamageExact(33), ManaExact(10)) }, { ItemID.DiamondStaff, Do(DamageExact(26)) }, - { ItemID.Drax, Do(TrueMelee, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), DamageRatio(1.33f)) }, { ItemID.Dynamite, maxStack999 }, { ItemID.EbonwoodBow, Do(PointBlank, DamageRatio(1.1f)) }, @@ -303,7 +304,7 @@ namespace CalamityMod.Items { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125), UseTimeExact(14), TileBoostExact(+0)) }, { ItemID.MoltenPickaxe, Do(PickPower(100), UseTimeExact(10)) }, { ItemID.MoltenSkullRose, Do(DefenseExact(8)) }, - { ItemID.MonkStaffT1, Do(TrueMelee, DamageExact(83)) }, // Sleepy Octopod + { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageRatio(2f)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury { ItemID.MoonlordArrow, Do(DamageRatio(1.1f)) }, @@ -311,16 +312,16 @@ namespace CalamityMod.Items { ItemID.Muramasa, Do(ScaleRatio(1.5f), DamageRatio(1.5f), UseExact(14), CritDelta(+30)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, { ItemID.Musket, Do(PointBlank, DamageExact(25)) }, - { ItemID.MythrilChainsaw, Do(TrueMelee, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.MythrilDrill, Do(TrueMelee, PickPower(160), UseTimeExact(4)) }, + { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, + { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(95), ShootSpeedRatio(1.25f)) }, { ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) }, { ItemID.MythrilRepeater, Do(PointBlank, DamageExact(58), UseExact(19)) }, { ItemID.MythrilSword, Do(UseTurn, ScaleRatio(1.5f), DamageExact(100), UseExact(25)) }, { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, { ItemID.NaughtyPresent, nonConsumableBossSummon }, - { ItemID.NebulaChainsaw, trueMelee }, - { ItemID.NebulaDrill, Do(TrueMelee, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.NebulaChainsaw, trueMeleeNoSpeed }, + { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, { ItemID.NebulaPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(43)) }, { ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) }, @@ -335,8 +336,8 @@ namespace CalamityMod.Items { ItemID.OrangePhaseblade, Do(AutoReuse, UseTurn, ScaleRatio(1.5f), DamageExact(51)) }, { ItemID.OrangePhasesaber, Do(ScaleRatio(1.5f), DamageExact(72), UseExact(20)) }, { ItemID.OrichalcumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.OrichalcumChainsaw, Do(TrueMelee, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.OrichalcumDrill, Do(TrueMelee, PickPower(160), UseTimeExact(4)) }, + { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) }, + { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(98), ShootSpeedRatio(1.25f)) }, { ItemID.OrichalcumHeadgear, Do(DefenseDelta(+2)) }, { ItemID.OrichalcumHelmet, Do(DefenseDelta(+3)) }, @@ -350,8 +351,8 @@ namespace CalamityMod.Items { ItemID.PaladinsHammer, Do(AutoReuse, DamageExact(100)) }, { ItemID.PaladinsShield, Do(DefenseDelta(+3)) }, { ItemID.PalladiumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.PalladiumChainsaw, Do(TrueMelee, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.PalladiumDrill, Do(TrueMelee, PickPower(130), UseTimeExact(5)) }, + { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) }, + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) }, { ItemID.PalladiumHeadgear, Do(DefenseDelta(+2)) }, { ItemID.PalladiumHelmet, Do(DefenseDelta(+3)) }, { ItemID.PalladiumMask, Do(DefenseDelta(+1)) }, @@ -419,7 +420,7 @@ namespace CalamityMod.Items { ItemID.Sandgun, pointBlank }, { ItemID.SapphireStaff, Do(AutoReuse, DamageExact(25)) }, { ItemID.SanguineStaff, Do(AutoReuse, UseExact(25)) }, - { ItemID.SawtoothShark, Do(TrueMelee, AxePower(45), UseTimeExact(4), TileBoostExact(-1)) }, + { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45), UseTimeExact(4), TileBoostExact(-1)) }, { ItemID.ScytheWhip, autoReuse }, { ItemID.SDMG, pointBlank }, { ItemID.Seedler, Do(DamageRatio(1.5f)) }, @@ -450,8 +451,8 @@ namespace CalamityMod.Items { ItemID.SnowballCannon, pointBlank }, { ItemID.SnowGlobe, nonConsumableBossSummon }, { ItemID.SolarEruption, Do(DamageRatio(1.5f)) }, - { ItemID.SolarFlareChainsaw, trueMelee }, - { ItemID.SolarFlareDrill, Do(TrueMelee, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.SolarFlareChainsaw, trueMeleeNoSpeed }, + { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, { ItemID.SolarFlarePickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.SolarTablet, nonConsumableBossSummon }, // Life Drain could probably get a bigger buff @@ -468,9 +469,9 @@ namespace CalamityMod.Items { ItemID.StakeLauncher, Do(PointBlank, DamageRatio(2f), UseRatio(1.5f)) }, { ItemID.StarCannon, Do(DamageExact(25)) }, { ItemID.StardustCellStaff, Do(UseExact(20)) }, - { ItemID.StardustChainsaw, trueMelee }, + { ItemID.StardustChainsaw, trueMeleeNoSpeed }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, - { ItemID.StardustDrill, Do(TrueMelee, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, { ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.Starfury, autoReuse }, { ItemID.StarWrath, Do(DamageRatio(0.9f)) }, @@ -487,7 +488,7 @@ namespace CalamityMod.Items { ItemID.TempestStaff, Do(UseExact(20)) }, { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, { ItemID.TentacleSpike, autoReuse }, - { ItemID.Terragrim, trueMelee }, + { ItemID.Terragrim, trueMeleeNoSpeed }, { ItemID.Terrarian, Do(AutoReuse, DamageExact(352)) }, { ItemID.TheAxe, Do(HammerPower(100), AxePower(175), UseTimeExact(7), TileBoostExact(+1)) }, { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, @@ -504,8 +505,8 @@ namespace CalamityMod.Items { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, { ItemID.TinPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, { ItemID.TinShortsword, autoReuse }, - { ItemID.TitaniumChainsaw, Do(TrueMelee, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, - { ItemID.TitaniumDrill, Do(TrueMelee, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, + { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) }, + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) }, { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.TitaniumRepeater, Do(PointBlank, UseExact(29), DamageExact(122)) }, { ItemID.TitaniumSword, Do(UseTurn, ScaleRatio(1.5f), UseRatio(0.8f), DamageExact(77)) }, @@ -536,8 +537,8 @@ namespace CalamityMod.Items { ItemID.VenusMagnum, Do(AutoReuse, PointBlank) }, { ItemID.Vilethorn, Do(DamageExact(14)) }, { ItemID.VortexBeater, pointBlank }, - { ItemID.VortexChainsaw, trueMelee }, - { ItemID.VortexDrill, Do(TrueMelee, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, + { ItemID.VortexChainsaw, trueMeleeNoSpeed }, + { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) }, { ItemID.VortexPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, { ItemID.WandofSparking, Do(AutoReuse) }, { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, @@ -1073,10 +1074,17 @@ namespace CalamityMod.Items #region True Melee internal class TrueMeleeRule : IItemTweak { - public bool AppliesTo(Item it) => IsMelee(it); - public void ApplyTweak(Item it) => it.Calamity().trueMelee = true; + public bool AppliesTo(Item it) => true; + public void ApplyTweak(Item it) => it.DamageType = TrueMeleeDamageClass.Instance; } internal static IItemTweak TrueMelee => new TrueMeleeRule(); + + internal class TrueMeleeNoSpeedRule : IItemTweak + { + public bool AppliesTo(Item it) => true; + public void ApplyTweak(Item it) => it.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + } + internal static IItemTweak TrueMeleeNoSpeed => new TrueMeleeNoSpeedRule(); #endregion #region Use Time and Use Animation diff --git a/Items/Dyes/DragonSoulDye.cs b/Items/Dyes/DragonSoulDye.cs index 50cd9b3fef..3896572671 100644 --- a/Items/Dyes/DragonSoulDye.cs +++ b/Items/Dyes/DragonSoulDye.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Dyes { CreateRecipe(2). AddIngredient(ItemID.BottledWater, 2). - AddIngredient(). + AddIngredient(). AddTile(TileID.DyeVat). Register(); } diff --git a/Items/Fishing/FishingRods/RiftReeler.cs b/Items/Fishing/FishingRods/RiftReeler.cs index f3307332a2..4f636e4ab3 100644 --- a/Items/Fishing/FishingRods/RiftReeler.cs +++ b/Items/Fishing/FishingRods/RiftReeler.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void SetStaticDefaults() { SacrificeTotal = 1; + ItemID.Sets.CanFishInLava[Item.type] = true; + DisplayName.SetDefault("Rift Reeler"); Tooltip.SetDefault("Fires three to five lines at once. Can fish in lava.\n" + "The battlefield is a scene of constant chaos.\n" + //Napoleon Bonaparte quote reference diff --git a/Items/Fishing/FishingRods/SlurperPole.cs b/Items/Fishing/FishingRods/SlurperPole.cs index 4d04ac72ed..5ed47350f1 100644 --- a/Items/Fishing/FishingRods/SlurperPole.cs +++ b/Items/Fishing/FishingRods/SlurperPole.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void SetStaticDefaults() { SacrificeTotal = 1; + ItemID.Sets.CanFishInLava[Item.type] = true; + DisplayName.SetDefault("Slurper Pole"); Tooltip.SetDefault("Can fish in lava.\n" + //Charles Spurgeon quote "It is the burning lava of the soul that has a furnace within--a very volcano of grief and sorrow."); diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 3c3715a36e..c49b71b61c 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void SetStaticDefaults() { SacrificeTotal = 1; + ItemID.Sets.CanFishInLava[Item.type] = true; + DisplayName.SetDefault("The Devourer of Cods"); Tooltip.SetDefault("Fires ten lines at once. Line never snaps and can fish from lava.\n" + "The devourer was once just an Eater of Shoals."); diff --git a/Items/LoreItems/KnowledgeAquaticScourge.cs b/Items/LoreItems/KnowledgeAquaticScourge.cs index 4edfa03429..f0acb783b3 100644 --- a/Items/LoreItems/KnowledgeAquaticScourge.cs +++ b/Items/LoreItems/KnowledgeAquaticScourge.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A horror born of pollution and insatiable hunger; based on size alone this was merely a juvenile.\n" + "These scourge creatures are the largest aquatic predators and very rarely do they frequent such shallow waters."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeAstralInfection.cs b/Items/LoreItems/KnowledgeAstralInfection.cs index c02552fad6..58392ff8d7 100644 --- a/Items/LoreItems/KnowledgeAstralInfection.cs +++ b/Items/LoreItems/KnowledgeAstralInfection.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This twisted dreamscape, surrounded by unnatural pillars under a dark and hazy sky.\n" + "Natural law has been upturned. What will you make of it?"); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeAstrumAureus.cs b/Items/LoreItems/KnowledgeAstrumAureus.cs index 5efc6a4093..0a18015e67 100644 --- a/Items/LoreItems/KnowledgeAstrumAureus.cs +++ b/Items/LoreItems/KnowledgeAstrumAureus.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A titanic cyborg infected by a star-borne disease expelled from the belly of an ancient god.\n" + "The destruction of this creature will not prevent the spread of the disease."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeAstrumDeus.cs b/Items/LoreItems/KnowledgeAstrumDeus.cs index 9db7a07146..1f92340013 100644 --- a/Items/LoreItems/KnowledgeAstrumDeus.cs +++ b/Items/LoreItems/KnowledgeAstrumDeus.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("God of the stars and largest vessel for the Astral Infection.\n" + "Though struck down from its place among the stars its remnants have gathered strength, aiming to take its rightful place in the cosmos once more."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeBloodMoon.cs b/Items/LoreItems/KnowledgeBloodMoon.cs index aec28c3eda..2581c748b8 100644 --- a/Items/LoreItems/KnowledgeBloodMoon.cs +++ b/Items/LoreItems/KnowledgeBloodMoon.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("We long ago feared the light of the red moon.\n" + "Many went mad, others died, but a scant few became blessed with a wealth of cosmic understanding."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index ad332a5e04..c7e3ab327a 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("An eye and now a brain.\n" + "Most likely another abomination spawned from this inchoate mass of flesh."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeBrimstoneCrag.cs b/Items/LoreItems/KnowledgeBrimstoneCrag.cs index 55ebc7af12..4179ee79bf 100644 --- a/Items/LoreItems/KnowledgeBrimstoneCrag.cs +++ b/Items/LoreItems/KnowledgeBrimstoneCrag.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Ah... this place.\n" + "The scent of broken promises, pain, and eventual death is heavy in the air..."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.cs b/Items/LoreItems/KnowledgeBrimstoneElemental.cs index 142652787f..a3b0bcbcca 100644 --- a/Items/LoreItems/KnowledgeBrimstoneElemental.cs +++ b/Items/LoreItems/KnowledgeBrimstoneElemental.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The most powerful of the elementals, bent on exacting revenge upon the bloody inferno that demolished her home.\n" + "Finally put to rest, she will suffer no longer from the grief caused by the deaths of her people."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCalamitas.cs b/Items/LoreItems/KnowledgeCalamitas.cs index 2b6a59caff..1e396f2b3b 100644 --- a/Items/LoreItems/KnowledgeCalamitas.cs +++ b/Items/LoreItems/KnowledgeCalamitas.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems "Now that you have defeated her your destiny is clear.\n" + "Come now, face me."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCalamitasClone.cs b/Items/LoreItems/KnowledgeCalamitasClone.cs index 09b6b0030c..cb61ebc0d8 100644 --- a/Items/LoreItems/KnowledgeCalamitasClone.cs +++ b/Items/LoreItems/KnowledgeCalamitasClone.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("You are indeed stronger than I thought.\n" + "Though the bloody inferno still lingers, observing your progress."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCorruption.cs b/Items/LoreItems/KnowledgeCorruption.cs index 0bb5657f51..3da487f82d 100644 --- a/Items/LoreItems/KnowledgeCorruption.cs +++ b/Items/LoreItems/KnowledgeCorruption.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The rotten and forever-deteriorating landscape of infected life, brought upon by a deadly microbe long ago.\n" + "It is rumored that the microbe was created through experimentation by a long-dead race, predating the Terrarians."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCrabulon.cs b/Items/LoreItems/KnowledgeCrabulon.cs index bd6eddfbf6..3c2b230a52 100644 --- a/Items/LoreItems/KnowledgeCrabulon.cs +++ b/Items/LoreItems/KnowledgeCrabulon.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A crab and its mushrooms, a love story.\n" + "It's interesting how creatures can adapt given certain circumstances."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCrimson.cs b/Items/LoreItems/KnowledgeCrimson.cs index edca27ab5c..609ce20e61 100644 --- a/Items/LoreItems/KnowledgeCrimson.cs +++ b/Items/LoreItems/KnowledgeCrimson.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This bloody hell, spawned from a formless mass of flesh that fell from the stars eons ago.\n" + "It is now home to many hideous creatures, spawned from the pumping blood and lurching organs deep within."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeCryogen.cs b/Items/LoreItems/KnowledgeCryogen.cs index b9af18b2eb..92c32936af 100644 --- a/Items/LoreItems/KnowledgeCryogen.cs +++ b/Items/LoreItems/KnowledgeCryogen.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The archmage's prison.\n" + "I am unsure if it has grown weaker over the decades of imprisonment."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeDesertScourge.cs b/Items/LoreItems/KnowledgeDesertScourge.cs index 33562ede84..22df3d9738 100644 --- a/Items/LoreItems/KnowledgeDesertScourge.cs +++ b/Items/LoreItems/KnowledgeDesertScourge.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems "What used to be a majestic beast swimming through the water has now become a dried-up and\n" + "gluttonous husk, constantly on a voracious search for its next meal."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeDestroyer.cs b/Items/LoreItems/KnowledgeDestroyer.cs index b5090d6eb6..fd3af2f635 100644 --- a/Items/LoreItems/KnowledgeDestroyer.cs +++ b/Items/LoreItems/KnowledgeDestroyer.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A machine brought to life by the mighty souls of warriors, and built to excavate massive tunnels in planets to gather resources.\n" + "Could have proven useful if Draedon didn't have an obsession with turning everything into a tool of destruction."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeDevourerofGods.cs b/Items/LoreItems/KnowledgeDevourerofGods.cs index 7725c4883b..0b0b070171 100644 --- a/Items/LoreItems/KnowledgeDevourerofGods.cs +++ b/Items/LoreItems/KnowledgeDevourerofGods.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This serpent’s power to assimilate the abilities and energy of those it consumed is unique in almost all the known cosmos, save for its lesser brethren.\n" + "I would have soon had to eliminate it as a threat had it been given more time and creatures to feast upon."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeDragonfolly.cs b/Items/LoreItems/KnowledgeDragonfolly.cs index beeb6b55e5..1f2440c7fc 100644 --- a/Items/LoreItems/KnowledgeDragonfolly.cs +++ b/Items/LoreItems/KnowledgeDragonfolly.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A failure of twisted scientific ambition; it appears our faulted arrogance over life has shown once more in the results.\n" + "Originally intended to be a clone of the Jungle Dragon, these were left to roam about the jungle, attacking anything in their path."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeDukeFishron.cs b/Items/LoreItems/KnowledgeDukeFishron.cs index 2da1e245cc..1788777652 100644 --- a/Items/LoreItems/KnowledgeDukeFishron.cs +++ b/Items/LoreItems/KnowledgeDukeFishron.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The mutant terror of the sea was once the trusted companion of an old king; he tamed it using its favorite treat.\n" + "Long ago, the creature flew in desperation from the raging bloody inferno consuming its home, ultimately finding its way to the ocean."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.cs b/Items/LoreItems/KnowledgeEaterofWorlds.cs index a0d3508df3..dd07853189 100644 --- a/Items/LoreItems/KnowledgeEaterofWorlds.cs +++ b/Items/LoreItems/KnowledgeEaterofWorlds.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Perhaps it was just a giant worm infected by the microbe, given centuries to feed and grow its festering body.\n" + "Seems likely, given the origins of this place."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeExoMechs.cs b/Items/LoreItems/KnowledgeExoMechs.cs index f790b95795..5643a83498 100644 --- a/Items/LoreItems/KnowledgeExoMechs.cs +++ b/Items/LoreItems/KnowledgeExoMechs.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The fruits of masterful craftsmanship and optimization, created only with the objective to destroy.\n" + "Yet in the end, they achieved little more than the original designs they were derived from."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.cs b/Items/LoreItems/KnowledgeEyeofCthulhu.cs index b886cf0b1c..ce7255eb92 100644 --- a/Items/LoreItems/KnowledgeEyeofCthulhu.cs +++ b/Items/LoreItems/KnowledgeEyeofCthulhu.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("That eye... how peculiar.\n" + "I sensed it watching you more intensely as you grew stronger."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeGolem.cs b/Items/LoreItems/KnowledgeGolem.cs index ec2c4d1afe..ff92743849 100644 --- a/Items/LoreItems/KnowledgeGolem.cs +++ b/Items/LoreItems/KnowledgeGolem.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A primitive construct.\n" + "I admire the lihzahrd race for their ingenuity, though finding faith in such a flawed idol would invariably lead to their downfall."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeHiveMind.cs b/Items/LoreItems/KnowledgeHiveMind.cs index 374670ecaa..135b4ed413 100644 --- a/Items/LoreItems/KnowledgeHiveMind.cs +++ b/Items/LoreItems/KnowledgeHiveMind.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A hive of clustered microbial-infected flesh.\n" + "I do not believe killing it will lessen the corruption here."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeKingSlime.cs b/Items/LoreItems/KnowledgeKingSlime.cs index 586a5e381f..0005ad7239 100644 --- a/Items/LoreItems/KnowledgeKingSlime.cs +++ b/Items/LoreItems/KnowledgeKingSlime.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Only a fool could be caught by this pitiful excuse for a hunter.\n" + "Unfortunately, our world has no shortage of those."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeLeviathanAnahita.cs b/Items/LoreItems/KnowledgeLeviathanAnahita.cs index d5690693a7..a45f3ae590 100644 --- a/Items/LoreItems/KnowledgeLeviathanAnahita.cs +++ b/Items/LoreItems/KnowledgeLeviathanAnahita.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("An odd pair of creatures; one seeking companionship and the other seeking sustenance.\n" + "Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeLunaticCultist.cs b/Items/LoreItems/KnowledgeLunaticCultist.cs index f9fc75146f..7f78c3e167 100644 --- a/Items/LoreItems/KnowledgeLunaticCultist.cs +++ b/Items/LoreItems/KnowledgeLunaticCultist.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems "Someone I once held in such contempt for his actions is now... deceased, his sealing ritual undone... prepare for the end.\n" + "Your impending doom approaches..."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeMechs.cs b/Items/LoreItems/KnowledgeMechs.cs index 7b1010bedd..93ea4300ff 100644 --- a/Items/LoreItems/KnowledgeMechs.cs +++ b/Items/LoreItems/KnowledgeMechs.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I see you have awakened Draedon's old toys.\n" + "Once useful tools turned into savage beasts when their AIs went rogue, a mistake that Draedon failed to rectify in time."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeMoonLord.cs b/Items/LoreItems/KnowledgeMoonLord.cs index 6221b124ee..93ce48f272 100644 --- a/Items/LoreItems/KnowledgeMoonLord.cs +++ b/Items/LoreItems/KnowledgeMoonLord.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems "Had it been fully restored it would have been a force to behold, but what you fought was an empty shell.\n" + "However, that doesn't diminish the immense potential locked within it, released upon its death."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeOcean.cs b/Items/LoreItems/KnowledgeOcean.cs index a7ab0c9244..d69a37420d 100644 --- a/Items/LoreItems/KnowledgeOcean.cs +++ b/Items/LoreItems/KnowledgeOcean.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Take care to not disturb the deep waters of this world.\n" + "You may awaken something more terrifying than death itself."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeOldDuke.cs b/Items/LoreItems/KnowledgeOldDuke.cs index 2b49a4f0c3..7c35c6244d 100644 --- a/Items/LoreItems/KnowledgeOldDuke.cs +++ b/Items/LoreItems/KnowledgeOldDuke.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Strange, to find out that the mutant terror of the seas was not alone in its unique biology.\n" + "Perhaps I was mistaken to classify the creature from its relation to pigrons alone."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index 03305f1db4..5f244100a0 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Perforators and their Hive"); Tooltip.SetDefault("An abomination of comingled flesh, bone, and organ, infested primarily by blood-slurping worms."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs index 19640be2e6..eb0acf7fb5 100644 --- a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs +++ b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A horrific amalgam of steel, flesh, and infection, capable of destroying an entire civilization in just one onslaught.\n" + "Its plague nuke barrage can leave an entire area uninhabitable for months. A shame that it came to this but the plague must be contained."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgePlantera.cs b/Items/LoreItems/KnowledgePlantera.cs index 9333afb3b1..e37a50ff94 100644 --- a/Items/LoreItems/KnowledgePlantera.cs +++ b/Items/LoreItems/KnowledgePlantera.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems "It was used as a vessel to house the spirits of those unfortunate enough to find their way down here.\n" + "I wish you luck in dealing with the fallout."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgePolterghast.cs b/Items/LoreItems/KnowledgePolterghast.cs index 3a3ca2e71f..b7d214a6aa 100644 --- a/Items/LoreItems/KnowledgePolterghast.cs +++ b/Items/LoreItems/KnowledgePolterghast.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A creature born of hatred and anger, formed by countless human souls with all of their energy entirely devoted to consuming others.\n" + "It seems a waste to have had such a potent source of power ravage mindlessly through these empty halls."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeProfanedGuardians.cs b/Items/LoreItems/KnowledgeProfanedGuardians.cs index b6319f35aa..76f21f2971 100644 --- a/Items/LoreItems/KnowledgeProfanedGuardians.cs +++ b/Items/LoreItems/KnowledgeProfanedGuardians.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems "Much like a phoenix from the ashes their deaths are simply a part of their life cycle.\n" + "Many times my forces have had to destroy these beings in search of the Profaned Goddess."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeProvidence.cs b/Items/LoreItems/KnowledgeProvidence.cs index 88850db694..0ca8bac9dd 100644 --- a/Items/LoreItems/KnowledgeProvidence.cs +++ b/Items/LoreItems/KnowledgeProvidence.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A core surrounded by stone and flame, a simple origin and a simple goal.\n" + "What would have become of us had she not been defeated is a frightening concept to consider."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeQueenBee.cs b/Items/LoreItems/KnowledgeQueenBee.cs index 8c77e8b606..2eedd92c3a 100644 --- a/Items/LoreItems/KnowledgeQueenBee.cs +++ b/Items/LoreItems/KnowledgeQueenBee.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Queen Bee"); Tooltip.SetDefault("As crude as the giant insects are they can prove useful in certain situations... given the ability to control them."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeRavager.cs b/Items/LoreItems/KnowledgeRavager.cs index 265c79c049..ec6bbdce88 100644 --- a/Items/LoreItems/KnowledgeRavager.cs +++ b/Items/LoreItems/KnowledgeRavager.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The flesh golem constructed using twisted necromancy during the time of my conquest to counter my unstoppable forces.\n" + "Its creators were slaughtered by it moments after its conception. It is for the best that it has been destroyed."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeSentinels.cs b/Items/LoreItems/KnowledgeSentinels.cs index 5096c765b8..4a06773945 100644 --- a/Items/LoreItems/KnowledgeSentinels.cs +++ b/Items/LoreItems/KnowledgeSentinels.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.LoreItems "Each represent one of the Devourer’s largest spheres of influence.\n" + "Dispatching them has most likely invoked its anger and marked you as a target for destruction."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeSkeletron.cs b/Items/LoreItems/KnowledgeSkeletron.cs index 28219a5a7d..19a543e18d 100644 --- a/Items/LoreItems/KnowledgeSkeletron.cs +++ b/Items/LoreItems/KnowledgeSkeletron.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The curse is said to only affect the elderly.\n" + "After they are afflicted they become an immortal vessel for an ancient demon of the underworld."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.cs b/Items/LoreItems/KnowledgeSkeletronPrime.cs index ebfbc2a1f6..2d9cb716f5 100644 --- a/Items/LoreItems/KnowledgeSkeletronPrime.cs +++ b/Items/LoreItems/KnowledgeSkeletronPrime.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("What a silly and pointless contraption for something created with the essence of pure terror.\n" + "Draedon obviously took several liberties with its design... I am not impressed."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index 77fb6eb5bf..3905f3a6d9 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("It is a travesty, one of the most threatening biological terrors ever created.\n" + "If this creature were allowed to combine every slime on the planet it would become nearly unstoppable."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeSulphurSea.cs b/Items/LoreItems/KnowledgeSulphurSea.cs index a1bc327570..d0de5d2975 100644 --- a/Items/LoreItems/KnowledgeSulphurSea.cs +++ b/Items/LoreItems/KnowledgeSulphurSea.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I remember the serene waves and the clear breeze.\n" + "The bitterness of my youth has long since subsided, but it is far too late. I must never repeat a mistake like this again."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeTwins.cs b/Items/LoreItems/KnowledgeTwins.cs index 1ddf9ac771..72f34effaa 100644 --- a/Items/LoreItems/KnowledgeTwins.cs +++ b/Items/LoreItems/KnowledgeTwins.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The bio-mechanical watchers of the night, originally created as security using the souls extracted from human eyes.\n" + "These creatures did not belong in this world, it's best to be rid of them."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeUnderworld.cs b/Items/LoreItems/KnowledgeUnderworld.cs index c1ad4e85fc..32666d13b8 100644 --- a/Items/LoreItems/KnowledgeUnderworld.cs +++ b/Items/LoreItems/KnowledgeUnderworld.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("These obsidian and hellstone towers were once home to thousands of... 'people'.\n" + "Unfortunately for them, they were twisted by their inner demons until they were beyond saving."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeWallofFlesh.cs b/Items/LoreItems/KnowledgeWallofFlesh.cs index 58e2d2f1da..f06264907a 100644 --- a/Items/LoreItems/KnowledgeWallofFlesh.cs +++ b/Items/LoreItems/KnowledgeWallofFlesh.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems "The unholy amalgamation of flesh and hatred has been defeated.\n" + "Prepare to face the terrors that lurk in the light and dark parts of this world."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeYharon.cs b/Items/LoreItems/KnowledgeYharon.cs index f2dcf02f67..33bdda9fe4 100644 --- a/Items/LoreItems/KnowledgeYharon.cs +++ b/Items/LoreItems/KnowledgeYharon.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I would not be able to bear a world without my faithful companion by my side.\n" + "Fortunately, fate will have it so that it is a world I shall never have to see, for better or for worse."); SacrificeTotal = 1; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 7567a79666..4a04aa9540 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("A catalyst of the highest caliber formed by fusing powerful souls"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index 2d3fd5e7f6..8b16e6b7dc 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Auric Bar"); Tooltip.SetDefault("Godlike power emanates from the metal"); } @@ -70,7 +72,7 @@ namespace CalamityMod.Items.Materials { CreateRecipe(5). AddIngredient(60). - AddIngredient(). + AddIngredient(). AddTile(). Register(); } diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index f69cfae1d6..bf9cea1a89 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Core of Calamity"); } diff --git a/Items/Materials/CoreofChaos.cs b/Items/Materials/CoreofChaos.cs index 7d4d790d92..9ed0a4cc3a 100644 --- a/Items/Materials/CoreofChaos.cs +++ b/Items/Materials/CoreofChaos.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Core of Chaos"); } diff --git a/Items/Materials/CoreofEleum.cs b/Items/Materials/CoreofEleum.cs index dc5f7cb08c..961e3280ac 100644 --- a/Items/Materials/CoreofEleum.cs +++ b/Items/Materials/CoreofEleum.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Core of Eleum"); } diff --git a/Items/Materials/CoreofSunlight.cs b/Items/Materials/CoreofSunlight.cs index 34838ba1ff..ea63c27faa 100644 --- a/Items/Materials/CoreofSunlight.cs +++ b/Items/Materials/CoreofSunlight.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Core of Sunlight"); } diff --git a/Items/Materials/DarkPlasma.cs b/Items/Materials/DarkPlasma.cs index 39190090c7..c23c69a822 100644 --- a/Items/Materials/DarkPlasma.cs +++ b/Items/Materials/DarkPlasma.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Materials DisplayName.SetDefault("Dark Plasma"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index aec057fa24..17d7556767 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("An impacted crystal suffused with opposing celestial energies"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/EndothermicEnergy.cs b/Items/Materials/EndothermicEnergy.cs index 3d324c11d5..1bfdfe973b 100644 --- a/Items/Materials/EndothermicEnergy.cs +++ b/Items/Materials/EndothermicEnergy.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("Its deathly chill sucks the life from its surroundings"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/EssenceofChaos.cs b/Items/Materials/EssenceofChaos.cs index ccd709ff5f..85e1845a76 100644 --- a/Items/Materials/EssenceofChaos.cs +++ b/Items/Materials/EssenceofChaos.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Essence of Chaos"); Tooltip.SetDefault("The essence of chaotic creatures"); } diff --git a/Items/Materials/EssenceofEleum.cs b/Items/Materials/EssenceofEleum.cs index 4c21a91708..20d98de6b0 100644 --- a/Items/Materials/EssenceofEleum.cs +++ b/Items/Materials/EssenceofEleum.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Essence of Eleum"); Tooltip.SetDefault("The essence of cold creatures"); } diff --git a/Items/Materials/EssenceofSunlight.cs b/Items/Materials/EssenceofSunlight.cs index 3ea81ba97c..90ceef9e6f 100644 --- a/Items/Materials/EssenceofSunlight.cs +++ b/Items/Materials/EssenceofSunlight.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Essence of Sunlight"); Tooltip.SetDefault("The essence of sky, light, and storm creatures"); } diff --git a/Items/Materials/GalacticaSingularity.cs b/Items/Materials/GalacticaSingularity.cs index 6f41687769..1db9201030 100644 --- a/Items/Materials/GalacticaSingularity.cs +++ b/Items/Materials/GalacticaSingularity.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("A shard of the cosmos"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 24)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index e9f055cd0f..61fce0a01f 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("May drain your sanity"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/TwistingNether.cs b/Items/Materials/TwistingNether.cs index 0bb1d0bcce..82fa73e6c7 100644 --- a/Items/Materials/TwistingNether.cs +++ b/Items/Materials/TwistingNether.cs @@ -9,6 +9,8 @@ namespace CalamityMod.Items.Materials public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Twisting Nether"); } diff --git a/Items/Materials/UnholyEssence.cs b/Items/Materials/UnholyEssence.cs index e8bb53b035..7948cd0912 100644 --- a/Items/Materials/UnholyEssence.cs +++ b/Items/Materials/UnholyEssence.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Materials Tooltip.SetDefault("The essence of profaned creatures"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ItemNoGravity[Item.type] = true; } public override void SetDefaults() diff --git a/Items/Materials/HellcasterFragment.cs b/Items/Materials/YharonSoulFragment.cs similarity index 84% rename from Items/Materials/HellcasterFragment.cs rename to Items/Materials/YharonSoulFragment.cs index cef78aac4c..5dd1b03b0e 100644 --- a/Items/Materials/HellcasterFragment.cs +++ b/Items/Materials/YharonSoulFragment.cs @@ -1,13 +1,17 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials { - public class HellcasterFragment : ModItem + [LegacyName("HellcasterFragment")] + public class YharonSoulFragment : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 25; + ItemID.Sets.ItemNoGravity[Item.type] = true; + DisplayName.SetDefault("Yharon Soul Fragment"); Tooltip.SetDefault("A shard of a godly soul"); } @@ -26,5 +30,6 @@ namespace CalamityMod.Items.Materials Item.maxStack = 999; Item.value = Item.sellPrice(gold: 45); Item.Calamity().customRarity = CalamityRarity.Violet; - } } + } + } } diff --git a/Items/Materials/HellcasterFragment.png b/Items/Materials/YharonSoulFragment.png similarity index 100% rename from Items/Materials/HellcasterFragment.png rename to Items/Materials/YharonSoulFragment.png diff --git a/Items/PermanentBoosters/Dragonfruit.cs b/Items/PermanentBoosters/Dragonfruit.cs index 225307dbee..c9846e31ec 100644 --- a/Items/PermanentBoosters/Dragonfruit.cs +++ b/Items/PermanentBoosters/Dragonfruit.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.PermanentBoosters AddIngredient(ItemID.LifeFruit, 5). AddIngredient(ItemID.SkyBlueFlower). AddIngredient(ItemID.FragmentSolar, 15). - AddIngredient(2). + AddIngredient(2). AddIngredient(). AddTile(). Register(); diff --git a/Items/Potions/DraconicElixir.cs b/Items/Potions/DraconicElixir.cs index 721db53ce6..2240593167 100644 --- a/Items/Potions/DraconicElixir.cs +++ b/Items/Potions/DraconicElixir.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Potions { CreateRecipe(). AddIngredient(ItemID.BottledWater). - AddIngredient(). + AddIngredient(). AddIngredient(ItemID.Daybloom). AddIngredient(ItemID.Moonglow). AddIngredient(ItemID.Fireblossom). @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Potions CreateRecipe(). AddIngredient(ItemID.BottledWater). AddIngredient(50). - AddIngredient(). + AddIngredient(). AddTile(TileID.AlchemyTable). Register(); } diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index f4aa093f9b..8b57815481 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.pick = 50; Item.axe = 30 / 5; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.width = 36; Item.height = 18; Item.channel = true; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 40f; - Item.Calamity().trueMelee = true; } public override void AddRecipes() diff --git a/Items/TreasureBags/YharonBag.cs b/Items/TreasureBags/YharonBag.cs index a5da3decb1..50ab9ab450 100644 --- a/Items/TreasureBags/YharonBag.cs +++ b/Items/TreasureBags/YharonBag.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.TreasureBags int soulFragMin = 22; int soulFragMax = 28; - DropHelper.DropItem(s, player, ModContent.ItemType(), soulFragMin, soulFragMax); + DropHelper.DropItem(s, player, ModContent.ItemType(), soulFragMin, soulFragMax); // Vanity DropHelper.DropItemChance(s, player, ModContent.ItemType(), 7); diff --git a/Items/VanillaArmorChanges/MoltenArmorSetChange.cs b/Items/VanillaArmorChanges/MoltenArmorSetChange.cs index fd4036f74e..fb505233e8 100644 --- a/Items/VanillaArmorChanges/MoltenArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MoltenArmorSetChange.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; namespace CalamityMod.Items.VanillaArmorChanges @@ -25,6 +25,7 @@ namespace CalamityMod.Items.VanillaArmorChanges { player.fireWalk = true; player.lavaMax += 300; + player.GetDamage() += 0.2f; } } } diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index dd93ac7076..ca63211b48 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -44,10 +44,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.noMelee = true; Item.noUseGraphic = true; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.channel = true; - modItem.trueMelee = true; modItem.UsesCharge = true; modItem.MaxCharge = 85f; modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile. diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index 5187bcc95a..8e990025d3 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic { CreateRecipe(). AddIngredient(ItemID.WandofSparking). - AddIngredient(5). + AddIngredient(5). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index 887ec196a2..8430599204 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 44; Item.damage = 90; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Cyan; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; - Item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 3cc02f2c46..ab6fad4467 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.damage = 58; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index b22adabcad..49d9dfefec 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 66; Item.height = 66; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.Calamity().customRarity = CalamityRarity.Turquoise; Item.Calamity().donorItem = true; - Item.Calamity().trueMelee = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 24f; } diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index 66d8eb6388..d6cabe9ff7 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 62; Item.damage = 65; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index e4aa8ab736..eccc0fd83a 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -60,7 +60,7 @@ Summons a barrage of petals and waterfalls on enemy hits"); AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(4). + AddIngredient(4). AddIngredient(5). AddTile(). Register(); diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index a2aff3d4e9..9028ba7755 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.damage = 1275; Item.knockBack = 7.5f; Item.useAnimation = Item.useTime = 25; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.channel = true; Item.autoReuse = true; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().customRarity = CalamityRarity.Violet; - Item.Calamity().trueMelee = true; } } } diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 38021ba9ff..09007e8fee 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 66; Item.damage = 315; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Purple; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 7740aaaf0d..1dc7bfb254 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 50; Item.damage = 26; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Blue; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index de4fb60d6f..793e4607f4 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 128; Item.width = 56; Item.damage = 3001; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 24f; Item.Calamity().customRarity = CalamityRarity.Violet; Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 14)); - Item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index bd9aa7e21c..4ab17121d4 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 64; Item.damage = 100; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 12; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 24f; Item.rare = ItemRarityID.Yellow; - Item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index 5e4bd492da..07c0040f90 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = Item.height = 40; Item.damage = 2705; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 1f; Item.Calamity().customRarity = CalamityRarity.PureGreen; - Item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults. diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index d4b6a1040f..fd1b23d1c9 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 44; Item.damage = 36; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/VulcaniteLance.cs b/Items/Weapons/Melee/VulcaniteLance.cs index 683a7b59d3..6f59244cfd 100644 --- a/Items/Weapons/Melee/VulcaniteLance.cs +++ b/Items/Weapons/Melee/VulcaniteLance.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 44; Item.damage = 90; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; - Item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index e5093622c9..4a59b0bdeb 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.useAnimation = Item.useTime = 22; Item.noUseGraphic = true; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.noMelee = true; Item.channel = true; Item.autoReuse = true; @@ -48,7 +48,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = ShootSpeed; - Item.Calamity().trueMelee = true; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index 8bbcaf8cc0..ca0c6ce998 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -109,7 +109,7 @@ Right click to fire two devastating barrages of five empowered fireballs. CreateRecipe(). AddIngredient(). AddIngredient(12). - AddIngredient(4). + AddIngredient(4). AddIngredient(5). AddTile(). Register(); diff --git a/Localization/enUS.hjson b/Localization/enUS.hjson index e46d9e906a..c642f38ed7 100644 --- a/Localization/enUS.hjson +++ b/Localization/enUS.hjson @@ -98,8 +98,10 @@ Config: DamageClassName: { - RogueDamageClass: "rogue damage", - AverageDamageClass: "average damage", + AverageDamageClass: "average damage", + RogueDamageClass: "rogue damage", + TrueMeleeDamageClass: "true melee damage", + TrueMeleeNoSpeedDamageClass: "true melee damage", } UI: diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 759f767781..22a541ecf6 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -586,7 +586,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Yharon", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("Yharon found you too weak to stay near your gravestone.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 9796ba90ab..786b4e0d14 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2828,7 +2828,7 @@ namespace CalamityMod.NPCs.Yharon normalOnly.Add(ModContent.ItemType(), 10); // Materials - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 15, 22)); + normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 15, 22)); // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index dc0631ac55..cd7ebf8c6d 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -182,14 +182,14 @@ namespace CalamityMod.UI.CalamitasEnchants "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful", null, player => player.Calamity().farProximityRewardEnchant = true, - item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.Calamity().trueMelee), + item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee()), new Enchantment("Bloodthirsty", "Makes the damage of projectiles vary based on how far the hit target is from you. The closer, the more damage, and vice versa.", 500, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty", null, player => player.Calamity().closeProximityRewardEnchant = true, - item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.Calamity().trueMelee), + item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.IsTrueMelee()), new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use.\nIts damage returns naturally when not being used. It starts off with more damage than it normally would have.", 600, @@ -293,7 +293,7 @@ namespace CalamityMod.UI.CalamitasEnchants CalamityNetcode.NewNPC_ClientSide(player.Center, orbType, player); } }, - item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.CountsAsClass() && !item.Calamity().trueMelee), + item => item.IsEnchantable() && item.damage > 0 && item.shoot > ProjectileID.None && !item.CountsAsClass() && !item.IsTrueMelee()), }; // Special disenchantment thing. This is separated from the list on purpose. diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index e403d4c8f6..afca5d800e 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -7,7 +7,6 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; -using CalamityMod.Items; namespace CalamityMod { @@ -15,13 +14,18 @@ namespace CalamityMod { public static bool IsTrueMelee(this Item item) { - if (item.IsAir) + // Even if you for some reason mark an accessory as true melee, it won't count. + if (item is null || item.IsAir || item.accessory) return false; - - CalamityGlobalItem modItem = item.Calamity(); - return item.CountsAsClass() && (item.shoot == ProjectileID.None || modItem.trueMelee); + return item.CountsAsClass() || item.CountsAsClass(); } - + + /// + /// Determines if a given item is a whip based on what it shoots. + /// + /// The item to check. + public static bool IsWhip(this Item item) => item.shoot > ProjectileID.None && ProjectileID.Sets.IsAWhip[item.shoot]; + #region Item Rarity Utilities internal const int TurquoiseRarityValue = 12; internal static readonly Color TurquoiseRarityColor = new Color(0, 255, 200); @@ -258,15 +262,6 @@ namespace CalamityMod return item.Calamity().AppliedEnchantment.HasValue; } - /// - /// Determines if a given item is a whip based on what it shoots. - /// - /// The item to check. - public static bool IsWhip(this Item item) - { - return item.shoot > ProjectileID.None && ProjectileID.Sets.IsAWhip[item.shoot]; - } - public static Rectangle FixSwingHitbox(float hitboxWidth, float hitboxHeight) { Player player = Main.player[Main.myPlayer]; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 2c555078f1..4b175b4424 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -1,15 +1,14 @@ -using CalamityMod.Balancing; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Balancing; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework; using static Terraria.ModLoader.ModContent; using static Terraria.Player; diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 429338c273..6411b575f3 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -25,6 +25,13 @@ namespace CalamityMod // Is it because of whips? We can make it "IsSummonNotWhip" if needed public static bool IsSummon(this Projectile proj) => proj.minion || proj.sentry || CalamityLists.projectileMinionList.Contains(proj.type) || ProjectileID.Sets.MinionShot[proj.type] || ProjectileID.Sets.SentryShot[proj.type]; + public static bool IsTrueMelee(this Projectile proj) + { + if (proj is null || !proj.active) + return false; + return proj.CountsAsClass() || proj.CountsAsClass(); + } + public static T ModProjectile(this Projectile projectile) where T : ModProjectile { return projectile.ModProjectile as T; From 578751620864c0a663b46555e14102ae8c7585a9 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 18:44:10 -0400 Subject: [PATCH 09/31] Removed all custom damage typing from CalamityGlobalProjectile --- Balancing/BalancingRules.cs | 2 +- CalPlayer/CalamityPlayer.cs | 36 ++--- CalPlayer/CalamityPlayerMiscEffects.cs | 12 +- CalPlayer/CalamityPlayerOnHit.cs | 48 +++---- CalPlayer/Dashes/StatisVoidSashDash.cs | 2 +- Items/Accessories/AmalgamatedBrain.cs | 2 +- Items/Accessories/RottenBrain.cs | 2 +- Items/Accessories/TheAmalgam.cs | 2 +- Items/Accessories/Wings/SoulofCryogen.cs | 2 +- Items/Armor/PlagueReaper/PlagueReaperMask.cs | 2 +- Items/CalamityGlobalItem.cs | 20 +-- Items/Mounts/BUMBLEDOGE.cs | 2 +- Items/Tools/InfernaCutter.cs | 4 +- Items/Weapons/Magic/BelchingSaxophone.cs | 2 +- Items/Weapons/Magic/ClothiersWrath.cs | 2 +- Items/Weapons/Magic/HyphaeRod.cs | 2 +- Items/Weapons/Magic/TheSwarmer.cs | 4 +- Items/Weapons/Magic/WintersFury.cs | 2 +- Items/Weapons/Melee/Floodtide.cs | 2 +- Items/Weapons/Melee/LionHeart.cs | 4 +- Items/Weapons/Melee/PlagueKeeper.cs | 4 +- Items/Weapons/Melee/StellarStriker.cs | 2 +- Items/Weapons/Ranged/BladedgeGreatbow.cs | 2 +- Items/Weapons/Ranged/FirestormCannon.cs | 4 +- Items/Weapons/Ranged/Goobow.cs | 2 +- Items/Weapons/Ranged/SpectralstormCannon.cs | 4 +- Items/Weapons/Ranged/SpectreRifle.cs | 2 +- Items/Weapons/Rogue/Brimblade.cs | 2 +- Projectiles/CalamityGlobalProjectile.cs | 128 +++++------------- Projectiles/CalamityGlobalProjectileTweaks.cs | 37 +++++ .../HydraulicVoltCrasherProjectile.cs | 3 +- .../DraedonsArsenal/PulseDragonProjectile.cs | 2 +- Projectiles/Magic/ArtAttackStar.cs | 2 +- Projectiles/Magic/HolyLaser.cs | 2 +- Projectiles/Magic/IceBarrageMain.cs | 6 +- Projectiles/Magic/InfernadoFriendly.cs | 13 +- Projectiles/Magic/SolarBeam2.cs | 2 +- Projectiles/Magic/SolarElementalBeam.cs | 2 +- Projectiles/Magic/SparklingBeam.cs | 2 +- Projectiles/Melee/DevilsSunriseProj.cs | 5 +- Projectiles/Melee/DragonPowFlail.cs | 2 +- Projectiles/Melee/DragonRageStaff.cs | 5 +- Projectiles/Melee/FallenPaladinsHammerProj.cs | 2 +- Projectiles/Melee/GalaxySmasherHammer.cs | 2 +- Projectiles/Melee/HellionSpike.cs | 2 +- Projectiles/Melee/IceBombFriendly.cs | 6 +- Projectiles/Melee/LaserFountain.cs | 2 +- Projectiles/Melee/LightningThing.cs | 3 +- Projectiles/Melee/MarniteObliteratorProj.cs | 5 +- Projectiles/Melee/MurasamaSlash.cs | 3 +- Projectiles/Melee/OmnibladeSwing.cs | 5 +- .../Melee/PhosphorescentGauntletPunches.cs | 3 +- Projectiles/Melee/Spears/AstralPikeProj.cs | 5 +- Projectiles/Melee/Spears/BrimlanceProj.cs | 3 +- Projectiles/Melee/Spears/DiseasedPikeSpear.cs | 3 +- Projectiles/Melee/Spears/EarthenPikeSpear.cs | 2 +- .../Melee/Spears/GildedProboscisProj.cs | 3 +- .../Spears/HellionFlowerSpearProjectile.cs | 2 +- .../Melee/Spears/MarniteSpearProjectile.cs | 3 +- Projectiles/Melee/Spears/SausageMakerSpear.cs | 3 +- .../Melee/Spears/VulcaniteLanceProj.cs | 5 +- Projectiles/Melee/Spears/YateveoBloomSpear.cs | 3 +- Projectiles/Melee/StellarContemptHammer.cs | 5 +- Projectiles/Melee/TaintedBladeSlasher.cs | 3 +- Projectiles/Melee/VirulentBeeWave.cs | 2 +- Projectiles/Melee/Yoyos/FaultLineYoyo.cs | 2 +- Projectiles/Melee/Yoyos/ObliteratorYoyo.cs | 2 +- Projectiles/Melee/Yoyos/OracleYoyo.cs | 3 - Projectiles/Melee/Yoyos/QuagmireYoyo.cs | 8 +- Projectiles/Melee/Yoyos/SolarFlareYoyo.cs | 4 +- Projectiles/Ranged/BeeRPG.cs | 2 +- Projectiles/Ranged/CorrodedShell.cs | 2 +- Projectiles/Ranged/DragonsBreathRound.cs | 2 +- .../Ranged/FlurrystormCannonShooting.cs | 3 +- Projectiles/Ranged/GoliathRocket.cs | 2 +- Projectiles/Ranged/HiveBomb.cs | 2 +- Projectiles/Ranged/HiveMissile.cs | 2 +- Projectiles/Ranged/HolyFireBulletProj.cs | 2 +- Projectiles/Ranged/NapalmArrowProj.cs | 2 +- Projectiles/Ranged/PlagueArrow.cs | 2 +- Projectiles/Ranged/SporeBomb.cs | 2 +- Projectiles/Ranged/StarfleetMK2Gun.cs | 2 +- Projectiles/Ranged/TitaniumRailgunScope.cs | 2 +- Projectiles/Rogue/AntumbraShardProjectile.cs | 2 +- Projectiles/Rogue/AuroradicalStar.cs | 2 +- Projectiles/Rogue/BloodsoakedCrashax.cs | 2 +- Projectiles/Rogue/BurningStrifeProj.cs | 6 +- Projectiles/Rogue/Crystalline2.cs | 2 +- Projectiles/Rogue/CursedDaggerProj.cs | 2 +- .../Rogue/EpidemicShredderProjectile.cs | 8 +- Projectiles/Rogue/EradicatorProjectile.cs | 2 +- Projectiles/Rogue/FantasyTalismanProj.cs | 2 +- Projectiles/Rogue/FantasyTalismanStealth.cs | 2 +- Projectiles/Rogue/FeatherKnifeProjectile.cs | 4 +- Projectiles/Rogue/FrostyFlareStealth.cs | 2 +- Projectiles/Rogue/GacruxianHome.cs | 2 +- Projectiles/Rogue/GacruxianProj.cs | 2 +- Projectiles/Rogue/GelDartProjectile.cs | 2 +- Projectiles/Rogue/GreenDonkeyKongReference.cs | 4 +- Projectiles/Rogue/IcebreakerHammer.cs | 4 +- Projectiles/Rogue/IchorSpearProj.cs | 2 +- .../Rogue/LeonidProgenitorBombshell.cs | 2 +- Projectiles/Rogue/LionfishProj.cs | 2 +- .../OrichalcumSpikedGemstoneProjectile.cs | 2 +- Projectiles/Rogue/PhantomLanceProj.cs | 2 +- Projectiles/Rogue/PoisonBol.cs | 2 +- Projectiles/Rogue/Prismalline3.cs | 2 +- Projectiles/Rogue/PrismallineProj.cs | 4 +- Projectiles/Rogue/RadiantExplosion.cs | 2 +- Projectiles/Rogue/SandDollarStealth.cs | 2 +- Projectiles/Rogue/SkyStabberProj.cs | 2 +- Projectiles/Rogue/SubductionSlicerProj.cs | 2 +- Projectiles/Rogue/UrchinStingerProj.cs | 2 +- Projectiles/Rogue/ValedictionBoomerang.cs | 2 +- Projectiles/Typeless/DemonshadeRedDevil.cs | 2 +- 115 files changed, 273 insertions(+), 317 deletions(-) create mode 100644 Projectiles/CalamityGlobalProjectileTweaks.cs diff --git a/Balancing/BalancingRules.cs b/Balancing/BalancingRules.cs index a6430ec717..5bf78ca9fd 100644 --- a/Balancing/BalancingRules.cs +++ b/Balancing/BalancingRules.cs @@ -133,7 +133,7 @@ namespace CalamityMod.Balancing public bool AppliesTo(NPC npc, NPCHitContext hitContext) { if (hitContext.DamageSource == DamageSourceType.FriendlyProjectile) - return Main.projectile[hitContext.ProjectileIndex.Value].Calamity().trueMelee; + return Main.projectile[hitContext.ProjectileIndex.Value].IsTrueMelee(); return hitContext.DamageSource == DamageSourceType.TrueMeleeSwing; } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 84e8a78029..e0a99dd410 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2765,10 +2765,10 @@ namespace CalamityMod.CalPlayer offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; int soul = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, 0f, ai1); if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].Calamity().forceClassless = true; + Main.projectile[soul].DamageType = DamageClass.Generic; int soul2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, 0f, ai1); if (soul2.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul2].Calamity().forceClassless = true; + Main.projectile[soul2].DamageType = DamageClass.Generic; } } } @@ -2856,7 +2856,7 @@ namespace CalamityMod.CalPlayer { int mark = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), damage, kBack, Player.whoAmI); if (mark.WithinBounds(Main.maxProjectiles)) - Main.projectile[mark].Calamity().forceClassless = true; + Main.projectile[mark].DamageType = DamageClass.Generic; } } } @@ -2936,7 +2936,7 @@ namespace CalamityMod.CalPlayer Main.projectile[projectileIndex].tileCollide = false; Main.projectile[projectileIndex].localAI[1] = (Main.projectile[projectileIndex].velocity.Y < 0f).ToInt(); if (projectileIndex.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectileIndex].Calamity().forceClassless = true; + Main.projectile[projectileIndex].DamageType = DamageClass.Generic; } // Remove all rage when the special attack is used, and apply the cooldown. @@ -3096,7 +3096,7 @@ namespace CalamityMod.CalPlayer int damage = (int)Player.GetTotalDamage().ApplyTo(20); int bubble = Projectile.NewProjectile(source, new Vector2(Player.position.X, Player.position.Y + (Player.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, 1f, 0f); if (bubble.WithinBounds(Main.maxProjectiles)) - Main.projectile[bubble].Calamity().forceClassless = true; + Main.projectile[bubble].DamageType = DamageClass.Generic; sulphurBubbleCooldown = 20; } } @@ -3771,7 +3771,7 @@ namespace CalamityMod.CalPlayer Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); Main.projectile[lumenyl].frame = Main.rand.Next(0, 4); if (lumenyl.WithinBounds(Main.maxProjectiles)) - Main.projectile[lumenyl].Calamity().forceClassless = true; + Main.projectile[lumenyl].DamageType = DamageClass.Generic; } // TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust @@ -3799,7 +3799,7 @@ namespace CalamityMod.CalPlayer int damage = (int)Player.GetTotalDamage().ApplyTo(2750); int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Player.whoAmI); if (eclipse.WithinBounds(Main.maxProjectiles)) - Main.projectile[eclipse].Calamity().forceClassless = true; + Main.projectile[eclipse].DamageType = DamageClass.Generic; // TODO -- Calamity dodges should probably not send a vanilla dodge packet considering that causes Tabi dust if (Player.whoAmI == Main.myPlayer) @@ -5500,7 +5500,7 @@ namespace CalamityMod.CalPlayer int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.065), knockBack * 0.5f, Player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) - Main.projectile[p].Calamity().forceClassless = true; //in case melee/rogue variants bug out + Main.projectile[p].DamageType = DamageClass.Generic; //in case melee/rogue variants bug out // Handle AI edge-cases. if (item.type == ModContent.ItemType()) @@ -5523,7 +5523,7 @@ namespace CalamityMod.CalPlayer int knife = Projectile.NewProjectile(source, Player.Center, velocity2, ModContent.ProjectileType(), knifeDamage, 0f, Player.whoAmI, knifeCol, 0); if (knife.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife].Calamity().forceClassless = true; + Main.projectile[knife].DamageType = DamageClass.Generic; } } } @@ -5543,7 +5543,7 @@ namespace CalamityMod.CalPlayer if (drop.WithinBounds(Main.maxProjectiles)) { Main.projectile[drop].penetrate = 2; - Main.projectile[drop].Calamity().forceClassless = true; + Main.projectile[drop].DamageType = DamageClass.Generic; } } } @@ -6328,7 +6328,7 @@ namespace CalamityMod.CalPlayer Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.HallowStar, deificStarDamage, 4f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) { - star.Calamity().forceClassless = true; + star.DamageType = DamageClass.Generic; star.usesLocalNPCImmunity = true; star.localNPCHitCooldown = 5; } @@ -6386,12 +6386,12 @@ namespace CalamityMod.CalPlayer if (spark1.WithinBounds(Main.maxProjectiles)) { Main.projectile[spark1].timeLeft = 120; - Main.projectile[spark1].Calamity().forceClassless = true; + Main.projectile[spark1].DamageType = DamageClass.Generic; } if (spark2.WithinBounds(Main.maxProjectiles)) { Main.projectile[spark2].timeLeft = 120; - Main.projectile[spark2].Calamity().forceClassless = true; + Main.projectile[spark2].DamageType = DamageClass.Generic; } } } @@ -6409,7 +6409,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item61, Player.position); int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, Player.whoAmI); if (ink.WithinBounds(Main.maxProjectiles)) - Main.projectile[ink].Calamity().forceClassless = true; + Main.projectile[ink].DamageType = DamageClass.Generic; } } } @@ -6463,9 +6463,9 @@ namespace CalamityMod.CalPlayer int shard = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI, 0f, 0f); int shard2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI, 0f, 0f); if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].Calamity().forceClassless = true; + Main.projectile[shard].DamageType = DamageClass.Generic; if (shard2.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard2].Calamity().forceClassless = true; + Main.projectile[shard2].DamageType = DamageClass.Generic; } } } @@ -6514,7 +6514,7 @@ namespace CalamityMod.CalPlayer Projectile beam = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.ShadowBeamFriendly, shadowbeamDamage, 7f, Player.whoAmI); if (beam.whoAmI.WithinBounds(Main.maxProjectiles)) { - beam.Calamity().forceClassless = true; + beam.DamageType = DamageClass.Generic; beam.usesLocalNPCImmunity = true; beam.localNPCHitCooldown = 10; } @@ -6525,7 +6525,7 @@ namespace CalamityMod.CalPlayer Projectile scythe = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.DemonScythe, scytheDamage, 7f, Player.whoAmI); if (scythe.whoAmI.WithinBounds(Main.maxProjectiles)) { - scythe.Calamity().forceClassless = true; + scythe.DamageType = DamageClass.Generic; scythe.usesLocalNPCImmunity = true; scythe.localNPCHitCooldown = 10; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f323ade63b..2b2e18a4f0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1614,7 +1614,7 @@ namespace CalamityMod.CalPlayer int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f); Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } for (int i = 0; i < 3; i++) @@ -1638,7 +1638,7 @@ namespace CalamityMod.CalPlayer int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType(), damage, 0, Player.whoAmI, 0, 0); Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } for (int i = 0; i < 3; i++) @@ -2902,7 +2902,7 @@ namespace CalamityMod.CalPlayer if (projectile.WithinBounds(Main.maxProjectiles)) { Main.projectile[projectile].originalDamage = 3750; - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } } @@ -3006,7 +3006,7 @@ namespace CalamityMod.CalPlayer int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType(), damage / 2, 0f, Player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) { - Main.projectile[spark].Calamity().forceClassless = true; + Main.projectile[spark].DamageType = DamageClass.Generic; Main.projectile[spark].localNPCHitCooldown = -2; Main.projectile[spark].penetrate = 5; } @@ -3219,7 +3219,7 @@ namespace CalamityMod.CalPlayer Main.projectile[bee].localNPCHitCooldown = 10; Main.projectile[bee].penetrate = 2; if (bee.WithinBounds(Main.maxProjectiles)) - Main.projectile[bee].Calamity().forceClassless = true; + Main.projectile[bee].DamageType = DamageClass.Generic; } } } @@ -3389,7 +3389,7 @@ namespace CalamityMod.CalPlayer int laser = Projectile.NewProjectile(source, startPos, velocity, ModContent.ProjectileType(), dmg, 4f, Player.whoAmI, 0f, 0f); Main.projectile[laser].localNPCHitCooldown = 5; if (laser.WithinBounds(Main.maxProjectiles)) - Main.projectile[laser].Calamity().forceClassless = true; + Main.projectile[laser].DamageType = DamageClass.Generic; } SoundEngine.PlaySound(SoundID.Item12, Player.Center); } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 8984a22f89..a77ac50bca 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -671,7 +671,7 @@ namespace CalamityMod.CalPlayer int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) - star.Calamity().forceClassless = true; + star.DamageType = DamageClass.Generic; } } } @@ -724,7 +724,7 @@ namespace CalamityMod.CalPlayer int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(30); Projectile projectile = CalamityGlobalProjectile.SpawnOrb(proj, seekerDamage, ProjectileType(), 400f, 12f); if (projectile.whoAmI.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile.whoAmI].Calamity().forceClassless = true; + Main.projectile[projectile.whoAmI].DamageType = DamageClass.Generic; } if (theBee && Player.statLife >= Player.statLifeMax2) @@ -760,7 +760,7 @@ namespace CalamityMod.CalPlayer int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) - star.Calamity().forceClassless = true; + star.DamageType = DamageClass.Generic; } } } @@ -783,7 +783,7 @@ namespace CalamityMod.CalPlayer var source = proj.GetSource_FromThis(); Item heldItem = Player.ActiveItem(); - if (modProj.trueMelee) + if (proj.IsTrueMelee()) { titanBoost = 600; if (soaring) @@ -817,7 +817,7 @@ namespace CalamityMod.CalPlayer int geyserDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.15, 36); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), geyserDamage, 0f, Player.whoAmI, 0f, 0f); } - if (bloodflareMelee && modProj.trueMelee && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) + if (bloodflareMelee && proj.IsTrueMelee() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) bloodflareMeleeHits++; } } @@ -848,7 +848,7 @@ namespace CalamityMod.CalPlayer int leaf = Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, leafDamage, 0f, Player.whoAmI); if (leaf.WithinBounds(Main.maxProjectiles)) { - Main.projectile[leaf].Calamity().forceClassless = true; + Main.projectile[leaf].DamageType = DamageClass.Generic; Main.projectile[leaf].netUpdate = true; } } @@ -898,7 +898,7 @@ namespace CalamityMod.CalPlayer int fire = Projectile.NewProjectile(source, position, velocity, ProjectileID.BallofFire, bloodflareFireballDamage, 0f, Player.whoAmI); if (fire.WithinBounds(Main.maxProjectiles)) { - Main.projectile[fire].Calamity().forceClassless = true; + Main.projectile[fire].DamageType = DamageClass.Generic; Main.projectile[fire].netUpdate = true; } } @@ -950,7 +950,7 @@ namespace CalamityMod.CalPlayer int damage = (int)Player.GetTotalDamage().ApplyTo(75); int dagger = Projectile.NewProjectile(source, proj.position, proj.velocity, ProjectileType(), damage, 1f, Player.whoAmI, 0f); if (dagger.WithinBounds(Main.maxProjectiles)) - Main.projectile[dagger].Calamity().forceClassless = true; + Main.projectile[dagger].DamageType = DamageClass.Generic; } } else @@ -1008,7 +1008,7 @@ namespace CalamityMod.CalPlayer int apparatusDamage = (int)Player.GetTotalDamage().ApplyTo(60); int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), apparatusDamage, 4f, proj.owner); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; jellyDmg = 100f; } else if (starbusterCore) @@ -1016,7 +1016,7 @@ namespace CalamityMod.CalPlayer int starburstDamage = (int)Player.GetTotalDamage().ApplyTo(40); int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), starburstDamage, 3.5f, proj.owner); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; jellyDmg = 60f; } else if (nuclearRod) @@ -1024,7 +1024,7 @@ namespace CalamityMod.CalPlayer int nuclearDamage = (int)Player.GetTotalDamage().ApplyTo(20); int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), nuclearDamage, 0f, proj.owner); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; jellyDmg = 60f; } else if (jellyChargedBattery) @@ -1045,7 +1045,7 @@ namespace CalamityMod.CalPlayer int hallowedDamage = (int)Player.GetTotalDamage().ApplyTo(30); int projectile = Projectile.NewProjectile(source, spawnPosition, Vector2.Normalize(position - spawnPosition) * speed, ProjectileType(), hallowedDamage, 3f, proj.owner); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } } @@ -1090,7 +1090,7 @@ namespace CalamityMod.CalPlayer int projectileIndex = Projectile.NewProjectile(spawnSource, projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ProjectileType(), damage, 15f, Main.myPlayer, 16f, 16f); if (projectileIndex.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectileIndex].Calamity().forceClassless = true; + Main.projectile[projectileIndex].DamageType = DamageClass.Generic; Main.projectile[projectileIndex].netUpdate = true; Main.projectile[projectileIndex].localNPCHitCooldown = 10; } @@ -1164,7 +1164,7 @@ namespace CalamityMod.CalPlayer Vector2 velocity = (position - source) / 10f; int flare = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileID.LunarFlare, lunarFlareDamage, lunarFlareKB, proj.owner); if (flare.WithinBounds(Main.maxProjectiles)) - Main.projectile[flare].Calamity().forceClassless = true; + Main.projectile[flare].DamageType = DamageClass.Generic; } } else if (featherCrown) @@ -1178,7 +1178,7 @@ namespace CalamityMod.CalPlayer int featherDamage = (int)Player.GetTotalDamage().ApplyTo(15); int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), featherDamage, 3f, proj.owner); if (feather.WithinBounds(Main.maxProjectiles)) - Main.projectile[feather].Calamity().forceClassless = true; + Main.projectile[feather].DamageType = DamageClass.Generic; } spawnedFeathers = true; } @@ -1196,7 +1196,7 @@ namespace CalamityMod.CalPlayer int damage = (int)Player.GetTotalDamage().ApplyTo(40); int eater = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, xVector, yVector, ProjectileType(), damage, proj.knockBack, proj.owner); if (eater.WithinBounds(Main.maxProjectiles)) - Main.projectile[eater].Calamity().forceClassless = true; + Main.projectile[eater].DamageType = DamageClass.Generic; forbiddenCooldown = 15; } } @@ -1243,7 +1243,7 @@ namespace CalamityMod.CalPlayer float speed = Main.rand.NextFloat(5f, 11f); int cloud = Projectile.NewProjectile(spawnSource, position, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, type, damage, proj.knockBack, Player.whoAmI); if (cloud.WithinBounds(Main.maxProjectiles)) - Main.projectile[cloud].Calamity().forceClassless = true; + Main.projectile[cloud].DamageType = DamageClass.Generic; } } } @@ -1257,14 +1257,14 @@ namespace CalamityMod.CalPlayer Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f); if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].Calamity().forceClassless = true; + Main.projectile[soul].DamageType = DamageClass.Generic; shadowPotCooldown = 30; } if (CalamityLists.spikyBallProjList.Contains(proj.type)) { int scythe = Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), (int)(proj.damage * 0.05), 3f, proj.owner, 1f, 0f); if (scythe.WithinBounds(Main.maxProjectiles)) - Main.projectile[scythe].Calamity().forceClassless = true; + Main.projectile[scythe].DamageType = DamageClass.Generic; Main.projectile[scythe].usesLocalNPCImmunity = true; Main.projectile[scythe].localNPCHitCooldown = 10; Main.projectile[scythe].penetrate = 2; @@ -1277,7 +1277,7 @@ namespace CalamityMod.CalPlayer shardVelocity *= 5f; int shard = Projectile.NewProjectile(spawnSource, proj.Center, shardVelocity, ProjectileType(), (int)(proj.damage * 0.15), 0f, proj.owner); if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].Calamity().forceClassless = true; + Main.projectile[shard].DamageType = DamageClass.Generic; Main.projectile[shard].timeLeft = 150; shadowPotCooldown = 30; } @@ -1287,7 +1287,7 @@ namespace CalamityMod.CalPlayer Projectile ghost = CalamityGlobalProjectile.SpawnOrb(proj, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - ghost.Calamity().forceClassless = true; + ghost.DamageType = DamageClass.Generic; ghost.penetrate = 1; } shadowPotCooldown = 30; @@ -1296,7 +1296,7 @@ namespace CalamityMod.CalPlayer { int blackhole = Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), (int)(proj.damage * 0.05), 3f, proj.owner, 0f, 0f); if (blackhole.WithinBounds(Main.maxProjectiles)) - Main.projectile[blackhole].Calamity().forceClassless = true; + Main.projectile[blackhole].DamageType = DamageClass.Generic; Main.projectile[blackhole].Center = proj.Center; shadowPotCooldown = 30; } @@ -1326,7 +1326,7 @@ namespace CalamityMod.CalPlayer int spark = Projectile.NewProjectile(spawnSource, position, velocity, ProjectileType(), damage, 0f, Player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) { - Main.projectile[spark].Calamity().forceClassless = true; + Main.projectile[spark].DamageType = DamageClass.Generic; Main.projectile[spark].localNPCHitCooldown = -1; } } @@ -1722,7 +1722,7 @@ namespace CalamityMod.CalPlayer } } - if (bloodflareMelee && modProj.trueMelee) + if (bloodflareMelee && proj.IsTrueMelee()) { int healAmount = Main.rand.Next(2) + 1; Player.statLife += healAmount; diff --git a/CalPlayer/Dashes/StatisVoidSashDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs index 4b8b437867..ac3186bb05 100644 --- a/CalPlayer/Dashes/StatisVoidSashDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -56,7 +56,7 @@ namespace CalamityMod.CalPlayer.Dashes int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, Vector2.Zero, ModContent.ProjectileType(), scytheDamage, 5f, player.whoAmI); if (scythe.WithinBounds(Main.maxProjectiles)) { - Main.projectile[scythe].Calamity().forceClassless = true; + Main.projectile[scythe].DamageType = DamageClass.Generic; Main.projectile[scythe].usesIDStaticNPCImmunity = true; Main.projectile[scythe].idStaticNPCHitCooldown = 10; } diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 4d4a9c8118..1598945fb2 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 2f, player.whoAmI); if (rain.whoAmI.WithinBounds(Main.maxProjectiles)) { - rain.Calamity().forceClassless = true; + rain.DamageType = DamageClass.Generic; rain.tileCollide = false; rain.penetrate = 1; } diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 0ea0f5f488..26b5129331 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Accessories Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 2f, player.whoAmI); if (rain.whoAmI.WithinBounds(Main.maxProjectiles)) { - rain.Calamity().forceClassless = true; + rain.DamageType = DamageClass.Generic; rain.tileCollide = false; rain.penetrate = 1; } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 6e7b33f299..ea876ca9d8 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Accessories Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileType(), damage, 2f, player.whoAmI); if (rain.whoAmI.WithinBounds(Main.maxProjectiles)) { - rain.Calamity().forceClassless = true; + rain.DamageType = DamageClass.Generic; rain.tileCollide = false; rain.penetrate = 1; } diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 8d1c827959..686d2e7534 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Accessories.Wings int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), damage, 3f, player.whoAmI, 1f); if (p.WithinBounds(Main.maxProjectiles)) { - Main.projectile[p].Calamity().forceClassless = true; + Main.projectile[p].DamageType = DamageClass.Generic; Main.projectile[p].frame = Main.rand.Next(5); } modPlayer.icicleCooldown = 10; diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index 2fa3b9f84f..5f22ddae7f 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper var damage = (int)player.GetTotalDamage().ApplyTo(40); var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) - cinder.Calamity().forceClassless = true; + cinder.DamageType = DamageClass.Generic; } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index e584afe592..dcac072e2d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -266,7 +266,7 @@ namespace CalamityMod.Items { int projectile = Projectile.NewProjectile(source, position, velocity * 0.5f, ModContent.ProjectileType(), (int)meleeDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } else if (item.CountsAsClass()) @@ -276,7 +276,7 @@ namespace CalamityMod.Items { int projectile = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)throwingDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } else if (item.CountsAsClass()) @@ -292,7 +292,7 @@ namespace CalamityMod.Items { int projectile = Projectile.NewProjectile(source, position, velocity * 1.5f, ModContent.ProjectileType(), (int)rangedDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } } @@ -303,7 +303,7 @@ namespace CalamityMod.Items { int projectile = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)magicDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } else if (item.CountsAsClass() && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) @@ -313,7 +313,7 @@ namespace CalamityMod.Items int projectile = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; Main.projectile[projectile].originalDamage = item.damage; } } @@ -367,7 +367,7 @@ namespace CalamityMod.Items yDiff *= speed; int projectile = Projectile.NewProjectile(source, position, new Vector2(xDiff, yDiff), ProjectileID.Leaf, leafDamage, knockBack, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } } @@ -449,7 +449,7 @@ namespace CalamityMod.Items { int projectile = Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), newDamage, 2f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } } @@ -466,7 +466,7 @@ namespace CalamityMod.Items Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); int rocket = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), (int)(damage * 0.25), 2f, player.whoAmI); if (rocket.WithinBounds(Main.maxProjectiles)) - Main.projectile[rocket].Calamity().forceClassless = true; + Main.projectile[rocket].DamageType = DamageClass.Generic; } } } @@ -485,7 +485,7 @@ namespace CalamityMod.Items { Main.projectile[feather].usesLocalNPCImmunity = true; Main.projectile[feather].localNPCHitCooldown = 10; - Main.projectile[feather].Calamity().forceClassless = true; + Main.projectile[feather].DamageType = DamageClass.Generic; } } } @@ -1392,7 +1392,7 @@ namespace CalamityMod.Items int p = Projectile.NewProjectile(source, player.Center, Vector2.UnitY * 2f, ProjectileID.OrnamentFriendly, ornamentDamage, 5f, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) { - Main.projectile[p].Calamity().forceClassless = true; + Main.projectile[p].DamageType = DamageClass.Generic; Main.projectile[p].Calamity().lineColor = 1; modPlayer.icicleCooldown = 10; } diff --git a/Items/Mounts/BUMBLEDOGE.cs b/Items/Mounts/BUMBLEDOGE.cs index b28a0dc4db..8c16461fe9 100644 --- a/Items/Mounts/BUMBLEDOGE.cs +++ b/Items/Mounts/BUMBLEDOGE.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Mounts float kb = 1f; Projectile birb = Projectile.NewProjectileDirect(new EntitySource_Parent(player), pos, vel, ModContent.ProjectileType(), damage, kb, player.whoAmI); if (birb.whoAmI.WithinBounds(Main.maxProjectiles)) - birb.Calamity().forceClassless = true; + birb.DamageType = DamageClass.Generic; } } } diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index 3229f7f52f..3f1ce709db 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Items.Tools int damage = (int)player.GetTotalDamage().ApplyTo(Item.damage * 0.2f); int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) - Main.projectile[spark].Calamity().forceMelee = true; + Main.projectile[spark].DamageType = DamageClass.Melee; } } if (Main.rand.NextBool(4)) @@ -142,7 +142,7 @@ namespace CalamityMod.Items.Tools var source = player.GetSource_ItemUse(Item); int boom = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) - Main.projectile[boom].Calamity().forceMelee = true; + Main.projectile[boom].DamageType = DamageClass.Melee; } target.AddBuff(BuffID.OnFire, 300); target.AddBuff(ModContent.BuffType(), 150); diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index 3d1879e98c..f2037aefb5 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Magic int note = Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 0.75f, velocity.Y * 0.75f, noteProj, (int)(damage * 0.75), knockback, player.whoAmI); if (note.WithinBounds(Main.maxProjectiles)) { - Main.projectile[note].Calamity().forceMagic = true; //why are these notes also internally ranged + Main.projectile[note].DamageType = DamageClass.Magic; //why are these notes also internally ranged Main.projectile[note].usesLocalNPCImmunity = true; Main.projectile[note].localNPCHitCooldown = 10; } diff --git a/Items/Weapons/Magic/ClothiersWrath.cs b/Items/Weapons/Magic/ClothiersWrath.cs index 16622768fa..167ca07d14 100644 --- a/Items/Weapons/Magic/ClothiersWrath.cs +++ b/Items/Weapons/Magic/ClothiersWrath.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); int proj = Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].DamageType = DamageClass.Magic; } return false; } diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index ffcbdb5c8e..1c554d25e8 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Weapons.Magic int proj = Projectile.NewProjectile(projSource, source, spawnVec, type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(3)); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].DamageType = DamageClass.Magic; Main.projectile[proj].timeLeft = CalamityUtils.SecondsToFrames(3f); } } diff --git a/Items/Weapons/Magic/TheSwarmer.cs b/Items/Weapons/Magic/TheSwarmer.cs index e75b0a2e98..efadfcb933 100644 --- a/Items/Weapons/Magic/TheSwarmer.cs +++ b/Items/Weapons/Magic/TheSwarmer.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic if (wasps.WithinBounds(Main.maxProjectiles)) { Main.projectile[wasps].penetrate = 1; - Main.projectile[wasps].Calamity().forceMagic = true; + Main.projectile[wasps].DamageType = DamageClass.Magic; } } for (int i = 0; i <= 3; i++) @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic if (bees.WithinBounds(Main.maxProjectiles)) { Main.projectile[bees].penetrate = 1; - Main.projectile[bees].Calamity().forceMagic = true; + Main.projectile[bees].DamageType = DamageClass.Magic; } } return false; diff --git a/Items/Weapons/Magic/WintersFury.cs b/Items/Weapons/Magic/WintersFury.cs index efd57c4353..75f9eadb38 100644 --- a/Items/Weapons/Magic/WintersFury.cs +++ b/Items/Weapons/Magic/WintersFury.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Magic speed.Y -= Math.Abs(speed.X) * 0.2f; int p = Projectile.NewProjectile(source, position, speed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) - Main.projectile[p].Calamity().forceMagic = true; + Main.projectile[p].DamageType = DamageClass.Magic; } if (Main.rand.NextBool(4)) { diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index 1a9dc102e1..4280dab996 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee float SpeedY = velocity.Y + (float)Main.rand.Next(-20, 21) * 0.05f; int proj = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } return false; } diff --git a/Items/Weapons/Melee/LionHeart.cs b/Items/Weapons/Melee/LionHeart.cs index bdbee8213d..775d800f98 100644 --- a/Items/Weapons/Melee/LionHeart.cs +++ b/Items/Weapons/Melee/LionHeart.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Melee int explosion = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (explosion.WithinBounds(Main.maxProjectiles)) - Main.projectile[explosion].Calamity().forceMelee = true; + Main.projectile[explosion].DamageType = DamageClass.Melee; } public override void OnHitPvp(Player player, Player target, int damage, bool crit) @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Melee int explosion = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, Item.knockBack, player.whoAmI); if (explosion.WithinBounds(Main.maxProjectiles)) - Main.projectile[explosion].Calamity().forceMelee = true; + Main.projectile[explosion].DamageType = DamageClass.Melee; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/PlagueKeeper.cs b/Items/Weapons/Melee/PlagueKeeper.cs index b6b07b7157..4438d5d633 100644 --- a/Items/Weapons/Melee/PlagueKeeper.cs +++ b/Items/Weapons/Melee/PlagueKeeper.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 1; - Main.projectile[bee].Calamity().forceMelee = true; + Main.projectile[bee].DamageType = DamageClass.Melee; } } } @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 1; - Main.projectile[bee].Calamity().forceMelee = true; + Main.projectile[bee].DamageType = DamageClass.Melee; } } } diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 67abfcb04d..39df5d21b8 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Items.Weapons.Melee float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; int proj = Projectile.NewProjectile(source, vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(damage * 0.5), knockback, i, 0f, (float)Main.rand.Next(3)); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeGreatbow.cs index e804e8cd2c..9295b948c7 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeGreatbow.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Ranged } int projectile = Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X, velocity.Y, ProjectileID.Leaf, damage / 2, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceRanged = true; + Main.projectile[projectile].DamageType = DamageClass.Ranged; } return false; } diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 3ef8b63581..b5327ef9fd 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Main.projectile[flare].penetrate = 1; Main.projectile[flare].timeLeft = 600; - Main.projectile[flare].Calamity().forceRanged = true; + Main.projectile[flare].DamageType = DamageClass.Ranged; } } return false; @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Weapons.Ranged int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); if (flare.WithinBounds(Main.maxProjectiles)) { - Main.projectile[flare].Calamity().forceRanged = true; + Main.projectile[flare].DamageType = DamageClass.Ranged; Main.projectile[flare].timeLeft = 200; Main.projectile[flare].penetrate = 3; } diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 9039543e86..fa0a53d898 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged int index = Projectile.NewProjectile(spawnSource, source + offset, velocity * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI); if (index.WithinBounds(Main.maxProjectiles)) { - Main.projectile[index].Calamity().forceRanged = true; + Main.projectile[index].DamageType = DamageClass.Ranged; Main.projectile[index].usesLocalNPCImmunity = true; Main.projectile[index].localNPCHitCooldown = 10; } diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index c281c3520b..b6f7e2e6ab 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (flare.WithinBounds(Main.maxProjectiles)) { Main.projectile[flare].timeLeft = 200; - Main.projectile[flare].Calamity().forceRanged = true; + Main.projectile[flare].DamageType = DamageClass.Ranged; } float SpeedX2 = velocity.X + (float)Main.rand.Next(-20, 21) * 0.05f; @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (soul.WithinBounds(Main.maxProjectiles)) { Main.projectile[soul].timeLeft = 600; - Main.projectile[soul].Calamity().forceRanged = true; + Main.projectile[soul].DamageType = DamageClass.Ranged; Main.projectile[soul].frame = Main.rand.Next(4); } return false; diff --git a/Items/Weapons/Ranged/SpectreRifle.cs b/Items/Weapons/Ranged/SpectreRifle.cs index a9b722bd5e..bf08a74b53 100644 --- a/Items/Weapons/Ranged/SpectreRifle.cs +++ b/Items/Weapons/Ranged/SpectreRifle.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (type == ProjectileID.Bullet) { int proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ProjectileID.LostSoulFriendly, damage, knockback, player.whoAmI, 2f, 0f); - Main.projectile[proj].Calamity().forceRanged = true; + Main.projectile[proj].DamageType = DamageClass.Ranged; Main.projectile[proj].extraUpdates += 2; } else diff --git a/Items/Weapons/Rogue/Brimblade.cs b/Items/Weapons/Rogue/Brimblade.cs index c07f7fbc7a..8e5cfd0fc2 100644 --- a/Items/Weapons/Rogue/Brimblade.cs +++ b/Items/Weapons/Rogue/Brimblade.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); int dart = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), damage, knockback * 0.5f, player.whoAmI); if (dart.WithinBounds(Main.maxProjectiles)) - Main.projectile[dart].Calamity().forceRogue = true; + Main.projectile[dart].DamageType = RogueDamageClass.Instance; } return false; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 4028a2c52c..073589f308 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1,6 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; +using CalamityMod.EntitySources; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.NPCs; @@ -14,23 +17,20 @@ using CalamityMod.Projectiles.VanillaProjectileOverrides; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities; using Terraria.WorldBuilding; using static Terraria.ModLoader.ModContent; using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.DataStructures; -using CalamityMod.EntitySources; namespace CalamityMod.Projectiles { - public class CalamityGlobalProjectile : GlobalProjectile + public partial class CalamityGlobalProjectile : GlobalProjectile { public override bool InstancePerEntity { @@ -40,18 +40,6 @@ namespace CalamityMod.Projectiles } } - // Class Types - public bool trueMelee = false; - - // Force Class Types - public bool forceMelee = false; - public bool forceRanged = false; - public bool forceMagic = false; - public bool forceMinion = false; - public bool forceRogue = false; - public bool forceClassless = false; - public bool forceHostile = false; - // Source variables. public bool CreatedByPlayerDash = false; @@ -145,6 +133,7 @@ namespace CalamityMod.Projectiles { switch (projectile.type) { + // True melee with speed case ProjectileID.Spear: case ProjectileID.Trident: case ProjectileID.TheRottedFork: @@ -159,6 +148,13 @@ namespace CalamityMod.Projectiles case ProjectileID.MushroomSpear: case ProjectileID.Gungnir: case ProjectileID.ObsidianSwordfish: + case ProjectileID.JoustingLance: + case ProjectileID.HallowJoustingLance: + case ProjectileID.ShadowJoustingLance: + projectile.DamageType = TrueMeleeDamageClass.Instance; + break; + + // True melee without speed case ProjectileID.CobaltDrill: case ProjectileID.MythrilDrill: case ProjectileID.AdamantiteDrill: @@ -166,6 +162,11 @@ namespace CalamityMod.Projectiles case ProjectileID.OrichalcumDrill: case ProjectileID.TitaniumDrill: case ProjectileID.ChlorophyteDrill: + case ProjectileID.SolarFlareDrill: + case ProjectileID.VortexDrill: + case ProjectileID.NebulaDrill: + case ProjectileID.StardustDrill: + case ProjectileID.SawtoothShark: case ProjectileID.CobaltChainsaw: case ProjectileID.MythrilChainsaw: case ProjectileID.AdamantiteChainsaw: @@ -173,23 +174,16 @@ namespace CalamityMod.Projectiles case ProjectileID.OrichalcumChainsaw: case ProjectileID.TitaniumChainsaw: case ProjectileID.ChlorophyteChainsaw: - case ProjectileID.VortexDrill: case ProjectileID.VortexChainsaw: - case ProjectileID.NebulaDrill: case ProjectileID.NebulaChainsaw: - case ProjectileID.SolarFlareDrill: case ProjectileID.SolarFlareChainsaw: - case ProjectileID.StardustDrill: case ProjectileID.StardustChainsaw: - case ProjectileID.Hamdrax: + case ProjectileID.Hamdrax: // Drax case ProjectileID.ChlorophyteJackhammer: - case ProjectileID.SawtoothShark: - case ProjectileID.JoustingLance: - case ProjectileID.HallowJoustingLance: - case ProjectileID.ShadowJoustingLance: - trueMelee = true; + projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; break; + // Point blank vanilla projectiles case ProjectileID.BulletHighVelocity: case ProjectileID.ChlorophyteBullet: case ProjectileID.WoodenArrowFriendly: @@ -298,12 +292,12 @@ namespace CalamityMod.Projectiles case ProjectileID.Arkhalis: case ProjectileID.Terragrim: case ProjectileID.ButchersChainsaw: - trueMelee = true; + projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; projectile.scale = 1.5f; break; case ProjectileID.MonkStaffT1: - trueMelee = true; + projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; projectile.scale = 3f; break; @@ -329,7 +323,7 @@ namespace CalamityMod.Projectiles break; case ProjectileID.MonkStaffT2: - trueMelee = true; + projectile.DamageType = TrueMeleeDamageClass.Instance; projectile.idStaticNPCHitCooldown = 18; break; @@ -2241,56 +2235,6 @@ namespace CalamityMod.Projectiles projectile.damage = defDamage + 15; } - #region Type Forcing - if (forceMelee) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.DamageType = DamageClass.Melee; - projectile.minion = false; - } - else if (forceRanged) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.DamageType = DamageClass.Ranged; - projectile.minion = false; - } - else if (forceMagic) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.DamageType = DamageClass.Magic; - projectile.minion = false; - } - else if (forceMinion) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.minion = true; - } - else if (forceRogue) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.DamageType = RogueDamageClass.Instance; - projectile.minion = false; - } - else if (forceClassless) - { - projectile.hostile = false; - projectile.friendly = true; - projectile.DamageType = DamageClass.Generic; - projectile.minion = false; - } - else if (forceHostile) - { - projectile.hostile = true; - projectile.friendly = false; - projectile.minion = false; - } - #endregion - if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee) { if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 @@ -2344,7 +2288,7 @@ namespace CalamityMod.Projectiles if (!projectile.npcProj && !projectile.trap && projectile.friendly && projectile.damage > 0) { - if (modPlayer.fungalSymbiote && trueMelee) + if (modPlayer.fungalSymbiote && projectile.IsTrueMelee()) { if (Main.player[projectile.owner].miscCounter % 6 == 0 && projectile.FinalExtraUpdate()) { @@ -2397,7 +2341,7 @@ namespace CalamityMod.Projectiles int damage = (int)player.GetTotalDamage().ApplyTo(45); int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceClassless = true; + Main.projectile[proj].DamageType = DamageClass.Generic; } } } @@ -2412,7 +2356,7 @@ namespace CalamityMod.Projectiles int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceClassless = true; + Main.projectile[proj].DamageType = DamageClass.Generic; } } } @@ -2430,7 +2374,7 @@ namespace CalamityMod.Projectiles Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int shard = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileID.CrystalShard, crystalDamage, 0f, projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].Calamity().forceClassless = true; + Main.projectile[shard].DamageType = DamageClass.Generic; } } } @@ -2831,7 +2775,7 @@ namespace CalamityMod.Projectiles int soul = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileType(), damage, 0f, projectile.owner); Main.projectile[soul].tileCollide = false; if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].Calamity().forceClassless = true; + Main.projectile[soul].DamageType = DamageClass.Generic; } } @@ -2841,7 +2785,7 @@ namespace CalamityMod.Projectiles int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); Main.projectile[spike].frame = 4; if (spike.WithinBounds(Main.maxProjectiles)) - Main.projectile[spike].Calamity().forceClassless = true; + Main.projectile[spike].DamageType = DamageClass.Generic; } } @@ -3047,7 +2991,7 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileType()) if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].Calamity().forceRogue = true; + Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; } } @@ -3067,11 +3011,11 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].Calamity().forceMelee = true; + Main.projectile[projectile2].DamageType = DamageClass.Melee; if (projectile.type == ProjectileType()) if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].Calamity().forceRogue = true; + Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs new file mode 100644 index 0000000000..8eceff8898 --- /dev/null +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.CalPlayer; +using CalamityMod.EntitySources; +using CalamityMod.Events; +using CalamityMod.Items.Accessories; +using CalamityMod.NPCs; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.VanillaProjectileOverrides; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Utilities; +using Terraria.WorldBuilding; +using static Terraria.ModLoader.ModContent; +using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech; + +namespace CalamityMod.Projectiles +{ + public partial class CalamityGlobalProjectile : GlobalProjectile + { + + } +} diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 1e5f01891d..8157ccfd43 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -29,9 +29,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.tileCollide = false; Projectile.hide = true; Projectile.ownerHitCheck = true; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.scale = 1.75f; - Projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs index 9db68f14c6..57564a8188 100644 --- a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs +++ b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile field = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileID.Electrosphere, Projectile.damage, Projectile.knockBack, Projectile.owner); if (field.whoAmI.WithinBounds(Main.maxProjectiles)) { - field.Calamity().forceMelee = true; + field.DamageType = DamageClass.Melee; field.usesLocalNPCImmunity = true; field.localNPCHitCooldown = 3; field.timeLeft = 12; diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index f5355f7140..1b92eb405b 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -206,7 +206,7 @@ namespace CalamityMod.Projectiles.Magic { int strike = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.npc[i].Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Projectile.owner, i); if (Main.projectile.IndexInRange(strike)) - Main.projectile[strike].Calamity().forceMelee = true; + Main.projectile[strike].DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Magic/HolyLaser.cs b/Projectiles/Magic/HolyLaser.cs index b2e285b838..6b5154976c 100644 --- a/Projectiles/Magic/HolyLaser.cs +++ b/Projectiles/Magic/HolyLaser.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].DamageType = DamageClass.Magic; } } } diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index 042b386be4..331033a269 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -131,8 +131,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 projspeed = new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f)); int ice = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, projspeed, ProjectileID.NorthPoleSnowflake, (int)(Projectile.damage * 0.05f), 2f, Projectile.owner, 0f, (float)Main.rand.Next(3)); Main.projectile[ice].timeLeft = 600; - // Main.projectile[ice].melee = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - Main.projectile[ice].Calamity().forceMagic = true; + Main.projectile[ice].DamageType = DamageClass.Magic; } Projectile.width = pwidth; Projectile.height = pheight; @@ -159,8 +158,7 @@ namespace CalamityMod.Projectiles.Magic if (ice.WithinBounds(Main.maxProjectiles)) { Main.projectile[ice].timeLeft = 600; - // Main.projectile[ice].melee = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - Main.projectile[ice].Calamity().forceMagic = true; + Main.projectile[ice].DamageType = DamageClass.Magic; } Projectile.ai[1] = 0f; } diff --git a/Projectiles/Magic/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs index 931d3b5731..c20a315b5b 100644 --- a/Projectiles/Magic/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -99,15 +99,14 @@ namespace CalamityMod.Projectiles.Magic center.Y -= baseHeight * num618 / 2f; center.Y += 2f; Projectile segment = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 10f, Projectile.ai[1] - 1f); - //Defaults to magic + + // The projectile defaults to magic, but each sub-segment copies the damage class of the previous. + // Truly a worm boss of weapons. if (segment.whoAmI.WithinBounds(Main.maxProjectiles)) { - segment.Calamity().forceMelee = Projectile.Calamity().forceMelee; - segment.Calamity().forceRanged = Projectile.Calamity().forceRanged; - segment.Calamity().forceMinion = Projectile.Calamity().forceMinion; - segment.Calamity().forceRogue = Projectile.Calamity().forceRogue; - segment.Calamity().forceClassless = Projectile.Calamity().forceClassless; - segment.Calamity().forceHostile = Projectile.Calamity().forceHostile; + segment.DamageType = Projectile.DamageType; + segment.friendly = Projectile.friendly; + segment.hostile = Projectile.hostile; } } if (Projectile.ai[0] <= 0f) diff --git a/Projectiles/Magic/SolarBeam2.cs b/Projectiles/Magic/SolarBeam2.cs index 80f1bc59f1..c726917077 100644 --- a/Projectiles/Magic/SolarBeam2.cs +++ b/Projectiles/Magic/SolarBeam2.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Magic { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].DamageType = DamageClass.Magic; } } } diff --git a/Projectiles/Magic/SolarElementalBeam.cs b/Projectiles/Magic/SolarElementalBeam.cs index 571e8f9183..8e4814c0a2 100644 --- a/Projectiles/Magic/SolarElementalBeam.cs +++ b/Projectiles/Magic/SolarElementalBeam.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Magic int type = ModContent.ProjectileType(); int boomDamage = (int)(damage * 1.1); int boom = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, type, boomDamage, knockback, Projectile.owner, 0f, Main.rand.NextFloat(0.85f, 2f)); - Main.projectile[boom].Calamity().forceMagic = true; + Main.projectile[boom].DamageType = DamageClass.Magic; } } } diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs index 3aeb96286f..17623e04f7 100644 --- a/Projectiles/Magic/SparklingBeam.cs +++ b/Projectiles/Magic/SparklingBeam.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, velocity, ModContent.ProjectileType(), shardDamage, 0f, Projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].Calamity().forceMagic = true; + Main.projectile[shard].DamageType = DamageClass.Magic; } } } diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 91dd389492..9c0711df2f 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -26,11 +26,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; - Projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index d001b2eb66..4468261513 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -188,7 +188,7 @@ namespace CalamityMod.Projectiles.Melee Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 1000f, 1400f, 80f, 900f, Main.rand.NextFloat(DragonPow.MinPetalSpeed, DragonPow.MaxPetalSpeed), type, petalDamage, petalKB, Projectile.owner); if (petal.whoAmI.WithinBounds(Main.maxProjectiles)) { - petal.Calamity().forceMelee = true; + petal.DamageType = DamageClass.Melee; petal.rotation = angle; petal.usesLocalNPCImmunity = true; petal.localNPCHitCooldown = -1; diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index e47fe501de..bab3baa12f 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.width = Projectile.height = 408; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.friendly = true; Projectile.penetrate = -1; Projectile.timeLeft = 90000; @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.hide = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; - Projectile.Calamity().trueMelee = true; } public override void AI() @@ -167,7 +166,7 @@ namespace CalamityMod.Projectiles.Melee } int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } diff --git a/Projectiles/Melee/FallenPaladinsHammerProj.cs b/Projectiles/Melee/FallenPaladinsHammerProj.cs index 645e59d2a4..f2683533c6 100644 --- a/Projectiles/Melee/FallenPaladinsHammerProj.cs +++ b/Projectiles/Melee/FallenPaladinsHammerProj.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index 5fc0e06ff3..b78013aa3d 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -202,7 +202,7 @@ namespace CalamityMod.Projectiles.Melee int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPoint, velocity, laserID, laserDamage, laserKB, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft = 30; } diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index ef5922950e..7b40a15f2e 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, true); if (petal.whoAmI.WithinBounds(Main.maxProjectiles)) { - petal.Calamity().forceMelee = true; + petal.DamageType = DamageClass.Melee; petal.localNPCHitCooldown = -1; } } diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index b25480d978..575dc72828 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -107,13 +107,13 @@ namespace CalamityMod.Projectiles.Melee int projectile1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); if (projectile1.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile1].Calamity().forceMelee = true; + Main.projectile[projectile1].DamageType = DamageClass.Melee; Main.projectile[projectile1].penetrate = 2; } int projectile2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); if (projectile2.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile2].Calamity().forceMelee = true; + Main.projectile[projectile2].DamageType = DamageClass.Melee; Main.projectile[projectile2].penetrate = 2; } } diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs index 6d4064cbb2..d48f8b3260 100644 --- a/Projectiles/Melee/LaserFountain.cs +++ b/Projectiles/Melee/LaserFountain.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee int projectile1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, Projectile.knockBack, Projectile.owner, 0f, 0f); if (projectile1.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile1].Calamity().forceMelee = true; + Main.projectile[projectile1].DamageType = DamageClass.Melee; Main.projectile[projectile1].aiStyle = 1; } } diff --git a/Projectiles/Melee/LightningThing.cs b/Projectiles/Melee/LightningThing.cs index 4b77a5f165..124a58eb17 100644 --- a/Projectiles/Melee/LightningThing.cs +++ b/Projectiles/Melee/LightningThing.cs @@ -34,11 +34,12 @@ namespace CalamityMod.Projectiles.Melee { Main.projectile[idx].usesLocalNPCImmunity = true; Main.projectile[idx].localNPCHitCooldown = GaelsGreatsword.ImmunityFrames; + // TODO -- Ozzatron 2JUL2022: what is this? Removing forceMelee, hope it doesn't break... // In death mode (and under a few other select conditions), the lightning has a PreAI return false in global projectile // So forceMelee won't work unless the projectile is friendly (because a friendly exception was added) Main.projectile[idx].friendly = true; Main.projectile[idx].hostile = false; - Main.projectile[idx].Calamity().forceMelee = true; + Main.projectile[idx].DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index 4126b7d9ad..c6d2c64a58 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class MarniteObliteratorProj : ModProjectile @@ -18,8 +18,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.hide = true; Projectile.ownerHitCheck = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.Calamity().trueMelee = true; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; } } } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index e11932b495..c380ca1ecb 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -41,12 +41,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.ownerHitCheck = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 21; Projectile.frameCounter = 0; - Projectile.Calamity().trueMelee = true; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index 7aefd9fbad..dc3a0930bd 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -24,11 +24,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.ownerHitCheck = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 3; - Projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs index 7157a13db1..95835bbdf1 100644 --- a/Projectiles/Melee/PhosphorescentGauntletPunches.cs +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -41,12 +41,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.penetrate = -1; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 12; Projectile.frameCounter = 0; - Projectile.Calamity().trueMelee = true; } #region AI diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index 0ff064bad8..711e47c073 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 40; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether projectile is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 40; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; @@ -53,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile star = CalamityUtils.ProjectileBarrage(source, Projectile.Center, target.Center, Main.rand.NextBool(), 800f, 800f, 800f, 800f, 10f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 1f, Projectile.owner, true); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) { - star.Calamity().forceMelee = true; + star.DamageType = DamageClass.Melee; star.ai[0] = 3f; } } diff --git a/Projectiles/Melee/Spears/BrimlanceProj.cs b/Projectiles/Melee/Spears/BrimlanceProj.cs index bf92922d69..77058e6554 100644 --- a/Projectiles/Melee/Spears/BrimlanceProj.cs +++ b/Projectiles/Melee/Spears/BrimlanceProj.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 40; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 40; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.hide = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs index cb3db6c331..2cd44fe109 100644 --- a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs +++ b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 40; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether projectile is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 40; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index 25ecdd4617..df559f23d3 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee.Spears int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y, Projectile.velocity.X * 1.25f, velocityY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), 0f, Projectile.owner, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 13aa493a11..61b68f8238 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 40; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 40; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 4; - Projectile.Calamity().trueMelee = true; } // These numbers sure are common, huh? yeah, they are diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 74f64eb32e..57aa9cde9b 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, true); if (petal.whoAmI.WithinBounds(Main.maxProjectiles)) { - petal.Calamity().forceMelee = true; + petal.DamageType = DamageClass.Melee; petal.localNPCHitCooldown = -1; } } diff --git a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs index 43b524a66c..ff4a4c0597 100644 --- a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs +++ b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 50; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 50; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/SausageMakerSpear.cs b/Projectiles/Melee/Spears/SausageMakerSpear.cs index 4b22a54091..107bfb424b 100644 --- a/Projectiles/Melee/Spears/SausageMakerSpear.cs +++ b/Projectiles/Melee/Spears/SausageMakerSpear.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 44; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 42; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/VulcaniteLanceProj.cs b/Projectiles/Melee/Spears/VulcaniteLanceProj.cs index 0c2d57a28f..95a5922b3e 100644 --- a/Projectiles/Melee/Spears/VulcaniteLanceProj.cs +++ b/Projectiles/Melee/Spears/VulcaniteLanceProj.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 95; //The width of the .png file in pixels divided by 2. Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 95; //The height of the .png file in pixels divided by 2. Projectile.friendly = true; @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; @@ -64,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { int boom = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) - Main.projectile[boom].Calamity().forceMelee = true; + Main.projectile[boom].DamageType = DamageClass.Melee; } if (crit) { diff --git a/Projectiles/Melee/Spears/YateveoBloomSpear.cs b/Projectiles/Melee/Spears/YateveoBloomSpear.cs index ddc4f7a7e2..0209b27942 100644 --- a/Projectiles/Melee/Spears/YateveoBloomSpear.cs +++ b/Projectiles/Melee/Spears/YateveoBloomSpear.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Projectile.width = 40; Projectile.aiStyle = 19; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.height = 40; Projectile.friendly = true; @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.ignoreWater = true; Projectile.penetrate = -1; Projectile.ownerHitCheck = true; - Projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/StellarContemptHammer.cs b/Projectiles/Melee/StellarContemptHammer.cs index 872f6741f8..477429a7fe 100644 --- a/Projectiles/Melee/StellarContemptHammer.cs +++ b/Projectiles/Melee/StellarContemptHammer.cs @@ -210,10 +210,7 @@ namespace CalamityMod.Projectiles.Melee { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1); if (proj.WithinBounds(Main.maxProjectiles)) - { - CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity(); - cgp.forceMelee = true; - } + Main.projectile[proj].DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 9b869a3ca8..9ca2a7dad6 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -114,13 +114,12 @@ namespace CalamityMod.Projectiles.Melee { Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.tileCollide = false; Projectile.penetrate = -1; Projectile.timeLeft = 90000; Projectile.usesLocalNPCImmunity = true; Projectile.noEnchantments = true; - Projectile.Calamity().trueMelee = true; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset); diff --git a/Projectiles/Melee/VirulentBeeWave.cs b/Projectiles/Melee/VirulentBeeWave.cs index dd4b9f12e5..caf21267b9 100644 --- a/Projectiles/Melee/VirulentBeeWave.cs +++ b/Projectiles/Melee/VirulentBeeWave.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee int bee = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + (float)Main.rand.Next(-spawnX, spawnX), Projectile.Center.Y + (float)Main.rand.Next(-spawnY, spawnY), Projectile.velocity.X, Projectile.velocity.Y, player.beeType(), player.beeDamage(Projectile.damage / 3), player.beeKB(0f), Projectile.owner); if (bee.WithinBounds(Main.maxProjectiles)) { - Main.projectile[bee].Calamity().forceMelee = true; + Main.projectile[bee].DamageType = DamageClass.Melee; Main.projectile[bee].penetrate = 1; } } diff --git a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs index dcdac09431..9339ce9deb 100644 --- a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs +++ b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { int boom = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) - Main.projectile[boom].Calamity().forceMelee = true; + Main.projectile[boom].DamageType = DamageClass.Melee; } } diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 89f5ef5c8e..26f4e409bb 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserSpawnPosition, velocity, ModContent.ProjectileType(), laserDamage, laserKB, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } } diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 655e0923ae..d42a429de6 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -244,10 +244,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), finalDamage, 0f, Projectile.owner, i); if (p.whoAmI.WithinBounds(Main.maxProjectiles)) - { p.DamageType = DamageClass.Melee; - p.Calamity().forceMelee = true; - } } } } diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 1d235e8d1b..137e45a64a 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0.35f, Projectile.velocity.Y * 0.35f, ProjectileID.SporeGas, (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, ProjectileID.SporeGas2, (int)(Projectile.damage * 0.6), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0.15f, Projectile.velocity.Y * 0.15f, ProjectileID.SporeGas3, (int)(Projectile.damage * 0.7), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } diff --git a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index 4fb3d58ca8..57923a990a 100644 --- a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceMelee = true; + Main.projectile[proj].DamageType = DamageClass.Melee; } } diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 3809eed61d..fe46066b6d 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 2; - Main.projectile[bee].Calamity().forceRanged = true; + Main.projectile[bee].DamageType = DamageClass.Ranged; } } } diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index 527ff3c6ce..8eec6116a2 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged int aura = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15), Projectile.knockBack, Projectile.owner); if (aura.WithinBounds(Main.maxProjectiles)) { - Main.projectile[aura].Calamity().forceRanged = true; + Main.projectile[aura].DamageType = DamageClass.Ranged; Main.projectile[aura].timeLeft = 40; } } diff --git a/Projectiles/Ranged/DragonsBreathRound.cs b/Projectiles/Ranged/DragonsBreathRound.cs index 59b5ce9d55..adfa8adb5d 100644 --- a/Projectiles/Ranged/DragonsBreathRound.cs +++ b/Projectiles/Ranged/DragonsBreathRound.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRanged = true; + Main.projectile[proj].DamageType = DamageClass.Ranged; } } diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.cs b/Projectiles/Ranged/FlurrystormCannonShooting.cs index cc0752ce84..c911d3658b 100644 --- a/Projectiles/Ranged/FlurrystormCannonShooting.cs +++ b/Projectiles/Ranged/FlurrystormCannonShooting.cs @@ -138,8 +138,7 @@ namespace CalamityMod.Projectiles.Ranged if (snowball.WithinBounds(Main.maxProjectiles)) { Main.projectile[snowball].noDropItem = true; - Main.projectile[snowball].Calamity().forceRanged = true; - // Main.projectile[snowball].thrown = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; + Main.projectile[snowball].DamageType = DamageClass.Ranged; Main.projectile[snowball].extraUpdates += Main.rand.Next(0,2); } diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 9371d35068..3e4ed5ab74 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 2; - Main.projectile[bee].Calamity().forceRanged = true; + Main.projectile[bee].DamageType = DamageClass.Ranged; } } } diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 929ebdfaf2..e4426129b0 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 2; - Main.projectile[bee].Calamity().forceRanged = true; + Main.projectile[bee].DamageType = DamageClass.Ranged; } } } diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 5e94f52df3..ca1f236dc4 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 2; - Main.projectile[bee].Calamity().forceRanged = true; + Main.projectile[bee].DamageType = DamageClass.Ranged; } } } diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index e489c5b839..4a18b406a6 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged // Only declare the explosion as ranged class if the bullet itself is ranged class. if (boom.WithinBounds(Main.maxProjectiles) && Projectile.CountsAsClass()) - Main.projectile[boom].Calamity().forceRanged = true; + Main.projectile[boom].DamageType = DamageClass.Ranged; } // Spawn four shrapnel dust. This deals no damage. diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 1d60e1c868..307ab32f7d 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged int flames = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3), 0f, Projectile.owner); if (flames.WithinBounds(Main.maxProjectiles)) { - Main.projectile[flames].Calamity().forceRanged = true; + Main.projectile[flames].DamageType = DamageClass.Ranged; Main.projectile[flames].penetrate = 3; Main.projectile[flames].usesLocalNPCImmunity = false; Main.projectile[flames].usesIDStaticNPCImmunity = true; diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index 02f9a75db6..b084d4ceb9 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 2; - Main.projectile[bee].Calamity().forceRanged = true; + Main.projectile[bee].DamageType = DamageClass.Ranged; } } } diff --git a/Projectiles/Ranged/SporeBomb.cs b/Projectiles/Ranged/SporeBomb.cs index 558d156181..763a2baa1f 100644 --- a/Projectiles/Ranged/SporeBomb.cs +++ b/Projectiles/Ranged/SporeBomb.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ProjectileID.SporeGas + Main.rand.Next(3), (int)(Projectile.damage * 0.25), 0f, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceRanged = true; + Main.projectile[proj].DamageType = DamageClass.Ranged; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } diff --git a/Projectiles/Ranged/StarfleetMK2Gun.cs b/Projectiles/Ranged/StarfleetMK2Gun.cs index dbed31199e..2d8eff04b7 100644 --- a/Projectiles/Ranged/StarfleetMK2Gun.cs +++ b/Projectiles/Ranged/StarfleetMK2Gun.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Ranged { Main.projectile[star].penetrate = 1; Main.projectile[star].timeLeft = 300; - Main.projectile[star].Calamity().forceRanged = true; + Main.projectile[star].DamageType = DamageClass.Ranged; Main.projectile[star].netUpdate = true; } Projectile.netUpdate = true; diff --git a/Projectiles/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index 5319b838e9..278b777f80 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Ranged float speed = 24f * ChargePercent; int projectile = Projectile.NewProjectile(new EntitySource_ItemUse_WithAmmo(Owner, Owner.HeldItem, -1), Projectile.Center, direction * speed, ModContent.ProjectileType(), (int)rangedDamage, 0f, Projectile.owner); if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].Calamity().forceClassless = true; + Main.projectile[projectile].DamageType = DamageClass.Generic; } } diff --git a/Projectiles/Rogue/AntumbraShardProjectile.cs b/Projectiles/Rogue/AntumbraShardProjectile.cs index 188a3508ac..a27e67d959 100644 --- a/Projectiles/Rogue/AntumbraShardProjectile.cs +++ b/Projectiles/Rogue/AntumbraShardProjectile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.Calamity().stealthStrike) { int star = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); - Main.projectile[star].Calamity().forceRogue = true; + Main.projectile[star].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index 845577e3a4..a0725d0eab 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Rogue int comet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), dmg, Projectile.knockBack, Projectile.owner); if (comet.WithinBounds(Main.maxProjectiles)) { - Main.projectile[comet].Calamity().forceRogue = true; + Main.projectile[comet].DamageType = RogueDamageClass.Instance; Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3); } } diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index f55d87e946..7f35f23e13 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Rogue int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, projID, bloodDamage, bloodKB, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); if (stealth.WithinBounds(Main.maxProjectiles)) { - Main.projectile[stealth].Calamity().forceRogue = true; + Main.projectile[stealth].DamageType = RogueDamageClass.Instance; Main.projectile[stealth].extraUpdates = 1; } } diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs index 2f12e783c2..14ce3795e8 100644 --- a/Projectiles/Rogue/BurningStrifeProj.cs +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), Projectile.knockBack, Projectile.owner); Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = Projectile.Center; - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } } @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), Projectile.knockBack, Projectile.owner); Main.projectile[proj].timeLeft += 20; Main.projectile[proj].Center = Projectile.Center; - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } } @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Rogue else proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.33), Projectile.knockBack, Projectile.owner); Main.projectile[proj].Center = Projectile.Center; - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/Crystalline2.cs b/Projectiles/Rogue/Crystalline2.cs index 74f87baafe..3762bfc3f1 100644 --- a/Projectiles/Rogue/Crystalline2.cs +++ b/Projectiles/Rogue/Crystalline2.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 projspeed = new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f)); int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, projspeed, ProjectileID.CrystalShard, (int)(Projectile.damage * 0.4f), 2f, Projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) - Main.projectile[shard].Calamity().forceRogue = true; + Main.projectile[shard].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index c8311ce0ad..7c872596c0 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue int flame = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.CursedFlameFriendly : ProjectileID.CursedDartFlame, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); if (flame.WithinBounds(Main.maxProjectiles)) { - Main.projectile[flame].Calamity().forceRogue = true; + Main.projectile[flame].DamageType = RogueDamageClass.Instance; Main.projectile[flame].usesLocalNPCImmunity = true; Main.projectile[flame].localNPCHitCooldown = 10; } diff --git a/Projectiles/Rogue/EpidemicShredderProjectile.cs b/Projectiles/Rogue/EpidemicShredderProjectile.cs index 4ddaee06de..d5b11a4893 100644 --- a/Projectiles/Rogue/EpidemicShredderProjectile.cs +++ b/Projectiles/Rogue/EpidemicShredderProjectile.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue { int projIndex2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.velocity * -1f).RotatedByRandom(MathHelper.ToRadians(15f)), ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), 2f, Projectile.owner); if (projIndex2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projIndex2].Calamity().forceRogue = true; + Main.projectile[projIndex2].DamageType = RogueDamageClass.Instance; } } @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue { int projIndex1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), 2f, Projectile.owner); if (projIndex1.WithinBounds(Main.maxProjectiles)) - Main.projectile[projIndex1].Calamity().forceRogue = true; + Main.projectile[projIndex1].DamageType = RogueDamageClass.Instance; Projectile.ai[0] = 12f; //0.2th of a second cooldown } Projectile.penetrate--; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue { int projectileIndex = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), 2f, Projectile.owner); if (projectileIndex.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectileIndex].Calamity().forceRogue = true; + Main.projectile[projectileIndex].DamageType = RogueDamageClass.Instance; Projectile.ai[0] = 12f; //0.2th of a second cooldown } target.AddBuff(ModContent.BuffType(), 240); @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue { int projectileIndex = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), 2f, Projectile.owner); if (projectileIndex.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectileIndex].Calamity().forceRogue = true; + Main.projectile[projectileIndex].DamageType = RogueDamageClass.Instance; Projectile.ai[0] = 12f; //0.2th of a second cooldown } target.AddBuff(ModContent.BuffType(), 240); diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index 9036610703..69459095de 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), laserDamage, 0f, Projectile.owner); if (laser.whoAmI.WithinBounds(Main.maxProjectiles)) { - laser.Calamity().forceRogue = true; + laser.DamageType = RogueDamageClass.Instance; laser.aiStyle = Main.rand.NextBool() ? 1 : -1; laser.penetrate = -1; laser.usesLocalNPCImmunity = true; diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 0b38a35919..d553a34db0 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile ghost = CalamityGlobalProjectile.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - ghost.Calamity().forceRogue = true; + ghost.DamageType = RogueDamageClass.Instance; ghost.penetrate = 1; } } diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index 7276b5158a..f8cb5b6023 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile ghost = CalamityGlobalProjectile.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - ghost.Calamity().forceRogue = true; + ghost.DamageType = RogueDamageClass.Instance; ghost.penetrate = 1; } } diff --git a/Projectiles/Rogue/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs index 0a53b240c6..7aece0f304 100644 --- a/Projectiles/Rogue/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, new Vector2(Projectile.velocity.X / 20, 2), ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } } } @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, new Vector2(Projectile.velocity.X / 20, 2), ModContent.ProjectileType(), (int)(Projectile.damage * 0.69), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 388397a7f6..b56cb4e965 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue int snowflake = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0f, Projectile.velocity.Y * 0f, ProjectileID.NorthPoleSnowflake, (int)(Projectile.damage * 0.25), Projectile.knockBack, Projectile.owner, 0f, Main.rand.Next(3)); if (snowflake.WithinBounds(Main.maxProjectiles)) { - Main.projectile[snowflake].Calamity().forceRogue = true; + Main.projectile[snowflake].DamageType = RogueDamageClass.Instance; Main.projectile[snowflake].timeLeft = 300; } } diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs index 8e87ab150e..4f0fa69b26 100644 --- a/Projectiles/Rogue/GacruxianHome.cs +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Rogue { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); } diff --git a/Projectiles/Rogue/GacruxianProj.cs b/Projectiles/Rogue/GacruxianProj.cs index 9fa5845686..a21d39f7a6 100644 --- a/Projectiles/Rogue/GacruxianProj.cs +++ b/Projectiles/Rogue/GacruxianProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs index 05ca304676..0f878479f5 100644 --- a/Projectiles/Rogue/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue int slime = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ProjectileID.SlimeGun, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); if (slime.WithinBounds(Main.maxProjectiles)) { - Main.projectile[slime].Calamity().forceRogue = true; + Main.projectile[slime].DamageType = RogueDamageClass.Instance; Main.projectile[slime].usesLocalNPCImmunity = true; Main.projectile[slime].localNPCHitCooldown = 10; } diff --git a/Projectiles/Rogue/GreenDonkeyKongReference.cs b/Projectiles/Rogue/GreenDonkeyKongReference.cs index 1718349bc2..70c71b4366 100644 --- a/Projectiles/Rogue/GreenDonkeyKongReference.cs +++ b/Projectiles/Rogue/GreenDonkeyKongReference.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue (int)(Projectile.damage * 0.75f), 1f, Projectile.owner); if (acidIndex.WithinBounds(Main.maxProjectiles)) { - Main.projectile[acidIndex].Calamity().forceRogue = true; + Main.projectile[acidIndex].DamageType = RogueDamageClass.Instance; Main.projectile[acidIndex].timeLeft = 300; Main.projectile[acidIndex].usesLocalNPCImmunity = true; Main.projectile[acidIndex].localNPCHitCooldown = -1; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Rogue (int)(Projectile.damage * 0.667f), 1f, Projectile.owner); if (acidIndex.WithinBounds(Main.maxProjectiles)) { - Main.projectile[acidIndex].Calamity().forceRogue = true; + Main.projectile[acidIndex].DamageType = RogueDamageClass.Instance; Main.projectile[acidIndex].timeLeft = 420; } } diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index e8ee625ea4..b807c610e9 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue { int ice = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (ice.WithinBounds(Main.maxProjectiles)) - Main.projectile[ice].Calamity().forceRogue = true; + Main.projectile[ice].DamageType = RogueDamageClass.Instance; explosionCount++; } @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue //no explosion count cap in pvp int ice = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (ice.WithinBounds(Main.maxProjectiles)) - Main.projectile[ice].Calamity().forceRogue = true; + Main.projectile[ice].DamageType = RogueDamageClass.Instance; int buffType = ModContent.BuffType(); float radius = 112f; // 7 blocks diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 691218ac74..e8da2df384 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue int ichor = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.GoldenShowerFriendly : ProjectileID.IchorSplash, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); if (ichor.WithinBounds(Main.maxProjectiles)) { - Main.projectile[ichor].Calamity().forceRogue = true; + Main.projectile[ichor].DamageType = RogueDamageClass.Instance; Main.projectile[ichor].usesLocalNPCImmunity = true; Main.projectile[ichor].localNPCHitCooldown = 10; Main.projectile[ichor].extraUpdates = 2; diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index f43a03477c..9911a2210e 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue int flash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 1f); if (flash.WithinBounds(Main.maxProjectiles)) { - Main.projectile[flash].Calamity().forceRogue = true; + Main.projectile[flash].DamageType = RogueDamageClass.Instance; Main.projectile[flash].usesLocalNPCImmunity = true; Main.projectile[flash].localNPCHitCooldown = 10; } diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 35172caf6e..9ad2a2fb29 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * Math.PI * 0.5, default); int spike = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, -10f, 0f); if (spike.WithinBounds(Main.maxProjectiles)) - Main.projectile[spike].Calamity().forceRogue = true; + Main.projectile[spike].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index ab4592332e..9bab14bed3 100644 --- a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue pathToTravel.Y *= speedMult; int petal = Projectile.NewProjectile(Projectile.GetSource_FromThis(), startPos, pathToTravel, ProjectileID.FlowerPetal, Projectile.damage, 0f, Projectile.owner); if (petal.WithinBounds(Main.maxProjectiles)) - Main.projectile[petal].Calamity().forceRogue = true; + Main.projectile[petal].DamageType = RogueDamageClass.Instance; } } diff --git a/Projectiles/Rogue/PhantomLanceProj.cs b/Projectiles/Rogue/PhantomLanceProj.cs index a482d041b3..024047c95c 100644 --- a/Projectiles/Rogue/PhantomLanceProj.cs +++ b/Projectiles/Rogue/PhantomLanceProj.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue int soul = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), soulDamage, Projectile.knockBack, Projectile.owner); if (soul.WithinBounds(Main.maxProjectiles)) { - Main.projectile[soul].Calamity().forceRogue = true; + Main.projectile[soul].DamageType = RogueDamageClass.Instance; Main.projectile[soul].usesLocalNPCImmunity = true; Main.projectile[soul].localNPCHitCooldown = -2; } diff --git a/Projectiles/Rogue/PoisonBol.cs b/Projectiles/Rogue/PoisonBol.cs index cc9049554b..0b9f503d23 100644 --- a/Projectiles/Rogue/PoisonBol.cs +++ b/Projectiles/Rogue/PoisonBol.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - velocity, velocity, Main.rand.Next(569,572), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) { - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 45; } diff --git a/Projectiles/Rogue/Prismalline3.cs b/Projectiles/Rogue/Prismalline3.cs index a2277eb3f8..c1b0afef64 100644 --- a/Projectiles/Rogue/Prismalline3.cs +++ b/Projectiles/Rogue/Prismalline3.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) { - Main.projectile[shard].Calamity().forceRogue = true; + Main.projectile[shard].DamageType = RogueDamageClass.Instance; Main.projectile[shard].penetrate = 1; } } diff --git a/Projectiles/Rogue/PrismallineProj.cs b/Projectiles/Rogue/PrismallineProj.cs index 88c861a4e9..c4711df934 100644 --- a/Projectiles/Rogue/PrismallineProj.cs +++ b/Projectiles/Rogue/PrismallineProj.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage / 2, 0f, Projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) { - Main.projectile[shard].Calamity().forceRogue = true; + Main.projectile[shard].DamageType = RogueDamageClass.Instance; Main.projectile[shard].usesLocalNPCImmunity = true; Main.projectile[shard].localNPCHitCooldown = 10; } @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage / 2, 0f, Projectile.owner); if (shard.WithinBounds(Main.maxProjectiles)) { - Main.projectile[shard].Calamity().forceRogue = true; + Main.projectile[shard].DamageType = RogueDamageClass.Instance; Main.projectile[shard].penetrate = 1; } } diff --git a/Projectiles/Rogue/RadiantExplosion.cs b/Projectiles/Rogue/RadiantExplosion.cs index b0e8d19a31..f7830aea92 100644 --- a/Projectiles/Rogue/RadiantExplosion.cs +++ b/Projectiles/Rogue/RadiantExplosion.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile star = CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 25f, projType, (int)(Projectile.damage * 0.75), 5f, Projectile.owner); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) { - star.Calamity().forceRogue = true; + star.DamageType = RogueDamageClass.Instance; star.ai[0] = 2f; } } diff --git a/Projectiles/Rogue/SandDollarStealth.cs b/Projectiles/Rogue/SandDollarStealth.cs index 7722bb66e0..a56adf6572 100644 --- a/Projectiles/Rogue/SandDollarStealth.cs +++ b/Projectiles/Rogue/SandDollarStealth.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); int coral = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); if (coral.WithinBounds(Main.maxProjectiles)) - Main.projectile[coral].Calamity().forceRogue = true; + Main.projectile[coral].DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/SkyStabberProj.cs b/Projectiles/Rogue/SkyStabberProj.cs index f953d4eb81..6f83a7c1b5 100644 --- a/Projectiles/Rogue/SkyStabberProj.cs +++ b/Projectiles/Rogue/SkyStabberProj.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile feather = CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner); if (feather.whoAmI.WithinBounds(Main.maxProjectiles)) - feather.Calamity().forceRogue = true; + feather.DamageType = RogueDamageClass.Instance; } } } diff --git a/Projectiles/Rogue/SubductionSlicerProj.cs b/Projectiles/Rogue/SubductionSlicerProj.cs index 8a104e0cb2..4237449a84 100644 --- a/Projectiles/Rogue/SubductionSlicerProj.cs +++ b/Projectiles/Rogue/SubductionSlicerProj.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Rogue { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; if (Projectile.Calamity().stealthStrike && Projectile.localAI[0] <= 0f) { Point result; diff --git a/Projectiles/Rogue/UrchinStingerProj.cs b/Projectiles/Rogue/UrchinStingerProj.cs index 3b8de056f0..ff7f99b34c 100644 --- a/Projectiles/Rogue/UrchinStingerProj.cs +++ b/Projectiles/Rogue/UrchinStingerProj.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 projspeed = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, projspeed, ModContent.ProjectileType(), (int)(projdmg * 0.5f), 1f, Projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].DamageType = RogueDamageClass.Instance; } return false; } diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index 70ff288572..dafb26d9e9 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile typhoon = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), typhoonDamage, 0f, Projectile.owner); if (typhoon.whoAmI.WithinBounds(Main.maxProjectiles)) { - typhoon.Calamity().forceRogue = true; + typhoon.DamageType = RogueDamageClass.Instance; typhoon.usesLocalNPCImmunity = true; typhoon.localNPCHitCooldown = 10; } diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs index c5d319de3f..76c7f81022 100644 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ b/Projectiles/Typeless/DemonshadeRedDevil.cs @@ -249,7 +249,7 @@ namespace CalamityMod.Projectiles.Typeless Main.projectile[trident].timeLeft = 300; Main.projectile[trident].usesLocalNPCImmunity = true; Main.projectile[trident].localNPCHitCooldown = 10; - Main.projectile[trident].Calamity().forceClassless = true; //typeless + Main.projectile[trident].DamageType = DamageClass.Generic; //typeless } Projectile.netUpdate = true; } From d4b5160f987b79bf4323704e261b825837766c06 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 19:42:56 -0400 Subject: [PATCH 10/31] 1 - Fully replaced Momentum Capacitor. It is now a channeled Burden Breaker. 2 - Stealth no longer gives movement speed. 3 - Moved a bunch of CalamityGlobalProjectile utilities to CalamityUtils where they belong. 4 - Renamed several things in CalamityGlobalProjectile --- CalPlayer/CalamityPlayer.cs | 38 +-- CalPlayer/CalamityPlayerMiscEffects.cs | 2 + CalPlayer/CalamityPlayerOnHit.cs | 14 +- CalamityKeybinds.cs | 5 - Items/Accessories/MomentumCapacitor.cs | 46 --- Items/MomentumCapacitor.cs | 47 ++++ Items/{Accessories => }/MomentumCapacitor.png | Bin NPCs/CalamityGlobalNPC.cs | 3 +- NPCs/TownNPCs/THIEF.cs | 2 + .../BaseMassiveExplosionProjectile.cs | 2 +- Projectiles/Boss/ApolloFireball.cs | 2 +- Projectiles/Boss/ApolloRocket.cs | 2 +- Projectiles/Boss/AresDeathBeamStart.cs | 2 +- Projectiles/Boss/AresGaussNukeProjectile.cs | 2 +- .../Boss/AresGaussNukeProjectileBoom.cs | 2 +- Projectiles/Boss/AresLaserBeamStart.cs | 2 +- Projectiles/Boss/AresPlasmaBolt.cs | 2 +- Projectiles/Boss/AresPlasmaFireball.cs | 2 +- Projectiles/Boss/ArtemisLaser.cs | 2 +- Projectiles/Boss/ArtemisSpinLaserbeam.cs | 2 +- Projectiles/Boss/AstralFlame.cs | 2 +- Projectiles/Boss/BrimstoneHellblast.cs | 2 +- Projectiles/Boss/BrimstoneHellblast2.cs | 2 +- Projectiles/Boss/BrimstoneHellfireball.cs | 2 +- Projectiles/Boss/BrimstoneMonster.cs | 2 +- Projectiles/Boss/BrimstoneRay.cs | 2 +- Projectiles/Boss/DarkEnergyBall.cs | 2 +- Projectiles/Boss/DarkEnergyBall2.cs | 2 +- Projectiles/Boss/DeusMine.cs | 2 +- Projectiles/Boss/DoGDeath.cs | 2 +- Projectiles/Boss/DoGFire.cs | 2 +- Projectiles/Boss/FlareBomb.cs | 4 +- Projectiles/Boss/FlareDust.cs | 4 +- Projectiles/Boss/FlareDust2.cs | 4 +- Projectiles/Boss/Flarenado.cs | 4 +- Projectiles/Boss/HiveBombGoliath.cs | 2 +- Projectiles/Boss/HolyBlast.cs | 2 +- Projectiles/Boss/HolyBurnOrb.cs | 4 +- Projectiles/Boss/HolySpear.cs | 2 +- Projectiles/Boss/IceBomb.cs | 4 +- Projectiles/Boss/Infernado.cs | 4 +- Projectiles/Boss/Infernado2.cs | 4 +- Projectiles/Boss/LeviathanBomb.cs | 2 +- Projectiles/Boss/MajesticSparkle.cs | 2 +- Projectiles/Boss/MoltenBlast.cs | 2 +- Projectiles/Boss/MoltenBlob.cs | 2 +- Projectiles/Boss/OldDukeVortex.cs | 2 +- Projectiles/Boss/PhantomBlast.cs | 2 +- Projectiles/Boss/PhantomBlast2.cs | 2 +- Projectiles/Boss/PhantomMine.cs | 2 +- Projectiles/Boss/ProfanedSpear.cs | 2 +- Projectiles/Boss/ProvidenceCrystalShard.cs | 2 +- Projectiles/Boss/ProvidenceHolyRay.cs | 2 +- Projectiles/Boss/RedLightning.cs | 2 +- Projectiles/Boss/SCalBrimstoneFireblast.cs | 2 +- Projectiles/Boss/SCalBrimstoneGigablast.cs | 2 +- Projectiles/Boss/SandPoisonCloud.cs | 2 +- Projectiles/Boss/ScavengerNuke.cs | 2 +- Projectiles/Boss/SporeGasPlantera.cs | 2 +- Projectiles/Boss/SupremeCatastropheSlash.cs | 2 +- Projectiles/Boss/ThanatosBeamStart.cs | 2 +- Projectiles/Boss/ThanatosLaser.cs | 2 +- Projectiles/Boss/ToxicCloud.cs | 2 +- Projectiles/Boss/UnstableCrimulanGlob.cs | 2 +- Projectiles/Boss/UnstableEbonianGlob.cs | 2 +- Projectiles/Boss/YharonFireball.cs | 4 +- Projectiles/Boss/YharonFireball2.cs | 4 +- Projectiles/CalamityGlobalProjectile.cs | 225 +-------------- .../FrequencyManipulatorProjectile.cs | 4 +- .../PlasmaGrenadeProjectile.cs | 2 +- .../DraedonsArsenal/TrackingDiskLaser.cs | 2 +- Projectiles/Enemy/AstralMeteorProj.cs | 2 +- Projectiles/Enemy/EarthRockBig.cs | 2 +- Projectiles/Enemy/FlakAcid.cs | 2 +- Projectiles/Enemy/GammaAcid.cs | 2 +- Projectiles/Enemy/MantisRing.cs | 2 +- Projectiles/Magic/AstralachneaFang.cs | 2 +- Projectiles/Magic/BeamingBolt2.cs | 2 +- Projectiles/Magic/BeastScythe.cs | 2 +- Projectiles/Magic/BlueBubble.cs | 2 +- Projectiles/Magic/BrimstoneHomer.cs | 2 +- Projectiles/Magic/ClimaxProj.cs | 2 +- Projectiles/Magic/CryoBlast.cs | 2 +- Projectiles/Magic/DivineRetributionSpear.cs | 2 +- Projectiles/Magic/ElementOrb.cs | 2 +- Projectiles/Magic/ElementOrb2.cs | 2 +- Projectiles/Magic/EnormousConsumingVortex.cs | 6 +- Projectiles/Magic/ForbiddenAxeBlade.cs | 2 +- Projectiles/Magic/GhastlyExplosionShard.cs | 2 +- Projectiles/Magic/GleamingBolt2.cs | 2 +- Projectiles/Magic/GraniteEnergy.cs | 2 +- Projectiles/Magic/GranitePulse.cs | 4 +- Projectiles/Magic/IceSpike.cs | 2 +- Projectiles/Magic/InfernadoFriendly.cs | 2 +- Projectiles/Magic/LightBead.cs | 2 +- Projectiles/Magic/LightBlade.cs | 2 +- .../Magic/MadAlchemistsCocktailShrapnel.cs | 2 +- Projectiles/Magic/MagneticOrb.cs | 2 +- Projectiles/Magic/ManaBoltSmall.cs | 2 +- Projectiles/Magic/MeteorStar.cs | 2 +- Projectiles/Magic/NightOrb.cs | 2 +- Projectiles/Magic/PartySparkle.cs | 2 +- Projectiles/Magic/Phantom.cs | 2 +- Projectiles/Magic/PoseidonTyphoon.cs | 2 +- Projectiles/Magic/PrinceFlameSmall.cs | 2 +- Projectiles/Magic/RainbowRocket.cs | 2 +- Projectiles/Magic/RancorArm.cs | 2 +- Projectiles/Magic/SubsumingTentacle.cs | 2 +- Projectiles/Magic/TearsofHeavenProjectile.cs | 2 +- Projectiles/Magic/TerraShard.cs | 2 +- Projectiles/Magic/ThunderstormShot.cs | 2 +- Projectiles/Magic/UndinesRetributionSpear.cs | 2 +- Projectiles/Magic/VividLaser2.cs | 2 +- Projectiles/Magic/VividOrb.cs | 2 +- Projectiles/Magic/VoidVortexProj.cs | 2 +- Projectiles/Melee/AncientStar.cs | 2 +- Projectiles/Melee/BlazingPhantomBlade.cs | 2 +- Projectiles/Melee/Blood.cs | 2 +- Projectiles/Melee/Blood2.cs | 2 +- Projectiles/Melee/Brimlash2.cs | 2 +- Projectiles/Melee/CometQuasherMeteor.cs | 2 +- Projectiles/Melee/CosmicOrb.cs | 2 +- Projectiles/Melee/CrescentMoonProj.cs | 2 +- Projectiles/Melee/DepthOrb2.cs | 2 +- Projectiles/Melee/DragonRageFireball.cs | 2 +- Projectiles/Melee/ElementBall.cs | 2 +- Projectiles/Melee/ElementBallShiv.cs | 2 +- Projectiles/Melee/ElementalExcaliburBeam.cs | 4 +- Projectiles/Melee/ElementalGlassStar.cs | 2 +- Projectiles/Melee/EmpyreanKnife.cs | 2 +- Projectiles/Melee/EntropicFlechette.cs | 2 +- Projectiles/Melee/EntropicFlechetteLarge.cs | 2 +- Projectiles/Melee/EntropicFlechetteSmall.cs | 2 +- Projectiles/Melee/EssenceFlame2.cs | 2 +- Projectiles/Melee/EssenceScythe.cs | 2 +- Projectiles/Melee/Exocomet.cs | 2 +- Projectiles/Melee/Flarefrost.cs | 2 +- Projectiles/Melee/GalileosMoon.cs | 2 +- Projectiles/Melee/GhastlySoulLarge.cs | 2 +- Projectiles/Melee/GhastlySoulMedium.cs | 2 +- Projectiles/Melee/GhastlySoulSmall.cs | 2 +- Projectiles/Melee/HolyColliderHolyFire.cs | 2 +- Projectiles/Melee/HyperBlade.cs | 2 +- Projectiles/Melee/IceBombFriendly.cs | 2 +- Projectiles/Melee/IllustriousKnife.cs | 2 +- Projectiles/Melee/JudgementBlah.cs | 2 +- Projectiles/Melee/JudgementProj.cs | 2 +- Projectiles/Melee/OathswordFlame.cs | 4 +- Projectiles/Melee/PlagueSeeker.cs | 2 +- Projectiles/Melee/RainBolt.cs | 2 +- Projectiles/Melee/Razorwind.cs | 2 +- Projectiles/Melee/SandFire.cs | 2 +- Projectiles/Melee/StormBeam.cs | 2 +- Projectiles/Melee/TerratomereProjectile.cs | 2 +- Projectiles/Melee/TinyCrystal.cs | 2 +- Projectiles/Melee/TinyFlare.cs | 2 +- Projectiles/Melee/UltimusCleaverDust.cs | 2 +- Projectiles/Melee/Whiterain.cs | 2 +- Projectiles/Melee/WhiterainBlah.cs | 2 +- Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs | 2 +- Projectiles/Melee/Yoyos/AortaYoyo.cs | 2 +- Projectiles/Melee/Yoyos/GodsGambitYoyo.cs | 2 +- Projectiles/Melee/Yoyos/OblivionYoyo.cs | 2 +- Projectiles/Melee/Yoyos/PandemicYoyo.cs | 2 +- Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs | 2 +- Projectiles/Melee/Yoyos/VerdantYoyo.cs | 2 +- Projectiles/Melee/Yoyos/YinYoyo.cs | 2 +- Projectiles/Ranged/AMRShot.cs | 2 +- Projectiles/Ranged/AccelerationRoundProj.cs | 2 +- Projectiles/Ranged/AcidRoundProj.cs | 2 +- Projectiles/Ranged/AquaBlast.cs | 2 +- Projectiles/Ranged/AquaBlastToxic.cs | 2 +- Projectiles/Ranged/Aquashard.cs | 2 +- Projectiles/Ranged/AquashardSplit.cs | 2 +- Projectiles/Ranged/ArcherfishShot.cs | 2 +- Projectiles/Ranged/ArcticArrowProj.cs | 2 +- Projectiles/Ranged/AstralRound.cs | 4 +- Projectiles/Ranged/AstralSandgun.cs | 2 +- Projectiles/Ranged/AstrealArrow.cs | 2 +- Projectiles/Ranged/AstrealFlame.cs | 2 +- Projectiles/Ranged/AuralisBullet.cs | 2 +- Projectiles/Ranged/BallistaGreatArrow.cs | 2 +- Projectiles/Ranged/BeeRPG.cs | 4 +- Projectiles/Ranged/BigCoral.cs | 2 +- Projectiles/Ranged/BigNuke.cs | 6 +- Projectiles/Ranged/BloodClotFriendly.cs | 2 +- Projectiles/Ranged/BloodfireArrowProj.cs | 4 +- Projectiles/Ranged/BloodfireBulletProj.cs | 2 +- Projectiles/Ranged/BloodflareSoul.cs | 2 +- Projectiles/Ranged/BlueExoArrow.cs | 2 +- Projectiles/Ranged/BoltArrow.cs | 2 +- Projectiles/Ranged/BouncingShotgunPellet.cs | 4 +- Projectiles/Ranged/BrimstoneBolt.cs | 2 +- Projectiles/Ranged/CardClubSplit.cs | 2 +- Projectiles/Ranged/ChargedBlast.cs | 2 +- Projectiles/Ranged/ChargedBlast3.cs | 2 +- Projectiles/Ranged/ClamorRifleProj.cs | 4 +- Projectiles/Ranged/ClamorRifleProjSplit.cs | 2 +- Projectiles/Ranged/ClaretCannonProj.cs | 2 +- Projectiles/Ranged/CondemnationArrow.cs | 2 +- Projectiles/Ranged/ContagionArrow.cs | 2 +- Projectiles/Ranged/CorrodedShell.cs | 2 +- Projectiles/Ranged/DWArrow.cs | 2 +- Projectiles/Ranged/DragonsBreathRound.cs | 2 +- Projectiles/Ranged/ElysianArrowProj.cs | 2 +- Projectiles/Ranged/EnhancedNanoRoundProj.cs | 2 +- Projectiles/Ranged/ExoFlareCluster.cs | 2 +- Projectiles/Ranged/FeatherLarge.cs | 2 +- Projectiles/Ranged/FishronRPG.cs | 2 +- Projectiles/Ranged/FlareBat.cs | 2 +- Projectiles/Ranged/FlashRoundProj.cs | 2 +- Projectiles/Ranged/FlurrystormIceChunk.cs | 2 +- Projectiles/Ranged/FungiOrb.cs | 2 +- Projectiles/Ranged/FungiOrb2.cs | 2 +- Projectiles/Ranged/GodSlayerSlugProj.cs | 6 +- Projectiles/Ranged/GoliathRocket.cs | 4 +- Projectiles/Ranged/GreenExoArrow.cs | 2 +- Projectiles/Ranged/HiveBomb.cs | 4 +- Projectiles/Ranged/HiveMissile.cs | 4 +- Projectiles/Ranged/HolyFireBulletProj.cs | 2 +- Projectiles/Ranged/HyperiusBulletProj.cs | 2 +- Projectiles/Ranged/IcicleArrowProj.cs | 2 +- Projectiles/Ranged/IcyBulletProj.cs | 2 +- Projectiles/Ranged/IlluminatedBullet.cs | 2 +- Projectiles/Ranged/ImpactRound.cs | 2 +- Projectiles/Ranged/LeafArrow.cs | 2 +- Projectiles/Ranged/LunarBolt.cs | 2 +- Projectiles/Ranged/LunarBolt2.cs | 2 +- Projectiles/Ranged/LuxorsGiftRanged.cs | 2 +- Projectiles/Ranged/MagnaStrike.cs | 2 +- Projectiles/Ranged/MagnomalyRocket.cs | 4 +- Projectiles/Ranged/MiniRocket.cs | 6 +- Projectiles/Ranged/MiniSharkron.cs | 2 +- Projectiles/Ranged/MiniatureFolly.cs | 2 +- Projectiles/Ranged/MistArrow.cs | 2 +- Projectiles/Ranged/MortarRoundProj.cs | 4 +- Projectiles/Ranged/NapalmArrowProj.cs | 4 +- Projectiles/Ranged/NorfleetComet.cs | 2 +- Projectiles/Ranged/Nuke.cs | 4 +- Projectiles/Ranged/NullShot.cs | 2 +- Projectiles/Ranged/NullShot2.cs | 2 +- Projectiles/Ranged/OpalStrike.cs | 2 +- Projectiles/Ranged/OrangeExoArrow.cs | 4 +- Projectiles/Ranged/PiercingBullet.cs | 2 +- Projectiles/Ranged/PlagueArrow.cs | 2 +- Projectiles/Ranged/PlanarRipperBolt.cs | 2 +- .../Ranged/PlanetaryAnnihilationProj.cs | 2 +- Projectiles/Ranged/PolarStar.cs | 4 +- Projectiles/Ranged/PrismComet.cs | 2 +- Projectiles/Ranged/PumplerGrenade.cs | 2 +- Projectiles/Ranged/RainbowBlast.cs | 2 +- Projectiles/Ranged/RealmRavagerBullet.cs | 4 +- Projectiles/Ranged/RubberMortarRoundProj.cs | 8 +- Projectiles/Ranged/SandstormBullet.cs | 2 +- Projectiles/Ranged/SandyWaifuShark.cs | 2 +- Projectiles/Ranged/ScorchedEarthRocket.cs | 4 +- Projectiles/Ranged/SeaDragonRocket.cs | 4 +- Projectiles/Ranged/SepticSkewerHarpoon.cs | 2 +- Projectiles/Ranged/Shell.cs | 2 +- Projectiles/Ranged/ShockblastRound.cs | 2 +- Projectiles/Ranged/Shroom.cs | 2 +- Projectiles/Ranged/SicknessRound.cs | 2 +- Projectiles/Ranged/SicknessRound2.cs | 2 +- Projectiles/Ranged/SlagRound.cs | 2 +- Projectiles/Ranged/SmallCoral.cs | 2 +- Projectiles/Ranged/SputterCometBig.cs | 2 +- Projectiles/Ranged/SulphuricBlast.cs | 2 +- Projectiles/Ranged/SuperballBulletProj.cs | 2 +- Projectiles/Ranged/TealExoArrow.cs | 2 +- Projectiles/Ranged/TelluricGlareArrow.cs | 2 +- Projectiles/Ranged/TerraArrowMain.cs | 4 +- Projectiles/Ranged/TerraArrowSplit.cs | 2 +- Projectiles/Ranged/TerraBulletMain.cs | 2 +- Projectiles/Ranged/TerraBulletSplit.cs | 2 +- Projectiles/Ranged/TheMaelstromShark.cs | 2 +- Projectiles/Ranged/ThePackMinissile.cs | 2 +- Projectiles/Ranged/TorrentialArrow.cs | 2 +- Projectiles/Ranged/ToxicArrow.cs | 2 +- Projectiles/Ranged/ToxicannonShot.cs | 2 +- Projectiles/Ranged/TyphoonArrow.cs | 2 +- Projectiles/Ranged/UltimaBolt.cs | 4 +- Projectiles/Ranged/UltimaSpark.cs | 2 +- .../Ranged/UniversalGenesisStarcaller.cs | 2 +- Projectiles/Ranged/VanquisherArrowMain.cs | 2 +- Projectiles/Ranged/VeriumBulletProj.cs | 2 +- Projectiles/Ranged/VoidragonTentacle.cs | 2 +- Projectiles/Rogue/AuroradicalStar.cs | 2 +- Projectiles/Rogue/BallisticPoisonBombProj.cs | 4 +- Projectiles/Rogue/CelestusBoomerang.cs | 2 +- Projectiles/Rogue/CinquedeaProj.cs | 2 +- Projectiles/Rogue/CobaltEnergy.cs | 2 +- Projectiles/Rogue/CorpusAvertorClone.cs | 2 +- Projectiles/Rogue/CosmicKunaiProj.cs | 2 +- Projectiles/Rogue/CosmicScythe.cs | 4 +- Projectiles/Rogue/Crushax.cs | 2 +- Projectiles/Rogue/DeepSeaDumbbell2.cs | 2 +- Projectiles/Rogue/DeepSeaDumbbell3.cs | 2 +- Projectiles/Rogue/DesecratedBubble.cs | 2 +- Projectiles/Rogue/DragonShit.cs | 2 +- Projectiles/Rogue/EclipsesSmol.cs | 2 +- Projectiles/Rogue/EradicatorProjectile.cs | 2 +- Projectiles/Rogue/ExecutionersBladeProj.cs | 4 +- .../Rogue/ExecutionersBladeStealthProj.cs | 2 +- Projectiles/Rogue/FantasyTalismanProj.cs | 2 +- Projectiles/Rogue/FantasyTalismanStealth.cs | 2 +- Projectiles/Rogue/GacruxianHome.cs | 2 +- Projectiles/Rogue/GodsParanoiaProj.cs | 2 +- Projectiles/Rogue/LeonidStar.cs | 2 +- Projectiles/Rogue/LionfishProj.cs | 2 +- Projectiles/Rogue/LostSoulFriendly.cs | 4 +- Projectiles/Rogue/LuminousShard.cs | 2 +- Projectiles/Rogue/LunarKunaiProj.cs | 2 +- Projectiles/Rogue/MalachiteStealth.cs | 4 +- Projectiles/Rogue/MeteorFistProj.cs | 2 +- Projectiles/Rogue/MoonSigil.cs | 2 +- Projectiles/Rogue/NiceCock.cs | 2 +- Projectiles/Rogue/PenumbraSoul.cs | 2 +- Projectiles/Rogue/PhantasmalRuinGhost.cs | 2 +- Projectiles/Rogue/PhantasmalSoul.cs | 2 +- Projectiles/Rogue/PrismShurikenBlade.cs | 2 +- Projectiles/Rogue/Prismalline3.cs | 2 +- Projectiles/Rogue/ProfanedPartisanSpear.cs | 2 +- Projectiles/Rogue/RadiantStar2.cs | 2 +- Projectiles/Rogue/ReaperProjectile.cs | 2 +- Projectiles/Rogue/ScarletDevilProjectile.cs | 4 +- Projectiles/Rogue/ShadowBlackhole.cs | 2 +- .../Rogue/ShatteredSunScorchedBlade.cs | 2 +- Projectiles/Rogue/ShroomerangSpore.cs | 2 +- Projectiles/Rogue/SkyfinNuke.cs | 2 +- Projectiles/Rogue/SphereBlue.cs | 2 +- Projectiles/Rogue/TheSyringeProj.cs | 2 +- Projectiles/Rogue/TheSyringeS1.cs | 2 +- Projectiles/Rogue/TitaniumClone.cs | 2 +- Projectiles/Rogue/TurbulanceWindSlash.cs | 2 +- Projectiles/Rogue/Valaricicle.cs | 2 +- Projectiles/Rogue/Valaricicle2.cs | 2 +- Projectiles/Rogue/ValedictionBoomerang.cs | 2 +- Projectiles/Rogue/WrathwingCinder.cs | 2 +- Projectiles/Rogue/WrathwingFireball.cs | 2 +- Projectiles/Rogue/WrathwingSpear.cs | 2 +- Projectiles/Summon/AngelOrb.cs | 2 +- Projectiles/Summon/FleshBlood.cs | 2 +- Projectiles/Summon/SarosSunfire.cs | 2 +- Projectiles/Summon/SlimePuppet.cs | 2 +- .../Summon/SummonBrimstoneExplosion.cs | 2 +- .../Summon/VoidConcentrationBlackhole.cs | 2 +- Projectiles/Typeless/AeroExplosive.cs | 4 +- Projectiles/Typeless/AstralStar.cs | 2 +- Projectiles/Typeless/EmpyreanGlob.cs | 2 +- Projectiles/Typeless/EmpyreanMarble.cs | 2 +- .../Typeless/EmpyreanStellarDetritus.cs | 2 +- Projectiles/Typeless/GodKiller.cs | 2 +- Projectiles/Typeless/GodSlayerOrb.cs | 2 +- Projectiles/Typeless/GodSlayerPhantom.cs | 2 +- Projectiles/Typeless/HydrothermicFlare.cs | 2 +- .../Typeless/HydrothermicFlareRogue.cs | 2 +- Projectiles/Typeless/HydrothermicSphere.cs | 2 +- Projectiles/Typeless/KelvinCatalystStar.cs | 2 +- Projectiles/Typeless/MomentumCapacitorOrb.cs | 66 ----- Projectiles/Typeless/MomentumCapacitorOrb.png | Bin 357 -> 0 bytes Projectiles/Typeless/Nanotech.cs | 2 +- Projectiles/Typeless/PendantProjectile3.cs | 2 +- Projectiles/Typeless/SabatonBoom.cs | 2 +- Projectiles/Typeless/StickyFeatherAero.cs | 2 +- Projectiles/Typeless/TarraEnergy.cs | 2 +- Projectiles/Typeless/VanquisherArrowSplit.cs | 2 +- Utilities/ProjectileUtils.cs | 263 +++++++++++++++--- 367 files changed, 728 insertions(+), 793 deletions(-) delete mode 100644 Items/Accessories/MomentumCapacitor.cs create mode 100644 Items/MomentumCapacitor.cs rename Items/{Accessories => }/MomentumCapacitor.png (100%) delete mode 100644 Projectiles/Typeless/MomentumCapacitorOrb.cs delete mode 100644 Projectiles/Typeless/MomentumCapacitorOrb.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e0a99dd410..53a94fc093 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -16,6 +16,7 @@ using CalamityMod.Dusts; using CalamityMod.EntitySources; using CalamityMod.Events; using CalamityMod.FluidSimulation; +using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; using CalamityMod.Items.Armor.Bloodflare; @@ -122,7 +123,10 @@ namespace CalamityMod.CalPlayer public DoGCartSegment[] DoGCartSegments = new DoGCartSegment[DoGCartMount.SegmentCount]; public float SmoothenedMinecartRotation; public bool LungingDown = false; + public float moveSpeedBonus = 0f; + public int momentumCapacitorTime = 0; + public float momentumCapacitorBoost = 0f; #endregion #region Speedrun Timer @@ -561,7 +565,6 @@ namespace CalamityMod.CalPlayer public bool dragonScales = false; public bool gloveOfPrecision = false; public bool gloveOfRecklessness = false; - public bool momentumCapacitor = false; public bool vampiricTalisman = false; public bool electricianGlove = false; public bool bloodyGlove = false; @@ -1809,7 +1812,6 @@ namespace CalamityMod.CalPlayer dragonScales = false; gloveOfPrecision = false; gloveOfRecklessness = false; - momentumCapacitor = false; vampiricTalisman = false; electricianGlove = false; bloodyGlove = false; @@ -2498,6 +2500,8 @@ namespace CalamityMod.CalPlayer potionTimer = 0; bloodflareCoreLostDefense = 0; persecutedEnchantSummonTimer = 0; + momentumCapacitorTime = 0; + momentumCapacitorBoost = 0f; LungingDown = false; if (BossRushEvent.BossRushActive) @@ -2546,15 +2550,6 @@ namespace CalamityMod.CalPlayer public override void ProcessTriggers(TriggersSet triggersSet) { - if (CalamityKeybinds.MomentumCapacitatorHotkey.JustPressed && momentumCapacitor && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.3f && - wearingRogueArmor && rogueStealthMax > 0 && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) == 0) - { - rogueStealth -= rogueStealthMax * 0.3f; - - var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - Vector2 fieldSpawnCenter = new Vector2(Main.mouseX, Main.mouseY) + Main.screenPosition; - Projectile.NewProjectile(source, fieldSpawnCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI, 0f, 0f); - } if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI) { if (!Player.CCed && !Player.chaosState) @@ -3570,8 +3565,7 @@ namespace CalamityMod.CalPlayer (silvaSet ? 0.05f : 0f) + (blueCandle ? 0.05f : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + - ((deepDiver && Player.IsUnderwater()) ? 0.15f : 0f) + - (rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f); + ((deepDiver && Player.IsUnderwater()) ? 0.15f : 0f); float runSpeedMult = 1f + (shadowSpeed ? 0.5f : 0f) + @@ -3584,8 +3578,7 @@ namespace CalamityMod.CalPlayer (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? 0.05f : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + - ((deepDiver && Player.IsUnderwater()) ? 0.15f : 0f) + - (rogueStealthMax > 0f ? (rogueStealth >= rogueStealthMax ? rogueStealth * 0.05f : rogueStealth * 0.025f) : 0f); + ((deepDiver && Player.IsUnderwater()) ? 0.15f : 0f); if (abyssalDivingSuit && !Player.IsUnderwater()) { @@ -3614,6 +3607,19 @@ namespace CalamityMod.CalPlayer runAccMult *= 0.6f; } + if (momentumCapacitorTime > 0) + { + runAccMult += momentumCapacitorBoost * 0.25f; + runSpeedMult += momentumCapacitorBoost; + + // Sputters out chaotically when you let go of the button + if (momentumCapacitorTime < MomentumCapacitor.TotalFadeTime - 3) + momentumCapacitorBoost *= Main.rand.NextFloat(0.955f, 0.99f); + } + // If the timer has hit zero, or you aren't using Momentum Capacitor, you get nothing. + else + momentumCapacitorBoost = 0f; + Player.runAcceleration *= runAccMult; Player.maxRunSpeed *= runSpeedMult; } @@ -5115,7 +5121,7 @@ namespace CalamityMod.CalPlayer // If this projectile is capable of dealing defense damage, then apply defense damage. // Defense damage is not applied if the player has iframes. - if (proj.Calamity().canBreakPlayerDefense && !hasIFrames) + if (proj.Calamity().DealsDefenseDamage && !hasIFrames) DealDefenseDamage(damage); if (projRefRare) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2b2e18a4f0..374da696c7 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1048,6 +1048,8 @@ namespace CalamityMod.CalPlayer if (expiredCooldowns.Count > 0) SyncCooldownRemoval(Main.netMode == NetmodeID.Server, expiredCooldowns); + if (momentumCapacitorTime > 0) + --momentumCapacitorTime; if (spiritOriginBullseyeShootCountdown > 0) spiritOriginBullseyeShootCountdown--; if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index a77ac50bca..10ca3ae8a6 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -722,7 +722,7 @@ namespace CalamityMod.CalPlayer if (alchFlask && Player.ownedProjectileCounts[ProjectileType()] < 3 && hasClass) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(30); - Projectile projectile = CalamityGlobalProjectile.SpawnOrb(proj, seekerDamage, ProjectileType(), 400f, 12f); + Projectile projectile = CalamityUtils.SpawnOrb(proj, seekerDamage, ProjectileType(), 400f, 12f); if (projectile.whoAmI.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile.whoAmI].DamageType = DamageClass.Generic; } @@ -877,7 +877,7 @@ namespace CalamityMod.CalPlayer if (ataxiaMage && ataxiaDmg <= 0) { int orbDamage = (int)(proj.damage * 0.6); - CalamityGlobalProjectile.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 20f); + CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 20f); int cooldown = (int)(orbDamage * 0.5); ataxiaDmg += cooldown; } @@ -1030,7 +1030,7 @@ namespace CalamityMod.CalPlayer else if (jellyChargedBattery) { int batteryDamage = (int)Player.GetTotalDamage().ApplyTo(15); - CalamityGlobalProjectile.SpawnOrb(proj, batteryDamage, ProjectileType(), 800f, 15f); + CalamityUtils.SpawnOrb(proj, batteryDamage, ProjectileType(), 800f, 15f); jellyDmg = 60f; } } @@ -1106,14 +1106,14 @@ namespace CalamityMod.CalPlayer case 0: // Exodus Rogue Stars: 80% int starDamage = (int)(proj.damage * 0.8); - CalamityGlobalProjectile.SpawnOrb(proj, starDamage, ProjectileType(), 800f, Main.rand.Next(15, 30)); + CalamityUtils.SpawnOrb(proj, starDamage, ProjectileType(), 800f, Main.rand.Next(15, 30)); xerocDmg += (int)(starDamage * 0.5); break; case 1: // Exodus Rogue Orbs: 60% int orbDamage = (int)(proj.damage * 0.6); - CalamityGlobalProjectile.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 30f); + CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 30f); xerocDmg += (int)(orbDamage * 0.5); break; @@ -1132,7 +1132,7 @@ namespace CalamityMod.CalPlayer case 4: // Exodus Rogue Bubble: 60% int bubbleDamage = (int)(proj.damage * 0.6); - CalamityGlobalProjectile.SpawnOrb(proj, bubbleDamage, ProjectileType(), 800f, 15f); + CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType(), 800f, 15f); xerocDmg += (int)(bubbleDamage * 0.5); break; @@ -1284,7 +1284,7 @@ namespace CalamityMod.CalPlayer if (CalamityLists.boomerangProjList.Contains(proj.type)) { int spiritDamage = (int)(proj.damage * 0.2); - Projectile ghost = CalamityGlobalProjectile.SpawnOrb(proj, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + Projectile ghost = CalamityUtils.SpawnOrb(proj, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { ghost.DamageType = DamageClass.Generic; diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index fec10c568f..f5379ce670 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -12,7 +12,6 @@ namespace CalamityMod public static ModKeybind AdrenalineHotKey { get; private set; } public static ModKeybind AstralTeleportHotKey { get; private set; } public static ModKeybind AstralArcanumUIHotkey { get; private set; } - public static ModKeybind MomentumCapacitatorHotkey { get; private set; } public static ModKeybind SandCloakHotkey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } public static ModKeybind PlaguePackHotKey { get; private set; } @@ -31,7 +30,6 @@ namespace CalamityMod SetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "Armor Set Bonus", "Y"); AstralTeleportHotKey = KeybindLoader.RegisterKeybind(Mod, "Astral Teleport", "P"); AstralArcanumUIHotkey = KeybindLoader.RegisterKeybind(Mod, "Astral Arcanum UI Toggle", "O"); - MomentumCapacitatorHotkey = KeybindLoader.RegisterKeybind(Mod, "Momentum Capacitor Effect", "U"); SandCloakHotkey = KeybindLoader.RegisterKeybind(Mod, "Sand Cloak Effect", "C"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "Spectral Veil Teleport", "Z"); PlaguePackHotKey = KeybindLoader.RegisterKeybind(Mod, "Booster Dash", "Q"); @@ -43,8 +41,6 @@ namespace CalamityMod public override void Unload() { - // Not required anymore, but nice nontheless - NormalityRelocatorHotKey = null; RageHotKey = null; AdrenalineHotKey = null; @@ -52,7 +48,6 @@ namespace CalamityMod SetBonusHotKey = null; AstralTeleportHotKey = null; AstralArcanumUIHotkey = null; - MomentumCapacitatorHotkey = null; SandCloakHotkey = null; SpectralVeilHotKey = null; PlaguePackHotKey = null; diff --git a/Items/Accessories/MomentumCapacitor.cs b/Items/Accessories/MomentumCapacitor.cs deleted file mode 100644 index f370acd603..0000000000 --- a/Items/Accessories/MomentumCapacitor.cs +++ /dev/null @@ -1,46 +0,0 @@ -using CalamityMod.CalPlayer; -using System.Collections.Generic; -using Terraria; -using Terraria.ModLoader; -using Terraria.ID; -using System.Linq; - -namespace CalamityMod.Items.Accessories -{ - public class MomentumCapacitor : ModItem - { - public override void SetStaticDefaults() - { - SacrificeTotal = 1; - DisplayName.SetDefault("Momentum Capacitor"); - Tooltip.SetDefault("TOOLTIP LINE HERE\n" + - "Rogue projectiles that enter the field get a constant acceleration and 15% damage boost\n" + - "These boosts can only happen to a projectile once\n" + - "There can only be one field"); - } - - public override void SetDefaults() - { - Item.width = 28; - Item.height = 32; - Item.value = Item.buyPrice(0, 36, 0, 0); - Item.accessory = true; - Item.rare = ItemRarityID.Pink; - } - - public override void ModifyTooltips(List list) - { - string hotkey = CalamityKeybinds.MomentumCapacitatorHotkey.TooltipHotkeyString(); - TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); - - if (line != null) - line.Text = "Press " + hotkey + " to consume 30% of your maximum stealth to create an energy field at the cursor position"; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.momentumCapacitor = true; - } - } -} diff --git a/Items/MomentumCapacitor.cs b/Items/MomentumCapacitor.cs new file mode 100644 index 0000000000..913428a2e0 --- /dev/null +++ b/Items/MomentumCapacitor.cs @@ -0,0 +1,47 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class MomentumCapacitor : ModItem + { + internal const float MomentumChargePerFrame = 0.02f; + internal const float MaxMomentumCharge = 5.8f; // +580% movemnt speed + internal const int TotalFadeTime = 16; + + public override void SetStaticDefaults() + { + SacrificeTotal = 1; + DisplayName.SetDefault("Momentum Capacitor"); + Tooltip.SetDefault("Hold down the button to charge the Momentum Capacitor,\n" + "continuously and uncontrollably increasing your top speed"); + } + + public override void SetDefaults() + { + Item.width = 28; + Item.height = 32; + Item.value = Item.buyPrice(gold: 36); + Item.rare = ItemRarityID.Pink; + + Item.useStyle = ItemUseStyleID.HoldUp; + Item.useTime = Item.useAnimation = 2; + Item.noMelee = true; + Item.channel = true; + Item.autoReuse = true; + Item.useTurn = true; + } + + public override bool? UseItem(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.momentumCapacitorTime = TotalFadeTime; + modPlayer.momentumCapacitorBoost += Main.rand.NextFloat(0.5f, 3.5f) * MomentumChargePerFrame; + if (modPlayer.momentumCapacitorBoost >= MaxMomentumCharge) + modPlayer.momentumCapacitorBoost = MaxMomentumCharge; + return null; + } + } +} diff --git a/Items/Accessories/MomentumCapacitor.png b/Items/MomentumCapacitor.png similarity index 100% rename from Items/Accessories/MomentumCapacitor.png rename to Items/MomentumCapacitor.png diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 069563d534..03821fb2f5 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4307,7 +4307,7 @@ namespace CalamityMod.NPCs { if (projectile.Calamity().pointBlankShotDuration > 0) { - float pointBlankShotDamageMultiplier = 1f + (projectile.Calamity().pointBlankShotDuration / (float)CalamityGlobalProjectile.basePointBlankShotDuration * 0.5f); + float pointBlankShotDamageMultiplier = 1f + (projectile.Calamity().pointBlankShotDuration / (float)CalamityGlobalProjectile.DefaultPointBlankDuration * 0.5f); damage = (int)(damage * pointBlankShotDamageMultiplier); projectile.Calamity().pointBlankShotDuration = 0; } @@ -4331,6 +4331,7 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.1); } + // TODO -- What in god's name is this? private void PierceResistGlobal(Projectile projectile, NPC npc, ref int damage) { if (CalamityLists.GrenadeResistIDs.Contains(projectile.type)) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index e168c1d337..8faae34f97 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -14,6 +14,8 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Items; + namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] diff --git a/Projectiles/BaseProjectiles/BaseMassiveExplosionProjectile.cs b/Projectiles/BaseProjectiles/BaseMassiveExplosionProjectile.cs index 89585cb7f1..b2c881c818 100644 --- a/Projectiles/BaseProjectiles/BaseMassiveExplosionProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseMassiveExplosionProjectile.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.scale = MathHelper.Lerp(1.2f, 5f, Utils.GetLerpValue(Lifetime, 0f, Projectile.timeLeft, true)); // Adjust the hitbox. - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(CurrentRadius * Projectile.scale), (int)(CurrentRadius * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(CurrentRadius * Projectile.scale), (int)(CurrentRadius * Projectile.scale)); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index d57c3bf03e..8a87972f75 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 48; Projectile.height = 48; Projectile.hostile = true; diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 318d94d6d4..50c1048800 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 28; Projectile.height = 28; Projectile.hostile = true; diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index 67aed63cf1..e985ea210f 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 35bb411109..2637bc339d 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 100; Projectile.height = 100; Projectile.hostile = true; diff --git a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs index 131faf1301..249b0644a5 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = Projectile.height = 2; Projectile.hostile = true; Projectile.ignoreWater = true; diff --git a/Projectiles/Boss/AresLaserBeamStart.cs b/Projectiles/Boss/AresLaserBeamStart.cs index 08e1cea26c..25f202d246 100644 --- a/Projectiles/Boss/AresLaserBeamStart.cs +++ b/Projectiles/Boss/AresLaserBeamStart.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/AresPlasmaBolt.cs b/Projectiles/Boss/AresPlasmaBolt.cs index be56a9b086..3522bd73f3 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index c921bd4876..6454c1d83c 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 36; Projectile.height = 36; Projectile.hostile = true; diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index f9efd1bae0..6eeee68648 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 22; Projectile.height = 22; Projectile.hostile = true; diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 4d3afdb748..7996fa9d3e 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index f7ce001560..72cca5d43e 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 50; Projectile.height = 50; Projectile.hostile = true; diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 809c752a7a..af5dfe7fd9 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 40; Projectile.height = 40; Projectile.hostile = true; diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 7682e48ab4..51f344c26c 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 40; Projectile.height = 40; Projectile.hostile = true; diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index 471609e14d..6c73872a6b 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 7c4da7c86c..9b9d36e557 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 320; Projectile.height = 320; Projectile.hostile = true; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 0c29de57b8..ea817c29aa 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 10; Projectile.height = 10; Projectile.hostile = true; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index bd247df10c..45af5bac7d 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 80; Projectile.height = 80; Projectile.hostile = true; diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index a50b60cb32..c7dc8a6559 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 80; Projectile.height = 80; Projectile.hostile = true; diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 033ea28b77..b61cf42fb1 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index fbe1aa6e23..408c5d5a6f 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 10; Projectile.height = 10; Projectile.hostile = true; diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index b23262f7bf..61098a51b3 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index c4a3a7c38e..9b0790e9bd 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.hostile = true; @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 48); + Projectile.ExpandHitboxBy(48); for (int d = 0; d < 2; d++) { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 02931fb34b..989142de27 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 48); + Projectile.ExpandHitboxBy(48); for (int d = 0; d < 2; d++) { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 6ab44f796f..e4f8741248 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 48); + Projectile.ExpandHitboxBy(48); for (int d = 0; d < 2; d++) { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index c30494d7d8..2f4276b6e2 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 320; Projectile.height = 88; Projectile.hostile = true; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.localAI[0] = 1f; Projectile.scale = (scaleBase - Projectile.ai[1]) * scaleMult / scaleBase; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); Projectile.netUpdate = true; } if (Projectile.ai[1] != -1f) diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 224ab6f092..337bcb2d31 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 22; Projectile.height = 22; Projectile.hostile = true; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 32d6554216..39e0c9b03a 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 180; Projectile.height = 180; Projectile.hostile = true; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 9c5e7a0ea1..13889396ea 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = 1; Projectile.penetrate = 1; Projectile.timeLeft = 200; - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; } public override void AI() @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 50); + Projectile.ExpandHitboxBy(50); int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int d = 0; d < 5; d++) { diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 1109483996..b7560a9aed 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index 277b108412..be196f9359 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.scale = 0.5f; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Boss } Projectile.scale = 1f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(30f * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(30f * Projectile.scale)); SoundEngine.PlaySound(SoundID.Item30, Projectile.Center); } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index a5552d0cbc..a7eeed3d50 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 320; Projectile.height = 88; Projectile.hostile = true; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.localAI[0] = 1f; Projectile.scale = (scaleBase - Projectile.ai[1]) * scaleMult / scaleBase; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); Projectile.netUpdate = true; } if (Projectile.ai[1] != -1f) diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 99e22ccdcd..08f2d8e567 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 320; Projectile.height = 88; Projectile.hostile = true; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { Projectile.localAI[0] = 1f; Projectile.scale = (scaleBase - Projectile.ai[1]) * scaleMult / scaleBase; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); Projectile.netUpdate = true; } if (Projectile.ai[1] != -1f) diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index 5d1c9d1b23..ef4d6b675a 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 172; Projectile.height = 172; Projectile.hostile = true; diff --git a/Projectiles/Boss/MajesticSparkle.cs b/Projectiles/Boss/MajesticSparkle.cs index e390bf2e81..1d906eda21 100644 --- a/Projectiles/Boss/MajesticSparkle.cs +++ b/Projectiles/Boss/MajesticSparkle.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss if (Time == 1f) { Projectile.scale = Main.rand.NextFloat(0.3f, 0.75f); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(Projectile.scale * 72f)); + Projectile.ExpandHitboxBy((int)(Projectile.scale * 72f)); ColorSpectrumHue = Main.rand.NextFloat(0f, 0.9999f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 5e79dc2905..e73e0d6e3a 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 42; Projectile.height = 42; Projectile.hostile = true; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index e8473dec5a..3300a198e8 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 12; Projectile.height = 12; Projectile.hostile = true; diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index d454c2566e..e1b729951e 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 408; Projectile.height = 408; Projectile.scale = 0.004f; diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 824f66fdfa..10e1314144 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index abf7854563..246c1bda48 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index d6d17d5392..69727f966a 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index e24a61d7c8..eb87e0b5de 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index d4cc517ba8..2db5aa407a 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index b2358b7074..aebfdd8455 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 48; Projectile.height = 48; Projectile.hostile = true; diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index 6986b2889e..0919fb2642 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 14; Projectile.height = 14; Projectile.hostile = true; diff --git a/Projectiles/Boss/SCalBrimstoneFireblast.cs b/Projectiles/Boss/SCalBrimstoneFireblast.cs index 95587886c5..c149b0cfd4 100644 --- a/Projectiles/Boss/SCalBrimstoneFireblast.cs +++ b/Projectiles/Boss/SCalBrimstoneFireblast.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 36; Projectile.height = 36; Projectile.hostile = true; diff --git a/Projectiles/Boss/SCalBrimstoneGigablast.cs b/Projectiles/Boss/SCalBrimstoneGigablast.cs index d047208ba1..bc04564d18 100644 --- a/Projectiles/Boss/SCalBrimstoneGigablast.cs +++ b/Projectiles/Boss/SCalBrimstoneGigablast.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 50; Projectile.height = 50; Projectile.hostile = true; diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 2fa1fa189a..647a03e86f 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 52; Projectile.height = 48; Projectile.hostile = true; diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 828434ad99..df15c69c97 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 44; Projectile.height = 44; Projectile.hostile = true; diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 242bbedd98..639751f8e7 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index a2821536f7..e39a523726 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; // These never naturally use rotations, so this shouldn't be an issue. Projectile.width = 100; diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index fde6f6b73d..72a3081f2c 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.timeLeft = 600; - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; CooldownSlot = 1; } diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index c0eff91248..63969be022 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 22; Projectile.height = 22; Projectile.hostile = true; diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index 46f2c682b4..f18e7d27b3 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 52; Projectile.height = 48; Projectile.hostile = true; diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index 445cfd8bff..e8d6ce30ba 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index b8f2e64e6e..1ea1544434 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 4499b1d7a5..4b50ac4011 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss speedX2 += 10f; } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 144); + Projectile.ExpandHitboxBy(144); for (int d = 0; d < 2; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 55, 0f, 0f, 50, default, 1.5f); diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index cc61ebd4ab..ecc88fa136 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Volume = SoundID.Item14.Volume * 0.5f }, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 144); + Projectile.ExpandHitboxBy(144); for (int d = 0; d < 2; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 55, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 073589f308..8c900b78f2 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -9,7 +9,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.NPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; @@ -66,7 +65,7 @@ namespace CalamityMod.Projectiles // Point-blank shot timer. public int pointBlankShotDuration = 0; - public const int basePointBlankShotDuration = 18; + public const int DefaultPointBlankDuration = 18; // 18 frames // Temporary damage reduction effects. public int damageReductionTimer = 0; @@ -78,21 +77,22 @@ namespace CalamityMod.Projectiles /// /// Allows hostile Projectiles to deal damage to the player's defense stat, used mostly for hard-hitting bosses. /// - public bool canBreakPlayerDefense = false; + public bool DealsDefenseDamage = false; // Rogue Stuff public bool stealthStrike = false; - public bool momentumCapacitatorBoost = false; // Constant acceleration - - // Counters and Timers public int stealthStrikeHitCount = 0; - - public int lineColor = 0; // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben public bool extorterBoost = false; + // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben + // TODO -- uses of this variable are undocumented and unstable. Remove it from the API surface. + public int lineColor = 0; + // Dogshit, hacky workarounds for the summon respawning system public bool RequiresManualResurrection = false; + // This flag is set to true on summon-classed attacks that are NOT minions, and thus should ALWAYS be able to hit enemies ALL the time. + // There are several enemies/NPCs in Calamity which do not take damage from minions in certain circumstances. public bool overridesMinionDamagePrevention = false; public static List MechBossProjectileIDs = new() @@ -117,7 +117,9 @@ namespace CalamityMod.Projectiles public int ExplosiveEnchantCountdown = 0; public const int ExplosiveEnchantTime = 2400; - // Update priority variable. + // Custom update priority. + // Calamity sorts projectiles by their update priority to fix otherwise absurdly difficult to resolve visual bugs on certain weapons. + // Examples include Mechworm segments detaching or Rancor's laser beam being offset from the magic circle. public float UpdatePriority = 0f; #region On Spawn @@ -223,7 +225,7 @@ namespace CalamityMod.Projectiles case ProjectileID.CandyCorn: case ProjectileID.Blizzard: case ProjectileID.LostSoulFriendly: - pointBlankShotDuration = basePointBlankShotDuration; + pointBlankShotDuration = DefaultPointBlankDuration; break; // Make bullets almost hitscan because that's how bullets should work in games :^) @@ -240,7 +242,7 @@ namespace CalamityMod.Projectiles case ProjectileID.GoldenBullet: case ProjectileID.MoonlordBullet: projectile.extraUpdates += 2; - pointBlankShotDuration = basePointBlankShotDuration; + pointBlankShotDuration = DefaultPointBlankDuration; break; case ProjectileID.FlamingJack: @@ -423,7 +425,7 @@ namespace CalamityMod.Projectiles case ProjectileID.CultistBossFireBall: case ProjectileID.CultistBossFireBallClone: case ProjectileID.CultistBossIceMist: - canBreakPlayerDefense = true; + DealsDefenseDamage = true; break; default: @@ -2380,13 +2382,6 @@ namespace CalamityMod.Projectiles } } - // Will always be friendly and rogue if it has this boost - if (modPlayer.momentumCapacitor && momentumCapacitatorBoost) - { - if (projectile.velocity.Length() < 26f) - projectile.velocity *= 1.05f; - } - if (player.meleeEnchant > 0 && !projectile.noEnchantments) { switch (player.meleeEnchant) @@ -2847,197 +2842,5 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, healProjectileType, 0, 0f, projectile.owner, healTarget, healAmount); } #endregion - - // TODO -- this entire region needs to go to Projectile Utilities - #region AI Shortcuts - public static Projectile SpawnOrb(Projectile projectile, int damage, int projType, float distanceRequired, float speedMult, bool gsPhantom = false) - { - float ai1 = Main.rand.NextFloat() + 0.5f; - int[] array = new int[Main.maxNPCs]; - int targetArrayA = 0; - int targetArrayB = 0; - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(projectile, false)) - { - float enemyDist = Vector2.Distance(projectile.Center, npc.Center); - if (enemyDist < distanceRequired) - { - if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && enemyDist > 50f) - { - array[targetArrayB] = i; - targetArrayB++; - } - else if (targetArrayB == 0) - { - array[targetArrayA] = i; - targetArrayA++; - } - } - } - } - if (targetArrayA == 0 && targetArrayB == 0) - { - return Projectile.NewProjectileDirect(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner); - } - int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, speedMult, speedMult, 1f); - Projectile orb = Projectile.NewProjectileDirect(projectile.GetSource_FromThis(), projectile.Center, velocity, projType, damage, 0f, projectile.owner, gsPhantom ? 0f : target, gsPhantom ? ai1 : 0f); - return orb; - } - - public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float N) - { - if (!projectile.friendly) - return; - - // Set amount of extra updates. - if (projectile.Calamity().defExtraUpdates == -1) - projectile.Calamity().defExtraUpdates = projectile.extraUpdates; - - Vector2 destination = projectile.Center; - float maxDistance = distanceRequired; - bool locatedTarget = false; - - // Find a target. - for (int i = 0; i < Main.maxNPCs; i++) - { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); - if (!Main.npc[i].CanBeChasedBy(projectile, false) || !projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance)) - continue; - - if (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) - { - destination = Main.npc[i].Center; - locatedTarget = true; - break; - } - } - - if (locatedTarget) - { - // Increase amount of extra updates to greatly increase homing velocity. - projectile.extraUpdates = projectile.Calamity().defExtraUpdates + 1; - - // Home in on the target. - Vector2 homeDirection = (destination - projectile.Center).SafeNormalize(Vector2.UnitY); - projectile.velocity = (projectile.velocity * N + homeDirection * homingVelocity) / (N + 1f); - } - else - { - // Set amount of extra updates to default amount. - projectile.extraUpdates = projectile.Calamity().defExtraUpdates; - } - } - - public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false) - { - // Only shoot once every N frames. - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > projectileTimer) - { - projectile.localAI[0] = 0f; - - // Only search for targets if projectiles could be fired. - float maxDistance = distanceRequired; - bool homeIn = false; - int[] targetArray = new int[maxTargets]; - int targetArrayIndex = 0; - - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); - - bool canHit = true; - if (extraDistance < maxDistance) - canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); - - if (projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit) - { - if (targetArrayIndex < maxTargets) - { - targetArray[targetArrayIndex] = i; - targetArrayIndex++; - homeIn = true; - } - else - break; - } - } - } - - // If there is anything to actually shoot at, pick targets at random and fire. - if (homeIn) - { - int randomTarget = Main.rand.Next(targetArrayIndex); - randomTarget = targetArray[randomTarget]; - - projectile.localAI[0] = 0f; - Vector2 spawnPos = projectile.Center + projectile.velocity * 4f; - Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - spawnPos) * homingVelocity; - - if (attackMultiple) - { - for (int i = 0; i < targetArrayIndex; i++) - { - velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - spawnPos) * homingVelocity; - - if (projectile.owner == Main.myPlayer) - { - int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); - - if (projectile.type == ProjectileType()) - if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; - } - } - - return; - } - - if (projectile.type == ProjectileType()) - { - velocity.Y += Main.rand.Next(-30, 31) * 0.05f; - velocity.X += Main.rand.Next(-30, 31) * 0.05f; - } - - if (projectile.owner == Main.myPlayer) - { - int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); - - if (projectile.type == ProjectileType() || - projectile.type == ProjectileType() || projectile.type == ProjectileType()) - if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].DamageType = DamageClass.Melee; - - if (projectile.type == ProjectileType()) - if (projectile2.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; - } - } - } - } - - public static void ExpandHitboxBy(Projectile projectile, int width, int height) - { - projectile.position = projectile.Center; - projectile.width = width; - projectile.height = height; - projectile.position -= projectile.Size * 0.5f; - } - - public static void ExpandHitboxBy(Projectile projectile, int newSize) - { - ExpandHitboxBy(projectile, newSize, newSize); - } - - public static void ExpandHitboxBy(Projectile projectile, float expandRatio) - { - ExpandHitboxBy(projectile, (int)(projectile.width * expandRatio), (int)(projectile.height * expandRatio)); - } - #endregion } } diff --git a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs index a897e98f99..cb6c5b2a01 100644 --- a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs +++ b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs @@ -94,11 +94,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); totalEnergyParticlesToSpawn = 4; RingDustEffect(Projectile.Center, 1.6f, 1.4f, 7f, 2.6f); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 160); + Projectile.ExpandHitboxBy(160); Projectile.damage /= 2; Projectile.Damage(); Projectile.damage *= 2; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 34); + Projectile.ExpandHitboxBy(34); } for (int i = 0; i < totalEnergyParticlesToSpawn; i++) diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index b270f29015..d036e2b379 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } else { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 360); + Projectile.ExpandHitboxBy(360); if (Main.myPlayer == Projectile.owner) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); diff --git a/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs b/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs index 9cfb966ecb..abd5fb72a9 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskLaser.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 60); + Projectile.ExpandHitboxBy(60); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index a803d06e07..93c7dabfdb 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Enemy public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.NPCDeath14, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 60); + Projectile.ExpandHitboxBy(60); for (int i = 0; i < 15; i++) { diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 6baa1f98cf..9bd732ea39 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Enemy/FlakAcid.cs b/Projectiles/Enemy/FlakAcid.cs index 4a7138148b..eab1b66b4c 100644 --- a/Projectiles/Enemy/FlakAcid.cs +++ b/Projectiles/Enemy/FlakAcid.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 150); + Projectile.ExpandHitboxBy(150); Projectile.Damage(); for (int i = 0; i <= 40; i++) { diff --git a/Projectiles/Enemy/GammaAcid.cs b/Projectiles/Enemy/GammaAcid.cs index 7012858478..d029975cb7 100644 --- a/Projectiles/Enemy/GammaAcid.cs +++ b/Projectiles/Enemy/GammaAcid.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); + Projectile.ExpandHitboxBy(80); Projectile.Damage(); for (int i = 0; i <= 40; i++) { diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index 6fc13255e9..e99dc45206 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { - Projectile.Calamity().canBreakPlayerDefense = true; + Projectile.Calamity().DealsDefenseDamage = true; Projectile.knockBack = 3f; Projectile.width = 72; Projectile.height = 30; diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index f1f8a8e642..8df67c5bb0 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.rotation = Projectile.velocity.ToRotation(); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 25f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/BeamingBolt2.cs b/Projectiles/Magic/BeamingBolt2.cs index 0e9435b61a..0c2faa8f58 100644 --- a/Projectiles/Magic/BeamingBolt2.cs +++ b/Projectiles/Magic/BeamingBolt2.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, randomDust, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/BeastScythe.cs b/Projectiles/Magic/BeastScythe.cs index ed758ab544..8a3eb09441 100644 --- a/Projectiles/Magic/BeastScythe.cs +++ b/Projectiles/Magic/BeastScythe.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile.velocity *= 1.001f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } } diff --git a/Projectiles/Magic/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs index f8d615c1de..f3027af2e8 100644 --- a/Projectiles/Magic/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 400f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 400f, 8f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/BrimstoneHomer.cs b/Projectiles/Magic/BrimstoneHomer.cs index b011832a4f..e72053a14b 100644 --- a/Projectiles/Magic/BrimstoneHomer.cs +++ b/Projectiles/Magic/BrimstoneHomer.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[brimstone].noGravity = true; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 8f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Magic/ClimaxProj.cs b/Projectiles/Magic/ClimaxProj.cs index e57117da70..43a9ed4734 100644 --- a/Projectiles/Magic/ClimaxProj.cs +++ b/Projectiles/Magic/ClimaxProj.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic // but once it's past that then it can fire constantly --Projectile.ai[0]; if (Projectile.ai[0] < 0f) - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 400f, 8f, VoltaicClimax.OrbFireRate, 2, ModContent.ProjectileType(), 1D, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 400f, 8f, VoltaicClimax.OrbFireRate, 2, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index 8c8440fdfe..256012aa33 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.scale <= 2.5f) { Projectile.scale *= 1.02f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(35f * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(35f * Projectile.scale)); } else if (Projectile.ai[0] < 2f) { diff --git a/Projectiles/Magic/DivineRetributionSpear.cs b/Projectiles/Magic/DivineRetributionSpear.cs index 89fd87ff20..cd11096f1f 100644 --- a/Projectiles/Magic/DivineRetributionSpear.cs +++ b/Projectiles/Magic/DivineRetributionSpear.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 9f, 20f); } else { diff --git a/Projectiles/Magic/ElementOrb.cs b/Projectiles/Magic/ElementOrb.cs index 06379ae664..d2567c8a91 100644 --- a/Projectiles/Magic/ElementOrb.cs +++ b/Projectiles/Magic/ElementOrb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); } } } diff --git a/Projectiles/Magic/ElementOrb2.cs b/Projectiles/Magic/ElementOrb2.cs index 688f4dc6fb..2531bcea98 100644 --- a/Projectiles/Magic/ElementOrb2.cs +++ b/Projectiles/Magic/ElementOrb2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); } } } diff --git a/Projectiles/Magic/EnormousConsumingVortex.cs b/Projectiles/Magic/EnormousConsumingVortex.cs index a91e941dc7..4571c906a3 100644 --- a/Projectiles/Magic/EnormousConsumingVortex.cs +++ b/Projectiles/Magic/EnormousConsumingVortex.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Magic ExplodeEffect(); Projectile.Kill(); } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(Projectile.scale * 62)); + Projectile.ExpandHitboxBy((int)(Projectile.scale * 62)); Time++; } @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Magic public void PulseEffect() { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, PulseHitboxExpandRatio); + Projectile.ExpandHitboxBy(PulseHitboxExpandRatio); Projectile.Damage(); if (!Main.dedServ) { @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = true; } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 1f / PulseHitboxExpandRatio); + Projectile.ExpandHitboxBy(1f / PulseHitboxExpandRatio); } public void ExplodeEffect() diff --git a/Projectiles/Magic/ForbiddenAxeBlade.cs b/Projectiles/Magic/ForbiddenAxeBlade.cs index b4df32b567..da8766eb3b 100644 --- a/Projectiles/Magic/ForbiddenAxeBlade.cs +++ b/Projectiles/Magic/ForbiddenAxeBlade.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic else if (Projectile.ai[1] > 20f && Projectile.ai[1] <= 39f) { Projectile.velocity *= 1.25f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 10f, 20f); } else if (Projectile.ai[1] == 40f) { diff --git a/Projectiles/Magic/GhastlyExplosionShard.cs b/Projectiles/Magic/GhastlyExplosionShard.cs index daac22cda7..7d4560a525 100644 --- a/Projectiles/Magic/GhastlyExplosionShard.cs +++ b/Projectiles/Magic/GhastlyExplosionShard.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic } if (Projectile.timeLeft < 50) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/GleamingBolt2.cs b/Projectiles/Magic/GleamingBolt2.cs index 100eee59f2..035048146e 100644 --- a/Projectiles/Magic/GleamingBolt2.cs +++ b/Projectiles/Magic/GleamingBolt2.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); else Projectile.velocity *= 0.985f; diff --git a/Projectiles/Magic/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs index 8198f8c650..5e74faab5a 100644 --- a/Projectiles/Magic/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.6f); if (Projectile.timeLeft < 60) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } } } diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index 3a73c996fe..511db49b6f 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Magic if (!initialized) { SoundEngine.PlaySound(SoundID.NPCHit53, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 20); + Projectile.ExpandHitboxBy(20); for (int d = 0; d < 5; d++) { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.timeLeft % 50 == 1 && Projectile.alpha <= 0) { SoundEngine.PlaySound(SoundID.NPCHit53, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 20); + Projectile.ExpandHitboxBy(20); for (int d = 0; d < 5; d++) { int ecto = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 229, 0f, 0f, 100, default, 0.5f); diff --git a/Projectiles/Magic/IceSpike.cs b/Projectiles/Magic/IceSpike.cs index 8167891c5b..71d1249c7c 100644 --- a/Projectiles/Magic/IceSpike.cs +++ b/Projectiles/Magic/IceSpike.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 67, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs index c20a315b5b..8d42b53aa3 100644 --- a/Projectiles/Magic/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile.localAI[0] = 1f; Projectile.scale = (scaleBase - Projectile.ai[1]) * scaleMult / scaleBase; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(baseWidth * Projectile.scale), (int)(baseHeight * Projectile.scale)); Projectile.netUpdate = true; } if (Projectile.ai[1] != -1f) diff --git a/Projectiles/Magic/LightBead.cs b/Projectiles/Magic/LightBead.cs index 0daac21aed..c887070d26 100644 --- a/Projectiles/Magic/LightBead.cs +++ b/Projectiles/Magic/LightBead.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic return; } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 15f, 15f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 15f, 15f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/LightBlade.cs b/Projectiles/Magic/LightBlade.cs index 86d79444d9..b165126a90 100644 --- a/Projectiles/Magic/LightBlade.cs +++ b/Projectiles/Magic/LightBlade.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Magic } // Also weakly home in on nearby enemies - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, Projectile.ai[0], EnemyHomingStrength); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, Projectile.ai[0], EnemyHomingStrength); // The projectile never slows down, even as it tries to curve towards enemies and its paired sword. float currentSpeed = Projectile.velocity.Length(); diff --git a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs index 55e36052f2..f57a740d66 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num458].noGravity = true; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 12f, 20f); } } } diff --git a/Projectiles/Magic/MagneticOrb.cs b/Projectiles/Magic/MagneticOrb.cs index d34928c62e..f0e244a5e3 100644 --- a/Projectiles/Magic/MagneticOrb.cs +++ b/Projectiles/Magic/MagneticOrb.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic } } - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 8f, FramesPerBeam, 1, ModContent.ProjectileType(), 1D, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 8f, FramesPerBeam, 1, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/ManaBoltSmall.cs b/Projectiles/Magic/ManaBoltSmall.cs index 4612af9cfa..4de9b08fbf 100644 --- a/Projectiles/Magic/ManaBoltSmall.cs +++ b/Projectiles/Magic/ManaBoltSmall.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; if (Projectile.timeLeft < 40) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 450f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 450f, 6f, 20f); else Projectile.velocity *= 0.975f; diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index cd0c33a986..25933ffbf4 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Magic private void Explode(bool reducedDmg = false) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 64); + Projectile.ExpandHitboxBy(64); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); Vector2 spawnPos = Projectile.Center; spawnPos.Y -= 70f; diff --git a/Projectiles/Magic/NightOrb.cs b/Projectiles/Magic/NightOrb.cs index 8041720dfa..ca5ed06c73 100644 --- a/Projectiles/Magic/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); } } } diff --git a/Projectiles/Magic/PartySparkle.cs b/Projectiles/Magic/PartySparkle.cs index d5fdfcdbf0..2d30752bf2 100644 --- a/Projectiles/Magic/PartySparkle.cs +++ b/Projectiles/Magic/PartySparkle.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic if (Time == 1f) { Projectile.scale = Main.rand.NextFloat(0.4f, 1.1f); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(72 * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(72 * Projectile.scale)); ColorSpectrumHue = Main.rand.NextFloat(0f, 0.9999f); Projectile.netUpdate = true; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Magic/Phantom.cs b/Projectiles/Magic/Phantom.cs index 388eaf8f1d..3c24d413dc 100644 --- a/Projectiles/Magic/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num458].noGravity = true; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } } } diff --git a/Projectiles/Magic/PoseidonTyphoon.cs b/Projectiles/Magic/PoseidonTyphoon.cs index ca6bfe86ed..08d83f8d0a 100644 --- a/Projectiles/Magic/PoseidonTyphoon.cs +++ b/Projectiles/Magic/PoseidonTyphoon.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, 0, (255 - Projectile.alpha) * 0.7f / 255f, (255 - Projectile.alpha) / 255f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 30f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/PrinceFlameSmall.cs b/Projectiles/Magic/PrinceFlameSmall.cs index 3c67df8f6c..7ec0b8c21c 100644 --- a/Projectiles/Magic/PrinceFlameSmall.cs +++ b/Projectiles/Magic/PrinceFlameSmall.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.Opacity = Utils.GetLerpValue(0f, 15f, Projectile.timeLeft, true); if (Time > AttackDelay) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, false, 600f, 14f, 32f); + CalamityUtils.HomeInOnNPC(Projectile, false, 600f, 14f, 32f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index c5e419eb20..569141548e 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Magic } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 350); + Projectile.ExpandHitboxBy(350); Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); diff --git a/Projectiles/Magic/RancorArm.cs b/Projectiles/Magic/RancorArm.cs index 2997795623..9b839e2798 100644 --- a/Projectiles/Magic/RancorArm.cs +++ b/Projectiles/Magic/RancorArm.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Magic } idealCenter.Y += 36f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)newSize.X, (int)newSize.Y); + Projectile.ExpandHitboxBy((int)newSize.X, (int)newSize.Y); // Sometimes use a slanted rotation. if (Main.rand.NextBool(3)) diff --git a/Projectiles/Magic/SubsumingTentacle.cs b/Projectiles/Magic/SubsumingTentacle.cs index 19b5c8c747..839a710f94 100644 --- a/Projectiles/Magic/SubsumingTentacle.cs +++ b/Projectiles/Magic/SubsumingTentacle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic { Projectile.oldPos[i] = Projectile.oldPos[i - 1] + Vector2.Normalize(Projectile.oldPos[i] - Projectile.oldPos[i - 1]) * SegmentOffset; } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(20f * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(20f * Projectile.scale)); if (Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height) && Projectile.tileCollide) { Projectile.tileCollide = false; diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index 4cdefeaf77..aa2436772d 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num102].noGravity = true; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 8f, 20f); Projectile.rotation += 0.3f * (float)Projectile.direction; } diff --git a/Projectiles/Magic/TerraShard.cs b/Projectiles/Magic/TerraShard.cs index 8c4d9ddc07..d0f4345f16 100644 --- a/Projectiles/Magic/TerraShard.cs +++ b/Projectiles/Magic/TerraShard.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic terraMagic.velocity *= 0.1f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, false, 500f, 15f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, false, 500f, 15f, 20f); } } } diff --git a/Projectiles/Magic/ThunderstormShot.cs b/Projectiles/Magic/ThunderstormShot.cs index aafd7e3375..e0a6666696 100644 --- a/Projectiles/Magic/ThunderstormShot.cs +++ b/Projectiles/Magic/ThunderstormShot.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic { CalamityUtils.ProjectileRain(source, Projectile.Center, 200f, 100f, 1500f, 1500f, 29f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 36); + Projectile.ExpandHitboxBy(36); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Magic/UndinesRetributionSpear.cs b/Projectiles/Magic/UndinesRetributionSpear.cs index 5428eb2384..024a11ad20 100644 --- a/Projectiles/Magic/UndinesRetributionSpear.cs +++ b/Projectiles/Magic/UndinesRetributionSpear.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Magic return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 9f, 20f); } else { diff --git a/Projectiles/Magic/VividLaser2.cs b/Projectiles/Magic/VividLaser2.cs index 91b3a2e76b..be9b105443 100644 --- a/Projectiles/Magic/VividLaser2.cs +++ b/Projectiles/Magic/VividLaser2.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[0] = 1f; if (Projectile.ai[0] >= 1f) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 400f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 400f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/VividOrb.cs b/Projectiles/Magic/VividOrb.cs index 913672a28b..9ac031c8f7 100644 --- a/Projectiles/Magic/VividOrb.cs +++ b/Projectiles/Magic/VividOrb.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType(), 1D, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType(), 1D, true); } } } diff --git a/Projectiles/Magic/VoidVortexProj.cs b/Projectiles/Magic/VoidVortexProj.cs index da821d0dd4..5e98f5ec2d 100644 --- a/Projectiles/Magic/VoidVortexProj.cs +++ b/Projectiles/Magic/VoidVortexProj.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic // but once it's past that then it can fire constantly --Projectile.ai[0]; if (Projectile.ai[0] < 0f) - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 400f, 8f, VoidVortex.OrbFireRate, 2, ModContent.ProjectileType(), 1D, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 400f, 8f, VoidVortex.OrbFireRate, 2, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs index 0d4a2f5a5f..045ffba912 100644 --- a/Projectiles/Melee/AncientStar.cs +++ b/Projectiles/Melee/AncientStar.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index 3d6876791a..78c852d143 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee { Lighting.AddLight(Projectile.Center, 0.6f, 0f, 0f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 8f, 20f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index 97bfeead83..8f9567a076 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Blood2.cs b/Projectiles/Melee/Blood2.cs index 6ac10ce4cb..3a0fdbc45b 100644 --- a/Projectiles/Melee/Blood2.cs +++ b/Projectiles/Melee/Blood2.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.timeLeft < 120) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); } } } diff --git a/Projectiles/Melee/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs index 241df7fa29..8a2fe8d90f 100644 --- a/Projectiles/Melee/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.05f / 255f, (255 - Projectile.alpha) * 0.05f / 255f); if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 15f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 15f); int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 235, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; diff --git a/Projectiles/Melee/CometQuasherMeteor.cs b/Projectiles/Melee/CometQuasherMeteor.cs index 8bb6198710..defa51ecb3 100644 --- a/Projectiles/Melee/CometQuasherMeteor.cs +++ b/Projectiles/Melee/CometQuasherMeteor.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item89, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(128f * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(128f * Projectile.scale)); for (int index = 0; index < 8; ++index) Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 31, 0.0f, 0.0f, 100, new Color(), 1.5f); for (int index1 = 0; index1 < 32; ++index1) diff --git a/Projectiles/Melee/CosmicOrb.cs b/Projectiles/Melee/CosmicOrb.cs index 31cbe7c94e..90606c74ff 100644 --- a/Projectiles/Melee/CosmicOrb.cs +++ b/Projectiles/Melee/CosmicOrb.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee } } - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 8f, 5, ModContent.ProjectileType()); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 8f, 5, ModContent.ProjectileType()); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/CrescentMoonProj.cs b/Projectiles/Melee/CrescentMoonProj.cs index efebd1cc6d..33a670fc25 100644 --- a/Projectiles/Melee/CrescentMoonProj.cs +++ b/Projectiles/Melee/CrescentMoonProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/DepthOrb2.cs b/Projectiles/Melee/DepthOrb2.cs index 3f3b55792a..5fd78f9b53 100644 --- a/Projectiles/Melee/DepthOrb2.cs +++ b/Projectiles/Melee/DepthOrb2.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += Projectile.velocity * 0.1f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/DragonRageFireball.cs b/Projectiles/Melee/DragonRageFireball.cs index 67e626b5d2..79e02090a3 100644 --- a/Projectiles/Melee/DragonRageFireball.cs +++ b/Projectiles/Melee/DragonRageFireball.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); + Projectile.ExpandHitboxBy(80); for (int d = 0; d < 5; d++) { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Melee/ElementBall.cs b/Projectiles/Melee/ElementBall.cs index 896bb34282..fe7203ef60 100644 --- a/Projectiles/Melee/ElementBall.cs +++ b/Projectiles/Melee/ElementBall.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num250].noGravity = true; Main.dust[num250].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index 1fd620d873..468019df6a 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[rainbow].noGravity = true; Main.dust[rainbow].velocity = Vector2.Zero; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/ElementalExcaliburBeam.cs b/Projectiles/Melee/ElementalExcaliburBeam.cs index cfefb189c2..1b8227c599 100644 --- a/Projectiles/Melee/ElementalExcaliburBeam.cs +++ b/Projectiles/Melee/ElementalExcaliburBeam.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Melee case 4: // Green, home in on enemies color = new Color(0, 255, 0, alpha); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 6f, 20f); break; @@ -341,7 +341,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 64); + Projectile.ExpandHitboxBy(64); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Melee/ElementalGlassStar.cs b/Projectiles/Melee/ElementalGlassStar.cs index ff5b7e5089..79006ab1d4 100644 --- a/Projectiles/Melee/ElementalGlassStar.cs +++ b/Projectiles/Melee/ElementalGlassStar.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 350f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 350f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 73e7410f53..185bb1b4cc 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation += 0.5f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 20f); if (Main.rand.NextBool(6)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 58, Projectile.velocity.X * 0.1f, Projectile.velocity.Y * 0.1f); } diff --git a/Projectiles/Melee/EntropicFlechette.cs b/Projectiles/Melee/EntropicFlechette.cs index 404b2e23d1..7823d853df 100644 --- a/Projectiles/Melee/EntropicFlechette.cs +++ b/Projectiles/Melee/EntropicFlechette.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/EntropicFlechetteLarge.cs b/Projectiles/Melee/EntropicFlechetteLarge.cs index 53c3d770bd..b93489fb11 100644 --- a/Projectiles/Melee/EntropicFlechetteLarge.cs +++ b/Projectiles/Melee/EntropicFlechetteLarge.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/EntropicFlechetteSmall.cs b/Projectiles/Melee/EntropicFlechetteSmall.cs index dec55453c1..4714967363 100644 --- a/Projectiles/Melee/EntropicFlechetteSmall.cs +++ b/Projectiles/Melee/EntropicFlechetteSmall.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index d04fd0cdc4..8273d58a87 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frame = 0; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 31fbd5738e..06c10e2f7b 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 173, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/Exocomet.cs b/Projectiles/Melee/Exocomet.cs index c22f7718db..c4be7fec65 100644 --- a/Projectiles/Melee/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(Projectile.Center, 0f, 0.5f, 0.5f); if (Projectile.timeLeft < 240) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 12f, 20f); else { float num953 = 100f * Projectile.ai[1]; diff --git a/Projectiles/Melee/Flarefrost.cs b/Projectiles/Melee/Flarefrost.cs index 83d822a178..aee8c561cd 100644 --- a/Projectiles/Melee/Flarefrost.cs +++ b/Projectiles/Melee/Flarefrost.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/GalileosMoon.cs b/Projectiles/Melee/GalileosMoon.cs index 97aa392da8..214a3e3ebb 100644 --- a/Projectiles/Melee/GalileosMoon.cs +++ b/Projectiles/Melee/GalileosMoon.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee } } Projectile.rotation += Projectile.direction * 0.55f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 10f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 10f, 25f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/GhastlySoulLarge.cs b/Projectiles/Melee/GhastlySoulLarge.cs index 5f811f995e..b986718d71 100644 --- a/Projectiles/Melee/GhastlySoulLarge.cs +++ b/Projectiles/Melee/GhastlySoulLarge.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } else { diff --git a/Projectiles/Melee/GhastlySoulMedium.cs b/Projectiles/Melee/GhastlySoulMedium.cs index 87f7bd3a08..b23f676c9f 100644 --- a/Projectiles/Melee/GhastlySoulMedium.cs +++ b/Projectiles/Melee/GhastlySoulMedium.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } else { diff --git a/Projectiles/Melee/GhastlySoulSmall.cs b/Projectiles/Melee/GhastlySoulSmall.cs index 20eda6684f..099f2ab5cb 100644 --- a/Projectiles/Melee/GhastlySoulSmall.cs +++ b/Projectiles/Melee/GhastlySoulSmall.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } else { diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index d3228588bf..150c911faa 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.X *= 1.05f; if (Projectile.timeLeft < 75) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 450f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 450f, 12f, 20f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/HyperBlade.cs b/Projectiles/Melee/HyperBlade.cs index 8e657dee2c..6ebeab7a7e 100644 --- a/Projectiles/Melee/HyperBlade.cs +++ b/Projectiles/Melee/HyperBlade.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee { Lighting.AddLight(Projectile.Center, 0f, 0.5f, 0f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 10f, 10f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 10f, 10f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index 575dc72828..006c20c367 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee } Projectile.scale = 1f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, (int)(30f * Projectile.scale)); + Projectile.ExpandHitboxBy((int)(30f * Projectile.scale)); SoundEngine.PlaySound(SoundID.Item30, Projectile.Center); } } diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index 46f7d3deae..0040309a2f 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation += 0.5f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); if (Main.rand.NextBool(6)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 20, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/JudgementBlah.cs b/Projectiles/Melee/JudgementBlah.cs index de536865d5..617ebb731c 100644 --- a/Projectiles/Melee/JudgementBlah.cs +++ b/Projectiles/Melee/JudgementBlah.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += Projectile.velocity * 0.1f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/JudgementProj.cs b/Projectiles/Melee/JudgementProj.cs index 7eafec7199..e2693c3959 100644 --- a/Projectiles/Melee/JudgementProj.cs +++ b/Projectiles/Melee/JudgementProj.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].velocity += Projectile.velocity * 0.1f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 9f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/OathswordFlame.cs b/Projectiles/Melee/OathswordFlame.cs index 631b73982c..a99837b543 100644 --- a/Projectiles/Melee/OathswordFlame.cs +++ b/Projectiles/Melee/OathswordFlame.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Projectile.Opacity = MathHelper.Clamp(Projectile.Opacity + 0.08f, 0f, 1f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, false, 700f, 15f, 10f); + CalamityUtils.HomeInOnNPC(Projectile, false, 700f, 15f, 10f); } public override Color? GetAlpha(Color lightColor) @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 100); + Projectile.ExpandHitboxBy(100); for (int k = 0; k < 10; k++) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 73, Projectile.oldVelocity.X * 2.5f, Projectile.oldVelocity.Y * 2.5f); } diff --git a/Projectiles/Melee/PlagueSeeker.cs b/Projectiles/Melee/PlagueSeeker.cs index 2f7b039002..fc7c3468de 100644 --- a/Projectiles/Melee/PlagueSeeker.cs +++ b/Projectiles/Melee/PlagueSeeker.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/RainBolt.cs b/Projectiles/Melee/RainBolt.cs index 21772c0c58..2588f12bb5 100644 --- a/Projectiles/Melee/RainBolt.cs +++ b/Projectiles/Melee/RainBolt.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num469].velocity *= 0f; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); else Projectile.velocity *= 0.95f; } diff --git a/Projectiles/Melee/Razorwind.cs b/Projectiles/Melee/Razorwind.cs index bf2acdfb41..a0244ee847 100644 --- a/Projectiles/Melee/Razorwind.cs +++ b/Projectiles/Melee/Razorwind.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Melee/SandFire.cs b/Projectiles/Melee/SandFire.cs index 1406d97fcf..6ec6694ecd 100644 --- a/Projectiles/Melee/SandFire.cs +++ b/Projectiles/Melee/SandFire.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/StormBeam.cs b/Projectiles/Melee/StormBeam.cs index 92e78595e1..66a7cdbc15 100644 --- a/Projectiles/Melee/StormBeam.cs +++ b/Projectiles/Melee/StormBeam.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { Lighting.AddLight(Projectile.Center, 0f, 0.25f, 0.25f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, false, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, false, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/TerratomereProjectile.cs b/Projectiles/Melee/TerratomereProjectile.cs index ed75b99e91..ebcc64fde2 100644 --- a/Projectiles/Melee/TerratomereProjectile.cs +++ b/Projectiles/Melee/TerratomereProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.75f / 255f, 0f); } diff --git a/Projectiles/Melee/TinyCrystal.cs b/Projectiles/Melee/TinyCrystal.cs index 13d704cf50..31c2b5468d 100644 --- a/Projectiles/Melee/TinyCrystal.cs +++ b/Projectiles/Melee/TinyCrystal.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.timeLeft < 75) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 9f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/TinyFlare.cs b/Projectiles/Melee/TinyFlare.cs index 74d57257d3..425d6df1e5 100644 --- a/Projectiles/Melee/TinyFlare.cs +++ b/Projectiles/Melee/TinyFlare.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/UltimusCleaverDust.cs b/Projectiles/Melee/UltimusCleaverDust.cs index 8c194c4ba9..4dfc232938 100644 --- a/Projectiles/Melee/UltimusCleaverDust.cs +++ b/Projectiles/Melee/UltimusCleaverDust.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity.Y = 16f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); } } } diff --git a/Projectiles/Melee/Whiterain.cs b/Projectiles/Melee/Whiterain.cs index 4d0902153a..a615c1d707 100644 --- a/Projectiles/Melee/Whiterain.cs +++ b/Projectiles/Melee/Whiterain.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].velocity += Projectile.velocity * 0.1f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } } } diff --git a/Projectiles/Melee/WhiterainBlah.cs b/Projectiles/Melee/WhiterainBlah.cs index e2adcc4eba..ef0da305c0 100644 --- a/Projectiles/Melee/WhiterainBlah.cs +++ b/Projectiles/Melee/WhiterainBlah.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num458].velocity += Projectile.velocity * 0.1f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } } } diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index 4ea19e73c4..b475cf969a 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 60f, 5, ModContent.ProjectileType(), 0.25); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 60f, 5, ModContent.ProjectileType(), 0.25); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index 3383414ab4..5ad98eef69 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 240f, 6f, 180f, 3, ModContent.ProjectileType(), 0.25); + CalamityUtils.MagnetSphereHitscan(Projectile, 240f, 6f, 180f, 3, ModContent.ProjectileType(), 0.25); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs index e3fd66d026..fda3f60a5d 100644 --- a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs +++ b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 30f, 5, ProjectileID.SlimeGun, 0.75); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 30f, 5, ProjectileID.SlimeGun, 0.75); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index b697a12d4b..8a885dd1c7 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 48f, 5, ModContent.ProjectileType(), 0.5); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 48f, 5, ModContent.ProjectileType(), 0.5); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index a6d51c141f..f8abff22dd 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 180f, 5, ModContent.ProjectileType(), 0.75); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 180f, 5, ModContent.ProjectileType(), 0.75); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs index 852c8dac88..520224d910 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, 120f, 5, ProjectileID.HallowStar); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 120f, 5, ProjectileID.HallowStar); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Melee/Yoyos/VerdantYoyo.cs b/Projectiles/Melee/Yoyos/VerdantYoyo.cs index 5d73f31cea..ee73fd0c78 100644 --- a/Projectiles/Melee/Yoyos/VerdantYoyo.cs +++ b/Projectiles/Melee/Yoyos/VerdantYoyo.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (Main.rand.NextBool(5)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 75, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 12f, 54f, 5, ProjectileID.CrystalLeafShot, 0.8); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 12f, 54f, 5, ProjectileID.CrystalLeafShot, 0.8); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 80e925a961..80dcf7792a 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 10f, 144f, 5, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); } diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index fafec75ae7..cb34b281c8 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AccelerationRoundProj.cs b/Projectiles/Ranged/AccelerationRoundProj.cs index d934ed39f8..3a08c28a21 100644 --- a/Projectiles/Ranged/AccelerationRoundProj.cs +++ b/Projectiles/Ranged/AccelerationRoundProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AcidRoundProj.cs b/Projectiles/Ranged/AcidRoundProj.cs index c917ebad5f..f6da436f40 100644 --- a/Projectiles/Ranged/AcidRoundProj.cs +++ b/Projectiles/Ranged/AcidRoundProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 7ab081d057..e7d3e38db3 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 8ad2d755de..ed34d8a0c9 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 7d7910012b..81c5700f00 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AquashardSplit.cs b/Projectiles/Ranged/AquashardSplit.cs index 06b40c12cb..4d887e6616 100644 --- a/Projectiles/Ranged/AquashardSplit.cs +++ b/Projectiles/Ranged/AquashardSplit.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.velocity.Y += 0.01f; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index a76f5a53b9..b80507570b 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.alpha = 255; Projectile.timeLeft = 600; Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index abf14129e5..d1e1a9c1cd 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.aiStyle = 1; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 94e2112dbf..1eea0dc300 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 2; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Ranged if (speed == 0f) speed = Projectile.velocity.Length(); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, speed, 12f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, speed, 12f); return false; } diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index be439558ec..7d7e135620 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 36a364f76f..bbd1bc7110 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index ee4962139d..d64c2980a7 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame = 0; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/AuralisBullet.cs b/Projectiles/Ranged/AuralisBullet.cs index 71a4f31e3b..df415401ae 100644 --- a/Projectiles/Ranged/AuralisBullet.cs +++ b/Projectiles/Ranged/AuralisBullet.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 10; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 3cac483fa6..b0e3be5217 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; Projectile.aiStyle = 1; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index fe46066b6d..84118fe5e6 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 6; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/BigCoral.cs b/Projectiles/Ranged/BigCoral.cs index fba0d13281..32fe8910ca 100644 --- a/Projectiles/Ranged/BigCoral.cs +++ b/Projectiles/Ranged/BigCoral.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 8cb61d7221..b3c22a2f67 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num249].velocity *= 0.05f; } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 720); + Projectile.ExpandHitboxBy(720); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Ranged float kb = 0f; player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 16); + Projectile.ExpandHitboxBy(16); if (Projectile.owner == Main.myPlayer && (projID == ProjectileID.RocketII || projID == ProjectileID.RocketIV)) { diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index ac11e4c9f8..ea590ebdd8 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 21c9166052..6bc1166a0c 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.ai[1] == 80f) //means it's from Arterial Assault's wooden arrow conversion - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index d4b0500443..38ddf4fac7 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 4; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodflareSoul.cs b/Projectiles/Ranged/BloodflareSoul.cs index fb60209d22..91f791f06d 100644 --- a/Projectiles/Ranged/BloodflareSoul.cs +++ b/Projectiles/Ranged/BloodflareSoul.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.velocity = (Projectile.velocity * (num953 - 1f) + moveDirection * scaleFactor12) / num953; return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 11f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 11f, 20f); } else { diff --git a/Projectiles/Ranged/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs index 5ec83aa688..d370a0db90 100644 --- a/Projectiles/Ranged/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index f274d4e0a4..aa24880c0b 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(BuffID.Electrified, 60); diff --git a/Projectiles/Ranged/BouncingShotgunPellet.cs b/Projectiles/Ranged/BouncingShotgunPellet.cs index 8223a28e76..5feeaad4d6 100644 --- a/Projectiles/Ranged/BouncingShotgunPellet.cs +++ b/Projectiles/Ranged/BouncingShotgunPellet.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; AIType = ProjectileID.BulletHighVelocity; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); for (int d = 0; d < 2; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index 3dc096dd35..e4c7b7767f 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 3; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/CardClubSplit.cs b/Projectiles/Ranged/CardClubSplit.cs index 074bc3c5e0..0e2ec35af9 100644 --- a/Projectiles/Ranged/CardClubSplit.cs +++ b/Projectiles/Ranged/CardClubSplit.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.alpha < 128) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } } diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 7edade01e4..7422bea684 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 3; Projectile.alpha = 255; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs index ee9e5c0e0c..56ba50b3f0 100644 --- a/Projectiles/Ranged/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 3; Projectile.alpha = 255; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index 3d3553be08..95b1a466e1 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num155].velocity += Projectile.velocity * 0.5f; } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 25f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/ClamorRifleProjSplit.cs b/Projectiles/Ranged/ClamorRifleProjSplit.cs index 628e2f2fac..62fb6df470 100644 --- a/Projectiles/Ranged/ClamorRifleProjSplit.cs +++ b/Projectiles/Ranged/ClamorRifleProjSplit.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 25f); } } } diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs index ffe76dff7a..453eb119bd 100644 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ b/Projectiles/Ranged/ClaretCannonProj.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.aiStyle = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index e0f2796871..76cbe47d5a 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.extraUpdates = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index d5a1778e6b..ecb028a5df 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index 8eec6116a2..204a4c3cdb 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index 7be42194d8..8c6348f297 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DragonsBreathRound.cs b/Projectiles/Ranged/DragonsBreathRound.cs index adfa8adb5d..5a639d1b9a 100644 --- a/Projectiles/Ranged/DragonsBreathRound.cs +++ b/Projectiles/Ranged/DragonsBreathRound.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 180; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 235289341f..d3aac581f5 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/EnhancedNanoRoundProj.cs b/Projectiles/Ranged/EnhancedNanoRoundProj.cs index eba90aab1f..6f88bbbcaa 100644 --- a/Projectiles/Ranged/EnhancedNanoRoundProj.cs +++ b/Projectiles/Ranged/EnhancedNanoRoundProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ExoFlareCluster.cs b/Projectiles/Ranged/ExoFlareCluster.cs index 97c53aec73..6a6ba13e61 100644 --- a/Projectiles/Ranged/ExoFlareCluster.cs +++ b/Projectiles/Ranged/ExoFlareCluster.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged { int width = (int)MathHelper.Min(target.Hitbox.Width, 60); int height = (int)MathHelper.Min(target.Hitbox.Height, 60); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, width, height); + Projectile.ExpandHitboxBy(width, height); } target.ExoDebuffs(2f); } diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index 47ab2e6ed8..4987dbc2be 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs index 2a221a6f60..41be0001b5 100644 --- a/Projectiles/Ranged/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index 75c6461f0b..336f458502 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlashRoundProj.cs b/Projectiles/Ranged/FlashRoundProj.cs index bb4ced929c..8a054a07d4 100644 --- a/Projectiles/Ranged/FlashRoundProj.cs +++ b/Projectiles/Ranged/FlashRoundProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 24ce7da73b..26593557cb 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.coldDamage = true; Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index 19740713ef..35ac1bdd2c 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.aiStyle = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FungiOrb2.cs b/Projectiles/Ranged/FungiOrb2.cs index 8d401fd815..9b4db19ddd 100644 --- a/Projectiles/Ranged/FungiOrb2.cs +++ b/Projectiles/Ranged/FungiOrb2.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index 7df7629517..20ef0dcd1c 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(Projectile.tileCollide); @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Ranged // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. Reset the point blank timer. Projectile.damage = (int)(0.28f * Projectile.damage); Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; @@ -164,7 +164,7 @@ namespace CalamityMod.Projectiles.Ranged // Turn blue to set stats correctly, if not already done. if (!BlueMode) TurnBlue(false); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 48); + Projectile.ExpandHitboxBy(48); Projectile.Damage(); // Create a fancy triangle of dust. diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 3e4ed5ab74..7f3cdc2b80 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 160); + Projectile.ExpandHitboxBy(160); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 9; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs index 83c27ea0c5..ddd4db2b7a 100644 --- a/Projectiles/Ranged/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index e4426129b0..f10c743049 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 64); + Projectile.ExpandHitboxBy(64); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 7; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index ca1f236dc4..cdeec2d50c 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); + Projectile.ExpandHitboxBy(80); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 8; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 4a18b406a6..b0c9771852 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.MaxUpdates = 5; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 2ed26c0b39..4c6b35c626 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 8ce61503ac..8d951d7bdb 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void SetStaticDefaults() diff --git a/Projectiles/Ranged/IcyBulletProj.cs b/Projectiles/Ranged/IcyBulletProj.cs index f82c2133ff..afc20bfebe 100644 --- a/Projectiles/Ranged/IcyBulletProj.cs +++ b/Projectiles/Ranged/IcyBulletProj.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 20; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/IlluminatedBullet.cs b/Projectiles/Ranged/IlluminatedBullet.cs index 52d4c95d98..79ee5c4205 100644 --- a/Projectiles/Ranged/IlluminatedBullet.cs +++ b/Projectiles/Ranged/IlluminatedBullet.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged // Invisible for the first few frames Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index c5dc714def..73ba7ea7a8 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index 7a261a2839..1c0996e7bd 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index 5270d454a1..4fe628524c 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LunarBolt2.cs b/Projectiles/Ranged/LunarBolt2.cs index ea8500be0a..fa26093b5b 100644 --- a/Projectiles/Ranged/LunarBolt2.cs +++ b/Projectiles/Ranged/LunarBolt2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LuxorsGiftRanged.cs b/Projectiles/Ranged/LuxorsGiftRanged.cs index 8d896485b1..f8b1aed232 100644 --- a/Projectiles/Ranged/LuxorsGiftRanged.cs +++ b/Projectiles/Ranged/LuxorsGiftRanged.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 16); + Projectile.ExpandHitboxBy(16); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Ranged/MagnaStrike.cs b/Projectiles/Ranged/MagnaStrike.cs index 074c7df087..abfd0f1b15 100644 --- a/Projectiles/Ranged/MagnaStrike.cs +++ b/Projectiles/Ranged/MagnaStrike.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 6088be78f6..da4468841f 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -76,14 +76,14 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[exo].noGravity = true; Main.dust[exo].noLight = true; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } public override void Kill(int timeLeft) { if (Projectile.owner == Main.myPlayer) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 192); + Projectile.ExpandHitboxBy(192); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); //DO NOT REMOVE THIS PROJECTILE Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index d83890feaf..b8de264dfc 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -75,12 +75,12 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num249].velocity *= 0.05f; } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 6; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index 9251a34f89..acba6b3088 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.alpha = 255; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/MiniatureFolly.cs b/Projectiles/Ranged/MiniatureFolly.cs index 3a5b703920..af54383ddf 100644 --- a/Projectiles/Ranged/MiniatureFolly.cs +++ b/Projectiles/Ranged/MiniatureFolly.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? MathHelper.Pi : 0f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 10f, 20f); } } } diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index d14ed24fe4..576ee69007 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.WoodenArrowFriendly; Projectile.arrow = true; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index adf12b43bf..13cc7c07b9 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 200); + Projectile.ExpandHitboxBy(200); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 307ab32f7d..a47e30ee7b 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int j = 0; j < 5; j++) { diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index d4d9e4ac79..a80e558c7b 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3), Projectile.knockBack * 0.1f, Projectile.owner); } SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 144); + Projectile.ExpandHitboxBy(144); for (int d = 0; d < 4; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f); diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index 8a597beb6b..34323a1de8 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 192); + Projectile.ExpandHitboxBy(192); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Ranged else if (projID == ProjectileID.RocketIV) blastRadius = 12; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 22); + Projectile.ExpandHitboxBy(22); if (Projectile.owner == Main.myPlayer && blastRadius > 0) { diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index ce26318011..e7c77cc2d1 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 120; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index 9fa4d8b3df..72b7717cc9 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 120; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index ff8f07c9b5..dbbfe0dd76 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index d19a7c15c5..a2107d2ce7 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 188); + Projectile.ExpandHitboxBy(188); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index 288920c4e0..e320a9fe99 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.BulletHighVelocity; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index b084d4ceb9..8f18ca9ccf 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 45d5009743..4a871ddfdc 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.aiStyle = 1; AIType = ProjectileID.BulletHighVelocity; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs index ca03a746f3..9dc439fa64 100644 --- a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs +++ b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 0fe84a22ab..adda152d89 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.ai[1] == 2f) //Boost three { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } else if (Projectile.ai[1] == 1f) //Boost two { @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Projectile.ai[1] == 2f) //Boost three { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 150); + Projectile.ExpandHitboxBy(150); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs index 855939a2fc..620dceb886 100644 --- a/Projectiles/Ranged/PrismComet.cs +++ b/Projectiles/Ranged/PrismComet.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Zombie103, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); + Projectile.ExpandHitboxBy(80); Projectile.Damage(); if (Main.myPlayer != Projectile.owner) diff --git a/Projectiles/Ranged/PumplerGrenade.cs b/Projectiles/Ranged/PumplerGrenade.cs index 504340ab38..d5754f4532 100644 --- a/Projectiles/Ranged/PumplerGrenade.cs +++ b/Projectiles/Ranged/PumplerGrenade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; Projectile.ignoreWater = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override string Texture => "CalamityMod/Projectiles/Ranged/PumplerGrenade"; diff --git a/Projectiles/Ranged/RainbowBlast.cs b/Projectiles/Ranged/RainbowBlast.cs index 19bb13841b..5591d21e1c 100644 --- a/Projectiles/Ranged/RainbowBlast.cs +++ b/Projectiles/Ranged/RainbowBlast.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num469].velocity = dspeed; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index ff2f968642..1785a4f4ba 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 3; Projectile.penetrate = 1; Projectile.timeLeft = 90; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); for (int d = 0; d < 2; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index 3a9078cde2..20ba5225d5 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { int penetrateAmt = Projectile.penetrate; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 200); + Projectile.ExpandHitboxBy(200); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer) { @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 200); + Projectile.ExpandHitboxBy(200); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; @@ -204,7 +204,7 @@ namespace CalamityMod.Projectiles.Ranged } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 14); + Projectile.ExpandHitboxBy(14); if (Projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/SandstormBullet.cs b/Projectiles/Ranged/SandstormBullet.cs index 838f039b07..83a27a587b 100644 --- a/Projectiles/Ranged/SandstormBullet.cs +++ b/Projectiles/Ranged/SandstormBullet.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.aiStyle = 1; Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SandyWaifuShark.cs b/Projectiles/Ranged/SandyWaifuShark.cs index 1300a93f15..76832facb1 100644 --- a/Projectiles/Ranged/SandyWaifuShark.cs +++ b/Projectiles/Ranged/SandyWaifuShark.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); if (Projectile.timeLeft < 210) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/ScorchedEarthRocket.cs b/Projectiles/Ranged/ScorchedEarthRocket.cs index a67634f211..1344393d1b 100644 --- a/Projectiles/Ranged/ScorchedEarthRocket.cs +++ b/Projectiles/Ranged/ScorchedEarthRocket.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frame = 6; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 400f, 5f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, true, 400f, 5f, 30f); //Rotation Projectile.rotation = Projectile.velocity.ToRotation(); @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.owner == Main.myPlayer) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 300); + Projectile.ExpandHitboxBy(300); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); if (Main.netMode != NetmodeID.Server) diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index 738ddb7933..825e76c695 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -77,12 +77,12 @@ namespace CalamityMod.Projectiles.Ranged } } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 192); + Projectile.ExpandHitboxBy(192); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index 88a08002b4..f8483c859d 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 8; Projectile.timeLeft = 900; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Shell.cs b/Projectiles/Ranged/Shell.cs index 35561d69c1..6f0bded4ef 100644 --- a/Projectiles/Ranged/Shell.cs +++ b/Projectiles/Ranged/Shell.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; Projectile.arrow = true; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index b0c2478d22..d84450a17b 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.5f; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/Shroom.cs b/Projectiles/Ranged/Shroom.cs index 29b9b5511d..1945465fa8 100644 --- a/Projectiles/Ranged/Shroom.cs +++ b/Projectiles/Ranged/Shroom.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { Lighting.AddLight(Projectile.Center, 0f, 0.2f, 0.6f); Projectile.rotation += 1f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index 39794faaab..3c71e3d061 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 4; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SicknessRound2.cs b/Projectiles/Ranged/SicknessRound2.cs index 953ff492e6..626273c089 100644 --- a/Projectiles/Ranged/SicknessRound2.cs +++ b/Projectiles/Ranged/SicknessRound2.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 25f); return false; } diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index 7f1916fcd0..f838073774 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SmallCoral.cs b/Projectiles/Ranged/SmallCoral.cs index 93fd3aa149..f083f17601 100644 --- a/Projectiles/Ranged/SmallCoral.cs +++ b/Projectiles/Ranged/SmallCoral.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.aiStyle = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SputterCometBig.cs b/Projectiles/Ranged/SputterCometBig.cs index 5184e7d1ac..e3313e8aa7 100644 --- a/Projectiles/Ranged/SputterCometBig.cs +++ b/Projectiles/Ranged/SputterCometBig.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(SoundID.Item9, Projectile.position); } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SulphuricBlast.cs b/Projectiles/Ranged/SulphuricBlast.cs index 4b67d98c65..b482c124a1 100644 --- a/Projectiles/Ranged/SulphuricBlast.cs +++ b/Projectiles/Ranged/SulphuricBlast.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged // Home in on enemies if not sticking to anything. if (Projectile.ai[0] != 1f) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } } diff --git a/Projectiles/Ranged/SuperballBulletProj.cs b/Projectiles/Ranged/SuperballBulletProj.cs index 8a6f51aaf8..d8bec66391 100644 --- a/Projectiles/Ranged/SuperballBulletProj.cs +++ b/Projectiles/Ranged/SuperballBulletProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs index dab12c65dd..210e4c7297 100644 --- a/Projectiles/Ranged/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index 3393c1969c..a29846e67d 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; // Can hit up to two enemies. Will explode extremely soon after hitting the first, though. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanDamage() => Projectile.timeLeft < Lifetime - 4 ? null : false; diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 1035851d4c..d4da77d0d4 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); SoundEngine.PlaySound(SoundID.Item60, Projectile.Center); for (int d = 0; d < 3; d++) { diff --git a/Projectiles/Ranged/TerraArrowSplit.cs b/Projectiles/Ranged/TerraArrowSplit.cs index aef43f0d16..76b344e9d8 100644 --- a/Projectiles/Ranged/TerraArrowSplit.cs +++ b/Projectiles/Ranged/TerraArrowSplit.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/TerraBulletMain.cs b/Projectiles/Ranged/TerraBulletMain.cs index 97a6ca42ef..74fc2e538a 100644 --- a/Projectiles/Ranged/TerraBulletMain.cs +++ b/Projectiles/Ranged/TerraBulletMain.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.alpha = 255; Projectile.extraUpdates = 3; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TerraBulletSplit.cs b/Projectiles/Ranged/TerraBulletSplit.cs index 8c5acfe22e..8610e75a74 100644 --- a/Projectiles/Ranged/TerraBulletSplit.cs +++ b/Projectiles/Ranged/TerraBulletSplit.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged speed = Projectile.velocity.Length(); if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, speed, 12f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, speed, 12f); } } } diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index ba3c8a99b0..d907d2d4a4 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.Opacity = 0f; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ThePackMinissile.cs b/Projectiles/Ranged/ThePackMinissile.cs index 71d72ac9f0..171d3915e6 100644 --- a/Projectiles/Ranged/ThePackMinissile.cs +++ b/Projectiles/Ranged/ThePackMinissile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 15f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 15f); Projectile.frameCounter++; if (Projectile.frameCounter > 3) { diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index a5244c3692..5820580576 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ToxicArrow.cs b/Projectiles/Ranged/ToxicArrow.cs index 5801084f2a..7cc4901f04 100644 --- a/Projectiles/Ranged/ToxicArrow.cs +++ b/Projectiles/Ranged/ToxicArrow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 240; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index 43c83e495e..f63bbf2191 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 180); + Projectile.ExpandHitboxBy(180); Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.damage /= 2; diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 41f31ee613..c999fa8757 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = 1; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs index d753bb7dfe..2cf671b77c 100644 --- a/Projectiles/Ranged/UltimaBolt.cs +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 90, 90); + Projectile.ExpandHitboxBy(90, 90); Projectile.Damage(); ProduceExplosionDust(32); } diff --git a/Projectiles/Ranged/UltimaSpark.cs b/Projectiles/Ranged/UltimaSpark.cs index 56dc077444..48365c3da1 100644 --- a/Projectiles/Ranged/UltimaSpark.cs +++ b/Projectiles/Ranged/UltimaSpark.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 60, 60); + Projectile.ExpandHitboxBy(60, 60); Projectile.Damage(); if (!Main.dedServ) { diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index 7c330ac659..bb11f24f96 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/VanquisherArrowMain.cs b/Projectiles/Ranged/VanquisherArrowMain.cs index 57b983efdb..b75afe0417 100644 --- a/Projectiles/Ranged/VanquisherArrowMain.cs +++ b/Projectiles/Ranged/VanquisherArrowMain.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 90; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/VeriumBulletProj.cs b/Projectiles/Ranged/VeriumBulletProj.cs index 4a6801eb07..4a0a369959 100644 --- a/Projectiles/Ranged/VeriumBulletProj.cs +++ b/Projectiles/Ranged/VeriumBulletProj.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.Bullet; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/VoidragonTentacle.cs b/Projectiles/Ranged/VoidragonTentacle.cs index 07847a331c..0dce204163 100644 --- a/Projectiles/Ranged/VoidragonTentacle.cs +++ b/Projectiles/Ranged/VoidragonTentacle.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index a0725d0eab..0c8f4a6a5a 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item9, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 96); + Projectile.ExpandHitboxBy(96); Projectile.localNPCHitCooldown = 10; Projectile.usesLocalNPCImmunity = true; Projectile.Damage(); diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 9d33600711..c3fe454283 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.ai[1] = 0f; Projectile.alpha = 255; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 128); + Projectile.ExpandHitboxBy(128); } Projectile.ai[0] += 1f; if (Projectile.ai[0] > 10f) @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 128); + Projectile.ExpandHitboxBy(128); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int projAmt = Main.rand.Next(3, 5); if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Rogue/CelestusBoomerang.cs b/Projectiles/Rogue/CelestusBoomerang.cs index f9f1bd20bd..524ba6dba5 100644 --- a/Projectiles/Rogue/CelestusBoomerang.cs +++ b/Projectiles/Rogue/CelestusBoomerang.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Rogue } break; case 2f: - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, speed, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, speed, 20f); break; default: break; diff --git a/Projectiles/Rogue/CinquedeaProj.cs b/Projectiles/Rogue/CinquedeaProj.cs index 9de467618d..4ad119049a 100644 --- a/Projectiles/Rogue/CinquedeaProj.cs +++ b/Projectiles/Rogue/CinquedeaProj.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Rogue //Stealth strike if (stealthstrike) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 7f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 7f, 20f); } //Gravity code else diff --git a/Projectiles/Rogue/CobaltEnergy.cs b/Projectiles/Rogue/CobaltEnergy.cs index ea22f2ec7b..b4b144659f 100644 --- a/Projectiles/Rogue/CobaltEnergy.cs +++ b/Projectiles/Rogue/CobaltEnergy.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue if (!hasHitEnemy && Projectile.timeLeft < 575) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } else if (hasHitEnemy) { diff --git a/Projectiles/Rogue/CorpusAvertorClone.cs b/Projectiles/Rogue/CorpusAvertorClone.cs index 3866080aba..57412f108e 100644 --- a/Projectiles/Rogue/CorpusAvertorClone.cs +++ b/Projectiles/Rogue/CorpusAvertorClone.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue } Projectile.width = Projectile.height = (int)(24f * Projectile.scale); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Rogue/CosmicKunaiProj.cs b/Projectiles/Rogue/CosmicKunaiProj.cs index 04720d7eeb..09dbc85234 100644 --- a/Projectiles/Rogue/CosmicKunaiProj.cs +++ b/Projectiles/Rogue/CosmicKunaiProj.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.Kill(); } Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } } } diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index f3eb23668e..934ad71a81 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft > 350) Projectile.velocity *= 1.06f; Projectile.damage = (int)(originalDamage * 1.25); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } } @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 50); + Projectile.ExpandHitboxBy(50); for (int d = 0; d < 4; d++) { int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 27, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index e26ea8f38a..e1a4a45efd 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/DeepSeaDumbbell2.cs b/Projectiles/Rogue/DeepSeaDumbbell2.cs index 1b2ae84c55..ca865f10b2 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell2.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell2.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ai[0] += 1f; else { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } Projectile.rotation += Math.Abs(Projectile.velocity.X) * 0.01f * (float)Projectile.direction; diff --git a/Projectiles/Rogue/DeepSeaDumbbell3.cs b/Projectiles/Rogue/DeepSeaDumbbell3.cs index e2b908cea8..b58843a710 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell3.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell3.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ai[0] += 1f; else { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f); } Projectile.rotation += Math.Abs(Projectile.velocity.X) * 0.01f * (float)Projectile.direction; diff --git a/Projectiles/Rogue/DesecratedBubble.cs b/Projectiles/Rogue/DesecratedBubble.cs index 81fd4f816a..30fbe8dc79 100644 --- a/Projectiles/Rogue/DesecratedBubble.cs +++ b/Projectiles/Rogue/DesecratedBubble.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.ai[1] == 0f) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 8f, 20f); } } } diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index b974256041..4877ef45f1 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); + Projectile.ExpandHitboxBy(80); for (int d = 0; d < 5; d++) { int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index 38174af61f..ddaa753202 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index 69459095de..9109253c4b 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Rogue // Stealth strike lasers have an intentionally lower ratio of 12%. double laserDamageRatio = Projectile.Calamity().stealthStrike ? 0.12D : 0.4D; float laserFrames = Projectile.MaxUpdates * 8f; - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), laserDamageRatio, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), laserDamageRatio, true); } } diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index b61964bc5e..c7101a9c00 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 173, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 20f); } public override void PostDraw(Color lightColor) @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 128); + Projectile.ExpandHitboxBy(128); SoundEngine.PlaySound(SoundID.Item74, Projectile.position); for (int num621 = 0; num621 < 3; num621++) { diff --git a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs index 81b7f9c93d..c8750a0164 100644 --- a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 128); + Projectile.ExpandHitboxBy(128); SoundEngine.PlaySound(SoundID.Item74, Projectile.position); for (int num621 = 0; num621 < 3; num621++) { diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index d553a34db0..39f7d9cc04 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = Projectile.damage / 2; - Projectile ghost = CalamityGlobalProjectile.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { ghost.DamageType = RogueDamageClass.Instance; diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index f8cb5b6023..819ce03406 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2)) { int spiritDamage = Projectile.damage / 2; - Projectile ghost = CalamityGlobalProjectile.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f); if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { ghost.DamageType = RogueDamageClass.Instance; diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs index 4f0fa69b26..636f6c796d 100644 --- a/Projectiles/Rogue/GacruxianHome.cs +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].DamageType = RogueDamageClass.Instance; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 3aa8648c58..4c7e24c5c6 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue else { Projectile.rotation += 0.2f * (float)Projectile.direction; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, Projectile.Calamity().stealthStrike ? 12f : 7f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, Projectile.Calamity().stealthStrike ? 12f : 7f, 20f); } Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Rogue/LeonidStar.cs b/Projectiles/Rogue/LeonidStar.cs index 1f2999b2bb..92d6e57439 100644 --- a/Projectiles/Rogue/LeonidStar.cs +++ b/Projectiles/Rogue/LeonidStar.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[0] > 120f) { Projectile.scale *= 0.98f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, Projectile.scale); + Projectile.ExpandHitboxBy(Projectile.scale); if (Projectile.scale <= 0.05f) Projectile.Kill(); } diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 9ad2a2fb29..f165f7990a 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Dig, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 72); + Projectile.ExpandHitboxBy(72); for (int d = 0; d < 3; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 14, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 34f018e860..795f28a9bb 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.DamageType = RogueDamageClass.Instance; Projectile.extraUpdates = 1; Projectile.alpha = 150; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanHitNPC(NPC target) => (Projectile.timeLeft < 210 || Projectile.ai[0] == 2f) && target.CanBeChasedBy(Projectile); @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); if (Projectile.ai[0] != 1f && (Projectile.timeLeft < 210 || Projectile.ai[0] == 2f)) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 12f, 20f); } // Reduce damage of projectiles if more than the cap are active diff --git a/Projectiles/Rogue/LuminousShard.cs b/Projectiles/Rogue/LuminousShard.cs index 2f176e8cfe..3aa87e9016 100644 --- a/Projectiles/Rogue/LuminousShard.cs +++ b/Projectiles/Rogue/LuminousShard.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y *= 1.05f; if (Projectile.timeLeft < 90) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/LunarKunaiProj.cs b/Projectiles/Rogue/LunarKunaiProj.cs index 3ec97fa7a6..a6ae176bb5 100644 --- a/Projectiles/Rogue/LunarKunaiProj.cs +++ b/Projectiles/Rogue/LunarKunaiProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.frame = 0; Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, lunarEnhance ? 300f : 150f, lunarEnhance ? 12f : 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, lunarEnhance ? 300f : 150f, lunarEnhance ? 12f : 8f, 20f); if (Main.rand.Next(6) == 0 && lunarEnhance) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 229, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 7f22765a9a..c5ac31e109 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[0] == 0f) { Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 10f, 25f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 10f, 25f); Projectile.localAI[1] += 1f; if (Projectile.localAI[1] > 4f) { @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { Projectile.ai[0] = 2f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 112); + Projectile.ExpandHitboxBy(112); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); for (int i = 0; i < 7; i++) { diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index ef69b20a38..40cb23f24b 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 32); + Projectile.ExpandHitboxBy(32); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs index 594699effa..47bf603cde 100644 --- a/Projectiles/Rogue/MoonSigil.cs +++ b/Projectiles/Rogue/MoonSigil.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 8f, 20f); } // Reduce damage of projectiles if more than the cap are active diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs index 5f7fb43207..7f7fda47fc 100644 --- a/Projectiles/Rogue/NiceCock.cs +++ b/Projectiles/Rogue/NiceCock.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item74, Projectile.Center); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 50); + Projectile.ExpandHitboxBy(50); // Create into some rainbow-colored dust when dead for (int d = 0; d < 5; d++) diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index 7eee1e2d94..c1acb66ee3 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue private void HomingAI() { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, Penumbra.ShootSpeed * 1.5f, 35f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, Penumbra.ShootSpeed * 1.5f, 35f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/PhantasmalRuinGhost.cs b/Projectiles/Rogue/PhantasmalRuinGhost.cs index 19f0dc831f..163a9824b9 100644 --- a/Projectiles/Rogue/PhantasmalRuinGhost.cs +++ b/Projectiles/Rogue/PhantasmalRuinGhost.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft >= 207) Projectile.alpha += 6; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 40f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 40f); } public override Color? GetAlpha(Color lightColor) => new Color(100, 200, 255, 100); diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index 927bb9bf6b..411d793567 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue // Otherwise, if homing on enemies is enabled, they home in on enemies. if (Projectile.ai[0] == 1f) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); } // If the owner is dead these projectiles disappear rapidly. diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs index 1fcd60c833..1b74ac0a55 100644 --- a/Projectiles/Rogue/PrismShurikenBlade.cs +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, false, 850f, 19f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, false, 850f, 19f, 30f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } diff --git a/Projectiles/Rogue/Prismalline3.cs b/Projectiles/Rogue/Prismalline3.cs index c1b0afef64..7147b200f9 100644 --- a/Projectiles/Rogue/Prismalline3.cs +++ b/Projectiles/Rogue/Prismalline3.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/ProfanedPartisanSpear.cs b/Projectiles/Rogue/ProfanedPartisanSpear.cs index 993460be09..599442fdfa 100644 --- a/Projectiles/Rogue/ProfanedPartisanSpear.cs +++ b/Projectiles/Rogue/ProfanedPartisanSpear.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 1; if (timer >= 10) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 7f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 7f, 20f); } } diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 9b4a8999e4..6299e1556e 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue } } else if (Projectile.timeLeft < 270) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, Projectile.Calamity().stealthStrike ? 900f : 450f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, Projectile.Calamity().stealthStrike ? 900f : 450f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index fd0924e9c8..85a7b7a695 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue // Initial homing before landing a hit. else - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 250f, 12f, 14f); + CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 14f); } // Homing after landing a hit. This homing repeatedly turns on and off. diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index beb89a753b..e831f9f2be 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 150); + Projectile.ExpandHitboxBy(150); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.0075), 0f, Projectile.owner); if (!Projectile.Calamity().stealthStrike) return; @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 150); + Projectile.ExpandHitboxBy(150); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.0075), 0f, Projectile.owner); if (!Projectile.Calamity().stealthStrike) return; diff --git a/Projectiles/Rogue/ShadowBlackhole.cs b/Projectiles/Rogue/ShadowBlackhole.cs index 8be9836f9f..e2068e7232 100644 --- a/Projectiles/Rogue/ShadowBlackhole.cs +++ b/Projectiles/Rogue/ShadowBlackhole.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.scale *= 0.95f; Projectile.Opacity *= 0.95f; - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, Projectile.scale); + Projectile.ExpandHitboxBy(Projectile.scale); } if (Projectile.scale <= 0.05f) { diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index a03d3a7ee8..519fbfd326 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue } Lighting.AddLight(Projectile.Center, 0.7f, 0.3f, 0f); - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); float num633; Vector2 vector46 = Projectile.position; bool flag25 = false; diff --git a/Projectiles/Rogue/ShroomerangSpore.cs b/Projectiles/Rogue/ShroomerangSpore.cs index 8a4a8426d0..ffd686e4c0 100644 --- a/Projectiles/Rogue/ShroomerangSpore.cs +++ b/Projectiles/Rogue/ShroomerangSpore.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 56); + Projectile.ExpandHitboxBy(56); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Rogue/SkyfinNuke.cs b/Projectiles/Rogue/SkyfinNuke.cs index 6a9668e5eb..e983bf0dd6 100644 --- a/Projectiles/Rogue/SkyfinNuke.cs +++ b/Projectiles/Rogue/SkyfinNuke.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue else { //More range - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, homingRange, speedMult, turnSpeed); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, homingRange, speedMult, turnSpeed); } } diff --git a/Projectiles/Rogue/SphereBlue.cs b/Projectiles/Rogue/SphereBlue.cs index 71071cb7fb..2b497c4abe 100644 --- a/Projectiles/Rogue/SphereBlue.cs +++ b/Projectiles/Rogue/SphereBlue.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.velocity.Y = Projectile.velocity.Y + 0.085f; Projectile.velocity.X = Projectile.velocity.X * 0.99f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index 7a678f8eba..aebcb8377f 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 100); + Projectile.ExpandHitboxBy(100); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Rogue/TheSyringeS1.cs b/Projectiles/Rogue/TheSyringeS1.cs index a7498f7a95..d0a2c1d5b5 100644 --- a/Projectiles/Rogue/TheSyringeS1.cs +++ b/Projectiles/Rogue/TheSyringeS1.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostAI() { if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 10f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/TitaniumClone.cs b/Projectiles/Rogue/TitaniumClone.cs index 8d3e7dd5be..d17e75941a 100644 --- a/Projectiles/Rogue/TitaniumClone.cs +++ b/Projectiles/Rogue/TitaniumClone.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ai[0] += 1f; if (Projectile.ai[0] > 30f) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } } diff --git a/Projectiles/Rogue/TurbulanceWindSlash.cs b/Projectiles/Rogue/TurbulanceWindSlash.cs index 98f3cee201..f8c2dd2afc 100644 --- a/Projectiles/Rogue/TurbulanceWindSlash.cs +++ b/Projectiles/Rogue/TurbulanceWindSlash.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue } if (Projectile.ai[1] == 1f) { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, Projectile.ai[0] == 1f ? 900f : 450f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, Projectile.ai[0] == 1f ? 900f : 450f, 8f, 20f); } } diff --git a/Projectiles/Rogue/Valaricicle.cs b/Projectiles/Rogue/Valaricicle.cs index 64a167a97b..ee6b6ef9a0 100644 --- a/Projectiles/Rogue/Valaricicle.cs +++ b/Projectiles/Rogue/Valaricicle.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y += 0.01f; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/Valaricicle2.cs b/Projectiles/Rogue/Valaricicle2.cs index 2e23e769d7..fb39f801e3 100644 --- a/Projectiles/Rogue/Valaricicle2.cs +++ b/Projectiles/Rogue/Valaricicle2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y += 0.01f; if (Projectile.timeLeft < 150) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index dafb26d9e9..f81fa0ebca 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue } else { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } } else diff --git a/Projectiles/Rogue/WrathwingCinder.cs b/Projectiles/Rogue/WrathwingCinder.cs index 9d6d6b8e3c..121bf51bca 100644 --- a/Projectiles/Rogue/WrathwingCinder.cs +++ b/Projectiles/Rogue/WrathwingCinder.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Volume = SoundID.Item14.Volume * 0.5f }, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 144); + Projectile.ExpandHitboxBy(144); for (int d = 0; d < 2; d++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 55, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Rogue/WrathwingFireball.cs b/Projectiles/Rogue/WrathwingFireball.cs index c792bc2c59..deba6ac6c1 100644 --- a/Projectiles/Rogue/WrathwingFireball.cs +++ b/Projectiles/Rogue/WrathwingFireball.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue // Expand hitbox and explode on hit. public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 144); + Projectile.ExpandHitboxBy(144); // Allow infinite piercing and ignoring iframes for this one extra AoE hit Projectile.maxPenetrate = -1; diff --git a/Projectiles/Rogue/WrathwingSpear.cs b/Projectiles/Rogue/WrathwingSpear.cs index 97ff2bbdf4..b3d47e9954 100644 --- a/Projectiles/Rogue/WrathwingSpear.cs +++ b/Projectiles/Rogue/WrathwingSpear.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue // Homing // The item's default velocity is 28. Homing speed is intentionally a bit lower. - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 450f, 23f, 30f); + CalamityUtils.HomeInOnNPC(Projectile, true, 450f, 23f, 30f); // Animation Projectile.frameCounter++; diff --git a/Projectiles/Summon/AngelOrb.cs b/Projectiles/Summon/AngelOrb.cs index 07f6dbac59..4df13d9bca 100644 --- a/Projectiles/Summon/AngelOrb.cs +++ b/Projectiles/Summon/AngelOrb.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(Projectile, 150f, 3f, 6f, 2, ModContent.ProjectileType(), 1D, true); + CalamityUtils.MagnetSphereHitscan(Projectile, 150f, 3f, 6f, 2, ModContent.ProjectileType(), 1D, true); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType(), 300); diff --git a/Projectiles/Summon/FleshBlood.cs b/Projectiles/Summon/FleshBlood.cs index 78dbe9dd89..aa0a739417 100644 --- a/Projectiles/Summon/FleshBlood.cs +++ b/Projectiles/Summon/FleshBlood.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon } if (Projectile.timeLeft < LifeTime - 30) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f); } } } diff --git a/Projectiles/Summon/SarosSunfire.cs b/Projectiles/Summon/SarosSunfire.cs index 50ec7691c0..b46d1e8f75 100644 --- a/Projectiles/Summon/SarosSunfire.cs +++ b/Projectiles/Summon/SarosSunfire.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 60); + Projectile.ExpandHitboxBy(60); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index bf8bc0189c..0eab461dc8 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 100); + Projectile.ExpandHitboxBy(100); Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Summon/SummonBrimstoneExplosion.cs b/Projectiles/Summon/SummonBrimstoneExplosion.cs index 7f7c99e817..3ce65e2b42 100644 --- a/Projectiles/Summon/SummonBrimstoneExplosion.cs +++ b/Projectiles/Summon/SummonBrimstoneExplosion.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.Damage(); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 48); + Projectile.ExpandHitboxBy(48); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index ed9ccdaefb..b59ecb8e97 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Summon int baseHeight = 34; int newWidth = (int)(baseWidth * Projectile.scale); int newHeight = (int)(baseHeight * Projectile.scale); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, newWidth, newHeight); + Projectile.ExpandHitboxBy(newWidth, newHeight); diff --git a/Projectiles/Typeless/AeroExplosive.cs b/Projectiles/Typeless/AeroExplosive.cs index 8a97f870e7..c9dfaa877e 100644 --- a/Projectiles/Typeless/AeroExplosive.cs +++ b/Projectiles/Typeless/AeroExplosive.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 200); + Projectile.ExpandHitboxBy(200); Projectile.maxPenetrate = Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Typeless } } - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 15); + Projectile.ExpandHitboxBy(15); if (Projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index fc2cce03a3..a8bec55145 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { if (Projectile.ai[0] == 3f) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20); if (Projectile.ai[0] == 2f) { diff --git a/Projectiles/Typeless/EmpyreanGlob.cs b/Projectiles/Typeless/EmpyreanGlob.cs index 3356cb9a82..222362a14e 100644 --- a/Projectiles/Typeless/EmpyreanGlob.cs +++ b/Projectiles/Typeless/EmpyreanGlob.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 8f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 8f, 20f); } } } diff --git a/Projectiles/Typeless/EmpyreanMarble.cs b/Projectiles/Typeless/EmpyreanMarble.cs index 735c4d572d..35911a388b 100644 --- a/Projectiles/Typeless/EmpyreanMarble.cs +++ b/Projectiles/Typeless/EmpyreanMarble.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Typeless int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 7f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 7f, 20f); } } } diff --git a/Projectiles/Typeless/EmpyreanStellarDetritus.cs b/Projectiles/Typeless/EmpyreanStellarDetritus.cs index 4a8a889000..63492d7147 100644 --- a/Projectiles/Typeless/EmpyreanStellarDetritus.cs +++ b/Projectiles/Typeless/EmpyreanStellarDetritus.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index 2ba147ad36..b3e52d8fe3 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless } } } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override void PostDraw(Color lightColor) diff --git a/Projectiles/Typeless/GodSlayerOrb.cs b/Projectiles/Typeless/GodSlayerOrb.cs index 0e9dee2361..469eec3310 100644 --- a/Projectiles/Typeless/GodSlayerOrb.cs +++ b/Projectiles/Typeless/GodSlayerOrb.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/GodSlayerPhantom.cs b/Projectiles/Typeless/GodSlayerPhantom.cs index a59a4258d8..91595db25d 100644 --- a/Projectiles/Typeless/GodSlayerPhantom.cs +++ b/Projectiles/Typeless/GodSlayerPhantom.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.velocity = (Projectile.velocity * (num953 - 1f) + moveDirection * scaleFactor12) / num953; return; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } else { diff --git a/Projectiles/Typeless/HydrothermicFlare.cs b/Projectiles/Typeless/HydrothermicFlare.cs index c213804ba0..f5929d559b 100644 --- a/Projectiles/Typeless/HydrothermicFlare.cs +++ b/Projectiles/Typeless/HydrothermicFlare.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless } if (Projectile.timeLeft < 105) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 12f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/HydrothermicFlareRogue.cs b/Projectiles/Typeless/HydrothermicFlareRogue.cs index e73690acde..399392510e 100644 --- a/Projectiles/Typeless/HydrothermicFlareRogue.cs +++ b/Projectiles/Typeless/HydrothermicFlareRogue.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[d].velocity += Projectile.velocity * 0.1f; if (Projectile.timeLeft < 285) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 11f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 250f, 11f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/HydrothermicSphere.cs b/Projectiles/Typeless/HydrothermicSphere.cs index ef53e63366..53d53d2462 100644 --- a/Projectiles/Typeless/HydrothermicSphere.cs +++ b/Projectiles/Typeless/HydrothermicSphere.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless fire.velocity = Vector2.Zero; if (Projectile.timeLeft < 170) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 9f, 20f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/KelvinCatalystStar.cs b/Projectiles/Typeless/KelvinCatalystStar.cs index 1717096ed0..bc08fb8f1a 100644 --- a/Projectiles/Typeless/KelvinCatalystStar.cs +++ b/Projectiles/Typeless/KelvinCatalystStar.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item27, Projectile.position); - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 24); + Projectile.ExpandHitboxBy(24); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Typeless/MomentumCapacitorOrb.cs b/Projectiles/Typeless/MomentumCapacitorOrb.cs deleted file mode 100644 index 9e1bcc004f..0000000000 --- a/Projectiles/Typeless/MomentumCapacitorOrb.cs +++ /dev/null @@ -1,66 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless -{ - public class MomentumCapacitorOrb : ModProjectile - { - public const float Radius = 180f; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orb"); - } - - public override void SetDefaults() - { - Projectile.width = 18; - Projectile.height = 18; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = 4; - Projectile.timeLeft = 600; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; - } - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.momentumCapacitor) - Projectile.Kill(); - if (Main.rand.NextBool(4)) - { - float numDust = MathHelper.TwoPi * Radius / 5f; - float angleIncrement = MathHelper.TwoPi / numDust; - Vector2 dustOffset = Vector2.UnitX * Radius; - dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi); - for (int i = 0; i < (int)numDust; i++) - { - dustOffset = dustOffset.RotatedBy(angleIncrement); - int dustIndex = Dust.NewDust(Projectile.Center, 1, 1, 226); - Main.dust[dustIndex].position = Projectile.Center + dustOffset; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].fadeIn = 1f; - Main.dust[dustIndex].velocity *= 0f; - Main.dust[dustIndex].scale = 0.5f; - } - } - for (int k = 0; k < Main.projectile.Length; k++) - { - if (Main.projectile[k].type == ModContent.ProjectileType() || - Main.projectile[k].type == ModContent.ProjectileType() || - Main.projectile[k].type == ModContent.ProjectileType()) - continue; - if (Main.projectile[k].owner == Projectile.owner && Main.projectile[k].CountsAsClass() && - !Main.projectile[k].Calamity().momentumCapacitatorBoost && Main.projectile[k].friendly && - Vector2.Distance(Main.projectile[k].Center, Projectile.Center) < Radius) - { - Main.projectile[k].damage = (int)(Main.projectile[k].damage * 1.15f); - Main.projectile[k].Calamity().momentumCapacitatorBoost = true; - } - } - } - } -} diff --git a/Projectiles/Typeless/MomentumCapacitorOrb.png b/Projectiles/Typeless/MomentumCapacitorOrb.png deleted file mode 100644 index b676ed6204bf11f10a92a8d206747c8f8717438f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmV-r0h<1aP)q`1x#Ns2UrSl9`9f`AqhEDYoc0(KT+X<-nwiy#OJ z;ffeR?~q_#BNmq-j>J?u)$YGDJ3ll3jLGIK0DiFmz%Uw2_+_Q74Fk}BepR?%ESRZ3 z082QsOx}8m$#J`>99oU$LOgFhUfU}c20GBs+09ERaCxw3uz5v*+mgj!tu13L56`0MMC|pdG z`yVb_z-iY2kS#EZ6Sa3%*L?%<`8HIzO#LWMaLVWhJC0#`hSR{r00000NkvXXu0mjf D9OITo diff --git a/Projectiles/Typeless/Nanotech.cs b/Projectiles/Typeless/Nanotech.cs index 5c6909ab72..6ead62a723 100644 --- a/Projectiles/Typeless/Nanotech.cs +++ b/Projectiles/Typeless/Nanotech.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless } if (Projectile.ai[1] >= 30f) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); } // Reduce damage of projectiles if more than the cap are active diff --git a/Projectiles/Typeless/PendantProjectile3.cs b/Projectiles/Typeless/PendantProjectile3.cs index f327cd9ef5..65f45ff019 100644 --- a/Projectiles/Typeless/PendantProjectile3.cs +++ b/Projectiles/Typeless/PendantProjectile3.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); Projectile.rotation += Projectile.velocity.X * 1.25f; diff --git a/Projectiles/Typeless/SabatonBoom.cs b/Projectiles/Typeless/SabatonBoom.cs index 58e6c3c931..d7e5656b08 100644 --- a/Projectiles/Typeless/SabatonBoom.cs +++ b/Projectiles/Typeless/SabatonBoom.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Typeless { if (Projectile.ai[0] == 1f) { - CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 100); //Not really an expansion + Projectile.ExpandHitboxBy(100); //Not really an expansion Projectile.timeLeft /= 2; Projectile.ai[0] = 0f; } diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index 0c84197658..ede7254774 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless { Projectile.tileCollide = true; } - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 150f, 12f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Typeless/TarraEnergy.cs b/Projectiles/Typeless/TarraEnergy.cs index 37d895f20a..6b6fe08c58 100644 --- a/Projectiles/Typeless/TarraEnergy.cs +++ b/Projectiles/Typeless/TarraEnergy.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Typeless } if (Projectile.timeLeft < 170) - CalamityGlobalProjectile.HomeInOnNPC(Projectile, true, 600f, 9f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 9f, 20f); } } } diff --git a/Projectiles/Typeless/VanquisherArrowSplit.cs b/Projectiles/Typeless/VanquisherArrowSplit.cs index 89bb98691c..342572aea7 100644 --- a/Projectiles/Typeless/VanquisherArrowSplit.cs +++ b/Projectiles/Typeless/VanquisherArrowSplit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - CalamityGlobalProjectile.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f); } public override void PostDraw(Color lightColor) diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 6411b575f3..2a1478041d 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -1,4 +1,7 @@ using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -53,6 +56,61 @@ namespace CalamityMod return null; } + #region Projectile AI Utilities + public static void ExpandHitboxBy(this Projectile projectile, int width, int height) + { + projectile.position = projectile.Center; + projectile.width = width; + projectile.height = height; + projectile.position -= projectile.Size * 0.5f; + } + public static void ExpandHitboxBy(this Projectile projectile, int newSize) => projectile.ExpandHitboxBy(newSize, newSize); + public static void ExpandHitboxBy(this Projectile projectile, float expandRatio) => projectile.ExpandHitboxBy((int)(projectile.width * expandRatio), (int)(projectile.height * expandRatio)); + + public static void HomeInOnNPC(Projectile projectile, bool ignoreTiles, float distanceRequired, float homingVelocity, float N) + { + if (!projectile.friendly) + return; + + // Set amount of extra updates. + if (projectile.Calamity().defExtraUpdates == -1) + projectile.Calamity().defExtraUpdates = projectile.extraUpdates; + + Vector2 destination = projectile.Center; + float maxDistance = distanceRequired; + bool locatedTarget = false; + + // Find a target. + for (int i = 0; i < Main.maxNPCs; i++) + { + float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + if (!Main.npc[i].CanBeChasedBy(projectile, false) || !projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance)) + continue; + + if (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + { + destination = Main.npc[i].Center; + locatedTarget = true; + break; + } + } + + if (locatedTarget) + { + // Increase amount of extra updates to greatly increase homing velocity. + projectile.extraUpdates = projectile.Calamity().defExtraUpdates + 1; + + // Home in on the target. + Vector2 homeDirection = (destination - projectile.Center).SafeNormalize(Vector2.UnitY); + projectile.velocity = (projectile.velocity * N + homeDirection * homingVelocity) / (N + 1f); + } + else + { + // Set amount of extra updates to default amount. + projectile.extraUpdates = projectile.Calamity().defExtraUpdates; + } + } + // NOTE - Do not under any circumstance use these predictive methods for enemies or bosses. It is intended for minions and player-created projectiles. // Due to its extremely precise nature, it will have little openings that allow players to react without dashing through the enemy. // The results will be neither fun nor fair. @@ -102,7 +160,175 @@ namespace CalamityMod Vector2 idealVelocity = CalculatePredictiveAimToTarget(projectile.Center, target, homingSpeed); return (projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; } + #endregion + #region Projectile Spawning Utilities + public static Projectile ProjectileRain(IEntitySource source, Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner) + { + float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); + if (projType == ProjectileType()) + x = targetPos.X + xLimit; + float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper); + Vector2 spawnPosition = new Vector2(x, y); + Vector2 velocity = targetPos - spawnPosition; + velocity.X += Main.rand.NextFloat(-xVariance, xVariance); + float speed = projSpeed; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + return Projectile.NewProjectileDirect(source, spawnPosition, velocity, projType, damage, knockback, owner); + } + + public static Projectile ProjectileBarrage(IEntitySource source, Vector2 originVec, Vector2 targetPos, bool fromRight, float xOffsetMin, float xOffsetMax, float yOffsetMin, float yOffsetMax, float projSpeed, int projType, int damage, float knockback, int owner, bool clamped = false, float inaccuracyOffset = 5f) + { + float xPos = originVec.X + Main.rand.NextFloat(xOffsetMin, xOffsetMax) * fromRight.ToDirectionInt(); + float yPos = originVec.Y + Main.rand.NextFloat(yOffsetMin, yOffsetMax) * Main.rand.NextBool().ToDirectionInt(); + Vector2 spawnPosition = new Vector2(xPos, yPos); + Vector2 velocity = targetPos - spawnPosition; + velocity.X += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); + velocity.Y += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); + velocity.Normalize(); + velocity *= projSpeed * (clamped ? 150f : 1f); + //This clamp means the spawned projectiles only go at diagnals and are not accurate + if (clamped) + { + velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); + velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); + } + return Projectile.NewProjectileDirect(source, spawnPosition, velocity, projType, damage, knockback, owner); + } + + public static Projectile SpawnOrb(Projectile projectile, int damage, int projType, float distanceRequired, float speedMult, bool gsPhantom = false) + { + float ai1 = Main.rand.NextFloat() + 0.5f; + int[] array = new int[Main.maxNPCs]; + int targetArrayA = 0; + int targetArrayB = 0; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false)) + { + float enemyDist = Vector2.Distance(projectile.Center, npc.Center); + if (enemyDist < distanceRequired) + { + if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && enemyDist > 50f) + { + array[targetArrayB] = i; + targetArrayB++; + } + else if (targetArrayB == 0) + { + array[targetArrayA] = i; + targetArrayA++; + } + } + } + } + if (targetArrayA == 0 && targetArrayB == 0) + { + return Projectile.NewProjectileDirect(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner); + } + int target = targetArrayB <= 0 ? array[Main.rand.Next(targetArrayA)] : array[Main.rand.Next(targetArrayB)]; + Vector2 velocity = RandomVelocity(100f, speedMult, speedMult, 1f); + Projectile orb = Projectile.NewProjectileDirect(projectile.GetSource_FromThis(), projectile.Center, velocity, projType, damage, 0f, projectile.owner, gsPhantom ? 0f : target, gsPhantom ? ai1 : 0f); + return orb; + } + + // TODO -- This overused method should NOT have hardcoded projectile type checks in it. + public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false) + { + // Only shoot once every N frames. + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > projectileTimer) + { + projectile.localAI[0] = 0f; + + // Only search for targets if projectiles could be fired. + float maxDistance = distanceRequired; + bool homeIn = false; + int[] targetArray = new int[maxTargets]; + int targetArrayIndex = 0; + + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + + bool canHit = true; + if (extraDistance < maxDistance) + canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + + if (projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit) + { + if (targetArrayIndex < maxTargets) + { + targetArray[targetArrayIndex] = i; + targetArrayIndex++; + homeIn = true; + } + else + break; + } + } + } + + // If there is anything to actually shoot at, pick targets at random and fire. + if (homeIn) + { + int randomTarget = Main.rand.Next(targetArrayIndex); + randomTarget = targetArray[randomTarget]; + + projectile.localAI[0] = 0f; + Vector2 spawnPos = projectile.Center + projectile.velocity * 4f; + Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - spawnPos) * homingVelocity; + + if (attackMultiple) + { + for (int i = 0; i < targetArrayIndex; i++) + { + velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - spawnPos) * homingVelocity; + + if (projectile.owner == Main.myPlayer) + { + int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); + + if (projectile.type == ProjectileType()) + if (projectile2.WithinBounds(Main.maxProjectiles)) + Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; + } + } + + return; + } + + if (projectile.type == ProjectileType()) + { + velocity.Y += Main.rand.Next(-30, 31) * 0.05f; + velocity.X += Main.rand.Next(-30, 31) * 0.05f; + } + + if (projectile.owner == Main.myPlayer) + { + int projectile2 = Projectile.NewProjectile(projectile.GetSource_FromThis(), spawnPos, velocity, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); + + if (projectile.type == ProjectileType() || + projectile.type == ProjectileType() || projectile.type == ProjectileType()) + if (projectile2.WithinBounds(Main.maxProjectiles)) + Main.projectile[projectile2].DamageType = DamageClass.Melee; + + if (projectile.type == ProjectileType()) + if (projectile2.WithinBounds(Main.maxProjectiles)) + Main.projectile[projectile2].DamageType = RogueDamageClass.Instance; + } + } + } + } + #endregion + + #region Projectile Despawning/Killing Utilities public static void KillAllHostileProjectiles() { for (int x = 0; x < Main.maxProjectiles; x++) @@ -140,6 +366,7 @@ namespace CalamityMod } } } + #endregion public static int FindFirstProjectile(int Type) { @@ -176,42 +403,6 @@ namespace CalamityMod } } - public static Projectile ProjectileRain(IEntitySource source, Vector2 targetPos, float xLimit, float xVariance, float yLimitLower, float yLimitUpper, float projSpeed, int projType, int damage, float knockback, int owner) - { - float x = targetPos.X + Main.rand.NextFloat(-xLimit, xLimit); - if (projType == ProjectileType()) - x = targetPos.X + xLimit; - float y = targetPos.Y - Main.rand.NextFloat(yLimitLower, yLimitUpper); - Vector2 spawnPosition = new Vector2(x, y); - Vector2 velocity = targetPos - spawnPosition; - velocity.X += Main.rand.NextFloat(-xVariance, xVariance); - float speed = projSpeed; - float targetDist = velocity.Length(); - targetDist = speed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; - return Projectile.NewProjectileDirect(source, spawnPosition, velocity, projType, damage, knockback, owner); - } - - public static Projectile ProjectileBarrage(IEntitySource source, Vector2 originVec, Vector2 targetPos, bool fromRight, float xOffsetMin, float xOffsetMax, float yOffsetMin, float yOffsetMax, float projSpeed, int projType, int damage, float knockback, int owner, bool clamped = false, float inaccuracyOffset = 5f) - { - float xPos = originVec.X + Main.rand.NextFloat(xOffsetMin, xOffsetMax) * fromRight.ToDirectionInt(); - float yPos = originVec.Y + Main.rand.NextFloat(yOffsetMin, yOffsetMax) * Main.rand.NextBool().ToDirectionInt(); - Vector2 spawnPosition = new Vector2(xPos, yPos); - Vector2 velocity = targetPos - spawnPosition; - velocity.X += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); - velocity.Y += Main.rand.NextFloat(-inaccuracyOffset, inaccuracyOffset); - velocity.Normalize(); - velocity *= projSpeed * (clamped ? 150f : 1f); - //This clamp means the spawned projectiles only go at diagnals and are not accurate - if (clamped) - { - velocity.X = MathHelper.Clamp(velocity.X, -15f, 15f); - velocity.Y = MathHelper.Clamp(velocity.Y, -15f, 15f); - } - return Projectile.NewProjectileDirect(source, spawnPosition, velocity, projType, damage, knockback, owner); - } - public static int DamageSoftCap(double dmgInput, int cap) { // If the incoming damage is less than the cap, don't do anything. From 2b0adc9e0a9d61a6607bb4ad21c2063f164d85b7 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 23:23:03 -0400 Subject: [PATCH 11/31] Add CalamityGlobalProjectileTweaks system --- CalamityMod.cs | 3 + Projectiles/CalamityGlobalProjectile.cs | 310 +--------- Projectiles/CalamityGlobalProjectileTweaks.cs | 555 +++++++++++++++++- 3 files changed, 536 insertions(+), 332 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index a44813224f..653f588f55 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -44,6 +44,7 @@ using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Particles; +using CalamityMod.Projectiles; using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Schematics; using CalamityMod.Skies; @@ -188,6 +189,7 @@ namespace CalamityMod // Initialize Calamity Balance, since it is tightly coupled with the remaining lists CalamityGlobalItem.LoadTweaks(); + CalamityGlobalProjectile.LoadTweaks(); // Mount balancing occurs during runtime and is undone when Calamity is unloaded. Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; @@ -357,6 +359,7 @@ namespace CalamityMod CalamityLists.UnloadLists(); NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); + CalamityGlobalProjectile.UnloadTweaks(); PopupGUIManager.UnloadGUIs(); InvasionProgressUIManager.UnloadGUIs(); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8c900b78f2..08f183fb6f 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Projectiles // Damage Adjusters public const float PierceResistHarshness = 0.12f; public const float PierceResistCap = 0.8f; + // TODO -- Remove this. Vanilla originalDamage now applies to all projectiles. public int defDamage = 0; // Enables "supercrits". When crit is over 100%, projectiles with this bool enabled can "supercrit". @@ -133,314 +134,11 @@ namespace CalamityMod.Projectiles #region SetDefaults public override void SetDefaults(Projectile projectile) { - switch (projectile.type) - { - // True melee with speed - case ProjectileID.Spear: - case ProjectileID.Trident: - case ProjectileID.TheRottedFork: - case ProjectileID.Swordfish: - case ProjectileID.DarkLance: - case ProjectileID.CobaltNaginata: - case ProjectileID.PalladiumPike: - case ProjectileID.MythrilHalberd: - case ProjectileID.OrichalcumHalberd: - case ProjectileID.AdamantiteGlaive: - case ProjectileID.TitaniumTrident: - case ProjectileID.MushroomSpear: - case ProjectileID.Gungnir: - case ProjectileID.ObsidianSwordfish: - case ProjectileID.JoustingLance: - case ProjectileID.HallowJoustingLance: - case ProjectileID.ShadowJoustingLance: - projectile.DamageType = TrueMeleeDamageClass.Instance; - break; - - // True melee without speed - case ProjectileID.CobaltDrill: - case ProjectileID.MythrilDrill: - case ProjectileID.AdamantiteDrill: - case ProjectileID.PalladiumDrill: - case ProjectileID.OrichalcumDrill: - case ProjectileID.TitaniumDrill: - case ProjectileID.ChlorophyteDrill: - case ProjectileID.SolarFlareDrill: - case ProjectileID.VortexDrill: - case ProjectileID.NebulaDrill: - case ProjectileID.StardustDrill: - case ProjectileID.SawtoothShark: - case ProjectileID.CobaltChainsaw: - case ProjectileID.MythrilChainsaw: - case ProjectileID.AdamantiteChainsaw: - case ProjectileID.PalladiumChainsaw: - case ProjectileID.OrichalcumChainsaw: - case ProjectileID.TitaniumChainsaw: - case ProjectileID.ChlorophyteChainsaw: - case ProjectileID.VortexChainsaw: - case ProjectileID.NebulaChainsaw: - case ProjectileID.SolarFlareChainsaw: - case ProjectileID.StardustChainsaw: - case ProjectileID.Hamdrax: // Drax - case ProjectileID.ChlorophyteJackhammer: - projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; - break; - - // Point blank vanilla projectiles - case ProjectileID.BulletHighVelocity: - case ProjectileID.ChlorophyteBullet: - case ProjectileID.WoodenArrowFriendly: - case ProjectileID.BeeArrow: - case ProjectileID.BoneArrow: - case ProjectileID.ChlorophyteArrow: - case ProjectileID.CursedArrow: - case ProjectileID.FireArrow: - case ProjectileID.FrostArrow: - case ProjectileID.FrostburnArrow: - case ProjectileID.HellfireArrow: - case ProjectileID.HolyArrow: - case ProjectileID.IchorArrow: - case ProjectileID.JestersArrow: - case ProjectileID.MoonlordArrow: - case ProjectileID.PhantasmArrow: - case ProjectileID.ShadowFlameArrow: - case ProjectileID.UnholyArrow: - case ProjectileID.VenomArrow: - case ProjectileID.Hellwing: - case ProjectileID.Flare: - case ProjectileID.BlueFlare: - case ProjectileID.Seed: - case ProjectileID.CrystalDart: - case ProjectileID.CursedDart: - case ProjectileID.PoisonDartBlowgun: - case ProjectileID.SnowBallFriendly: - case ProjectileID.SandBallGun: - case ProjectileID.PearlSandBallGun: - case ProjectileID.CrimsandBallGun: - case ProjectileID.EbonsandBallGun: - case ProjectileID.PainterPaintball: - case ProjectileID.Harpoon: - case ProjectileID.DD2PhoenixBowShot: - case ProjectileID.PulseBolt: - case ProjectileID.Stake: - case ProjectileID.CandyCorn: - case ProjectileID.Blizzard: - case ProjectileID.LostSoulFriendly: - pointBlankShotDuration = DefaultPointBlankDuration; - break; - - // Make bullets almost hitscan because that's how bullets should work in games :^) - // Chloro bullets are not here, because they home in - case ProjectileID.Bullet: - case ProjectileID.MeteorShot: - case ProjectileID.CrystalBullet: - case ProjectileID.IchorBullet: - case ProjectileID.CursedBullet: - case ProjectileID.VenomBullet: - case ProjectileID.PartyBullet: - case ProjectileID.NanoBullet: - case ProjectileID.ExplosiveBullet: - case ProjectileID.GoldenBullet: - case ProjectileID.MoonlordBullet: - projectile.extraUpdates += 2; - pointBlankShotDuration = DefaultPointBlankDuration; - break; - - case ProjectileID.FlamingJack: - case ProjectileID.Anchor: - case ProjectileID.Sunfury: - case ProjectileID.FlowerPow: - case ProjectileID.EnchantedBoomerang: - case ProjectileID.IceBoomerang: - case ProjectileID.FruitcakeChakram: - case ProjectileID.BlueMoon: - case ProjectileID.FrostBoltStaff: - projectile.extraUpdates = 1; - break; - - case ProjectileID.CorruptYoyo: - ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 190f; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - break; - - case ProjectileID.Valor: - ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 384f; - ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16f; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - break; - - case ProjectileID.JungleYoyo: - ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - break; - - case ProjectileID.Code1: - ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 240f; - projectile.extraUpdates = 1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 20; - break; - - case ProjectileID.Flamarang: - projectile.extraUpdates = 2; - break; - - case ProjectileID.LightDisc: - projectile.extraUpdates = 5; - break; - - case ProjectileID.Arkhalis: - case ProjectileID.Terragrim: - case ProjectileID.ButchersChainsaw: - projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; - projectile.scale = 1.5f; - break; - - case ProjectileID.MonkStaffT1: - projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; - projectile.scale = 3f; - break; - - case ProjectileID.ShadowBeamHostile: - projectile.timeLeft = 60; - break; - - case ProjectileID.LostSoulHostile: - projectile.tileCollide = true; - break; - - case ProjectileID.NebulaLaser: - projectile.extraUpdates = 1; - break; - - case ProjectileID.StarWrath: - projectile.penetrate = projectile.maxPenetrate = 1; - break; - - case ProjectileID.QueenSlimeGelAttack: - case ProjectileID.QueenSlimeMinionPinkBall: - projectile.penetrate = projectile.maxPenetrate = 1; - break; - - case ProjectileID.MonkStaffT2: - projectile.DamageType = TrueMeleeDamageClass.Instance; - projectile.idStaticNPCHitCooldown = 18; - break; - - case ProjectileID.MonkStaffT3: - case ProjectileID.MonkStaffT3_Alt: - projectile.scale = 2f; - break; - - case ProjectileID.EmeraldBolt: - projectile.penetrate = 1; - break; - - case ProjectileID.Bee: - case ProjectileID.GiantBee: - case ProjectileID.LightBeam: - projectile.penetrate = 2; - break; - - case ProjectileID.CrystalVileShardHead: - case ProjectileID.CrystalVileShardShaft: - case ProjectileID.PoisonFang: - case ProjectileID.VenomFang: - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - break; - - case ProjectileID.Retanimini: - case ProjectileID.MiniRetinaLaser: - projectile.localNPCHitCooldown = 10; - projectile.usesLocalNPCImmunity = true; - projectile.usesIDStaticNPCImmunity = false; - break; - - case ProjectileID.FlowerPetal: - projectile.MaxUpdates = 4; - projectile.localNPCHitCooldown = 10; - projectile.usesLocalNPCImmunity = true; - projectile.usesIDStaticNPCImmunity = false; - break; - - case ProjectileID.Spazmamini: - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 12; - break; - - case ProjectileID.WoodYoyo: - case ProjectileID.CrimsonYoyo: - case ProjectileID.RedsYoyo: - case ProjectileID.ValkyrieYoyo: - case ProjectileID.Kraken: - case ProjectileID.Rally: - case ProjectileID.Code2: - case ProjectileID.Cascade: - case ProjectileID.Chik: - case ProjectileID.FormatC: - case ProjectileID.HelFire: - case ProjectileID.Amarok: - case ProjectileID.Gradient: - case ProjectileID.Yelets: - case ProjectileID.TheEyeOfCthulhu: - case ProjectileID.Terrarian: - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - break; - - case ProjectileID.DD2BetsyFireball: - case ProjectileID.DD2BetsyFlameBreath: - case ProjectileID.CultistBossLightningOrbArc: - case ProjectileID.InfernoHostileBlast: - case ProjectileID.RocketSkeleton: - case ProjectileID.SniperBullet: - case ProjectileID.RuneBlast: - case ProjectileID.UnholyTridentHostile: - case ProjectileID.JavelinHostile: - case ProjectileID.FrostWave: - case ProjectileID.Present: - case ProjectileID.FlamingScythe: - case ProjectileID.SaucerDeathray: - case ProjectileID.CannonballHostile: - case ProjectileID.PaladinsHammerHostile: - case ProjectileID.Spike: - case ProjectileID.Sharknado: - case ProjectileID.Cthulunado: - case ProjectileID.PhantasmalSphere: - case ProjectileID.PhantasmalDeathray: - case ProjectileID.RockGolemRock: - case ProjectileID.HallowBossLastingRainbow: - case ProjectileID.FairyQueenSunDance: - case ProjectileID.FairyQueenLance: - case ProjectileID.DeerclopsIceSpike: - case ProjectileID.DeerclopsRangedProjectile: - case ProjectileID.DemonSickle: - case ProjectileID.BombSkeletronPrime: - case ProjectileID.Skull: - case ProjectileID.SaucerMissile: - case ProjectileID.ThornBall: - case ProjectileID.CultistBossFireBall: - case ProjectileID.CultistBossFireBallClone: - case ProjectileID.CultistBossIceMist: - DealsDefenseDamage = true; - break; - - default: - break; - } - - if (projectile.type >= ProjectileID.BlackCounterweight && projectile.type <= ProjectileID.YellowCounterweight) - { - projectile.MaxUpdates = 2; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 10; - } - // Disable Lunatic Cultist's homing resistance globally ProjectileID.Sets.CultistIsResistantTo[projectile.type] = false; + + // Apply Calamity Global Projectile Tweaks. + SetDefaults_ApplyTweaks(projectile); } #endregion diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 8eceff8898..39f887e0eb 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -1,37 +1,540 @@ -using System; -using System.Collections.Generic; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.EntitySources; -using CalamityMod.Events; -using CalamityMod.Items.Accessories; -using CalamityMod.NPCs; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Melee.Yoyos; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.Projectiles.Typeless; -using CalamityMod.Projectiles.VanillaProjectileOverrides; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Utilities; -using Terraria.WorldBuilding; -using static Terraria.ModLoader.ModContent; -using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech; namespace CalamityMod.Projectiles { + // TODO -- The projectile tweaks database and functions should be stored in a ModSystem. + // ApplyTweaks(ref Projectile proj) would be the one exposed function, which CalamityGlobalProjectile would call in SetDefaults. public partial class CalamityGlobalProjectile : GlobalProjectile { + #region Database and Initialization + internal static SortedDictionary currentTweaks = null; + internal static void LoadTweaks() + { + // Various shorthands for projectiles which receive very simple changes, such as setting one flag. + IProjectileTweak[] defenseDamage = Do(DefenseDamage); + IProjectileTweak[] trueMelee = Do(TrueMelee); + IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); + IProjectileTweak[] pointBlank = Do(PointBlank); + IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2)); + IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), IDStaticIFrames(10)); + + // TODO -- Very few vanilla yoyos have range and speed tweaks. Looks like an unfinished job. + + // Please keep this strictly alphabetical. It's the only way to keep it sane. Thanks in advance. + // - Ozzatron + currentTweaks = new SortedDictionary + { + { ProjectileID.AdamantiteChainsaw, trueMeleeNoSpeed }, + { ProjectileID.AdamantiteDrill, trueMeleeNoSpeed }, + { ProjectileID.AdamantiteGlaive, trueMelee }, + { ProjectileID.Amarok, Do(LocalIFrames(10)) }, + { ProjectileID.Anchor, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.5f)) }, + { ProjectileID.Bee, Do(PiercingExact(2)) }, + { ProjectileID.BeeArrow, pointBlank }, + { ProjectileID.BlackCounterweight, counterweightTweaks }, + { ProjectileID.Blizzard, pointBlank }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. + { ProjectileID.BlueCounterweight, counterweightTweaks }, + { ProjectileID.BlueFlare, pointBlank }, + { ProjectileID.BombSkeletronPrime, defenseDamage }, + { ProjectileID.BoneArrow, pointBlank }, + { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Bullet, standardBulletTweaks }, + { ProjectileID.BulletHighVelocity, pointBlank }, + { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ScaleExact(1.5f)) }, + { ProjectileID.CandyCorn, pointBlank }, + { ProjectileID.CannonballHostile, defenseDamage }, + { ProjectileID.Cascade, Do(LocalIFrames(10)) }, + { ProjectileID.Chik, Do(LocalIFrames(10)) }, + { ProjectileID.ChlorophyteArrow, pointBlank }, + { ProjectileID.ChlorophyteBullet, pointBlank }, + { ProjectileID.ChlorophyteChainsaw, trueMeleeNoSpeed }, + { ProjectileID.ChlorophyteDrill, trueMeleeNoSpeed }, + { ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed }, + { ProjectileID.CobaltChainsaw, trueMeleeNoSpeed }, + { ProjectileID.CobaltDrill, trueMeleeNoSpeed }, + { ProjectileID.CobaltNaginata, trueMelee }, + { ProjectileID.Code1, Do(YoyoRange(240f), ExtraUpdatesExact(1), LocalIFrames(20)) }, + { ProjectileID.Code2, Do(LocalIFrames(10)) }, + { ProjectileID.CorruptYoyo, Do(YoyoRange(190f), LocalIFrames(10)) }, // Malaise + { ProjectileID.CrimsandBallGun, pointBlank }, + { ProjectileID.CrimsonYoyo, Do(LocalIFrames(10)) }, // Artery + { ProjectileID.CrystalBullet, standardBulletTweaks }, + { ProjectileID.CrystalDart, pointBlank }, + { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(10)) }, + { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(10)) }, + { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados + { ProjectileID.CultistBossFireBall, defenseDamage }, + { ProjectileID.CultistBossFireBallClone, defenseDamage }, + { ProjectileID.CultistBossIceMist, defenseDamage }, + { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, + { ProjectileID.CursedArrow, pointBlank }, + { ProjectileID.CursedBullet, standardBulletTweaks }, + { ProjectileID.CursedDart, pointBlank }, + { ProjectileID.DarkLance, trueMelee }, + { ProjectileID.DD2BetsyFireball, defenseDamage }, + { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, + { ProjectileID.DD2PhoenixBowShot, pointBlank }, // Phantom Phoenix + { ProjectileID.DeerclopsIceSpike, defenseDamage }, + { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, // Deerclops shadow hands + { ProjectileID.DemonSickle, defenseDamage }, + { ProjectileID.EbonsandBallGun, pointBlank }, + { ProjectileID.EmeraldBolt, Do(NoPiercing) }, + { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.ExplosiveBullet, standardBulletTweaks }, + { ProjectileID.FairyQueenLance, defenseDamage }, // Empress of Light's lance walls + { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance + { ProjectileID.FireArrow, pointBlank }, + { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) }, + { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes + { ProjectileID.Flare, pointBlank }, + { ProjectileID.FlowerPetal, Do(MaxUpdatesExact(4), LocalIFrames(10)) }, + { ProjectileID.FlowerPow, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.FormatC, Do(LocalIFrames(10)) }, + { ProjectileID.FrostBoltStaff, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.FrostburnArrow, pointBlank }, + { ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves + { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.GiantBee, Do(PiercingExact(2)) }, + { ProjectileID.GoldenBullet, standardBulletTweaks }, + { ProjectileID.Gradient, Do(LocalIFrames(10)) }, + { ProjectileID.GreenCounterweight, counterweightTweaks }, + { ProjectileID.Gungnir, trueMelee }, + { ProjectileID.HallowBossLastingRainbow, defenseDamage }, // Empress of Light's lingering rainbow trail hitboxes + { ProjectileID.HallowJoustingLance, trueMelee }, + { ProjectileID.Hamdrax, trueMeleeNoSpeed }, // Drax (never internally renamed since 1.1) + { ProjectileID.Harpoon, pointBlank }, + { ProjectileID.HelFire, Do(LocalIFrames(10)) }, + { ProjectileID.HellfireArrow, pointBlank }, + { ProjectileID.Hellwing, pointBlank }, + { ProjectileID.HolyArrow, pointBlank }, + { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.IchorArrow, pointBlank }, + { ProjectileID.IchorBullet, standardBulletTweaks }, + { ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions + { ProjectileID.JavelinHostile, defenseDamage }, + { ProjectileID.JestersArrow, pointBlank }, + { ProjectileID.JoustingLance, trueMelee }, + { ProjectileID.JungleYoyo, Do(YoyoTopSpeed(14f), LocalIFrames(10)) }, // Amazon + { ProjectileID.Kraken, Do(LocalIFrames(10)) }, + { ProjectileID.LightBeam, Do(PiercingExact(2)) }, + { ProjectileID.LightDisc, Do(MaxUpdatesExact(6)) }, + { ProjectileID.LostSoulFriendly, pointBlank }, // TODO -- why does LostSoulFriendly have point blank enabled + { ProjectileID.LostSoulHostile, Do(TileCollide) }, + { ProjectileID.MeteorShot, standardBulletTweaks }, + { ProjectileID.MiniRetinaLaser, Do(LocalIFrames(10)) }, + { ProjectileID.MonkStaffT1, Do(TrueMeleeNoSpeed, ScaleExact(3f)) }, // Sleepy Octopod + { ProjectileID.MonkStaffT2, Do(TrueMelee, IDStaticIFrames(18)) }, // Ghastly Glaive + { ProjectileID.MonkStaffT3, Do(ScaleRatio(2f)) }, // Sky Dragon's Fury + { ProjectileID.MoonlordArrow, pointBlank }, // Luminite Arrow + { ProjectileID.MoonlordBullet, standardBulletTweaks }, // Luminite Bullet + { ProjectileID.MushroomSpear, trueMelee }, + { ProjectileID.MythrilChainsaw, trueMeleeNoSpeed }, + { ProjectileID.MythrilDrill, trueMeleeNoSpeed }, + { ProjectileID.MythrilHalberd, trueMelee }, + { ProjectileID.NanoBullet, standardBulletTweaks }, + { ProjectileID.NebulaChainsaw, trueMeleeNoSpeed }, + { ProjectileID.NebulaDrill, trueMeleeNoSpeed }, + { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(+1)) }, + { ProjectileID.ObsidianSwordfish, trueMelee }, + { ProjectileID.OrichalcumChainsaw, trueMeleeNoSpeed }, + { ProjectileID.OrichalcumDrill, trueMeleeNoSpeed }, + { ProjectileID.OrichalcumHalberd, trueMelee }, + { ProjectileID.PainterPaintball, pointBlank }, + { ProjectileID.PaladinsHammerHostile, defenseDamage }, + { ProjectileID.PalladiumChainsaw, trueMeleeNoSpeed }, + { ProjectileID.PalladiumDrill, trueMeleeNoSpeed }, + { ProjectileID.PalladiumPike, trueMelee }, + { ProjectileID.PartyBullet, standardBulletTweaks }, + { ProjectileID.PearlSandBallGun, pointBlank }, + { ProjectileID.PhantasmalDeathray, defenseDamage }, + { ProjectileID.PhantasmalSphere, defenseDamage }, + { ProjectileID.PhantasmArrow, pointBlank }, + { ProjectileID.PoisonDartBlowgun, pointBlank }, + { ProjectileID.PoisonFang, Do(LocalIFrames(10)) }, + { ProjectileID.Present, defenseDamage }, // Falling present bombs in Frost Moon + { ProjectileID.PulseBolt, pointBlank }, + { ProjectileID.PurpleCounterweight, counterweightTweaks }, + { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, + { ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) }, + { ProjectileID.Rally, Do(LocalIFrames(10)) }, + { ProjectileID.RedCounterweight, counterweightTweaks }, + { ProjectileID.RedsYoyo, Do(LocalIFrames(10)) }, + { ProjectileID.Retanimini, Do(LocalIFrames(10)) }, // Optic Staff (Mini Retinazer) + { ProjectileID.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets + { ProjectileID.RockGolemRock, defenseDamage }, + { ProjectileID.RuneBlast, defenseDamage }, // Rune Wizard shots + { ProjectileID.SandBallGun, pointBlank }, + { ProjectileID.SaucerDeathray, defenseDamage }, + { ProjectileID.SaucerMissile, defenseDamage }, + { ProjectileID.SawtoothShark, trueMeleeNoSpeed }, + { ProjectileID.Seed, pointBlank }, + { ProjectileID.ShadowBeamHostile, Do(TimeLeftExact(60)) }, + { ProjectileID.ShadowFlameArrow, pointBlank }, + { ProjectileID.ShadowJoustingLance, trueMelee }, + { ProjectileID.Sharknado, defenseDamage }, + { ProjectileID.Skull, defenseDamage }, // Skeletron Expert+ skulls + { ProjectileID.SniperBullet, defenseDamage }, // Skeleton Sniper bullets + { ProjectileID.SnowBallFriendly, pointBlank }, + { ProjectileID.SolarFlareChainsaw, trueMeleeNoSpeed }, + { ProjectileID.SolarFlareDrill, trueMeleeNoSpeed }, + { ProjectileID.Spazmamini, Do(IDStaticIFrames(12)) }, // Optic Staff (Mini Spazmatism) + { ProjectileID.Spear, trueMelee }, + { ProjectileID.Spike, defenseDamage }, // UNKNOWN + { ProjectileID.Stake, pointBlank }, + { ProjectileID.StardustChainsaw, trueMeleeNoSpeed }, + { ProjectileID.StardustDrill, trueMeleeNoSpeed }, + { ProjectileID.StarWrath, Do(NoPiercing) }, + { ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) }, + { ProjectileID.Swordfish, trueMelee }, + { ProjectileID.Terragrim, Do(TrueMeleeNoSpeed, ScaleExact(1.5f)) }, + { ProjectileID.Terrarian, Do(LocalIFrames(10)) }, + { ProjectileID.TerrarianBeam, Do(LocalIFrames(-1)) }, // Terrarian yoyo orbs + { ProjectileID.TheEyeOfCthulhu, Do(LocalIFrames(10)) }, // this is the yoyo + { ProjectileID.TheRottedFork, trueMelee }, + { ProjectileID.ThornBall, defenseDamage }, // Plantera bouncing thorn balls + { ProjectileID.TitaniumChainsaw, trueMeleeNoSpeed }, + { ProjectileID.TitaniumDrill, trueMeleeNoSpeed }, + { ProjectileID.TitaniumTrident, trueMelee }, + { ProjectileID.Trident, trueMelee }, + { ProjectileID.UnholyArrow, pointBlank }, + { ProjectileID.UnholyTridentHostile, defenseDamage }, + { ProjectileID.ValkyrieYoyo, Do(LocalIFrames(10)) }, + { ProjectileID.Valor, Do(YoyoRange(384f), YoyoTopSpeed(16f), LocalIFrames(10)) }, + { ProjectileID.VenomArrow, pointBlank }, + { ProjectileID.VenomBullet, standardBulletTweaks }, + { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, + { ProjectileID.VortexChainsaw, trueMeleeNoSpeed }, + { ProjectileID.VortexDrill, trueMeleeNoSpeed }, + { ProjectileID.WoodenArrowFriendly, pointBlank }, + { ProjectileID.WoodYoyo, Do(LocalIFrames(10)) }, + { ProjectileID.Yelets, Do(LocalIFrames(10)) }, + { ProjectileID.YellowCounterweight, counterweightTweaks }, + }; + } + + internal static void UnloadTweaks() + { + currentTweaks?.Clear(); + currentTweaks = null; + } + #endregion + + #region SetDefaults (Projectile Tweaks Applied Here) + internal static void SetDefaults_ApplyTweaks(Projectile proj) + { + // Do nothing if the tweaks database is not defined. + if (currentTweaks is null) + return; + + // Grab the tweaking or balancing to apply, if any. If nothing comes back, do nothing. + bool needsTweaking = currentTweaks.TryGetValue(proj.type, out IProjectileTweak[] tweaks); + if (!needsTweaking) + return; + + // Apply all alterations sequentially, assuming they are relevant. + foreach (IProjectileTweak tweak in tweaks) + if (tweak.AppliesTo(proj)) + tweak.ApplyTweak(proj); + } + #endregion + + #region Internal Structures + + // This function simply concatenates a bunch of Projectile Tweaks into an array. + // It looks a lot nicer than constantly typing "new IProjectileTweak[]". + internal static IProjectileTweak[] Do(params IProjectileTweak[] r) => r; + + // Only one applicability lambda. + internal static bool IsAYoyo(Projectile proj) => proj.aiStyle == ProjAIStyleID.Yoyo; + + #region Projectile Tweak Definitions + internal interface IProjectileTweak + { + bool AppliesTo(Projectile proj); + void ApplyTweak(Projectile proj); + } + + #region Defense Damage + internal class DefenseDamageRule : IProjectileTweak + { + internal readonly bool flag = true; + + public DefenseDamageRule(bool dd) => flag = dd; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.Calamity().DealsDefenseDamage = flag; + } + internal static IProjectileTweak DefenseDamage => new DefenseDamageRule(true); + internal static IProjectileTweak NoDefenseDamage => new DefenseDamageRule(false); + #endregion + + #region Extra Updates + internal class ExtraUpdatesDeltaRule : IProjectileTweak + { + internal readonly int delta = 0; + + public ExtraUpdatesDeltaRule(int d) => delta = d; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.extraUpdates += delta; + if (proj.extraUpdates < 0) + proj.extraUpdates = 0; + } + } + internal static IProjectileTweak ExtraUpdatesDelta(int d) => new ExtraUpdatesDeltaRule(d); + + internal class ExtraUpdatesExactRule : IProjectileTweak + { + internal readonly int newExtraUpdates = 0; + + public ExtraUpdatesExactRule(int eu) => newExtraUpdates = eu; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.extraUpdates = newExtraUpdates; + if (proj.extraUpdates < 0) + proj.extraUpdates = 0; + } + } + internal static IProjectileTweak ExtraUpdatesExact(int eu) => new ExtraUpdatesExactRule(eu); + + // The MaxUpdates property is sometimes used in favor of the raw extraUpdates field. + // Both are supported by Calamity Global Projectile Tweaks. + internal class MaxUpdatesExactRule : IProjectileTweak + { + internal readonly int newMaxUpdates = 0; + + public MaxUpdatesExactRule(int mu) => newMaxUpdates = mu; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.MaxUpdates = newMaxUpdates; + if (proj.extraUpdates < 0) + proj.extraUpdates = 0; + } + } + internal static IProjectileTweak MaxUpdatesExact(int mu) => new MaxUpdatesExactRule(mu); + #endregion + + #region ID-Static Immunity Frames + internal class IDStaticIFrameRule : IProjectileTweak + { + internal readonly int idStaticIFrameValue = -2; + + public IDStaticIFrameRule(int f) => idStaticIFrameValue = f; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.usesLocalNPCImmunity = false; + proj.localNPCHitCooldown = -2; + proj.usesIDStaticNPCImmunity = true; + proj.idStaticNPCHitCooldown = idStaticIFrameValue; + } + } + internal static IProjectileTweak IDStaticIFrames(int f) => new IDStaticIFrameRule(f); + #endregion + + #region Local Immunity Frames + internal class LocalIFrameRule : IProjectileTweak + { + internal readonly int localIFrameValue = -2; + + public LocalIFrameRule(int f) => localIFrameValue = f; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.usesLocalNPCImmunity = true; + proj.localNPCHitCooldown = localIFrameValue; + proj.usesIDStaticNPCImmunity = false; + proj.idStaticNPCHitCooldown = 0; + } + } + internal static IProjectileTweak LocalIFrames(int f) => new LocalIFrameRule(f); + internal static IProjectileTweak LocalIFramesOneHit = new LocalIFrameRule(-1); + #endregion + + #region Piercing + internal class PiercingDeltaRule : IProjectileTweak + { + internal readonly int delta = 0; + + public PiercingDeltaRule(int d) => delta = d; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.penetrate += delta; + if (proj.penetrate < 1) + proj.penetrate = 1; + proj.maxPenetrate = proj.penetrate; + } + } + internal static IProjectileTweak PiercingDelta(int p) => new PiercingDeltaRule(p); + + internal class PiercingExactRule : IProjectileTweak + { + internal readonly int newPenetrate = -1; + + public PiercingExactRule(int p) => newPenetrate = p; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.penetrate = newPenetrate; + if (proj.penetrate < 1) + proj.penetrate = 1; + proj.maxPenetrate = proj.penetrate; + } + } + internal static IProjectileTweak PiercingExact(int p) => new PiercingExactRule(p); + internal static IProjectileTweak NoPiercing = new PiercingExactRule(1); + internal static IProjectileTweak InfinitePiercing = new PiercingExactRule(-1); + #endregion + + #region Point Blank + internal class PointBlankRule : IProjectileTweak + { + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + => proj.Calamity().pointBlankShotDuration = DefaultPointBlankDuration; + } + internal static IProjectileTweak PointBlank => new PointBlankRule(); + #endregion + + #region Scale + internal class ScaleDeltaRule : IProjectileTweak + { + internal readonly float delta = 0; + + public ScaleDeltaRule(float d) => delta = d; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.scale += delta; + if (proj.scale < 0f) + proj.scale = 0f; + } + } + internal static IProjectileTweak ScaleDelta(float d) => new ScaleDeltaRule(d); + + internal class ScaleExactRule : IProjectileTweak + { + internal readonly float newScale = 0; + + public ScaleExactRule(float s) => newScale = s; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.scale = newScale; + if (proj.scale < 0f) + proj.scale = 0f; + } + } + internal static IProjectileTweak ScaleExact(float s) => new ScaleExactRule(s); + + internal class ScaleRatioRule : IProjectileTweak + { + internal readonly float ratio = 1f; + + public ScaleRatioRule(float f) => ratio = f; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.scale *= ratio; + if (proj.scale < 0f) + proj.scale = 0f; + } + } + internal static IProjectileTweak ScaleRatio(float f) => new ScaleRatioRule(f); + #endregion + + #region Tile Collide + internal class TileCollideRule : IProjectileTweak + { + internal readonly bool flag = true; + + public TileCollideRule(bool tc) => flag = tc; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.tileCollide = flag; + } + internal static IProjectileTweak TileCollide => new TileCollideRule(true); + internal static IProjectileTweak NoTileCollide => new TileCollideRule(false); + #endregion + + #region Time Left + internal class TimeLeftDeltaRule : IProjectileTweak + { + internal readonly int delta = 0; + + public TimeLeftDeltaRule(int d) => delta = d; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.timeLeft += delta; + if (proj.timeLeft < 1) + proj.timeLeft = 1; + } + } + internal static IProjectileTweak TimeLeftDelta(int d) => new TimeLeftDeltaRule(d); + + internal class TimeLeftExactRule : IProjectileTweak + { + internal readonly int newTimeLeft = 0; + + public TimeLeftExactRule(int t) => newTimeLeft = t; + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) + { + proj.timeLeft = newTimeLeft; + if (proj.timeLeft < 1) + proj.timeLeft = 1; + } + } + internal static IProjectileTweak TimeLeftExact(int t) => new TimeLeftExactRule(t); + #endregion + + #region True Melee + internal class TrueMeleeRule : IProjectileTweak + { + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.DamageType = TrueMeleeDamageClass.Instance; + } + internal static IProjectileTweak TrueMelee => new TrueMeleeRule(); + + internal class TrueMeleeNoSpeedRule : IProjectileTweak + { + public bool AppliesTo(Projectile proj) => true; + public void ApplyTweak(Projectile proj) => proj.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + } + internal static IProjectileTweak TrueMeleeNoSpeed => new TrueMeleeNoSpeedRule(); + #endregion + + #region Yoyo Stats + internal class YoyoRangeRule : IProjectileTweak + { + internal readonly float newMaxRange = 0f; + + public YoyoRangeRule(float r) => newMaxRange = r; + public bool AppliesTo(Projectile proj) => IsAYoyo(proj); + public void ApplyTweak(Projectile proj) => ProjectileID.Sets.YoyosMaximumRange[proj.type] = newMaxRange; + } + internal static IProjectileTweak YoyoRange(float r) => new YoyoRangeRule(r); + + internal class YoyoTopSpeedRule : IProjectileTweak + { + internal readonly float newTopSpeed = 0f; + + public YoyoTopSpeedRule(float s) => newTopSpeed = s; + public bool AppliesTo(Projectile proj) => IsAYoyo(proj); + public void ApplyTweak(Projectile proj) => ProjectileID.Sets.YoyosTopSpeed[proj.type] = newTopSpeed; + } + internal static IProjectileTweak YoyoTopSpeed(float r) => new YoyoTopSpeedRule(r); + #endregion + #endregion + #endregion } } From eb2fa2a1862520ab3c008471fd0189e413589cb7 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 23:39:46 -0400 Subject: [PATCH 12/31] make two random items public --- Items/Accessories/PhantomicArtifact.cs | 7 ++----- Items/Weapons/Summon/VoidConcentrationStaff.cs | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index a0c4a7f2f9..eef1f764a8 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - class PhantomicArtifact : ModItem + public class PhantomicArtifact : ModItem { public override void SetStaticDefaults() { @@ -32,10 +32,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.Calamity().phantomicArtifact = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().phantomicArtifact = true; public override void AddRecipes() { diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 076b393888..3b4bdec377 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -8,12 +8,12 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - class VoidConcentrationStaff : ModItem + public class VoidConcentrationStaff : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Void Concentration Staff"); - Tooltip.SetDefault("Summons a foreboding aura that attacks by firing void orbs\n" + //If you have flavour text ideas, feel free to implement, my brain is still like nonexistant as per usual yeah. + Tooltip.SetDefault("Summons a foreboding aura that attacks by firing void orbs\n" + "Minion damage is increased by 5% while the aura is active\n" + "Requires three minion slots to use\n" + "Only one may exist\n" + @@ -59,9 +59,7 @@ namespace CalamityMod.Items.Weapons.Summon return false; } - public override bool AltFunctionUse(Player player) - { - return base.AltFunctionUse(player); - } + // TODO -- should be strictly unnecessary as per API design + public override bool AltFunctionUse(Player player) => base.AltFunctionUse(player); } } From c4f4e07db9d4739addcb7508ce6e5a605bc070d7 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 2 Jul 2022 23:40:40 -0400 Subject: [PATCH 13/31] 1 - Internally renamed Wulfrum Metal Scrap 2 - Attempted to fix recipes that swap ingredient positions --- Items/Armor/Wulfrum/WulfrumArmor.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadMagic.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadMelee.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadRanged.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadRogue.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadSummon.cs | 2 +- Items/Armor/Wulfrum/WulfrumLeggings.cs | 2 +- Items/CalamityGlobalItemLoot.cs | 4 ++-- Items/Fishing/FishingRods/WulfrumRod.cs | 2 +- .../{WulfrumShard.cs => WulfrumMetalScrap.cs} | 6 ++++-- .../{WulfrumShard.png => WulfrumMetalScrap.png} | Bin Items/Tools/WulfrumAxe.cs | 2 +- Items/Tools/WulfrumHammer.cs | 2 +- Items/Tools/WulfrumPickaxe.cs | 2 +- Items/Weapons/Magic/WulfrumStaff.cs | 2 +- Items/Weapons/Melee/WulfrumBlade.cs | 2 +- Items/Weapons/Ranged/WulfrumBow.cs | 2 +- Items/Weapons/Rogue/WulfrumKnife.cs | 2 +- Items/Weapons/Summon/WulfrumController.cs | 2 +- NPCs/NormalNPCs/WulfrumDrone.cs | 2 +- NPCs/NormalNPCs/WulfrumGyrator.cs | 2 +- NPCs/NormalNPCs/WulfrumHovercraft.cs | 2 +- NPCs/NormalNPCs/WulfrumPylon.cs | 2 +- NPCs/NormalNPCs/WulfrumRover.cs | 2 +- Utilities/CalamityRecipes.cs | 7 +++++-- 25 files changed, 32 insertions(+), 27 deletions(-) rename Items/Materials/{WulfrumShard.cs => WulfrumMetalScrap.cs} (84%) rename Items/Materials/{WulfrumShard.png => WulfrumMetalScrap.png} (100%) diff --git a/Items/Armor/Wulfrum/WulfrumArmor.cs b/Items/Armor/Wulfrum/WulfrumArmor.cs index 89a10c8f4e..e9aa8e2359 100644 --- a/Items/Armor/Wulfrum/WulfrumArmor.cs +++ b/Items/Armor/Wulfrum/WulfrumArmor.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadMagic.cs b/Items/Armor/Wulfrum/WulfrumHeadMagic.cs index 5e92722e98..431cb15bb8 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadMagic.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadMagic.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadMelee.cs b/Items/Armor/Wulfrum/WulfrumHeadMelee.cs index 4209a2a8f3..1ecd8a6275 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadMelee.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadMelee.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadRanged.cs b/Items/Armor/Wulfrum/WulfrumHeadRanged.cs index 2b2b43bd70..8880553bbb 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadRanged.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadRanged.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadRogue.cs b/Items/Armor/Wulfrum/WulfrumHeadRogue.cs index dbc981bc32..a0bf5fb76d 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadRogue.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadRogue.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadSummon.cs b/Items/Armor/Wulfrum/WulfrumHeadSummon.cs index 4d9e4a1636..8672848df2 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadSummon.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadSummon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumLeggings.cs b/Items/Armor/Wulfrum/WulfrumLeggings.cs index 897f279f2b..9798df367e 100644 --- a/Items/Armor/Wulfrum/WulfrumLeggings.cs +++ b/Items/Armor/Wulfrum/WulfrumLeggings.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(8). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index 177b0e516e..b600276188 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -257,13 +257,13 @@ namespace CalamityMod.Items case ItemID.WoodenCrate: case ItemID.WoodenCrateHard: BlockCrateDrops(); - DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 3, 5); + DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 3, 5); break; case ItemID.IronCrate: case ItemID.IronCrateHard: BlockCrateDrops(); - DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); + DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); break; diff --git a/Items/Fishing/FishingRods/WulfrumRod.cs b/Items/Fishing/FishingRods/WulfrumRod.cs index ed4c1d1979..e0fce5c5a9 100644 --- a/Items/Fishing/FishingRods/WulfrumRod.cs +++ b/Items/Fishing/FishingRods/WulfrumRod.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(9). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Materials/WulfrumShard.cs b/Items/Materials/WulfrumMetalScrap.cs similarity index 84% rename from Items/Materials/WulfrumShard.cs rename to Items/Materials/WulfrumMetalScrap.cs index 725c76f90a..7d17d6c499 100644 --- a/Items/Materials/WulfrumShard.cs +++ b/Items/Materials/WulfrumMetalScrap.cs @@ -4,7 +4,8 @@ using Terraria.ID; namespace CalamityMod.Items.Materials { - public class WulfrumShard : ModItem + [LegacyName("WulfrumShard")] + public class WulfrumMetalScrap : ModItem { public override void SetStaticDefaults() { @@ -19,5 +20,6 @@ namespace CalamityMod.Items.Materials Item.maxStack = 999; Item.value = Item.sellPrice(copper: 80); Item.rare = ItemRarityID.Blue; - } } + } + } } diff --git a/Items/Materials/WulfrumShard.png b/Items/Materials/WulfrumMetalScrap.png similarity index 100% rename from Items/Materials/WulfrumShard.png rename to Items/Materials/WulfrumMetalScrap.png diff --git a/Items/Tools/WulfrumAxe.cs b/Items/Tools/WulfrumAxe.cs index 3cb9edc5f9..9a6e170f4f 100644 --- a/Items/Tools/WulfrumAxe.cs +++ b/Items/Tools/WulfrumAxe.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(14). + AddIngredient(14). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/WulfrumHammer.cs b/Items/Tools/WulfrumHammer.cs index 6323e7996a..658079700d 100644 --- a/Items/Tools/WulfrumHammer.cs +++ b/Items/Tools/WulfrumHammer.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(16). + AddIngredient(16). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/WulfrumPickaxe.cs b/Items/Tools/WulfrumPickaxe.cs index 529aa57d42..c045cdc538 100644 --- a/Items/Tools/WulfrumPickaxe.cs +++ b/Items/Tools/WulfrumPickaxe.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index d88993e314..2c3428c84e 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/WulfrumBlade.cs b/Items/Weapons/Melee/WulfrumBlade.cs index b48de10bf2..96cee3c6f9 100644 --- a/Items/Weapons/Melee/WulfrumBlade.cs +++ b/Items/Weapons/Melee/WulfrumBlade.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 18f96b284e..978c8a83e3 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 221d095dcf..50eb84005e 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(100). - AddIngredient(). + AddIngredient(). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 0467ead024..07672937a7 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(9). AddTile(TileID.Anvils). Register(); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 7a62faaeb8..8a6e514625 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(ModContent.ItemType(), 1, 1, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 321beb7bb4..f3eb82c31c 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 2); + npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 0c3d439589..652896030c 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -297,7 +297,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 2, 3); + npcLoot.Add(ModContent.ItemType(), 1, 2, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 80ebc2d7cd..cb80505f16 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 2, 3); + npcLoot.Add(ModContent.ItemType(), 1, 2, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.Add(ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 8341a45320..12586150d8 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 2); + npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 58c450a5b2..e8f76835fd 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -681,8 +681,11 @@ namespace CalamityMod { if (r.requiredItem.Count < i1 + 1 || r.requiredItem.Count < i2 + 1) return; - (r.requiredItem[i2].type, r.requiredItem[i1].type) = (r.requiredItem[i1].type, r.requiredItem[i2].type); - (r.requiredItem[i2].stack, r.requiredItem[i1].stack) = (r.requiredItem[i1].stack, r.requiredItem[i2].stack); + + // Apparently, C# tuple swap notation does not work here. + var store = r.requiredItem[i1]; + r.requiredItem[i1] = r.requiredItem[i2]; + r.requiredItem[i2] = store; }; static Action ReplaceTile(int oldTileID, int newTileID) => r => { From fad54bc2d86ac3be8c101ec14646715774a13ca8 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 3 Jul 2022 00:01:34 -0400 Subject: [PATCH 14/31] Fix recipes that replace their ingredients. --- Utilities/CalamityRecipes.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index e8f76835fd..0b41bff01a 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -674,7 +674,12 @@ namespace CalamityMod int idx = r.IngredientIndex(oldItemID); if (idx == -1) return; - r.requiredItem[idx].type = newItemID; + + // Replace the entire Item, but keep the old stack count. + Item newIngredient = new Item(); + newIngredient.SetDefaults(newItemID); + newIngredient.stack = r.requiredItem[idx].stack; + r.requiredItem[idx] = newIngredient; }; static Action RemoveIngredient(int itemID) => r => r.RemoveIngredient(itemID); static Action SwapIngredients(int i1, int i2) => r => @@ -682,7 +687,8 @@ namespace CalamityMod if (r.requiredItem.Count < i1 + 1 || r.requiredItem.Count < i2 + 1) return; - // Apparently, C# tuple swap notation does not work here. + // Swap the entire Items in the List (uses pointers under the hood). + // DO NOT do what it tells you to here by making it a tuple notation swap. That does NOT work. var store = r.requiredItem[i1]; r.requiredItem[i1] = r.requiredItem[i2]; r.requiredItem[i2] = store; From 0716578a73df8f32da6304361122783b52163b2e Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 2 Jul 2022 23:12:13 -0500 Subject: [PATCH 15/31] 1 - Made DoG dialogue less cringe. --- Items/SummonItems/CosmicWorm.cs | 2 +- Localization/CalamityLocalization.cs | 18 +++++++----------- NPCs/DevourerofGods/DevourerofGodsHead.cs | 10 ++++------ NPCs/DevourerofGods/DevourerofGodsTail.cs | 13 ------------- 4 files changed, 12 insertions(+), 31 deletions(-) diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index 0bd5abd421..46b69e78eb 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - string key = "Mods.CalamityMod.EdgyBossText12"; + string key = "Mods.CalamityMod.EdgyBossText7"; Color messageColor = Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 8072d28646..26d457769e 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -79,17 +79,13 @@ namespace CalamityMod.Localization new [] { "SCalDesparationText3Rematch", "I trust you will not make the same mistakes he did." }, new [] { "SCalDesparationText4Rematch", "I can’t imagine what your future holds now." }, - new [] { "EdgyBossText", "Don't get cocky, kid!" }, - new [] { "EdgyBossText3", "A fatal mistake!" }, - new [] { "EdgyBossText4", "Good luck recovering from that!" }, - new [] { "EdgyBossText5", "Delicious..." }, - new [] { "EdgyBossText6", "Did that hurt?" }, - new [] { "EdgyBossText7", "Nothing personal, kid." }, - new [] { "EdgyBossText8", "Are you honestly that bad at dodging?" }, - new [] { "EdgyBossText9", "Of all my segments to get hit by..." }, - new [] { "EdgyBossText10", "It's not over yet, kid!" }, - new [] { "EdgyBossText11", "A GOD DOES NOT FEAR DEATH!" }, - new [] { "EdgyBossText12", "You are no god... but I shall feast upon your essence regardless!" }, + new [] { "EdgyBossText", "Don't get cocky!" }, + new [] { "EdgyBossText2", "A fatal mistake!" }, + new [] { "EdgyBossText3", "Delicious..." }, + new [] { "EdgyBossText4", "Did that hurt?" }, + new [] { "EdgyBossText5", "It's not over yet!" }, + new [] { "EdgyBossText6", "A GOD DOES NOT FEAR DEATH!" }, + new [] { "EdgyBossText7", "You are no god... but I shall feast upon your essence regardless!" }, new [] { "DoGBossText", "The frigid moon shimmers brightly." }, new [] { "DoGBossText2", "The harvest moon glows eerily." }, diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 5799f34655..50ea413f8b 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -516,7 +516,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Dialogue the moment the second phase starts if (NPC.localAI[2] == 60f) { - string key = "Mods.CalamityMod.EdgyBossText10"; + string key = "Mods.CalamityMod.EdgyBossText5"; Color messageColor = Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); } @@ -661,7 +661,7 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[3] = 0f; // Anger message - string key = "Mods.CalamityMod.EdgyBossText11"; + string key = "Mods.CalamityMod.EdgyBossText6"; Color messageColor = Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); @@ -2523,11 +2523,9 @@ namespace CalamityMod.NPCs.DevourerofGods { string text = Utils.SelectRandom(Main.rand, new string[] { + "Mods.CalamityMod.EdgyBossText2", "Mods.CalamityMod.EdgyBossText3", - "Mods.CalamityMod.EdgyBossText4", - "Mods.CalamityMod.EdgyBossText5", - "Mods.CalamityMod.EdgyBossText6", - "Mods.CalamityMod.EdgyBossText7" + "Mods.CalamityMod.EdgyBossText4" }); Color messageColor = Color.Cyan; Rectangle location = new Rectangle((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index b54581bdaf..32cccd6e4b 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -453,19 +453,6 @@ namespace CalamityMod.NPCs.DevourerofGods { player.AddBuff(ModContent.BuffType(), 180, true); player.AddBuff(ModContent.BuffType(), 360, true); - - if (player.Calamity().dogTextCooldown <= 0) - { - string text = Utils.SelectRandom(Main.rand, new string[] - { - "Mods.CalamityMod.EdgyBossText8", - "Mods.CalamityMod.EdgyBossText9" - }); - Color messageColor = Color.Cyan; - Rectangle location = new Rectangle((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height); - CombatText.NewText(location, messageColor, Language.GetTextValue(text), true); - player.Calamity().dogTextCooldown = 60; - } } } } From 0d30fc23411e2662536fb4167f341a570fd04d15 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 3 Jul 2022 00:28:07 -0400 Subject: [PATCH 16/31] Severe buff to Flamethrower and Elf Melter. --- Items/CalamityGlobalItemTweaks.cs | 4 ++-- Projectiles/CalamityGlobalProjectileTweaks.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 8bad55765c..493ad9c6f4 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -178,7 +178,7 @@ namespace CalamityMod.Items { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, { ItemID.EbonwoodSword, Do(AutoReuse, UseTurn) }, { ItemID.ElectrosphereLauncher, Do(DamageRatio(1.1f)) }, - { ItemID.EldMelter, Do(DamageRatio(1.5f)) }, // Elf Melter, intentionally not in alphabetical order to correct for typo + { ItemID.EldMelter, Do(DamageExact(113), ShootSpeedDelta(+3f)) }, // Elf Melter, intentionally not in alphabetical order to correct for typo { ItemID.EmeraldStaff, Do(DamageExact(28)) }, { ItemID.EmpressBlade, Do(UseExact(20)) }, { ItemID.EnchantedBoomerang, Do(DamageRatio(2f), UseExact(28)) }, @@ -194,7 +194,7 @@ namespace CalamityMod.Items // { ItemID.FireworksLauncher, Do(DamageRatio(2f)) }, // Celebration { ItemID.Flamarang, Do(DamageExact(45)) }, { ItemID.Flamelash, Do(DamageRatio(1.25f)) }, - { ItemID.Flamethrower, Do(DamageExact(47), ShootSpeedExact(14)) }, + { ItemID.Flamethrower, Do(DamageExact(47), ShootSpeedDelta(+3f)) }, { ItemID.FlamingArrow, Do(DamageRatio(1.1f)) }, { ItemID.FlareGun, pointBlank }, { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 39f887e0eb..1867493dbf 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -90,6 +90,7 @@ namespace CalamityMod.Projectiles { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance { ProjectileID.FireArrow, pointBlank }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2)) }, + { ProjectileID.Flames, Do(IDStaticIFrames(6), ExtraUpdatesDelta(+1)) }, // Flamethrower + Elf Melter { ProjectileID.FlamingJack, Do(ExtraUpdatesExact(1)) }, { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes { ProjectileID.Flare, pointBlank }, From 412e88e498814b90bcf6892af98cf364f5429b71 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 3 Jul 2022 00:28:41 -0400 Subject: [PATCH 17/31] UN-RENAMED Wulfrum Shard to prevent horrific merge conflicts --- Items/Armor/Wulfrum/WulfrumArmor.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadMagic.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadMelee.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadRanged.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadRogue.cs | 2 +- Items/Armor/Wulfrum/WulfrumHeadSummon.cs | 2 +- Items/Armor/Wulfrum/WulfrumLeggings.cs | 2 +- Items/CalamityGlobalItemLoot.cs | 4 ++-- Items/Fishing/FishingRods/WulfrumRod.cs | 2 +- Items/Materials/WulfrumMetalScrap.cs | 3 +-- .../{WulfrumMetalScrap.png => WulfrumShard.png} | Bin Items/Tools/WulfrumAxe.cs | 2 +- Items/Tools/WulfrumHammer.cs | 2 +- Items/Tools/WulfrumPickaxe.cs | 2 +- Items/Weapons/Magic/WulfrumStaff.cs | 2 +- Items/Weapons/Melee/WulfrumBlade.cs | 2 +- Items/Weapons/Ranged/WulfrumBow.cs | 2 +- Items/Weapons/Rogue/WulfrumKnife.cs | 2 +- Items/Weapons/Summon/WulfrumController.cs | 2 +- NPCs/NormalNPCs/WulfrumDrone.cs | 2 +- NPCs/NormalNPCs/WulfrumGyrator.cs | 2 +- NPCs/NormalNPCs/WulfrumHovercraft.cs | 2 +- NPCs/NormalNPCs/WulfrumPylon.cs | 2 +- NPCs/NormalNPCs/WulfrumRover.cs | 2 +- 24 files changed, 24 insertions(+), 25 deletions(-) rename Items/Materials/{WulfrumMetalScrap.png => WulfrumShard.png} (100%) diff --git a/Items/Armor/Wulfrum/WulfrumArmor.cs b/Items/Armor/Wulfrum/WulfrumArmor.cs index e9aa8e2359..89a10c8f4e 100644 --- a/Items/Armor/Wulfrum/WulfrumArmor.cs +++ b/Items/Armor/Wulfrum/WulfrumArmor.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadMagic.cs b/Items/Armor/Wulfrum/WulfrumHeadMagic.cs index 431cb15bb8..5e92722e98 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadMagic.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadMagic.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadMelee.cs b/Items/Armor/Wulfrum/WulfrumHeadMelee.cs index 1ecd8a6275..4209a2a8f3 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadMelee.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadMelee.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadRanged.cs b/Items/Armor/Wulfrum/WulfrumHeadRanged.cs index 8880553bbb..2b2b43bd70 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadRanged.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadRanged.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadRogue.cs b/Items/Armor/Wulfrum/WulfrumHeadRogue.cs index a0bf5fb76d..dbc981bc32 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadRogue.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadRogue.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumHeadSummon.cs b/Items/Armor/Wulfrum/WulfrumHeadSummon.cs index 8672848df2..4d9e4a1636 100644 --- a/Items/Armor/Wulfrum/WulfrumHeadSummon.cs +++ b/Items/Armor/Wulfrum/WulfrumHeadSummon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/Wulfrum/WulfrumLeggings.cs b/Items/Armor/Wulfrum/WulfrumLeggings.cs index 9798df367e..897f279f2b 100644 --- a/Items/Armor/Wulfrum/WulfrumLeggings.cs +++ b/Items/Armor/Wulfrum/WulfrumLeggings.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(8). AddIngredient(). AddTile(TileID.Anvils). Register(); diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index b600276188..177b0e516e 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -257,13 +257,13 @@ namespace CalamityMod.Items case ItemID.WoodenCrate: case ItemID.WoodenCrateHard: BlockCrateDrops(); - DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 3, 5); + DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 3, 5); break; case ItemID.IronCrate: case ItemID.IronCrateHard: BlockCrateDrops(); - DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); + DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); DropHelper.DropItemChance(s, player, ModContent.ItemType(), 0.25f, 5, 8); break; diff --git a/Items/Fishing/FishingRods/WulfrumRod.cs b/Items/Fishing/FishingRods/WulfrumRod.cs index e0fce5c5a9..ed4c1d1979 100644 --- a/Items/Fishing/FishingRods/WulfrumRod.cs +++ b/Items/Fishing/FishingRods/WulfrumRod.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Fishing.FishingRods public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(9). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Materials/WulfrumMetalScrap.cs b/Items/Materials/WulfrumMetalScrap.cs index 7d17d6c499..7567c3dd3d 100644 --- a/Items/Materials/WulfrumMetalScrap.cs +++ b/Items/Materials/WulfrumMetalScrap.cs @@ -4,8 +4,7 @@ using Terraria.ID; namespace CalamityMod.Items.Materials { - [LegacyName("WulfrumShard")] - public class WulfrumMetalScrap : ModItem + public class WulfrumShard : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Materials/WulfrumMetalScrap.png b/Items/Materials/WulfrumShard.png similarity index 100% rename from Items/Materials/WulfrumMetalScrap.png rename to Items/Materials/WulfrumShard.png diff --git a/Items/Tools/WulfrumAxe.cs b/Items/Tools/WulfrumAxe.cs index 9a6e170f4f..3cb9edc5f9 100644 --- a/Items/Tools/WulfrumAxe.cs +++ b/Items/Tools/WulfrumAxe.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(14). + AddIngredient(14). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/WulfrumHammer.cs b/Items/Tools/WulfrumHammer.cs index 658079700d..6323e7996a 100644 --- a/Items/Tools/WulfrumHammer.cs +++ b/Items/Tools/WulfrumHammer.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(16). + AddIngredient(16). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Tools/WulfrumPickaxe.cs b/Items/Tools/WulfrumPickaxe.cs index c045cdc538..529aa57d42 100644 --- a/Items/Tools/WulfrumPickaxe.cs +++ b/Items/Tools/WulfrumPickaxe.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index 2c3428c84e..d88993e314 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/WulfrumBlade.cs b/Items/Weapons/Melee/WulfrumBlade.cs index 96cee3c6f9..b48de10bf2 100644 --- a/Items/Weapons/Melee/WulfrumBlade.cs +++ b/Items/Weapons/Melee/WulfrumBlade.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(12). + AddIngredient(12). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 978c8a83e3..18f96b284e 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 50eb84005e..221d095dcf 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(100). - AddIngredient(). + AddIngredient(). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 07672937a7..0467ead024 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). - AddIngredient(9). + AddIngredient(9). AddTile(TileID.Anvils). Register(); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 8a6e514625..7a62faaeb8 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 3); + npcLoot.Add(ModContent.ItemType(), 1, 1, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index f3eb82c31c..321beb7bb4 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 2); + npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 652896030c..0c3d439589 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -297,7 +297,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 2, 3); + npcLoot.Add(ModContent.ItemType(), 1, 2, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index cb80505f16..80ebc2d7cd 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 2, 3); + npcLoot.Add(ModContent.ItemType(), 1, 2, 3); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.Add(ModContent.ItemType()); } diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 12586150d8..8341a45320 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 1, 1, 2); + npcLoot.Add(ModContent.ItemType(), 1, 1, 2); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType(), new Fraction(7, 100)); npcLoot.AddIf(info => info.npc.ModNPC().Supercharged, ModContent.ItemType()); From 3e38c2245a5a7a53685e41b59c107d2104be6fb7 Mon Sep 17 00:00:00 2001 From: GinYuH <> Date: Sun, 3 Jul 2022 04:08:26 -0700 Subject: [PATCH 18/31] Resprited Carnage --- Items/Weapons/Melee/Carnage.cs | 4 ++-- Items/Weapons/Melee/Carnage.png | Bin 861 -> 862 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 0e15b9d419..2fb784f3fc 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.width = 46; + Item.width = 50; Item.damage = 70; Item.DamageType = DamageClass.Melee; Item.useAnimation = 21; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.useTurn = true; - Item.height = 60; + Item.height = 54; Item.scale = 1.25f; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; diff --git a/Items/Weapons/Melee/Carnage.png b/Items/Weapons/Melee/Carnage.png index cfa055f37188fdafe4f730648391055cc38f16b7..98714b5768e6097c2b9da02e3700b59892d75feb 100644 GIT binary patch literal 862 zcmV-k1EKthP)D`&0>29Go)Ay&U&N=sXucJ}R{~m2!iP;z*KNd}*<+cuAC5q2(e0wMr4tROVLHX<5^m{LH4kV2jj$pq|wclSn=*m?VO z8ZWm_MTy_vKTpHFarxy{$GHCXAOg?=jYtF~^sM08h-m!T_M4au1YmA36Ns;`qXa_s zQM#r)hagAnQ%8Nzge3TAa72E5dJ!dNT`9j2r7%S(&k2fImldY;u7dx57|&=w<#QeN zck^kq_e3zFBt+0NWgrJAWgR6UrPXPQ_SNd`aYSN`z}^x;2qHug3S=idTkmb-Ek#** z4~y!<#(6Z>8zLI6A;l>H-3{~ha{xA0ZqbDrsG&v?fSn+^#lLa9uM6WN(Fr^ivkU2%6h>rCf~TswC%O1yt^ z>A%R%AmZ)C8IJg#aAxI>^qvR;@nb<}w8iBKvlPhsPf=ZI(P+zoH7l{+#xBAE~;D1Phgi71hsu#N*z zzO|voU~h>~FcbK8=XsPcj;QsWMGZSry(5CahpQK(1R};WdVTwgpfk>Bw0A@(3K6N@ z0rS>#0A{Lxq=Kxy+Ffbvhl o2tsh_inX0k;~CqoyR7_w0Yf6oT=s4tTL1t607*qoM6N<$f|H$mod5s; literal 861 zcmV-j1ETziP)N;mQjDz_LYzkx1pc*2H~E#*Dy2i$H4MxhC#X*GT_3ebf6ZD~1eAPDTt(8SW-bE&rp`=f#^1kw3IMoj{W&A7ZbIFkT>t>wTX_zkCO#@9 zt{Q&-n(1G&oF{p8kwjdnChn5DO7rAd0REh(>Y1~wx{f-XkzkHTGERS2^1%{6uzH+w zxeIfAZTk&?Q6Fc&ZP)X2*z;=QKGC|% zRgb4*0KhY=N$4_hRce*OIZkp9EEn(Y{o4PkmbLTd*YxL?7J&)-e7N-mz-V5Fm+KVW15y<(=Zs+WiBrtYSo(~Fl4qp0^?r+3WDz52x`^gD*PK+a z#B=*N$>|!A(%gI{_p??xy}k+n=sE7!D)6?wmyuYqHdx|?bDTt2OK|_=hRtjgYYSet zWTaJer-9{qDr-z7ogSNd{11QL1@;JlxoyNc*k8I|{=53~yjMw6)g$g&BU1Eb-KiSb zYTb1rLDD)OsM4yQNO*HxiE`y~(Oe?3_Q}kz>!+^V1OW7nd`tY@^&2RvV2OKYPF=Zh z%}8kk-dcoqtgqFg&V+5pUZGFbB~H2a097v1RASHRiJ!at+NEHLdtF6$qHY;cuDajZ zjQNO>u{hi^)?*DL8Fs_GG^v}W=7xyw}&c}_a! z-hB0lD`~DZ^~9hr{k;1sf7QpSbI+h9?OV^4|`JMVbnh_@t8Fk^PU4 nhfLO`V2L-1p5+`B1xx%V&Egv&R-$ge00000NkvXXu0mjfUp}mr From 8aed0663263e3967775ecf8a93b351cc702bd334 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Sun, 3 Jul 2022 11:39:43 -0500 Subject: [PATCH 19/31] Swapped Beetle Shell recipe mats and fixed Naughty Present. --- Utilities/CalamityRecipes.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 0b41bff01a..62c4f20f9d 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -716,7 +716,7 @@ namespace CalamityMod { Vanilla(ItemID.Magiluminescence), MagiluminescenceRecipeEdit }, { Vanilla(ItemID.FireGauntlet), AddIngredient(ModContent.ItemType(), 5) }, { Vanilla(ItemID.SpiritFlame), AddGroup(AnyAdamantiteBar, 2) }, - { VanillaEach(ItemID.BeetleHelmet, ItemID.BeetleScaleMail, ItemID.BeetleLeggings), SwapIngredients(0, 1) }, + { VanillaEach(ItemID.BeetleHelmet, ItemID.BeetleScaleMail, ItemID.BeetleShell, ItemID.BeetleLeggings), SwapIngredients(0, 1) }, { Vanilla(ItemID.GoblinBattleStandard), ChangeIngredientStack(ItemID.TatteredCloth, 5) }, { Vanilla(ItemID.WormFood), WormFoodRecipeEdit }, { Vanilla(ItemID.BloodySpine), BloodySpineRecipeEdit }, @@ -1113,6 +1113,7 @@ namespace CalamityMod r.AddIngredient(ItemID.Silk, 20); r.AddIngredient(ItemID.Ectoplasm, 5); r.AddRecipeGroup(AnySilverBar, 5); + r.AddTile(TileID.MythrilAnvil); r.Register(); // Lihzahrd Power Cell (NOT Calamity's Old Power Cell) From e8e99b7d693eb9522a911427c0de8dab847b7f1d Mon Sep 17 00:00:00 2001 From: "Phuc Nguyen (Brav)" Date: Sun, 3 Jul 2022 17:41:22 -0700 Subject: [PATCH 20/31] 1 - Updated Supreme Bait Tackle Box Fishing Station's tooltip to include being able to fish in lava 2 - Made the non-Sunken Sea schematics use a dynamic tooltip to signify whether they've been decrypted yet --- .../Accessories/SupremeBaitTackleBoxFishingStation.cs | 1 + Items/DraedonMisc/EncryptedSchematicHell.cs | 10 ++++++++++ Items/DraedonMisc/EncryptedSchematicIce.cs | 11 +++++++++++ Items/DraedonMisc/EncryptedSchematicJungle.cs | 10 ++++++++++ Items/DraedonMisc/EncryptedSchematicPlanetoid.cs | 9 +++++++++ 5 files changed, 41 insertions(+) diff --git a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs index d6248c0e22..2f5063944f 100644 --- a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs +++ b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories "Increases fishing skill by 80\n" + "Fishing line will never break and decreases chance of bait consumption\n" + "Increases chance to catch crates\n" + + "Allows fishing in lava\n" + "Sonar potion effect"); } diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs index 827f194146..8bd15a53cc 100644 --- a/Items/DraedonMisc/EncryptedSchematicHell.cs +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -4,6 +4,8 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; +using System.Linq; namespace CalamityMod.Items.DraedonMisc { @@ -33,6 +35,14 @@ namespace CalamityMod.Items.DraedonMisc } } + public override void ModifyTooltips(List list) + { + TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); + + if (line != null && RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes) + line.Text = "Has already been decrypted"; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/DraedonMisc/EncryptedSchematicIce.cs b/Items/DraedonMisc/EncryptedSchematicIce.cs index f350608fe9..5f9e8286e6 100644 --- a/Items/DraedonMisc/EncryptedSchematicIce.cs +++ b/Items/DraedonMisc/EncryptedSchematicIce.cs @@ -4,6 +4,9 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; +using System.Linq; + namespace CalamityMod.Items.DraedonMisc { @@ -33,6 +36,14 @@ namespace CalamityMod.Items.DraedonMisc } } + public override void ModifyTooltips(List list) + { + TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); + + if (line != null && RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes) + line.Text = "Has already been decrypted"; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs index 6afa983388..a4d4616caf 100644 --- a/Items/DraedonMisc/EncryptedSchematicJungle.cs +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -4,6 +4,8 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; +using System.Linq; namespace CalamityMod.Items.DraedonMisc { @@ -33,6 +35,14 @@ namespace CalamityMod.Items.DraedonMisc } } + public override void ModifyTooltips(List list) + { + TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); + + if (line != null && RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes) + line.Text = "Has already been decrypted"; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index eb2c90225d..ec5ce5797f 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -4,6 +4,8 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System.Collections.Generic; +using System.Linq; namespace CalamityMod.Items.DraedonMisc { @@ -33,6 +35,13 @@ namespace CalamityMod.Items.DraedonMisc } } + public override void ModifyTooltips(List list) + { + TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); + + if (line != null && RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes) + line.Text = "Has already been decrypted"; + } public override void AddRecipes() { CreateRecipe(). From eabd312700a738eceb0abc84af713adbee78a457 Mon Sep 17 00:00:00 2001 From: "Phuc Nguyen (Brav)" Date: Sun, 3 Jul 2022 17:43:41 -0700 Subject: [PATCH 21/31] Made Rune of Kos correctly state CV's enrage condition --- Items/SummonItems/RuneofKos.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/SummonItems/RuneofKos.cs b/Items/SummonItems/RuneofKos.cs index 0f8892fbf7..223c4ca96d 100644 --- a/Items/SummonItems/RuneofKos.cs +++ b/Items/SummonItems/RuneofKos.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.SummonItems if (player.ZoneDungeon) { line.Text = "Summons the Ceaseless Void" + - "\nEnrages outside the Dungeon"; + "\nEnrages on the surface"; } else if (player.ZoneSkyHeight) line.Text = "Summons the Storm Weaver"; From 83772188cc5244e4c64a43adad2bbfafc24aea54 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 4 Jul 2022 16:30:49 -0500 Subject: [PATCH 22/31] 1 - Goodbye, Malice. --- CalPlayer/CalamityPlayer.cs | 4 +- CalPlayer/CalamityPlayerMiscEffects.cs | 6 +- DataStructures/NPCStats.cs | 2 +- ILEditing/ILChangesLoading.cs | 4 +- ILEditing/MechanicILChanges.cs | 8 +- Items/DifficultyItems/DeathModeItem.cs | 8 - Items/DifficultyItems/MaliceModeItem.cs | 111 --- Items/DifficultyItems/MaliceModeItem.png | Bin 573 -> 0 bytes .../MaliceModeItem_Animated.png | Bin 3073 -> 0 bytes Items/DifficultyItems/RevengeanceModeItem.cs | 7 - Items/TreasureBags/StarterBag.cs | 3 +- Localization/CalamityLocalization.cs | 3 - ModSupport/ModCalls.cs | 10 - NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs | 7 +- .../AdultEidolonWyrmBodyAlt.cs | 7 +- NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs | 33 +- NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs | 5 +- NPCs/AquaticScourge/AquaticScourgeBody.cs | 2 +- NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs | 2 +- NPCs/AquaticScourge/AquaticScourgeHead.cs | 2 +- NPCs/AquaticScourge/AquaticScourgeTail.cs | 2 +- NPCs/AstrumDeus/AstrumDeusBody.cs | 2 +- NPCs/AstrumDeus/AstrumDeusHead.cs | 2 +- NPCs/AstrumDeus/AstrumDeusTail.cs | 2 +- NPCs/CalamityAI.cs | 763 +++--------------- NPCs/CalamityGlobalNPC.cs | 12 +- NPCs/CeaselessVoid/DarkEnergy.cs | 10 +- NPCs/Crabulon/CrabShroom.cs | 2 +- NPCs/Crabulon/Crabulon.cs | 34 +- NPCs/Cryogen/Cryogen.cs | 38 +- NPCs/DesertScourge/DesertScourgeBody.cs | 2 +- NPCs/DesertScourge/DesertScourgeHead.cs | 30 +- NPCs/DesertScourge/DesertScourgeTail.cs | 2 +- NPCs/DevourerofGods/CosmicGuardianHead.cs | 5 +- NPCs/DevourerofGods/DevourerofGodsBody.cs | 18 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 47 +- NPCs/ExoMechs/Apollo/Apollo.cs | 20 +- NPCs/ExoMechs/Ares/AresBody.cs | 16 +- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 12 +- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 12 +- NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 14 +- NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 14 +- NPCs/ExoMechs/Artemis/Artemis.cs | 24 +- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 16 +- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 16 +- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 12 +- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 16 +- NPCs/HiveMind/DankCreeper.cs | 2 +- NPCs/HiveMind/DarkHeart.cs | 2 +- NPCs/HiveMind/HiveMind.cs | 30 +- NPCs/Leviathan/Anahita.cs | 18 +- NPCs/Leviathan/AquaticAberration.cs | 12 +- NPCs/Leviathan/Leviathan.cs | 16 +- NPCs/NormalNPCs/KingSlimeJewel.cs | 2 +- NPCs/OldDuke/OldDukeToothBall.cs | 12 +- NPCs/OldDuke/SulphurousSharkron.cs | 16 +- NPCs/Perforator/PerforatorBodyLarge.cs | 2 +- NPCs/Perforator/PerforatorBodyMedium.cs | 2 +- NPCs/Perforator/PerforatorBodySmall.cs | 2 +- NPCs/Perforator/PerforatorHeadLarge.cs | 22 +- NPCs/Perforator/PerforatorHeadMedium.cs | 16 +- NPCs/Perforator/PerforatorHeadSmall.cs | 20 +- NPCs/Perforator/PerforatorHive.cs | 30 +- NPCs/Perforator/PerforatorTailLarge.cs | 2 +- NPCs/Perforator/PerforatorTailMedium.cs | 2 +- NPCs/Perforator/PerforatorTailSmall.cs | 2 +- .../PlagueHomingMissile.cs | 12 +- NPCs/PlaguebringerGoliath/PlagueMine.cs | 12 +- .../PlaguebringerGoliath.cs | 30 +- NPCs/Polterghast/PolterPhantom.cs | 14 +- NPCs/Polterghast/Polterghast.cs | 18 +- .../ProfanedGuardianCommander.cs | 26 +- .../ProfanedGuardianDefender.cs | 22 +- NPCs/Providence/Providence.cs | 48 +- NPCs/Ravager/RavagerBody.cs | 28 +- NPCs/Ravager/RavagerHead2.cs | 8 +- NPCs/Ravager/RockPillar.cs | 2 +- NPCs/Signus/CosmicLantern.cs | 2 +- NPCs/Signus/Signus.cs | 28 +- NPCs/SlimeGod/CrimulanSlimeGod.cs | 15 +- NPCs/SlimeGod/EbonianSlimeGod.cs | 15 +- NPCs/SlimeGod/SlimeGodCore.cs | 23 +- NPCs/SlimeGod/SplitCrimulanSlimeGod.cs | 15 +- NPCs/SlimeGod/SplitEbonianSlimeGod.cs | 15 +- NPCs/StormWeaver/StormWeaverBody.cs | 32 +- NPCs/StormWeaver/StormWeaverHead.cs | 37 +- NPCs/StormWeaver/StormWeaverTail.cs | 26 +- .../SepulcherBodyEnergyBall.cs | 2 +- NPCs/SupremeCalamitas/SepulcherHead.cs | 4 +- NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 2 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 52 +- NPCs/SupremeCalamitas/SupremeCataclysm.cs | 4 +- NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 4 +- .../Bosses/BrainOfCthulhuAI.cs | 28 +- NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs | 12 +- .../VanillaNPCOverrides/Bosses/DestroyerAI.cs | 26 +- .../Bosses/DukeFishronAI.cs | 18 +- .../Bosses/EaterOfWorldsAI.cs | 18 +- .../Bosses/EmpressofLightAI.cs | 10 +- .../Bosses/EyeOfCthulhuAI.cs | 10 +- NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs | 46 +- .../VanillaNPCOverrides/Bosses/KingSlimeAI.cs | 21 +- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 10 +- NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs | 32 +- NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs | 14 +- .../Bosses/QueenSlimeAI.cs | 45 +- .../VanillaNPCOverrides/Bosses/SkeletronAI.cs | 35 +- .../Bosses/SkeletronPrimeAI.cs | 155 ++-- NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs | 28 +- .../Bosses/WallOfFleshAI.cs | 21 +- NPCs/Yharon/Yharon.cs | 50 +- Projectiles/Boss/ApolloChargeTelegraph.cs | 20 +- Projectiles/Boss/ApolloFireball.cs | 6 +- Projectiles/Boss/ApolloRocket.cs | 16 +- Projectiles/Boss/AresDeathBeamStart.cs | 20 +- Projectiles/Boss/AresDeathBeamTelegraph.cs | 22 +- Projectiles/Boss/AresGaussNukeProjectile.cs | 14 +- Projectiles/Boss/AresPlasmaFireball.cs | 6 +- Projectiles/Boss/AresTeslaOrb.cs | 10 +- Projectiles/Boss/ArtemisLaser.cs | 2 +- Projectiles/Boss/AstralShot2.cs | 6 +- Projectiles/Boss/BrimstoneBarrage.cs | 6 +- Projectiles/Boss/BrimstoneHellblast2.cs | 2 +- Projectiles/Boss/BrimstoneRay.cs | 6 +- Projectiles/Boss/DoGBeamPortal.cs | 10 +- Projectiles/Boss/DoGDeath.cs | 2 +- Projectiles/Boss/HolyBlast.cs | 12 +- Projectiles/Boss/HolyBomb.cs | 10 +- Projectiles/Boss/HolyBurnOrb.cs | 8 +- Projectiles/Boss/HolyFire.cs | 10 +- Projectiles/Boss/HolyFire2.cs | 10 +- Projectiles/Boss/HolyFlare.cs | 12 +- Projectiles/Boss/HolySpear.cs | 14 +- Projectiles/Boss/MoltenBlast.cs | 12 +- Projectiles/Boss/MoltenBlob.cs | 10 +- Projectiles/Boss/MushBombFall.cs | 2 +- Projectiles/Boss/ProvidenceCrystal.cs | 4 +- Projectiles/Boss/ProvidenceCrystalShard.cs | 2 +- Projectiles/Boss/ProvidenceHolyRay.cs | 6 +- Projectiles/Boss/RavagerFlame.cs | 2 +- Projectiles/Boss/ScavengerNuke.cs | 8 +- Projectiles/Boss/ThanatosBeamStart.cs | 10 +- Projectiles/Boss/ThanatosLaser.cs | 4 +- Projectiles/Boss/ToxicCloud.cs | 4 +- Projectiles/Boss/UnstableCrimulanGlob.cs | 4 +- Projectiles/Boss/UnstableEbonianGlob.cs | 4 +- Projectiles/CalamityGlobalProjectile.cs | 2 +- Systems/MiscWorldStateSystem.cs | 4 - Systems/WorldSyncingSystem.cs | 4 +- UI/ModeIndicatorUI.cs | 7 - World/CalamityWorld.cs | 1 - 151 files changed, 1137 insertions(+), 1829 deletions(-) delete mode 100644 Items/DifficultyItems/MaliceModeItem.cs delete mode 100644 Items/DifficultyItems/MaliceModeItem.png delete mode 100644 Items/DifficultyItems/MaliceModeItem_Animated.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 53a94fc093..ef1f2f02b3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -362,7 +362,7 @@ namespace CalamityMod.CalPlayer #region Defense Damage // Ratio at which incoming damage (after mitigation) is converted into defense damage. - // Used to be 5% normal, 10% expert, 12% rev, 15% death, 20% malice + // Used to be 5% normal, 10% expert, 12% rev, 15% death, 20% boss rush // It is now 15% on all difficulties because you already take less damage on lower difficulties. public const double DefenseDamageRatio = 0.15; public int CurrentDefenseDamage => (int)(totalDefenseDamage * ((float)defenseDamageRecoveryFrames / totalDefenseDamageRecoveryFrames)); @@ -8099,7 +8099,7 @@ namespace CalamityMod.CalPlayer // This floor is only applied if bosses are alive if (areThereAnyDamnBosses) { - int defenseDamageFloor = ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 5 : CalamityWorld.death ? 4 : CalamityWorld.revenge ? 3 : Main.expertMode ? 2 : 1) * (NPC.downedMoonlord ? 3 : Main.hardMode ? 2 : 1); + int defenseDamageFloor = (BossRushEvent.BossRushActive ? 5 : CalamityWorld.death ? 4 : CalamityWorld.revenge ? 3 : Main.expertMode ? 2 : 1) * (NPC.downedMoonlord ? 3 : Main.hardMode ? 2 : 1); if (defenseDamageTaken < defenseDamageFloor) defenseDamageTaken = defenseDamageFloor; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 374da696c7..c80ad8142b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -216,7 +216,7 @@ namespace CalamityMod.CalPlayer if (CalamityWorld.revenge) { // Adjusts the life steal cap in rev/death - float lifeStealCap = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 30f : CalamityWorld.death ? 45f : 60f; + float lifeStealCap = BossRushEvent.BossRushActive ? 30f : CalamityWorld.death ? 45f : 60f; if (Player.lifeSteal > lifeStealCap) Player.lifeSteal = lifeStealCap; @@ -676,8 +676,8 @@ namespace CalamityMod.CalPlayer // Reduces Expert Mode life steal recovery rate from 0.5/s to 0.35/s // Revengeance Mode recovery rate is 0.3/s // Death Mode recovery rate is 0.25/s - // Malice Mode recovery rate is 0.2/s - float lifeStealCooldown = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; + // Boss Rush recovery rate is 0.2/s + float lifeStealCooldown = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; Player.lifeSteal -= lifeStealCooldown; // Nebula Armor nerf diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 8929768f31..6628b6ed76 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -132,7 +132,7 @@ namespace CalamityMod bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npc.type, projType), out int[] projectileDamage); return !exists ? 1 // Base case for safety, in case the array is not initialized yet. : Main.masterMode ? projectileDamage[4] - : (CalamityWorld.death || CalamityWorld.malice) ? projectileDamage[3] + : CalamityWorld.death ? projectileDamage[3] : CalamityWorld.revenge ? projectileDamage[2] : Main.expertMode ? projectileDamage[1] : projectileDamage[0]; diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 91d998c6d7..e123db78f5 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -33,7 +33,7 @@ namespace CalamityMod.ILEditing // Mechanics / features On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; - On.Terraria.NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInMalice; + On.Terraria.NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; IL.Terraria.Main.UpdateTime += PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; IL.Terraria.Player.Hurt += RemoveRNGFromDodges; @@ -129,7 +129,7 @@ namespace CalamityMod.ILEditing // Mechanics / features On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; - On.Terraria.NPC.ShouldEmpressBeEnraged -= AllowEmpressToEnrageInMalice; + On.Terraria.NPC.ShouldEmpressBeEnraged -= AllowEmpressToEnrageInBossRush; IL.Terraria.Main.UpdateTime -= PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs -= AlterTownNPCSpawnRate; IL.Terraria.Player.Hurt -= RemoveRNGFromDodges; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 2aa7a84050..c796d86704 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -231,15 +231,15 @@ namespace CalamityMod.ILEditing } #endregion Dash Fixes and Improvements - #region Allow Empress to Enrage in Malice - private static bool AllowEmpressToEnrageInMalice(On.Terraria.NPC.orig_ShouldEmpressBeEnraged orig) + #region Allow Empress to Enrage in Boss Rush + private static bool AllowEmpressToEnrageInBossRush(On.Terraria.NPC.orig_ShouldEmpressBeEnraged orig) { - if (Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) + if (Main.dayTime || BossRushEvent.BossRushActive) return true; return orig(); } - #endregion Allow Empress to Enrage in Malice + #endregion Allow Empress to Enrage in Boss Rush #region Enabling of Triggered NPC Platform Fallthrough // Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me. diff --git a/Items/DifficultyItems/DeathModeItem.cs b/Items/DifficultyItems/DeathModeItem.cs index 16989e5391..206653ec6f 100644 --- a/Items/DifficultyItems/DeathModeItem.cs +++ b/Items/DifficultyItems/DeathModeItem.cs @@ -80,14 +80,6 @@ namespace CalamityMod.Items.DifficultyItems string key = "Mods.CalamityMod.DeathText2"; Color messageColor = Color.Crimson; CalamityUtils.DisplayLocalizedText(key, messageColor); - - if (CalamityWorld.malice) - { - CalamityWorld.malice = false; - key = "Mods.CalamityMod.MaliceText2"; - messageColor = Color.Crimson; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } } CalamityNetcode.SyncWorld(); diff --git a/Items/DifficultyItems/MaliceModeItem.cs b/Items/DifficultyItems/MaliceModeItem.cs deleted file mode 100644 index 9184071777..0000000000 --- a/Items/DifficultyItems/MaliceModeItem.cs +++ /dev/null @@ -1,111 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.DifficultyItems -{ - [LegacyName("Malice")] - public class MaliceModeItem : ModItem - { - public int frameCounter = 0; - public int frame = 0; - public override void SetStaticDefaults() - { - SacrificeTotal = 1; - DisplayName.SetDefault("Tormented Mind of Malice"); - Tooltip.SetDefault("Enables/disables Malice Mode, can only be used in Death Mode.\n" + - - // Overall description and warning lines - "[c/c01818:This mode is subjective, play how you want, don't expect to live.]\n" + - - // Rev Mode line - "All effects from Death Mode are enabled, including the following:\n" + - - // Misc lines - "Nerfs the effectiveness of life steal a bit more.\n" + - - // Boss lines - "Enrages all bosses and gives them far more aggressive AI."); - } - - public override void SetDefaults() - { - Item.expert = true; - Item.rare = ItemRarityID.Purple; - Item.width = 82; - Item.height = 66; - Item.useAnimation = 45; - Item.useTime = 45; - Item.useStyle = ItemUseStyleID.HoldUp; - Item.UseSound = SoundID.Item119; - Item.consumable = false; - } - - public override void UseStyle(Player player, Rectangle rectangle) - { - player.itemLocation += new Vector2(-32f * player.direction, player.gravDir).RotatedBy(player.itemRotation); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture = ModContent.Request("CalamityMod/Items/DifficultyItems/MaliceModeItem_Animated").Value; - spriteBatch.Draw(texture, position, Item.GetCurrentFrame(ref frame, ref frameCounter, 8, 8), Color.White, 0f, origin, scale, SpriteEffects.None, 0); - return false; - } - - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture = ModContent.Request("CalamityMod/Items/DifficultyItems/MaliceModeItem_Animated").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 8, 8), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - return false; - } - - // Can only be used in Death Mode. - public override bool CanUseItem(Player player) => CalamityWorld.death || CalamityWorld.malice; - - public override bool? UseItem(Player player) - { - // This world syncing code should only be run by one entity- the server, to prevent a race condition - // with the packets. - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - if (CalamityPlayer.areThereAnyDamnBosses || BossRushEvent.BossRushActive) - { - string key = "Mods.CalamityMod.ChangingTheRules"; - Color messageColor = Color.Crimson; - CalamityUtils.DisplayLocalizedText(key, messageColor); - return true; - } - if (!CalamityWorld.malice) - { - CalamityWorld.malice = true; - string key = "Mods.CalamityMod.MaliceText"; - Color messageColor = Color.Crimson; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - else - { - CalamityWorld.malice = false; - string key = "Mods.CalamityMod.MaliceText2"; - Color messageColor = Color.Crimson; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - CalamityNetcode.SyncWorld(); - - return true; - } - - public override void AddRecipes() - { - CreateRecipe() - .AddTile(TileID.DemonAltar) - .Register(); - } - } -} diff --git a/Items/DifficultyItems/MaliceModeItem.png b/Items/DifficultyItems/MaliceModeItem.png deleted file mode 100644 index 12938e44f5d0aad0a5c846c4560de1643ec8ace5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 573 zcmeAS@N?(olHy`uVBq!ia0vp^Ane4!3?x6R6dD03#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;v0X`wFPF4<*BJ!!pSrgl*_8QsD3QWq8l0TSMbA8H`Cp&inRsE<7S^}iF zOM?7@|HA=;mp|htpfG2FM`SSr1K%MKW)#)%Y5-c==jq}Y65;-K>chNd10J@s4FVPa z+2xLlcW*o3rT*wGyZY2g0r5|6EHR5cw{}lobfxU}PgZ$P#WtrMvx_tF>wLHR!%7pc zov&`q3|Bq-6W|wm=PwC_h^zy$eb}HoH)Z>>dRD%>|1cp0we%Y_#=(Ty> zYw=xrs%9>?Kb3p2JS}T{FvX*ChT{uQdCu3`XFW2eF3P$+<(HlQk|lzvR?D_sy8P*w z;*8e@PkbKD3S2m?A@-HlRii8cW7eXnM(O|M*q(V^;4}0R`u=4?k8w@)#2Vp_kG@q) z)(L6yo)MLd;+)X8xIb*Ee2MCwfasSB${hublQu1QtjT_&O2Xdz@f0s#%~clvPR{%m zzWD9`)FT?DJ}Wl<)JPR&SM(2B)UjN6{Sp@?S&!2<<||x1z47nijv%cWTb8oCtF^9Z zx)k4+zGw=|N|zHhwW{m4_{-(_xvC1BJJGs_VNZ`&^?Zq?OGHj~FJzsu@ZwHw`#Y*$ zog$1*ESC;cCoU0ES-P@StV+EnY!}n1Bbtk*?tfhL)TEYq%j%7?34$*d0Hce+)78&q Iol`;+0I8DmVE_OC diff --git a/Items/DifficultyItems/MaliceModeItem_Animated.png b/Items/DifficultyItems/MaliceModeItem_Animated.png deleted file mode 100644 index fa448647be361034f7e03ec5ef3152dae9f99bfd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3073 zcmbVOdpy&7AD>Gkm$K+&O%|I=ku0$dGYs1>hKh(Bb5d?$iQ`Uj6f@fn<=#X|BDoey z&XExzxh7#@p>j!?%bq!%>YV4l=lQ-~-`D5&z5V`pf8L+>=bdCnw3OZk+6Djsr13bc zy&wvv@Q$q_f-l%QdrA<5g6%C$0e3sWT){&0w26%g0B|o=a?N9lV7=eY+R@w;g;9`G z^71^JmiT)L+%S{$voA=g>6eIpCX-WF#}|x`fVP{0+W^rqyD&kJq1Y20Hut{|fcfKB zt%4JYb2#TFN1xWOMiN$p&sUK9m7 zjg%k#wFD5^QQ+4R)9w0x$21b}3~sm=$T?q06@}^kGIv@MI$c7;E>L(Yi~Y1b zxcvu{sZQ)i#$X*GsykWc+$GdYuPe*mw^bp%@L4nerlu zEr!t%5mENFF0;3;H~k!hPfQl!P%8F4r|0F(^X8kX`@HuZfnKrr2agF8ijdiMLi zGw*QfaBTzs#Yy*7m7`=P`q8zSZ)m4zuZsegkeoc@Mrwv;UP~1B0xwo_+$&5>L%vKF zWQ>4iVnC0Lqj}}Ayh-Nt`x_9l6d1JlOiTXK!#}B@OwFPMa?GqQZ0L`5_G%IKjE?SJ z7=xT4eki%=)D}!e5f+)N%Yre$;>i}e`ZS6pI6MdFH;ybFqoI0wG`l;Ko`w=C!=@?| z%zmJFjhLkOA-j))Q+AvZ=#YN?9bvL7f1*nvs76aPC@*2`{>ZKc>Th6%0O!{IjjX%Ou*#|P(f z4aTUCYW4DuALQs!K6aidkz}j(lTwxanoZ$sty`;!&AHZY#)xHJgn&^2dbXoG%lhfI z)GXAwGDroD^)~G_${>RoK4(ut5BmmekpyZW5W?i6o-2zM7^ z83k)oq9ZdciQ0#D+h~1FNU!k)x4XH9LEvw^7Gy*$?CptVXc{C4oBnA)q%Al=4+2F*{A8vk@z)@gr0+wz0VWj6Z9(((Z@061Ck4m3$Uekhc6q&!n9 zu2MS7-Ugk1I&Cr9nsVUzzKjizzEZ=~dhy6zTu+}|lM_ob40M3y44Y__H!H3EqUMnp zGT=$2jdjv%)SOpEt9prk+=SI(S;fu=5*?}&RRY#i@lUwpL7IheWbV**+btvSo*x~e z;^DXe+$wQ>7)>rW)5`q zMc~kQhzaL6&6#`Ry<;ug8(f;x_y4nA)T6z13G)Ac$!uu&Tp1;x>%=o{{IxgwNGqJV zc$FGkSChL1as8>c_XQNhm0{chcD(VS{lQI`&zO{<`*V^3K1csYtQU) z$o1A*U-wn!^by^RY!xnt z#)gJ(m%!C;tsI+*G@Bq*;3UPp0E<#z0Y`1ns2rNAldy$K<{sRGEz|~LQcGfBKIj@$ zLN2)|-FxZ}Pea%cpFGgnON+8bl!rN0aDTg#gk zKPo^^$zQHx{y9vd!&#E1kI4gWc_>?=ga9(R{f{s ze~UW~4H%zz7tV&hUB(2nxib^RkQ&bNJ#i#@HiS{dIG$FMRri4>dmcLGvrZu}3&s)Y z>4VlmAcQ}*^^3)s%dU5`eBm9pfRR$_h)S^n*PJBstmv`L&@o1gBSNeXyjGM80F*?!Z#L zQZMzl=nOHZ`;SX=pI#KnN`ws~bztvYJlzn(Gq@c{<@N{Rjg4Or%UZKa$$__VdmO5v z9>{~@;gE?A9h>j0w#yxEk}Up#_DQ0&20_jIbf|Fkp|1X-Jta6h00y8?A#;q5Wt#XI zc7vR3#7u?~Y>HKttn|WGo_@Z^p~r;hU*n+78S!iUuSRCGt1fDEbI-YeemxHbyJxb& zb7M16E^F?$TRU~e5HO>YqsMGp-p@I(tcsNjmbe|+&W#F+YFXgKZ*cPVL(}Syz#cFo zfcaW7*XL(CDi-c{QcWYn)6ZXkZ`^OtIp_WCaE+tf`&|ZSz00o}(rc8BUyVOGj0w34 zw1G(M{>!Mmer+ZU)c!A@68R?aCNwrVru(-^F}i=O=LZo7mc)%hXI9S6R2K)<#`WTT z>sQa6S}Z3Us1;#z&c1RD1%B(PjYvIWk}B=HGeKM$|Ccq1d{%Lg94lAIU>!CTa@jrY z^CIOaR2=|`k#ZJ4fLCtI*UR;mzM~os@oO$}WTe6}X7%kytyJrNx@slxf3LK~>)d66 z_BQsp6O%d*^J|M$#=i7e_jR>9rsa4(nWu9oHADwX)3mU`z$|_KkkTf2D;=(CWd-M< z>eqFABDiX_{4!G@+cW)>?83|F_Oq-zyAisR*If2*yKqJEh^~|MK`t#YX4X*PQ2v{F ze+lgALry|ng4d+KjYg>k$-#{Gw{#NofQ38tf6B$iwaPm8d2YWIKuy`iE=9wIUJlNP tHzHoQ+vxIU{;+EQBOYEC7DgZOg@HOVwiY@fRRWt0z?&1XcTG>l{RbD8paK8@ diff --git a/Items/DifficultyItems/RevengeanceModeItem.cs b/Items/DifficultyItems/RevengeanceModeItem.cs index 994eca35be..227c14eeb6 100644 --- a/Items/DifficultyItems/RevengeanceModeItem.cs +++ b/Items/DifficultyItems/RevengeanceModeItem.cs @@ -107,13 +107,6 @@ namespace CalamityMod.Items.DifficultyItems messageColor = Color.Crimson; CalamityUtils.DisplayLocalizedText(key, messageColor); } - if (CalamityWorld.malice) - { - CalamityWorld.malice = false; - key = "Mods.CalamityMod.MaliceText2"; - messageColor = Color.Crimson; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } CalamityNetcode.SyncWorld(); } return true; diff --git a/Items/TreasureBags/StarterBag.cs b/Items/TreasureBags/StarterBag.cs index 2d2cc9b11c..2332bd4fb4 100644 --- a/Items/TreasureBags/StarterBag.cs +++ b/Items/TreasureBags/StarterBag.cs @@ -54,10 +54,9 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItem(s, player, ItemID.Torch, 25); DropHelper.DropItem(s, player, ItemID.Chest, 3); - // Difficulty items (Revengeance, Death and Malice don't drop in Normal) + // Difficulty items (Revengeance and Death don't drop in Normal) DropHelper.DropItemCondition(s, player, ModContent.ItemType(), Main.expertMode); DropHelper.DropItemCondition(s, player, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItemCondition(s, player, ModContent.ItemType(), Main.expertMode); // The Lad DropHelper.DropItemCondition(s, player, ModContent.ItemType(), player.name == "Aleksh" || player.name == "Shark Lad"); diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 26d457769e..f4408b886a 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -153,9 +153,6 @@ namespace CalamityMod.Localization new [] { "DeathText", "Death is active; enjoy the fun." }, new [] { "DeathText2", "Death is not active; not fun enough for you?" }, - new [] { "MaliceText", "Malice is active; witness the horror!" }, - new [] { "MaliceText2", "Malice is not active." }, - new [] { "ArmageddonText", "Bosses will now kill you instantly." }, new [] { "ArmageddonText2", "Bosses will no longer kill you instantly." }, new [] { "ArmageddonDodgeDisable", "All of your dodges are now disabled." }, diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 91b5c91b14..c221785fd3 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -422,11 +422,6 @@ namespace CalamityMod case "death mode": return CalamityWorld.death; - case "malice": - case "malicemode": - case "malice mode": - return CalamityWorld.malice; - case "br": case "bossrush": case "boss rush": @@ -469,11 +464,6 @@ namespace CalamityMod case "death mode": return CalamityWorld.death = enabled; - case "malice": - case "malicemode": - case "malice mode": - return CalamityWorld.malice = enabled; - case "br": case "bossrush": case "boss rush": diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs index 68fe6a34ce..8271c1a8bf 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBody.cs @@ -59,7 +59,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm NPC.damage = 0; // Difficulty modes - bool malice = CalamityWorld.malice; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool expertMode = Main.expertMode; @@ -94,8 +93,8 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)NPC.ai[2]].Calamity(); - float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; - float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; + float chargePhaseGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.LightningCharge; @@ -123,7 +122,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (Vector2.Distance(NPC.Center, Main.player[Main.npc[(int)NPC.ai[2]].target].Center) > 160f) { NPC.localAI[0] += 1f; - float spawnAncientLightGateValue = malice ? 90f : death ? 100f : revenge ? 105f : expertMode ? 110f : 120f; + float spawnAncientLightGateValue = death ? 100f : revenge ? 105f : expertMode ? 110f : 120f; float divisor = 4f; if (NPC.ai[3] % divisor == 0f && NPC.localAI[0] >= spawnAncientLightGateValue) { diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs index b4bbb65c17..26e50211c6 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmBodyAlt.cs @@ -59,7 +59,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm NPC.damage = 0; // Difficulty modes - bool malice = CalamityWorld.malice; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool expertMode = Main.expertMode; @@ -94,8 +93,8 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)NPC.ai[2]].Calamity(); - float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; - float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; + float chargePhaseGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.LightningCharge; @@ -123,7 +122,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (Vector2.Distance(NPC.Center, Main.player[Main.npc[(int)NPC.ai[2]].target].Center) > 160f) { NPC.localAI[0] += 1f; - float shootShadowFireballGateValue = malice ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float shootShadowFireballGateValue = death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; float divisor = 2f; if (NPC.ai[3] % divisor == 0f && NPC.localAI[0] >= shootShadowFireballGateValue) { diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs index 996e1e116a..31fff706fd 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs @@ -172,7 +172,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm CalamityGlobalNPC.adultEidolonWyrmHead = NPC.whoAmI; // Difficulty modes - bool malice = CalamityWorld.malice; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool expertMode = Main.expertMode; @@ -202,7 +201,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm bool targetOnMount = player.mount.Active; // Check whether enraged for the sake of the HP bar UI - NPC.Calamity().CurrentlyEnraged = !targetDownDeep || malice; + NPC.Calamity().CurrentlyEnraged = !targetDownDeep; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -306,14 +305,14 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm // Phase 6 - 10 // Phase gate values - float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; - float lightningRainDuration = malice ? 150f : 180f; - float eidolonWyrmPhaseDuration = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; - float iceMistDuration = malice ? 150f : 180f; - float spinPhaseDuration = malice ? 210f : death ? 240f : revenge ? 255f : expertMode ? 270f : 300f; + float chargePhaseGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + float lightningRainDuration = 180f; + float eidolonWyrmPhaseDuration = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; + float iceMistDuration = 180f; + float spinPhaseDuration = death ? 240f : revenge ? 255f : expertMode ? 270f : 300f; float ancientDoomPhaseGateValue = 30f; - float ancientDoomGateValue = malice ? 80f : death ? 95f : revenge ? 100f : expertMode ? 105f : 120f; - float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; + float ancientDoomGateValue = death ? 95f : revenge ? 100f : expertMode ? 105f : 120f; + float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; if (Main.getGoodWorld) { @@ -400,7 +399,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm } Vector2 chargeLocation = destination + chargeVector; Vector2 chargeVectorFlipped = chargeVector * -1f; - float chargePredictionAmt = malice ? 60f : death ? 50f : revenge ? 40f : expertMode ? 30f : 20f; + float chargePredictionAmt = death ? 50f : revenge ? 40f : expertMode ? 30f : 20f; // Lightning Rain variables Vector2 lightningRainLocation = new Vector2(0f, -baseDistance); @@ -409,7 +408,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm // Wyrm and Eidolist variables Vector2 eidolonWyrmPhaseLocation = new Vector2(0f, baseDistance); float eidolonWyrmPhaseLocationDistance = baseAttackTriggerDistance; - int eidolistScale = malice ? 4 : death ? 3 : revenge ? 2 : expertMode ? 1 : 0; + int eidolistScale = death ? 3 : revenge ? 2 : expertMode ? 1 : 0; int maxEidolists = (targetDownDeep ? 3 : 6) + eidolistScale; // Ice Mist variables @@ -424,9 +423,9 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm // Ancient Doom variables Vector2 ancientDoomLocation = new Vector2(0f, -baseDistance); float ancientDoomLocationDistance = baseAttackTriggerDistance; - int ancientDoomScale = malice ? 4 : death ? 3 : revenge ? 2 : expertMode ? 1 : 0; + int ancientDoomScale = death ? 3 : revenge ? 2 : expertMode ? 1 : 0; int ancientDoomLimit = (targetDownDeep ? 4 : 8) + ancientDoomScale; - int ancientDoomDistance = malice ? 480 : death ? 520 : revenge ? 535 : expertMode ? 550 : 600; + int ancientDoomDistance = death ? 520 : revenge ? 535 : expertMode ? 550 : 600; float maxAncientDoomRings = 3f; // Lightning charge variables @@ -436,11 +435,11 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm Vector2 lightningChargeVectorFlipped = lightningChargeVector * -1f; float lightningSpawnY = 540f; Vector2 lightningSpawnLocation = new Vector2(NPC.Center.X, NPC.Center.Y - lightningSpawnY); - int numLightningBolts = malice ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4; + int numLightningBolts = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; float distanceBetweenBolts = lightningSpawnY * 2f / numLightningBolts; // Velocity and turn speed values - float velocityScale = malice ? 3f : death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; + float velocityScale = death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; float baseVelocity = (targetDownDeep ? 12f : 24f) + (targetDownDeep ? velocityScale : velocityScale * 2f); if (Main.getGoodWorld) baseVelocity *= 1.15f; @@ -613,7 +612,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm } float predictionAmt = targetDownDeep ? 45f : 60f; - float lightningVelocityScale = malice ? 1.5f : death ? 0.9f : revenge ? 0.75f : expertMode ? 0.6f : 0f; + float lightningVelocityScale = death ? 0.9f : revenge ? 0.75f : expertMode ? 0.6f : 0f; float lightningVelocity = ((targetDownDeep && !targetOnMount) ? 6f : 9f) + ((targetDownDeep && !targetOnMount) ? lightningVelocityScale : lightningVelocityScale * 1.5f); for (int i = 0; i < numProjectiles; i++) { @@ -895,7 +894,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm } float predictionAmt = targetDownDeep ? 90f : 120f; - float iceMistVelocityScale = malice ? 3f : death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; + float iceMistVelocityScale = death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; float iceMistVelocity = (targetDownDeep ? 12f : 18f) + (targetDownDeep ? iceMistVelocityScale : iceMistVelocityScale * 1.5f); for (int i = 0; i < numProjectiles; i++) { diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs index 6c7965a47f..5bc49867e9 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmTail.cs @@ -48,7 +48,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm NPC.damage = 0; // Difficulty modes - bool malice = CalamityWorld.malice; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool expertMode = Main.expertMode; @@ -83,8 +82,8 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm CalamityGlobalNPC calamityGlobalNPC_Head = Main.npc[(int)NPC.ai[2]].Calamity(); - float chargePhaseGateValue = malice ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; - float lightningChargePhaseGateValue = malice ? 90f : death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; + float chargePhaseGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; bool invisiblePartOfChargePhase = calamityGlobalNPC_Head.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= chargePhaseGateValue + 1f && (calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeOne || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.ChargeTwo || calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC_Head.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC_Head.newAI[2] <= lightningChargePhaseGateValue + 1f && calamityGlobalNPC_Head.newAI[0] == (float)AdultEidolonWyrmHead.Phase.LightningCharge; diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index e5a8bd4c54..c12f1d397b 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.chaseable = false; NPC.canGhostHeal = false; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 267723fc8d..dd03b806e3 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.chaseable = false; NPC.canGhostHeal = false; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index ffc790d042..2fc88f26b8 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 64eb09c494..4376837b95 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.chaseable = false; NPC.canGhostHeal = false; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 6329c30860..004282884a 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.5f; else if (CalamityWorld.death) NPC.scale *= 1.4f; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index e5eee41c4f..7dd98aad0d 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.5f; else if (CalamityWorld.death) NPC.scale *= 1.4f; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 9e3ab737c4..cff2ce0fc0 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.5f; else if (CalamityWorld.death) NPC.scale *= 1.4f; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 5ab2914603..83ff3ac717 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -34,13 +34,13 @@ namespace CalamityMod.NPCs public static void AquaticScourgeAI(NPC npc, Mod mod, bool head) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Adjust hostility and stats - if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.getGoodWorld) + if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || bossRush || Main.getGoodWorld) { if (calamityGlobalNPC.newAI[0] == 0f) { @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs // Enrage if (head) { - if (notOcean && !player.Calamity().ZoneSulphur && !BossRushEvent.BossRushActive) + if (notOcean && !player.Calamity().ZoneSulphur && !bossRush) { if (npc.localAI[2] > 0f) npc.localAI[2] -= 1f; @@ -102,12 +102,12 @@ namespace CalamityMod.NPCs npc.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax; } - bool biomeEnraged = npc.localAI[2] <= 0f || malice; + bool biomeEnraged = npc.localAI[2] <= 0f || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; + float enrageScale = bossRush ? 1f : 0f; if (biomeEnraged) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs npc.localAI[3] = colorFadeTimeAfterSpiral; // Vomit acid mist - float acidMistBarfDivisor = (float)Math.Floor(malice ? 4f : death ? 5f : 6f) * (phase3 ? 1.5f : 1f); + float acidMistBarfDivisor = (float)Math.Floor(bossRush ? 4f : death ? 5f : 6f) * (phase3 ? 1.5f : 1f); if (calamityGlobalNPC.newAI[3] % acidMistBarfDivisor == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs } // Vomit circular spreads of acid clouds while in phase 3 - float toxicCloudBarfDivisor = malice ? 20f : death ? 30f : 40f; + float toxicCloudBarfDivisor = bossRush ? 20f : death ? 30f : 40f; if (calamityGlobalNPC.newAI[3] % toxicCloudBarfDivisor == 0f && phase3) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -251,7 +251,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = malice ? 10 : expertMode ? 8 : 6; + int totalProjectiles = bossRush ? 10 : expertMode ? 8 : 6; if (phase3) totalProjectiles *= 2; @@ -645,17 +645,17 @@ namespace CalamityMod.NPCs float lifeRatio = npc.life / (float)npc.lifeMax; // Variables for buffing the AI - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; + bool provy = DownedBossSystem.downedProvidence && !bossRush; bool phase2 = lifeRatio < 0.5f && revenge; bool phase3 = lifeRatio < 0.33f; // Enrage - if ((!player.ZoneUnderworldHeight || !modPlayer.ZoneCalamity) && !BossRushEvent.BossRushActive) + if ((!player.ZoneUnderworldHeight || !modPlayer.ZoneCalamity) && !bossRush) { if (calamityGlobalNPC.newAI[3] > 0f) calamityGlobalNPC.newAI[3] -= 1f; @@ -663,17 +663,17 @@ namespace CalamityMod.NPCs else calamityGlobalNPC.newAI[3] = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f || malice; + bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && (!player.ZoneUnderworldHeight || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && (!player.ZoneUnderworldHeight || bossRush)) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (biomeEnraged && (!modPlayer.ZoneCalamity || malice)) + if (biomeEnraged && (!modPlayer.ZoneCalamity || bossRush)) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -773,7 +773,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= (malice ? 5f : death ? 30f : 180f)) + if (npc.localAI[1] >= (bossRush ? 5f : death ? 30f : 180f)) { npc.TargetClosest(); npc.localAI[1] = 0f; @@ -827,7 +827,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; } - npc.alpha += malice ? 4 : death ? 3 : 2; + npc.alpha += bossRush ? 4 : death ? 3 : 2; if (npc.alpha >= 255) { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType()) < (death ? 1 : 2) && revenge) @@ -1036,7 +1036,7 @@ namespace CalamityMod.NPCs Vector2 source = new Vector2(vectorCenter.X + (npc.spriteDirection > 0 ? 34f : -34f), vectorCenter.Y - 74f); Vector2 aimAt = player.Center + player.velocity * 20f; - float aimResponsiveness = malice ? 0.05f : (npc.ai[2] == 1f || death) ? 0.1f : 0.25f; + float aimResponsiveness = bossRush ? 0.05f : (npc.ai[2] == 1f || death) ? 0.1f : 0.25f; Vector2 aimVector = Vector2.Normalize(aimAt - source); if (aimVector.HasNaNs()) @@ -1153,11 +1153,11 @@ namespace CalamityMod.NPCs Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f); // Variables for increasing difficulty - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; + bool provy = DownedBossSystem.downedProvidence && !bossRush; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -1299,10 +1299,10 @@ namespace CalamityMod.NPCs // Target variable Player player = Main.player[npc.target]; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -1311,8 +1311,8 @@ namespace CalamityMod.NPCs Vector2 lookAt = new Vector2(player.position.X - (player.width / 2), player.position.Y - (player.height / 2)); Vector2 rotationVector = npcCenter - lookAt; - // Malice Mode predictive charge rotation - if (npc.ai[1] == 4f && phase5 && malice) + // Boss Rush predictive charge rotation + if (npc.ai[1] == 4f && phase5 && bossRush) { // Velocity float chargeVelocity = 30f; @@ -1476,7 +1476,7 @@ namespace CalamityMod.NPCs int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type) + (provy ? 30 : 0); float gigaBlastFrequency = (Main.getGoodWorld ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; - float projSpeed = malice ? 6.25f : 5f; + float projSpeed = bossRush ? 6.25f : 5f; if (calamityGlobalNPC.newAI[3] <= 300f) { if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top @@ -1501,7 +1501,7 @@ namespace CalamityMod.NPCs npc.ai[0] = 0f; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type) + (provy ? 30 : 0); - float projSpeed = malice ? 5f : 4f; + float projSpeed = bossRush ? 5f : 4f; if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) { float distance = Main.rand.NextBool() ? -1000f : 1000f; @@ -1716,7 +1716,7 @@ namespace CalamityMod.NPCs if (provy) chargeVelocity *= 1.25f; - Vector2 vector = Vector2.Normalize(player.Center + (phase5 && malice ? player.velocity * 20f : Vector2.Zero) - npc.Center); + Vector2 vector = Vector2.Normalize(player.Center + (phase5 && bossRush ? player.velocity * 20f : Vector2.Zero) - npc.Center); npc.velocity = vector * chargeVelocity; npc.ai[1] = 3f; @@ -1799,11 +1799,11 @@ namespace CalamityMod.NPCs CalamityGlobalNPC.cataclysm = npc.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; + bool provy = DownedBossSystem.downedProvidence && !bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1815,10 +1815,10 @@ namespace CalamityMod.NPCs Player player = Main.player[npc.target]; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -2088,11 +2088,11 @@ namespace CalamityMod.NPCs CalamityGlobalNPC.catastrophe = npc.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; + bool provy = DownedBossSystem.downedProvidence && !bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -2104,10 +2104,10 @@ namespace CalamityMod.NPCs Player player = Main.player[npc.target]; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -2370,7 +2370,13 @@ namespace CalamityMod.NPCs { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool postMoonLordBuff = NPC.downedMoonlord && !BossRushEvent.BossRushActive; + // Variables + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; + + bool postMoonLordBuff = NPC.downedMoonlord && !bossRush; npc.damage = postMoonLordBuff ? npc.defDamage * 2 : npc.defDamage; // Don't fire projectiles and don't increment phase timers for 4 seconds after the teleport phase to avoid cheap bullshit @@ -2402,16 +2408,10 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -2533,8 +2533,8 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[2] = 1f; - int maxProjectiles = !phase2 ? (malice ? 5 : 3) : (malice ? 7 : 5); - int spread = !phase2 ? (malice ? 11 : 8) : (malice ? 12 : 10); + int maxProjectiles = !phase2 ? (bossRush ? 5 : 3) : (bossRush ? 7 : 5); + int spread = !phase2 ? (bossRush ? 11 : 8) : (bossRush ? 12 : 10); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -2573,8 +2573,8 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[2] = 0f; - int maxProjectiles = !phase3 ? (malice ? 13 : death ? 11 : 9) : (malice ? 19 : death ? 17 : 15); - int spread = !phase3 ? (malice ? 20 : death ? 18 : 16) : (malice ? 24 : death ? 22 : 20); + int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 19 : death ? 17 : 15); + int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -2617,7 +2617,7 @@ namespace CalamityMod.NPCs // Stay vulnerable for a maximum of 2 seconds npc.ai[1] += 1f; - if (npc.ai[1] >= (phase2 ? 30f : 120f) || malice) + if (npc.ai[1] >= (phase2 ? 30f : 120f) || bossRush) { // Set AI to next phase (Walk) and reset other AI npc.TargetClosest(); @@ -2705,7 +2705,7 @@ namespace CalamityMod.NPCs if (!dontAttack) npc.ai[1] += 1f; - if (npc.ai[1] >= ((malice ? 270f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f))) + if (npc.ai[1] >= ((bossRush ? 270f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f))) { // Collide with tiles again npc.noTileCollide = false; @@ -2854,8 +2854,8 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[2] = 1f; float flameVelocity = 12f; - int maxProjectiles = !phase2 ? (malice ? 3 : death ? 2 : 1) : (malice ? 4 : death ? 3 : 2); - int spread = !phase2 ? (malice ? 28 : death ? 22 : 16) : (malice ? 36 : death ? 28 : 20); + int maxProjectiles = !phase2 ? (bossRush ? 3 : death ? 2 : 1) : (bossRush ? 4 : death ? 3 : 2); + int spread = !phase2 ? (bossRush ? 28 : death ? 22 : 16) : (bossRush ? 36 : death ? 28 : 20); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -2877,8 +2877,8 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[2] = 0f; float laserVelocity = death ? 7f : 6f; - int maxProjectiles = !phase3 ? (malice ? 13 : death ? 11 : 9) : (malice ? 17 : death ? 15 : 13); - int spread = !phase3 ? (malice ? 20 : death ? 18 : 16) : (malice ? 24 : death ? 22 : 20); + int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 17 : death ? 15 : 13); + int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -2998,7 +2998,7 @@ namespace CalamityMod.NPCs npc.localAI[2] += 1.25f; } - if (npc.localAI[1] >= (malice ? 60f : death ? 180f : 240f)) + if (npc.localAI[1] >= (bossRush ? 60f : death ? 180f : 240f)) { // Spawn slimes bool spawnFlag = revenge; @@ -3190,15 +3190,15 @@ namespace CalamityMod.NPCs CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); // Difficulty variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 0.5f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 0.5f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1.5f; } @@ -3965,10 +3965,10 @@ namespace CalamityMod.NPCs double lifeRatio = npc.life / (double)npc.lifeMax; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Phases bool phase2 = lifeRatio <= 0.7; @@ -4021,7 +4021,7 @@ namespace CalamityMod.NPCs Player player = Main.player[npc.target]; // Speed enrage - bool moveVeryFast = Vector2.Distance(npc.Center, player.Center) > 960f || (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0); + bool moveVeryFast = Vector2.Distance(npc.Center, player.Center) > 960f || (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0); // Despawn if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) @@ -4046,8 +4046,8 @@ namespace CalamityMod.NPCs npc.timeLeft = 1800; // Scale multiplier based on nearby active tiles - float tileEnrageMult = BossRushEvent.BossRushActive ? 1.375f : malice ? 1.25f : 1f; - npc.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !BossRushEvent.BossRushActive; + float tileEnrageMult = bossRush ? 1.375f : bossRush ? 1.25f : 1f; + npc.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !bossRush; // Set AI variable to be used by Dark Energies npc.ai[1] = tileEnrageMult; @@ -4059,7 +4059,7 @@ namespace CalamityMod.NPCs if (!anyDarkEnergies) { // This is here because it's used in multiple places - float suckDistance = malice ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; + float suckDistance = bossRush ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -4170,9 +4170,9 @@ namespace CalamityMod.NPCs // Beam Portals if (calamityGlobalNPC.newAI[1] == 0f) { - int numBeamPortals = malice ? 3 : revenge ? 2 : 1; + int numBeamPortals = bossRush ? 3 : revenge ? 2 : 1; float degrees = 360 / numBeamPortals; - float beamPortalDistance = malice ? 800f : death ? 960f : revenge ? 1000f : expertMode ? 1040f : 1080f; + float beamPortalDistance = bossRush ? 800f : death ? 960f : revenge ? 1000f : expertMode ? 1040f : 1080f; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); for (int i = 0; i < numBeamPortals; i++) @@ -4289,7 +4289,7 @@ namespace CalamityMod.NPCs } // Destroy all Dark Energies if their total HP is below 20% - int darkEnergyMaxHP = BossRushEvent.BossRushActive ? 44000 : 12000; + int darkEnergyMaxHP = bossRush ? 44000 : 12000; int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2; int totalDarkEnergyMaxHP = darkEnergyMaxHP * totalDarkEnergiesSpawned; int succPhaseGateValue = (int)(totalDarkEnergyMaxHP * 0.2); @@ -4345,8 +4345,8 @@ namespace CalamityMod.NPCs // Basic movement towards a location void Movement(bool succ) { - float velocity = moveVeryFast ? 25f : BossRushEvent.BossRushActive ? 15f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; - float acceleration = moveVeryFast ? 0.75f : malice ? 0.3f : death ? 0.2f : expertMode ? 0.16f : 0.12f; + float velocity = moveVeryFast ? 25f : bossRush ? 15f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; + float acceleration = moveVeryFast ? 0.75f : bossRush ? 0.3f : death ? 0.2f : expertMode ? 0.16f : 0.12f; // Increase speed dramatically in succ phase if (succ) @@ -4370,7 +4370,7 @@ namespace CalamityMod.NPCs { // Move to a new location every few seconds calamityGlobalNPC.newAI[2] += 1f; - float newPositionGateValue = malice ? 180f : death ? 270f : revenge ? 300f : expertMode ? 360f : 480f; + float newPositionGateValue = bossRush ? 180f : death ? 270f : revenge ? 300f : expertMode ? 360f : 480f; if (calamityGlobalNPC.newAI[2] > newPositionGateValue) { calamityGlobalNPC.newAI[2] = 0f; @@ -4515,10 +4515,10 @@ namespace CalamityMod.NPCs // Variables float rotationMult = 3f; float rotationAmt = 0.03f; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; Vector2 vector = npc.Center; // Adjust slowing debuff immunity @@ -4549,12 +4549,13 @@ namespace CalamityMod.NPCs // Enrage scale float enrageScale = death ? 1.5f : 1f; - if (npc.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax || malice) + if (npc.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (npc.localAI[2] > 0f || malice) + + if (npc.localAI[2] > 0f || bossRush) enrageScale += 1f; if (Main.getGoodWorld) @@ -4608,8 +4609,8 @@ namespace CalamityMod.NPCs bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); - calamityGlobalNPC.DR = (phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !malice)) ? 0.55f : 0.1f; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !malice); + calamityGlobalNPC.DR = (phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !bossRush)) ? 0.55f : 0.1f; + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || npc.ai[0] == 5f || (enrageScale == 3f && !bossRush); if (phaseSwitchPhase) { @@ -5431,10 +5432,10 @@ namespace CalamityMod.NPCs float lifeRatio = npc.life / (float)npc.lifeMax; // Variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; float exhaustionGateValue = 300f; if (Main.getGoodWorld) @@ -5497,7 +5498,7 @@ namespace CalamityMod.NPCs chargeVelocity = expertMode ? 24f : 23f; } - if (malice) + if (bossRush) { idlePhaseTimer = 35; idlePhaseAcceleration *= 1.25f; @@ -5526,20 +5527,20 @@ namespace CalamityMod.NPCs idlePhaseVelocity *= 0.25f; // Variables - int toothBallBelchPhaseTimer = malice ? 35 : death ? 90 : 120; - int toothBallBelchPhaseDivisor = malice ? 7 : death ? 18 : 24; - float toothBallBelchPhaseAcceleration = malice ? 0.95f : death ? 0.6f : 0.55f; - float toothBallBelchPhaseVelocity = malice ? 14f : death ? 10f : 9f; + int toothBallBelchPhaseTimer = bossRush ? 35 : death ? 90 : 120; + int toothBallBelchPhaseDivisor = bossRush ? 7 : death ? 18 : 24; + float toothBallBelchPhaseAcceleration = bossRush ? 0.95f : death ? 0.6f : 0.55f; + float toothBallBelchPhaseVelocity = bossRush ? 14f : death ? 10f : 9f; float goreVelocityX = death ? 8f : revenge ? 7.5f : expertMode ? 7f : 6f; float goreVelocityY = death ? 10.5f : revenge ? 10f : expertMode ? 9.5f : 8f; - float sharkronVelocity = malice ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float sharkronVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int num9 = 120; int num10 = 180; int num12 = 30; - int num13 = malice ? 35 : death ? 90 : 120; - int toothBallSpinPhaseDivisor = malice ? 7 : death ? 18 : 24; + int num13 = bossRush ? 35 : death ? 90 : 120; + int toothBallSpinPhaseDivisor = bossRush ? 7 : death ? 18 : 24; float spinTime = num13 / 2; - float toothBallSpinToothBallVelocity = malice ? 14f : death ? 9.5f : 9f; + float toothBallSpinToothBallVelocity = bossRush ? 14f : death ? 9.5f : 9f; float scaleFactor4 = 22f; float num15 = MathHelper.TwoPi / spinTime; int num16 = 75; @@ -5595,7 +5596,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[0] % 60f == 0f) SoundEngine.PlaySound(OldDuke.OldDuke.HuffSound, player.Center); - calamityGlobalNPC.newAI[0] -= malice ? 1.5f : 1f; + calamityGlobalNPC.newAI[0] -= bossRush ? 1.5f : 1f; if (calamityGlobalNPC.newAI[0] <= 0f) { calamityGlobalNPC.newAI[0] = 0f; @@ -5604,7 +5605,7 @@ namespace CalamityMod.NPCs } // Enrage variable - bool enrage = !BossRushEvent.BossRushActive && + bool enrage = !bossRush && (player.position.Y < 300f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 8000f && player.position.X < (Main.maxTilesX * 16 - 8000))); @@ -5619,7 +5620,7 @@ namespace CalamityMod.NPCs bool biomeEnraged = npc.localAI[1] <= 0f; - npc.Calamity().CurrentlyEnraged = biomeEnraged || malice; + npc.Calamity().CurrentlyEnraged = biomeEnraged || bossRush; // Increased DR while transitioning phases and not exhausted if (!exhausted) @@ -6730,522 +6731,6 @@ namespace CalamityMod.NPCs } #endregion - // This AI is for testing purposes, don't remove it - #region Brimstone Elemental2 - public static void BrimstoneElementalAI2(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - // Used for Brimling AI states - CalamityGlobalNPC.brimstoneElemental = npc.whoAmI; - - // Center - Vector2 vectorCenter = npc.Center; - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(true); - - Player player = Main.player[npc.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, vectorCenter) > 5600f) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, vectorCenter) > 5600f) - { - npc.rotation = npc.velocity.X * 0.04f; - - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[0] != 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.localAI[0] = 0f; - npc.localAI[1] = 0f; - npc.netUpdate = true; - } - return; - } - } - else if (npc.timeLeft < 1800) - npc.timeLeft = 1800; - - CalamityPlayer modPlayer = player.Calamity(); - - // Reset defense - npc.defense = npc.defDefense; - - // Hide the sprite - npc.alpha = 255; - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Variables for buffing the AI - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool calamity = modPlayer.ZoneCalamity; - bool phase2 = (lifeRatio < 0.5f && revenge) || death; - - // Speed while moving in phase 1 - float speed = expertMode ? 5f : 4.5f; - if (BossRushEvent.BossRushActive) - speed = 12f; - else if (!calamity) - speed = 7f; - else if (death) - speed = 6f; - else if (revenge) - speed = 5.5f; - float speedBoost = death ? 2f : 2f * (1f - lifeRatio); - speed += speedBoost; - - int damage = expertMode ? 125 : 200; - float radialOffset = 32f; - float xDistance = player.Center.X - vectorCenter.X; - float yDistance = player.Center.Y - vectorCenter.Y; - float totalDistance = (float)Math.Sqrt(xDistance * xDistance + yDistance * yDistance); - - // Static movement towards target - if (npc.ai[0] == 5f) - { - npc.rotation = npc.velocity.X * 0.04f; - if (npc.ai[1] < 180f) - { - float playerLocation = vectorCenter.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - totalDistance = speed * 0.15f / totalDistance; - xDistance *= totalDistance; - yDistance *= totalDistance; - npc.velocity.X = (npc.velocity.X * 50f + xDistance) / 51f; - npc.velocity.Y = (npc.velocity.Y * 50f + yDistance) / 51f; - } - } - - if (npc.ai[0] == 0f) - { - npc.chaseable = true; - npc.rotation = npc.velocity.X * 0.04f; - float playerLocation = vectorCenter.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - npc.ai[1] += 1f; - - bool shootProjectile = false; - float fireRate = 60f; - if (npc.ai[1] % fireRate == fireRate - 1f) - shootProjectile = true; - - if (shootProjectile) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float num742 = 16f; - float num743 = player.position.X + player.width * 0.5f - vectorCenter.X; - float num744 = player.position.Y + player.height * 0.5f - vectorCenter.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - - vectorCenter.X += num743 * 3f; - vectorCenter.Y += num744 * 3f; - - float radians = MathHelper.TwoPi / 3f; - - for (int i = 0; i < 3; i++) - { - Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 8f, 0f); - Main.projectile[proj].scale = 4f; - } - - //Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, num743, num744, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 4f, 0f); - - int numProj = 4; - int spread = 45; - float rotation = MathHelper.ToRadians(spread); - float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); - double startAngle = Math.Atan2(num743, num744) - rotation / 2; - double deltaAngle = rotation / numProj; - double offsetAngle; - - for (int i = 0; i < numProj; i++) - { - offsetAngle = startAngle + deltaAngle * i; - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 10f, 0f); - } - } - } - - if (npc.position.Y > player.position.Y - 150f) //200 - { - if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.98f; - - npc.velocity.Y -= BossRushEvent.BossRushActive ? 0.15f : 0.1f; - - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - } - else if (npc.position.Y < player.position.Y - 350f) //500 - { - if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.98f; - - npc.velocity.Y += BossRushEvent.BossRushActive ? 0.15f : 0.1f; - - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; - } - if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 150f) //100 - { - if (npc.velocity.X > 0f) - npc.velocity.X *= 0.985f; - - npc.velocity.X -= BossRushEvent.BossRushActive ? 0.15f : 0.1f; - - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; - } - if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 150f) //100 - { - if (npc.velocity.X < 0f) - npc.velocity.X *= 0.985f; - - npc.velocity.X += (BossRushEvent.BossRushActive ? 0.15f : 0.1f); - - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; - } - - if (npc.ai[1] >= 300f) - { - npc.TargetClosest(true); - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - } - - // Cocoon bullet hell - else if (npc.ai[0] == 1f) - { - npc.defense = 99999; - npc.chaseable = false; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[0] += 1f; - - float projectileSpeed = revenge ? 8f : 6f; - if (BossRushEvent.BossRushActive) - projectileSpeed = 12f; - - Vector2 targetVector = player.Center - vectorCenter; - float offsetAngle = 0f; - int totalProjectiles = 0; - //int chains = 0; - - // Parabolic Arcs - if (npc.localAI[0] % 60f == 0f) - { - radialOffset = 0.1f; - float diameter = 90f; - - // Offset the arc so the central projectile(s) point towards the target - targetVector.Y -= Math.Abs(targetVector.X) * radialOffset; - - // Velocity of the arc moving towards the target - targetVector = Vector2.Normalize(targetVector) * projectileSpeed; - - // Offset the arc - Vector2 velocity = targetVector; - velocity.Normalize(); - velocity *= diameter; - - totalProjectiles = 16; - int half = totalProjectiles / 2; - float scalar = 0.2f; - float velocityMult = (totalProjectiles - 1f) / 2f; - offsetAngle = (float)Math.PI * radialOffset; - - for (int j = 0; j < totalProjectiles; j++) - { - float radians = j - velocityMult; - Vector2 offset = velocity.RotatedBy(offsetAngle * radians, default); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector * (1f - (Math.Abs(radians) / half * scalar)), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); - } - } - - // Arcs - /*if (npc.localAI[0] % 60f == 0f) - { - radialOffset = 0.1f; - float diameter = 120f; - - targetVector.Y -= Math.Abs(targetVector.X) * radialOffset; - targetVector = Vector2.Normalize(targetVector) * projectileSpeed; - - Vector2 velocity = targetVector; - velocity.Normalize(); - velocity *= diameter; - - totalProjectiles = 8; - offsetAngle = (float)Math.PI * radialOffset; - - for (int j = 0; j < totalProjectiles; j++) - { - float radians = j - (totalProjectiles - 1f) / 2f; - Vector2 offset = velocity.RotatedBy(offsetAngle * radians, default); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter + offset, targetVector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -1f, 0f); - } - } - - if (npc.localAI[0] % 120f == 0f) - { - totalProjectiles = 24; - offsetAngle = 360 / totalProjectiles; - for (int i = 0; i < totalProjectiles; i++) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 15f, i * offsetAngle); - } - - totalProjectiles = 16; - chains = 4; - float velocityTimer = 90f / (totalProjectiles / chains); - double radians = MathHelper.TwoPi / totalProjectiles; - int j = 0; - - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i, default); - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 16f, j * velocityTimer); - - j++; - if (j % 4 == 0) - j = 0; - } - } - - totalProjectiles = 36; - float divisor = 6f; - chains = 3; - float interval = totalProjectiles / chains * divisor; - double patternInterval = Math.Floor(npc.localAI[0] / interval); - - if (patternInterval % 2 == 0) - { - if (npc.localAI[0] % divisor == 0f) - { - double radians = (patternInterval % 4 == 0 ? MathHelper.TwoPi + MathHelper.Pi / 3 : MathHelper.TwoPi) / chains; - radialOffset = MathHelper.ToRadians(npc.ai[2]); - - for (int i = 0; i < chains; i++) - { - Vector2 vector = new Vector2(0f, -3f).RotatedBy(radians * i + radialOffset, default); - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, vector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 3f, 0f); - } - - // Radial offset - npc.ai[2] += 5f; - } - } - else - npc.ai[2] = 0f;*/ - - /*if (npc.localAI[0] % 180f == 0f) - { - totalProjectiles = 12; - offsetAngle = 360 / totalProjectiles; - - for (int i = 0; i < totalProjectiles; i++) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, i * offsetAngle); - Projectile.NewProjectile(npc.GetSource_FromAI(), vectorCenter, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 12f, i * offsetAngle); - } - }*/ - } - - if (npc.velocity.Length() > 0f) - npc.velocity = Vector2.Zero; - - npc.rotation = npc.velocity.X * 0.04f; - - float playerLocation = vectorCenter.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - - npc.ai[1] += 1f; - if (npc.ai[1] >= 600f) - { - npc.TargetClosest(true); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.localAI[0] = 0f; - npc.netUpdate = true; - } - } - - // Laser beam attack - else if (npc.ai[0] == 2f) - { - npc.defense = npc.defDefense * 3; - - Vector2 source = new Vector2(vectorCenter.X + (npc.spriteDirection > 0 ? 34f : -34f), vectorCenter.Y - 74f); - Vector2 aimAt = player.Center + player.velocity * 20f; - float aimResponsiveness = 0.4f; - - switch ((int)npc.ai[2]) - { - case 0: - break; - case 1: - aimResponsiveness = 0.25f; - break; - case 2: - aimResponsiveness = 0.1f; - break; - } - - Vector2 aimVector = Vector2.Normalize(aimAt - source); - if (aimVector.HasNaNs()) - aimVector = -Vector2.UnitY; - aimVector = Vector2.Normalize(Vector2.Lerp(aimVector, Vector2.Normalize(npc.velocity), aimResponsiveness)); - aimVector *= 6f; - - Vector2 laserVelocity = Vector2.Normalize(aimVector); - if (laserVelocity.HasNaNs()) - laserVelocity = -Vector2.UnitY; - - calamityGlobalNPC.newAI[1] = laserVelocity.X; - calamityGlobalNPC.newAI[2] = laserVelocity.Y; - - npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) - { - npc.TargetClosest(true); - npc.ai[2] += 1f; - npc.localAI[0] = 0f; - npc.localAI[1] = 0f; - if (npc.ai[2] >= 3f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - else - { - npc.ai[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } - else if (npc.ai[1] >= 180f) - { - npc.velocity *= 0.95f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (npc.ai[1] == 180f) - { - SoundEngine.PlaySound(SoundID.Zombie104, npc.position); - Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); - laserVelocity2.Normalize(); - - int totalProjectiles = 4; - float spread = MathHelper.ToRadians(90); // 30 degrees in radians = 0.523599 - double startAngle = Math.Atan2(laserVelocity2.X, laserVelocity2.Y) - spread / 2; // Where the projectiles start spawning at, don't change this - double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325 - double offsetAngle; - - int i; - for (i = 0; i < 2; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + radialOffset * i; - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 40, 0f, Main.myPlayer, 1f, npc.whoAmI); - } - } - } - } - else - { - float playSoundTimer = 20f; - if (npc.ai[1] < 150f) - { - switch ((int)npc.ai[2]) - { - case 0: - break; - case 1: - npc.ai[1] += 0.5f; - playSoundTimer = 30f; - break; - case 2: - npc.ai[1] += 1f; - playSoundTimer = 40f; - break; - } - } - - if (npc.ai[1] % playSoundTimer == 0f) - SoundEngine.PlaySound(SoundID.Item20, npc.position); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (npc.ai[1] < 150f && calamityGlobalNPC.newAI[0] == 0f) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - calamityGlobalNPC.newAI[0] = 1f; - } - else - { - if (npc.ai[1] == 150f) - { - npc.localAI[0] = laserVelocity.X; - npc.localAI[1] = laserVelocity.Y; - - Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); - laserVelocity2.Normalize(); - - int totalProjectiles = 4; - float spread = MathHelper.ToRadians(90); // 30 degrees in radians = 0.523599 - double startAngle = Math.Atan2(laserVelocity2.X, laserVelocity2.Y) - spread / 2; // Where the projectiles start spawning at, don't change this - double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325 - double offsetAngle; - - int i; - for (i = 0; i < 2; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + radialOffset * i; - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)Math.Sin(offsetAngle), (float)Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, (float)-Math.Sin(offsetAngle), (float)-Math.Cos(offsetAngle), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - } - } - } - } - } - } - } - #endregion - #region Gem Crawler AI public static void GemCrawlerAI(NPC npc, Mod mod, float speedDetect, float speedAdditive) { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 03821fb2f5..21b07f8bfc 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs // 1 - For special cases with super-enrages (specifically Yharon/SCal with their arenas), go solely based on whether that enrage is active. That information is most important to the player. // 2 - Otherwise, check if the demonshade enrage is active. If it is, register this as true. If not, go to step 3. // 3 - Check if a specific enrage condition (such as Duke Fishron's Ocean check) is met. If it is, and Boss Rush is not active, set this to true. If not, go to step 4. - // 4 - Check if malice is active and Boss Rush isn't. If so, set this to true. + // 4 - Check if Boss Rush isn't active. If so, set this to true. public bool CurrentlyEnraged; // Increased defense or DR variable for use with the boss health UI. @@ -2570,8 +2570,8 @@ namespace CalamityMod.NPCs damage += yellowCandleDamage; // Calculate extra DR based on kill time, similar to the Hush boss from The Binding of Isaac - bool nightProvi = npc.type == NPCType() && (!Main.dayTime || CalamityWorld.malice); - bool dayEmpress = npc.type == NPCID.HallowBoss && (NPC.ShouldEmpressBeEnraged() || CalamityWorld.malice); + bool nightProvi = npc.type == NPCType() && !Main.dayTime; + bool dayEmpress = npc.type == NPCID.HallowBoss && NPC.ShouldEmpressBeEnraged(); if (KillTime > 0 && AITimer < KillTime && !BossRushEvent.BossRushActive && (nightProvi || dayEmpress)) { // Set the DR scaling factor @@ -3636,10 +3636,8 @@ namespace CalamityMod.NPCs npc.buffImmune[BuffType()] = false; // Sets certain vanilla NPCs and all town NPCs to be immune to most debuffs. - if (((CalamityLists.DesertScourgeIDs.Contains(npc.type) || npc.type == NPCID.Creeper || CalamityLists.PerforatorIDs.Contains(npc.type)) && CalamityWorld.malice) || - CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.SkeletronHead || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel || - (CalamityLists.EaterofWorldsIDs.Contains(npc.type) && (BossRushEvent.BossRushActive || CalamityWorld.malice)) || - npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) + if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.SkeletronHead || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel || + (CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) { for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 3ecd69fc69..f4a494b49a 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -129,16 +129,16 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.timeLeft = 1800; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Gets how enraged Ceaseless Void is float tileEnrageMult = Main.npc[CalamityGlobalNPC.voidBoss].ai[1]; // Distance from Ceaseless Void - double maxDistance = malice ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; + double maxDistance = bossRush ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index c615193d31..ec6357faa5 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.Crabulon { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0f, 0.2f, 0.4f); bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - float xVelocityLimit = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 7.5f : 5f; + float xVelocityLimit = BossRushEvent.BossRushActive ? 7.5f : 5f; float yVelocityLimit = revenge ? 1.25f : 1f; Player player = Main.player[NPC.target]; NPC.velocity.Y += 0.02f; diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 54d2f1fafc..39ba9f3293 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -110,10 +110,10 @@ namespace CalamityMod.NPCs.Crabulon { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0f, 0.3f, 0.7f); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; NPC.spriteDirection = NPC.direction; @@ -166,7 +166,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.timeLeft = 1800; // Enrage - if ((!player.ZoneGlowshroom || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + if ((!player.ZoneGlowshroom || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -174,17 +174,17 @@ namespace CalamityMod.NPCs.Crabulon else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (biomeEnraged && (!player.ZoneGlowshroom || malice)) + if (biomeEnraged && (!player.ZoneGlowshroom || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -408,7 +408,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[1] += !revenge ? 4f : 1f; } - float jumpGateValue = (malice ? 40f : 120f) / (enrageScale + 1f); + float jumpGateValue = (bossRush ? 40f : 120f) / (enrageScale + 1f); if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -481,16 +481,16 @@ namespace CalamityMod.NPCs.Crabulon int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - float velocityY = BossRushEvent.BossRushActive ? 8f : CalamityWorld.malice ? 6f : CalamityWorld.death ? 4f : 3f; + float velocityY = bossRush ? 8f : death ? 4f : 3f; if (NPC.ai[2] % 2f == 0f && phase2 && revenge) { if (Main.netMode != NetmodeID.MultiplayerClient) { float velocityX = NPC.ai[2] == 0f ? -4f : 4f; - int totalMushrooms = malice ? 50 : 20; - int shotSpacingDecrement = malice ? 80 : 100; - if (malice) + int totalMushrooms = bossRush ? 50 : 20; + int shotSpacingDecrement = bossRush ? 80 : 100; + if (bossRush) shotSpacing = 2000; for (int x = 0; x < totalMushrooms; x++) @@ -501,7 +501,7 @@ namespace CalamityMod.NPCs.Crabulon shotSpacing -= shotSpacingDecrement; } - shotSpacing = malice ? 2000 : 1000; + shotSpacing = bossRush ? 2000 : 1000; } } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 21d36a3444..63ed2ac16c 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -127,13 +127,13 @@ namespace CalamityMod.NPCs.Cryogen Player player = Main.player[NPC.target]; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Enrage - if (!player.ZoneSnow && !BossRushEvent.BossRushActive) + if (!player.ZoneSnow && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -141,19 +141,19 @@ namespace CalamityMod.NPCs.Cryogen else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; float enrageScale = death ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } if (enrageScale > 2f) enrageScale = 2f; - if (BossRushEvent.BossRushActive) + if (bossRush) enrageScale = 3f; // Percent life remaining @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.Cryogen if ((int)NPC.ai[0] + 1 > currentPhase) HandlePhaseTransition((int)NPC.ai[0] + 1); - if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (NPC.ai[0] < 3f || BossRushEvent.BossRushActive || (death && NPC.ai[0] > 3f))) //spawn shield for phase 0 1 2, not 3 4 5 + if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (NPC.ai[0] < 3f || bossRush || (death && NPC.ai[0] > 3f))) //spawn shield for phase 0 1 2, not 3 4 5 { int num6 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); NPC.ai[2] = num6 + 1; @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float chargePhaseGateValue = malice ? 240f : 360f; + float chargePhaseGateValue = bossRush ? 240f : 360f; float chargeDuration = 60f; float chargeSlowDownTime = 15f; float chargeVelocityMin = 12f; @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (NPC.ai[0] < 5f || !phase6) && !chargePhase) { time++; - if (time >= (malice ? 660 : 900)) + if (time >= (bossRush ? 660 : 900)) { time = 0; SoundEngine.PlaySound(SoundID.Item28, NPC.Center); @@ -281,7 +281,7 @@ namespace CalamityMod.NPCs.Cryogen if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int totalProjectiles = malice ? 24 : 16; + int totalProjectiles = bossRush ? 24 : 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.Cryogen if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int totalProjectiles = malice ? 18 : 12; + int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -511,7 +511,7 @@ namespace CalamityMod.NPCs.Cryogen if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int totalProjectiles = malice ? 18 : 12; + int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -653,7 +653,7 @@ namespace CalamityMod.NPCs.Cryogen if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int totalProjectiles = malice ? 18 : 12; + int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -768,7 +768,7 @@ namespace CalamityMod.NPCs.Cryogen float velocity = 9f + enrageScale; for (int i = 0; i < 3; i++) { - int totalProjectiles = malice ? 9 : 6; + int totalProjectiles = bossRush ? 9 : 6; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * 0.33f * i); float velocityX = 0f; @@ -851,7 +851,7 @@ namespace CalamityMod.NPCs.Cryogen float velocity = 9f + enrageScale; for (int i = 0; i < 4; i++) { - int totalProjectiles = malice ? 6 : 4; + int totalProjectiles = bossRush ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * 0.25f * i); float velocityX = 0f; @@ -945,7 +945,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.rotation = NPC.velocity.X * 0.1f; time++; - if (time >= (malice ? 50 : 75)) + if (time >= (bossRush ? 50 : 75)) { time = 0; SoundEngine.PlaySound(SoundID.Item28, NPC.Center); @@ -966,7 +966,7 @@ namespace CalamityMod.NPCs.Cryogen } NPC.ai[1] += 1f; - if (NPC.ai[1] >= (malice ? 120f : 180f)) + if (NPC.ai[1] >= (bossRush ? 120f : 180f)) { NPC.TargetClosest(); NPC.ai[0] = 4f; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 4dc514c92c..42fa8ed329 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 2163bfa3b0..3ab29fca4b 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -126,10 +126,10 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.DesertScourge Player player = Main.player[NPC.target]; // Enrage - if (!player.ZoneDesert && !BossRushEvent.BossRushActive) + if (!player.ZoneDesert && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -150,12 +150,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; + float enrageScale = bossRush ? 1f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -246,13 +246,13 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.Calamity().newAI[2] % 30f == 0f) { SoundEngine.PlaySound(SoundID.Item21, NPC.Center); - float velocity = malice ? 6f : death ? 5.5f : 5f; + float velocity = bossRush ? 6f : death ? 5.5f : 5f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * velocity; - int baseProjectileAmt = malice ? 6 : death ? 4 : revenge ? 3 : 2; + int baseProjectileAmt = bossRush ? 6 : death ? 4 : revenge ? 3 : 2; int numProj = NPC.Calamity().newAI[2] % 60f == 0f ? (int)(baseProjectileAmt * 1.5) : baseProjectileAmt; - int spread = malice ? 18 : death ? 14 : revenge ? 12 : 10; + int spread = bossRush ? 18 : death ? 14 : revenge ? 12 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { @@ -372,7 +372,7 @@ namespace CalamityMod.NPCs.DesertScourge float num18 = speed; float num19 = turnSpeed; - float burrowDistance = malice ? 500f : 800f; + float burrowDistance = bossRush ? 500f : 800f; float burrowTarget = player.Center.Y + burrowDistance; float lungeTarget = player.Center.Y - 600f; Vector2 vector3 = NPC.Center; @@ -405,11 +405,11 @@ namespace CalamityMod.NPCs.DesertScourge SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float velocity = malice ? 9f : death ? 7f : 6f; + float velocity = bossRush ? 9f : death ? 7f : 6f; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(NPC.Center + NPC.velocity * 10f - NPC.Center) * velocity; - int numProj = malice ? 24 : death ? 20 : revenge ? 18 : expertMode ? 16 : 12; + int numProj = bossRush ? 24 : death ? 20 : revenge ? 18 : expertMode ? 16 : 12; if (Main.getGoodWorld) numProj *= 2; diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 4ab35a974b..38c0a24f26 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 1755c23936..d7040495d8 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -192,8 +193,8 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector18 = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); float num191 = Main.npc[CalamityGlobalNPC.DoGHead].position.X + (Main.npc[CalamityGlobalNPC.DoGHead].width / 2); float num192 = Main.npc[CalamityGlobalNPC.DoGHead].position.Y + (Main.npc[CalamityGlobalNPC.DoGHead].height / 2); - float num188 = CalamityWorld.malice ? 30f : CalamityWorld.revenge ? 25f : 23f; - float num189 = CalamityWorld.malice ? 0.9f : CalamityWorld.revenge ? 0.75f : 0.23f; + float num188 = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; + float num189 = BossRushEvent.BossRushActive ? 0.9f : CalamityWorld.revenge ? 0.75f : 0.23f; if (increaseSpeedMore) num189 *= 4f; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index e3ba8e5507..92444932e1 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -137,10 +137,10 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.life = Main.npc[(int)NPC.ai[1]].life; bool phase2 = NPC.life / (float)NPC.lifeMax < 0.6f; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; if (phase2) { @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[3] < laserWallPhaseGateValue - 180f) { NPC.localAI[0] += 1f; - float laserGateValue = malice ? 156f : death ? 180f : 192f; + float laserGateValue = bossRush ? 156f : death ? 180f : 192f; if (Main.getGoodWorld) laserGateValue *= 0.5f; @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.DevourerofGods { SoundEngine.PlaySound(SoundID.Item12, player.position); NPC.TargetClosest(); - float maxProjectileVelocity = malice ? 8f : death ? 7.5f : revenge ? 7.25f : expertMode ? 7f : 6.5f; + float maxProjectileVelocity = bossRush ? 8f : death ? 7.5f : revenge ? 7.25f : expertMode ? 7f : 6.5f; float minProjectileVelocity = maxProjectileVelocity * 0.25f; float projectileVelocity = MathHelper.Clamp(Vector2.Distance(player.Center, NPC.Center) * 0.01f, minProjectileVelocity, maxProjectileVelocity); Vector2 velocityVector = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; @@ -244,8 +244,8 @@ namespace CalamityMod.NPCs.DevourerofGods else { // Fire lasers from every 10th (20th in normal mode) body segment if not in laser barrage phase - float laserBarrageGateValue = malice ? 780f : death ? 900f : 960f; - float laserBarrageShootGateValue = malice ? 160f : 240f; + float laserBarrageGateValue = bossRush ? 780f : death ? 900f : 960f; + float laserBarrageShootGateValue = bossRush ? 160f : 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue * 1.5f; if (Main.npc[(int)NPC.ai[2]].Calamity().newAI[1] < laserBarragePhaseGateValue) { @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.DevourerofGods SoundEngine.PlaySound(SoundID.Item12, player.position); NPC.localAI[0] = 0f; NPC.TargetClosest(); - float maxProjectileVelocity = malice ? 7.5f : death ? 7f : revenge ? 6.75f : expertMode ? 6.5f : 6f; + float maxProjectileVelocity = bossRush ? 7.5f : death ? 7f : revenge ? 6.75f : expertMode ? 6.5f : 6f; float minProjectileVelocity = maxProjectileVelocity * 0.25f; float projectileVelocity = MathHelper.Clamp(Vector2.Distance(player.Center, NPC.Center) * 0.01f, minProjectileVelocity, maxProjectileVelocity); Vector2 velocityVector = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 50ea413f8b..127c0523cd 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -338,11 +338,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Variables Vector2 vector = NPC.Center; bool flies = NPC.ai[3] == 0f; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -359,14 +358,14 @@ namespace CalamityMod.NPCs.DevourerofGods bool phase7 = lifeRatio < 0.15f; // Velocity variables - float fallSpeed = malice ? 19f : death ? 17.5f : 16f; + float fallSpeed = bossRush ? 19f : death ? 17.5f : 16f; if (expertMode) fallSpeed += 4f * (1f - lifeRatio); - float speed = malice ? 18f : death ? 16.5f : 15f; - float turnSpeed = malice ? 0.36f : death ? 0.33f : 0.3f; - float homingSpeed = malice ? 36f : death ? 30f : 24f; - float homingTurnSpeed = malice ? 0.48f : death ? 0.405f : 0.33f; + float speed = bossRush ? 18f : death ? 16.5f : 15f; + float turnSpeed = bossRush ? 0.36f : death ? 0.33f : 0.3f; + float homingSpeed = bossRush ? 36f : death ? 30f : 24f; + float homingTurnSpeed = bossRush ? 0.48f : death ? 0.405f : 0.33f; if (expertMode) { @@ -376,7 +375,7 @@ namespace CalamityMod.NPCs.DevourerofGods homingTurnSpeed += 0.15f * (1f - lifeRatio); } - float groundPhaseTurnSpeed = malice ? 0.3f : death ? 0.24f : 0.18f; + float groundPhaseTurnSpeed = bossRush ? 0.3f : death ? 0.24f : 0.18f; if (expertMode) groundPhaseTurnSpeed += 0.1f * (1f - lifeRatio); @@ -459,10 +458,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Teleport after the Phase 2 animation. float timeWhenDoGShouldTeleportDuringPhase2Countdown = 61f; - if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown + ((CalamityWorld.death || BossRushEvent.BossRushActive) ? TimeBeforeTeleport_Death : CalamityWorld.revenge ? TimeBeforeTeleport_Revengeance : Main.expertMode ? TimeBeforeTeleport_Expert : TimeBeforeTeleport_Normal)) + if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown + (death ? TimeBeforeTeleport_Death : CalamityWorld.revenge ? TimeBeforeTeleport_Revengeance : Main.expertMode ? TimeBeforeTeleport_Expert : TimeBeforeTeleport_Normal)) SpawnTeleportLocation(player, true); if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown) - Teleport(player, malice, death, revenge, expertMode, phase5); + Teleport(player, bossRush, death, revenge, expertMode, phase5); // Just in case the projectile cap is reached and the teleport rift doesn't spawn. if (AwaitingPhase2Teleport && NPC.localAI[2] == 0f) @@ -585,7 +584,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Teleport if (teleportTimer == 0) - Teleport(player, malice, death, revenge, expertMode, phase5); + Teleport(player, bossRush, death, revenge, expertMode, phase5); } // Do the death animation once killed. @@ -729,7 +728,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (!spawnedGuardians3 && laserWallPhase == (int)LaserWallPhase.FireLaserWalls) { float spawnOffset = 1500f; - float divisor = malice ? 80f : 120f; + float divisor = bossRush ? 80f : 120f; if (calamityGlobalNPC.newAI[1] % divisor == 0f) { @@ -1246,8 +1245,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = malice ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = malice ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; + double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; if (expertMode) { @@ -1430,8 +1429,8 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser barrage attack variables - float laserBarrageGateValue = malice ? 780f : death ? 900f : 960f; - float laserBarrageShootGateValue = malice ? 160f : 240f; + float laserBarrageGateValue = bossRush ? 780f : death ? 900f : 960f; + float laserBarrageShootGateValue = bossRush ? 160f : 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue; // Spawn segments @@ -1939,8 +1938,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = malice ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = malice ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; + double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; if (expertMode) { @@ -2092,7 +2091,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - private void Teleport(Player player, bool malice, bool death, bool revenge, bool expertMode, bool phase5) + private void Teleport(Player player, bool bossRush, bool death, bool revenge, bool expertMode, bool phase5) { Vector2 newPosition = GetRiftLocation(true); @@ -2110,7 +2109,7 @@ namespace CalamityMod.NPCs.DevourerofGods float mult = revenge ? 1.5f : 3f; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = malice ? 18 : 12; + int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = finalVelocity - i * mult; float velocityMult = 1f + ((finalVelocity - newVelocity) / (newVelocity * 2f) / 100f); @@ -2130,7 +2129,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.TargetClosest(); NPC.position = newPosition; - float chargeVelocity = malice ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; + float chargeVelocity = bossRush ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; float maxChargeDistance = 1600f; postTeleportTimer = (int)Math.Round(maxChargeDistance / chargeVelocity); AwaitingPhase2Teleport = false; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 1d91997063..5515afde42 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -232,10 +232,10 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -401,20 +401,20 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Phase 7 - 0, 1, 2 // Predictiveness - float predictionAmt = malice ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; + float predictionAmt = bossRush ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; if (nerfedAttacks) predictionAmt *= 0.5f; if (SecondaryAIState == (int)SecondaryPhase.Passive) predictionAmt *= 0.5f; // Gate values - float reducedTimeForGateValue = malice ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = 30f; - float timeToLineUpCharge = malice ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; + float timeToLineUpCharge = bossRush ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; if (Main.getGoodWorld) { @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float chargeLocationDistanceGateValue = 40f; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (AIState == (int)Phase.LineUpChargeCombo ? 40f : 20f) * baseVelocityMult; // Attack gate values @@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; // Charge velocity - float chargeVelocity = malice ? 115f : death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; + float chargeVelocity = bossRush ? 115f : death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; if (Main.getGoodWorld) { @@ -1191,7 +1191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Plasma bolts on charge if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.malice ? 12 : 8; + int totalProjectiles = bossRush ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = (int)(NPC.GetProjectileDamage(ModContent.ProjectileType()) * 0.8); diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 96a5f26948..e17653b106 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_Malice = 60f; + public const float deathrayTelegraphDuration_BossRush = 60f; // Total duration of the deathrays public const float deathrayDuration = 600f; @@ -231,10 +231,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -454,7 +454,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 425f) : player.Center; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (EnragedState == (float)Enraged.Yes ? 28f : 20f) * baseVelocityMult; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; float decelerationVelocityMult = 0.85f; @@ -741,7 +741,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 1f; NPC.velocity *= decelerationVelocityMult; - int totalProjectiles = malice ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; + int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; if (Main.getGoodWorld) totalProjectiles += 4; @@ -754,7 +754,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); spinningPoint.Normalize(); - float deathrayTelegraphDuration = malice ? deathrayTelegraphDuration_Malice : death ? deathrayTelegraphDuration_Death : + float deathrayTelegraphDuration = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; calamityGlobalNPC.newAI[2] += (EnragedState == (float)Enraged.Yes && calamityGlobalNPC.newAI[2] % 2f == 0f) ? 2f : 1f; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index fc9e223680..676e87ff56 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -130,10 +130,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Predictiveness - float predictionAmt = malice ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -317,7 +317,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX2, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY2) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index b3ebda46fb..f3fb7f4064 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -133,10 +133,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; @@ -345,7 +345,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, player.Center) > 320f || !fireNormalLasers; // Telegraph duration for deathray spiral - float deathraySpiralTelegraphDuration = malice ? AresBody.deathrayTelegraphDuration_Malice : death ? AresBody.deathrayTelegraphDuration_Death : + float deathraySpiralTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to disable deathray firing diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index f1728d2a34..cd97aef04d 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -130,10 +130,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Predictiveness - float predictionAmt = malice ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -330,7 +330,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX2, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY2) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -346,7 +346,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, player.Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = malice ? AresBody.deathrayTelegraphDuration_Malice : death ? AresBody.deathrayTelegraphDuration_Death : + float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel plasma bolt firing diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 49b897e113..6e343e0abf 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -128,10 +128,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -214,7 +214,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Predictiveness - float predictionAmt = malice ? 40f : death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; + float predictionAmt = bossRush ? 40f : death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -330,7 +330,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX2, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY2) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + offsetX, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + offsetY); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -343,7 +343,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, player.Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = malice ? AresBody.deathrayTelegraphDuration_Malice : death ? AresBody.deathrayTelegraphDuration_Death : + float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel tesla orb firing diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index caea32dfcf..60359eb7a6 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -250,10 +250,10 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -426,7 +426,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Phase 7 - 0, 1, 2 // Predictiveness - float predictionAmt = malice ? 21f : death ? 18f : revenge ? 16.5f : expertMode ? 15f : 12f; + float predictionAmt = bossRush ? 21f : death ? 18f : revenge ? 16.5f : expertMode ? 15f : 12f; if (AIState == (float)Phase.LaserShotgun) predictionAmt *= 1.5f; if (nerfedAttacks) @@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis predictionAmt *= 0.5f; // Gate values - float reducedTimeForGateValue = malice ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; @@ -479,7 +479,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float movementDistanceGateValue = 100f; // Charge variables - float chargeVelocity = nerfedAttacks ? 75f : malice ? 100f : death ? 90f : revenge ? 86.25f : expertMode ? 82.5f : 75f; + float chargeVelocity = nerfedAttacks ? 75f : bossRush ? 100f : death ? 90f : revenge ? 86.25f : expertMode ? 82.5f : 75f; if (Main.getGoodWorld) chargeVelocity *= 1.15f; @@ -490,7 +490,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = ((AIState == (int)Phase.Deathray || lineUpAttack || AIState == (int)Phase.LaserShotgun) ? 40f : 20f) * baseVelocityMult; float decelerationVelocityMult = 0.85f; @@ -636,7 +636,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } // Duration of deathray spin to do a full circle - // Normal = 120, Expert = 104, Rev = 96, Death = 88, Malice = 72 + // Normal = 120, Expert = 104, Rev = 96, Death = 88, Boss Rush = 72 float spinTime = 120f - 320f * (baseVelocityMult - 1.25f); // Set to transition to phase 2 if it hasn't happened yet @@ -791,8 +791,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 laserVelocity = chargeVelocityNormalized * 10f; - int numLasersPerSpread = malice ? 10 : death ? 8 : expertMode ? 6 : 4; - int spread = malice ? 30 : death ? 26 : expertMode ? 21 : 15; + int numLasersPerSpread = bossRush ? 10 : death ? 8 : expertMode ? 6 : 4; + int spread = bossRush ? 30 : death ? 26 : expertMode ? 21 : 15; float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(NPC.Center, NPC.Center + chargeVelocityNormalized * chargeDistance); float setVelocityInAI = 6.5f; @@ -882,7 +882,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis * normal = 16, 20, 24 * nerfedAttacks = 12, 15, 18 */ - int numLasersAddedByDifficulty = malice ? 3 : death ? 2 : expertMode ? 1 : 0; + int numLasersAddedByDifficulty = bossRush ? 3 : death ? 2 : expertMode ? 1 : 0; int numLasersPerSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 3 : lastMechAlive ? 7 : 5) + numLasersAddedByDifficulty; int baseSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 9 : lastMechAlive ? 20 : 15) + numLasersAddedByDifficulty * 2; int spread = baseSpread + (int)(calamityGlobalNPC.newAI[2] / divisor2) * (baseSpread / 4); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index c98d31fdd8..9d24a59218 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -133,10 +133,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die bool shouldDespawn = true; @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; + double numSegmentsAbleToFire = bossRush ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.5; @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = malice ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; @@ -445,9 +445,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.Calamity().unbreakableDR = !vulnerable; // Increase overall damage taken while vulnerable - float damageMult = malice ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; + float damageMult = bossRush ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; if (shouldGetBuffedByBerserkPhase) - damageMult -= malice ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; + damageMult -= bossRush ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; NPC.takenDamageMultiplier = vulnerable ? damageMult : 1f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 99e1f13541..956548f77a 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -133,10 +133,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die bool shouldDespawn = true; @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; + double numSegmentsAbleToFire = bossRush ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.5; @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = malice ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; @@ -445,9 +445,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.Calamity().unbreakableDR = !vulnerable; // Increase overall damage taken while vulnerable - float damageMult = malice ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; + float damageMult = bossRush ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; if (shouldGetBuffedByBerserkPhase) - damageMult -= malice ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; + damageMult -= bossRush ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; NPC.takenDamageMultiplier = vulnerable ? damageMult : 1f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 9775aa82fa..cd47e775d8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (Main.getGoodWorld ? 0.5f : 1f); + (BossRushEvent.BossRushActive ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (Main.getGoodWorld ? 0.5f : 1f); public int CheckForOtherMechs(ref Player target, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -258,10 +258,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos CalamityGlobalNPC.draedonExoMechWorm = NPC.whoAmI; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -484,7 +484,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float laserBarrageLocationDistance = turnDistance * 3f; // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (malice ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = 11.1f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 10ee4a7134..ce305ece2d 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -133,10 +133,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die bool shouldDespawn = true; @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; + double numSegmentsAbleToFire = bossRush ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.5; @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = malice ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; @@ -445,9 +445,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.Calamity().unbreakableDR = !vulnerable; // Increase overall damage taken while vulnerable - float damageMult = malice ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; + float damageMult = bossRush ? 1.1f : death ? 1.2f : revenge ? 1.25f : expertMode ? 1.3f : 1.4f; if (shouldGetBuffedByBerserkPhase) - damageMult -= malice ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; + damageMult -= bossRush ? 0.1f : death ? 0.175f : revenge ? 0.2f : expertMode ? 0.225f : 0.3f; NPC.takenDamageMultiplier = vulnerable ? damageMult : 1f; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 47e6b7583d..c48f4e465f 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.TargetClosest(); bool revenge = CalamityWorld.revenge; float speed = revenge ? 12f : 11f; - if (BossRushEvent.BossRushActive || CalamityWorld.malice) + if (BossRushEvent.BossRushActive) speed = 18f; if (NPC.ai[1] < 90f) diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 82fa9e9cad..b031561300 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.TargetClosest(); float num1164 = revenge ? 4.5f : 4f; float num1165 = revenge ? 0.8f : 0.75f; - if (BossRushEvent.BossRushActive || CalamityWorld.malice) + if (BossRushEvent.BossRushActive) { num1164 *= 2f; num1165 *= 2f; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 62c95a48bd..6f4da44b56 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1f; } - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) { lungeRots = 0.4; minimumDriftTime = 40; @@ -387,16 +387,16 @@ namespace CalamityMod.NPCs.HiveMind Player player = Main.player[NPC.target]; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; // Enrage - if ((!player.ZoneCorrupt || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + if ((!player.ZoneCorrupt || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -404,17 +404,17 @@ namespace CalamityMod.NPCs.HiveMind else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCorrupt || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && (!player.ZoneCorrupt || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || malice)) + if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -523,8 +523,8 @@ namespace CalamityMod.NPCs.HiveMind { NPC.ai[3] = NPC.life; - int maxSpawns = malice ? 10 : death ? 5 : revenge ? 4 : expertMode ? Main.rand.Next(3, 5) : Main.rand.Next(2, 4); - int maxDankSpawns = malice ? 4 : death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; + int maxSpawns = bossRush ? 10 : death ? 5 : revenge ? 4 : expertMode ? Main.rand.Next(3, 5) : Main.rand.Next(2, 4); + int maxDankSpawns = bossRush ? 4 : death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; for (int num662 = 0; num662 < maxSpawns; num662++) { @@ -844,7 +844,7 @@ namespace CalamityMod.NPCs.HiveMind if (phase2timer <= 0) { phase2timer = lungeTime - 4 * (int)enrageScale; - NPC.velocity = player.Center + (malice ? player.velocity * 20f : Vector2.Zero) - NPC.Center; + NPC.velocity = player.Center + (bossRush ? player.velocity * 20f : Vector2.Zero) - NPC.Center; NPC.velocity.Normalize(); NPC.velocity *= teleportRadius / (lungeTime - (int)enrageScale); dashStarted = true; diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 1e59be0439..0d0efb9800 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -142,14 +142,14 @@ namespace CalamityMod.NPCs.Leviathan // Variables Player player = Main.player[NPC.target]; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !BossRushEvent.BossRushActive) + if (notOcean && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -157,12 +157,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 0.5f : 0f; + float enrageScale = bossRush ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1.5f; } @@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.rotation = NPC.rotation.AngleTowards(idealRotation, 0.08f); - if (BossRushEvent.BossRushActive || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) + if (bossRush || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) { int oldAlpha = NPC.alpha; NPC.alpha = Utils.Clamp(NPC.alpha + 9, 0, 255); diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index c476446356..3fe8daf4c6 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -84,10 +84,10 @@ namespace CalamityMod.NPCs.Leviathan return; } - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; NPC.TargetClosest(false); @@ -119,14 +119,14 @@ namespace CalamityMod.NPCs.Leviathan } } - float inertia = malice ? 24f : death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; + float inertia = bossRush ? 24f : death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; if (!sirenAlive || leviathanInPhase4) inertia *= 0.75f; float num1006 = 0.111111117f * inertia; if (NPC.ai[0] == 0f) { - float scaleFactor6 = malice ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; + float scaleFactor6 = bossRush ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; if (!sirenAlive || leviathanInPhase4) scaleFactor6 *= 1.25f; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 5d8ca873b1..1d6d4bebf1 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -116,10 +116,10 @@ namespace CalamityMod.NPCs.Leviathan CalamityGlobalNPC.leviathan = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; Vector2 vector = NPC.Center; // Is in spawning animation @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Leviathan bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !BossRushEvent.BossRushActive) + if (notOcean && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -187,12 +187,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; + float enrageScale = bossRush ? 1f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index c7dd15b354..aafa91fe3c 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs { // Fire bolt every 1.5 seconds NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 45f : CalamityWorld.death ? 60f : 75f)) + if (NPC.localAI[0] >= (BossRushEvent.BossRushActive ? 45f : CalamityWorld.death ? 60f : 75f)) { NPC.localAI[0] = 0f; diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 7896303cf2..3d4c531943 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -64,10 +64,10 @@ namespace CalamityMod.NPCs.OldDuke public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; NPC.rotation += NPC.velocity.X * 0.05f; @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.OldDuke float num1372 = death ? 14f : revenge ? 13f : 12f; if (expertMode) { - float speedUpMult = BossRushEvent.BossRushActive ? 0.015f : CalamityWorld.malice ? 0.0125f : 0.01f; + float speedUpMult = bossRush ? 0.015f : 0.01f; num1372 += Vector2.Distance(player.Center, NPC.Center) * speedUpMult; } @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.velocity.Y = (NPC.velocity.Y * 7f + num1374) / 8f; } - float num1247 = CalamityWorld.malice ? 0.65f : 0.5f; + float num1247 = bossRush ? 0.65f : 0.5f; for (int num1248 = 0; num1248 < Main.maxNPCs; num1248++) { if (Main.npc[num1248].active) diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index d77402d237..1930f5e353 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -88,10 +88,10 @@ namespace CalamityMod.NPCs.OldDuke public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) { @@ -123,14 +123,14 @@ namespace CalamityMod.NPCs.OldDuke // Fly down bool downwardAI = NPC.ai[3] > 0f; - float flyTowardTargetGateValue = malice ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; - float extraTime = malice ? 90f : death ? 100f : revenge ? 105f : expertMode ? 110f : 120f; + float flyTowardTargetGateValue = bossRush ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float extraTime = bossRush ? 90f : death ? 100f : revenge ? 105f : expertMode ? 110f : 120f; float aiGateValue = flyTowardTargetGateValue + extraTime; if (!normalAI) aiGateValue -= extraTime * 0.3f; float explodeIntoGoreGateValue = aiGateValue + extraTime; float fallDownGateValue = aiGateValue + extraTime * 0.5f; - float maxVelocity = malice ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + float maxVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; if (NPC.ai[0] == 0f) { @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.OldDuke Vector2 vector17 = Main.player[NPC.target].Center - NPC.Center; vector17.Normalize(); vector17 *= scaleFactor2; - float inertia = malice ? 16f : death ? 18f : revenge ? 20f : expertMode ? 22f : 25f; + float inertia = bossRush ? 16f : death ? 18f : revenge ? 20f : expertMode ? 22f : 25f; NPC.velocity = (NPC.velocity * (inertia - 1f) + vector17) / inertia; NPC.velocity.Normalize(); NPC.velocity *= scaleFactor2; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 74b4e6e4c8..c273204b07 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 32dfb3176e..1bc3701abf 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 33bf7a3c4f..ea12831490 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index d43b96a4c7..53b06b9821 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -103,13 +103,13 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Enrage - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -117,12 +117,12 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || bossRush)) enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || malice)) + if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) enrageScale += 1f; // Percent life remaining @@ -300,7 +300,7 @@ namespace CalamityMod.NPCs.Perforator float num18 = speed; float num19 = turnSpeed; - float burrowDistance = malice ? 500f : 800f; + float burrowDistance = bossRush ? 500f : 800f; float burrowTarget = player.Center.Y + burrowDistance; float lungeTarget = player.Center.Y - 600f; Vector2 vector3 = NPC.Center; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index df6d755746..f6306132a2 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -87,15 +87,15 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if ((NPC.position.Y / 16f) < Main.worldSurface || malice) + float enrageScale = bossRush ? 1f : 0f; + if ((NPC.position.Y / 16f) < Main.worldSurface || bossRush) enrageScale += 1f; - if (!Main.player[NPC.target].ZoneCrimson || malice) + if (!Main.player[NPC.target].ZoneCrimson || bossRush) enrageScale += 1f; // Percent life remaining diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 7150d4512f..9c19b19c80 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -99,13 +99,13 @@ namespace CalamityMod.NPCs.Perforator public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Enrage - if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + if ((!Main.player[NPC.target].ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -113,12 +113,12 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && (!Main.player[NPC.target].ZoneCrimson || bossRush)) enrageScale += 1f; - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || malice)) + if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) enrageScale += 1f; // Percent life remaining diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 266107eff6..0036fb261e 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -117,13 +117,13 @@ namespace CalamityMod.NPCs.Perforator if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) NPC.TargetClosest(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Variables for ichor blob phase - float blobPhaseGateValue = malice ? 450f : 600f; + float blobPhaseGateValue = bossRush ? 450f : 600f; bool floatAboveToFireBlobs = NPC.ai[2] >= blobPhaseGateValue - 120f; // Don't deal damage for 3 seconds after spawning or while firing blobs @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.Perforator bool phase2 = lifeRatio < 0.7f; // Enrage - if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !BossRushEvent.BossRushActive) + if ((!player.ZoneCrimson || (NPC.position.Y / 16f) < Main.worldSurface) && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -153,17 +153,17 @@ namespace CalamityMod.NPCs.Perforator else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (biomeEnraged && (!player.ZoneCrimson || malice)) + float enrageScale = bossRush ? 1f : 0f; + if (biomeEnraged && (!player.ZoneCrimson || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || malice)) + if (biomeEnraged && ((NPC.position.Y / 16f) < Main.worldSurface || bossRush)) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -283,7 +283,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || malice || floatAboveToFireBlobs) + if (wormsAlive == 0 || bossRush || floatAboveToFireBlobs) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -291,7 +291,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.ai[2] < blobPhaseGateValue + 300f) { if (NPC.velocity.Length() > 0.5f) - NPC.velocity *= malice ? 0.94f : 0.96f; + NPC.velocity *= bossRush ? 0.94f : 0.96f; else NPC.ai[2] = blobPhaseGateValue + 300f; } @@ -325,7 +325,7 @@ namespace CalamityMod.NPCs.Perforator { Vector2 blobVelocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); blobVelocity.Normalize(); - blobVelocity *= Main.rand.Next(400, 801) * (malice ? 0.02f : 0.01f); + blobVelocity *= Main.rand.Next(400, 801) * (bossRush ? 0.02f : 0.01f); float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.5f; if (blobVelocity.Y < 2f) diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index dc1dcba97f..ef0c0deeff 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 07746f1659..ae6a6624f4 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index b4723783d8..56fb0878b2 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 5020e029f3..9e6324b219 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -45,10 +45,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; Lighting.AddLight(NPC.Center, 0.015f, 0.1f, 0f); @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.localAI[1] += 1f; float timeBeforeExploding = 480f + NPC.ai[3] * 2f; - float homingDuration = (malice ? 430f : death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; + float homingDuration = (bossRush ? 430f : death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; if (NPC.localAI[1] == timeBeforeExploding) { CheckDead(); @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.noTileCollide = false; - if (NPC.velocity.Length() < (malice ? 25f : 20f)) + if (NPC.velocity.Length() < (bossRush ? 25f : 20f)) NPC.velocity *= 1.01f; if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 46d36bf159..ae646fe37e 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -43,9 +43,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; Lighting.AddLight(NPC.Center, 0.03f, 0.2f, 0f); @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vector = Main.player[NPC.target].Center - NPC.Center; float distanceRequiredForExplosion = 90f; - float timeBeforeExplosion = (malice ? 1000f : death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; + float timeBeforeExplosion = (bossRush ? 1000f : death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; if (vector.Length() < distanceRequiredForExplosion || NPC.ai[0] >= timeBeforeExplosion) { CheckDead(); @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } NPC.TargetClosest(true); - float velocity = (malice ? 14f : death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; + float velocity = (bossRush ? 14f : death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; Vector2 vector167 = new Vector2(NPC.Center.X + (float)(NPC.direction * 20), NPC.Center.Y + 6f); float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X; float num1374 = player.Center.Y - vector167.Y; @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float num1376 = velocity / num1375; num1373 *= num1376; num1374 *= num1376; - float inertia = (malice ? 35f : death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; + float inertia = (bossRush ? 35f : death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; NPC.velocity.X = (NPC.velocity.X * inertia + num1373) / (inertia + 1f); NPC.velocity.Y = (NPC.velocity.Y * inertia + num1374) / (inertia + 1f); } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index ad84a9654b..cd69619650 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -144,10 +144,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.height = (int)(NPC.frame.Height * (charging ? 1.5f : 1.8f)); // Mode variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 distFromPlayer = player.Center - vectorCenter; // Enrage - if (!player.ZoneJungle && !BossRushEvent.BossRushActive) + if (!player.ZoneJungle && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -233,12 +233,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; float enrageScale = death ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + NPC.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1.5f; } @@ -248,10 +248,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.getGoodWorld) enrageScale += 0.5f; - if (BossRushEvent.BossRushActive) + if (bossRush) enrageScale = 2f; - bool diagonalDash = (revenge && phase2) || malice; + bool diagonalDash = (revenge && phase2) || bossRush; if (NPC.ai[0] != 0f && NPC.ai[0] != 4f) NPC.rotation = NPC.velocity.X * 0.02f; @@ -579,7 +579,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath calamityGlobalNPC.newAI[0] += 1f; if (num1057 < 600f || calamityGlobalNPC.newAI[0] >= 180f) { - NPC.ai[0] = (phase3 || malice) ? 5f : 1f; + NPC.ai[0] = (phase3 || bossRush) ? 5f : 1f; NPC.ai[1] = 0f; calamityGlobalNPC.newAI[0] = 0f; NPC.netUpdate = true; @@ -879,12 +879,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity.Normalize(); baseVelocity *= speed; - int missiles = malice ? 16 : MissileProjectiles; - int spread = malice ? 18 : 24; + int missiles = bossRush ? 16 : MissileProjectiles; + int spread = bossRush ? 18 : 24; for (int i = 0; i < missiles; i++) { - Vector2 spawn = vectorCenter; // Normal = 96, Malice = 144 - spawn.X += i * (int)(spread * 1.125) - (missiles * (spread / 2)); // Normal = -96 to 93, Malice = -144 to 156 + Vector2 spawn = vectorCenter; // Normal = 96, Boss Rush = 144 + spawn.X += i * (int)(spread * 1.125) - (missiles * (spread / 2)); // Normal = -96 to 93, Boss Rush = -144 to 156 Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / missiles))); Projectile.NewProjectile(NPC.GetSource_FromAI(), spawn, velocity, type, damage, 0f, Main.myPlayer, nukeBarrageChallengeAmt, player.position.Y); } @@ -1025,7 +1025,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath acceleration *= 0.1f * enrageScale + 1f; velocity *= 1f - enrageScale * 0.1f; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) velocity *= 0.5f; deceleration *= 1f - enrageScale * 0.1f; diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 09b41a265a..5df145daed 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -87,10 +87,10 @@ namespace CalamityMod.NPCs.Polterghast { CalamityGlobalNPC.ghostBossClone = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active) { @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.Polterghast float velocity = 3f; float acceleration = 0.03f; - if (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0) + if (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0) { despawnTimer--; if (despawnTimer <= 0) @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.Polterghast } // Predictiveness - Vector2 predictionVector = chargePhase && malice ? player.velocity * 20f : Vector2.Zero; + Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; Vector2 lookAt = player.Center + predictionVector; Vector2 rotationVector = lookAt - vector; @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.Polterghast float num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || malice) + if (speedBoost || bossRush) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index a63b342db7..0bc0d0fa1d 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -158,12 +158,12 @@ namespace CalamityMod.NPCs.Polterghast // Variables Vector2 vector = NPC.Center; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; bool speedBoost = false; bool despawnBoost = false; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Phases bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType(), NPC.whoAmI, 0f, 0f, 0f, 0f, 255); } - if (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0) + if (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0) { despawnTimer--; if (despawnTimer <= 0) @@ -357,10 +357,10 @@ namespace CalamityMod.NPCs.Polterghast if (nearbyActiveTiles < 1000) tileEnrageMult += (1000 - nearbyActiveTiles) * 0.00075f; // Ranges from 1f to 1.75f - if (malice) + if (bossRush) tileEnrageMult = 1.75f; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && tileEnrageMult >= 1.6f; + NPC.Calamity().CurrentlyEnraged = !bossRush && tileEnrageMult >= 1.6f; // Used to inform clone and hooks about number of active tiles nearby NPC.ai[3] = tileEnrageMult; @@ -380,7 +380,7 @@ namespace CalamityMod.NPCs.Polterghast baseProjectileVelocity *= 1.25f; // Predictiveness - Vector2 predictionVector = chargePhase && malice ? player.velocity * 20f : Vector2.Zero; + Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; Vector2 lookAt = player.Center + predictionVector; Vector2 rotationVector = lookAt - vector; @@ -430,7 +430,7 @@ namespace CalamityMod.NPCs.Polterghast float num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || malice) + if (speedBoost || bossRush) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 41b442801c..454fb809fa 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -112,10 +112,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians { CalamityGlobalNPC.doughnutBoss = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Become immune over time if target isn't in hell or hallow bool isHoly = player.ZoneHallow; bool isHell = player.ZoneUnderworldHeight; - if (!isHoly && !isHell && !BossRushEvent.BossRushActive) + if (!isHoly && !isHell && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -240,7 +240,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians phase1 = true; } - float inertia = (malice || biomeEnraged) ? 45f : death ? 50f : revenge ? 52f : expertMode ? 55f : 60f; + float inertia = (bossRush || biomeEnraged) ? 45f : death ? 50f : revenge ? 52f : expertMode ? 55f : 60f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) @@ -259,13 +259,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = NPC.direction; } - float velocity = (malice || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; Vector2 targetVector = player.Center - vectorCenter; targetVector = Vector2.Normalize(targetVector) * velocity; - float phaseGateValue = (malice || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = (bossRush || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; if (defenderAlive) phaseGateValue *= 1.5f; @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { - float divisor = (malice || biomeEnraged) ? 30f : death ? 40f : revenge ? 44f : expertMode ? 50f : 60f; + float divisor = (bossRush || biomeEnraged) ? 30f : death ? 40f : revenge ? 44f : expertMode ? 50f : 60f; if (!phase1) divisor = (float)Math.Round(divisor * 0.8f); @@ -338,7 +338,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.netUpdate = true; Vector2 velocity = new Vector2(NPC.ai[2], NPC.ai[3]); velocity.Normalize(); - velocity *= (malice || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + velocity *= (bossRush || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (defenderAlive) velocity *= 0.8f; if (Main.getGoodWorld) @@ -356,7 +356,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] += 1f; - float projectileGateValue = (malice || biomeEnraged) ? 30f : death ? 35f : revenge ? 37f : expertMode ? 40f : 45f; + float projectileGateValue = (bossRush || biomeEnraged) ? 30f : death ? 35f : revenge ? 37f : expertMode ? 40f : 45f; if (NPC.localAI[0] >= projectileGateValue && Vector2.Distance(vectorCenter, player.Center) > 160f) { NPC.localAI[0] = 0f; @@ -384,7 +384,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians break; } - if (malice || biomeEnraged) + if (bossRush || biomeEnraged) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; @@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } NPC.ai[1] += 1f; - float phaseGateValue = (malice || biomeEnraged) ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float phaseGateValue = (bossRush || biomeEnraged) ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 4bf95f3dda..dc68d26d55 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -152,15 +152,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians Player player = Main.player[Main.npc[CalamityGlobalNPC.doughnutBoss].target]; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; bool isHoly = player.ZoneHallow; bool isHell = player.ZoneUnderworldHeight; // Become immune over time if target isn't in hell or hallow - if (!isHoly && !isHell && !BossRushEvent.BossRushActive) + if (!isHoly && !isHell && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.ai[3] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { - float divisor = (malice || biomeEnraged) ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; + float divisor = (bossRush || biomeEnraged) ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; if (NPC.ai[3] % divisor == 0f) { SoundEngine.PlaySound(SoundID.Item20, NPC.position); @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } Vector2 targetVector = player.Center - NPC.Center; - float phaseGateValue = (malice || biomeEnraged) ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; + float phaseGateValue = (bossRush || biomeEnraged) ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; if (NPC.ai[3] >= phaseGateValue && !healerAlive) { NPC.ai[0] = 1f; @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.netUpdate = true; Vector2 velocity = new Vector2(NPC.ai[2], NPC.ai[3]); velocity.Normalize(); - velocity *= (malice || biomeEnraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + velocity *= (bossRush || biomeEnraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; if (Main.getGoodWorld) velocity *= 1.15f; @@ -269,7 +269,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] += 1f; - float projectileGateValue = (malice || biomeEnraged) ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; + float projectileGateValue = (bossRush || biomeEnraged) ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; if (NPC.localAI[0] >= projectileGateValue && Vector2.Distance(NPC.Center, player.Center) > 160f) { NPC.localAI[0] = 0f; @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } NPC.ai[1] += 1f; - float phaseGateValue = (malice || biomeEnraged) ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; + float phaseGateValue = (bossRush || biomeEnraged) ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -307,7 +307,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (targetVector.HasNaNs()) targetVector = new Vector2(NPC.direction, 0f); - float inertia = (malice || biomeEnraged) ? 35f : death ? 40f : revenge ? 42f : expertMode ? 45f : 50f; + float inertia = (bossRush || biomeEnraged) ? 35f : death ? 40f : revenge ? 42f : expertMode ? 45f : 50f; float num1006 = 0.111111117f * inertia; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + num1006)) / inertia; } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index d0d751114a..2485815df7 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -217,13 +217,13 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Night bool - bool malice = CalamityWorld.malice; - bool nightTime = !Main.dayTime || malice; + bool bossRush = BossRushEvent.BossRushActive; + bool nightTime = !Main.dayTime || bossRush; // Difficulty bools - bool death = CalamityWorld.death || BossRushEvent.BossRushActive || nightTime; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive || nightTime; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive || nightTime; + bool death = CalamityWorld.death || nightTime; + bool revenge = CalamityWorld.revenge || nightTime; + bool expertMode = Main.expertMode || nightTime; // Target's current biome bool isHoly = player.ZoneHallow; @@ -257,7 +257,7 @@ namespace CalamityMod.NPCs.Providence if (nightTime) projectileDamageMult = 2; - NPC.Calamity().CurrentlyEnraged = (!BossRushEvent.BossRushActive && (nightTime || malice)) || biomeEnrageTimer <= 0; + NPC.Calamity().CurrentlyEnraged = (!bossRush && nightTime) || biomeEnrageTimer <= 0; // Projectile damage values int holyLaserDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; @@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.Providence float baseSpearRate = 18f; float spearRate = 1f + spearRateIncrease; - if (BossRushEvent.BossRushActive) + if (bossRush) spearRate += bossRushSpearRateIncrease; // Projectile fire rate multiplier @@ -309,8 +309,8 @@ namespace CalamityMod.NPCs.Providence // Inflict Holy Inferno if target is too far away float baseDistance = 2800f; - float shorterFlameCocoonDistance = (CalamityWorld.death || BossRushEvent.BossRushActive || nightTime) ? 2200f : CalamityWorld.revenge ? 2400f : Main.expertMode ? 2600f : baseDistance; - float shorterSpearCocoonDistance = (CalamityWorld.death || BossRushEvent.BossRushActive || nightTime) ? 1800f : CalamityWorld.revenge ? 2150f : Main.expertMode ? 2500f : baseDistance; + float shorterFlameCocoonDistance = death ? 2200f : CalamityWorld.revenge ? 2400f : Main.expertMode ? 2600f : baseDistance; + float shorterSpearCocoonDistance = death ? 1800f : CalamityWorld.revenge ? 2150f : Main.expertMode ? 2500f : baseDistance; float shorterDistance = AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; float maxDistance = (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) ? shorterDistance : baseDistance; if (Vector2.Distance(player.Center, vector) > maxDistance) @@ -389,7 +389,7 @@ namespace CalamityMod.NPCs.Providence } // Become immune over time if target isn't in hell or hallow - if (!isHoly && !isHell && !BossRushEvent.BossRushActive) + if (!isHoly && !isHell && !bossRush) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.Providence biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; // Take damage or not - bool biomeEnraged = biomeEnrageTimer <= 0 || malice; + bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; NPC.dontTakeDamage = Dying; // Do the death animation once killed. @@ -561,7 +561,7 @@ namespace CalamityMod.NPCs.Providence float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost; float velocity = (expertMode ? 16f : 15f) + velocityBoost; - if (BossRushEvent.BossRushActive || nightTime) + if (nightTime) { acceleration = 1.5f; velocity = 25f; @@ -632,8 +632,8 @@ namespace CalamityMod.NPCs.Providence int phase = 0; // Holy ray in hallow, Crystal in hell - bool useLaser = (phase2 && biomeType == 1) || BossRushEvent.BossRushActive; - bool useCrystal = (phase2 && biomeType == 2) || BossRushEvent.BossRushActive; + bool useLaser = (phase2 && biomeType == 1) || bossRush; + bool useCrystal = (phase2 && biomeType == 2) || bossRush; // Unique pattern for Death Mode and Boss Rush if (death) @@ -888,7 +888,7 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(6f * (1f - lifeRatio)) : (int)Math.Round(5f * (1f - lifeRatio)); int num864 = (expertMode ? 36 : 39) - shootBoost; - if (BossRushEvent.BossRushActive || biomeEnraged) + if (bossRush || biomeEnraged) num864 = 27; num864 = (int)(num864 * attackRateMult); @@ -1104,7 +1104,7 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(5f * (1f - lifeRatio)) : (int)Math.Round(4f * (1f - lifeRatio)); int num856 = (expertMode ? 24 : 26) - shootBoost; - if (BossRushEvent.BossRushActive || biomeEnraged) + if (bossRush || biomeEnraged) num856 = 18; num856 = (int)(num856 * attackRateMult); @@ -1121,7 +1121,7 @@ namespace CalamityMod.NPCs.Providence float shootBoost2 = death ? 4f * (1f - lifeRatio) : 2.5f * (1f - lifeRatio); float num860 = (expertMode ? 10.25f : 9f) + shootBoost2; - if (BossRushEvent.BossRushActive) + if (bossRush) num860 = 12.75f; if (revenge) @@ -1444,12 +1444,12 @@ namespace CalamityMod.NPCs.Providence float aiTimer = NPC.ai[3]; // Night bool - bool malice = CalamityWorld.malice; - bool nightTime = !Main.dayTime || malice; + bool bossRush = BossRushEvent.BossRushActive; + bool nightTime = !Main.dayTime || bossRush; float baseDistance = 2800f; - float shorterFlameCocoonDistance = (CalamityWorld.death || BossRushEvent.BossRushActive || nightTime) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; - float shorterSpearCocoonDistance = (CalamityWorld.death || BossRushEvent.BossRushActive || nightTime) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; + float shorterFlameCocoonDistance = (CalamityWorld.death || nightTime) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; + float shorterSpearCocoonDistance = (CalamityWorld.death || nightTime) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; float shorterDistance = AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; bool guardianAlive = false; @@ -1571,7 +1571,7 @@ namespace CalamityMod.NPCs.Providence npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); - return CalamityWorld.malice || !prov.hasTakenDaytimeDamage; + return !prov.hasTakenDaytimeDamage; }, ModContent.ItemType(), 1, 3, 4); // Normal drops: Everything that would otherwise be in the bag @@ -1645,8 +1645,8 @@ namespace CalamityMod.NPCs.Providence { void drawProvidenceInstance(Vector2 drawOffset, Color? colorOverride) { - bool malice = CalamityWorld.malice; - bool nightTime = !Main.dayTime || malice; + bool bossRush = BossRushEvent.BossRushActive; + bool nightTime = !Main.dayTime || bossRush; string baseTextureString = "CalamityMod/NPCs/Providence/"; string baseGlowTextureString = baseTextureString + "Glowmasks/"; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 25b73f9654..a2eeed31df 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -122,12 +122,10 @@ namespace CalamityMod.NPCs.Ravager { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -202,7 +200,7 @@ namespace CalamityMod.NPCs.Ravager if (immunePhase) { NPC.dontTakeDamage = true; - if (malice) + if (bossRush) { if (Main.netMode != NetmodeID.Server) { @@ -388,11 +386,11 @@ namespace CalamityMod.NPCs.Ravager if (revenge) { - float multiplier = malice ? 0.003f : 0.0015f; + float multiplier = bossRush ? 0.003f : 0.0015f; if (distanceBelowTarget > 0f) calamityGlobalNPC.newAI[1] += 1f + distanceBelowTarget * multiplier; - float speedMultLimit = malice ? 3f : 2f; + float speedMultLimit = bossRush ? 3f : 2f; if (calamityGlobalNPC.newAI[1] > speedMultLimit) calamityGlobalNPC.newAI[1] = speedMultLimit; @@ -544,7 +542,7 @@ namespace CalamityMod.NPCs.Ravager if (phase2) { - float stopBeforeFallTime = malice ? 25f : 30f; + float stopBeforeFallTime = bossRush ? 25f : 30f; if (!anyHeadActive) stopBeforeFallTime -= 15f; else if (expertMode) @@ -558,7 +556,7 @@ namespace CalamityMod.NPCs.Ravager else { float fallSpeedBoost = !anyHeadActive ? 1.8f : death ? 1.8f * (1f - lifeRatio) : 1.2f * (1f - lifeRatio); - float fallSpeed = (malice ? 1.8f : 1.2f) + fallSpeedBoost; + float fallSpeed = (bossRush ? 1.8f : 1.2f) + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -575,7 +573,7 @@ namespace CalamityMod.NPCs.Ravager if (NPC.Bottom.Y < player.position.Y) { float fallSpeedBoost = !anyHeadActive ? 0.9f : death ? 0.9f * (1f - lifeRatio) : 0.6f * (1f - lifeRatio); - float fallSpeed = (malice ? 0.9f : 0.6f) + fallSpeedBoost; + float fallSpeed = (bossRush ? 0.9f : 0.6f) + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -586,7 +584,7 @@ namespace CalamityMod.NPCs.Ravager } else { - float velocityMult = malice ? 2f : 1.8f; + float velocityMult = bossRush ? 2f : 1.8f; float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.001f; float velocityXBoost = !anyHeadActive ? 6f : death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); @@ -636,7 +634,7 @@ namespace CalamityMod.NPCs.Ravager { float gravity = phase2 ? 0f : 0.45f; float maxFallSpeed = reduceFallSpeed ? 12f : phase2 ? 24f : 15f; - if (malice && !reduceFallSpeed) + if (bossRush && !reduceFallSpeed) { gravity *= 1.25f; maxFallSpeed *= 1.25f; @@ -657,7 +655,7 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[NPC.target]; } - int distanceFromTarget = player.dead ? 1600 : malice ? 8400 : 5600; + int distanceFromTarget = player.dead ? 1600 : bossRush ? 8400 : 5600; if (Vector2.Distance(NPC.Center, player.Center) > distanceFromTarget) { NPC.TargetClosest(); diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index addf4ba1e3..60c553fa76 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -65,9 +65,9 @@ namespace CalamityMod.NPCs.Ravager Player player = Main.player[Main.npc[CalamityGlobalNPC.scavenger].target]; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool provy = DownedBossSystem.downedProvidence && !bossRush; if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.Ravager NPC.rotation = num803; NPC.ai[1] += 1f; - bool fireProjectiles = NPC.ai[1] >= (malice ? 240f : 480f); + bool fireProjectiles = NPC.ai[1] >= (bossRush ? 240f : 480f); if (fireProjectiles && Vector2.Distance(NPC.Center, player.Center) > 80f) { int type = ModContent.ProjectileType(); diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 25bfda9a41..b2b95b13d5 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Ravager } NPC.noTileCollide = true; - NPC.velocity.X = ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 15 : 12) * NPC.direction; + NPC.velocity.X = (BossRushEvent.BossRushActive ? 15 : 12) * NPC.direction; NPC.velocity.Y = -28.5f; NPC.ai[0] = 1f; NPC.ai[1] = 0f; diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 05af6b6543..6456775fa9 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.Signus bool revenge = CalamityWorld.revenge; float playerDistNormMult = revenge ? 24f : 22f; - if (BossRushEvent.BossRushActive || CalamityWorld.malice) + if (BossRushEvent.BossRushActive) playerDistNormMult = 30f; CalamityAI.DungeonSpiritAI(NPC, Mod, playerDistNormMult, 0f, true); } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 63e676964b..11de13c8cd 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -110,10 +110,10 @@ namespace CalamityMod.NPCs.Signus CalamityGlobalNPC.signus = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; Vector2 vectorCenter = NPC.Center; @@ -122,8 +122,8 @@ namespace CalamityMod.NPCs.Signus lifeToAlpha = (int)((Main.getGoodWorld ? 200D : 100D) * (1D - lifeRatio)); int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; int maxTeleports = (death && lifeRatio < 0.9) ? 1 : revenge ? 2 : expertMode ? 3 : 4; - float inertia = malice ? 9f : death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; - float chargeVelocity = malice ? 16f : death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; + float inertia = bossRush ? 9f : death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; + float chargeVelocity = bossRush ? 16f : death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; if (Main.getGoodWorld) { inertia *= 0.5f; @@ -134,8 +134,6 @@ namespace CalamityMod.NPCs.Signus bool phase3 = lifeRatio < 0.5f; bool phase4 = lifeRatio < 0.33f; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; - NPC.damage = NPC.defDamage; // Get a target @@ -209,7 +207,7 @@ namespace CalamityMod.NPCs.Signus if (phase3 || revenge) NPC.knockBackResist = 0f; - float speed = malice ? 20f : revenge ? 15f : expertMode ? 14f : 12f; + float speed = bossRush ? 20f : revenge ? 15f : expertMode ? 14f : 12f; if (expertMode) speed += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -248,7 +246,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.localAI[1] += malice ? 1.5f : 1f; + NPC.localAI[1] += bossRush ? 1.5f : 1f; if (expertMode) NPC.localAI[1] += death ? 3f * (float)(1D - lifeRatio) : 2f * (float)(1D - lifeRatio); @@ -311,7 +309,7 @@ namespace CalamityMod.NPCs.Signus Main.dust[dust].fadeIn = 1f; } - NPC.alpha += malice ? 3 : 2; + NPC.alpha += bossRush ? 3 : 2; if (expertMode) NPC.alpha += death ? (int)Math.Round(4.5D * (1D - lifeRatio)) : (int)Math.Round(3D * (1D - lifeRatio)); @@ -411,7 +409,7 @@ namespace CalamityMod.NPCs.Signus NPC.direction = playerLocation < 0f ? 1 : -1; NPC.spriteDirection = NPC.direction; - float divisor = expertMode ? (malice ? 10f : death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; + float divisor = expertMode ? (bossRush ? 10f : death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; float scytheBarrageTime = divisor * 3f; float scytheBarrageCooldown = divisor * 3f; @@ -441,8 +439,8 @@ namespace CalamityMod.NPCs.Signus } } - float maxVelocityY = malice ? 1.5f : death ? 2.5f : 3f; - float maxVelocityX = malice ? 5f : death ? 7f : 8f; + float maxVelocityY = bossRush ? 1.5f : death ? 2.5f : 3f; + float maxVelocityX = bossRush ? 5f : death ? 7f : 8f; if (NPC.position.Y > player.position.Y - 250f) { @@ -534,7 +532,7 @@ namespace CalamityMod.NPCs.Signus if (calamityGlobalNPC.newAI[0] == 0f) // Line up the charge { - float velocity = malice ? 18f : revenge ? 16f : expertMode ? 15f : 14f; + float velocity = bossRush ? 18f : revenge ? 16f : expertMode ? 15f : 14f; if (expertMode) velocity += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); diff --git a/NPCs/SlimeGod/CrimulanSlimeGod.cs b/NPCs/SlimeGod/CrimulanSlimeGod.cs index 5fc2fc5285..22e5ea70c1 100644 --- a/NPCs/SlimeGod/CrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/CrimulanSlimeGod.cs @@ -64,11 +64,10 @@ namespace CalamityMod.NPCs.SlimeGod public override void AI() { CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -134,7 +133,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.localAI[1] = 0f; enraged = true; } - if (malice) + if (bossRush) { enraged = true; } @@ -145,7 +144,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.defense = NPC.defDefense * 2; } - float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (malice ? 0.008f : 0.005f); + float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (bossRush ? 0.008f : 0.005f); if (NPC.ai[0] == 0f) { @@ -365,7 +364,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noGravity = true; NPC.velocity.Y += 0.5f; - float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; + float velocityLimit = bossRush ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (NPC.velocity.Y > velocityLimit) NPC.velocity.Y = velocityLimit; } diff --git a/NPCs/SlimeGod/EbonianSlimeGod.cs b/NPCs/SlimeGod/EbonianSlimeGod.cs index 403385b925..382cc4fabd 100644 --- a/NPCs/SlimeGod/EbonianSlimeGod.cs +++ b/NPCs/SlimeGod/EbonianSlimeGod.cs @@ -61,11 +61,10 @@ namespace CalamityMod.NPCs.SlimeGod public override void AI() { CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -132,13 +131,13 @@ namespace CalamityMod.NPCs.SlimeGod enraged = true; hyperMode = true; } - if (malice) + if (bossRush) { enraged = true; hyperMode = true; } - float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (malice ? 0.008f : 0.005f); + float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (bossRush ? 0.008f : 0.005f); if (NPC.ai[0] == 0f) { @@ -378,7 +377,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noGravity = true; NPC.velocity.Y += 0.5f; - float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; + float velocityLimit = bossRush ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (NPC.velocity.Y > velocityLimit) NPC.velocity.Y = velocityLimit; } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 6398f110c0..a37a10aa2e 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -114,11 +114,10 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC.slimeGod = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -146,7 +145,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = NPC.defDamage; // Enrage based on large slimes - bool phase2 = lifeRatio < 0.4f || malice; + bool phase2 = lifeRatio < 0.4f || bossRush; bool hyperMode = true; bool purpleSlimeAlive = false; bool redSlimeAlive = false; @@ -188,11 +187,11 @@ namespace CalamityMod.NPCs.SlimeGod } // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (BossRushEvent.BossRushActive ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (BossRushEvent.BossRushActive ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) { if (NPC.velocity.Y < -3f) NPC.velocity.Y = -3f; @@ -231,7 +230,7 @@ namespace CalamityMod.NPCs.SlimeGod else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float ai1 = malice ? 210f : hyperMode ? 270f : 360f; + float ai1 = bossRush ? 210f : hyperMode ? 270f : 360f; // Hide inside large slime if (!hyperMode && NPC.ai[1] < ai1) @@ -429,14 +428,14 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.getGoodWorld) chargeVelocity *= 1.25f; - NPC.velocity = Vector2.Normalize(player.Center + (malice ? player.velocity * 20f : Vector2.Zero) - NPC.Center) * chargeVelocity; + NPC.velocity = Vector2.Normalize(player.Center + (bossRush ? player.velocity * 20f : Vector2.Zero) - NPC.Center) * chargeVelocity; NPC.TargetClosest(); return; } if (Main.netMode != NetmodeID.MultiplayerClient) { - float divisor = malice ? 10f : 15f; + float divisor = bossRush ? 10f : 15f; if (NPC.ai[1] % divisor == 0f && Vector2.Distance(player.Center, NPC.Center) > 160f) { SoundEngine.PlaySound(SoundID.Item33, NPC.Center); @@ -493,7 +492,7 @@ namespace CalamityMod.NPCs.SlimeGod float flySpeed = death ? 14f : revenge ? 11f : expertMode ? 8.5f : 6f; if (phase2) flySpeed = revenge ? 18f : expertMode ? 16f : 14f; - if (hyperMode || malice) + if (hyperMode || bossRush) flySpeed *= 1.25f; if (Main.getGoodWorld) flySpeed *= 1.25f; diff --git a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs index 1df1ce4a59..2f7d59a446 100644 --- a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs @@ -86,11 +86,10 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodRed < 0 || !Main.npc[CalamityGlobalNPC.slimeGodRed].active) CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -144,7 +143,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.localAI[1] = 0f; enraged = true; } - if (malice) + if (bossRush) { enraged = true; } @@ -155,7 +154,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.defense = NPC.defDefense * 2; } - float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (malice ? 0.008f : 0.005f); + float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (bossRush ? 0.008f : 0.005f); if (NPC.ai[0] == 0f) { @@ -365,7 +364,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noGravity = true; NPC.velocity.Y += 0.5f; - float velocityLimit = malice ? 22f : death ? 16f : revenge ? 15f : expertMode ? 14f : 13f; + float velocityLimit = bossRush ? 22f : death ? 16f : revenge ? 15f : expertMode ? 14f : 13f; if (NPC.velocity.Y > velocityLimit) NPC.velocity.Y = velocityLimit; } diff --git a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs index d9c023fac1..55eb20cb62 100644 --- a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs +++ b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs @@ -86,11 +86,10 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodPurple < 0 || !Main.npc[CalamityGlobalNPC.slimeGodPurple].active) CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -146,13 +145,13 @@ namespace CalamityMod.NPCs.SlimeGod hyperMode = true; enraged = true; } - if (malice) + if (bossRush) { enraged = true; hyperMode = true; } - float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (malice ? 0.008f : 0.005f); + float distanceSpeedBoost = Vector2.Distance(player.Center, NPC.Center) * (bossRush ? 0.008f : 0.005f); if (NPC.ai[0] == 0f) { @@ -383,7 +382,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noGravity = true; NPC.velocity.Y += 0.5f; - float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; + float velocityLimit = bossRush ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (NPC.velocity.Y > velocityLimit) NPC.velocity.Y = velocityLimit; } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 004e7e72af..b838cff4d2 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -92,10 +92,10 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a barrage of lasers every 5 seconds - float laserBarrageGateValue = malice ? 200f : 300f; + float laserBarrageGateValue = bossRush ? 200f : 300f; if (Main.npc[(int)NPC.ai[2]].localAI[0] % laserBarrageGateValue == 0f) { float bodySegmentDivisor = death ? 6 : revenge ? 5 : expertMode ? 4 : 3; @@ -245,10 +245,10 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -257,7 +257,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -309,10 +309,10 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 84b0cba126..07ff8be47f 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -104,7 +104,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.noTileCollide = true; NPC.netAlways = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -161,11 +161,10 @@ namespace CalamityMod.NPCs.StormWeaver { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; if (!Main.raining) CalamityUtils.StartRain(); @@ -313,8 +312,8 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 npcCenter = NPC.Center; float targetCenterX = Main.player[NPC.target].Center.X; float targetCenterY = Main.player[NPC.target].Center.Y; - float velocity = (phase2 ? 12f : 10f) + (malice ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); - float acceleration = (phase2 ? 0.24f : 0.2f) + (malice ? 0.12f : revenge ? 0.08f : expertMode ? 0.04f : 0f); + float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); + float acceleration = (phase2 ? 0.24f : 0.2f) + (bossRush ? 0.12f : revenge ? 0.08f : expertMode ? 0.04f : 0f); // Start charging at the player when in phase 2 if (phase2) @@ -326,7 +325,7 @@ namespace CalamityMod.NPCs.StormWeaver bool useTornadoes = calamityGlobalNPC.newAI[3] % 2f != 0f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -783,10 +782,10 @@ namespace CalamityMod.NPCs.StormWeaver CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -795,7 +794,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -847,10 +846,10 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -858,7 +857,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 34eff4eae8..be515cbe57 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.malice || BossRushEvent.BossRushActive) + if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; else if (CalamityWorld.death) NPC.scale *= 1.2f; @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a lightning orb every 5 seconds - float spawnOrbGateValue = malice ? 200f : 300f; + float spawnOrbGateValue = bossRush ? 200f : 300f; if (Main.npc[(int)NPC.ai[2]].localAI[0] % spawnOrbGateValue == 0f) { int type = ProjectileID.CultistBossLightningOrb; @@ -237,10 +237,10 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -309,10 +309,10 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player player, int damage, bool crit) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.5f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = malice ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 8ade54b344..7ea9afb07a 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else NPC.alpha = HeadSegment.alpha; - AttackTimer += (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.5f : 1f; + AttackTimer += BossRushEvent.BossRushActive ? 1.5f : 1f; if (AttackTimer >= 900f) { AttackTimer = 0f; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 716f931137..445bb73802 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -188,8 +188,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 vector18 = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); float num191 = Main.player[NPC.target].position.X + (Main.player[NPC.target].width / 2); float num192 = Main.player[NPC.target].position.Y + (Main.player[NPC.target].height / 2); - float num188 = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 12.5f : 10f; - float num189 = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 0.125f : 0.1f; + float num188 = BossRushEvent.BossRushActive ? 12.5f : 10f; + float num189 = BossRushEvent.BossRushActive ? 0.125f : 0.1f; float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index d9be6b0d9a..4d82c35247 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.spriteDirection = (Target.Center.X < NPC.Center.X).ToDirectionInt(); timer++; - int shootRate = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 120 : 180; + int shootRate = BossRushEvent.BossRushActive ? 120 : 180; if (timer > shootRate) { for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 06992fcde8..138b530805 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -382,10 +382,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityMod.StopRain(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -419,7 +419,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!startText) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalSummonText"; if (DownedBossSystem.downedSCal) @@ -566,11 +566,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region Enrage and DR - if ((spawnArena && !player.Hitbox.Intersects(safeBox)) || malice) + if ((spawnArena && !player.Hitbox.Intersects(safeBox)) || bossRush) { float projectileVelocityMultCap = (!player.Hitbox.Intersects(safeBox) && spawnArena) ? 2f : 1.5f; uDieLul = MathHelper.Clamp(uDieLul * 1.01f, 1f, projectileVelocityMultCap); - protectionBoost = !malice; + protectionBoost = !bossRush; if (!player.Hitbox.Intersects(safeBox)) protectionBoost = true; } @@ -612,7 +612,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.GetLerpValue(0.1f, 0.6f, NPC.Opacity, true); if (NPC.alpha >= 230) { - if (DownedBossSystem.downedSCal && !BossRushEvent.BossRushActive) + if (DownedBossSystem.downedSCal && !bossRush) { // Create a teleport line effect Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, Color.Red); @@ -810,7 +810,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!startSecondAttack && lifeRatio <= 0.75f) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalBH2Text"; if (DownedBossSystem.downedSCal) @@ -874,7 +874,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Switch from the Grief section of Stained, Brutal Calamity to the Lament section. Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas2") ?? MusicID.Boss3; - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalBH3Text"; if (DownedBossSystem.downedSCal) @@ -947,7 +947,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Switch from the Lament section of Stained, Brutal Calamity to the Epiphany section. Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas3") ?? MusicID.LunarBoss; - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalBH4Text"; if (DownedBossSystem.downedSCal) @@ -1019,7 +1019,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SCalBH5Text"; - if (!BossRushEvent.BossRushActive) + if (!bossRush) { if (DownedBossSystem.downedSCal) key += "Rematch"; @@ -1046,7 +1046,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) NPC.velocity.X *= 0.96f; - if (DownedBossSystem.downedSCal && !BossRushEvent.BossRushActive) + if (DownedBossSystem.downedSCal && !bossRush) { if (giveUpCounter == 720) { @@ -1065,15 +1065,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.NPCLoot(); } } - else if (giveUpCounter == 900 && !BossRushEvent.BossRushActive) + else if (giveUpCounter == 900 && !bossRush) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText1", textColor); - else if(giveUpCounter == 600 && !BossRushEvent.BossRushActive) + else if(giveUpCounter == 600 && !bossRush) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText2", textColor); - else if(giveUpCounter == 300 && !BossRushEvent.BossRushActive) + else if(giveUpCounter == 300 && !bossRush) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText3", textColor); if (giveUpCounter <= 0) { - if (BossRushEvent.BossRushActive) + if (bossRush) { NPC.chaseable = true; NPC.dontTakeDamage = false; @@ -1112,7 +1112,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText4"; if (DownedBossSystem.downedSCal) @@ -1124,7 +1124,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired4 && lifeRatio <= 0.02f) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText3"; if (DownedBossSystem.downedSCal) @@ -1136,7 +1136,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired3 && lifeRatio <= 0.04f) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText2"; if (DownedBossSystem.downedSCal) @@ -1148,7 +1148,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired2 && lifeRatio <= 0.06f) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalDesparationText1"; if (DownedBossSystem.downedSCal) @@ -1217,7 +1217,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region TransformSeekerandBrotherTriggers if (!halfLife && lifeRatio <= 0.4f) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalPhase2Text"; if (DownedBossSystem.downedSCal) @@ -1231,7 +1231,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (!secondStage) { - if (!BossRushEvent.BossRushActive) + if (!bossRush) { string key = "Mods.CalamityMod.SCalSeekerRingText"; if (DownedBossSystem.downedSCal) @@ -2580,11 +2580,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); } - // One of the only Death-exclusive drops in the mod, as requested by Leviathan: Levi pet + // One of the only Death-exclusive drops in the mod, as requested by Leviathan: Levi pet and Gael's Greatsword npcLoot.AddIf(() => CalamityWorld.death, ModContent.ItemType()); - - // The only Malice-exclusive drop in the mod, as requested by Leviathan: Gael's Greatsword - npcLoot.AddIf(() => CalamityWorld.malice, ModContent.ItemType()); + npcLoot.AddIf(() => CalamityWorld.death, ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 10); diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 217b7f9631..52db1e73b5 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot fists. - float fireRate = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); + float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); PunchCounter += fireRate; if (PunchCounter >= PunchCounterLimit) { @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Shoot dart spreads. - fireRate = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); + fireRate = BossRushEvent.BossRushActive ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); DartBurstCounter += fireRate; if (DartBurstCounter >= DartBurstCounterLimit) { diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 5b4546f690..6dd587aee2 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot sword slashes. - float fireRate = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); + float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); SlashCounter += fireRate; if (SlashCounter >= SlashCounterLimit) { @@ -214,7 +214,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Shoot dart spreads. - fireRate = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); + fireRate = BossRushEvent.BossRushActive ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); DartBurstCounter += fireRate; if (DartBurstCounter >= DartBurstCounterLimit) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index 8812a4f670..dacb7e19b6 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -16,8 +16,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // whoAmI variable NPC.crimsonBoss = npc.whoAmI; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -27,15 +27,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) npc.TargetClosest(); - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface || malice) + float enrageScale = bossRush ? 1f : 0f; + if ((npc.position.Y / 16f) < Main.worldSurface || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (!Main.player[npc.target].ZoneCrimson || malice) + if (!Main.player[npc.target].ZoneCrimson || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoar, npc.position); // Velocity - npc.velocity = Vector2.Normalize(Main.player[npc.target].Center + (malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * ((death ? 20f : 16f) + 4f * enrageScale); + npc.velocity = Vector2.Normalize(Main.player[npc.target].Center + (bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * ((death ? 20f : 16f) + 4f * enrageScale); if (Main.getGoodWorld) npc.velocity *= 1.15f; } @@ -543,7 +543,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } // Despawn - if (Main.player[npc.target].dead && !BossRushEvent.BossRushActive) + if (Main.player[npc.target].dead && !bossRush) { if (npc.localAI[3] < 120f) npc.localAI[3] += 1f; @@ -571,17 +571,17 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses return false; } - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface || malice) + float enrageScale = bossRush ? 1f : 0f; + if ((npc.position.Y / 16f) < Main.worldSurface || bossRush) enrageScale += 1f; - if (!Main.player[npc.target].ZoneCrimson || malice) + if (!Main.player[npc.target].ZoneCrimson || bossRush) enrageScale += 2f; // Creeper count, 0 to 20 diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index fee1ff0b3d..4d3ecb4870 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -34,8 +34,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.85f; bool phase3 = lifeRatio < 0.7f; bool phase4 = lifeRatio < 0.55f; @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int idleTime = phase3 ? 35 : 40; float timeToFinishRitual = phase5 ? 300f : 360f; - if (malice) + if (bossRush) { iceMistFireRate = 40; iceMistSpeed = 14f; @@ -87,8 +87,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses idleTime = 20; } - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; - // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(false); @@ -1078,8 +1076,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedAncientDoomAI(NPC npc, Mod mod) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; npc.damage = npc.defDamage = 0; float duration = 420f; float spawnAnimTime = 120f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index 964dca00bb..f42aa70cd1 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -18,8 +18,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // 10 seconds of resistance to prevent spawn killing if (calamityGlobalNPC.newAI[1] < 600f) @@ -63,10 +63,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (increaseSpeedMore && npc.type == NPCID.TheDestroyer) npc.TargetClosest(); - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.type == NPCID.TheDestroyerBody) { // Enrage, fire more cyan lasers - if (enrageScale > 0f && !malice) + if (enrageScale > 0f && !bossRush) { if (calamityGlobalNPC.newAI[2] < 480f) calamityGlobalNPC.newAI[2] += 1f; @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { if (calamityGlobalNPC.newAI[0] % 30f == 0f) { - float velocity = malice ? 6f : death ? 5.333f : 5f; + float velocity = bossRush ? 6f : death ? 5.333f : 5f; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); Vector2 projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * velocity; @@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses break; } - if (calamityGlobalNPC.newAI[2] > 0f || malice) + if (calamityGlobalNPC.newAI[2] > 0f || bossRush) { projectileType = ModContent.ProjectileType(); laserSpawnDistance = 20f; @@ -610,7 +610,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedProbeAI(NPC npc, Mod mod) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -621,8 +621,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (targetData.Type == NPCTargetType.Player) targetDead = Main.player[npc.target].dead; - float velocity = malice ? 8f : 6f; - float acceleration = malice ? 0.1f : 0.05f; + float velocity = bossRush ? 8f : 6f; + float acceleration = bossRush ? 0.1f : 0.05f; Vector2 vector = npc.Center; float num4 = targetData.Center.X; @@ -704,7 +704,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.justHit) npc.localAI[0] = 0f; - float laserGateValue = malice ? 150f : 240f; + float laserGateValue = bossRush ? 150f : 240f; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= laserGateValue) { npc.localAI[0] = 0f; @@ -712,7 +712,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { int type = ProjectileID.PinkLaser; int damage = npc.GetProjectileDamage(type); - int totalProjectiles = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 3 : 1; + int totalProjectiles = (CalamityWorld.death || bossRush) ? 3 : 1; for (int i = 0; i < totalProjectiles; i++) { float velocityMultiplier = 1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs index db6ab0c500..b8fd7184ac 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs @@ -19,8 +19,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.7f; bool phase3 = lifeRatio < 0.4f; bool phase4 = lifeRatio < 0.2f; @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int teleportPhaseTimer = 30; - int bubbleSpinPhaseTimer = malice ? 45 : death ? 90 : 120; + int bubbleSpinPhaseTimer = bossRush ? 45 : death ? 90 : 120; int bubbleSpinPhaseDivisor = death ? 3 : 4; float bubbleSpinBubbleVelocity = death ? 8f : 7f; float bubbleSpinPhaseVelocity = 20f; @@ -151,18 +151,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } // Enrage variable - bool enrage = !BossRushEvent.BossRushActive && + bool enrage = !bossRush && (player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400))); - npc.Calamity().CurrentlyEnraged = (!BossRushEvent.BossRushActive && enrage) || malice; + npc.Calamity().CurrentlyEnraged = !bossRush && enrage; // Increased DR during phase transitions calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? 0.625f : 0.15f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; // Enrage - if (enrage || malice) + if (enrage || bossRush) { bubbleBelchPhaseTimer = 20; bubbleBelchPhaseDivisor = 1; @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses bubbleSpinPhaseDivisor = 1; bubbleSpinBubbleVelocity = 15f; - if (!malice) + if (!bossRush) { npc.damage = npc.defDamage * 2; npc.defense = npc.defDefense * 3; @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses rateOfRotation = 0.01f; Vector2 rotationVector = player.Center - npc.Center; - if (!player.dead && malice && phase4) + if (!player.dead && bossRush && phase4) { // Rotate to show direction of predictive charge if (npc.ai[0] == 10f) @@ -913,7 +913,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] = 0f; // Velocity and rotation - npc.velocity = Vector2.Normalize(player.Center + (malice && phase4 ? player.velocity * 20f : Vector2.Zero) - npc.Center) * chargeVelocity; + npc.velocity = Vector2.Normalize(player.Center + (bossRush && phase4 ? player.velocity * 20f : Vector2.Zero) - npc.Center) * chargeVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); // Direction diff --git a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs index 64ec67a3cd..778dfef604 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs @@ -15,8 +15,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Causes it to split far more in death mode if (((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) @@ -36,15 +36,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Fade in. npc.Opacity = MathHelper.Clamp(npc.Opacity + 0.08f, 0f, 1f); - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface || malice) + float enrageScale = bossRush ? 1f : 0f; + if ((npc.position.Y / 16f) < Main.worldSurface || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } - if (!Main.player[npc.target].ZoneCorrupt || malice) + if (!Main.player[npc.target].ZoneCorrupt || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float lifeRatio = segmentCount / (totalSegments + 2); // 10 seconds of resistance to prevent spawn killing - if (calamityGlobalNPC.newAI[1] < 600f && BossRushEvent.BossRushActive) + if (calamityGlobalNPC.newAI[1] < 600f && bossRush) calamityGlobalNPC.newAI[1] += 1f; // Phases @@ -421,7 +421,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Despawn bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && Main.player[npc.target].dead; - if (shouldDespawn && !BossRushEvent.BossRushActive) + if (shouldDespawn && !bossRush) { bool everyoneDead = true; for (int num58 = 0; num58 < Main.maxPlayers; num58++) diff --git a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs index bc3dd18aa1..44d2eb8336 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs @@ -17,8 +17,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); // Difficulty bools. - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Rotation npc.rotation = npc.velocity.X * 0.005f; @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.life == npc.lifeMax && dayTimeEnrage && !npc.AI_120_HallowBoss_IsGenuinelyEnraged()) npc.ai[3] += 2f; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && dayTimeEnrage; + npc.Calamity().CurrentlyEnraged = !bossRush && dayTimeEnrage; int projectileDamageMultiplier = dayTimeEnrage ? 2 : 1; @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.TargetClosest(); NPCAimedTarget targetData5 = npc.GetTargetData(); bool flag12 = false; - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !malice) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) { if (!Main.dayTime) flag12 = true; @@ -1086,7 +1086,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses bool flag8 = false; if (!flag7) { - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !malice) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) { if (!Main.dayTime) flag8 = true; diff --git a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs index 1d3a0449e8..df73e5b928 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs @@ -18,18 +18,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.65f; bool phase4 = lifeRatio < 0.55f; bool phase5 = lifeRatio < 0.4f; float num5 = death ? 15f : 20f; - float enrageScale = BossRushEvent.BossRushActive ? 1f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 1f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 2f; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs index ee2178b89b..b8f2011ba8 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/GolemAI.cs @@ -22,8 +22,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; bool phase4 = lifeRatio < 0.25f; @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's malice mode or for the worthy + // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy bool enrage = true; bool turboEnrage = false; if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) @@ -66,15 +66,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; } else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; - if (malice || Main.getGoodWorld) + if (bossRush || Main.getGoodWorld) enrage = true; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage); + npc.Calamity().CurrentlyEnraged = !bossRush && (enrage || turboEnrage); bool reduceFallSpeed = npc.velocity.Y > 0f && Collision.SolidCollision(npc.position + Vector2.UnitY * 1.1f * npc.velocity.Y, npc.width, npc.height); @@ -432,11 +432,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedGolemFistAI(NPC npc, Mod mod) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's malice mode or for the worthy + // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy bool enrage = true; bool turboEnrage = false; if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) @@ -448,12 +448,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; } else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; - if (malice || Main.getGoodWorld) + if (bossRush || Main.getGoodWorld) enrage = true; float aggression = turboEnrage ? (Main.getGoodWorld ? 4f : 3f) : enrage ? 2f : death ? 1.5f : 1f; @@ -683,8 +683,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Count body parts bool flag41 = NPC.AnyNPCs(NPCID.GolemFistLeft); @@ -706,12 +706,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; } else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; - if (malice || Main.getGoodWorld) + if (bossRush || Main.getGoodWorld) enrage = true; // Alpha @@ -933,8 +933,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float golemLifeRatio = Main.npc[NPC.golemBoss].life / (float)Main.npc[NPC.golemBoss].lifeMax; // Phases - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; bool phase2 = lifeRatio < 0.7f || golemLifeRatio < 0.85f; bool phase3 = lifeRatio < 0.55f || golemLifeRatio < 0.7f; bool phase4 = lifeRatio < 0.4f || golemLifeRatio < 0.55f; @@ -951,12 +951,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; } else - turboEnrage = malice || Main.getGoodWorld; + turboEnrage = bossRush || Main.getGoodWorld; - if (malice || Main.getGoodWorld) + if (bossRush || Main.getGoodWorld) enrage = true; if (turboEnrage) diff --git a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs index c950575a5b..67faf3c071 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs @@ -32,9 +32,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Reset damage npc.damage = npc.defDamage; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -102,7 +101,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) - npc.velocity.Y += malice ? 0.1f : death ? 0.05f : 0f; + npc.velocity.Y += bossRush ? 0.1f : death ? 0.05f : 0f; // Activate teleport if (!Main.player[npc.target].dead && npc.ai[2] >= 300f && npc.ai[1] < 5f && npc.velocity.Y == 0f) @@ -247,7 +246,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (!teleporting) { npc.ai[0] += 2f; - if (malice) + if (bossRush) { npc.ai[0] += 9f; } @@ -284,7 +283,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.velocity.Y = -13f * speedMult; npc.velocity.X += (phase2 ? (death ? 5.5f : 4.5f) : 3.5f) * npc.direction; - if (malice) + if (bossRush) npc.velocity.X *= jumpSpeedMult; npc.ai[0] = -200f; @@ -294,7 +293,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.velocity.Y = -6f * speedMult; npc.velocity.X += (phase2 ? (death ? 6.5f : 5.5f) : 4.5f) * npc.direction; - if (malice) + if (bossRush) npc.velocity.X *= jumpSpeedMult; npc.ai[0] = -120f; @@ -304,7 +303,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.velocity.Y = -8f * speedMult; npc.velocity.X += (phase2 ? (death ? 6f : 5f) : 4f) * npc.direction; - if (malice) + if (bossRush) npc.velocity.X *= jumpSpeedMult; npc.ai[0] = -120f; @@ -326,9 +325,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if ((npc.direction == 1 && npc.velocity.X < num252) || (npc.direction == -1 && npc.velocity.X > 0f - num252)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) - npc.velocity.X += (malice ? 0.4f : death ? 0.25f : 0.2f) * npc.direction; + npc.velocity.X += (bossRush ? 0.4f : death ? 0.25f : 0.2f) * npc.direction; else - npc.velocity.X *= malice ? 0.9f : death ? 0.92f : 0.93f; + npc.velocity.X *= bossRush ? 0.9f : death ? 0.92f : 0.93f; } } @@ -402,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses break; } - if ((Main.raining || malice) && Main.rand.NextBool(10)) + if ((Main.raining || bossRush) && Main.rand.NextBool(10)) { npcType = NPCID.UmbrellaSlime; diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 66e01c2ed6..3d47668bd2 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -16,8 +16,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; int aggressionLevel = 4; if (npc.type == NPCID.MoonLordCore || npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) @@ -40,14 +40,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } - if (malice) + if (bossRush) aggressionLevel = 5; if (Main.getGoodWorld) aggressionLevel = 6; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; - if (npc.type == NPCID.MoonLordCore) { // Play a random Moon Lord sound @@ -1174,7 +1172,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int damage = npc.GetProjectileDamage(type); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), vector169, vector170, type, damage, 0f, Main.myPlayer, 0f, ai); Main.projectile[proj].timeLeft = 1200; - Main.projectile[proj].Calamity().lineColor = malice ? 1 : aggressionLevel; + Main.projectile[proj].Calamity().lineColor = bossRush ? 1 : aggressionLevel; } } else diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index 65e2ee99d9..e0228a852d 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -16,8 +16,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -37,11 +37,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses bool phase4 = lifeRatio < 0.2f; // Variables and target - bool enrage = malice; + bool enrage = bossRush; bool despawn = false; // Check for Jungle - bool surface = !BossRushEvent.BossRushActive && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; + bool surface = !bossRush && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; int maxTentacles = death ? 25 : 20; float speedUpDistance = 480f; bool speedUp = Vector2.Distance(Main.player[npc.target].Center, npc.Center) > speedUpDistance; // 30 or 40 tile distance @@ -112,21 +112,21 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses acceleration = 0.06f; } - if (malice) + if (bossRush) { velocity += 2f; acceleration += 0.02f; } // Enrage if target is on the surface - if (!BossRushEvent.BossRushActive && (surface || Main.player[npc.target].position.Y > ((Main.maxTilesY - 200) * 16))) + if (!bossRush && (surface || Main.player[npc.target].position.Y > ((Main.maxTilesY - 200) * 16))) { enrage = true; velocity += 8f; acceleration = 0.15f; } - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && enrage; + npc.Calamity().CurrentlyEnraged = !bossRush && enrage; // Detect active tiles around Plantera int radius = 20; // 20 tile radius @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (nearbyActiveTiles < 800) tileEnrageMult += (800 - nearbyActiveTiles) * 0.00075f; // Ranges from 1f to 1.6f - if (malice) + if (bossRush) tileEnrageMult = 1.6f; // Let hooks and tentacles know how enraged plantera is @@ -315,7 +315,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.TargetClosest(); int projectileType = ProjectileID.SeedPlantera; float projectileVelocity = 17f; - int chance = malice ? 2 : 6; + int chance = bossRush ? 2 : 6; if (Main.rand.NextBool(chance)) { projectileType = ModContent.ProjectileType(); @@ -453,7 +453,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int num762 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore); Main.npc[num762].velocity.X = num758; Main.npc[num762].velocity.Y = num760; - Main.npc[num762].dontTakeDamage = malice; + Main.npc[num762].dontTakeDamage = bossRush; Main.npc[num762].netUpdate = true; } } @@ -483,7 +483,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float num742 = 8f + ((0.5f - lifeRatio) * 8f); // 8f to 12f if (nearbyActiveTiles < 300) num742 = 12f; - if (malice) + if (bossRush) num742 += 4f; float num743 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector93.X; @@ -539,7 +539,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float shootBoost = 2f * (0.5f - lifeRatio); calamityGlobalNPC.newAI[0] += 1f + shootBoost; - float sporeGasGateValue = malice ? 300f : 600f; + float sporeGasGateValue = bossRush ? 300f : 600f; if (calamityGlobalNPC.newAI[0] >= sporeGasGateValue) { npc.TargetClosest(); @@ -645,9 +645,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedPlanterasHookAI(NPC npc, Mod mod) { // Variables - bool enrage = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool enrage = BossRushEvent.BossRushActive; bool despawn = false; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || enrage; // Despawn if Plantera is gone if (NPC.plantBoss < 0) @@ -661,14 +661,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float lifeRatio = Main.npc[NPC.plantBoss].life / (float)Main.npc[NPC.plantBoss].lifeMax; // Despawn if Plantera's target is dead - if (Main.player[Main.npc[NPC.plantBoss].target].dead && !BossRushEvent.BossRushActive) + if (Main.player[Main.npc[NPC.plantBoss].target].dead && !enrage) despawn = true; // Tile enrage float tileEnrageMult = Main.npc[NPC.plantBoss].ai[3]; // Enrage if Plantera's target is on the surface - if (!BossRushEvent.BossRushActive && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > ((Main.maxTilesY - 200) * 16)) | despawn)) + if (!enrage && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > ((Main.maxTilesY - 200) * 16)) | despawn)) { npc.localAI[0] -= 4f; enrage = true; diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index 37e5e83c7f..a9377423f1 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -17,18 +17,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; float enrageScale = death ? 0.25f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface || malice) + if ((npc.position.Y / 16f) < Main.worldSurface || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 0.5f; } - if (!Main.player[npc.target].ZoneJungle || malice) + if (!Main.player[npc.target].ZoneJungle || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 0.5f; } @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.getGoodWorld) enrageScale += 0.5f; - if (BossRushEvent.BossRushActive) + if (bossRush) enrageScale = 2f; // Percent life remaining diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenSlimeAI.cs index c77d2b3788..a19484ef9a 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenSlimeAI.cs @@ -15,9 +15,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedQueenSlimeAI(NPC npc, Mod mod) { // Difficulty bools - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -215,9 +214,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses break; npc.ai[1] += 1f; - int idleTime = malice ? 20 : death ? 30 : 40; + int idleTime = bossRush ? 20 : death ? 30 : 40; if (phase2) - idleTime = malice ? 40 : death ? 60 : 80; + idleTime = bossRush ? 40 : death ? 60 : 80; if (phase4) idleTime /= 2; @@ -279,7 +278,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportEndTime = malice ? 10f : death ? 15f : 20f; + float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; num3 = MathHelper.Clamp(npc.ai[1] / teleportEndTime, 0f, 1f); num3 = 0.5f + num3 * 0.5f; if (npc.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -317,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportTime = malice ? 20f : death ? 30f : 40f; + float teleportTime = bossRush ? 20f : death ? 30f : 40f; num3 = MathHelper.Clamp((teleportTime - npc.ai[1]) / teleportTime, 0f, 1f); num3 = 0.5f + num3 * 0.5f; @@ -362,7 +361,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) - npc.velocity.Y += malice ? 0.1f : death ? 0.05f : 0f; + npc.velocity.Y += bossRush ? 0.1f : death ? 0.05f : 0f; npc.rotation = 0f; if (npc.velocity.Y == 0f) @@ -371,7 +370,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; - float timerIncrement = malice ? 7f : death ? 6f : 5f; + float timerIncrement = bossRush ? 7f : death ? 6f : 5f; npc.ai[1] += timerIncrement; if (lifeRatio < 0.85f) npc.ai[1] += timerIncrement; @@ -394,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[2] == 3f) { npc.velocity.Y = -13f * speedMult; - npc.velocity.X += (malice ? 7f : death ? 6f : 5.5f) * npc.direction; + npc.velocity.X += (bossRush ? 7f : death ? 6f : 5.5f) * npc.direction; npc.ai[1] = 0f; npc.ai[2] = 0f; if (npc.timeLeft > 10) @@ -408,15 +407,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } else if (npc.ai[2] == 2f) { - npc.velocity.Y = -(malice ? 10f : death ? 8f : 6f) * speedMult; - npc.velocity.X += (malice ? 8.5f : death ? 7.5f : 7f) * npc.direction; + npc.velocity.Y = -(bossRush ? 10f : death ? 8f : 6f) * speedMult; + npc.velocity.X += (bossRush ? 8.5f : death ? 7.5f : 7f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } else { - npc.velocity.Y = -(malice ? 12f : death ? 10f : 8f) * speedMult; - npc.velocity.X += (malice ? 7.5f : death ? 6.5f : 6f) * npc.direction; + npc.velocity.Y = -(bossRush ? 12f : death ? 10f : 8f) * speedMult; + npc.velocity.X += (bossRush ? 7.5f : death ? 6.5f : 6f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } @@ -426,16 +425,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.target >= Main.maxPlayers) break; - float num19 = malice ? 6.5f : death ? 5.5f : 4.5f; + float num19 = bossRush ? 6.5f : death ? 5.5f : 4.5f; if (Main.getGoodWorld) num19 = 7f; if ((npc.direction == 1 && npc.velocity.X < num19) || (npc.direction == -1 && npc.velocity.X > 0f - num19)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) - npc.velocity.X += (malice ? 0.5f : death ? 0.35f : 0.3f) * npc.direction; + npc.velocity.X += (bossRush ? 0.5f : death ? 0.35f : 0.3f) * npc.direction; else - npc.velocity.X *= malice ? 0.88f : death ? 0.9f : 0.91f; + npc.velocity.X *= bossRush ? 0.88f : death ? 0.9f : 0.91f; } } @@ -539,8 +538,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses break; } - npc.velocity.Y += malice ? 2f : death ? 1.75f : 1.5f; - float num24 = malice ? 15.99f : death ? 15.5f : 15f; + npc.velocity.Y += bossRush ? 2f : death ? 1.75f : 1.5f; + float num24 = bossRush ? 15.99f : death ? 15.5f : 15f; if (Main.getGoodWorld) { npc.velocity.Y += 1f; @@ -614,7 +613,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.velocity = center - npc.Center; npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= malice ? 30f : death ? 26f : 24f; + npc.velocity *= bossRush ? 30f : death ? 26f : 24f; } else npc.velocity.Y *= 0.95f; @@ -815,14 +814,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static void QueenSlime_FlyMovement(NPC npc) { // Difficulty bools - bool malice = CalamityWorld.malice; + bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death; npc.noTileCollide = true; npc.noGravity = true; - float flyVelocity = malice ? 20f : death ? 18f : 16f; - float flyAcceleration = malice ? 0.18f : death ? 0.14f : 0.12f; + float flyVelocity = bossRush ? 20f : death ? 18f : 16f; + float flyAcceleration = bossRush ? 0.18f : death ? 0.14f : 0.12f; float flyDistanceY = 450f; npc.TargetClosest(); diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index a17b44c0d9..6d992b2045 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -15,9 +15,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -99,15 +98,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float distance = Vector2.Distance(Main.player[npc.target].Center, npc.Center); // Despawn - if (Main.player[npc.target].dead || distance > (BossRushEvent.BossRushActive ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (Main.player[npc.target].dead || distance > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) { npc.TargetClosest(); - if (Main.player[npc.target].dead || distance > (BossRushEvent.BossRushActive ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (Main.player[npc.target].dead || distance > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) npc.ai[1] = 3f; } // Daytime enrage - if (Main.dayTime && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.dayTime && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) { npc.ai[1] = 2f; SoundEngine.PlaySound(SoundID.Roar, npc.position); @@ -188,7 +187,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // If hands are dead: 7 seconds // If hands are not dead: 14 seconds // If hands are dead in phase 2: 4.7 seconds - npc.ai[3] += 1f + (((phase2 && handsDead) || malice) ? 0.5f : 0f) - ((handsDead || malice) ? 0f : 0.5f); + npc.ai[3] += 1f + (((phase2 && handsDead) || bossRush) ? 0.5f : 0f) - ((handsDead || bossRush) ? 0f : 0.5f); // Dust to show teleport int ai3 = (int)npc.ai[3]; // 0 to 30, and -60 @@ -278,7 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Skull shooting if (handsDead && npc.ai[1] == 0f) { - float num158 = BossRushEvent.BossRushActive ? 10f : malice ? 15f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f; + float num158 = bossRush ? 10f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f; if (Main.getGoodWorld) num158 *= 0.8f; @@ -298,7 +297,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num165 = num162 / num165; num163 *= num165; num164 *= num165; - int spread = malice ? 100 : 50; + int spread = bossRush ? 100 : 50; Vector2 vector19 = new Vector2(num163 + Main.rand.Next(-spread, spread + 1) * 0.01f, num164 + Main.rand.Next(-spread, spread + 1) * 0.01f); vector19.Normalize(); vector19 *= num162; @@ -348,7 +347,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num171 += 0.05f; num172 += 2f; } - if (malice) + if (bossRush) { num169 *= 1.25f; num170 *= 0.75f; @@ -423,9 +422,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Increase speed while charging npc.damage = (int)(npc.defDamage * 1.3); - float num176 = BossRushEvent.BossRushActive ? 9f : malice ? 6f : 4.5f; + float num176 = bossRush ? 9f : 4.5f; float velocityBoost = death ? 1f : 1f - lifeRatio; - if (handsDead || malice) + if (handsDead || bossRush) num176 += velocityBoost; if (num175 > 150f) @@ -493,8 +492,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -557,8 +556,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { - float maxX = malice ? 4f : death ? 6f : 7f; - float maxY = malice ? 3f : death ? 4.5f : 5f; + float maxX = bossRush ? 4f : death ? 6f : 7f; + float maxY = bossRush ? 3f : death ? 4.5f : 5f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 100f * yMultiplier) { @@ -605,8 +604,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.netUpdate = true; } - float maxX = malice ? 4f : death ? 6f : 7f; - float maxY = malice ? 1f : death ? 2f : 2.5f; + float maxX = bossRush ? 4f : death ? 6f : 7f; + float maxY = bossRush ? 1f : death ? 2f : 2.5f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 230f * yMultiplier) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs index edee5c87ab..986ec98c26 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs @@ -17,9 +17,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -136,7 +135,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } // Activate daytime enrage - if (Main.dayTime && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.dayTime && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) { // Heal if (Main.netMode != NetmodeID.MultiplayerClient) @@ -209,7 +208,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.localAI[1] = 0f; - int totalProjectiles = malice ? 24 : 12; + int totalProjectiles = bossRush ? 24 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -240,8 +239,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 value19 = Main.player[npc.target].Center - npc.Center; value19.Normalize(); value19 *= num502; - int numProj = malice ? 5 : 3; - float rotation = MathHelper.ToRadians(malice ? 8 : 5); + int numProj = bossRush ? 5 : 3; + float rotation = MathHelper.ToRadians(bossRush ? 8 : 5); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); @@ -278,7 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses acceleration += 0.025f; } - if (malice) + if (bossRush) { velocityY = 0.25f; velocityX = 0.5f; @@ -347,7 +346,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.localAI[1] = 0f; - int totalProjectiles = malice ? 24 : 12; + int totalProjectiles = bossRush ? 24 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -388,7 +387,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float num456 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector48.Y; float num457 = (float)Math.Sqrt(num455 * num455 + num456 * num456); - float speed = BossRushEvent.BossRushActive ? 9f : 6f; + float speed = bossRush ? 9f : 6f; if (phase2) speed += 0.5f; if (phase3) @@ -508,7 +507,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else { npc.velocity = npc.velocity.RotatedBy(MathHelper.Pi / spinVelocity * -calamityGlobalNPC.newAI[0]); - float skullSpawnDivisor = BossRushEvent.BossRushActive ? 15f : malice ? 20f : death ? 30f - (float)Math.Round(10f * (1f - lifeRatio)) : 30f; + float skullSpawnDivisor = bossRush ? 15f : death ? 30f - (float)Math.Round(10f * (1f - lifeRatio)) : 30f; if (npc.ai[2] % skullSpawnDivisor == 0f) { calamityGlobalNPC.newAI[1] += 1f; @@ -566,14 +565,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.rotation = npc.velocity.X / 15f; - float flightVelocity = malice ? 25f : death ? 20f : 15f; - float flightAcceleration = malice ? 0.25f : death ? 0.2f : 0.15f; + float flightVelocity = bossRush ? 25f : death ? 20f : 15f; + float flightAcceleration = bossRush ? 0.25f : death ? 0.2f : 0.15f; Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 500f); npc.SimpleFlyMovement(Vector2.Normalize(destination - npc.Center) * flightVelocity, flightAcceleration); // Spit homing missiles and then go to floating phase - if (Vector2.Distance(npc.Center, destination) < 160f || npc.ai[2] > 0f) + npc.ai[3] += 1f; + if (Vector2.Distance(npc.Center, destination) < 160f || npc.ai[2] > 0f || npc.ai[3] > 120f) { float missileSpawnDivisor = death ? 8f : 12f; npc.ai[2] += 1f; @@ -588,7 +588,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses velocity *= 5f; int type = ProjectileID.SaucerMissile; int damage = npc.GetProjectileDamage(type); - float delayBeforeHoming = malice ? 25f : 45f; + float delayBeforeHoming = bossRush ? 25f : 45f; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 4f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, 0f, delayBeforeHoming); } @@ -598,6 +598,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.ai[1] = 0f; npc.ai[2] = 0f; + npc.ai[3] = 0f; calamityGlobalNPC.newAI[0] = 0f; calamityGlobalNPC.newAI[1] = 0f; npc.localAI[1] = -90f; @@ -615,8 +616,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedPrimeLaserAI(NPC npc, Mod mod) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -700,15 +701,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.netUpdate = true; } - float velocityY = malice ? 0.5f : death ? 2f : 2.5f; - float velocityX = malice ? 1f : death ? 5f : 7f; + float velocityY = bossRush ? 0.5f : death ? 2f : 2.5f; + float velocityX = bossRush ? 1f : death ? 5f : 7f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 100f) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y -= bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -718,7 +719,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y += bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -729,7 +730,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.3f : death ? 0.16f : 0.14f; + npc.velocity.X -= bossRush ? 0.3f : death ? 0.16f : 0.14f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -739,7 +740,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.3f : death ? 0.16f : 0.14f; + npc.velocity.X += bossRush ? 0.3f : death ? 0.16f : 0.14f; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -766,7 +767,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.localAI[0] = 0f; npc.TargetClosest(); - float num509 = malice ? 10f : 8f; + float num509 = bossRush ? 10f : 8f; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); num508 = num509 / num508; @@ -815,25 +816,25 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.X -= bossRush ? 0.3f : death ? 0.12f : 0.1f; } if (npc.velocity.X < num513) { if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.X += bossRush ? 0.3f : death ? 0.12f : 0.1f; } if (npc.velocity.Y > num514) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.3f : death ? 0.08f : 0.06f; + npc.velocity.Y -= bossRush ? 0.3f : death ? 0.08f : 0.06f; } if (npc.velocity.Y < num514) { if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.3f : death ? 0.08f : 0.06f; + npc.velocity.Y += bossRush ? 0.3f : death ? 0.08f : 0.06f; } vector63 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -856,7 +857,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { npc.localAI[0] = 0f; npc.TargetClosest(); - int totalProjectiles = malice ? 24 : 12; + int totalProjectiles = bossRush ? 24 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -881,8 +882,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedPrimeCannonAI(NPC npc, Mod mod) { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1000,15 +1001,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] == 3f && npc.timeLeft > 10) npc.timeLeft = 10; - float velocityY = malice ? 0.5f : death ? 2f : 2.5f; - float velocityX = malice ? 1f : death ? 5f : 7f; + float velocityY = bossRush ? 0.5f : death ? 2f : 2.5f; + float velocityX = bossRush ? 1f : death ? 5f : 7f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 150f) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.Y -= bossRush ? 0.275f : death ? 0.1f : 0.08f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -1018,7 +1019,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.Y += bossRush ? 0.275f : death ? 0.1f : 0.08f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -1029,7 +1030,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.275f : death ? 0.22f : 0.2f; + npc.velocity.X -= bossRush ? 0.275f : death ? 0.22f : 0.2f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -1039,7 +1040,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.275f : death ? 0.22f : 0.2f; + npc.velocity.X += bossRush ? 0.275f : death ? 0.22f : 0.2f; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -1093,25 +1094,25 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.X -= bossRush ? 0.275f : death ? 0.1f : 0.08f; } if (npc.velocity.X < num499) { if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.X += bossRush ? 0.275f : death ? 0.1f : 0.08f; } if (npc.velocity.Y > num500) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.Y -= bossRush ? 0.275f : death ? 0.1f : 0.08f; } if (npc.velocity.Y < num500) { if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.275f : death ? 0.1f : 0.08f; + npc.velocity.Y += bossRush ? 0.275f : death ? 0.1f : 0.08f; } vector61 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -1140,8 +1141,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 value19 = Main.player[npc.target].Center - npc.Center; value19.Normalize(); value19 *= num502; - int numProj = malice ? 5 : 3; - float rotation = MathHelper.ToRadians(malice ? 8 : 5); + int numProj = bossRush ? 5 : 3; + float rotation = MathHelper.ToRadians(bossRush ? 8 : 5); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = value19.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); @@ -1156,8 +1157,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedPrimeViceAI(NPC npc, Mod mod) { - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1231,15 +1232,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Return to the head if (npc.ai[2] == 99f) { - float velocityY = malice ? 1f : death ? 5f : 7f; - float velocityX = malice ? 1.5f : death ? 8f : 10f; + float velocityY = bossRush ? 1f : death ? 5f : 7f; + float velocityX = bossRush ? 1.5f : death ? 8f : 10f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y -= bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -1249,7 +1250,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y += bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -1260,7 +1261,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 1f : death ? 0.55f : 0.5f; + npc.velocity.X -= bossRush ? 1f : death ? 0.55f : 0.5f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -1270,7 +1271,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 1f : death ? 0.55f : 0.5f; + npc.velocity.X += bossRush ? 1f : death ? 0.55f : 0.5f; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -1304,16 +1305,16 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.netUpdate = true; } - float velocityY = malice ? 0.5f : death ? 2f : 2.5f; - float velocityX = malice ? 1.5f : death ? 7f : 8f; - float velocityX2 = malice ? 1.25f : death ? 6f : 7f; + float velocityY = bossRush ? 0.5f : death ? 2f : 2.5f; + float velocityX = bossRush ? 1.5f : death ? 7f : 8f; + float velocityX2 = bossRush ? 1.25f : death ? 6f : 7f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 300f) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y -= bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -1323,7 +1324,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y += bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -1334,7 +1335,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.8f : death ? 0.33f : 0.3f; + npc.velocity.X -= bossRush ? 0.8f : death ? 0.33f : 0.3f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -1344,7 +1345,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.8f : death ? 0.22f : 0.2f; + npc.velocity.X += bossRush ? 0.8f : death ? 0.22f : 0.2f; if (npc.velocity.X < -velocityX2) npc.velocity.X = -velocityX2; @@ -1377,7 +1378,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 280f) { - float chargeVelocity = malice ? 20f : 16f; + float chargeVelocity = bossRush ? 20f : 16f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1441,7 +1442,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.position.X + (npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - 500f || npc.position.X + (npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) + 500f) { - float chargeVelocity = malice ? 17.5f : 14f; + float chargeVelocity = bossRush ? 17.5f : 14f; if (!cannonAlive) chargeVelocity += 1.15f; if (!laserAlive) @@ -1492,8 +1493,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses public static bool BuffedPrimeSawAI(NPC npc, Mod mod) { - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1562,15 +1563,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[2] == 99f) { - float velocityY = malice ? 1f : death ? 6f : 7f; - float velocityX = malice ? 1.5f : death ? 8f : 10f; + float velocityY = bossRush ? 1f : death ? 6f : 7f; + float velocityX = bossRush ? 1.5f : death ? 8f : 10f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y -= bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -1580,7 +1581,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.3f : death ? 0.12f : 0.1f; + npc.velocity.Y += bossRush ? 0.3f : death ? 0.12f : 0.1f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -1591,7 +1592,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 1.2f : death ? 0.55f : 0.5f; + npc.velocity.X -= bossRush ? 1.2f : death ? 0.55f : 0.5f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -1601,7 +1602,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 1.2f : death ? 0.55f : 0.5f; + npc.velocity.X += bossRush ? 1.2f : death ? 0.55f : 0.5f; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -1631,15 +1632,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.netUpdate = true; } - float velocityY = malice ? 0.5f : death ? 2f : 2.5f; - float velocityX = malice ? 1.5f : death ? 8f : 10f; + float velocityY = bossRush ? 0.5f : death ? 2f : 2.5f; + float velocityX = bossRush ? 1.5f : death ? 8f : 10f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 320f) { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y -= malice ? 0.15f : death ? 0.05f : 0.04f; + npc.velocity.Y -= bossRush ? 0.15f : death ? 0.05f : 0.04f; if (npc.velocity.Y > velocityY) npc.velocity.Y = velocityY; @@ -1649,7 +1650,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.9f; - npc.velocity.Y += malice ? 0.15f : death ? 0.05f : 0.04f; + npc.velocity.Y += bossRush ? 0.15f : death ? 0.05f : 0.04f; if (npc.velocity.Y < -velocityY) npc.velocity.Y = -velocityY; @@ -1660,7 +1661,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X > 0f) npc.velocity.X *= 0.9f; - npc.velocity.X -= malice ? 0.8f : death ? 0.33f : 0.3f; + npc.velocity.X -= bossRush ? 0.8f : death ? 0.33f : 0.3f; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; @@ -1670,7 +1671,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.velocity.X < 0f) npc.velocity.X *= 0.9f; - npc.velocity.X += malice ? 0.8f : death ? 0.33f : 0.3f; + npc.velocity.X += bossRush ? 0.8f : death ? 0.33f : 0.3f; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -1697,7 +1698,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) { - float chargeVelocity = malice ? 27.5f : 22f; + float chargeVelocity = bossRush ? 27.5f : 22f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1728,7 +1729,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { if (npc.ai[2] == 4f) { - float chargeVelocity = malice ? 13.5f : 11f; + float chargeVelocity = bossRush ? 13.5f : 11f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1744,7 +1745,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num474 *= num476; num475 *= num476; - float acceleration = malice ? 0.15f : death ? 0.06f : 0.05f; + float acceleration = bossRush ? 0.15f : death ? 0.06f : 0.05f; if (npc.velocity.X > num474) { if (npc.velocity.X > 0f) diff --git a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs index eeeb770292..927054bfb8 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs @@ -337,8 +337,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -348,10 +348,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) npc.TargetClosest(); - float enrageScale = BossRushEvent.BossRushActive ? 0.5f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 0.5f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -1067,8 +1067,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1078,10 +1078,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) npc.TargetClosest(); - float enrageScale = BossRushEvent.BossRushActive ? 0.5f : 0f; - if (Main.dayTime || malice) + float enrageScale = bossRush ? 0.5f : 0f; + if (Main.dayTime || bossRush) { - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + npc.Calamity().CurrentlyEnraged = !bossRush; enrageScale += 1f; } @@ -1103,8 +1103,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 lookAt = new Vector2(Main.player[npc.target].position.X - (Main.player[npc.target].width / 2), Main.player[npc.target].position.Y - (Main.player[npc.target].height / 2)); Vector2 rotationVector = npcCenter - lookAt; - // Malice Mode predictive charge rotation - if (npc.ai[1] == 5f && !retAlive && malice) + // Boss Rush predictive charge rotation + if (npc.ai[1] == 5f && !retAlive && bossRush) { // Velocity float chargeVelocity = 20f + (death ? 6f * (0.7f - lifeRatio) : 0f); @@ -1659,7 +1659,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.getGoodWorld) num48 *= 1.2f; - Vector2 distanceVector = Main.player[npc.target].Center + (!retAlive && malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center; + Vector2 distanceVector = Main.player[npc.target].Center + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center; npc.velocity = Vector2.Normalize(distanceVector) * num48; if (retAlive) @@ -1800,7 +1800,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float velocity = 16f; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center + (!retAlive && malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * velocity; + Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * velocity; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * 4f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs index e4bf58d8e5..699dac6114 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs @@ -15,9 +15,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && malice; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Despawn if (npc.position.X < 160f || npc.position.X > ((Main.maxTilesX - 10) * 16)) @@ -49,7 +48,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[1] += 1f; if (phase3) npc.ai[1] += 1f; - if (malice) + if (bossRush) npc.ai[1] += 3f; if (npc.ai[1] > 2700f) @@ -199,7 +198,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float timeBeforeEnrage = 600f - (death ? 390f * (1f - lifeRatio) : 0f); float speedMult = 1f; - if (malice) + if (bossRush) timeBeforeEnrage *= 0.25f; if (calamityGlobalNPC.newAI[0] < timeBeforeEnrage) @@ -251,14 +250,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } } - if (malice) + if (bossRush) speedMult += 0.2f; // NOTE: Max velocity is 8 in Expert Mode // NOTE: Max velocity is 9 in For The Worthy float velocityBoost = 4f * (1f - lifeRatio); - float velocityX = (BossRushEvent.BossRushActive ? 7f : death ? 3.5f : 2f) + velocityBoost; + float velocityX = (bossRush ? 7f : death ? 3.5f : 2f) + velocityBoost; velocityX *= speedMult; if (Main.getGoodWorld) @@ -375,7 +374,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Range of 64 to 268 chance *= 2; - if (malice) + if (bossRush) chance /= 4; if (Main.rand.NextBool(chance)) @@ -457,8 +456,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; // Despawn if (Main.wofNPCIndex < 0) @@ -578,7 +577,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (flag30) { - bool phase2 = lifeRatio < 0.5 || malice; + bool phase2 = lifeRatio < 0.5 || bossRush; float velocity = (fireAcceleratingLasers ? 3f : 9f) + shootBoost; int projectileType = phase2 ? ProjectileID.DeathLaser : ProjectileID.EyeLaser; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 786b4e0d14..92e711120c 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -181,17 +181,17 @@ namespace CalamityMod.NPCs.Yharon CalamityMod.StopRain(); // Variables - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; float pie = (float)Math.PI; // Start phase 2 or not if (startSecondAI) { - Yharon_AI2(expertMode, revenge, death, malice, pie, lifeRatio, calamityGlobalNPC); + Yharon_AI2(expertMode, revenge, death, bossRush, pie, lifeRatio, calamityGlobalNPC); return; } @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Yharon float reduceSpeedChargeDistance = 540f; int chargeTime = expertMode ? 40 : 45; float chargeSpeed = expertMode ? 28f : 26f; - float fastChargeVelocityMultiplier = malice ? 2f : 1.5f; + float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastCharge = NPC.localAI[1] > fastChargeTelegraphTime; @@ -249,8 +249,8 @@ namespace CalamityMod.NPCs.Yharon if (revenge) { - int chargeTimeDecrease = malice ? 6 : death ? 4 : 2; - float velocityMult = malice ? 1.15f : death ? 1.1f : 1.05f; + int chargeTimeDecrease = bossRush ? 6 : death ? 4 : 2; + float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; phaseSwitchTimer -= chargeTimeDecrease; acceleration *= velocityMult; velocity *= velocityMult; @@ -259,17 +259,17 @@ namespace CalamityMod.NPCs.Yharon } float reduceSpeedFlareBombDistance = 570f; - int flareBombPhaseTimer = malice ? 30 : death ? 40 : 60; + int flareBombPhaseTimer = bossRush ? 30 : death ? 40 : 60; int flareBombSpawnDivisor = flareBombPhaseTimer / 20; - float flareBombPhaseAcceleration = malice ? 1f : death ? 0.92f : 0.8f; - float flareBombPhaseVelocity = malice ? 16f : death ? 14f : 12f; + float flareBombPhaseAcceleration = bossRush ? 1f : death ? 0.92f : 0.8f; + float flareBombPhaseVelocity = bossRush ? 16f : death ? 14f : 12f; int fireTornadoPhaseTimer = 90; int newPhaseTimer = 180; - int flareDustPhaseTimer = malice ? 160 : death ? 200 : 240; - int flareDustPhaseTimer2 = malice ? 80 : death ? 100 : 120; + int flareDustPhaseTimer = bossRush ? 160 : death ? 200 : 240; + int flareDustPhaseTimer2 = bossRush ? 80 : death ? 100 : 120; float spinTime = flareDustPhaseTimer / 2; @@ -335,12 +335,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.getGoodWorld ? 1000f : malice ? 2000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)(player.Center.Y - 10500f); - safeBox.Width = Main.getGoodWorld ? 2000 : malice ? 4000 : revenge ? 6000 : 7000; + safeBox.Width = Main.getGoodWorld ? 2000 : bossRush ? 4000 : revenge ? 6000 : 7000; safeBox.Height = 21000; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.getGoodWorld ? 1000f : malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.getGoodWorld ? 1000f : malice ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -1513,7 +1513,7 @@ namespace CalamityMod.NPCs.Yharon } #region AI2 - public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool malice, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC) + public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool bossRush, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC) { float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f; bool phase2 = death || lifeRatio <= phase2GateValue; @@ -1635,13 +1635,13 @@ namespace CalamityMod.NPCs.Yharon float reduceSpeedChargeDistance = 500f; float reduceSpeedFireballSpitChargeDistance = 800f; - float phaseSwitchTimer = malice ? 28f : expertMode ? 30f : 32f; + float phaseSwitchTimer = bossRush ? 28f : expertMode ? 30f : 32f; float acceleration = expertMode ? 0.92f : 0.9f; float velocity = expertMode ? 14.5f : 14f; float chargeTime = expertMode ? 32f : 35f; float chargeSpeed = expertMode ? 32f : 30f; - float fastChargeVelocityMultiplier = malice ? 2f : 1.5f; + float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; fastChargeTelegraphTime = protectionBoost ? 60 : (100 - secondPhasePhase * 10); bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastChargeTelegraph = NPC.localAI[1] <= fastChargeTelegraphTime; @@ -1658,21 +1658,21 @@ namespace CalamityMod.NPCs.Yharon float splittingFireballBreathYVelocityTimer = 40f; float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer; - int spinPhaseTimer = secondPhasePhase == 4 ? (malice ? 80 : death ? 100 : 120) : (malice ? 120 : death ? 150 : 180); + int spinPhaseTimer = secondPhasePhase == 4 ? (bossRush ? 80 : death ? 100 : 120) : (bossRush ? 120 : death ? 150 : 180); int flareDustSpawnDivisor = spinPhaseTimer / 10; int flareDustSpawnDivisor2 = spinPhaseTimer / 20 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); float increasedIdleTimeAfterBulletHell = -120f; - float flareSpawnDecelerationTimer = malice ? 60f : death ? 75f : 90f; + float flareSpawnDecelerationTimer = bossRush ? 60f : death ? 75f : 90f; int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0; - float flareSpawnPhaseTimer = (malice ? 120f : death ? 150f : 180f) - flareSpawnPhaseTimerReduction; + float flareSpawnPhaseTimer = (bossRush ? 120f : death ? 150f : 180f) - flareSpawnPhaseTimerReduction; float teleportPhaseTimer = 45f; if (revenge) { - float chargeTimeDecrease = malice ? 6f : death ? 4f : 2f; - float velocityMult = malice ? 1.15f : death ? 1.1f : 1.05f; + float chargeTimeDecrease = bossRush ? 6f : death ? 4f : 2f; + float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; acceleration *= velocityMult; velocity *= velocityMult; chargeTime -= chargeTimeDecrease; diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index cd05066970..7c3edc9f9b 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -37,12 +37,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; - Projectile.timeLeft = malice ? 30 : death ? 40 : revenge ? 45 : expertMode ? 50 : 60; + Projectile.timeLeft = bossRush ? 30 : death ? 40 : revenge ? 45 : expertMode ? 50 : 60; } public override void SendExtraAI(BinaryWriter writer) @@ -76,13 +76,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Determine opacity - float telegraphTotalTime = malice ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; + float telegraphTotalTime = bossRush ? 30f : death ? 40f : revenge ? 45f : expertMode ? 50f : 60f; Projectile.Opacity = Utils.GetLerpValue(0f, 6f, Projectile.timeLeft, true) * Utils.GetLerpValue(telegraphTotalTime, telegraphTotalTime - 6f, Projectile.timeLeft, true); } diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index 8a87972f75..5567bd7f86 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = 1; - Projectile.timeLeft = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 48 : timeLeft; + Projectile.timeLeft = BossRushEvent.BossRushActive ? 48 : timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = true; int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 48 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 48 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -164,7 +164,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 6 : 4; + int totalProjectiles = BossRushEvent.BossRushActive ? 6 : 4; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 0.5f; diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 50c1048800..5566ee7a99 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -118,10 +118,10 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Light Lighting.AddLight(Projectile.Center, 0f, 0.6f, 0f); @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = malice ? 120f : death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; + float stopHomingDistance = bossRush ? 120f : death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; if (distanceFromTarget.Length() < stopHomingDistance || Projectile.ai[0] == 1f || Projectile.timeLeft < 480) { Projectile.ai[0] = 1f; @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = malice ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -152,8 +152,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= scaleFactor; // Fly away from other rockets - float pushForce = malice ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; - float pushDistance = malice ? 120f : death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; + float pushForce = bossRush ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = bossRush ? 120f : death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index e985ea210f..fbbf88a6af 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -89,13 +89,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = malice ? AresBody.deathrayTelegraphDuration_Malice : death ? AresBody.deathrayTelegraphDuration_Death : + float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; Time = Main.npc[OwnerIndex].Calamity().newAI[2] - deathrayTelegraphDuration; @@ -104,12 +104,12 @@ namespace CalamityMod.Projectiles.Boss public override void UpdateLaserMotion() { // Declare difficulty modes. - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; - float angularSlowdownDivisor = malice ? 300f : death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; + float angularSlowdownDivisor = bossRush ? 300f : death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; float angularVelocity = MathHelper.TwoPi * Time / Lifetime / angularSlowdownDivisor; if (Main.npc[OwnerIndex].ai[3] % 2f == 0f) angularVelocity *= -1f; diff --git a/Projectiles/Boss/AresDeathBeamTelegraph.cs b/Projectiles/Boss/AresDeathBeamTelegraph.cs index e478ad4798..4ea6633989 100644 --- a/Projectiles/Boss/AresDeathBeamTelegraph.cs +++ b/Projectiles/Boss/AresDeathBeamTelegraph.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_Malice = 60f; + public const float deathrayTelegraphDuration_BossRush = 60f; public const float TelegraphFadeTime = 15f; public const float TelegraphWidth = 2400f; @@ -48,12 +48,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; - Projectile.timeLeft = (int)(malice ? deathrayTelegraphDuration_Malice : death ? deathrayTelegraphDuration_Death : + Projectile.timeLeft = (int)(bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal); } @@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; - float TelegraphTotalTime = malice ? deathrayTelegraphDuration_Malice : death ? deathrayTelegraphDuration_Death : + float TelegraphTotalTime = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; if (TelegraphDelay >= TelegraphTotalTime) diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 2637bc339d..05f680ce81 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -71,10 +71,10 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Spawn effects if (Projectile.localAI[0] == 0f) @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Boss // Gauss sparks if (Main.myPlayer == Projectile.owner) { - int totalProjectiles = malice ? 18 : 12; + int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = Projectile.velocity.Length(); @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = malice ? 260f : death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; + float stopHomingDistance = bossRush ? 260f : death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; if ((distanceFromTarget.Length() < stopHomingDistance && Projectile.ai[0] != -1f) || Projectile.ai[0] == 1f) { Projectile.ai[0] = 1f; @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = malice ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 6454c1d83c..c721d21a57 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = 1; - Projectile.timeLeft = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 96 : timeLeft; + Projectile.timeLeft = BossRushEvent.BossRushActive ? 96 : timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss } int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 96 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 96 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 12 : 8; + int totalProjectiles = BossRushEvent.BossRushActive ? 12 : 8; // Reduce the total amount of projectiles by half if Ares Plasma Arm is shooting them and in deathray phase and not the last mech if (Projectile.ai[0] == -1f) diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index a27bcd287c..7944b5ff13 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -150,12 +150,12 @@ namespace CalamityMod.Projectiles.Boss return null; // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; - float detachDistance = malice ? 1600f : death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; + float detachDistance = bossRush ? 1600f : death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].type != Projectile.type || Main.projectile[i].ai[0] != Identity + 1f || !Main.projectile[i].active || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index 6eeee68648..c640513dad 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.25f : 1f); + Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 8559fd1954..9bffd81d5b 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -36,11 +36,11 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 1f) { Projectile.extraUpdates = 2; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - float maxVelocity = malice ? 3.75f : 3f; + bool bossRush = BossRushEvent.BossRushActive; + float maxVelocity = bossRush ? 3.75f : 3f; if (Projectile.velocity.Length() < maxVelocity) { - Projectile.velocity *= malice ? 1.02f : 1.015f; + Projectile.velocity *= bossRush ? 1.02f : 1.015f; if (Projectile.velocity.Length() > maxVelocity) { Projectile.velocity.Normalize(); diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 626e30377a..aab3922b27 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -44,10 +44,10 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; - if (Projectile.velocity.Length() < (Projectile.ai[1] == 0f ? (malice ? 17.5f : 14f) : (malice ? 12.5f : 10f))) - Projectile.velocity *= malice ? 1.0125f : 1.01f; + if (Projectile.velocity.Length() < (Projectile.ai[1] == 0f ? (bossRush ? 17.5f : 14f) : (bossRush ? 12.5f : 10f))) + Projectile.velocity *= bossRush ? 1.0125f : 1.01f; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 51f344c26c..af629558c0 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Boss // Cal Clone bullet hell projectiles accelerate after a certain time has passed if (Projectile.ai[0] == 2f && Main.expertMode && Projectile.timeLeft < 1260) { - if (Projectile.velocity.Length() < ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 10f : 8f)) + if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 10f : 8f)) Projectile.velocity *= 1.01f; } diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index ea817c29aa..38af2dc2fe 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -113,13 +113,13 @@ namespace CalamityMod.Projectiles.Boss Vector2 vector79 = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f); // Fire brimstone darts along the laser - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; if (Main.npc[(int)Projectile.ai[1]].ai[1] == 210f && Projectile.owner == Main.myPlayer) { Vector2 velocity = Projectile.velocity; velocity.Normalize(); - float distanceBetweenProjectiles = malice ? 72f : 144f; + float distanceBetweenProjectiles = bossRush ? 72f : 144f; Vector2 fireFrom = new Vector2(Main.npc[(int)Projectile.ai[1]].Center.X + (Main.npc[(int)Projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)Projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles; int projectileAmt = (int)(Projectile.localAI[1] / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index 0395bfc714..7e547bb705 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -84,10 +84,10 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || bossRush; Lighting.AddLight(Projectile.Center, 0f, 0.95f, 1.15f); @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Boss double deg = Projectile.ai[1]; double rad = deg * (Math.PI / 180); - double dist = malice ? 800D : death ? 960D : revenge ? 1000D : expertMode ? 1040D : 1080D; + double dist = bossRush ? 800D : death ? 960D : revenge ? 1000D : expertMode ? 1040D : 1080D; Projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - Projectile.width / 2; Projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - Projectile.height / 2; Projectile.ai[1] += 1f; diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 408c5d5a6f..c77708ddca 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss // If an old velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (OldVelocity != Vector2.Zero) { - Projectile.velocity = OldVelocity * ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.25f : 1f); + Projectile.velocity = OldVelocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); OldVelocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 39e0c9b03a..76be09e805 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.ai[1] == 0f) { - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -81,12 +81,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return (Main.dayTime && !CalamityWorld.malice) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = (Main.dayTime && !CalamityWorld.malice) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; + Texture2D texture = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss double deltaAngle = spread / 8f; double offsetAngle; float velocity = 5f; - int totalProjectiles = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 5 : 4; + int totalProjectiles = (!Main.dayTime || BossRushEvent.BossRushActive) ? 5 : 4; int type = ModContent.ProjectileType(); int damage = (int)Math.Round(Projectile.damage * 0.75); for (int i = 0; i < totalProjectiles; i++) @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss } } SoundEngine.PlaySound(ImpactSound, Projectile.Center); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 4; num193++) { Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 1.5f); @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 480); } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index fd4add234c..62e36bf661 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -1,7 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Events; using CalamityMod.NPCs.Providence; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -83,12 +83,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; + Texture2D texture = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBombNight").Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 150; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - int dustType = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 1.5f); @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 240); } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 13889396ea..b3ccac3aad 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if (Projectile.ai[0] == 0f && (CalamityWorld.malice || BossRushEvent.BossRushActive)) + if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive) Projectile.velocity *= 1.25f; if (Projectile.ai[0] < 240f) @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Texture2D texture = ModContent.Request(Texture).Value; Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = (Main.dayTime && !CalamityWorld.malice) ? new Color(255, 200, 100, 255) : new Color(100, 200, 255, 255); + Color baseColor = (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(255, 200, 100, 255) : new Color(100, 200, 255, 255); baseColor *= 0.5f; baseColor.A = 0; Color colorA = baseColor; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Boss { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); Projectile.ExpandHitboxBy(50); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int d = 0; d < 5; d++) { int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); Projectile.Kill(); } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 1284142c13..021e6df9ea 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.ai[1] = 1f; SoundEngine.PlaySound(SoundID.Item20, Projectile.position); } - Projectile.alpha -= (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 10 : 5; + Projectile.alpha -= (!Main.dayTime || BossRushEvent.BossRushActive) ? 10 : 5; if (Projectile.alpha <= 0) { Projectile.Kill(); @@ -58,12 +58,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return (Main.dayTime && !CalamityWorld.malice) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = (Main.dayTime && !CalamityWorld.malice) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; + Texture2D texture = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFireNight").Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 150; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index bb6ceceedd..2a49923ad2 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 vector11 = Main.player[num103].Center - Projectile.Center; vector11.Normalize(); vector11 *= scaleFactor2; - float inertia = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 20f : 25f; + float inertia = (!Main.dayTime || BossRushEvent.BossRushActive) ? 20f : 25f; Projectile.velocity = (Projectile.velocity * (inertia - 1f) + vector11) / inertia; Projectile.velocity.Normalize(); Projectile.velocity *= scaleFactor2; @@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return (Main.dayTime && !CalamityWorld.malice) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = (Main.dayTime && !CalamityWorld.malice) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + Texture2D texture = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 150; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index e8d287ba57..130834534c 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Y > velocityYCap) Projectile.velocity.Y = velocityYCap; - float velocityX = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 0.025f : 0.02f; + float velocityX = (!Main.dayTime || BossRushEvent.BossRushActive) ? 0.025f : 0.02f; if (Projectile.position.X + Projectile.width < player.position.X) { if (Projectile.velocity.X < 0f) @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity.X -= velocityX; } - float velocityXCap = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 10f : 8f; + float velocityXCap = (!Main.dayTime || BossRushEvent.BossRushActive) ? 10f : 8f; if (Projectile.velocity.X > velocityXCap || Projectile.velocity.X < -velocityXCap) Projectile.velocity.X *= 0.97f; @@ -74,12 +74,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; + Texture2D texture = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFlareNight").Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 50; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - int dustType = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = ((Main.dayTime && !CalamityWorld.malice) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = ((Main.dayTime && !BossRushEvent.BossRushActive) || !NPC.AnyNPCs(ModContent.NPCType())) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index b7560a9aed..2e6c6c530b 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -59,14 +59,14 @@ namespace CalamityMod.Projectiles.Boss velocity = Projectile.velocity; } - float timeGateValue = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 420f : 540f; + float timeGateValue = (!Main.dayTime || BossRushEvent.BossRushActive) ? 420f : 540f; if (Projectile.ai[0] == 0f) { Projectile.ai[1] += 1f; - float slowGateValue = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 60f : 90f; + float slowGateValue = (!Main.dayTime || BossRushEvent.BossRushActive) ? 60f : 90f; float fastGateValue = 30f; - float minVelocity = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 4f : 3f; + float minVelocity = (!Main.dayTime || BossRushEvent.BossRushActive) ? 4f : 3f; float maxVelocity = minVelocity * 4f; float extremeVelocity = maxVelocity * 2f; float deceleration = 0.95f; @@ -95,8 +95,8 @@ namespace CalamityMod.Projectiles.Boss } else { - float frequency = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 0.2f : 0.1f; - float amplitude = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 4f : 2f; + float frequency = (!Main.dayTime || BossRushEvent.BossRushActive) ? 0.2f : 0.1f; + float amplitude = (!Main.dayTime || BossRushEvent.BossRushActive) ? 4f : 2f; Projectile.ai[1] += frequency; @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Boss int blue = Projectile.ai[0] != 0f ? 0 : 125; Color baseColor = new Color(255, green, blue, 255); - if (!Main.dayTime || CalamityWorld.malice) + if (!Main.dayTime || BossRushEvent.BossRushActive) { int red = Projectile.ai[0] != 0f ? 100 : 175; green = Projectile.ai[0] != 0f ? 255 : 175; @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 180); } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index e73e0d6e3a..c60cf8dadf 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.wet || Projectile.lavaWet) Projectile.Kill(); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; if (Projectile.ai[1] == 0f) { for (int d = 0; d < 10; d++) @@ -96,12 +96,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return (Main.dayTime && !CalamityWorld.malice) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = (Main.dayTime && !CalamityWorld.malice) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; + Texture2D texture2D13 = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - int blobAmt = (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) ? 9 : 6; + int blobAmt = (!Main.dayTime || BossRushEvent.BossRushActive) ? 9 : 6; if (Projectile.owner == Main.myPlayer) { for (int b = 0; b < blobAmt; b++) @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Boss } SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 1.5f); @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 240); } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 3300a198e8..1222c06862 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.World; +using CalamityMod.Events; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -64,12 +64,12 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return (Main.dayTime && !CalamityWorld.malice) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); + return (Main.dayTime && !BossRushEvent.BossRushActive) ? new Color(250, 150, 0, Projectile.alpha) : new Color(100, 200, 250, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = (Main.dayTime && !CalamityWorld.malice) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; + Texture2D texture2D13 = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.Request(Texture).Value : ModContent.Request("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0); @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 10; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 120); } diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 220ec5e7e8..feff60000b 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss if (Math.Abs(Projectile.velocity.X) > 2f) Projectile.velocity.X *= 0.99f; - float velocityYLimit = BossRushEvent.BossRushActive ? 10f : CalamityWorld.malice ? 8f : CalamityWorld.death ? 6f : 5f; + float velocityYLimit = BossRushEvent.BossRushActive ? 10f : CalamityWorld.death ? 6f : 5f; if (Projectile.velocity.Y > velocityYLimit) Projectile.velocity.Y = velocityYLimit; } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index 8ff8b53a21..c9b8942cd6 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.width = 160; Projectile.height = 160; Projectile.ignoreWater = true; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 1500 : ((CalamityWorld.death || CalamityWorld.malice) ? 2100 : 3600); + Projectile.timeLeft = BossRushEvent.BossRushActive ? 1500 : CalamityWorld.death ? 2100 : 3600; Projectile.alpha = 255; Projectile.tileCollide = false; Projectile.penetrate = -1; @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss return; } - bool dayTime = Main.dayTime && !CalamityWorld.malice; + bool dayTime = Main.dayTime && !BossRushEvent.BossRushActive; Projectile.position.X = Main.player[Projectile.owner].Center.X - (Projectile.width / 2); Projectile.position.Y = Main.player[Projectile.owner].Center.Y - (Projectile.height / 2) + Main.player[Projectile.owner].gfxOffY - 360f; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index 2db5aa407a..639ab934d1 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if (!Main.dayTime || CalamityWorld.malice || BossRushEvent.BossRushActive) + if (!Main.dayTime || BossRushEvent.BossRushActive) Projectile.extraUpdates = 1; if (Projectile.timeLeft < 300) diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index aebfdd8455..14a95a76e3 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss num807 = 2400f; } - int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + int dustType = (Main.dayTime && !BossRushEvent.BossRushActive) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; float amount = 0.5f; //0.5f Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], num807, amount); //length of laser, linear interpolation Vector2 vector79 = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f); @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Boss { return false; } - bool dayTime = Main.dayTime && !CalamityWorld.malice; + bool dayTime = Main.dayTime && !BossRushEvent.BossRushActive; Texture2D texture2D19 = dayTime ? ModContent.Request(Texture, AssetRequestMode.ImmediateLoad).Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight", AssetRequestMode.ImmediateLoad).Value; Texture2D texture2D20 = dayTime ? ModContent.Request("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value : @@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - int buffType = (Main.dayTime && !CalamityWorld.malice) ? ModContent.BuffType() : ModContent.BuffType(); + int buffType = (Main.dayTime && !BossRushEvent.BossRushActive) ? ModContent.BuffType() : ModContent.BuffType(); target.AddBuff(buffType, 600); } diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 660bf1bd4d..1cb41c2c66 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = 1; - Projectile.extraUpdates = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 2 : 1; + Projectile.extraUpdates = BossRushEvent.BossRushActive ? 2 : 1; } public override void AI() diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index df15c69c97..de30b23676 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || bossRush; if (Projectile.timeLeft < 180) Projectile.tileCollide = true; @@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; - float inertia = malice ? 70f : revenge ? 90f : 110f; - float scaleFactor12 = malice ? 20f : revenge ? 16f : 12f; + float inertia = bossRush ? 70f : revenge ? 90f : 110f; + float scaleFactor12 = bossRush ? 20f : revenge ? 16f : 12f; if (Projectile.alpha > 0) Projectile.alpha -= 10; diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 72a3081f2c..f47dd116eb 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -108,10 +108,10 @@ namespace CalamityMod.Projectiles.Boss return; // Difficulty modes. Used during the firing of the perpendicular lasers. - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool bossRush = BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || bossRush; + bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || bossRush; // Spawn dust at the end of the beam. int dustType = (int)CalamityDusts.Brimstone; @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 beamDirection = Projectile.velocity.SafeNormalize(Vector2.UnitY); - float distanceBetweenProjectiles = malice ? 160f : death ? 256f : revenge ? 288f : 320f; + float distanceBetweenProjectiles = bossRush ? 160f : death ? 256f : revenge ? 288f : 320f; Vector2 laserFirePosition = Main.npc[OwnerIndex].Center + beamDirection * distanceBetweenProjectiles; int laserCount = (int)(LaserLength / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index 63969be022..983c3f3bea 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.25f : 1f); + Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Boss if (Velocity != Vector2.Zero) { Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * ((CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.25f : 1f); + Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index f18e7d27b3..3bca09e3fd 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -37,8 +37,8 @@ namespace CalamityMod.Projectiles.Boss { Lighting.AddLight(Projectile.Center, 0.1f, 0.7f, 0f); - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - if (Projectile.velocity.Length() < (malice ? 6.25f : 5f)) + bool bossRush = BossRushEvent.BossRushActive; + if (Projectile.velocity.Length() < (bossRush ? 6.25f : 5f)) Projectile.velocity *= 1.01f; Projectile.frameCounter++; diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index e8d6ce30ba..68c0645a65 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 640 : CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; + Projectile.timeLeft = BossRushEvent.BossRushActive ? 640 : CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; if (Main.getGoodWorld) Projectile.extraUpdates = 1; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss { if (Projectile.velocity.Length() < 15f && (Main.expertMode || BossRushEvent.BossRushActive)) { - float velocityMult = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; Projectile.velocity *= velocityMult; } } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index 1ea1544434..4b8befc7aa 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 780 : CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; + Projectile.timeLeft = BossRushEvent.BossRushActive ? 780 : CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; if (Main.getGoodWorld) Projectile.extraUpdates = 1; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss { if (Projectile.velocity.Length() < 12f && (Main.expertMode || BossRushEvent.BossRushActive)) { - float velocityMult = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; Projectile.velocity *= velocityMult; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 08f183fb6f..daa5fe0709 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1355,7 +1355,7 @@ namespace CalamityMod.Projectiles projectile.velocity *= 1.02f; } - else if (projectile.type == ProjectileID.CultistBossLightningOrb && (CalamityWorld.malice || BossRushEvent.BossRushActive)) + else if (projectile.type == ProjectileID.CultistBossLightningOrb && BossRushEvent.BossRushActive) { if (NPC.AnyNPCs(NPCID.CultistBoss)) { diff --git a/Systems/MiscWorldStateSystem.cs b/Systems/MiscWorldStateSystem.cs index 28d0e2e95d..c669cc50be 100644 --- a/Systems/MiscWorldStateSystem.cs +++ b/Systems/MiscWorldStateSystem.cs @@ -87,7 +87,6 @@ namespace CalamityMod TalkedToDraedon = false; death = false; armageddon = false; - malice = false; AcidRainEvent.AcidRainEventIsOngoing = false; AcidRainEvent.CountdownUntilForcedAcidRain = 0; } @@ -109,8 +108,6 @@ namespace CalamityMod downed.Add("revenge"); if (death) downed.Add("death"); - if (malice) - downed.Add("malice"); if (Abyss.AtLeftSideOfWorld) downed.Add("abyssSide"); if (BossRushEvent.BossRushActive) @@ -216,7 +213,6 @@ namespace CalamityMod onionMode = downed.Contains("onionMode"); revenge = downed.Contains("revenge"); death = downed.Contains("death"); - malice = downed.Contains("malice"); Abyss.AtLeftSideOfWorld = downed.Contains("abyssSide"); BossRushEvent.BossRushActive = downed.Contains("bossRushActive"); AcidRainEvent.AcidRainEventIsOngoing = downed.Contains("acidRain"); diff --git a/Systems/WorldSyncingSystem.cs b/Systems/WorldSyncingSystem.cs index e3d3b6e9ad..3479844d15 100644 --- a/Systems/WorldSyncingSystem.cs +++ b/Systems/WorldSyncingSystem.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Systems flags10[7] = false; BitsByte flags11 = new BitsByte(); - flags11[0] = malice; + flags11[0] = false; flags11[1] = HasGeneratedLuminitePlanetoids; flags11[2] = downedAdultEidolonWyrm; flags11[3] = downedExoMechs; @@ -259,7 +259,7 @@ namespace CalamityMod.Systems _ = flags10[7]; BitsByte flags11 = reader.ReadByte(); - malice = flags11[0]; + _ = flags11[0]; HasGeneratedLuminitePlanetoids = flags11[1]; downedAdultEidolonWyrm = flags11[2]; downedExoMechs = flags11[3]; diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs index 82d42629a8..542eab5f42 100644 --- a/UI/ModeIndicatorUI.cs +++ b/UI/ModeIndicatorUI.cs @@ -20,8 +20,6 @@ namespace CalamityMod.UI indicatorFrame = 1; if (CalamityWorld.death) indicatorFrame = 2; - if (CalamityWorld.malice) - indicatorFrame = 3; Rectangle mouseRectangle = Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); Rectangle indicatorFrameArea = indicatorTexture.Frame(1, 4, 0, indicatorFrame); @@ -40,11 +38,6 @@ namespace CalamityMod.UI modeToDisplay = "Death"; modeIsActive = CalamityWorld.death; } - if (CalamityWorld.malice) - { - modeToDisplay = "Malice"; - modeIsActive = CalamityWorld.malice; - } Main.instance.MouseText($"{modeToDisplay} Mode is {(modeIsActive ? "active" : "not active")}."); renderingText = true; diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 692238a8a6..261bc6acc3 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -26,7 +26,6 @@ namespace CalamityMod.World public static bool revenge = false; // Revengeance Mode public static bool death = false; // Death Mode public static bool armageddon = false; // Armageddon Mode - public static bool malice = false; // Malice Mode // Sunken Sea public static Rectangle SunkenSeaLocation = Rectangle.Empty; From 4f79056bad7a6c4132501af510d8d1d922b198dc Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 4 Jul 2022 16:40:50 -0500 Subject: [PATCH 23/31] 1 - FTW planetoids also have lava. --- World/Planets/Planetoid.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index 12fd551d9b..5d59e3e6dd 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -84,7 +84,19 @@ namespace CalamityMod.World.Planets { bool convertToRegularSpikes = (j % 2 == 0 && k % 2 == 0) || (j % 2 != 0 && k % 2 != 0); if (Main.tile[j, k].TileType == TileID.WoodenSpikes && convertToRegularSpikes) - Main.tile[j, k].TileType = TileID.Spikes; + { + // Random lava too :^) + if (WorldGen.genRand.NextBool()) + { + Main.tile[j, k].TileType = TileID.Spikes; + } + else + { + Main.tile[j, k].Get().HasTile = false; + Main.tile[j, k].LiquidAmount = 255; + Main.tile[j, k].Get().LiquidType = LiquidID.Lava; + } + } } } } From 4ccb18cd03ea3dcf78f2a4398383c866790cd1bc Mon Sep 17 00:00:00 2001 From: GinYuH <> Date: Mon, 4 Jul 2022 19:02:27 -0700 Subject: [PATCH 24/31] =?UTF-8?q?=F0=9F=A5=96=20and=20fantasy=20talisman?= =?UTF-8?q?=20resprites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Items/Potions/Baguette.cs | 4 ++-- Items/Potions/Baguette.png | Bin 640 -> 595 bytes Items/Weapons/Rogue/FantasyTalisman.cs | 4 ++-- Items/Weapons/Rogue/FantasyTalisman.png | Bin 645 -> 665 bytes Projectiles/Rogue/FantasyTalismanProj.png | Bin 328 -> 328 bytes 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Potions/Baguette.cs b/Items/Potions/Baguette.cs index 2bfa3e149c..7964052dda 100644 --- a/Items/Potions/Baguette.cs +++ b/Items/Potions/Baguette.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.width = 26; - Item.height = 26; + Item.width = 52; + Item.height = 38; Item.useTurn = true; Item.maxStack = 30; Item.useAnimation = 17; diff --git a/Items/Potions/Baguette.png b/Items/Potions/Baguette.png index 82450f4989fa285a865da780917652f9938f7c41..756ae9cd99ab87c78674f911476c702d32163561 100644 GIT binary patch delta 583 zcmV-N0=WHv1=9qO7k?%Q1^@s6i)Ofc0006SNklI ztc=`%g@JRFWAqT5fiv_793v>GpQ?S471Sog?q9MVacuwI*Dp@`U#%+rw|Tzn`u6d7 zbJX7Nue-xmsr{j?W`QyRAlvm**SF8Nhu@~3n)h;h)%9(-C4UR`Fh&_}28eO$JV;`@ zdF_tcNK)o6mJ|@mP%}UtApneLKQQAwa?%=`_iqWM@iAl70Rf=jUz_f**?C|T2$fil z&-=#BmJkqn2-E+a2CD@Ez#!w!zyPf9HnWZ-tfyZhsgoz9AOp<;H z-K;lxGFd=jMt>;7nVkMq^Qd*R-q}D|Kp~n1^_#~yFxRQZo1g2R4dSO>7E+LAVg2SY zzBo`CDZahpw-+FqVAiGX)7+rRl2OpkHVd=|*?l+idy>~csrl5-yQcajIe#*(1LY3c zL273`f`g=XXUTozQ%i}cKiQeFAO%7hW4Kx%JI1(cV1Lwont-lTjW4Zh{mGJ1XsodN zlyQl^&k+Ug7r9|{M z2gERdR6yXVizkv%Gk7sT023^K!bpNTz|{Q!uz VNICMC7a~dt7FS(+11{RV;G!2$dJUx);G%cXTj;tQ3q?c_ zHyTm|{~#?X`4Q6NV)&BImotquX%Z$ro8io4PRM!ky)$zHhJVcFV%oZX@@N8p{j*va z_4()7L;&#pq6$E{(F9=cssg~ouzyg$c{r>uE~FCxq!JGRC|8;xz^~eG0N!n609aVa zSo1!7It-z0W-XTt{v7wtP|*7={*IUs9#5KQn2eb}$7$s{1h)~PSUigyfAetvw9o))|eX>XfavZA}vO3Px%Q%OWYR9J=8m(6PvK^Vq=YfYm`rHQLmLN(DtTRjvMFIrIXECun}`f=C)KoHSC zz=H>Gtshq@6v3lbNL45iR2o}pNyP>d+a{oC(*{`&N1>oY%y8!I%KDVg}m!`%5NRJL#5F`a;uUEQmq2^ zsh2$!=1)(~0?^SN2B0{#3cx@Ht-rv31=gA8a~42fzhasmReR)I@yMAx0R8WdxH=T( zk8UjjaP^*w7i8QQ;J*S+=5I$Hs+N}UKRJ{=7v@s;g8vFM+u^10ger{d_UJD6{=riq za>pnY*L5gyVq+w9|1bEjKruHB zKyA6w6o=a{5;~dB=anK}x1kZXZzPO$CJlhxMA`yKo$3Q@1w)0 z{`sM$1;D-yqJR^^q%`pou$AdOePL4*I+gTa0V#OJfj#?^0K9+p1b`El2LUjXgPJ|J z#mp!YH-nKG8B&l;sH00|LbcVZb{ho3*qIBK=4Q3}U+o5U5F7;rk|%`1>I+kxo~--u z3)7Wy$pH9OTLYja)C$1vSR8=Q*$=MceOKT&ru5OQPtn2h00000NkvXXu0mjf9n~iw literal 645 zcmV;00($+4P)>$l^|Fq2o}OM+9j2>g(iXsC!%2d0J#%HBB@ebirtrUUUodU5GMa-ciw#5 z?Qj44=8ZwAv7y;&2SFBqa`~`A0tG?VMDt?%FMgd`?K?>pzfGB&5_mZ@m1yCm!c1&D z-JUZ5CkMNJ5~*v=9lC$MDF?ud z(RZ;VG@-u12`lao5y^l{g&E5$d;2Tbk`WSG`QDD`$&>vNe~7sD0#R@20D!Nbrh%#l zD2xH{{<0;ChwuFJ+t&bO+A;uaZx(?nS@Fi){2CT>L+X`~lFf+}N*LEr0+301|XXSad~LNk%$P fa%p95bYXO9Z*BlFgjnqF00000NkvXXu0mjf1mhx1 diff --git a/Projectiles/Rogue/FantasyTalismanProj.png b/Projectiles/Rogue/FantasyTalismanProj.png index 197b14099bbc6c7590c52c192ec3f9e6b6c5bbb5..b053f5a34b0e1893d24b7b44f1d02a97701459ac 100644 GIT binary patch literal 328 zcmV-O0k{5%P);00001b5ch_0Itp) z=>Px$0!c(cR5*>rl|O3&K@i1%7lZ`TNCXRuAOSsykisrnBxoxk;beH|0*2B?*VwNwf30~VAG)>XCL_)07>^6 zfbYo<0B_?|h~F>xMqbr33)*w2Z4%URudxE)y`A{I81pxtXRd31hJt3HjuoHE6E5#? zGoOVLdOwFPJKDC}n{Zt99*jKIIflI%F8wJ0PtT>Z3aGAdafgnZ$pNrk&LjN~li5c* a|KSehO;RzG)X<**0000xMTPCu*@%#dvXWx0J983sQTQp^g zi11Yhn>lU{-2Ce5ao%B5CpR_#ky Date: Mon, 4 Jul 2022 19:36:08 -0700 Subject: [PATCH 25/31] onyx drill resprite --- Buffs/Mounts/OnyxExcavatorBuff.png | Bin 615 -> 562 bytes Items/Mounts/OnyxExcavator.cs | 12 ++++++------ Items/Mounts/OnyxExcavatorExtra.png | Bin 1558 -> 756 bytes Items/Mounts/OnyxExcavatorExtra2.png | Bin 3822 -> 1667 bytes Items/Mounts/OnyxExcavator_Back.png | Bin 3822 -> 1667 bytes Items/Mounts/OnyxExcavator_Front.png | Bin 3822 -> 1667 bytes 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Buffs/Mounts/OnyxExcavatorBuff.png b/Buffs/Mounts/OnyxExcavatorBuff.png index d87d9e6a60dac2f599046ae956e608b143a8410b..0d665d14bb10a108b71b964e150ab3585f407355 100644 GIT binary patch delta 538 zcmV+#0_FYZ1hNE>BYy$;NklTR5D4YHc)WtBKjYQLkC?PoCK+2T4|E^@{1a^Jb{ z-FM#id(OS*ykL4N13>xf_ZIhv>8VTr&~u+oqYwZsfOjiz0DoxIPXVZWtK7IS{XFg1 z_W4@vk7K`F$O4c|4FmAD_#W^;fnHsRxiFCEbM2u)#}*Td?a#*mjQ8aLs9qj8_pKj) z6i^JsJe!*Vu7B}ena>6(0IGxv{5(4k$L6K8&L0IV#5|6%u>NTqfR+B&037h+zdpb} z1#Gs*LChEX7k{1k9FqX7wRR)l>u(O&lPxaxam!!_Z*O)oxOd)Ck4dV z?t9^5X#;@Okq^$ivc8l3&6^!sW&Keg4r0DEvK)EeX8jR$pnDSD27eT=v9~d|u@-Zo z5afY>lxWo>9r|Al56d;+dbSH4W7)>_5)8-6Oj)TFG>JxrAyAd zs+|IXFXR}C$mjQ$NT+6~OBO4#$M_Y=f)^J3GPubMtU@U9vL$>A{o8mG0# c`FDH;OA~UmcnMnaaR2}S07*qoM6N<$f?x>;YybcN delta 591 zcmV-V0%-6o#KMlq7rw5|I_u2u9X`A)%t6VGCnH zMJu5(7A7WYWws(#WD`0Q3x5E$p}>}kWWyp0;UmhL^&=5iFrl$pi*~&n3@;|pj7(n zOla?FbH=4FJI?so^GD9uIuxnR{6_#Pzm5R-u(}3#K%k}G4LQG-x(UEmVI6?k>rVg} z;}!r*cXJ>(&=lKM{{nSGMMuHRoi@7)9b0Q*{ z2loKz>gfiO9FY7WAj!FOT=@gQbmz1a->8;>#JR{2<%sUDEa!oQges!{r{JQ!uNSvu z<~k<<$S&uAv!|r#1ma3~yKls~q0^uoxY02NB+leivVZZpU=m2kh*b7>NMir%2H*jK zI0ueT!iuHyYvXjd3lEOM>=qdte;3Uc89CQ!*njIAfs54W-iwGx9N^Xg+c`CzKzs_i z+j{^Q=)VIb*)J&$!8<9}xX|!N&jq002ovPDHLkV1kXiAz=Uj diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 37f2fe4fee..3f03518b0a 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -27,23 +27,23 @@ namespace CalamityMod.Items.Mounts MountData.acceleration = 0.2f; MountData.jumpSpeed = 3f; MountData.swimSpeed = 0.5f; - MountData.totalFrames = 8; + MountData.totalFrames = 6; int[] array = new int[MountData.totalFrames]; for (int l = 0; l < array.Length; l++) { - array[l] = 2; + array[l] = 6; } - array[1] = 0; - array[5] = 0; + array[1] = 4; + array[5] = 4; MountData.playerYOffsets = array; - MountData.xOffset = 0; //-6 + MountData.xOffset = 10; MountData.bodyFrame = 3; MountData.yOffset = -1; //done MountData.playerHeadOffset = 10; MountData.standingFrameCount = 1; MountData.standingFrameDelay = 12; MountData.standingFrameStart = 0; - MountData.runningFrameCount = 8; + MountData.runningFrameCount = 6; MountData.runningFrameDelay = 36; //36 MountData.runningFrameStart = MountData.standingFrameStart; MountData.inAirFrameCount = MountData.standingFrameCount; diff --git a/Items/Mounts/OnyxExcavatorExtra.png b/Items/Mounts/OnyxExcavatorExtra.png index 3e3bab8b47231aed30e98006a558f7e43572aa28..4243a391b5ba0ad1c284d5e56480ec43ce743e75 100644 GIT binary patch literal 756 zcmeAS@N?(olHy`uVBq!ia0vp^6$}iFF&xZ5mdS^%5+Icj;1l8sq)YYc-E@;g1;kWk z^iB2c0(=tkiknyHEdokmg6mFujv24U6vrhJ^FHx6P)?yF$S;`TKYlQ2*4i=#1}0@s z7srr_Id5klENV93VGTAoa{SN#>tdmcXDyk_$(|xu`CVY^^fkv13!IrwI+8W!}8YnX8?T zoL*!vQY0)mF(%;m%OYV;k?t@%)|pk3zLR}!CTx#Rn{Y$!Ysl*0kVU2cZTUoQyUpHl zd9nY78zpn+uVy~-cU$WbEYKjz5n=k>j<4x%1gYyYukow`Kpug ze9^Khd5P0~E^oPT+G#=X)`v;lyG@iXY*_8P9OS4g>l3G+(QCZUdgNRD@&no)Yj!m} zebP0l+XkKb}v5p literal 1558 zcmeAS@N?(olHy`uVBq!ia0vp^RSXP_A2`^6tW4JGcR-3Q$=lt9;Xep2*t>i(0|VA@lJ`D(!I{;}3wZ3`3ed0^? z@B58CCw<+^zUk-VgDNMt+sD>CnZNpl=)xCCuYZ42zqxCcoa+CYufJDb&kg_8zP@IP zise-E$tv>kKU03i*jrk7PU>Aedw<^UL!x_?L}K53n;ZRo@{_IM{(iFiKmL~Y{1^Kv z=jGxj+&}d^Km9w#?m6kZnzZMn^XqG@LVpxj^Z8GDvR3%L>P@Zai`q^XeYa_s$;i9C zOz)dB)2i;{zpE*me}8Fc9G>Lh(RE35Ce?+W$g()#z;{Ro+~HpqSF;Wr;QPrmHA%}f62 z{M}`Cor}WTioZ17+40kR(%MVu{m(yqd95G6e?rRYFE=00x2^cAQ9I?0%-$rCy-VhO zxnsj6pBjJeS^x3xa`RPAF5P`!CGg9sf~&DPF{S{2U3%wwsqyqh z-Dm6CUDHm_ zF?U+*!*`(|#YKH_0@<6V1bmsa$?SCBj#qkVxzobBu##eE7C!rMq#0!R)0g{v*POlN zbn)z(vq4@Lj{?~+5+d$>=$6iIP!xd_%j{JEI&0wz)zsW+vV~V;&)m{kD}tRwv+vBq zPIi#tr!Lpdj+ni)bIRZip(I3nddt?xvew<w&R#8$;&T_dfsPRBiVFfdLNNR;a&)7ynNaOJATzHb02JLecei%} zV?krr%&n1LsBr-nukwtTof^KQIuxXM&SG((BUFJo66gr!b-R$G8;#8hwy%QgKSS#C wL(P2*S?WLmp%T{!Ao6sx@-NCv%_~VP$;{7VFl>o<^B$z!)78&qol`;+0M41=o&W#< diff --git a/Items/Mounts/OnyxExcavatorExtra2.png b/Items/Mounts/OnyxExcavatorExtra2.png index e0ed00a7e4518064f8da62488211b9c7a76cc100..40744ca9e09ae1e9995a56ff6e606b9992107d03 100644 GIT binary patch literal 1667 zcmaJ?c~nwq6emG66>}<6N61#&Gzk$jw^DN@Q`%_UAY6JHD!JsArle(y)s%ostNCn7 z1?`oZlv_!KX!(*7CehT?F-ucRr)Heje{)V}=KgcM4>dRz1+6$N-7?^Gpj+@Y4|Ml|y%)S0*1W1c+7dU5rW?8dzE_ys4pZbJ$;9uCJM-p2ZT{Jzx2)%iL@4-*B`ihl3)lsnY;icW) zdzn_<=t+aTf$Z{5d(sHUeJ|$^{9~5r4JqAW+5A?mJ#IbRcjpi18}Coih+{muakW@cO7#zZEUB7$^#OfamCO9LVt57)bZ*X< zCR1KmEjZ=NB$q9=5DhKb&FGMkW>qiHjB~b`r~=75yWmOukobB?>;0@3nQIxJi8h{b z62nQn2;x3CmY`WetWWhF+n3O0XUvy!+ppZ$kBHqjmO(HUGzdq~#lGCB{?8p!3Y*Y0 zBIp-+pvzaz(5~^6^jspxk!N>iXstF8fj!W_q>D( zj>;mP?*Qz>u?=%+<#m8H<~U%VIDGZquD2(^Gc`2AtyKB;B0F0Jlnv;@{L3v^?Y_G% zIklNJx+0bkG{m+4Bne8I#_GfT5b}2nM9x>OdR-9%{=6slK6KDH)J*m2m>_*xX*xp# zEfo-OBPhb;Teo}Pphlhzr~Dat#~Rn!2{1~j*XYyiljGxENwSiWZ8+w=^d!eC{hmjp z_?97um`LU6#^Eh=qJ1-2%CYV+Eu>fzbw;zNc#Oi)=R&g>2`EPe?nxEiOI>o89YaFW zi5#gu;U(Yu7%*yrk5V=x0DL-FXouUts4h}+MR_DOR(S8*bq^B982gN95FE`+H)KUC ziyOa99yID3#5xrL_Ub~4rffCnwJ~=rs@Z3*xWR~6YW@&qhJ7kNQa^qOeH?HdAVe%p z-rM~eGRX|0sVWtaiIB2pyn4KIFf=Tf4;(~*)%|^bt7|Af{zf62STKa!USuMyS=3bA zvojnhW5|js0c(vCaqwE2s)M@<2F+?RoD{!9CRr^I!9LzEU_I9jZe3uJaPtFUaO8Xy zLKT%mGxQi<`9(jk%p(UGi$Vmn@Xq0BMT=e^0rq{LK}<%XVV6AKx_v}Vtr>e8nq2n)&=OVE8`dI$@`A{g%7rIa8zTmwP$miKd^UK}kW zN^0ul*og@Y`6WlohJG|Zc^}wUNZA>?UP2r%MbH0c literal 3822 zcmdT{`#;nBA77H|=^~e$9LlhCINfB*l2c8{wTPBnA`}}XCWLOngtX%npGFkEav8?t zGD@kW5iy$&_N^}#yQnlfVtn7z>3hx(-+$mdw#Vc3dF;K<`}2A|Z|^PD)!BBX%6b(9 z02U{#+QTDpWC?O*dtCH-o``j-K3Mp2!pKLX+ zcOM_9xfsarWNQVUnqGNS1N|FPMNVns#?RsZwqE1*%y3?A?ZPF46^3ir1+NbNR_5sE zwV|l(`mL<_a}G+7!&#nS#40+@rMs)kIbXy}eK0)o)~tSpBATG&1f%x-A?|FoXGF1S zefa*g)}~KzY4kaFJt%g$pT+Czx3!b?ltoRearx9=-WfKkksQ8|48x5sLwfol_UP2G zYyNAcX;X`bu-LrY=aI;W7@`ju{Yrb%X#VO`MKiUm)nfr_YO`;-3){r`r`LcDg1UV! zgt=Z$9A4zz>khq@dCnO5x%n=XnsOqKvM%e>i$hL-C?>DQVn+|mUKmp|3aPP=G!WP? zW*e!g?Vf(N;D|Mh!m>9`I4Jj4f6BB-XeC=;)7ze*dva$-C{N|^#-8+Tb1YAv-5P2Q zA7A$z`=c$JnwIi%7&BEd-x@K^!kDOr^ln(-`AtMYAN$y*-Vw!ms+j~|%>Z*SiGkymTqi|D9bYL!nhz!hrlc5s|N@- zf#-2(>+<+fdeZ*eEhflKWYIbN4^!fXK2x6w=#qPH*PiOF-qt!5CIX73mAcyOe44En zr;Bi)P)9$m0wYde{N$3*Fmpb4bWWmIe$khwu=$8BV(Y$m$$=h&-;;;)=kgZ<0-Ih) zx?W?k3v;sv)N;0P00GW-)yGlu0yo=Moy3`m9_k*n@{CS+u$V+?hjC5*nLm`ukKM`* zy#W7*kw4fam6ik}k&24>DKAB2r$U{R-i4kSCoR!?iIX2NpFi|Gy+8f2q@}rUOO#I@ z(mbs`|Luc|!uLnj)M5gOHdt)stBBsp&WPTH*bBB;?8u@-oDJWe+*%h;r$`p68=gB} z!#=eW#H@@o#h}N3GLoi^NwWKL8~ikMX*wM*%5xVixl4NVIkj0i0 zz9BsE6oU!}!ZEg0-T;ty*uo85i~%xjx}}}{mWgV@JvP-f0(U@QBy5 zIZ|t$v0;8&8H1A4a@L5-a7sa;#ff8enLeEl^P3p)5?bvk@`r;jool7nMIkeTl9%tY z;; zT3{bekA$?!VRFwN$+X_g{4t4v1*hm&0Ln8>)K>2WdP>UOk+_I4O;o8bRUqi|F$+wr z7sbU(+}Q>B@clMoq@gJI!^vZ3gZ!46ZU19AG$Mjs*==2jG#Mp|}+`HCuX2 z^82gbi`sKiUXGN$MMel3!;{@V3$j2Jhlh7Z-O>bB+_aW4 zp)Q{hPZnnR300sjqMK)S*NX*_bckDYo?j$VqosPE!{P>Ah8Ii8&=ssj+v)DtHPL~S zv%=!;9XTZP&@be2T)0dO=~OwP!(>As^uE7?p<))*UmWjE#^;|{vjRNlerC_yoD0a5 zCr>u%ShbdE6elQjxZ3SR{JN`cPuzM~uuc2EP5~Pm01a;e2$39i(mCgVgj^j9tC<<9 zfL%OImmO4~QpF_tK}kP9MneeL^qM?e?y?j@e=TqMnpL?0Pg}DNPg4M8J)Q<`Lsc>T zp`_f$=rn>>h#V~VwTij_updN_2d%M#DAG2xY5~}?fx!;amuCm*hU63hoqC~P9YV?;x@7+()s`|#oshw`9I)ZPHl08`0es~L2_K_Xk6t3sm&2y+%jg_1pS~eGDE^^#88{^Vw@mEG zjFbXsANfJ%puF*eK$GT|30kmepFAB0W>9AbDT3BWaxmWDrVJgvVBHcXoYz9|U48I@ zYo{p%YavJHI0Ar`NY%{ahpM{)@~(bR6zBqA%

w>YX7ppV{Wt^~z@MzNQ(b%$gGx zZ{-~WkSo~CLWh!1CpsNDPeJv}H0_eBsGnvN(@u3ux@U*J5`oe&fe~;y%1J#$eLSmC z?pc{dtuN@#5Fi}I!dFn^VO(=;^wiz%kPH=0j02)<7+Gq8c&0huonBzr9MYvR>@p!FLN=FxTDej=qY9{&^CnJvPSK=53)!`ej z=OODykOeWV1_4kKGG_>F60s9i93&hRi70#Ea*7R)<)#&^IN-suQUIN=#?w~GIwo_1 zEEwUjURoS?D=%5=z*Z#L`X4c8+!{&X_W3K&@X2Jkc)e-N0%(E=84&TMits^1GqGLHf<<#El>+ zjjNbwxuv-6N;tV>T;`Auh&nmYcHQgVrNm&$gLdy7gYjDeyv}I;x%iC*isjO5AnXS2 zZYEZ6@&@>PqDTIuFP|gJh@;yY2s5K~N6V%<^CZC;rj0vFq_G`NVi3y@@8MwlG}~gncpP>0Nl^ni7podeOK7DnvTCTa&$v;bfz@nrhrnNwCvJ+btQ&mjMC|O0-Gmpn* zv{&9J^7tT#3FF2RzvUr~IcVZpp4O{}+nKW|W0w{G3}<6N61#&Gzk$jw^DN@Q`%_UAY6JHD!JsArle(y)s%ostNCn7 z1?`oZlv_!KX!(*7CehT?F-ucRr)Heje{)V}=KgcM4>dRz1+6$N-7?^Gpj+@Y4|Ml|y%)S0*1W1c+7dU5rW?8dzE_ys4pZbJ$;9uCJM-p2ZT{Jzx2)%iL@4-*B`ihl3)lsnY;icW) zdzn_<=t+aTf$Z{5d(sHUeJ|$^{9~5r4JqAW+5A?mJ#IbRcjpi18}Coih+{muakW@cO7#zZEUB7$^#OfamCO9LVt57)bZ*X< zCR1KmEjZ=NB$q9=5DhKb&FGMkW>qiHjB~b`r~=75yWmOukobB?>;0@3nQIxJi8h{b z62nQn2;x3CmY`WetWWhF+n3O0XUvy!+ppZ$kBHqjmO(HUGzdq~#lGCB{?8p!3Y*Y0 zBIp-+pvzaz(5~^6^jspxk!N>iXstF8fj!W_q>D( zj>;mP?*Qz>u?=%+<#m8H<~U%VIDGZquD2(^Gc`2AtyKB;B0F0Jlnv;@{L3v^?Y_G% zIklNJx+0bkG{m+4Bne8I#_GfT5b}2nM9x>OdR-9%{=6slK6KDH)J*m2m>_*xX*xp# zEfo-OBPhb;Teo}Pphlhzr~Dat#~Rn!2{1~j*XYyiljGxENwSiWZ8+w=^d!eC{hmjp z_?97um`LU6#^Eh=qJ1-2%CYV+Eu>fzbw;zNc#Oi)=R&g>2`EPe?nxEiOI>o89YaFW zi5#gu;U(Yu7%*yrk5V=x0DL-FXouUts4h}+MR_DOR(S8*bq^B982gN95FE`+H)KUC ziyOa99yID3#5xrL_Ub~4rffCnwJ~=rs@Z3*xWR~6YW@&qhJ7kNQa^qOeH?HdAVe%p z-rM~eGRX|0sVWtaiIB2pyn4KIFf=Tf4;(~*)%|^bt7|Af{zf62STKa!USuMyS=3bA zvojnhW5|js0c(vCaqwE2s)M@<2F+?RoD{!9CRr^I!9LzEU_I9jZe3uJaPtFUaO8Xy zLKT%mGxQi<`9(jk%p(UGi$Vmn@Xq0BMT=e^0rq{LK}<%XVV6AKx_v}Vtr>e8nq2n)&=OVE8`dI$@`A{g%7rIa8zTmwP$miKd^UK}kW zN^0ul*og@Y`6WlohJG|Zc^}wUNZA>?UP2r%MbH0c literal 3822 zcmdT{`#;nBA77H|=^~e$9LlhCINfB*l2c8{wTPBnA`}}XCWLOngtX%npGFkEav8?t zGD@kW5iy$&_N^}#yQnlfVtn7z>3hx(-+$mdw#Vc3dF;K<`}2A|Z|^PD)!BBX%6b(9 z02U{#+QTDpWC?O*dtCH-o``j-K3Mp2!pKLX+ zcOM_9xfsarWNQVUnqGNS1N|FPMNVns#?RsZwqE1*%y3?A?ZPF46^3ir1+NbNR_5sE zwV|l(`mL<_a}G+7!&#nS#40+@rMs)kIbXy}eK0)o)~tSpBATG&1f%x-A?|FoXGF1S zefa*g)}~KzY4kaFJt%g$pT+Czx3!b?ltoRearx9=-WfKkksQ8|48x5sLwfol_UP2G zYyNAcX;X`bu-LrY=aI;W7@`ju{Yrb%X#VO`MKiUm)nfr_YO`;-3){r`r`LcDg1UV! zgt=Z$9A4zz>khq@dCnO5x%n=XnsOqKvM%e>i$hL-C?>DQVn+|mUKmp|3aPP=G!WP? zW*e!g?Vf(N;D|Mh!m>9`I4Jj4f6BB-XeC=;)7ze*dva$-C{N|^#-8+Tb1YAv-5P2Q zA7A$z`=c$JnwIi%7&BEd-x@K^!kDOr^ln(-`AtMYAN$y*-Vw!ms+j~|%>Z*SiGkymTqi|D9bYL!nhz!hrlc5s|N@- zf#-2(>+<+fdeZ*eEhflKWYIbN4^!fXK2x6w=#qPH*PiOF-qt!5CIX73mAcyOe44En zr;Bi)P)9$m0wYde{N$3*Fmpb4bWWmIe$khwu=$8BV(Y$m$$=h&-;;;)=kgZ<0-Ih) zx?W?k3v;sv)N;0P00GW-)yGlu0yo=Moy3`m9_k*n@{CS+u$V+?hjC5*nLm`ukKM`* zy#W7*kw4fam6ik}k&24>DKAB2r$U{R-i4kSCoR!?iIX2NpFi|Gy+8f2q@}rUOO#I@ z(mbs`|Luc|!uLnj)M5gOHdt)stBBsp&WPTH*bBB;?8u@-oDJWe+*%h;r$`p68=gB} z!#=eW#H@@o#h}N3GLoi^NwWKL8~ikMX*wM*%5xVixl4NVIkj0i0 zz9BsE6oU!}!ZEg0-T;ty*uo85i~%xjx}}}{mWgV@JvP-f0(U@QBy5 zIZ|t$v0;8&8H1A4a@L5-a7sa;#ff8enLeEl^P3p)5?bvk@`r;jool7nMIkeTl9%tY z;; zT3{bekA$?!VRFwN$+X_g{4t4v1*hm&0Ln8>)K>2WdP>UOk+_I4O;o8bRUqi|F$+wr z7sbU(+}Q>B@clMoq@gJI!^vZ3gZ!46ZU19AG$Mjs*==2jG#Mp|}+`HCuX2 z^82gbi`sKiUXGN$MMel3!;{@V3$j2Jhlh7Z-O>bB+_aW4 zp)Q{hPZnnR300sjqMK)S*NX*_bckDYo?j$VqosPE!{P>Ah8Ii8&=ssj+v)DtHPL~S zv%=!;9XTZP&@be2T)0dO=~OwP!(>As^uE7?p<))*UmWjE#^;|{vjRNlerC_yoD0a5 zCr>u%ShbdE6elQjxZ3SR{JN`cPuzM~uuc2EP5~Pm01a;e2$39i(mCgVgj^j9tC<<9 zfL%OImmO4~QpF_tK}kP9MneeL^qM?e?y?j@e=TqMnpL?0Pg}DNPg4M8J)Q<`Lsc>T zp`_f$=rn>>h#V~VwTij_updN_2d%M#DAG2xY5~}?fx!;amuCm*hU63hoqC~P9YV?;x@7+()s`|#oshw`9I)ZPHl08`0es~L2_K_Xk6t3sm&2y+%jg_1pS~eGDE^^#88{^Vw@mEG zjFbXsANfJ%puF*eK$GT|30kmepFAB0W>9AbDT3BWaxmWDrVJgvVBHcXoYz9|U48I@ zYo{p%YavJHI0Ar`NY%{ahpM{)@~(bR6zBqA%

w>YX7ppV{Wt^~z@MzNQ(b%$gGx zZ{-~WkSo~CLWh!1CpsNDPeJv}H0_eBsGnvN(@u3ux@U*J5`oe&fe~;y%1J#$eLSmC z?pc{dtuN@#5Fi}I!dFn^VO(=;^wiz%kPH=0j02)<7+Gq8c&0huonBzr9MYvR>@p!FLN=FxTDej=qY9{&^CnJvPSK=53)!`ej z=OODykOeWV1_4kKGG_>F60s9i93&hRi70#Ea*7R)<)#&^IN-suQUIN=#?w~GIwo_1 zEEwUjURoS?D=%5=z*Z#L`X4c8+!{&X_W3K&@X2Jkc)e-N0%(E=84&TMits^1GqGLHf<<#El>+ zjjNbwxuv-6N;tV>T;`Auh&nmYcHQgVrNm&$gLdy7gYjDeyv}I;x%iC*isjO5AnXS2 zZYEZ6@&@>PqDTIuFP|gJh@;yY2s5K~N6V%<^CZC;rj0vFq_G`NVi3y@@8MwlG}~gncpP>0Nl^ni7podeOK7DnvTCTa&$v;bfz@nrhrnNwCvJ+btQ&mjMC|O0-Gmpn* zv{&9J^7tT#3FF2RzvUr~IcVZpp4O{}+nKW|W0w{G3}<6N61#&Gzk$jw^DN@Q`%_UAY6JHD!JsArle(y)s%ostNCn7 z1?`oZlv_!KX!(*7CehT?F-ucRr)Heje{)V}=KgcM4>dRz1+6$N-7?^Gpj+@Y4|Ml|y%)S0*1W1c+7dU5rW?8dzE_ys4pZbJ$;9uCJM-p2ZT{Jzx2)%iL@4-*B`ihl3)lsnY;icW) zdzn_<=t+aTf$Z{5d(sHUeJ|$^{9~5r4JqAW+5A?mJ#IbRcjpi18}Coih+{muakW@cO7#zZEUB7$^#OfamCO9LVt57)bZ*X< zCR1KmEjZ=NB$q9=5DhKb&FGMkW>qiHjB~b`r~=75yWmOukobB?>;0@3nQIxJi8h{b z62nQn2;x3CmY`WetWWhF+n3O0XUvy!+ppZ$kBHqjmO(HUGzdq~#lGCB{?8p!3Y*Y0 zBIp-+pvzaz(5~^6^jspxk!N>iXstF8fj!W_q>D( zj>;mP?*Qz>u?=%+<#m8H<~U%VIDGZquD2(^Gc`2AtyKB;B0F0Jlnv;@{L3v^?Y_G% zIklNJx+0bkG{m+4Bne8I#_GfT5b}2nM9x>OdR-9%{=6slK6KDH)J*m2m>_*xX*xp# zEfo-OBPhb;Teo}Pphlhzr~Dat#~Rn!2{1~j*XYyiljGxENwSiWZ8+w=^d!eC{hmjp z_?97um`LU6#^Eh=qJ1-2%CYV+Eu>fzbw;zNc#Oi)=R&g>2`EPe?nxEiOI>o89YaFW zi5#gu;U(Yu7%*yrk5V=x0DL-FXouUts4h}+MR_DOR(S8*bq^B982gN95FE`+H)KUC ziyOa99yID3#5xrL_Ub~4rffCnwJ~=rs@Z3*xWR~6YW@&qhJ7kNQa^qOeH?HdAVe%p z-rM~eGRX|0sVWtaiIB2pyn4KIFf=Tf4;(~*)%|^bt7|Af{zf62STKa!USuMyS=3bA zvojnhW5|js0c(vCaqwE2s)M@<2F+?RoD{!9CRr^I!9LzEU_I9jZe3uJaPtFUaO8Xy zLKT%mGxQi<`9(jk%p(UGi$Vmn@Xq0BMT=e^0rq{LK}<%XVV6AKx_v}Vtr>e8nq2n)&=OVE8`dI$@`A{g%7rIa8zTmwP$miKd^UK}kW zN^0ul*og@Y`6WlohJG|Zc^}wUNZA>?UP2r%MbH0c literal 3822 zcmdT{`#;nBA77H|=^~e$9LlhCINfB*l2c8{wTPBnA`}}XCWLOngtX%npGFkEav8?t zGD@kW5iy$&_N^}#yQnlfVtn7z>3hx(-+$mdw#Vc3dF;K<`}2A|Z|^PD)!BBX%6b(9 z02U{#+QTDpWC?O*dtCH-o``j-K3Mp2!pKLX+ zcOM_9xfsarWNQVUnqGNS1N|FPMNVns#?RsZwqE1*%y3?A?ZPF46^3ir1+NbNR_5sE zwV|l(`mL<_a}G+7!&#nS#40+@rMs)kIbXy}eK0)o)~tSpBATG&1f%x-A?|FoXGF1S zefa*g)}~KzY4kaFJt%g$pT+Czx3!b?ltoRearx9=-WfKkksQ8|48x5sLwfol_UP2G zYyNAcX;X`bu-LrY=aI;W7@`ju{Yrb%X#VO`MKiUm)nfr_YO`;-3){r`r`LcDg1UV! zgt=Z$9A4zz>khq@dCnO5x%n=XnsOqKvM%e>i$hL-C?>DQVn+|mUKmp|3aPP=G!WP? zW*e!g?Vf(N;D|Mh!m>9`I4Jj4f6BB-XeC=;)7ze*dva$-C{N|^#-8+Tb1YAv-5P2Q zA7A$z`=c$JnwIi%7&BEd-x@K^!kDOr^ln(-`AtMYAN$y*-Vw!ms+j~|%>Z*SiGkymTqi|D9bYL!nhz!hrlc5s|N@- zf#-2(>+<+fdeZ*eEhflKWYIbN4^!fXK2x6w=#qPH*PiOF-qt!5CIX73mAcyOe44En zr;Bi)P)9$m0wYde{N$3*Fmpb4bWWmIe$khwu=$8BV(Y$m$$=h&-;;;)=kgZ<0-Ih) zx?W?k3v;sv)N;0P00GW-)yGlu0yo=Moy3`m9_k*n@{CS+u$V+?hjC5*nLm`ukKM`* zy#W7*kw4fam6ik}k&24>DKAB2r$U{R-i4kSCoR!?iIX2NpFi|Gy+8f2q@}rUOO#I@ z(mbs`|Luc|!uLnj)M5gOHdt)stBBsp&WPTH*bBB;?8u@-oDJWe+*%h;r$`p68=gB} z!#=eW#H@@o#h}N3GLoi^NwWKL8~ikMX*wM*%5xVixl4NVIkj0i0 zz9BsE6oU!}!ZEg0-T;ty*uo85i~%xjx}}}{mWgV@JvP-f0(U@QBy5 zIZ|t$v0;8&8H1A4a@L5-a7sa;#ff8enLeEl^P3p)5?bvk@`r;jool7nMIkeTl9%tY z;; zT3{bekA$?!VRFwN$+X_g{4t4v1*hm&0Ln8>)K>2WdP>UOk+_I4O;o8bRUqi|F$+wr z7sbU(+}Q>B@clMoq@gJI!^vZ3gZ!46ZU19AG$Mjs*==2jG#Mp|}+`HCuX2 z^82gbi`sKiUXGN$MMel3!;{@V3$j2Jhlh7Z-O>bB+_aW4 zp)Q{hPZnnR300sjqMK)S*NX*_bckDYo?j$VqosPE!{P>Ah8Ii8&=ssj+v)DtHPL~S zv%=!;9XTZP&@be2T)0dO=~OwP!(>As^uE7?p<))*UmWjE#^;|{vjRNlerC_yoD0a5 zCr>u%ShbdE6elQjxZ3SR{JN`cPuzM~uuc2EP5~Pm01a;e2$39i(mCgVgj^j9tC<<9 zfL%OImmO4~QpF_tK}kP9MneeL^qM?e?y?j@e=TqMnpL?0Pg}DNPg4M8J)Q<`Lsc>T zp`_f$=rn>>h#V~VwTij_updN_2d%M#DAG2xY5~}?fx!;amuCm*hU63hoqC~P9YV?;x@7+()s`|#oshw`9I)ZPHl08`0es~L2_K_Xk6t3sm&2y+%jg_1pS~eGDE^^#88{^Vw@mEG zjFbXsANfJ%puF*eK$GT|30kmepFAB0W>9AbDT3BWaxmWDrVJgvVBHcXoYz9|U48I@ zYo{p%YavJHI0Ar`NY%{ahpM{)@~(bR6zBqA%

w>YX7ppV{Wt^~z@MzNQ(b%$gGx zZ{-~WkSo~CLWh!1CpsNDPeJv}H0_eBsGnvN(@u3ux@U*J5`oe&fe~;y%1J#$eLSmC z?pc{dtuN@#5Fi}I!dFn^VO(=;^wiz%kPH=0j02)<7+Gq8c&0huonBzr9MYvR>@p!FLN=FxTDej=qY9{&^CnJvPSK=53)!`ej z=OODykOeWV1_4kKGG_>F60s9i93&hRi70#Ea*7R)<)#&^IN-suQUIN=#?w~GIwo_1 zEEwUjURoS?D=%5=z*Z#L`X4c8+!{&X_W3K&@X2Jkc)e-N0%(E=84&TMits^1GqGLHf<<#El>+ zjjNbwxuv-6N;tV>T;`Auh&nmYcHQgVrNm&$gLdy7gYjDeyv}I;x%iC*isjO5AnXS2 zZYEZ6@&@>PqDTIuFP|gJh@;yY2s5K~N6V%<^CZC;rj0vFq_G`NVi3y@@8MwlG}~gncpP>0Nl^ni7podeOK7DnvTCTa&$v;bfz@nrhrnNwCvJ+btQ&mjMC|O0-Gmpn* zv{&9J^7tT#3FF2RzvUr~IcVZpp4O{}+nKW|W0w{G3 Date: Tue, 5 Jul 2022 13:02:39 -0500 Subject: [PATCH 26/31] Increased Frost Barrier drop chance from Ice Claspers (10% to 20%) --- NPCs/NormalNPCs/IceClasper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 1d38bb041f..b838d5fc29 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType()); - npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ModContent.ItemType(), 5); npcLoot.Add(ModContent.ItemType(), 3); } } From da437420d079d070278d236403179a37dab04437 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Tue, 5 Jul 2022 13:05:40 -0500 Subject: [PATCH 27/31] Increased Ink Bomb drop rates again --- NPCs/Abyss/ColossalSquid.cs | 2 +- NPCs/Abyss/Cuttlefish.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 239187383d..cf7939ef10 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -554,7 +554,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.BlackInk, 1, 3, 5); - npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ModContent.ItemType(), 5); var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 26, 38, 31, 45)); diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index b44e383a6a..0a1790393d 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -384,7 +384,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2); - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 40, 20)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 20, 10)); } public override void HitEffect(int hitDirection, double damage) From 021903332a9a68cad1d7d061970f449454e1c1b3 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Tue, 5 Jul 2022 13:24:13 -0500 Subject: [PATCH 28/31] Biome crates have a research req of 5 for some reason. --- Items/Fishing/AstralCatches/AstralCrate.cs | 2 +- Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs | 2 +- Items/Fishing/SulphurCatches/AbyssalCrate.cs | 2 +- Items/Fishing/SunkenSeaCatches/SunkenCrate.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 8528a32be3..db3db03d97 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches { public override void SetStaticDefaults() { - SacrificeTotal = 10; + SacrificeTotal = 5; DisplayName.SetDefault("Astral Crate"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); } diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index c245e2b9f6..0aa91b4a07 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public override void SetStaticDefaults() { - SacrificeTotal = 10; + SacrificeTotal = 5; DisplayName.SetDefault("Brimstone Crate"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); } diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index 1a74fa1c33..41a1285b34 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches { public override void SetStaticDefaults() { - SacrificeTotal = 10; + SacrificeTotal = 5; DisplayName.SetDefault("Abyssal Crate"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); } diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index fef2e81146..f5157d8d21 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { public override void SetStaticDefaults() { - SacrificeTotal = 10; + SacrificeTotal = 5; DisplayName.SetDefault("Sunken Crate"); Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); } From b59bc5689a3fa98c37ac0c2b230da9e8b0d8291b Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 5 Jul 2022 14:43:22 -0500 Subject: [PATCH 29/31] 1 - Soaring Insignia boosts flight time by 25% instead of 50% because it was a wee bit overpowered. --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/CalamityGlobalItemTooltip.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c80ad8142b..190adc7578 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2596,7 +2596,7 @@ namespace CalamityMod.CalPlayer (prismaticGreaves ? 0.1 : 0D) + (plagueReaper ? 0.05 : 0D) + (draconicSurge ? 0.2 : 0D) + - (Player.empressBrooch ? 0.5 : 0D); + (Player.empressBrooch ? 0.25 : 0D); if (harpyRing) Player.moveSpeed += 0.1f; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index a7e858ef55..e5cc962c50 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -590,7 +590,7 @@ namespace CalamityMod.Items // Soaring Insignia nerf and clear explanation of what it actually does. if (item.type == ItemID.EmpressFlightBooster) { - EditTooltipByNum(0, (line) => line.Text = "Increases wing flight time by 50%"); + EditTooltipByNum(0, (line) => line.Text = "Increases wing flight time by 25%"); EditTooltipByNum(1, (line) => line.Text = "Increases movement and jump speed by 10% and acceleration by 1.1x"); } From 2d1db6fdc35c055e0ac03577be0db04c594bba5a Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 5 Jul 2022 15:15:05 -0500 Subject: [PATCH 30/31] 1 - Storm Weaver projectiles have larger gaps between them. --- NPCs/StormWeaver/StormWeaverHead.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 07ff8be47f..0a3ea05188 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.StormWeaver int type = ProjectileID.FrostWave; int waveDamage = NPC.GetProjectileDamage(type); int totalWaves = death ? (phase4 ? 27 : 25) : (phase4 ? 25 : 23); - int shotSpacing = death ? (phase4 ? 148 : 160) : (phase4 ? 160 : 172); + int shotSpacing = death ? (phase4 ? 185 : 200) : (phase4 ? 200 : 215); float projectileSpawnX = Main.player[NPC.target].Center.X - totalWaves * shotSpacing * 0.5f; // Start fast at index 0, become slower as each projectile spawns and then become faster past the central wave @@ -494,7 +494,7 @@ namespace CalamityMod.NPCs.StormWeaver int projectileType = ModContent.ProjectileType(); int tornadoDamage = NPC.GetProjectileDamage(projectileType); int totalTornadoes = revenge ? 7 : expertMode ? 5 : 3; - float spawnDistance = revenge ? 600f : expertMode ? 720f : 840f; + float spawnDistance = revenge ? 750f : expertMode ? 900f : 1050f; for (int i = 0; i < totalTornadoes; i++) { Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * spawnDistance * (i - totalTornadoes / 2); From c4ff86c9c6fa1ba204f95c28d590b251d58adcaf Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 5 Jul 2022 16:16:13 -0500 Subject: [PATCH 31/31] 1 - Dungeon Guardian has 90% DR instead of 99.9999% DR. --- CalamityMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 653f588f55..a65ab5b7de 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -478,7 +478,7 @@ namespace CalamityMod { NPCID.DiabolistRed, 0.2f }, { NPCID.DiabolistWhite, 0.2f }, { NPCID.DukeFishron, 0.15f }, - { NPCID.DungeonGuardian, 0.999999f }, + { NPCID.DungeonGuardian, 0.9f }, { NPCID.DungeonSpirit, 0.2f }, { NPCID.ElfCopter, 0.15f }, { NPCID.Everscream, 0.1f },