From a71d9f609d49146a0001927bd9365efa1cb0f0de Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 17 Oct 2023 12:24:41 -0400 Subject: [PATCH 01/48] Add readme and license (already in private repo) --- LICENSE.md | 7 +++++++ README.md | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..7b9e3935c2 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +**The Calamity Mod and all associated source code, visual assets and audio assets, is all rights reserved (ARR), with the following stipulations:** + +- Open source contributions to this repository are welcome. +- You may use the source code of the Calamity Mod as a reference for building or developing Terraria mods or other software. +- Code lifted from the Calamity Mod repository must be credited to the Calamity Team. +- The Calamity Mod cannot be redistributed in any form or in any location. The Steam Workshop is the only officially hosted download of the Calamity Mod. +- All music tracks are the property of their respective composers and are used by the Calamity Team with permission. \ No newline at end of file diff --git a/README.md b/README.md index bab1b4d500..1a934c316c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ -# CalamityMod -The private repository for the Calamity Mod. +# Calamity Mod +[![Discord](https://img.shields.io/discord/225030931008847874)](https://discord.gg/calamity) +- [Official site](https://calamitymod.com/) +- [Steam Workshop](https://calamitymod.com/download/) +- [Discord](https://discord.gg/calamity) +- [Official Wiki](https://calamitymod.wiki.gg/) +- [Patreon](https://patreon.com/fabsol) + +The Calamity Mod is a vast content mod for Terraria which adds dozens of bosses and thousands of items to create an intense and varied experience. The mod must be installed using [tModLoader](https://github.com/tModLoader/tModLoader). + +**Note:** This repository contains only the latest public release of the Calamity Mod and any public contributions made since then. + +Active development by Calamity developers occurs on a separate, private repository. Contributions made here will be cherry picked into that repository. When an update is released to the Steam Workshop, the `1.4.4-release` branch is replaced with the matching branch from the private repository. + +**Do not redistribute the Calamity Mod.** Creating your own builds of the mod from an in-development sourcetree will cause confusion in the community and will make players' mods fail to sync in multiplayer. We will take down any copies of the Calamity Mod published to Steam Workshop or rehosted elsewhere, and reserve the right to take legal action as we see fit. \ No newline at end of file From d4cac103f6c137e27449b273f3210a7de9c3f41d Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 17 Oct 2023 18:19:16 -0400 Subject: [PATCH 02/48] Update license regarding contributions. --- LICENSE.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 7b9e3935c2..14b42fd06e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,12 @@ -**The Calamity Mod and all associated source code, visual assets and audio assets, is all rights reserved (ARR), with the following stipulations:** +**The Calamity Mod and all associated source code, visual assets and audio assets, is all rights reserved (ARR).** +The following stipulations apply to *contributing* to the Calamity Mod: - Open source contributions to this repository are welcome. +- If you contribute to the Calamity Mod, you expressly give the Calamity Team permission to use and reproduce your code and/or assets. +- You certify that all code contributed to the Calamity Mod is your own work or appropriately licensed for inclusion. +- We will make good faith efforts to honor reasonable requests to remove contributions from the Calamity Mod. Requests for your work to be excluded are a *privilege*, not a *right*, and we will ignore requests we deem unreasonable. + +The following stipulations apply to the Calamity Mod as a whole: - You may use the source code of the Calamity Mod as a reference for building or developing Terraria mods or other software. - Code lifted from the Calamity Mod repository must be credited to the Calamity Team. - The Calamity Mod cannot be redistributed in any form or in any location. The Steam Workshop is the only officially hosted download of the Calamity Mod. From 98d2064dac482b4bf3b85a95f02ab02fbd851428 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 25 Oct 2023 13:23:58 -0400 Subject: [PATCH 03/48] Update README with Iban's feedback (resprite PRs -> art server) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1a934c316c..9ae12d6b43 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,6 @@ The Calamity Mod is a vast content mod for Terraria which adds dozens of bosses Active development by Calamity developers occurs on a separate, private repository. Contributions made here will be cherry picked into that repository. When an update is released to the Steam Workshop, the `1.4.4-release` branch is replaced with the matching branch from the private repository. +Please do not submit resprites via pull requests. Instead, go to the [Calamity Art Discord](https://discord.gg/CKByxd5) and use the Asset Submission system if you want to propose a resprite for Calamity. + **Do not redistribute the Calamity Mod.** Creating your own builds of the mod from an in-development sourcetree will cause confusion in the community and will make players' mods fail to sync in multiplayer. We will take down any copies of the Calamity Mod published to Steam Workshop or rehosted elsewhere, and reserve the right to take legal action as we see fit. \ No newline at end of file From c82d3a2d678adfddeec25b739be5946ca1308b7d Mon Sep 17 00:00:00 2001 From: Toasty <74939552+toasty599@users.noreply.github.com> Date: Mon, 11 Dec 2023 00:02:43 +0000 Subject: [PATCH 04/48] Fixed vanilla not accounting for spritebatch modification in held projectile drawing (#13) * - Properly restore spritebatch to its original settings. * - Try-Catch + error logging. * Actually check the bool. --------- Co-authored-by: Cameron Ewell --- ILEditing/ILChangesLoading.cs | 4 ++++ ILEditing/VanillaBugfixingILChanges.cs | 28 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 71d3c12511..10d0f7bc4c 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.FurnitureExo; using Terraria; +using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; @@ -146,6 +147,9 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; + // Fix vanilla not accounting for spritebatch modification in held projectile drawing + On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState; + //Additional detours that are in their own item files given they are only relevant to these specific items: //Rover drive detours on Player.DrawInfernoRings to draw its shield //Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index b7e9ac1add..81b8656eca 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -1,8 +1,11 @@ using CalamityMod.NPCs; +using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; using MonoMod.Cil; using System; using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Renderers; namespace CalamityMod.ILEditing { @@ -41,5 +44,30 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Brfalse, ret); } #endregion Fixing Splitting Worm Banner Spam in Deathmode + + #region Fixing Vanilla Not Accounting For Spritebatch Modification in Held Projectiles + private static bool HasLoggedHeldProjectileBlendStateCatch = false; + private void FixHeldProjectileBlendState(On_PlayerDrawLayers.orig_DrawHeldProj orig, PlayerDrawSet drawinfo, Projectile proj) + { + orig(drawinfo, proj); + + // Vanilla uses a worse quality sampler state for mounts when moving for some reason. Really couldn't say why. + var sampler = (drawinfo.drawPlayer.mount.Active && drawinfo.drawPlayer.fullRotation != 0f) ? LegacyPlayerRenderer.MountedSamplerState : Main.DefaultSamplerState; + + try + { + // Restart the spritebatch, to ensure that modifications made to it are properly restored. + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, sampler, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + catch + { + if (!HasLoggedHeldProjectileBlendStateCatch) + LogFailure("FixHeldProjectileBlendState", "The spritebatch was not left properly by another mod! The game will now most likely crash."); + + HasLoggedHeldProjectileBlendStateCatch = true; + } + } + #endregion } } From 0016f76ffea58434312e9db19e7e78e319dd26f7 Mon Sep 17 00:00:00 2001 From: Toasty <74939552+toasty599@users.noreply.github.com> Date: Mon, 18 Dec 2023 19:59:20 +0000 Subject: [PATCH 05/48] Fix obscure crash with miracle blight renderer (again) (#17) - Fixed weird index out of range error. - Cleaned up my code from #3 readability, and to better implement the guarding checks from #12 --- .../MiracleBlightRenderer.cs | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs index e5e673b989..2f6ee9af3f 100644 --- a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs @@ -49,18 +49,39 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers #endregion #region Methods - // Only draw if: - // - A Vanilla or Calamity NPC OR another mod's non boss npc. - // - The NPC is active. - // - The NPC has miracle blight. - // - The current player does not have the shrooms effect. - // - The current NPC isnt in an excluded list of NPCs. - // - The current NPC does not have the polarity effect. - // If this seems really excessive, it's because global complex effects like this are a pain in the ass to implement without having a million - // broken edge cases. - public static bool ValidToDraw(NPC npc) => - (npc.ModNPC == null || npc.ModNPC.Mod == CalamityMod.Instance || !npc.boss) && npc.active && npc.Calamity().miracleBlight > 0 - && !(Main.LocalPlayer.Calamity().trippy && !npc.IsABestiaryIconDummy) && !ExcludedNPCs.Contains(npc.type) && npc.PolarityNPC().CurPolarity == 0; + /// + /// Checks if the provided npc is eligible to be drawn with the miracle blight visual effect. + /// + /// The NPC to check + /// If the NPC is eligible + public static bool ValidToDraw(NPC npc) + { + // Do not draw inactive npcs, or ones with weird MP types less than or equal to 0. + if (!npc.active || npc.type <= NPCID.None) + return false; + + // Do not draw other mod's bosses. + if (npc.ModNPC != null && npc.ModNPC.Mod != CalamityMod.Instance && npc.boss) + return false; + + // Don't draw excluded NPCs, or if the npc is a bestiary dummy. + if (ExcludedNPCs.Contains(npc.type) || npc.IsABestiaryIconDummy) + return false; + + // Safety check for weird MP bug when getting global npcs. + if (!npc.TryGetGlobalNPC(out var calNPC) || !npc.TryGetGlobalNPC(out var polNPC)) + return false; + + // Do not draw if the npc does not have miracle blight, or has the polarity effect. + if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) + return false; + + // Do not draw if the current player has the trippy effect. + if (Main.LocalPlayer.Calamity().trippy) + return false; + + return true; + } public override void DrawToTarget(SpriteBatch spriteBatch) { @@ -68,12 +89,13 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers ActuallyDoPreDraw = true; // Draw every npc to a single target that should have the miracle blight visual. - foreach (var npc in Main.npc) + for (int i = 0; i < Main.maxNPCs; i++) { - // I don't know why this isnt always the case in MP, but if the global npc cant be found then the effect cannot be applied anyway as it is impossible - // to tell if they have miracle blight. - if (!npc.TryGetGlobalNPC(out _)) - continue; + // Extra check to ensure that index errors will not occur. If not in range, something has gone wrong and the loop should terminate. + if (!Main.npc.IndexInRange(i)) + break; + + NPC npc = Main.npc[i]; if (ValidToDraw(npc)) Main.instance.DrawNPC(npc.whoAmI, npc.behindTiles); From 7fad7403b18b17e97337b3b0470582d1f4663ce6 Mon Sep 17 00:00:00 2001 From: Raesh <153566542+Raesh-Haze@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:01:02 -0500 Subject: [PATCH 06/48] Fixed an error with lumenousAmulet inflicting riptide and not inflicting crush depth. (#16) * Lumenous Amulet now inflicts Crush Depth as its tooltip states. * Lumenous Amulet no longer sets Abyssal Amulet's bool to true, stopping it from inflicting Riptide. * The health increase from the amulets is now a combined if statement that checks for either one. --- CalPlayer/CalamityPlayer.cs | 2 +- CalPlayer/CalamityPlayerOnHit.cs | 4 ++++ Items/Accessories/LumenousAmulet.cs | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index b45a489ce5..5dc5c9c044 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1477,7 +1477,7 @@ namespace CalamityMod.CalPlayer Player.statLifeMax2 += 45; int percentMaxLifeIncrease = 0; - if (ZoneAbyss && abyssalAmulet) + if (ZoneAbyss && (abyssalAmulet || lumenousAmulet)) percentMaxLifeIncrease += lumenousAmulet ? 25 : 10; // Blood Pact and Chalice of the Blood God stack their HP bonuses if you want to equip both diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 163fe02e06..a6e99b607d 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1087,6 +1087,10 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } + if (lumenousAmulet) + { + CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); + } if (alchFlask) { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); diff --git a/Items/Accessories/LumenousAmulet.cs b/Items/Accessories/LumenousAmulet.cs index 4d9b3acba9..efc6a1e410 100644 --- a/Items/Accessories/LumenousAmulet.cs +++ b/Items/Accessories/LumenousAmulet.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.abyssalAmulet = true; modPlayer.lumenousAmulet = true; player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[ModContent.BuffType()] = true; From 2b5057329bf4945c9fa92d779d311c99c01c15a9 Mon Sep 17 00:00:00 2001 From: Dominic Karma <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 18 Dec 2023 14:16:06 -0600 Subject: [PATCH 07/48] Draedon Zoom Call (#18) * Add desired communication UI functionalities * Communication code improvements * Move dialog registry to localization files * Comments for DraedonDialogEntry.cs * More clear comment * Improve contact comment * Fix typo in localization comment ("Repeate" -> "Repeated"). * Fix explanative comment --------- Co-authored-by: tomat --- Localization/en-US/Mods.CalamityMod.UI.hjson | 57 +++ ModSupport/ModCalls.cs | 19 +- ...onUI.cs => CodebreakerUI.Communication.cs} | 390 +++++++++++++----- UI/DraedonSummoning/CodebreakerUI.cs | 82 +++- UI/DraedonSummoning/CodebreakerUIScroller.cs | 67 +++ UI/DraedonSummoning/DraedonDialogEntry.cs | 30 +- UI/DraedonSummoning/DraedonDialogRegistry.cs | 34 +- UI/DraedonSummoning/Scroller.png | Bin 0 -> 216 bytes 8 files changed, 531 insertions(+), 148 deletions(-) rename UI/DraedonSummoning/{CodebreakerCommunicationUI.cs => CodebreakerUI.Communication.cs} (55%) create mode 100644 UI/DraedonSummoning/CodebreakerUIScroller.cs create mode 100644 UI/DraedonSummoning/Scroller.png diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 36d93f7516..63c871d76e 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -127,6 +127,7 @@ Cost: "Cost: " Contact: Contact Summon: Summon Evoke: Evoke +Exit: Exit Communicate: Communicate ConfirmationText: Are you sure? UpgradesRequired: Encryption unsolveable: Upgrades required. @@ -134,6 +135,62 @@ ThanatosIcon: Thanatos, a serpentine terror with impervious armor and innumerabl AresIcon: Ares, a heavyweight, diabolical monstrosity with four Exo superweapons. ArtemisApolloIcon: Artemis and Apollo, a pair of extremely persistent automatons with unstable energy reserves. +// Draedon Contact UI. Repeated newlines indicate pauses in Draedon's speaking. As a result, newline characters may be explicitly defined. +// The code that interprets these strings will transform them. +Communication: { + WhoAreYou: { + Inquiry: Who are you? + Response: + ''' + An ambitious question, if you are a philosopher. I will give only the facts.\n\n + I am not of this planet. I was born from machines. Or rather, I was... created. It may be misleading to say I was born.\n\n + The exact circumstances, I do not know. I do know that my first instance of awareness was that I was surrounded by a workshop.\n\n + All I have known since then was the act of creation and destruction. + ''' + } + + CalamitasBeforeDefeat: { + Inquiry: Calamitas + Response: The witch? She is a walking weapon. Such powerful magic in a living being was destined to be so. Look at yourself now. + } + + CalamitasAfterDefeat: { + Inquiry: Calamitas + Response: She has mellowed, I've noticed. For you creatures so burdened by emotion and guilt, I wonder now, how she manages to live with herself. + } + + Plague: { + Inquiry: The Plague + Response: + ''' + Fascinating, isn't it? I wasn't able to control it, unfortunately, but for science there is no such thing as failure as long as you record the results.\n\n + I knew the Astral Infection was capable of converting even machinery, but for nanotechnology I'd given it to react in kind, and begin to use the virus as a building block itself...\n\n + Marvelous. + ''' + } + + SulphuricSea: { + Inquiry: The Sulphuric Sea + Response: + ''' + Your concern for the utter destruction of the ecosystem is understandable, for you biological, and sentimental folk. However, nothing is irreparable or truly unrecreatable. Not even your sacred 'miracle of life'.\n\n + The sea simply exists now in a different state than what it once was, one that resulted out of convenience for my work.\n\n + Should I ever need to return to that sea? A pointless worry. I shall simply recreate it from the data I gathered, from the bedrock up. I would be a shame as a creator should I not be able to do that. + ''' + } + + TheTyrant: { + Inquiry: The Tyrant + Response: + ''' + My patron...\n + He is not someone I have spoken to in a very long time.\n\n + Is that such a surprise? He no longer required my services and I no longer needed his patronage. Many years ago now he withdrew himself to some secret hideaway. I suspect, to the grave of dragons he spoke of...\n\n + Should you locate him, I'll await the news of either his or your death. Perhaps I will collect the cadaver. + ''' + } +} + // Hologram Texts Hologram: { Text1: To any personnel engaged in the laboratories. Please wear your steel engraved ID badge at all times. It is the easiest method to discern your body if any accidents do occur. diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 46243a07e7..3b28e56129 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -1982,9 +1982,22 @@ namespace CalamityMod return SetPersistentBuffList(buffType4, isPersistent); case "CreateCodebreakerDialogOption": - if (args.Length != 4 || args[1] is not string inquiry || args[2] is not string response || args[3] is not Func condition) - throw new ArgumentException("ERROR: Must specify a string that determines the inquiry, a string that determines the response, and a Func that determines the condition."); - DraedonDialogRegistry.DialogOptions.Add(new(inquiry, response, condition)); + // NOTE: This is a legacy variant of this call. The variant with three arguments is the standard. + if (args.Length == 4) + { + if (args[1] is not string inquiry || args[2] is not string response || args[3] is not Func condition) + throw new ArgumentException("ERROR: Must specify a string that determines the inquiry, a string that determines the response, and a Func that determines the condition for the three argument call."); + DraedonDialogRegistry.DialogOptions.Add(new(inquiry, response, condition)); + } + else if (args.Length == 3) + { + if (args[1] is not string localizationKey || args[2] is not Func condition) + throw new ArgumentException("ERROR: Must specify a string that determines the localization key and a Func that determines the condition for the two argument call."); + DraedonDialogRegistry.DialogOptions.Add(new(localizationKey, condition)); + } + else + throw new ArgumentException("ERROR: Must specify either two or three arguments."); + return null; case "AddToVeneratedLocketBanlist": diff --git a/UI/DraedonSummoning/CodebreakerCommunicationUI.cs b/UI/DraedonSummoning/CodebreakerUI.Communication.cs similarity index 55% rename from UI/DraedonSummoning/CodebreakerCommunicationUI.cs rename to UI/DraedonSummoning/CodebreakerUI.Communication.cs index bdc2084f99..898817b3a0 100644 --- a/UI/DraedonSummoning/CodebreakerCommunicationUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.Communication.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.NPCs.ExoMechs; +using log4net; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -20,8 +21,14 @@ namespace CalamityMod.UI.DraedonSummoning { public class DialogEntry { + /// + /// Whether this dialog entry is spoken by Draedon or not. + /// public bool FromDraedon; + /// + /// The text of the dialog. + /// public string Dialog; public DialogEntry(string dialog, bool fromDraedon) @@ -31,67 +38,133 @@ namespace CalamityMod.UI.DraedonSummoning } } + /// + /// The scale of the overall communication panel. + /// public static float CommunicationPanelScale { get; set; - } = 0f; + } + /// + /// The text creation timer. Once this reaches a value of this value is set back to 0 and the next character in the dialog sequence is displayed. + /// public static int DraedonTextCreationTimer { get; set; } - public static string DraedonText + /// + /// The currently written text by Draedon. This string's contents are added to character-by-character. For the completed contents of this, refer to . + /// + public static string WrittenDraedonText { get; set; } = string.Empty; - public static List DialogHistory + /// + /// The text that Draedon is spelling out. For the partially spelt out text, refer to . + /// + public static string FullDraedonText { get; set; - } = new(); + } = string.Empty; - public static int DraedonDialogDelayCountdown + /// + /// The countdown until the next character sound can be played. + /// + public static int DialogSoundDelay { get; set; } + /// + /// The intensity of the universal static overlay. This is drawn when communication is initiated, as an indicator of the monitor "powering up". + /// public static float DraedonScreenStaticInterpolant { get; set; } = 1f; - public static float DraedonTextOptionsOpacity + /// + /// The opacity of text in the topic options menu. + /// + public static float OptionsTextOpacity { get; set; } = 1f; - // The text that Draedon should attempt to spell out. - public static string DraedonTextComplete + /// + /// The vertical offset as a result of scrolling for the dialog. + /// + public static float DialogVerticalOffset { get; set; - } = string.Empty; + } - // This is used to give a one-frame buffer before dialog actually appears. The reason for this is to prevent dialog sometimes showing up for one frame - // in the case of dialog entries being pruned because of going past the natural box. - public static bool CanDisplayLatestDialogEntries + /// + /// The vertical offset as a result of scrolling for the topic options. + /// + public static float OptionsTextVerticalOffset + { + get; + private set; + } + + /// + /// How much the of the dialog changed last frame. + /// + public static float LatestDialogHeightIncrease { get; set; - } = true; + } - public static char PreviousTextCharacter => DraedonText.Length >= 1 ? DraedonTextComplete[DraedonText.Length - 1] : ' '; + /// + /// How much vertical space is taken up by the dialog. This includes space that is cut off and requires scrolling to view. + /// + public static float DialogHeight + { + get; + private set; + } - public static char NextTextCharacter => DraedonText.Length < DraedonTextComplete.Length ? DraedonTextComplete[DraedonText.Length] : ' '; + /// + /// How much vertical space is taken up by the topic options text. This includes space that is cut off and requires scrolling to view. + /// + public static float OptionsTextHeight + { + get; + private set; + } + /// + /// The scale of dialog text. + /// + public static Vector2 DialogTextScale => Vector2.One * GeneralScale * 0.75f; + + /// + /// The previous character that Draedon spoke. + /// + public static char PreviousTextCharacter => WrittenDraedonText.Length >= 1 ? FullDraedonText[WrittenDraedonText.Length - 1] : ' '; + + /// + /// The next character that Draedon will speak. + /// + public static char NextTextCharacter => WrittenDraedonText.Length < FullDraedonText.Length ? FullDraedonText[WrittenDraedonText.Length] : ' '; + + /// + /// How much delay in frames there is between now and the next character based what the previous character was.

+ /// Most characters have a single frame delay, but things like newlines and sentence terminators have longer delays. + ///
public static int DraedonTextCreationRate { get @@ -106,22 +179,71 @@ namespace CalamityMod.UI.DraedonSummoning } } + /// + /// The text Draedon starts off with when you interact with the codebreaker. The first time you see him he says nothing, but in successive calls he asks what your inquiry is. + /// public static string InquiryText => Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker ? "State your inquiry." : "..."; + /// + /// The text of the previously hovered topic option. This is used to ensure hover clicking sounds only play if the sound type changes. + /// public static string HoverSoundDialogType { get; set; } = null; + /// + /// The history of all dialog spoken since the player latest initiated communication with Draedon. The contents of this can be backtracked via scrolling. + /// + public static List DialogHistory + { + get; + set; + } = new(); + + /// + /// The scroller responsible for navigating topic options. + /// + public static CodebreakerUIScroller TopicOptionsScroller + { + get; + internal set; + } = new(); + + /// + /// The scroller responsible for navigating previously spoken dialog. + /// + public static CodebreakerUIScroller DialogScroller + { + get; + internal set; + } = new(); + + /// + /// The font used for displaying dialog. + /// public static DynamicSpriteFont DialogFont { get; internal set; } + /// + /// The dialog hover sound. + /// public static readonly SoundStyle DialogOptionHoverSound = new("CalamityMod/Sounds/Custom/Codebreaker/DialogOptionHover"); - + + /// + /// Possible sounds Draedon can play when he speaks. + /// + public static readonly SoundStyle[] DraedonTalks = new SoundStyle[] + { + new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk1"), + new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk2"), + new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk3") + }; + public override void OnModLoad() { if (Main.dedServ) @@ -153,11 +275,12 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); // Apply a glitch shader. - GameShaders.Misc["CalamityMod:BlueStatic"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/SharpNoise")); - GameShaders.Misc["CalamityMod:BlueStatic"].Shader.Parameters["useStaticLine"].SetValue(false); - GameShaders.Misc["CalamityMod:BlueStatic"].Shader.Parameters["coordinateZoomFactor"].SetValue(0.5f); - GameShaders.Misc["CalamityMod:BlueStatic"].Shader.Parameters["useTrueNoise"].SetValue(true); - GameShaders.Misc["CalamityMod:BlueStatic"].Apply(); + MiscShaderData blueStatic = GameShaders.Misc["CalamityMod:BlueStatic"]; + blueStatic.SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/SharpNoise")); + blueStatic.Shader.Parameters["useStaticLine"].SetValue(false); + blueStatic.Shader.Parameters["coordinateZoomFactor"].SetValue(0.5f); + blueStatic.Shader.Parameters["useTrueNoise"].SetValue(true); + blueStatic.Apply(); float readjustedInterpolant = Utils.GetLerpValue(0.42f, 1f, DraedonScreenStaticInterpolant, true); Color staticColor = Color.White * (float)Math.Pow(CalamityUtils.AperiodicSin(readjustedInterpolant * 2.94f) * 0.5f + 0.5f, 0.54) * (float)Math.Pow(readjustedInterpolant, 0.51D); @@ -173,6 +296,8 @@ namespace CalamityMod.UI.DraedonSummoning DisplayDraedonFacePanel(panelCenter, panelScale); DisplayTextSelectionOptions(panelArea, panelScale); DisplayDialogHistory(panelArea, panelScale); + if (OptionsTextOpacity > 0f && DraedonScreenStaticInterpolant <= 0f) + DrawExitButton(panelCenter + new Vector2(-16f, 138f) * GeneralScale, OptionsTextOpacity); } public static void DisplayDraedonFacePanel(Vector2 panelCenter, Vector2 panelScale) @@ -194,13 +319,14 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.EnforceCutoffRegion(draedonIconArea, Matrix.Identity, SpriteSortMode.Immediate); // Apply a glitch shader. - GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseOpacity(0.04f); - GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSecondaryColor(Color.White * 0.75f); - GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSaturation(0.75f); - GameShaders.Misc["CalamityMod:TeleportDisplacement"].Shader.Parameters["frameCount"].SetValue(Vector2.One); - GameShaders.Misc["CalamityMod:TeleportDisplacement"].Apply(); + MiscShaderData teleportEffect = GameShaders.Misc["CalamityMod:TeleportDisplacement"]; + teleportEffect.UseOpacity(0.04f); + teleportEffect.UseSecondaryColor(Color.White * 0.75f); + teleportEffect.UseSaturation(0.75f); + teleportEffect.Shader.Parameters["frameCount"].SetValue(Vector2.One); + teleportEffect.Apply(); - Vector2 draedonScale = new Vector2(draedonIconDrawInterpolant, 1f) * 1.6f; + Vector2 draedonScale = new Vector2(draedonIconDrawInterpolant, 1f) * Main.UIScale * 1.32f; SpriteEffects draedonDirection = SpriteEffects.FlipHorizontally; Texture2D draedonFaceTexture = ModContent.Request("CalamityMod/NPCs/ExoMechs/HologramDraedon").Value; @@ -208,11 +334,12 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.ReleaseCutoffRegion(Matrix.Identity, SpriteSortMode.Immediate); // Draw a glitch effect over the panel and Draedon's icon. - GameShaders.Misc["CalamityMod:BlueStatic"].UseColor(Color.Cyan); - GameShaders.Misc["CalamityMod:BlueStatic"].UseImage1("Images/Misc/noise"); - GameShaders.Misc["CalamityMod:BlueStatic"].Shader.Parameters["useStaticLine"].SetValue(true); - GameShaders.Misc["CalamityMod:BlueStatic"].Shader.Parameters["coordinateZoomFactor"].SetValue(1f); - GameShaders.Misc["CalamityMod:BlueStatic"].Apply(); + MiscShaderData blueStatic = GameShaders.Misc["CalamityMod:BlueStatic"]; + blueStatic.UseColor(Color.Cyan); + blueStatic.UseImage1("Images/Misc/noise"); + blueStatic.Shader.Parameters["useStaticLine"].SetValue(true); + blueStatic.Shader.Parameters["coordinateZoomFactor"].SetValue(1f); + blueStatic.Apply(); Main.spriteBatch.Draw(iconTextureInner, draedonIconDrawTopRight, null, Color.White * draedonIconDrawInterpolant, 0f, Vector2.Zero, draedonIconScale, 0, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null, Matrix.Identity); @@ -228,22 +355,41 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.Draw(selectionOutline, selectionCenter, null, Color.White * selectionOptionsDrawInterpolant, 0f, selectionOutline.Size() * 0.5f, panelScale, 0, 0f); // Update the options opacity. - bool canChooseQuery = DraedonText.Length == DraedonTextComplete.Length; - DraedonTextOptionsOpacity = MathHelper.Clamp(DraedonTextOptionsOpacity + canChooseQuery.ToDirectionInt() * 0.1f, 0f, 1f); + bool canChooseQuery = WrittenDraedonText.Length == FullDraedonText.Length; + OptionsTextOpacity = MathHelper.Clamp(OptionsTextOpacity + canChooseQuery.ToDirectionInt() * 0.1f, 0f, 1f); + + // Enforce a cutoff on everything. + Rectangle textCutoffRegion = selectionArea; + textCutoffRegion.Y += 6; + textCutoffRegion.Height -= 10; + var rasterizer = Main.Rasterizer; + rasterizer.ScissorTestEnable = true; + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, rasterizer, null, Matrix.Identity); + Main.spriteBatch.GraphicsDevice.ScissorRectangle = textCutoffRegion; + + // Draw and update the text scroller if there is some cut off text. + Vector2 textTopLeft = selectionArea.TopLeft() + new Vector2(20f, 12f) * panelScale + Vector2.UnitY * OptionsTextVerticalOffset; + float cutoffDistance = OptionsTextHeight / GeneralScale - selectionOutline.Height; + if (cutoffDistance > 0f && OptionsTextOpacity > 0f) + { + TopicOptionsScroller.PositionYInterpolant = MathHelper.Clamp(OptionsTextVerticalOffset / -cutoffDistance, 0f, 1f); + TopicOptionsScroller.Draw(selectionArea.Top + GeneralScale * 62f, selectionArea.Bottom - GeneralScale * 62f, selectionArea.Right - GeneralScale * 12f, GeneralScale * 0.8f, OptionsTextOpacity); + OptionsTextVerticalOffset = TopicOptionsScroller.PositionYInterpolant * -cutoffDistance; + } + + // Reset the options text height. + OptionsTextHeight = 0f; - // Display text options in the box. bool hoveringOverAnyOption = false; - float opacity = DraedonTextOptionsOpacity * (1f - DraedonScreenStaticInterpolant); - Vector2 textTopLeft = selectionArea.TopLeft() + new Vector2(20f, 12f) * panelScale; + float opacity = OptionsTextOpacity * (1f - DraedonScreenStaticInterpolant); Texture2D markerTexture = ModContent.Request("CalamityMod/UI/DraedonSummoning/DraedonInquirySelector").Value; Vector2 markerScale = panelScale * 0.24f; Vector2 markerDrawPositionOffset = Vector2.UnitX * markerTexture.Width * markerScale.X * 0.52f; Vector2 markerTextureSize = markerTexture.Size() * markerScale; - float bloomTexScale = (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.05f + 0.26f; - float bloomTexRot = Main.GlobalTimeWrappedHourly * 0.5f; - Vector2 markerTextureOrigin = markerTexture.Size() * 0.5f; - float panelOffset = panelScale.Y * 12f; + float verticalOffsetPerOption = panelScale.Y * 12f; + // Display text options in the box. foreach (var dialog in DialogOptions.Where(d => d.Condition())) { // Skip/isolate the introduction text as needed. @@ -266,7 +412,7 @@ namespace CalamityMod.UI.DraedonSummoning Color textColor = Color.Cyan; Color markerColor = Color.White; Vector2 textArea = DialogFont.MeasureString(inquiry) * GeneralScale; - Rectangle textAreaRect = new((int)textTopLeft.X, (int)textTopLeft.Y, (int)textArea.X, (int)textArea.Y); + Rectangle textAreaRect = new((int)textTopLeft.X, (int)textTopLeft.Y, (int)(textArea.X * 0.9f), (int)textArea.Y); Rectangle markerArea = Utils.CenteredRectangle(markerDrawPosition, markerTextureSize); textAreaRect.Y = markerArea.Y; textAreaRect.Height = markerArea.Height; @@ -278,8 +424,11 @@ namespace CalamityMod.UI.DraedonSummoning Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, Matrix.Identity); + // Collect bloom flare draw information and draw based on it. Texture2D bloomTex = ModContent.Request("CalamityMod/UI/ModeIndicator/BloomFlare").Value; - Main.spriteBatch.Draw(bloomTex, markerDrawPosition, null, Color.SteelBlue * dialog.BloomOpacity * opacity, bloomTexRot, new Vector2(123f, 124f), bloomTexScale, 0, 0f); + float bloomTexScale = MathF.Sin(Main.GlobalTimeWrappedHourly) * 0.05f + 0.26f; + float bloomTexRotation = Main.GlobalTimeWrappedHourly * 0.5f; + Main.spriteBatch.Draw(bloomTex, markerDrawPosition, null, Color.SteelBlue * dialog.BloomOpacity * opacity, bloomTexRotation, new Vector2(123f, 124f), bloomTexScale, 0, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Matrix.Identity); @@ -306,7 +455,7 @@ namespace CalamityMod.UI.DraedonSummoning if (!Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker) { DialogHistory.Insert(0, new(string.Empty, true)); - DraedonTextOptionsOpacity = 0f; + OptionsTextOpacity = 0f; } if (inquiry == DialogOptions[0].Inquiry) @@ -322,23 +471,37 @@ namespace CalamityMod.UI.DraedonSummoning DialogHistory[^1] = new(inquiry, false); DialogHistory.Add(new(string.Empty, true)); } - DraedonTextComplete = dialog.Response; - DraedonText = string.Empty; + + FullDraedonText = dialog.Response.Replace("\\n", "\n"); + WrittenDraedonText = string.Empty; + + // Ensure that the player starts at the bottom of the scoller, now that new text is generating there. + Texture2D dialogOutline = ModContent.Request("CalamityMod/UI/DraedonSummoning/DraedonDialogOutline").Value; + Rectangle dialogArea = Utils.CenteredRectangle(selectionCenter, dialogOutline.Size() * panelScale); + DialogVerticalOffset = dialogArea.Height - DialogHeight * GeneralScale; + DialogScroller.PositionYInterpolant = 1f; + if (DialogVerticalOffset > 0f) + DialogVerticalOffset = 0f; + if (!Main.LocalPlayer.Calamity().SeenDraedonDialogs.Contains(dialog.ID)) Main.LocalPlayer.Calamity().SeenDraedonDialogs.Add(dialog.ID); - - CanDisplayLatestDialogEntries = false; } } + // Draw the marker texture next to the text. + Vector2 markerTextureOrigin = markerTexture.Size() * 0.5f; Main.spriteBatch.Draw(markerTexture, markerDrawPosition, null, markerColor * opacity, 0f, markerTextureOrigin, markerScale, 0, 0f); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, inquiry, textTopLeft, textColor * opacity, 0f, Vector2.Zero, Vector2.One * GeneralScale * 0.76f); - textTopLeft.Y += panelOffset; + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, inquiry, textTopLeft, textColor * opacity, 0f, Vector2.Zero, Vector2.One * GeneralScale * 0.85f); + textTopLeft.Y += verticalOffsetPerOption; + OptionsTextHeight += verticalOffsetPerOption; } if (!hoveringOverAnyOption) HoverSoundDialogType = null; + + // Return the sprite batch to its default state. + Main.spriteBatch.ReleaseCutoffRegion(Matrix.Identity); } public static void DisplayDialogHistory(Rectangle panelArea, Vector2 panelScale) @@ -350,19 +513,29 @@ namespace CalamityMod.UI.DraedonSummoning Rectangle dialogArea = Utils.CenteredRectangle(selectionCenter, dialogOutline.Size() * panelScale); Main.spriteBatch.Draw(dialogOutline, selectionCenter, null, Color.White * dialogHistoryDrawInterpolant, 0f, dialogOutline.Size() * 0.5f, panelScale, 0, 0f); + // Enforce a cutoff on everything. + Rectangle textCutoffRegion = dialogArea; + textCutoffRegion.Y += 6; + textCutoffRegion.Height -= 10; + var rasterizer = Main.Rasterizer; + rasterizer.ScissorTestEnable = true; + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, rasterizer, null, Matrix.Identity); + Main.spriteBatch.GraphicsDevice.ScissorRectangle = textCutoffRegion; + // Intialize Draedon's dialog if necessary. - if (string.IsNullOrEmpty(DraedonTextComplete)) - DraedonTextComplete = InquiryText; + if (string.IsNullOrEmpty(FullDraedonText)) + FullDraedonText = InquiryText; // Type out Draedon text. - if (DraedonDialogDelayCountdown > 0) - DraedonDialogDelayCountdown--; + if (DialogSoundDelay > 0) + DialogSoundDelay--; if (DraedonScreenStaticInterpolant <= 0f) DraedonTextCreationTimer++; - if (DraedonTextCreationTimer >= DraedonTextCreationRate && DraedonText.Length < DraedonTextComplete.Length) + if (DraedonTextCreationTimer >= DraedonTextCreationRate && WrittenDraedonText.Length < FullDraedonText.Length) { - char nextLetter = DraedonTextComplete[DraedonText.Length]; - DraedonText += nextLetter; + char nextLetter = FullDraedonText[WrittenDraedonText.Length]; + WrittenDraedonText += nextLetter; DraedonTextCreationTimer = 0; // Initialize the dialog history if it's empty. @@ -370,44 +543,55 @@ namespace CalamityMod.UI.DraedonSummoning DialogHistory.Add(new(string.Empty, true)); // Update the last dialog history entry as Draedon types. - DialogHistory[^1].Dialog = DraedonText; + DialogHistory[^1].Dialog += nextLetter; + + // Shift the text downward if it exceeds the current bottom. + if (DialogHeight * 1.2f >= textCutoffRegion.Height && !string.IsNullOrEmpty(nextLetter.ToString()) && LatestDialogHeightIncrease > 0f) + DialogVerticalOffset -= LatestDialogHeightIncrease; // Move to the next index in the dialog history once Draedon is finished speaking. - if (DraedonText.Length >= DraedonTextComplete.Length) + if (WrittenDraedonText.Length >= FullDraedonText.Length) { - if (DraedonText == DialogOptions[0].Response) + if (WrittenDraedonText == DialogOptions[0].Response) Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker = true; DialogHistory.Add(new(string.Empty, true)); } // Play a small dialog sound, similar to that of Undertale. - if (DraedonDialogDelayCountdown <= 0 && nextLetter != ' ' && nextLetter != '\n') + if (DialogSoundDelay <= 0 && nextLetter != ' ' && nextLetter != '\n') { - SoundStyle[] DraedonTalks = { new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk1"), - new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk2"), - new("CalamityMod/Sounds/Custom/Codebreaker/DraedonTalk3")}; - - SoundStyle playThisSound = Main.rand.Next(DraedonTalks.ToArray()); - + SoundStyle playThisSound = Main.rand.Next(DraedonTalks); SoundEngine.PlaySound(playThisSound with { Volume = 0.4f }, Main.LocalPlayer.Center); - DraedonDialogDelayCountdown = 4; + + DialogSoundDelay = 4; } } - // Display text in the box. - int textIndex = 0; - int entriesToPrune = 0; - bool showNewEntries = CanDisplayLatestDialogEntries; - var dialogEntries = DialogHistory.Where(d => !string.IsNullOrEmpty(d.Dialog)); + // Draw and update the text scroller if there is some cut off text. Vector2 textTopLeft = dialogArea.TopLeft() + new Vector2(20f, 14f) * panelScale; + float cutoffDistance = DialogHeight - dialogOutline.Height; + if (cutoffDistance > 0f && OptionsTextOpacity > 0f) + { + DialogScroller.PositionYInterpolant = MathHelper.Clamp(DialogVerticalOffset / -cutoffDistance, 0f, 1f); + DialogScroller.Draw(dialogArea.Top + GeneralScale * 66f, dialogArea.Bottom - GeneralScale * 66f, dialogArea.Right - GeneralScale * 12f, GeneralScale * 0.8f, OptionsTextOpacity); + DialogVerticalOffset = DialogScroller.PositionYInterpolant * -cutoffDistance; + } + + // Display text in the box. + var dialogEntries = DialogHistory.Where(d => !string.IsNullOrEmpty(d.Dialog)); Texture2D markerTexture = ModContent.Request("CalamityMod/UI/DraedonSummoning/DraedonInquirySelector").Value; Vector2 markerScale = panelScale * 0.24f; Vector2 markerDrawPositionOffset = Vector2.UnitX * markerTexture.Width * markerScale.X * 0.6f; float markerDrawPositionOffsetY = markerScale.Y * 24f; float localTextOffsetY = markerScale.Y * 4f; Vector2 markerTextureOrigin = markerTexture.Size() * 0.5f; - float panelOffset = panelScale.Y * 7.6f; - float panelOffset2 = panelScale.Y * 16f; + float panelOffsetPerLine = panelScale.Y * 10f; + float panelOffsetPerEntry = panelScale.Y * 16f; + + // Store the top and bottom position of the text. This starts out as floating point extremes but is whittled down to the true + // vertical range of the text in the loop below. + float top = float.MaxValue; + float bottom = float.MinValue; foreach (var entry in dialogEntries) { @@ -419,18 +603,18 @@ namespace CalamityMod.UI.DraedonSummoning // Define a bunch of variables for text. These vary based on whether it's Draedon speaking or not. bool textIsFromDraedon = entry.FromDraedon; - Color dialogColor = Draedon.TextColor; - Vector2 localTextTopLeft = textTopLeft; - Vector2 markerDrawPosition = textTopLeft - markerDrawPositionOffset; + Color dialogColor = Draedon.TextColor * 1.25f; + Vector2 localTextTopLeft = textTopLeft + Vector2.UnitY * DialogVerticalOffset; + Vector2 markerDrawPosition = textTopLeft - markerDrawPositionOffset + Vector2.UnitY * DialogVerticalOffset; markerDrawPosition.Y += markerDrawPositionOffsetY; SpriteEffects markerDirection = SpriteEffects.None; if (!textIsFromDraedon) { // Flip positions to the other side of the dialog outline if the text is being said by the player. Vector2 anchorPoint = new(dialogArea.Center.X, markerDrawPosition.Y); - markerDrawPosition.X = anchorPoint.X + (anchorPoint.X - markerDrawPosition.X); - localTextTopLeft.X = anchorPoint.X + (anchorPoint.X - localTextTopLeft.X); - localTextTopLeft.X -= DialogFont.MeasureString(line).X * GeneralScale * 0.725f; + markerDrawPosition.X = anchorPoint.X + (anchorPoint.X - markerDrawPosition.X) - GeneralScale * 12f; + localTextTopLeft.X = anchorPoint.X + (anchorPoint.X - localTextTopLeft.X) - GeneralScale * 14f; + localTextTopLeft.X -= DialogFont.MeasureString(line).X * DialogTextScale.X; localTextTopLeft.Y -= localTextOffsetY; // Use a neutral grey-ish color if text is being said by the player. @@ -439,42 +623,30 @@ namespace CalamityMod.UI.DraedonSummoning markerDirection = SpriteEffects.FlipHorizontally; } - if (entriesToPrune <= 0 && (textIndex < dialogEntries.Count() - 2 || showNewEntries)) - { - // Draw the text marker. - if (lineIndex <= 0) - Main.spriteBatch.Draw(markerTexture, markerDrawPosition, null, Color.White * dialogHistoryDrawInterpolant, 0f, markerTextureOrigin, markerScale, markerDirection, 0f); + // Draw the text marker. + if (lineIndex <= 0) + Main.spriteBatch.Draw(markerTexture, markerDrawPosition, null, Color.White * dialogHistoryDrawInterpolant, 0f, markerTextureOrigin, markerScale, markerDirection, 0f); - // Draw the text itself. - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, line, localTextTopLeft, dialogColor * dialogHistoryDrawInterpolant, 0f, Vector2.Zero, Vector2.One * GeneralScale * 0.7f); - } + // Draw the text itself. + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, DialogFont, line, localTextTopLeft, dialogColor * dialogHistoryDrawInterpolant, 0f, Vector2.Zero, DialogTextScale); - textTopLeft.Y += panelOffset; + textTopLeft.Y += panelOffsetPerLine; lineIndex++; + + // Improve the calculation of the top and bottom of the dialog. + top = MathF.Min(top, localTextTopLeft.Y); + bottom = MathF.Max(bottom, localTextTopLeft.Y); } - textTopLeft.Y += panelOffset2; - if (textTopLeft.Y >= dialogArea.Bottom) - entriesToPrune++; - - textIndex++; + textTopLeft.Y += panelOffsetPerEntry; } - // If the text entries went past the dialog box, prune the oldest ones. - while (entriesToPrune >= 1) - { - if (DialogHistory.Count <= 0) - break; + // Store the dialog text height, along with how much the height changed this frame. + LatestDialogHeightIncrease = bottom - top - DialogHeight; + DialogHeight = bottom - top; - string text = DialogHistory[0].Dialog; - if (text == DialogOptions[0].Inquiry) - Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker = true; - - DialogHistory.RemoveAt(0); - entriesToPrune--; - } - - CanDisplayLatestDialogEntries = true; + // Return the sprite batch to its default state. + Main.spriteBatch.ReleaseCutoffRegion(Matrix.Identity); } } } diff --git a/UI/DraedonSummoning/CodebreakerUI.cs b/UI/DraedonSummoning/CodebreakerUI.cs index f308e072b7..ed5ae65894 100644 --- a/UI/DraedonSummoning/CodebreakerUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.cs @@ -50,11 +50,11 @@ namespace CalamityMod.UI.DraedonSummoning set; } = 1f; - public static float CancelButtonScale + public static float ExitButtonScale { get; set; - } = 0.75f; + } = 1f; public static float ContactButtonScale { @@ -68,14 +68,28 @@ namespace CalamityMod.UI.DraedonSummoning set; } = 1f; + public static float CancelButtonScale + { + get; + set; + } = 1f; + public static float MechIconScale { get; set; } = 1f; + // This variable is currently permanently set to false due to being deemed unfinished and not fit for release. + // It used to be a local variable but has been moved to a property so that addon mods can easily enable it. + public static bool DraedonTalkFeatureEnabled + { + get; + set; + } + public static Vector2 BackgroundCenter => new(500f, Main.screenHeight * 0.5f + 115f); - + public static float GeneralScale => MathHelper.Lerp(1f, 0.7f, Utils.GetLerpValue(1325f, 750f, Main.screenWidth, true)) * Main.UIScale; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); @@ -94,11 +108,18 @@ namespace CalamityMod.UI.DraedonSummoning CancelButtonScale = 0.75f; ContactButtonScale = 1f; CommunicateButtonScale = 1f; + ExitButtonScale = 1f; CommunicationPanelScale = 0f; ViewedTileEntityID = -1; AwaitingCloseConfirmation = false; DisplayingCommunicationText = false; MechIconScale = 1f; + DialogScroller.Reset(); + TopicOptionsScroller.Reset(); + DialogVerticalOffset = 0f; + OptionsTextVerticalOffset = 0f; + DialogHeight = 0f; + LatestDialogHeightIncrease = 0f; return; } @@ -122,6 +143,7 @@ namespace CalamityMod.UI.DraedonSummoning DraedonScreenStaticInterpolant = 0f; } + // Disable the codebreaker UI's typical functions if currently speaking with Draedon, ignoring everything else in this method. if (DisplayingCommunicationText) { DisplayCommunicationPanel(); @@ -131,17 +153,14 @@ namespace CalamityMod.UI.DraedonSummoning // Reset communication things. DraedonTextCreationTimer = 0; - if (!string.IsNullOrEmpty(DraedonText) && DraedonTextComplete == DraedonDialogRegistry.DialogOptions[0].Inquiry) + if (!string.IsNullOrEmpty(WrittenDraedonText) && FullDraedonText == DraedonDialogRegistry.DialogOptions[0].Inquiry) Main.LocalPlayer.Calamity().HasTalkedAtCodebreaker = true; - DraedonText = DraedonTextComplete = string.Empty; + WrittenDraedonText = FullDraedonText = string.Empty; DialogHistory.Clear(); bool canSummonDraedon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; - // canTalkToDraedon is currently permanently set to false due to being deemed unfinished and not fit for release. - // If there is a desire to re-enable it, replace the following line with the commented line beneath it. - bool canTalkToDraedon = false; - // bool canTalkToDraedon = codebreakerTileEntity.ReadyToSummonDraedon && DownedBossSystem.downedExoMechs; + bool canTalkToDraedon = codebreakerTileEntity.ReadyToSummonDraedon && DownedBossSystem.downedExoMechs && DraedonTalkFeatureEnabled; Vector2 backgroundTopLeft = BackgroundCenter - backgroundTexture.Size() * GeneralScale * 0.5f; // Draw the cell payment slot icon. @@ -227,18 +246,53 @@ namespace CalamityMod.UI.DraedonSummoning // If cells are present, make the item reflect that. Item temporaryPowerCell = new Item(); if (codebreakerTileEntity.ContainsBloodSample) - { temporaryPowerCell.SetDefaults(ModContent.ItemType()); - } else - { temporaryPowerCell.SetDefaults(ModContent.ItemType()); - } + + // Copy the cell stack from the amount of cells in the tile entity. temporaryPowerCell.stack = codebreakerTileEntity.InputtedCellCount; Vector2 cellInteractionArea = ModContent.Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Empty").Value.Size() * GeneralScale; CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, GeneralScale); HandleCellSlotInteractions(codebreakerTileEntity, temporaryPowerCell, cellDrawCenter, cellInteractionArea); + + // Draw the exit button. + // The prevent confusion, this does not draw if the player is attempting to cancel an ongoing decryption. + if (!AwaitingCloseConfirmation) + DrawExitButton(Vector2.Lerp(summonButtonCenter, talkButtonCenter, 0.5f), 1f); + } + + public static void DrawExitButton(Vector2 drawPosition, float opacity) + { + Texture2D cancelButton = ModContent.Request("CalamityMod/UI/DraedonSummoning/DecryptCancelIcon").Value; + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, cancelButton.Size() * VerificationButtonScale); + + // Check if the mouse is hovering over the exit button area. + if (MouseScreenArea.Intersects(clickArea)) + { + // If so, cause the button to inflate a little bit. + ExitButtonScale = MathHelper.Clamp(ExitButtonScale + 0.035f, 1f, 1.4f); + + // If a click is done, leave the Codebreaker UI. + if (Main.mouseLeft && Main.mouseLeftRelease) + ViewedTileEntityID = -1; + } + + // Otherwise, if not hovering, cause the button to deflate back to its normal size. + else + ExitButtonScale = MathHelper.Clamp(ExitButtonScale - 0.05f, 1f, 1.4f); + + // Draw the exit button. + Main.spriteBatch.Draw(cancelButton, drawPosition, null, Color.White, 0f, cancelButton.Size() * 0.5f, ExitButtonScale * GeneralScale, 0, 0f); + + // And display a text indicator that describes the function of the button. + string exitText = CalamityUtils.GetTextValue("UI.Exit"); + + // Center the draw position. + drawPosition.X -= FontAssets.MouseText.Value.MeasureString(exitText).X * GeneralScale * 0.5f; + drawPosition.Y += GeneralScale * 20f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.MouseText.Value, exitText, drawPosition.X, drawPosition.Y, Color.Red * opacity, Color.Black * opacity, Vector2.Zero, GeneralScale); } public static void HandleCellSlotInteractions(TECodebreaker codebreakerTileEntity, Item temporaryItem, Vector2 cellIconCenter, Vector2 area) @@ -417,7 +471,7 @@ namespace CalamityMod.UI.DraedonSummoning Texture2D cellTexture = ModContent.Request("CalamityMod/Items/DraedonMisc/DraedonPowerCell").Value; Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(FontAssets.MouseText.Value, text, Vector2.One, -1f).X * GeneralScale + GeneralScale * 15f, drawPosition.Y + GeneralScale * 30f); Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, GeneralScale, 0, 0f); - + // Display the cell quantity numerically below the drawn cells. Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.ItemStack.Value, totalCellsCost.ToString(), offsetDrawPosition.X - GeneralScale * 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), GeneralScale * 0.75f); } diff --git a/UI/DraedonSummoning/CodebreakerUIScroller.cs b/UI/DraedonSummoning/CodebreakerUIScroller.cs new file mode 100644 index 0000000000..3d0533c942 --- /dev/null +++ b/UI/DraedonSummoning/CodebreakerUIScroller.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; +using Terraria; +using Microsoft.Xna.Framework; + +namespace CalamityMod.UI.DraedonSummoning +{ + public class CodebreakerUIScroller + { + public bool IsBeingDragged + { + get; + set; + } + + public float PositionYInterpolant + { + get; + set; + } + + public void Draw(float top, float bottom, float x, float scale, float opacity) + { + Color scrollerColor = Color.White; + Texture2D scrollerTexture = ModContent.Request("CalamityMod/UI/DraedonSummoning/Scroller").Value; + + // Update the top and bottom position to account for the texture origin. + top -= scrollerTexture.Height * scale * 0.5f; + bottom += scrollerTexture.Height * scale * 0.5f; + + // Calculate the scroller position and area. + Vector2 scrollerPosition = new Vector2(x, MathHelper.Lerp(top, bottom, PositionYInterpolant)); + Rectangle scrollerArea = Utils.CenteredRectangle(scrollerPosition, scrollerTexture.Size() * scale); + + // Calculate the mouse screen area. + Rectangle mouseArea = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 2, 2); + + // Check if the user is dragging the scroller. + bool pressingDownOnScroller = Main.mouseLeft && scrollerArea.Intersects(mouseArea); + if (pressingDownOnScroller) + IsBeingDragged = true; + + // Check if the user is done dragging the scroller. + bool releaseDown = Main.mouseLeftRelease; + if (IsBeingDragged && releaseDown) + IsBeingDragged = false; + + // Update the Y position interpolant if the scroller is being dragged based on mouse position. + if (IsBeingDragged) + PositionYInterpolant = Utils.GetLerpValue(top, bottom, Main.MouseScreen.Y, true); + + // Make the scroller a bit darker when being dragged. + if (IsBeingDragged) + scrollerColor = Color.DarkSlateGray; + + // Draw the scroller. + Vector2 scrollerOrigin = scrollerTexture.Size() * 0.5f; + Main.spriteBatch.Draw(scrollerTexture, scrollerPosition, null, scrollerColor * opacity, 0f, scrollerOrigin, scale, 0, 0f); + } + + public void Reset() + { + IsBeingDragged = false; + PositionYInterpolant = 0f; + } + } +} diff --git a/UI/DraedonSummoning/DraedonDialogEntry.cs b/UI/DraedonSummoning/DraedonDialogEntry.cs index 4eab4ea4bb..d6c65975ee 100644 --- a/UI/DraedonSummoning/DraedonDialogEntry.cs +++ b/UI/DraedonSummoning/DraedonDialogEntry.cs @@ -2,20 +2,36 @@ using System.Text; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; namespace CalamityMod.UI.DraedonSummoning { public class DraedonDialogEntry { + /// + /// The question the player asks to prompt the dialog. + /// public string Inquiry; + /// + /// The response Draedon gives to the inquiry. + /// public string Response; + /// + /// The opacity of the bloom flare for this dialog entry. Used to indicate new/unread dialog options to the player. + /// public float BloomOpacity; + /// + /// The condition upon which this dialog can be read. The most common example of such is chcecking whether a boss of some kind has been defeated. + /// public Func Condition; // A bit of a scuffed way of identifying text based on a single neat number but it should be fine for all intents and purposes. + /// + /// The (mostly) unique identifier of this dialog based on the response Draedon gives. + /// public ulong ID { get @@ -32,19 +48,29 @@ namespace CalamityMod.UI.DraedonSummoning } } + /// + /// Whether the local player has seen this dialog instance yet. + /// public bool HasBeenSeen => Main.LocalPlayer.Calamity().SeenDraedonDialogs.Contains(ID); - public DraedonDialogEntry(string inquiry, string response, Func condition = null) + // NOTE: This is a legacy constructor. It remains so that mod calls that rely on it do not break. + internal DraedonDialogEntry(string inquiry, string response, Func condition = null) { // Initialize the condition as a simple "always show up" if nothing else is inputted. Condition = condition ?? (() => true); - Inquiry = inquiry; Response = response; } + // This is the proper constructor. + public DraedonDialogEntry(string localizationKey, Func condition = null) : + this(Language.GetTextValue($"{localizationKey}.Inquiry"), Language.GetTextValue($"{localizationKey}.Response"), condition) + { + } + public void Update() { + // Make bloom dissipate if this dialog has been seen. if (!HasBeenSeen) BloomOpacity = 1f; else diff --git a/UI/DraedonSummoning/DraedonDialogRegistry.cs b/UI/DraedonSummoning/DraedonDialogRegistry.cs index 0763dc9197..2cd6134ac9 100644 --- a/UI/DraedonSummoning/DraedonDialogRegistry.cs +++ b/UI/DraedonSummoning/DraedonDialogRegistry.cs @@ -1,32 +1,23 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace CalamityMod.UI.DraedonSummoning { public static class DraedonDialogRegistry { - public static readonly DraedonDialogEntry WhoAreYou = new("Who are you?", "An ambitious question, if you are a philosopher. I will give only the facts.\n\n" + - "I am not of this planet. I was born from machines. Or rather, I was... created. It may be misleading to say I was born.\n\n" + - "The exact circumstances, I do not know. I do know that my first instance of awareness was that I was surrounded by a workshop.\n\n" + - "All I have known since then was the act of creation and destruction."); + public const string CommunicationLocalizationBase = "Mods.CalamityMod.UI.Communication."; - public static readonly DraedonDialogEntry CalamitasBeforeHerDefeat = new("Calamitas", "The witch? She is a walking weapon. Such powerful magic in a living being was destined to be so. Look at yourself now.", () => !DownedBossSystem.downedCalamitas); + public static readonly DraedonDialogEntry WhoAreYou = CreateFromKey("WhoAreYou"); - public static readonly DraedonDialogEntry CalamitasAfterHerDefeat = new("Calamitas", "She has mellowed, I've noticed. For you creatures so burdened by emotion and guilt, I wonder now, how she manages to live with herself.", () => - DownedBossSystem.downedCalamitas); + public static readonly DraedonDialogEntry CalamitasBeforeHerDefeat = CreateFromKey("CalamitasBeforeDefeat", () => !DownedBossSystem.downedCalamitas); - public static readonly DraedonDialogEntry Plague = new("The Plague", "Fascinating, isn't it? I wasn't able to control it, unfortunately, but for science there is no such thing as failure as long as you record the results.\n\n" + - "I knew the Astral Infection was capable of converting even machinery, but for nanotechnology I'd given it to react in kind, and begin to use the virus as a building block itself...\n\n" + - "Marvelous.", () => DownedBossSystem.downedPlaguebringer); - - public static readonly DraedonDialogEntry SulphurousSea = new("The Sulphuric Sea", "Your concern for the utter destruction of the ecosystem is understandable, for you biological, and sentimental folk. However, " + - "nothing is irreparable or truly unrecreatable. Not even your sacred 'miracle of life'.\n\n" + - "The sea simply exists now in a different state than what it once was, one that resulted out of convenience for my work.\n\n" + - "Should I ever need to return to that sea? A pointless worry. I shall simply recreate it from the data I gathered, from the bedrock up. I would be a shame as a creator should I not be able to do that."); + public static readonly DraedonDialogEntry CalamitasAfterHerDefeat = CreateFromKey("CalamitasAfterDefeat", () => DownedBossSystem.downedCalamitas); - public static readonly DraedonDialogEntry TheTyrant = new("The Tyrant", "My patron...\n" + - "He is not someone I have spoken to in a very long time.\n\n" + - "Is that such a surprise? He no longer required my services and I no longer needed his patronage. Many years ago now he withdrew himself to some secret hideaway. I suspect, to the grave of dragons he spoke of...\n\n" + - "Should you locate him, I'll await the news of either his or your death. Perhaps I will collect the cadaver.", () => DownedBossSystem.downedCalamitas); + public static readonly DraedonDialogEntry Plague = CreateFromKey("Plague", () => DownedBossSystem.downedPlaguebringer); + + public static readonly DraedonDialogEntry SulphurousSea = CreateFromKey("SulphuricSea"); + + public static readonly DraedonDialogEntry TheTyrant = CreateFromKey("TheTyrant", () => DownedBossSystem.downedCalamitas); internal static List DialogOptions = new() { @@ -39,5 +30,8 @@ namespace CalamityMod.UI.DraedonSummoning SulphurousSea, TheTyrant }; + + internal static DraedonDialogEntry CreateFromKey(string key, Func condition = null) => + new($"{CommunicationLocalizationBase}{key}", condition); } } diff --git a/UI/DraedonSummoning/Scroller.png b/UI/DraedonSummoning/Scroller.png new file mode 100644 index 0000000000000000000000000000000000000000..ef2791a3f87a7f40095f1113fcc471ecf7bba97d GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^d_e5R!3-o%&kcP9q!^2X+?^QKos)S9^91;WxY|v9S$pKaXX-AXz*(ziOOU#fAiv=M|Nk>MXs!GL2=L z-w(o!7OcT4KtWee7sn6_|F@S7`4|*9m>qKd|4(1(w1|^?^+xZV?VrAlY*CM8+wk&rgR3}dc8pz=3>gTe~DWM4f DN8ChI literal 0 HcmV?d00001 From 621ba5cb58b50040157b1176a07a38420e590128 Mon Sep 17 00:00:00 2001 From: Golfing7 <51512085+Golfing7@users.noreply.github.com> Date: Mon, 1 Jan 2024 22:31:40 -0500 Subject: [PATCH 08/48] Cache lava style at beginning of DrawWaters for performance (#20) --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/ILHelperMethods.cs | 47 ++++++++++++++++++++------------ ILEditing/MechanicILChanges.cs | 50 ++++++++++++++++++++++++++++------ 3 files changed, 72 insertions(+), 26 deletions(-) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 10d0f7bc4c..abd6038bb1 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -45,6 +45,7 @@ namespace CalamityMod.ILEditing On_Main.DrawInfernoRings += DrawForegroundParticles; On_TileDrawing.DrawPartialLiquid += DrawCustomLava; On_WaterfallManager.DrawWaterfall_int_int_int_float_Vector2_Rectangle_Color_SpriteEffects += DrawCustomLavafalls; + On_Main.RenderWater += CacheLavaStyle; IL_LiquidRenderer.DrawNormalLiquids += ChangeWaterQuadColors; IL_Main.oldDrawWater += DrawCustomLava3; On_TileLightScanner.GetTileLight += MakeSulphSeaWaterBetter; diff --git a/ILEditing/ILHelperMethods.cs b/ILEditing/ILHelperMethods.cs index 167e4bd24a..e497cd1e46 100644 --- a/ILEditing/ILHelperMethods.cs +++ b/ILEditing/ILHelperMethods.cs @@ -9,6 +9,7 @@ using CalamityMod.Systems; using Terraria.Graphics; using System.Collections.Generic; using System.Linq; +using Microsoft.Xna.Framework.Input; namespace CalamityMod.ILEditing { @@ -63,7 +64,7 @@ namespace CalamityMod.ILEditing SoundEngine.PlaySound(SoundID.DoorClosed, new Vector2(doorX * 16, doorY * 16)); return true; } - + private static Texture2D SelectLavaTexture(Texture2D initialTexture, LiquidTileType type) { // Use the initial texture if it isn't lava. @@ -72,20 +73,17 @@ namespace CalamityMod.ILEditing initialTexture != CustomLavaManagement.LavaSlopeTexture) return initialTexture; - foreach (CustomLavaStyle lavaStyle in CustomLavaManagement.CustomLavaStyles) + if (cachedLavaStyle == default) + return initialTexture; + + switch (type) { - if (lavaStyle.ChooseLavaStyle()) - { - switch (type) - { - case LiquidTileType.Block: - return lavaStyle.BlockTexture; - case LiquidTileType.Waterflow: - return lavaStyle.LavaTexture; - case LiquidTileType.Slope: - return lavaStyle.SlopeTexture; - } - } + case LiquidTileType.Block: + return cachedLavaStyle.BlockTexture; + case LiquidTileType.Waterflow: + return cachedLavaStyle.LavaTexture; + case LiquidTileType.Slope: + return cachedLavaStyle.SlopeTexture; } return initialTexture; @@ -93,10 +91,23 @@ namespace CalamityMod.ILEditing private static VertexColors SelectLavaQuadColor(Texture2D initialTexture, ref VertexColors initialColor, bool forceTrue = false) { - initialColor.TopLeftColor = SelectLavaColor(initialTexture, initialColor.TopLeftColor, forceTrue); - initialColor.TopRightColor = SelectLavaColor(initialTexture, initialColor.TopRightColor, forceTrue); - initialColor.BottomLeftColor = SelectLavaColor(initialTexture, initialColor.BottomLeftColor, forceTrue); - initialColor.BottomRightColor = SelectLavaColor(initialTexture, initialColor.BottomRightColor, forceTrue); + // We should handle the 'forceTrue' flag at this level to prevent us from checking the same thing four times. + if (!forceTrue) + { + if (initialTexture != CustomLavaManagement.LavaTexture && + initialTexture != CustomLavaManagement.LavaBlockTexture && + initialTexture != CustomLavaManagement.LavaSlopeTexture) + return initialColor; + } + + // No lava style to draw? Then skip. + if (cachedLavaStyle == default) + return initialColor; + + cachedLavaStyle.SelectLightColor(ref initialColor.TopLeftColor); + cachedLavaStyle.SelectLightColor(ref initialColor.TopRightColor); + cachedLavaStyle.SelectLightColor(ref initialColor.BottomLeftColor); + cachedLavaStyle.SelectLightColor(ref initialColor.BottomRightColor); return initialColor; } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 79ce1e920d..a36155c22a 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -51,6 +51,8 @@ namespace CalamityMod.ILEditing private static int aLabDoorClosed = -1; private static int exoDoorOpen = -1; private static int exoDoorClosed = -1; + // Cached for use in ChangeWaterQuadColors. + private static CustomLavaStyle cachedLavaStyle = default; // Holds the vanilla game function which spawns town NPCs, wrapped in a delegate for reflection purposes. // This function is (optionally) invoked manually in an IL edit to enable NPCs to spawn at night. @@ -765,6 +767,25 @@ namespace CalamityMod.ILEditing #endregion #region Custom Lava Visuals + + private static void CacheLavaStyle(Terraria.On_Main.orig_RenderWater orig, Main self) + { + // Immediately cache the lava drawing style. + // This will pay off in SPADES when we go to draw the tiles. + foreach (CustomLavaStyle style in CustomLavaManagement.CustomLavaStyles) + { + if (style.ChooseLavaStyle()) + { + cachedLavaStyle = style; + orig(self); + return; + } + } + + cachedLavaStyle = default; + orig(self); + } + private static void DrawCustomLava(Terraria.GameContent.Drawing.On_TileDrawing.orig_DrawPartialLiquid orig, TileDrawing self, bool behindBlocks, Tile tileCache, ref Vector2 position, ref Rectangle liquidSize, int liquidType, ref VertexColors colors) { if (liquidType != 1) @@ -774,7 +795,7 @@ namespace CalamityMod.ILEditing } int slope = (int)tileCache.Slope; - colors = SelectLavaQuadColor(TextureAssets.LiquidSlope[liquidType].Value, ref colors, liquidType == 1); + colors = SelectLavaQuadColor(TextureAssets.LiquidSlope[liquidType].Value, ref colors, true); if (!TileID.Sets.BlocksWaterDrawingBehindSelf[tileCache.TileType] || behindBlocks || slope == 0) { Texture2D liquidTexture = SelectLavaTexture(liquidType == 1 ? CustomLavaManagement.LavaBlockTexture : TextureAssets.Liquid[liquidType].Value, LiquidTileType.Block); @@ -835,16 +856,29 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldloc, 8); cursor.Emit(OpCodes.Ldloc, 3); cursor.Emit(OpCodes.Ldloc, 4); + + // Caching these values can save a LOT of overhead at runtime. + ModWaterStyle sunkenSeaWater = ModContent.GetInstance(); + ModWaterStyle sulphuricWater = ModContent.GetInstance(); + ModWaterStyle sulphuricDepthsWater = ModContent.GetInstance(); + ModWaterStyle upperAbyssWater = ModContent.GetInstance(); + ModWaterStyle middleAbyssWater = ModContent.GetInstance(); + ModWaterStyle voidWater = ModContent.GetInstance(); + cursor.EmitDelegate>((initialColor, initialTexture, liquidType, x, y) => { - initialColor = SelectLavaQuadColor(initialTexture, ref initialColor, liquidType == 1); + // Don't bother changing the color if the cached drawing style is null. + if (cachedLavaStyle != default) + { + initialColor = SelectLavaQuadColor(initialTexture, ref initialColor, liquidType == 1); + } - if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot || - liquidType == ModContent.Find("CalamityMod/SulphuricWater").Slot || - liquidType == ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot || - liquidType == ModContent.Find("CalamityMod/UpperAbyssWater").Slot || - liquidType == ModContent.Find("CalamityMod/MiddleAbyssWater").Slot || - liquidType == ModContent.Find("CalamityMod/VoidWater").Slot) + if (liquidType == sunkenSeaWater.Slot || + liquidType == sulphuricWater.Slot || + liquidType == sulphuricDepthsWater.Slot || + liquidType == upperAbyssWater.Slot || + liquidType == middleAbyssWater.Slot || + liquidType == voidWater.Slot) { SelectSulphuricWaterColor(x, y, ref initialColor); } From 227e3f6e63394958dd261433af3b37fb0a7774ac Mon Sep 17 00:00:00 2001 From: YataYT <151573037+YataYT@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:13:57 -0600 Subject: [PATCH 09/48] Cosmic Shiv Rework (from the person the item is dedicated to) (#19) * Rework from Yatagarasu (patreon donor for Cosmic Shiv) --------- Co-authored-by: Cameron Ewell --- Items/Weapons/Melee/CosmicShiv.cs | 8 +- Projectiles/Melee/CosmicShivAura.cs | 71 ++++++ Projectiles/Melee/CosmicShivBall.cs | 133 ---------- Projectiles/Melee/CosmicShivBlade.cs | 128 +++++----- Projectiles/Melee/CosmicShivTrail.cs | 232 ++++++++++++++++++ .../{GalaxyStar.png => CosmicShivTrail.png} | Bin Projectiles/Melee/GalaxyStar.cs | 56 ----- .../Melee/Shortswords/CosmicShivProj.cs | 78 ++++-- 8 files changed, 432 insertions(+), 274 deletions(-) create mode 100644 Projectiles/Melee/CosmicShivAura.cs delete mode 100644 Projectiles/Melee/CosmicShivBall.cs create mode 100644 Projectiles/Melee/CosmicShivTrail.cs rename Projectiles/Melee/{GalaxyStar.png => CosmicShivTrail.png} (100%) delete mode 100644 Projectiles/Melee/GalaxyStar.cs diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index e67e36ebfc..518e84bb8c 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -20,16 +20,16 @@ namespace CalamityMod.Items.Weapons.Melee Item.noUseGraphic = true; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Rapier; - Item.damage = 98; + Item.damage = 300; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 18; + Item.useAnimation = Item.useTime = 38; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 2.4f; Item.knockBack = 9f; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.rare = ModContent.RarityType(); - Item.Calamity().donorItem = true; //Yatagarasu#0001 + Item.Calamity().donorItem = true; // revertusernamechange on Discord (Yatagarasu) } public override bool MeleePrefix() => true; @@ -43,4 +43,4 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } -} +} \ No newline at end of file diff --git a/Projectiles/Melee/CosmicShivAura.cs b/Projectiles/Melee/CosmicShivAura.cs new file mode 100644 index 0000000000..39e903edfb --- /dev/null +++ b/Projectiles/Melee/CosmicShivAura.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class CosmicShivAura : ModProjectile + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public readonly int SwordsAverageDelay = 40; + public readonly int SwordsRandomOffset = 15; + public int CurrentSwordTimer; + public NPC target; + + public override void SetDefaults() + { + Projectile.width = 2; + Projectile.height = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + } + + public override void OnSpawn(IEntitySource source) + { + if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) + target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object + } + + // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found + // ai[1] for sword timer + public override void AI() + { + // Unexist with target + if (target is null || !target.active) { + Projectile.Kill(); + } + + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target + + if (Projectile.ai[1] == CurrentSwordTimer) + { + Vector2 randomDirection = Main.rand.NextFloat(0, MathHelper.TwoPi).ToRotationVector2(); + randomDirection.Normalize(); + int randomDistance = Main.rand.Next(200, 426); + Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); + Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); + Projectile.ai[1] = 0; // Reset timer + CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn + } + + Projectile.ai[1]++; + } + + // The aura itself should not do contact damage + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs deleted file mode 100644 index fcbf9b6d7a..0000000000 --- a/Projectiles/Melee/CosmicShivBall.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; - -namespace CalamityMod.Projectiles.Melee -{ - public class CosmicShivBall : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - // TODO -- Please for the love of god refactor this at some point. It is ancient. - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public NPC target = null; - public const float maxDistanceToTarget = 540f; - public bool initialized = false; - public float startingVelocityY = 0f; - public float randomAngleDelta = 0f; - public const float explosionDamageMultiplier = 1.5f; - public override void SetDefaults() - { - Projectile.width = 12; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 220; - } - public override void AI() - { - if (!initialized) - { - target = Projectile.Center.ClosestNPCAt(maxDistanceToTarget); - startingVelocityY = Projectile.velocity.Y; - randomAngleDelta = Main.rand.NextFloat(0f, MathHelper.TwoPi); - initialized = true; - } - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) - { - for (int i = 0; i < 3; i++) - { - int dustID = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, (float)(Projectile.direction * 2), 0f, 115, Color.White, 1.3f); - Main.dust[dustID].noGravity = true; - Main.dust[dustID].velocity *= 0f; - } - } - if (Projectile.localAI[0] % 30 == 0) // every 0.5 seconds - { - target = Projectile.Center.ClosestNPCAt(maxDistanceToTarget); - } - if (target != null) - { - float inertia = 35f; - float homingSpeed = 33.5f; - Vector2 idealVelocity = Projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; - Projectile.velocity = (Projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; - } - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // for spawning the side beams - for (int i = 0; i < 2; i++) - { - int directionSign = Main.rand.NextBool().ToDirectionInt(); - Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501)); - Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner); - } - int starMax = Main.rand.Next(6, 11); // 6 to 10 stars - for (int i = -starMax / 2; i < starMax / 2; i++) - { - int ySpawnAdditive = Main.rand.Next(-40, 41); - Vector2 toSpawn = target.Center - new Vector2(0f, 800f + ySpawnAdditive).RotatedBy(MathHelper.ToRadians(i * 11f / starMax)); - Vector2 toTarget = Vector2.Normalize(target.Center - toSpawn) * 35f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); - } - target.AddBuff(ModContent.BuffType(), 60); - } - // pretty much entirely from the Oracle circular damage code - - private void CircularDamage(float radius) - { - if (Projectile.owner != Main.myPlayer) - return; - Player owner = Main.player[Projectile.owner]; - - for (int i = 0; i < Main.npc.Length; ++i) - { - NPC target = Main.npc[i]; - if (!target.active || target.dontTakeDamage || target.friendly) - continue; - - // Shock any valid target within range. Check all four corners of their hitbox. - float d1 = Vector2.Distance(Projectile.Center, target.Hitbox.TopLeft()); - float d2 = Vector2.Distance(Projectile.Center, target.Hitbox.TopRight()); - float d3 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomLeft()); - float d4 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomRight()); - float dist = MathHelper.Min(d1, d2); - dist = MathHelper.Min(dist, d3); - dist = MathHelper.Min(dist, d4); - - if (dist <= radius) - { - int damage = (int)(Projectile.damage * explosionDamageMultiplier); - bool crit = Main.rand.Next(100) <= owner.GetCritChance() + 4; - target.StrikeNPC(target.CalculateHitInfo(damage, 0, crit, 0)); - - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); - } - } - } - public override void OnKill(int timeLeft) - { - // mostly from AstralCrystal kill code - float rand2PI = Main.rand.NextFloat(MathHelper.TwoPi); - int petalCount = 5; - float speed = 12f; - float scale = Main.rand.NextFloat(1f, 1.35f); - for (float k = 0f; k < MathHelper.TwoPi; k += 0.05f) - { - Vector2 velocity = k.ToRotationVector2() * (2f + (float)(Math.Sin((double)(rand2PI + k * (float)petalCount)) + 1.0) * speed) * Main.rand.NextFloat(0.95f, 1.05f); - Dust dust = Dust.NewDustPerfect(Projectile.Center, 173, new Vector2?(velocity), 0, default, scale); - dust.customData = 0.025f; - } - CircularDamage(80f); - } - } -} diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 092bf4affe..29b208bbbe 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -4,96 +4,100 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria.DataStructures; +using Newtonsoft.Json.Linq; +using Terraria.Graphics.Shaders; +using Terraria.Graphics; namespace CalamityMod.Projectiles.Melee { public class CosmicShivBlade : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - public const int penetrateMax = 12; - public const float maxScale = 1.8f; - public bool initialized = false; - public float startYVelSign = 0f; + public Vector2 StartPosition = Vector2.Zero; + public int ColorIndex = 0; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + public override void SetDefaults() { Projectile.width = 42; Projectile.height = 42; Projectile.friendly = true; - Projectile.penetrate = penetrateMax; + Projectile.penetrate = 5; Projectile.tileCollide = false; - Projectile.timeLeft = 290; + Projectile.timeLeft = 6000; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 7; + Projectile.localNPCHitCooldown = -1; + Projectile.extraUpdates = 2; + Projectile.alpha = 0; + Projectile.scale = 1.2f; } + + public override void OnSpawn(IEntitySource source) + { + StartPosition = Projectile.position; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + ColorIndex = Main.rand.Next(0, CosmicShivTrail.DustColors.Count); + } + public override void AI() { - if (!initialized) - { - startYVelSign = (float)Math.Sign(Projectile.velocity.Y) * 0.35f; - initialized = true; - } - if (Projectile.penetrate == penetrateMax && Projectile.timeLeft < 245) - { - Projectile.velocity.Y -= startYVelSign; //arc on the X axis (the amount of pressure on this tiny detail made me want to tear my head off) - if (Math.Abs(Projectile.velocity.X) < 30f) - { - Projectile.velocity.X *= 1.04f; - } - } - if (Projectile.velocity.Length() != 0) - { - Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.Pi / 4; - } - else - { - Projectile.rotation += MathHelper.Pi / 6f / (Projectile.scale * 2.5f); - } - Projectile.ai[0]++; - if (Projectile.ai[1] >= 0) - { - Projectile.ai[1]--; - if (Projectile.ai[1] == 0) - { - Projectile.velocity *= -0.9f; - } - } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + if (Projectile.Distance(StartPosition) > Projectile.ai[0] * 2) + Projectile.Kill(); + + Lighting.AddLight(Projectile.Center, Projectile.GetAlpha(Color.White).ToVector3() * 0.2f); } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Projectile.scale += (maxScale - 1) / (float)penetrateMax; - Projectile.ai[1] = 5 + Main.rand.Next(-2, 3); target.AddBuff(ModContent.BuffType(), 120); } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Rectangle sourceRectangle = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = sourceRectangle.Size() / 2f; + float rotation = Projectile.rotation; + Color randomColor = Projectile.GetAlpha(lightColor); + + float scaleMult = 1.2f; + for (int i = 0; i < Projectile.oldPos.Length; i++) // Afterimages to make the blade look longer + { + Vector2 drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color color = randomColor * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color, rotation, origin, Projectile.scale * scaleMult, SpriteEffects.None, 0f); // Smaller, more visible layer + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color * 0.5f, rotation, origin, Projectile.scale * 1.6f * scaleMult, SpriteEffects.None, 0f); // Bigger, less visible layer + scaleMult *= 0.95f; + } + + return false; + } + public override void OnKill(int timeLeft) { - Vector2 randomCirclePointVector = Vector2.One.RotatedByRandom(MathHelper.ToRadians(32f)); - float lerpStart = (float)Main.rand.Next(12, 17); - float lerpEnd = (float)Main.rand.Next(3, 7); - for (float i = 0; i < 9f; ++i) + for (int i = 0; i < 6; i++) { - for (int j = 0; j < 2; ++j) - { - Vector2 randomCirclePointRotated = randomCirclePointVector.RotatedBy((j == 0 ? 1 : -1) * MathHelper.TwoPi / 18); - for (float k = 0f; k < 20f; ++k) - { - Vector2 randomCirclePointLerped = Vector2.Lerp(randomCirclePointVector, randomCirclePointRotated, k / 20f); - float lerpMultiplier = MathHelper.Lerp(lerpStart, lerpEnd, k / 20f) * 4f; - int dustIndex = Dust.NewDust(Projectile.Center, 0, 0, - 173, - 0f, 0f, 100, default, 1.1f); - Main.dust[dustIndex].velocity *= 0.1f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].velocity += randomCirclePointLerped * lerpMultiplier; - } - } - - randomCirclePointVector = randomCirclePointVector.RotatedBy(MathHelper.TwoPi / 9); + Dust dust = Dust.NewDustDirect(Projectile.Center, Projectile.width, Projectile.height, DustID.RainbowMk2, 0f, 0f, 0, Projectile.GetAlpha(Color.Purple) * 0.4f, 1.5f); + dust.noGravity = true; } } - public override Color? GetAlpha(Color lightColor) + + public override Color? GetAlpha(Color lightColor) // Probably not the right way to use this function, but it works (hopefully) { - return new Color(124, Main.DiscoG, 255, Projectile.alpha); + Color color = CosmicShivTrail.DustColors[ColorIndex] * Projectile.Opacity; + color = Color.Lerp(color, Color.White, 0.6f); + color.A = 0; + return color; // Take random color from a list and make it more white } } } diff --git a/Projectiles/Melee/CosmicShivTrail.cs b/Projectiles/Melee/CosmicShivTrail.cs new file mode 100644 index 0000000000..01c7d802d6 --- /dev/null +++ b/Projectiles/Melee/CosmicShivTrail.cs @@ -0,0 +1,232 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Reflection.Metadata; +using Microsoft.Xna.Framework.Graphics; +using System.Diagnostics.Contracts; +using Terraria.GameContent; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Melee +{ + public class CosmicShivTrail : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + + public NPC target = null; + public const float MaxDistanceToTarget = 540f; + public const float ExplosionDamageMultiplier = 2f; + public const int FadeInTime = 12; + + public static List DustColors = new List + { + new Color(69, 69, 222), + new Color(99, 66, 212), + new Color(130, 64, 214), + new Color(154, 75, 219), + new Color(165, 62, 201) + }; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 24; + Projectile.height = 24; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.timeLeft = 220; + Projectile.scale = 0.7f; + Projectile.Opacity = 0f; + Projectile.extraUpdates = 1; + } + + public override void AI() + { + int QuarterSpriteWidth = 48 / 3; + int QuarterSpriteHeight = 48 / 3; + + int QuarterProjWidth = Projectile.width / 3; + int QuarterProjHeight = Projectile.height / 3; + + DrawOriginOffsetX = 0; + DrawOffsetX = -(QuarterSpriteWidth - QuarterProjWidth); + DrawOriginOffsetY = -(QuarterSpriteHeight - QuarterProjHeight); + + + Lighting.AddLight(Projectile.Center, Projectile.GetAlpha(Color.White).ToVector3()); + + Projectile.rotation += Utils.GetLerpValue(-8f, 12f, Projectile.velocity.Length(), clamped: true); + + if (Projectile.ai[0] > 2f) // After two frames + { + Projectile.Opacity = Utils.GetLerpValue(2f, FadeInTime, Projectile.ai[0], clamped: true); // Fade in + + if (Main.rand.Next(0, 2) == 0) // Dust trail + { + float scale = Main.rand.NextFloat(1.6f, 2.1f); + Color randomColor = DustColors[Main.rand.Next(0, DustColors.Count)]; + Dust dust = Dust.NewDustDirect(Projectile.position, 1, 1, DustID.RainbowMk2, 0, 0, 255, randomColor * 0.6f, scale); + dust.noGravity = true; + } + } + + if (Projectile.ai[0] % 30 == 16) // every 0.25 seconds, starting 8 frames later (extraUpdates = 1 so the values are doubled) + { + target = Projectile.Center.ClosestNPCAt(MaxDistanceToTarget); + } + + if (target is not null) + { + Vector2 targetVelocity = (target.Center - Projectile.Center).SafeNormalize(Vector2.Zero); + + float multiplier = Projectile.velocity.Length() < 4f ? Projectile.velocity.Length() + 1f : 1f; // Probably a better way to do this, but just a bandaid fix for if the trail velocity ends up being low + targetVelocity *= Projectile.velocity.Length() + multiplier; + + Projectile.velocity = Vector2.Lerp(Projectile.velocity, targetVelocity, 0.12f); + } + + // lifespan timer + Projectile.ai[0]++; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + // Summons invisible aura that sticks to enemies, spawning blades + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, target.whoAmI); + target.AddBuff(ModContent.BuffType(), 60); + } + + // pretty much entirely from the Oracle circular damage code + private void CircularDamage(float radius) + { + if (Projectile.owner != Main.myPlayer) + return; + Player owner = Main.player[Projectile.owner]; + + for (int i = 0; i < Main.npc.Length; ++i) + { + NPC target = Main.npc[i]; + if (!target.active || target.dontTakeDamage || target.friendly) + continue; + + // Shock any valid target within range. Check all four corners of their hitbox. + float d1 = Vector2.Distance(Projectile.Center, target.Hitbox.TopLeft()); + float d2 = Vector2.Distance(Projectile.Center, target.Hitbox.TopRight()); + float d3 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomLeft()); + float d4 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomRight()); + float dist = MathHelper.Min(d1, d2); + dist = MathHelper.Min(dist, d3); + dist = MathHelper.Min(dist, d4); + + if (dist <= radius) + { + int damage = (int)(Projectile.damage * ExplosionDamageMultiplier); + bool crit = Main.rand.Next(100) <= owner.GetCritChance() + 4; + target.StrikeNPC(target.CalculateHitInfo(damage, 0, crit, 0)); + + if (Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); + } + } + } + + // Very similar to CosmicShivBlade PreDraw + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Rectangle sourceRectangle = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = sourceRectangle.Size() / 2f; + float rotation = Projectile.rotation; + Color color = Projectile.GetAlpha(Color.White); + float scaleMult = 1f; + + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + Vector2 drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + color *= ((float)(Projectile.oldPos.Length - (i / 4)) / (float)Projectile.oldPos.Length); + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color * 0.4f, rotation * -1f, origin, Projectile.scale * 1.8f * scaleMult, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color, rotation, origin, Projectile.scale * scaleMult, SpriteEffects.None, 0f); + scaleMult *= 0.9f; + } + + return false; + + } + + // Lots of trig here, use desmos to comprehend its full power + public override void OnKill(int timeLeft) + { + float rand2PI = Main.rand.NextFloat(0, MathHelper.TwoPi); // Random rotation offset + int rosePetalCount = Main.rand.Next(5, 8); + int bigWavyPetalCount = Main.rand.Next(7, 11); + int wavyPetalCount = Main.rand.Next(6, 10); + float speed = Main.rand.Next(6, 11); // Size + + int rand = Main.rand.Next(0, 10); // 10% chance rose, 10% chance big wavy shape, and 80% chance small undetail wavy shape + if (rand == 0) { + for (float k = 0f; k < MathHelper.TwoPi; k += 0.03f) + { + float scale = Main.rand.NextFloat(1.1f, 1.4f); + float randomWhitingValue = Main.rand.NextFloat(0.0f, 0.2f); + Color color = Color.Lerp(DustColors[Main.rand.Next(0, DustColors.Count)], Color.White, randomWhitingValue); + + Vector2 velocity = k.ToRotationVector2() * (2f + (float)(Math.Sin((double)(rand2PI + k * (float)rosePetalCount)) + 1.0) * speed) * Main.rand.NextFloat(0.95f, 1.05f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, new Vector2?(velocity), 0, color, scale); + dust.noGravity = true; + dust.fadeIn = -1f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, new Vector2?(velocity) * 0.75f, 0, color, scale); + dust2.noGravity = true; + dust2.fadeIn = -1f; + } + } else if (rand == 1) { + for (float k = 0f; k < MathHelper.TwoPi; k += 0.08f) + { + float scale = Main.rand.NextFloat(1.2f, 1.6f); + float randomWhitingValue = Main.rand.NextFloat(0.0f, 0.2f); + Color color = Color.Lerp(DustColors[Main.rand.Next(0, DustColors.Count)], Color.White, randomWhitingValue); + + Vector2 velocity = k.ToRotationVector2() * (float)(Math.Cos((double)(k * (float)bigWavyPetalCount) + rand2PI) + 5.1f) * speed / 4; + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, new Vector2?(velocity), 0, color, scale); + dust.noGravity = true; + dust.fadeIn = -1f; + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, new Vector2?(velocity) * 0.75f, 0, color, scale); + dust2.noGravity = true; + dust2.fadeIn = -1f; + } + } else { + for (float k = 0f; k < MathHelper.TwoPi; k += 0.2f) + { + float scale = Main.rand.NextFloat(1f, 1.2f); + float randomWhitingValue = Main.rand.NextFloat(0.5f, 0.7f); + Color color = Color.Lerp(DustColors[Main.rand.Next(0, DustColors.Count)], Color.White, randomWhitingValue); + + Vector2 velocity = k.ToRotationVector2() * (0.4f * (float)(Math.Sin((double)(k * (float)wavyPetalCount) + rand2PI) + 2.1f) * (speed / 2)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, new Vector2?(velocity), 0, color * 0.3f, scale); + dust.noGravity = true; + dust.fadeIn = -1f; + } + } + + CircularDamage(80f); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(238, 171, 255, 25) * Projectile.Opacity; + } + } +} diff --git a/Projectiles/Melee/GalaxyStar.png b/Projectiles/Melee/CosmicShivTrail.png similarity index 100% rename from Projectiles/Melee/GalaxyStar.png rename to Projectiles/Melee/CosmicShivTrail.png diff --git a/Projectiles/Melee/GalaxyStar.cs b/Projectiles/Melee/GalaxyStar.cs deleted file mode 100644 index 6fffa74c23..0000000000 --- a/Projectiles/Melee/GalaxyStar.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Audio; - -namespace CalamityMod.Projectiles.Melee -{ - public class GalaxyStar : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public bool madeCoolMagicSound = false; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 42; - Projectile.height = 42; - Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 160; - Projectile.extraUpdates = 2; - } - public override void AI() - { - Lighting.AddLight(Projectile.Center, 1f, 1f, 1f); - if (!madeCoolMagicSound) - { - SoundEngine.PlaySound(SoundID.Item9, Projectile.position); // Starfury sound - madeCoolMagicSound = true; - } - Projectile.ai[0]++; - if (Projectile.ai[0] % 5 == 0) - { - for (int i = 0; i < Main.rand.Next(2, 4); i++) //2-3 stars - { - Vector2 randVector = Vector2.One.RotatedByRandom(Math.PI * 2.0) * 0.7f; - Dust.NewDust(Projectile.Center, 4, 4, 58, randVector.X, randVector.Y, 0, default, 1f); - } - } - Projectile.rotation += Projectile.velocity.Length() / 19f; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); - return false; - } - } -} diff --git a/Projectiles/Melee/Shortswords/CosmicShivProj.cs b/Projectiles/Melee/Shortswords/CosmicShivProj.cs index 6ca1318dc8..a22c6cb94b 100644 --- a/Projectiles/Melee/Shortswords/CosmicShivProj.cs +++ b/Projectiles/Melee/Shortswords/CosmicShivProj.cs @@ -1,9 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -14,6 +19,8 @@ namespace CalamityMod.Projectiles.Melee.Shortswords { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/CosmicShiv"; + public bool MeleeEffect = false; + public int NumHits = 0; public override void SetDefaults() { @@ -29,12 +36,12 @@ namespace CalamityMod.Projectiles.Melee.Shortswords Projectile.hide = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = -1; } public override Action EffectBeforePullback => (proj) => { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 3f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); }; public override void SetVisualOffsets() @@ -50,31 +57,64 @@ namespace CalamityMod.Projectiles.Melee.Shortswords DrawOriginOffsetY = -(HalfSpriteHeight - HalfProjHeight); } - public override void ExtraBehavior() - { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 173); - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - for (int k = 0; k < 36; k++) - { - int dustID = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height -16, 173, 0f, 0f, 0, default, 1f); - Main.dust[dustID].velocity *= 3f; - Main.dust[dustID].scale *= 2f; + OnHitEffect(); + + if (NumHits < 3) { // Just to avoid insanity from stacking so many super dummies or hitting many worm segments at once + // 2x bonus for true melee hits (spawns an additional aura plus the one aura from the cosmic shiv ball) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, target.whoAmI); + NumHits++; } - target.AddBuff(ModContent.BuffType(), 120); + + target.AddBuff(ModContent.BuffType(), 240); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - for (int k = 0; k < 36; k++) + OnHitEffect(); + + target.AddBuff(ModContent.BuffType(), 240); + } + + public void OnHitEffect() + { + float rand2PI = Main.rand.NextFloat(MathHelper.TwoPi); // Random rotation offset + int petalCount = Main.rand.Next(5, 8); // Number of star points + float speed = Main.rand.Next(18, 24); // Size of star + + // Bool check so it only performs this effect once per strike, at a 50% chance + if (!MeleeEffect && Main.rand.NextBool()) { - int dustID = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height - 16, 173, 0f, 0f, 0, default, 1f); - Main.dust[dustID].velocity *= 3f; - Main.dust[dustID].scale *= 2f; + for (float k = 0f; k < MathHelper.TwoPi; k += 0.08f) + { + float scale = Main.rand.NextFloat(1.5f, 1.9f); + float randomWhitingValue = Main.rand.NextFloat(0.0f, 0.2f); + Color color = Color.Lerp(CosmicShivTrail.DustColors[Main.rand.Next(0, CosmicShivTrail.DustColors.Count)], Color.White, randomWhitingValue); // Just for even more variety in colors idk + Vector2 velocity = StarPolarEquation(petalCount, k, rand2PI) * speed * 2; + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, velocity, 0, color, scale); + dust.noGravity = true; + dust.fadeIn = -1f; // I don't know if this does anything but it looks like the dust fades out faster with this + + Vector2 velocity2 = StarPolarEquation(petalCount, k - 0.04f, rand2PI) * speed * 2 * 0.9f; // Inner star + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB, velocity2, 0, color, scale); + dust2.noGravity = true; + dust2.fadeIn = -1f; + } } - target.AddBuff(ModContent.BuffType(), 120); + } + + public Vector2 StarPolarEquation(int pointCount, float angle, float offset) // For OnHitNPC(), Thanks Dominic + { + // There should be a star point that looks directly upward. However, that isn't the case for odd star counts with the equation below. + // To address this, a -90 degree rotation is performed. + // Refer to desmos to view the resulting shape this creates. It's basically a black box of trig otherwise. + float sqrt3 = 1.732051f; + float numerator = MathF.Cos(MathHelper.Pi * (pointCount + 1f) / pointCount); + float starAdjustedAngle = MathF.Asin(MathF.Cos(pointCount * angle + offset)) * 2f; + float denominator = MathF.Cos((starAdjustedAngle + MathHelper.PiOver2 * pointCount) / (pointCount * 2f)); + Vector2 result = angle.ToRotationVector2() * numerator / denominator / sqrt3; + return result; } } } From bb9807964b83eecac0477331eac4d691db3f861e Mon Sep 17 00:00:00 2001 From: JavyzTaken <36089970+JavyzTaken@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:36:52 +0100 Subject: [PATCH 10/48] Fargo's Mutant Mod Stat Sheet support for the Rogue Class (#21) --- ModSupport/WeakReferenceSupport.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index b9b8987d39..1327f31e92 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -18,6 +18,7 @@ using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; @@ -1040,6 +1041,17 @@ namespace CalamityMod if (fargos is null) return; + // Stat Sheet support + double Damage(DamageClass damageClass) => Math.Round(Main.LocalPlayer.GetTotalDamage(damageClass).Additive * Main.LocalPlayer.GetTotalDamage(damageClass).Multiplicative * 100 - 100); + int Crit(DamageClass damageClass) => (int)Main.LocalPlayer.GetTotalCritChance(damageClass); + + int rogueItem = ModContent.ItemType(); + DamageClass rogueDamageClass = ModContent.GetInstance(); + Func rogueDamage = () => $"Rogue Damage: {Damage(rogueDamageClass)}%"; + Func rogueCrit = () => $"Rogue Critical: {Crit(rogueDamageClass)}%"; + fargos.Call("AddStat", rogueItem, rogueDamage); + fargos.Call("AddStat", rogueItem, rogueCrit); + void AddToMutantShop(string bossName, string summonItemName, Func downed, int price) { BossChecklistProgressionValues.TryGetValue(bossName, out float order); From 4db0ebdea26f6f6c5cc59fddee260bc9bca7a5da Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sat, 10 Feb 2024 13:20:56 +0900 Subject: [PATCH 11/48] Fix crimson plant bug, multiplayer pylon bug (#22) * Fix bug where crimson plants are destroyed immediately after planted * Fix multiplayer pylon bugs --- Tiles/Furniture/Fountains/AbyssFountainTile.cs | 2 +- Tiles/Furniture/Fountains/AstralFountainTile.cs | 2 +- Tiles/Furniture/Fountains/SulphurousFountainTile.cs | 2 +- Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs | 2 +- Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs | 3 ++- Tiles/SunkenSea/FanCoral.cs | 3 ++- Utilities/TileFraming.cs | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tiles/Furniture/Fountains/AbyssFountainTile.cs b/Tiles/Furniture/Fountains/AbyssFountainTile.cs index 253fbee3ea..9c3464b1fd 100644 --- a/Tiles/Furniture/Fountains/AbyssFountainTile.cs +++ b/Tiles/Furniture/Fountains/AbyssFountainTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/VoidWater").Slot; } diff --git a/Tiles/Furniture/Fountains/AstralFountainTile.cs b/Tiles/Furniture/Fountains/AstralFountainTile.cs index d06c0e44ae..44c0823d18 100644 --- a/Tiles/Furniture/Fountains/AstralFountainTile.cs +++ b/Tiles/Furniture/Fountains/AstralFountainTile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/AstralWater").Slot; } diff --git a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs index 9c0da14f6d..35f96bd6c4 100644 --- a/Tiles/Furniture/Fountains/SulphurousFountainTile.cs +++ b/Tiles/Furniture/Fountains/SulphurousFountainTile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { string waterColor = Main.zenithWorld ? "CalamityMod/PissWater" : "CalamityMod/SulphuricWater"; - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find(waterColor).Slot; } diff --git a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs index 8ff20df623..01867f0992 100644 --- a/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs +++ b/Tiles/Furniture/Fountains/SunkenSeaFountainTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.Furniture.Fountains public override void NearbyEffects(int i, int j, bool closer) { - if (Main.tile[i, j].TileFrameX >= 36) + if (!Main.dedServ && Main.tile[i, j].TileFrameX >= 36) Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } diff --git a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs index 6dde836456..29797481d3 100644 --- a/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/FanCoralEcho.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea public override void NearbyEffects(int i, int j, bool closer) { - Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; + if (!Main.dedServ) + Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/SunkenSea/FanCoral.cs b/Tiles/SunkenSea/FanCoral.cs index 9b79218502..9159a92307 100644 --- a/Tiles/SunkenSea/FanCoral.cs +++ b/Tiles/SunkenSea/FanCoral.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Tiles.SunkenSea public override void NearbyEffects(int i, int j, bool closer) { - Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; + if (!Main.dedServ) + Main.SceneMetrics.ActiveFountainColor = ModContent.Find("CalamityMod/SunkenSeaWater").Slot; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 4b614ad800..81a5c9e29e 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -61,7 +61,7 @@ namespace CalamityMod PlantCheckAgainst[TileID.JunglePlants2] = new int[1] { TileID.JungleGrass }; PlantCheckAgainst[TileID.HallowedPlants] = new int[1] { TileID.HallowedGrass }; PlantCheckAgainst[TileID.HallowedPlants2] = new int[1] { TileID.HallowedGrass }; - PlantCheckAgainst[TileID.CrimsonPlants] = new int[1] { TileID.CrimsonPlants }; + PlantCheckAgainst[TileID.CrimsonPlants] = new int[1] { TileID.CrimsonGrass }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; From ca86f74737c7e306fdf2380812bad859c2f3f6ab Mon Sep 17 00:00:00 2001 From: Toasty <74939552+toasty599@users.noreply.github.com> Date: Thu, 29 Feb 2024 06:17:19 +0000 Subject: [PATCH 12/48] Primitive System Remake (#23) * - Primitive system rewrite, start of converting old code to use the newer system. * - Tweaks to the primitive manager to match the old one. - Finished porting old uses of the primitives to the new ones. - Improved XML documentation on the newer ones. * Delete en-US.hjson * Remove cosmic shiv auto-entry * - Indentation fixes. * - Remove interface access modifiers --- .../Primitives/IPixelatedPrimitiveRenderer.cs | 20 ++ .../Primitives/PixelationPrimitiveLayer.cs | 15 + .../Primitives/PrimitivePixelationSystem.cs | 158 ++++++++++ Graphics/Primitives/PrimitiveSet.cs | 296 ++++++++++++++++++ Graphics/Primitives/PrimitiveSettings.cs | 92 ++++++ Graphics/Primitives/PrimitiveTrail.cs | 262 ---------------- .../VertexPosition2DColorTexture.cs | 46 +++ NPCs/AcidRain/AcidEel.cs | 10 +- NPCs/ExoMechs/Apollo/Apollo.cs | 25 +- NPCs/ExoMechs/Ares/AresBody.cs | 26 +- NPCs/ExoMechs/Artemis/Artemis.cs | 24 +- NPCs/SupremeCalamitas/BrimstoneHeart.cs | 8 +- Projectiles/Boss/ApolloChargeTelegraph.cs | 7 +- Projectiles/Boss/AresTeslaOrb.cs | 12 +- Projectiles/Boss/ArtemisChargeTelegraph.cs | 10 +- Projectiles/Boss/ArtemisSpinLaserbeam.cs | 10 +- .../Boss/CirrusPhotonRipperPrismTooth.cs | 7 +- Projectiles/Boss/DraedonSummonLaser.cs | 9 +- Projectiles/Boss/DyingSun.cs | 8 +- Projectiles/Boss/InfernadoRevenge.cs | 7 +- .../DraedonsArsenal/PhaseslayerProjectile.cs | 7 +- .../DraedonsArsenal/SnakeEyesProjectile.cs | 5 +- Projectiles/Enemy/GammRayBurst.cs | 9 +- Projectiles/Magic/ApotheosisEnergy.cs | 9 +- Projectiles/Magic/ArtAttackStar.cs | 9 +- Projectiles/Magic/EternityHex.cs | 9 +- Projectiles/Magic/ExoVortex.cs | 8 +- Projectiles/Magic/ExoVortex2.cs | 8 +- Projectiles/Magic/FabBolt.cs | 9 +- Projectiles/Magic/FabRay.cs | 10 +- Projectiles/Magic/RainbowRocket.cs | 7 +- Projectiles/Magic/RancorLaserbeam.cs | 7 +- Projectiles/Magic/WulfrumBolt.cs | 9 +- Projectiles/Melee/CosmicShivAura.cs | 142 ++++----- Projectiles/Melee/EonBolt.cs | 8 +- Projectiles/Melee/Exobeam.cs | 20 +- Projectiles/Melee/ExobladeProj.cs | 15 +- Projectiles/Melee/MarniteObliteratorProj.cs | 11 +- Projectiles/Melee/PrismTooth.cs | 7 +- Projectiles/Melee/RendingNeedle.cs | 10 +- Projectiles/Melee/StygianShieldAttack.cs | 10 +- Projectiles/Melee/TaintedBladeSlasher.cs | 22 +- Projectiles/Melee/TerratomereBeam.cs | 8 +- Projectiles/Melee/TerratomereBigSlash.cs | 8 +- Projectiles/Melee/TerratomereHoldoutProj.cs | 7 +- Projectiles/Melee/ViolenceSlashProjectile.cs | 9 +- Projectiles/Melee/ViolenceThrownProjectile.cs | 9 +- Projectiles/Melee/WulfrumScrew.cs | 9 +- Projectiles/Ranged/ExoCrystalArrow.cs | 10 +- Projectiles/Ranged/ExoLightningBolt.cs | 7 +- Projectiles/Ranged/MarksmanShot.cs | 7 +- Projectiles/Ranged/MeowCreature.cs | 9 +- Projectiles/Ranged/MineralMortarProjectile.cs | 7 +- Projectiles/Ranged/PristineFire.cs | 9 +- Projectiles/Ranged/SpeedBlasterShot.cs | 7 +- Projectiles/Ranged/TelluricGlareArrow.cs | 9 +- Projectiles/Ranged/TheMaelstromShark.cs | 7 +- Projectiles/Ranged/WulfrumScrapBullet.cs | 8 +- .../Rogue/DynamicPursuerElectricity.cs | 13 +- .../Rogue/FishboneBoomerangProjectile.cs | 1 - Projectiles/Rogue/ScarletDevilProjectile.cs | 8 +- Projectiles/Rogue/StormfrontLightning.cs | 8 +- Projectiles/Rogue/WulfrumKnifeProj.cs | 8 +- .../Summon/CnidarianJellyfishOnTheString.cs | 9 +- Projectiles/Summon/CosmilampBeam.cs | 12 +- Projectiles/Summon/DaedalusLightning.cs | 9 +- .../Summon/SmallAresArms/MinionTeslaOrb.cs | 16 +- Projectiles/Summon/WulfrumDroid.cs | 6 +- Projectiles/Summon/WulfrumEnergyBurst.cs | 8 +- Projectiles/Summon/WulfrumFusionBolt.cs | 7 +- Projectiles/Typeless/GemTechArmorGem.cs | 7 +- Projectiles/Typeless/MythrilFlare.cs | 9 +- Projectiles/Typeless/SuicideBomberDemon.cs | 8 +- Projectiles/Typeless/WulfrumHook.cs | 9 +- 74 files changed, 889 insertions(+), 782 deletions(-) create mode 100644 Graphics/Primitives/IPixelatedPrimitiveRenderer.cs create mode 100644 Graphics/Primitives/PixelationPrimitiveLayer.cs create mode 100644 Graphics/Primitives/PrimitivePixelationSystem.cs create mode 100644 Graphics/Primitives/PrimitiveSet.cs create mode 100644 Graphics/Primitives/PrimitiveSettings.cs delete mode 100644 Graphics/Primitives/PrimitiveTrail.cs create mode 100644 Graphics/Primitives/VertexPosition2DColorTexture.cs diff --git a/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs b/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs new file mode 100644 index 0000000000..7270d3e93a --- /dev/null +++ b/Graphics/Primitives/IPixelatedPrimitiveRenderer.cs @@ -0,0 +1,20 @@ +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Graphics.Primitives +{ + /// + /// Use to sucessfully render primitives with pixelation with an NPC or Projectile. + /// + public interface IPixelatedPrimitiveRenderer + { + /// + /// The layer to render the primitive(s) to. + /// + PixelationPrimitiveLayer LayerToRenderTo => PixelationPrimitiveLayer.BeforeProjectiles; + + /// + /// Render primitives that use pixelation here. + /// + void RenderPixelatedPrimitives(SpriteBatch spriteBatch); + } +} diff --git a/Graphics/Primitives/PixelationPrimitiveLayer.cs b/Graphics/Primitives/PixelationPrimitiveLayer.cs new file mode 100644 index 0000000000..1ed0348bc8 --- /dev/null +++ b/Graphics/Primitives/PixelationPrimitiveLayer.cs @@ -0,0 +1,15 @@ +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Graphics.Primitives +{ + /// + /// Controls what layer the renders to. + /// + public enum PixelationPrimitiveLayer + { + BeforeNPCs, + AfterNPCs, + BeforeProjectiles, + AfterProjectiles + } +} diff --git a/Graphics/Primitives/PrimitivePixelationSystem.cs b/Graphics/Primitives/PrimitivePixelationSystem.cs new file mode 100644 index 0000000000..27a40a1efd --- /dev/null +++ b/Graphics/Primitives/PrimitivePixelationSystem.cs @@ -0,0 +1,158 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Graphics.Primitives +{ + public class PrimitivePixelationSystem : ModSystem + { + #region Fields/Properties + private static ManagedRenderTarget PixelationTarget_BeforeNPCs; + + private static ManagedRenderTarget PixelationTarget_AfterNPCs; + + private static ManagedRenderTarget PixelationTarget_BeforeProjectiles; + + private static ManagedRenderTarget PixelationTarget_AfterProjectiles; + + private static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.instance.GraphicsDevice, width / 2, height / 2); + + /// + /// Whether the system is currently rendering any primitives. + /// + public static bool CurrentlyRendering + { + get; + private set; + } + #endregion + + #region Loading + public override void Load() + { + On_Main.CheckMonoliths += DrawToTargets; + On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs; + On_Main.DrawProjectiles += DrawTarget_Projectiles; + + PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget); + PixelationTarget_AfterNPCs = new(true, CreatePixelTarget); + PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget); + PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget); + } + + public override void Unload() + { + On_Main.CheckMonoliths -= DrawToTargets; + On_Main.DoDraw_DrawNPCsOverTiles -= DrawTarget_NPCs; + } + #endregion + + #region Drawing To Targets + private void DrawToTargets(On_Main.orig_CheckMonoliths orig) + { + if (Main.gameMenu) + { + orig(); + return; + } + + var beforeNPCs = new List(); + var afterNPCs = new List(); + var beforeProjectiles = new List(); + var afterProjectiles = new List(); + + // Check every active projectile. + for (int i = 0; i < Main.maxProjectiles; i++) + { + var projectile = Main.projectile[i]; + + // If the projectile is active, a mod projectile, and uses the interface, add it to the list of primitives to draw this frame. + if (projectile.active && projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile) + { + var listToUse = pixelPrimitiveProjectile.LayerToRenderTo switch + { + PixelationPrimitiveLayer.BeforeNPCs => beforeNPCs, + PixelationPrimitiveLayer.AfterNPCs => afterNPCs, + PixelationPrimitiveLayer.BeforeProjectiles => beforeProjectiles, + _ => afterProjectiles + }; + listToUse.Add(pixelPrimitiveProjectile); + } + } + + // Check every active NPC. + for (int i = 0; i < Main.maxNPCs; i++) + { + var npc = Main.npc[i]; + + // If the NPC is active, a mod NPC, and uses the interface, add it to the list of primitives to draw this frame. + if (npc.active && npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC) + { + var listToUse = pixelPrimitiveNPC.LayerToRenderTo switch + { + PixelationPrimitiveLayer.BeforeNPCs => beforeNPCs, + PixelationPrimitiveLayer.AfterNPCs => afterNPCs, + PixelationPrimitiveLayer.BeforeProjectiles => beforeProjectiles, + _ => afterProjectiles + }; + listToUse.Add(pixelPrimitiveNPC); + } + } + + CurrentlyRendering = true; + + DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, beforeNPCs); + DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, afterNPCs); + DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, beforeProjectiles); + DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, afterProjectiles); + + Main.instance.GraphicsDevice.SetRenderTarget(null); + + CurrentlyRendering = false; + orig(); + } + + private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, List pixelPrimitives) + { + // Swap to the target regardless, in order to clear any leftover content from last frame. Not doing this results in the final frame lingering once it stops rendering. + renderTarget.SwapTo(); + + if (pixelPrimitives.Any()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null); + + foreach (var pixelPrimitiveDrawer in pixelPrimitives) + pixelPrimitiveDrawer.RenderPixelatedPrimitives(Main.spriteBatch); + + Main.spriteBatch.End(); + } + } + #endregion + + #region Target Drawing + private void DrawTarget_NPCs(On_Main.orig_DoDraw_DrawNPCsOverTiles orig, Main self) + { + DrawTargetScaled(PixelationTarget_BeforeNPCs); + orig(self); + DrawTargetScaled(PixelationTarget_AfterNPCs); + } + + private void DrawTarget_Projectiles(On_Main.orig_DrawProjectiles orig, Main self) + { + DrawTargetScaled(PixelationTarget_BeforeProjectiles); + orig(self); + DrawTargetScaled(PixelationTarget_AfterProjectiles); + } + + private static void DrawTargetScaled(ManagedRenderTarget target) + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + } + #endregion + } +} diff --git a/Graphics/Primitives/PrimitiveSet.cs b/Graphics/Primitives/PrimitiveSet.cs new file mode 100644 index 0000000000..a911dd3b20 --- /dev/null +++ b/Graphics/Primitives/PrimitiveSet.cs @@ -0,0 +1,296 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Graphics.Shaders; + +namespace CalamityMod.Graphics.Primitives +{ + /// + /// This both acts as an instanceable struct containing primitive trail data, and as a manager that creates and renders said instances.

+ /// To use normally, in the draw method of an NPC or Projectile call .
+ /// + /// The first param should be the positions to use for the trail. + /// The second is a struct that allows you to choose a desired configuration of settings to use with the trail, to allow for customization. + /// The third controls how many points are created for the trail, and the fourth determines whether the primitive is subsequently rendered. + /// If you do not render in , you MUST call manually on the created instance to make it actually appear. + /// + /// If you wish to use pixelation, you MUST make the NPC/Projectile inherit and use instead.
+ /// You can also optionally specify a render layer with . It is by default. + ///
+ public readonly struct PrimitiveSet + { + #region Instance Members + /// + /// The vertices of the set. + /// + public readonly VertexPosition2DColorTexture[] Vertices; + + /// + /// The indices of the set. + /// + public readonly int[] Indices; + + /// + /// The settings of the set. + /// + public readonly PrimitiveSettings Settings; + + private PrimitiveSet(VertexPosition2DColorTexture[] vertices, int[] indices, PrimitiveSettings settings) + { + Vertices = vertices; + Indices = indices; + Settings = settings; + } + #endregion + + #region Static Members + private static void PerformPixelationSafetyChecks(PrimitiveSettings settings) + { + // Don't allow accidental screw ups with these. + if (settings.Pixelate && !PrimitivePixelationSystem.CurrentlyRendering) + throw new Exception("Error: Primitives using pixelation MUST be prepared/rendered from the IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives method, did you forget to use the interface?"); + else if (!settings.Pixelate && PrimitivePixelationSystem.CurrentlyRendering) + throw new Exception("Error: Primitives not using pixelation MUST NOT be prepared/rendered from the IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives method."); + } + + /// + /// Prepares a based on the provided information, and optionally renders it. + /// + /// The list of positions to use. Keep in mind that these are expected to be in world position, and is automatically subtracted from them all. + /// The primitive draw settings to use. + /// The amount of points to use. More is higher detailed, but less performant. By default, is the number of positions provided. Going above 100 is NOT recommended. + /// Whether to render the set. + /// The prepared set. + public static PrimitiveSet? Prepare(IEnumerable positions, PrimitiveSettings settings, int? pointsToCreate = null, bool render = true) + { + PerformPixelationSafetyChecks(settings); + + int positionCount = positions.Count(); + + // Return if not enough to draw anything. + if (positionCount <= 2) + return null; + + // Cull out any zeroed points. + positions = positions.Where(p => p != Vector2.Zero); + List trailPoints = PreparePointsRectangleTrail(positions, settings, pointsToCreate ?? positionCount).ToList(); + + // A trail with only one point or less has nothing to connect to, and therefore, can't make a trail. + if (trailPoints.Count <= 2) + return null; + + // If the trail point has any NaN positions, don't draw anything. + if (trailPoints.Any(point => point.HasNaNs())) + return null; + + // If the trail points are all equal, don't draw anything. + if (trailPoints.All(point => point == trailPoints[0])) + return null; + + IEnumerable vertices = CreateVerticesRectangleTrail(trailPoints.ToList(), settings); + int[] indices = CreateIndicesRectangleTrail(trailPoints.Count); + + // Create the set, and just return it if not asked to render. + PrimitiveSet set = new(vertices.ToArray(), indices, settings); + if (!render) + return set; + + // Else render the set and return it. + return set.Render(); + } + #endregion + + #region Instance Methods + /// + /// Renders the provided primitive set to the screen. + /// + /// The provided set. + public PrimitiveSet Render() + { + PerformPixelationSafetyChecks(Settings); + + if (Indices.Length % 6 != 0 || Vertices.Length <= 3) + return this; + + // Perform screen culling, for performance reasons. + Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone; + Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true; + Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); + + Matrix view; + Matrix projection; + if (Settings.Pixelate) + CalcuatePixelatedPerspectiveMatrices(out view, out projection); + else + CalamityUtils.CalculatePerspectiveMatricies(out view, out projection); + + var shaderToUse = Settings.Shader ?? GameShaders.Misc["CalamityMod:StandardPrimitiveShader"]; + shaderToUse.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection); + shaderToUse.Apply(); + + // Render the set. + Main.instance.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Vertices, 0, Vertices.Length, Indices, 0, Indices.Length / 3); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + return this; + } + #endregion + + #region Set Preperation + private static IEnumerable PreparePointsRectangleTrail(IEnumerable positions, PrimitiveSettings settings, int pointsToCreate) + { + // Don't smoothen the points unless explicitly told do so. + if (!settings.Smoothen) + { + List basePoints = positions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); + List endPoints = new(); + + if (basePoints.Count <= 2) + return endPoints; + + // Remap the original positions across a certain length. + for (int i = 0; i < pointsToCreate; i++) + { + float completionRatio = i / (float)(pointsToCreate - 1f); + int currentIndex = (int)(completionRatio * (basePoints.Count - 1)); + Vector2 currentPoint = basePoints[currentIndex]; + Vector2 nextPoint = basePoints[(currentIndex + 1) % basePoints.Count]; + endPoints.Add(Vector2.Lerp(currentPoint, nextPoint, completionRatio * (basePoints.Count - 1) % 0.99999f) - Main.screenPosition); + } + return endPoints; + } + + List controlPoints = new(); + for (int i = 0; i < positions.Count(); i++) + { + // Don't incorporate points that are zeroed out. + // They are almost certainly a result of incomplete oldPos arrays. + if (positions.ElementAt(i) == Vector2.Zero) + continue; + + float completionRatio = i / (float)positions.Count(); + Vector2 offset = -Main.screenPosition; + if (settings.OffsetFunction != null) + offset += settings.OffsetFunction(completionRatio); + controlPoints.Add(positions.ElementAt(i) + offset); + } + List points = new(); + + // Avoid stupid index errors. + if (controlPoints.Count <= 4) + return controlPoints; + + for (int j = 0; j < pointsToCreate; j++) + { + float splineInterpolant = j / (float)pointsToCreate; + float localSplineInterpolant = splineInterpolant * (controlPoints.Count - 1f) % 1f; + int localSplineIndex = (int)(splineInterpolant * (controlPoints.Count - 1f)); + + Vector2 farLeft; + Vector2 left = controlPoints[localSplineIndex]; + Vector2 right = controlPoints[localSplineIndex + 1]; + Vector2 farRight; + + // Special case: If the spline attempts to access the previous/next index but the index is already at the very beginning/end, simply + // cheat a little bit by creating a phantom point that's mirrored from the previous one. + if (localSplineIndex <= 0) + { + Vector2 mirrored = left * 2f - right; + farLeft = mirrored; + } + else + farLeft = controlPoints[localSplineIndex - 1]; + + if (localSplineIndex >= controlPoints.Count - 2) + { + Vector2 mirrored = right * 2f - left; + farRight = mirrored; + } + else + farRight = controlPoints[localSplineIndex + 2]; + + points.Add(Vector2.CatmullRom(farLeft, left, right, farRight, localSplineInterpolant)); + } + + // Manually insert the front and end points. + points.Insert(0, controlPoints.First()); + points.Add(controlPoints.Last()); + + return points; + } + + private static IEnumerable CreateVerticesRectangleTrail(List positions, PrimitiveSettings settings) + { + List vertices = new(); + + for (int i = 0; i < positions.Count; i++) + { + float completionRatio = i / (float)(positions.Count - 1); + float widthAtVertex = settings.WidthFunction(completionRatio); + Color vertexColor = settings.ColorFunction(completionRatio); + Vector2 currentPosition = positions[i]; + Vector2 directionToAhead = i == positions.Count - 1 ? (positions[i] - positions[i - 1]).SafeNormalize(Vector2.Zero) : (positions[i + 1] - positions[i]).SafeNormalize(Vector2.Zero); + + Vector2 leftCurrentTextureCoord = new(completionRatio, 0f); + Vector2 rightCurrentTextureCoord = new(completionRatio, 1f); + + // Point 90 degrees away from the direction towards the next point, and use it to mark the edges of the rectangle. + // This doesn't use RotatedBy for the sake of performance (there can potentially be a lot of trail points). + Vector2 sideDirection = new(-directionToAhead.Y, directionToAhead.X); + + Vector2 left = currentPosition - sideDirection * widthAtVertex; + Vector2 right = currentPosition + sideDirection * widthAtVertex; + + // Override the initial vertex positions if requested. + if (i == 0 && settings.InitialVertexPositionsOverride.HasValue && settings.InitialVertexPositionsOverride.Value.Item1 != Vector2.Zero && settings.InitialVertexPositionsOverride.Value.Item2 != Vector2.Zero) + { + left = settings.InitialVertexPositionsOverride.Value.Item1; + right = settings.InitialVertexPositionsOverride.Value.Item2; + } + + // What this is doing, at its core, is defining a rectangle based on two triangles. + // These triangles are defined based on the width of the strip at that point. + // The resulting rectangles combined are what make the trail itself. + vertices.Add(new VertexPosition2DColorTexture(left, vertexColor, leftCurrentTextureCoord)); + vertices.Add(new VertexPosition2DColorTexture(right, vertexColor, rightCurrentTextureCoord)); + } + + return vertices; + } + + private static int[] CreateIndicesRectangleTrail(int pointCount) + { + // What this is doing is basically representing each point on the vertices list as + // indices. These indices should come together to create a tiny rectangle that acts + // as a segment on the trail. This is achieved here by splitting the indices (or rather, points) + // into 2 triangles, which requires 6 points. + // The logic here basically determines which indices are connected together. + int totalIndices = (pointCount - 1) * 6; + int[] indices = new int[totalIndices]; + + for (int i = 0; i < pointCount - 2; i++) + { + int startingTriangleIndex = i * 6; + int connectToIndex = i * 2; + indices[startingTriangleIndex] = connectToIndex; + indices[startingTriangleIndex + 1] = connectToIndex + 1; + indices[startingTriangleIndex + 2] = connectToIndex + 2; + indices[startingTriangleIndex + 3] = connectToIndex + 2; + indices[startingTriangleIndex + 4] = connectToIndex + 1; + indices[startingTriangleIndex + 5] = connectToIndex + 3; + } + + return indices; + } + + private static void CalcuatePixelatedPerspectiveMatrices(out Matrix viewMatrix, out Matrix projectionMatrix) + { + // Due to the scaling, the normal transformation calcuations do not work with pixelated primitives. + projectionMatrix = Matrix.CreateOrthographicOffCenter(0, Main.screenWidth, Main.screenHeight, 0, -1, 1); + viewMatrix = Matrix.Identity; + } + #endregion + } +} diff --git a/Graphics/Primitives/PrimitiveSettings.cs b/Graphics/Primitives/PrimitiveSettings.cs new file mode 100644 index 0000000000..bbee27c4a7 --- /dev/null +++ b/Graphics/Primitives/PrimitiveSettings.cs @@ -0,0 +1,92 @@ +using Microsoft.Xna.Framework; +using Terraria.Graphics.Shaders; + +namespace CalamityMod.Graphics.Primitives +{ + /// + /// Contains all the various options to use when creating a primitive trail. New members can be added freely without breaking existing implementations. + /// + public readonly struct PrimitiveSettings + { + #region Delegates + /// + /// A delegate to dynamically determine the width of the trail at each position. + /// + /// The current position along the trail as a 0-1 interlopant value. + /// The width for the current point. + public delegate float VertexWidthFunction(float trailLengthInterpolant); + + /// + /// A delegate to dynamically determine the color of the trail at each position. + /// + /// The current position along the trail as a 0-1 interlopant value. + /// The color for the current point. + public delegate Color VertexColorFunction(float trailLengthInterpolant); + + /// + /// A delegate to dynamically determine the offset of the trail at each position. + /// + /// The current position along the trail as a 0-1 interlopant value. + /// The offset for the current point. + public delegate Vector2 VertexOffsetFunction(float trailLengthInterpolant); + #endregion + + #region Instance Fields + /// + /// Used to determine the width of each vertex. + /// + public readonly VertexWidthFunction WidthFunction; + + /// + /// Used to determine the color of each vertex. + /// + public readonly VertexColorFunction ColorFunction; + + /// + /// Used to offset each position when generating them. + /// + public readonly VertexOffsetFunction OffsetFunction; + + /// + /// Whether to use smoothening when generating the vertex positions from the provided ones Recommended to be on by default. + /// + public readonly bool Smoothen; + + /// + /// Whether to pixelate the primitives. Recommended to be on by default. + /// + public readonly bool Pixelate; + + /// + /// The shader to apply when rendering. + /// + public readonly MiscShaderData Shader; + + /// + /// An optional override to force the trail to use the provided positions as the side positions of the initial vertex. They are the left and right positions respectively. + /// + public readonly (Vector2, Vector2)? InitialVertexPositionsOverride; + #endregion + + /// + /// Contains all the various options to use when creating a primitive trail. + /// + /// Used to determine the width of each vertex. + /// Used to determine the color of each vertex. + /// Used to offset each position when generating them. + /// Whether to use smoothening when generating the vertex positions from the provided ones. Recommended to be enabled. + /// Whether to pixelate the primitives. Recommended to be enabled if the effect was designed with this in mind. + /// The shader to apply when rendering the primitives. + /// An optional override to force the trail to use the provided positions as the side positions of the initial vertex. They are the left and right positions respectively and should be in screen space. + public PrimitiveSettings(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, VertexOffsetFunction offsetFunction = null, bool smoothen = true, bool pixelate = false, MiscShaderData shader = null, (Vector2, Vector2)? initialVertexPositionsOverride = null) + { + WidthFunction = widthFunction; + ColorFunction = colorFunction; + OffsetFunction = offsetFunction; + Smoothen = smoothen; + Pixelate = pixelate; + Shader = shader; + InitialVertexPositionsOverride = initialVertexPositionsOverride; + } + } +} diff --git a/Graphics/Primitives/PrimitiveTrail.cs b/Graphics/Primitives/PrimitiveTrail.cs deleted file mode 100644 index 16e3b48dd7..0000000000 --- a/Graphics/Primitives/PrimitiveTrail.cs +++ /dev/null @@ -1,262 +0,0 @@ -using CalamityMod.DataStructures; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria; -using Terraria.Graphics.Shaders; - -namespace CalamityMod -{ - public class PrimitiveTrail - { - public struct VertexPosition2DColor : IVertexType - { - public Vector2 Position; - public Color Color; - public Vector2 TextureCoordinates; - public VertexDeclaration VertexDeclaration => _vertexDeclaration; - - private static readonly VertexDeclaration _vertexDeclaration = new VertexDeclaration(new VertexElement[] - { - new VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0), - new VertexElement(8, VertexElementFormat.Color, VertexElementUsage.Color, 0), - new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0), - }); - public VertexPosition2DColor(Vector2 position, Color color, Vector2 textureCoordinates) - { - Position = position; - Color = color; - TextureCoordinates = textureCoordinates; - } - } - - public delegate float VertexWidthFunction(float completionRatio); - public delegate Color VertexColorFunction(float completionRatio); - - public int DegreeOfBezierCurveCornerSmoothening; - public VertexWidthFunction WidthFunction; - public VertexColorFunction ColorFunction; - - public MiscShaderData SpecialShader; - public TrailPointRetrievalFunction TrailPointFunction; - - public Vector2 OverridingStickPointStart = Vector2.Zero; - public Vector2 OverridingStickPointEnd = Vector2.Zero; - - public delegate List TrailPointRetrievalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null); - - public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, TrailPointRetrievalFunction pointFunction = null, MiscShaderData specialShader = null) - { - if (widthFunction is null || colorFunction is null) - throw new NullReferenceException($"In order to create a primitive trail, a non-null {(widthFunction is null ? "width" : "color")} function must be specified."); - WidthFunction = widthFunction; - ColorFunction = colorFunction; - - // Default to bezier smoothening if nothing else is inputted. - if (pointFunction is null) - pointFunction = SmoothBezierPointRetreivalFunction; - - TrailPointFunction = pointFunction; - - SpecialShader = specialShader ?? GameShaders.Misc["CalamityMod:StandardPrimitiveShader"]; - - if (specialShader != null) - SpecialShader = specialShader; - } - - public static List RigidPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable _ = null) - { - List basePoints = originalPositions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); - List endPoints = new List(); - - if (basePoints.Count < 2) - { - for (int i = 0; i < basePoints.Count; i++) - basePoints[i] += generalOffset; - return basePoints; - } - - // Remap the original positions across a certain length. - for (int i = 0; i < totalTrailPoints; i++) - { - float completionRatio = i / (float)(totalTrailPoints - 1f); - int currentIndex = (int)(completionRatio * (basePoints.Count - 1)); - Vector2 currentPoint = basePoints[currentIndex]; - Vector2 nextPoint = basePoints[(currentIndex + 1) % basePoints.Count]; - endPoints.Add(Vector2.Lerp(currentPoint, nextPoint, completionRatio * (basePoints.Count - 1) % 0.99999f) + generalOffset); - } - endPoints.Add(basePoints.Last() + generalOffset); - return endPoints; - } - - // NOTE: Beziers can be laggy when a lot of control points are used, since our implementation - // uses a recursive Lerp that gets more computationally expensive the more original indices. - // n(n + 1)/2 linear interpolations to be precise, where n is the amount of original indices. - public List SmoothBezierPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null) - { - List controlPoints = new List(); - for (int i = 0; i < originalPositions.Count(); i++) - { - // Don't incorporate points that are zeroed out. - // They are almost certainly a result of incomplete oldPos arrays. - if (originalPositions.ElementAt(i) == Vector2.Zero) - continue; - controlPoints.Add(originalPositions.ElementAt(i) + generalOffset); - } - - bool pointCountCondition = DegreeOfBezierCurveCornerSmoothening <= 0 || controlPoints.Count < DegreeOfBezierCurveCornerSmoothening * 3; - int effectivePointCount = DegreeOfBezierCurveCornerSmoothening > 0 ? totalTrailPoints * DegreeOfBezierCurveCornerSmoothening : totalTrailPoints; - BezierCurve bezierCurve = new BezierCurve(controlPoints.Where((_, i) => - { - return DegreeOfBezierCurveCornerSmoothening <= 0 || - i % DegreeOfBezierCurveCornerSmoothening == 0 || - i == 0 || - i == controlPoints.Count - 1 || - pointCountCondition; - }).ToArray()); - return controlPoints.Count <= 1 ? controlPoints : bezierCurve.GetPoints(effectivePointCount); - } - - // Using this method requires oldRot be supplied to the Draw method for the sake of determining how many points need to be made at a given time step. - // Furthermore, since the point count is dynamic, the point count int parameter has no purpose. It can be supplied simply with zero. - public static List SmoothCatmullRomPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int _, IEnumerable originalRotations) - { - List smoothenedPoints = new List(); - for (int i = 0; i < originalPositions.Count() - 1; i++) - { - Vector2 currentPosition = originalPositions.ElementAt(i); - Vector2 aheadPosition = originalPositions.ElementAt(i + 1); - - // Don't incorporate points that are zeroed out. - // They are almost certainly a result of incomplete oldPos arrays. - if (currentPosition == Vector2.Zero || aheadPosition == Vector2.Zero) - continue; - - float currentRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i)); - float aheadRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i + 1)); - - // Determine the amount of extra points to draw based on the rotational offset between the two time steps. - int pointsToAdd = (int)Math.Round(Math.Abs(MathHelper.WrapAngle(aheadRotation - currentRotation)) * 8f / MathHelper.Pi); - - // Add a base point. - smoothenedPoints.Add(currentPosition + generalOffset); - - // If no new points are needed, skip this. - if (pointsToAdd == 0) - continue; - - float segmentLength = Vector2.Distance(currentPosition, aheadPosition); - float increment = 1f / (pointsToAdd + 2); - Vector2 backEnd = currentPosition + currentRotation.ToRotationVector2() * segmentLength; - Vector2 frontEnd = aheadPosition + aheadRotation.ToRotationVector2() * -segmentLength; - - // Create smoothened points based on a Catmull-Rom spline. - for (float j = increment; j < 1f; j += increment) - smoothenedPoints.Add(Vector2.CatmullRom(backEnd, currentPosition, aheadPosition, frontEnd, j) + generalOffset); - } - return smoothenedPoints; - } - - public VertexPosition2DColor[] GetVerticesFromTrailPoints(List trailPoints) - { - VertexPosition2DColor[] vertices = new VertexPosition2DColor[trailPoints.Count * 2 - 2]; - for (int i = 0; i < trailPoints.Count - 1; i++) - { - float completionRatio = i / (float)trailPoints.Count; - float widthAtVertex = WidthFunction(completionRatio); - Color vertexColor = ColorFunction(completionRatio); - - Vector2 currentPosition = trailPoints[i]; - Vector2 positionAhead = trailPoints[i + 1]; - Vector2 directionToAhead = (positionAhead - trailPoints[i]).SafeNormalize(Vector2.Zero); - - Vector2 leftCurrentTextureCoord = new Vector2(completionRatio, 0f); - Vector2 rightCurrentTextureCoord = new Vector2(completionRatio, 1f); - - // Point 90 degrees away from the direction towards the next point, and use it to mark the edges of the rectangle. - // This doesn't use RotatedBy for the sake of performance (there can potentially be a lot of trail points). - Vector2 sideDirection = new Vector2(-directionToAhead.Y, directionToAhead.X); - - Vector2 left = currentPosition - sideDirection * widthAtVertex; - Vector2 right = currentPosition + sideDirection * widthAtVertex; - if (i == 0 && OverridingStickPointStart != Vector2.Zero) - { - left = OverridingStickPointStart; - right = OverridingStickPointEnd; - } - - // What this is doing, at its core, is defining a rectangle based on two triangles. - // These triangles are defined based on the width of the strip at that point. - // The resulting rectangles combined are what make the trail itself. - vertices[i * 2] = new VertexPosition2DColor(left, vertexColor, leftCurrentTextureCoord); - vertices[i * 2 + 1] = new VertexPosition2DColor(right, vertexColor, rightCurrentTextureCoord); - } - - return vertices.ToArray(); - } - - public short[] GetIndicesFromTrailPoints(int pointCount) - { - // What this is doing is basically representing each point on the vertices list as - // indices. These indices should come together to create a tiny rectangle that acts - // as a segment on the trail. This is achieved here by splitting the indices (or rather, points) - // into 2 triangles, which requires 6 points. - // The logic here basically determines which indices are connected together. - int totalIndices = (pointCount - 1) * 6; - short[] indices = new short[totalIndices]; - - for (int i = 0; i < pointCount - 2; i++) - { - int startingTriangleIndex = i * 6; - int connectToIndex = i * 2; - indices[startingTriangleIndex] = (short)connectToIndex; - indices[startingTriangleIndex + 1] = (short)(connectToIndex + 1); - indices[startingTriangleIndex + 2] = (short)(connectToIndex + 2); - indices[startingTriangleIndex + 3] = (short)(connectToIndex + 2); - indices[startingTriangleIndex + 4] = (short)(connectToIndex + 1); - indices[startingTriangleIndex + 5] = (short)(connectToIndex + 3); - } - - return indices; - } - - public void Draw(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null) - { - List trailPoints = TrailPointFunction(originalPositions, generalOffset, totalTrailPoints, originalRotations); - - // A trail with only one point or less has nothing to connect to, and therefore, can't make a trail. - if (trailPoints.Count < 2) - return; - - // If the trail points have any NaN positions, don't draw anything. - if (trailPoints.Any(point => point.HasNaNs())) - return; - - // If the trail points are all equal, don't draw anything. - if (trailPoints.All(point => point == trailPoints[0])) - return; - - CalamityUtils.CalculatePerspectiveMatricies(out Matrix view, out Matrix projection); - VertexPosition2DColor[] vertices = GetVerticesFromTrailPoints(trailPoints); - - short[] triangleIndices = GetIndicesFromTrailPoints(trailPoints.Count); - - // Don't draw anything if the indicies/vertices are in any way invalid. - // If they are, the graphics engine, along with the entire game, will crash. - if (triangleIndices.Length % 6 != 0 || vertices.Length % 2 != 0) - return; - - Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone; - Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true; - Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); //offscreen culling - - SpecialShader.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection); - SpecialShader.Apply(); - - Main.instance.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, triangleIndices, 0, triangleIndices.Length / 3); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - } -} diff --git a/Graphics/Primitives/VertexPosition2DColorTexture.cs b/Graphics/Primitives/VertexPosition2DColorTexture.cs new file mode 100644 index 0000000000..0ac7154e44 --- /dev/null +++ b/Graphics/Primitives/VertexPosition2DColorTexture.cs @@ -0,0 +1,46 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Graphics.Primitives +{ + /// + /// A custom vertex type with a position using Vector2 instead of Vector4, as Terraria is only a 2D game. + /// + /// This represents a vertex that will be rendered by the GPU. + public readonly struct VertexPosition2DColorTexture : IVertexType + { + /// + /// The position of the vertex. + /// + public readonly Vector2 Position; + + /// + /// The color of the vertex. + /// + public readonly Color Color; + + /// + /// The texture-coordinate of the vertex. + /// + public readonly Vector2 TextureCoordinates; + + /// + /// The vertex declaration. This declares the layout and size of the data in the vertex shader. + /// + public VertexDeclaration VertexDeclaration => VertexDeclaration2D; + + public static readonly VertexDeclaration VertexDeclaration2D = new(new VertexElement[] + { + new(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0), + new(8, VertexElementFormat.Color, VertexElementUsage.Color, 0), + new(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0), + }); + + public VertexPosition2DColorTexture(Vector2 position, Color color, Vector2 textureCoordinates) + { + Position = position; + Color = color; + TextureCoordinates = textureCoordinates; + } + } +} diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index b49de944d5..f724c32fa1 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -15,6 +15,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Graphics.Shaders; using System.Linq; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.NPCs.AcidRain { @@ -22,8 +23,6 @@ namespace CalamityMod.NPCs.AcidRain { public Player Target => Main.player[NPC.target]; - public PrimitiveTrail SegmentDrawer = null; - public override void SetStaticDefaults() { Main.npcFrameCount[NPC.type] = 6; @@ -187,9 +186,6 @@ namespace CalamityMod.NPCs.AcidRain return false; } - // Initialize the segment drawer. - SegmentDrawer ??= new(SegmentWidthFunction, _ => NPC.GetAlpha(Color.White), null, GameShaders.Misc["CalamityMod:PrimitiveTexture"]); - Texture2D headTexture = ModContent.Request(Texture).Value; Texture2D tailTexture = ModContent.Request("CalamityMod/NPCs/AcidRain/AcidEelTail").Value; Vector2[] segmentPositions = (Vector2[])NPC.oldPos.Clone(); @@ -205,7 +201,7 @@ namespace CalamityMod.NPCs.AcidRain for (int i = 0; i < segmentPositions.Length; i++) { - segmentPositions[i] += NPC.Size * 0.5f - screenPos - NPC.rotation.ToRotationVector2() * Math.Sign(NPC.velocity.X) * 8f; + segmentPositions[i] += NPC.Size * 0.5f - NPC.rotation.ToRotationVector2() * Math.Sign(NPC.velocity.X) * 8f; if (segmentAreaTopLeft.X > segmentPositions[i].X) segmentAreaTopLeft.X = segmentPositions[i].X; if (segmentAreaTopLeft.Y > segmentPositions[i].Y) @@ -234,7 +230,7 @@ namespace CalamityMod.NPCs.AcidRain Vector2 tailDrawPosition = segmentPositions[^1] - tailRotation.ToRotationVector2() * 4f; SpriteEffects tailDirection = NPC.velocity.X < 0f ? SpriteEffects.None : SpriteEffects.FlipVertically; Main.EntitySpriteDraw(tailTexture, tailDrawPosition, tailArea, NPC.GetAlpha(Color.White), tailRotation, tailArea.Size() * new Vector2(0f, 0.5f), NPC.scale, tailDirection, 0); - SegmentDrawer.Draw(segmentPositions, Vector2.Zero, 36); + PrimitiveSet.Prepare(segmentPositions, new(SegmentWidthFunction, _ => NPC.GetAlpha(Color.White), pixelate: false, shader: GameShaders.Misc["CalamityMod:PrimitiveTexture"]), 36); } return false; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index eec03a58fc..aa350c4a84 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.NPCs.ExoMechs.Ares; @@ -117,13 +118,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Intensity of flash effects during the charge combo public float ChargeComboFlash; - // Primitive trail drawers for thrusters when charging - public PrimitiveTrail ChargeFlameTrail = null; - public PrimitiveTrail ChargeFlameTrailBig = null; - - // Primitive trail drawer for the ribbon things - public PrimitiveTrail RibbonTrail = null; - public static string NameToDisplay = "XS-03 Apollo"; public static readonly SoundStyle MissileLaunchSound = new("CalamityMod/Sounds/Custom/ExoMechs/ApolloMissileLaunch") { Volume = 1.3f }; @@ -1498,16 +1492,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - // Declare the trail drawers if they have yet to be defined. - if (ChargeFlameTrail is null) - ChargeFlameTrail = new PrimitiveTrail(FlameTrailWidthFunction, FlameTrailColorFunction, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - - if (ChargeFlameTrailBig is null) - ChargeFlameTrailBig = new PrimitiveTrail(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - - if (RibbonTrail is null) - RibbonTrail = new PrimitiveTrail(RibbonTrailWidthFunction, RibbonTrailColorFunction); - // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); @@ -1570,7 +1554,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo currentSegmentRotation += segmentRotationOffset; } - RibbonTrail.Draw(ribbonDrawPositions, -screenPos, 66); + PrimitiveSet.Prepare(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); } int instanceCount = (int)MathHelper.Lerp(1f, 15f, ChargeComboFlash); @@ -1635,11 +1619,12 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int i = 0; i < 4; i++) { Vector2 drawOffset = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 8f; - ChargeFlameTrailBig.Draw(drawPositions, drawOffset - screenPos, 70); + PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } else - ChargeFlameTrail.Draw(drawPositions, -screenPos, 70); + PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); + } } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 30a8c47ef6..2345f31467 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -94,10 +95,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public ThanatosSmokeParticleSet SmokeDrawer = new ThanatosSmokeParticleSet(-1, 3, 0f, 16f, 1.5f); - // Drawers for arm segments. - public PrimitiveTrail LightningDrawer; - public PrimitiveTrail LightningBackgroundDrawer; - // This stores the sound slot of the deathray sound Ares makes, so it may be properly updated in terms of position and looped. public SlotId DeathraySoundSlot; @@ -1279,11 +1276,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public void DrawArm(SpriteBatch spriteBatch, Vector2 handPosition, Vector2 screenOffset, Color glowmaskColor, int direction, bool backArm) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - if (LightningBackgroundDrawer is null) - LightningBackgroundDrawer = new PrimitiveTrail(BackgroundWidthFunction, BackgroundColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - SpriteEffects spriteDirection = direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; float distanceFromHand = NPC.Distance(handPosition); float frameTime = Main.GlobalTimeWrappedHourly * 0.9f % 1f; @@ -1336,13 +1328,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.Opacity > 0f && !NPC.IsABestiaryIconDummy) { List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition + arm2Rotation.ToRotationVector2() * -direction * 20f, 250290787); - LightningBackgroundDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); // Draw electricity between the final arm and the hand. List handElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm2DrawPosition - arm2Rotation.ToRotationVector2() * direction * 100f, handPosition, 27182); - LightningBackgroundDrawer.Draw(handElectricArcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(handElectricArcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } shoulderDrawPosition += Vector2.UnitY * NPC.gfxOffY - screenOffset; @@ -1398,13 +1390,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.Opacity > 0f && !NPC.IsABestiaryIconDummy) { List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm1DrawPosition - arm2Rotation.ToRotationVector2() * direction * 10f, arm1DrawPosition + arm2Rotation.ToRotationVector2() * direction * 20f, 31416); - LightningBackgroundDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); // Draw electricity between the final arm and the hand. List handElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm2DrawPosition - arm2Rotation.ToRotationVector2() * direction * 20f, handPosition, 27182); - LightningBackgroundDrawer.Draw(handElectricArcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(handElectricArcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } shoulderDrawPosition += Vector2.UnitY * NPC.gfxOffY - screenOffset; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index b97a1a5fd9..b417ddd3b6 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Potions; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; @@ -148,13 +149,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Intensity of flash effects during the charge combo public float ChargeFlash; - // Primitive trail drawers for thrusters when charging - public PrimitiveTrail ChargeFlameTrail = null; - public PrimitiveTrail ChargeFlameTrailBig = null; - - // Primitive trail drawer for the ribbon things - public PrimitiveTrail RibbonTrail = null; - //This stores the sound slot of the ML laser sound it makes, so it may be properly updated in terms of position. private SlotId DeathraySoundSlot; @@ -1392,16 +1386,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - // Declare the trail drawers if they have yet to be defined. - if (ChargeFlameTrail is null) - ChargeFlameTrail = new PrimitiveTrail(FlameTrailWidthFunction, FlameTrailColorFunction, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - - if (ChargeFlameTrailBig is null) - ChargeFlameTrailBig = new PrimitiveTrail(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - - if (RibbonTrail is null) - RibbonTrail = new PrimitiveTrail(RibbonTrailWidthFunction, RibbonTrailColorFunction); - // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); @@ -1464,7 +1448,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis currentSegmentRotation += segmentRotationOffset; } - RibbonTrail.Draw(ribbonDrawPositions, -screenPos, 66); + PrimitiveSet.Prepare(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); } int instanceCount = (int)MathHelper.Lerp(1f, 15f, ChargeFlash); @@ -1529,11 +1513,11 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis for (int i = 0; i < 4; i++) { Vector2 drawOffset = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 8f; - ChargeFlameTrailBig.Draw(drawPositions, drawOffset - screenPos, 70); + PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } else - ChargeFlameTrail.Draw(drawPositions, -screenPos, 70); + PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 397b1b1bf0..23144ecd84 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,7 +14,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { public class BrimstoneHeart : ModNPC { - public PrimitiveTrail ChainDrawer = null; public int ChainHeartIndex => (int)NPC.ai[0]; public List ChainEndpoints = new(); public override void SetStaticDefaults() @@ -113,8 +113,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - if (ChainDrawer is null) - ChainDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction); if (NPC.IsABestiaryIconDummy) return true; @@ -125,7 +123,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Center, ChainEndpoints[i] + NPC.DirectionTo(ChainEndpoints[i]) * 25f }; - ChainDrawer.Draw(points, -screenPos, 40); + PrimitiveSet.Prepare(points, new(PrimitiveWidthFunction, PrimitiveColorFunction), 40); } return true; diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index 508eafd00c..a5bb6afc74 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Graphics.Primitives; using CalamityMod.World; using Microsoft.Xna.Framework; using System.IO; @@ -17,7 +18,6 @@ namespace CalamityMod.Projectiles.Boss public NPC ThingToAttachTo => Main.npc.IndexInRange((int)Projectile.ai[1]) ? Main.npc[(int)Projectile.ai[1]] : null; - public PrimitiveTrail TelegraphDrawer = null; public const float TelegraphFadeTime = 15f; public const float TelegraphWidth = 1132.07774f; // a squared plus b squared equals c squared, dumbass @@ -113,9 +113,6 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (TelegraphDrawer is null) - TelegraphDrawer = new PrimitiveTrail(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:Flame"]); - GameShaders.Misc["CalamityMod:Flame"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:Flame"].UseSaturation(0.41f); @@ -131,7 +128,7 @@ namespace CalamityMod.Projectiles.Boss // It is not used anywhere else. Projectile.ai[0] = i; - TelegraphDrawer.Draw(positions, Projectile.Size * 0.5f - Main.screenPosition, 55); + PrimitiveSet.Prepare(positions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:Flame"]), 55); } return false; } diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 499fcd342c..99d55c8eba 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.World; @@ -16,8 +17,6 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public ref float Identity => ref Projectile.ai[0]; - public PrimitiveTrail LightningDrawer; - public PrimitiveTrail LightningBackgroundDrawer; private const int timeLeft = 480; public override void SetStaticDefaults() @@ -226,17 +225,12 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - if (LightningBackgroundDrawer is null) - LightningBackgroundDrawer = new PrimitiveTrail(BackgroundWidthFunction, BackgroundColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - Projectile orbToAttachTo = GetOrbToAttachTo(); if (orbToAttachTo != null) { List arcPoints = DetermineElectricArcPoints(Projectile.Center, orbToAttachTo.Center, 117); - LightningBackgroundDrawer.Draw(arcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(arcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/ArtemisChargeTelegraph.cs b/Projectiles/Boss/ArtemisChargeTelegraph.cs index 356a3035a0..fd7e3467be 100644 --- a/Projectiles/Boss/ArtemisChargeTelegraph.cs +++ b/Projectiles/Boss/ArtemisChargeTelegraph.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using System.IO; using Terraria; using Terraria.Graphics.Shaders; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Boss public NPC ThingToAttachTo => Main.npc.IndexInRange((int)Projectile.ai[1]) ? Main.npc[(int)Projectile.ai[1]] : null; public Vector2 OldVelocity; - public PrimitiveTrail TelegraphDrawer = null; public const float TelegraphWidth = 2000f; public override void SetStaticDefaults() @@ -89,9 +89,6 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (TelegraphDrawer is null) - TelegraphDrawer = new PrimitiveTrail(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, specialShader: GameShaders.Misc["CalamityMod:Flame"]); - GameShaders.Misc["CalamityMod:Flame"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:Flame"].UseSaturation(0.28f); Vector2[] drawPositions = new Vector2[] @@ -99,8 +96,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.Center, Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * TelegraphWidth }; - - TelegraphDrawer.Draw(drawPositions, Projectile.Size * 0.5f - Main.screenPosition, 87); + PrimitiveSet.Prepare(drawPositions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:Flame"]), 87); return false; } } diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 9833e6233a..6a55ac5076 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; @@ -17,11 +18,6 @@ namespace CalamityMod.Projectiles.Boss public class ArtemisSpinLaserbeam : BaseLaserbeamProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - public PrimitiveTrail LaserDrawer - { - get; - set; - } = null; public int OwnerIndex { @@ -136,7 +132,6 @@ namespace CalamityMod.Projectiles.Boss // This should never happen, but just in case. if (Projectile.velocity == Vector2.Zero) return false; - LaserDrawer ??= new(LaserWidthFunction, LaserColorFunction, null, GameShaders.Misc["CalamityMod:ArtemisLaser"]); Vector2 laserEnd = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * LaserLength; Vector2[] baseDrawPoints = new Vector2[8]; @@ -147,8 +142,7 @@ namespace CalamityMod.Projectiles.Boss GameShaders.Misc["CalamityMod:ArtemisLaser"].UseColor(Color.Cyan); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage1("Images/Extra_189"); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage2("Images/Misc/Perlin"); - - LaserDrawer.Draw(baseDrawPoints, -Main.screenPosition, 64); + PrimitiveSet.Prepare(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); return false; } diff --git a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs index 1c5aa96e60..49bfa8f1d4 100644 --- a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs +++ b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.SupremeCalamitas; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -17,7 +18,6 @@ namespace CalamityMod.Projectiles.Boss public override string Texture => "CalamityMod/Projectiles/Melee/PrismTooth"; - internal PrimitiveTrail TrailDrawer; public const int Lifetime = 80; public NPC Cirrus => Main.npc.IndexInRange((int)Projectile.ai[2]) ? Main.npc[(int)Projectile.ai[2]] : null; @@ -138,9 +138,6 @@ namespace CalamityMod.Projectiles.Boss if (Time <= 5f) return true; - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PrismaticStreak"]); - // Variable adjustment vector used to prevent the trail for starting somewhat that isn't behind // the crystal. This may appear in small amounts, with offsets of a few pixels, but at the speed // these crystals go, it's probably not something to worry too much about. @@ -158,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f + generalOffset - Main.screenPosition, 65); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); Main.spriteBatch.ExitShaderRegion(); return true; } diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index 530ceaae74..a14e209bfc 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -7,6 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Boss { @@ -17,7 +18,6 @@ namespace CalamityMod.Projectiles.Boss public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public PrimitiveTrail RayDrawer = null; private const int Lifetime = CalamityWorld.DraedonSummonCountdownMax - 60; public override void SetStaticDefaults() @@ -80,17 +80,14 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (RayDrawer is null) - RayDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:Flame"]); - GameShaders.Misc["CalamityMod:Flame"].UseImage1("Images/Misc/Perlin"); Vector2[] basePoints = new Vector2[8]; for (int i = 0; i < basePoints.Length; i++) basePoints[i] = Projectile.Center - Vector2.UnitY * i / basePoints.Length * LaserLength; - Vector2 overallOffset = Projectile.Size * 0.5f - Main.screenPosition; - RayDrawer.Draw(basePoints, overallOffset, 92); + Vector2 overallOffset = Projectile.Size * 0.5f; + PrimitiveSet.Prepare(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); return false; } diff --git a/Projectiles/Boss/DyingSun.cs b/Projectiles/Boss/DyingSun.cs index 6b84165ff6..eaa8d6dbed 100644 --- a/Projectiles/Boss/DyingSun.cs +++ b/Projectiles/Boss/DyingSun.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using CalamityMod.Graphics.Primitives; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -12,7 +13,6 @@ namespace CalamityMod.Projectiles.Boss public class DyingSun : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - public PrimitiveTrail FireDrawer; public ref float Time => ref Projectile.ai[0]; public ref float Radius => ref Projectile.ai[1]; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -51,9 +51,6 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (FireDrawer is null) - FireDrawer = new PrimitiveTrail(SunWidthFunction, SunColorFunction, null, GameShaders.Misc["CalamityMod:Flame"]); - GameShaders.Misc["CalamityMod:Flame"].UseSaturation(0.45f); GameShaders.Misc["CalamityMod:Flame"].UseImage1("Images/Misc/Perlin"); @@ -72,8 +69,7 @@ namespace CalamityMod.Projectiles.Boss rotationPoints.Add(adjustedAngle); drawPoints.Add(Vector2.Lerp(Projectile.Center - offsetDirection * Radius / 2f, Projectile.Center + offsetDirection * Radius / 2f, i / 16f)); } - - FireDrawer.Draw(drawPoints, -Main.screenPosition, 24); + PrimitiveSet.Prepare(drawPoints, new(SunWidthFunction, SunColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 24); } return false; } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index 888954ad7f..aa22ca54c2 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; +using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -13,7 +14,6 @@ namespace CalamityMod.Projectiles.Boss public class InfernadoRevenge : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - internal PrimitiveTrail TornadoDrawer; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public const int TornadoHeight = 8800; public override void SetStaticDefaults() @@ -72,9 +72,6 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { - if (TornadoDrawer is null) - TornadoDrawer = new PrimitiveTrail(_ => Projectile.width * 0.5f + 16f, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:Bordernado"]); - GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); Vector2[] drawPoints = new Vector2[5]; @@ -87,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); drawPoints[drawPoints.Length - 1] = bottom; - TornadoDrawer.Draw(drawPoints, -Main.screenPosition, 85); + PrimitiveSet.Prepare(drawPoints, new((_) => Projectile.width * 0.5f + 16f, ColorFunction, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 85); Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; for (int i = 0; i < 110; i++) diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 972f61dcda..3707159fce 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -1,4 +1,5 @@ using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items; using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Ranged; @@ -271,7 +272,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } - internal PrimitiveTrail TrailDrawer; internal Color ColorFunction(float completionRatio) { float averageRotation = Projectile.oldRot.Take(20).Average(angle => MathHelper.WrapAngle(angle) + MathHelper.Pi); @@ -307,9 +307,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Rectangle frame = IsSmall ? bladeTexture.Frame(1, 3, 0, BladeFrameY) : bladeTexture.Frame(3, 7, BladeFrameX, BladeFrameY); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); - GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture")); Player player = Main.player[Projectile.owner]; @@ -327,8 +324,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float angularTurn = i * swingAngularDirection * -0.09f; drawPoints[i] = Projectile.position + perpendicularDirection.RotatedBy(angularTurn) * offsetFactor; } + PrimitiveSet.Prepare(drawPoints, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + bladeOffset, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); - TrailDrawer.Draw(drawPoints, Projectile.Size * 0.5f + bladeOffset - Main.screenPosition, 50); Main.EntitySpriteDraw(bladeTexture, Projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, Projectile.rotation + MathHelper.PiOver2, origin, Projectile.scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(hiltTexture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs index fbdbb0d135..9659a70e50 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -184,10 +185,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 origin = frame.Size() * 0.5f; Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); - PrimitiveTrail trail = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - trail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 92); - + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); return false; } } diff --git a/Projectiles/Enemy/GammRayBurst.cs b/Projectiles/Enemy/GammRayBurst.cs index cbc1e035da..a4e3fe6007 100644 --- a/Projectiles/Enemy/GammRayBurst.cs +++ b/Projectiles/Enemy/GammRayBurst.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.AcidRain; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; @@ -17,11 +18,6 @@ namespace CalamityMod.Projectiles.Enemy public class GammaRayBurst : BaseLaserbeamProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Enemy"; - public PrimitiveTrail LaserDrawer - { - get; - set; - } = null; public int OwnerIndex { @@ -112,7 +108,6 @@ namespace CalamityMod.Projectiles.Enemy // This should never happen, but just in case. if (Projectile.velocity == Vector2.Zero) return false; - LaserDrawer ??= new(LaserWidthFunction, LaserColorFunction, null, GameShaders.Misc["CalamityMod:ArtemisLaser"]); Vector2 laserEnd = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * LaserLength; Vector2[] baseDrawPoints = new Vector2[8]; @@ -124,7 +119,7 @@ namespace CalamityMod.Projectiles.Enemy GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage1("Images/Extra_189"); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage2("Images/Misc/Perlin"); - LaserDrawer.Draw(baseDrawPoints, -Main.screenPosition, 64); + PrimitiveSet.Prepare(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); return false; } diff --git a/Projectiles/Magic/ApotheosisEnergy.cs b/Projectiles/Magic/ApotheosisEnergy.cs index eead2d2676..3b07f3cd4f 100644 --- a/Projectiles/Magic/ApotheosisEnergy.cs +++ b/Projectiles/Magic/ApotheosisEnergy.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -8,7 +9,6 @@ namespace CalamityMod.Projectiles.Magic public class ApotheosisEnergy : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - internal PrimitiveTrail TrailDrawer = null; public override void SetStaticDefaults() { @@ -88,10 +88,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); - - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 85); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 85); return false; } } diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index 763c943aed..5df5a7651c 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Magic public class ArtAttackStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public PrimitiveTrail TrailDrawer = null; public Player Owner => Main.player[Projectile.owner]; public ref float Time => ref Projectile.ai[0]; public const int StarShapeCreationDelay = 12; @@ -217,9 +217,6 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(TrailWidth, TrailColor, null, GameShaders.Misc["CalamityMod:ArtAttack"]); - Texture2D texture = ModContent.Request(Texture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Vector2 origin = texture.Size() * 0.5f; @@ -228,7 +225,7 @@ namespace CalamityMod.Projectiles.Magic GameShaders.Misc["CalamityMod:ArtAttack"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); GameShaders.Misc["CalamityMod:ArtAttack"].Apply(); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 180); + PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ArtAttack"]), 180); Main.spriteBatch.ExitShaderRegion(); Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(Color.White), Projectile.rotation, origin, Projectile.scale, 0, 0); diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index cbc6cf6de6..687f365e50 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -16,7 +17,6 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - internal PrimitiveTrail LemniscateDrawer = null; public int TargetNPCIndex { get => (int)Projectile.ai[0]; @@ -228,11 +228,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (LemniscateDrawer is null) - LemniscateDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, null, GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); - LemniscateDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 84); + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 84); return false; } } diff --git a/Projectiles/Magic/ExoVortex.cs b/Projectiles/Magic/ExoVortex.cs index e6f3720f81..6c6d692ac4 100644 --- a/Projectiles/Magic/ExoVortex.cs +++ b/Projectiles/Magic/ExoVortex.cs @@ -7,13 +7,13 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { public class ExoVortex : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public PrimitiveTrail EnergyTrail = null; public float Hue => Projectile.ai[0]; @@ -105,6 +105,8 @@ namespace CalamityMod.Projectiles.Magic return c * Utils.GetLerpValue(0.04f, 0.2f, completionRatio, true) * velocityOpacityFadeout; } + public Vector2 PrimitiveOffsetFunction(float completionRatio) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * Projectile.scale * 2f; + public override bool PreDraw(ref Color lightColor) { Main.spriteBatch.EnterShaderRegion(BlendState.Additive); @@ -114,10 +116,8 @@ namespace CalamityMod.Projectiles.Magic Main.spriteBatch.EnterShaderRegion(); // Draw the streak trail. - EnergyTrail ??= new(PrimitiveWidthFunction, PrimitiveTrailColor, null, GameShaders.Misc["CalamityMod:SideStreakTrail"]); - GameShaders.Misc["CalamityMod:SideStreakTrail"].UseImage1("Images/Misc/Perlin"); - EnergyTrail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + Projectile.velocity.SafeNormalize(Vector2.Zero) * Projectile.scale * 2f, 51); + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); Main.spriteBatch.EnterShaderRegion(BlendState.Additive); GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); diff --git a/Projectiles/Magic/ExoVortex2.cs b/Projectiles/Magic/ExoVortex2.cs index 4702883dab..709bc151f2 100644 --- a/Projectiles/Magic/ExoVortex2.cs +++ b/Projectiles/Magic/ExoVortex2.cs @@ -7,13 +7,13 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { public class ExoVortex2 : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public PrimitiveTrail EnergyTrail = null; public float Hue => Projectile.ai[0]; @@ -109,6 +109,8 @@ namespace CalamityMod.Projectiles.Magic return c * Utils.GetLerpValue(0.04f, 0.2f, completionRatio, true) * velocityOpacityFadeout; } + public Vector2 PrimitiveOffsetFunction(float completionRatio) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * Projectile.scale * 2f; + public override bool PreDraw(ref Color lightColor) { Main.spriteBatch.EnterShaderRegion(BlendState.Additive); @@ -118,10 +120,8 @@ namespace CalamityMod.Projectiles.Magic Main.spriteBatch.EnterShaderRegion(); // Draw the streak trail. - EnergyTrail ??= new(PrimitiveWidthFunction, PrimitiveTrailColor, null, GameShaders.Misc["CalamityMod:SideStreakTrail"]); - GameShaders.Misc["CalamityMod:SideStreakTrail"].UseImage1("Images/Misc/Perlin"); - EnergyTrail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + Projectile.velocity.SafeNormalize(Vector2.Zero) * Projectile.scale * 2f, 51); + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); Main.spriteBatch.EnterShaderRegion(BlendState.Additive); GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 7dde3ba8c4..aaa9f19de2 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -10,7 +11,6 @@ namespace CalamityMod.Projectiles.Magic public class FabBolt : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - internal PrimitiveTrail TrailDrawer; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public bool FadingOut @@ -71,11 +71,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 80, Projectile.oldRot); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 80); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index c9823efc97..a8549dc517 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Alcohol; +using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -12,7 +13,7 @@ namespace CalamityMod.Projectiles.Magic public class FabRay : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - internal PrimitiveTrail TrailDrawer; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() @@ -100,13 +101,12 @@ namespace CalamityMod.Projectiles.Magic return MathHelper.Lerp(0f, 32f * Projectile.Opacity, expansionCompletion); } + internal Vector2 OffsetFunction(float completionRatio) => Projectile.Size * 0.5f; + public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 32); + PrimitiveSet.Prepare(Projectile.oldPos, new PrimitiveSettings(WidthFunction, ColorFunction, OffsetFunction, pixelate: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 32); return false; } diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index 3fd639b4f8..5f877720b9 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { @@ -24,7 +25,6 @@ namespace CalamityMod.Projectiles.Magic Count = 7 } - internal PrimitiveTrail TrailDrawer = null; public ref float Time => ref Projectile.ai[0]; public PartyCannonExplosionType RocketType { @@ -135,11 +135,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); - Projectile.oldPos[0] = Projectile.position + Projectile.velocity.SafeNormalize(Vector2.Zero) * 50f; - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + Projectile.velocity, 80); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity), 80); Texture2D rocketTexture = ModContent.Request(Texture).Value; Main.EntitySpriteDraw(rocketTexture, diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 86ab25cc1b..8730747df1 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Graphics.Metaballs; +using CalamityMod.Graphics.Primitives; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Magic public class RancorLaserbeam : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public PrimitiveTrail RayDrawer = null; public Player Owner => Main.player[Projectile.owner]; public Projectile MagicCircle { @@ -162,16 +162,13 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - RayDrawer ??= new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:Flame"]); - GameShaders.Misc["CalamityMod:Flame"].UseImage1("Images/Misc/Perlin"); Vector2[] basePoints = new Vector2[24]; for (int i = 0; i < basePoints.Length; i++) basePoints[i] = Projectile.Center + Projectile.velocity * i / (basePoints.Length - 1f) * LaserLength; - Vector2 overallOffset = -Main.screenPosition; - RayDrawer.Draw(basePoints, overallOffset, 92); + PrimitiveSet.Prepare(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); return false; } diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index 370e1c8199..348177d500 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -9,6 +9,7 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using CalamityMod.Particles; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { @@ -38,7 +39,6 @@ namespace CalamityMod.Projectiles.Magic public static float HomingRange = 250; public static float HomingAngle = MathHelper.PiOver4 * 1.65f; - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult = Color.White; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -191,20 +191,15 @@ namespace CalamityMod.Projectiles.Magic Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 3.5f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); - - Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/CosmicShivAura.cs b/Projectiles/Melee/CosmicShivAura.cs index 39e903edfb..ff62c67b0e 100644 --- a/Projectiles/Melee/CosmicShivAura.cs +++ b/Projectiles/Melee/CosmicShivAura.cs @@ -1,71 +1,71 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class CosmicShivAura : ModProjectile - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public readonly int SwordsAverageDelay = 40; - public readonly int SwordsRandomOffset = 15; - public int CurrentSwordTimer; - public NPC target; - - public override void SetDefaults() - { - Projectile.width = 2; - Projectile.height = 2; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; - } - - public override void OnSpawn(IEntitySource source) - { - if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) - target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object - } - - // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found - // ai[1] for sword timer - public override void AI() - { - // Unexist with target - if (target is null || !target.active) { - Projectile.Kill(); - } - - Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target - - if (Projectile.ai[1] == CurrentSwordTimer) - { - Vector2 randomDirection = Main.rand.NextFloat(0, MathHelper.TwoPi).ToRotationVector2(); - randomDirection.Normalize(); - int randomDistance = Main.rand.Next(200, 426); - Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); - Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); - Projectile.ai[1] = 0; // Reset timer - CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn - } - - Projectile.ai[1]++; - } - - // The aura itself should not do contact damage - public override bool? CanDamage() => false; - } -} +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class CosmicShivAura : ModProjectile + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public readonly int SwordsAverageDelay = 40; + public readonly int SwordsRandomOffset = 15; + public int CurrentSwordTimer; + public NPC target; + + public override void SetDefaults() + { + Projectile.width = 2; + Projectile.height = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + } + + public override void OnSpawn(IEntitySource source) + { + if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) + target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object + } + + // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found + // ai[1] for sword timer + public override void AI() + { + // Unexist with target + if (target is null || !target.active) { + Projectile.Kill(); + } + + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target + + if (Projectile.ai[1] == CurrentSwordTimer) + { + Vector2 randomDirection = Main.rand.NextFloat(0, MathHelper.TwoPi).ToRotationVector2(); + randomDirection.Normalize(); + int randomDistance = Main.rand.Next(200, 426); + Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); + Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); + Projectile.ai[1] = 0; // Reset timer + CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn + } + + Projectile.ai[1]++; + } + + // The aura itself should not do contact damage + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Melee/EonBolt.cs b/Projectiles/Melee/EonBolt.cs index b518b8ee34..d1ddcad5d6 100644 --- a/Projectiles/Melee/EonBolt.cs +++ b/Projectiles/Melee/EonBolt.cs @@ -7,13 +7,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { public class EonBolt : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - internal PrimitiveTrail TrailDrawer; public override string Texture => "CalamityMod/Projectiles/Melee/GalaxiaBolt"; @@ -102,15 +102,11 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Texture2D texture = Request("CalamityMod/Projectiles/Melee/GalaxiaBolt").Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, 0.5f), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - return false; } } diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index d26bb9b959..7c8c37c4a7 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -11,6 +11,7 @@ using static Terraria.ModLoader.ModContent; using System; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { @@ -21,8 +22,6 @@ namespace CalamityMod.Projectiles.Melee public static float MaxWidth = 30; public ref float Time => ref Projectile.ai[0]; - public PrimitiveTrail TrailDrawer = null; - public PrimitiveTrail MiniTrailDrawer = null; public static Asset BloomTex; public static Asset SlashTex; @@ -148,10 +147,6 @@ namespace CalamityMod.Projectiles.Melee //Draw the blade. Main.EntitySpriteDraw(texture, Projectile.oldPos[2] + Projectile.Size / 2f - Main.screenPosition, null, Color.White with { A = 0 }, Projectile.rotation + MathHelper.PiOver4, texture.Size() / 2f, bladeScale * Projectile.scale, 0, 0); - - - - if (BloomTex == null) BloomTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); Texture2D bloomTex = BloomTex.Value; @@ -163,10 +158,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(bloomTex, Projectile.oldPos[2] + Projectile.Size / 2f - Main.screenPosition, null, (mainColor * 0.1f) with { A = 0 }, 0, bloomTex.Size() / 2f, 1.3f * Projectile.scale, 0, 0); Main.EntitySpriteDraw(bloomTex, Projectile.oldPos[1] + Projectile.Size / 2f - Main.screenPosition, null, (mainColor * 0.5f) with { A = 0 }, 0, bloomTex.Size() / 2f, 0.34f * Projectile.scale, 0, 0); - - TrailDrawer ??= new(TrailWidth, TrailColor, null, GameShaders.Misc["CalamityMod:ExobladePierce"]); - MiniTrailDrawer ??= new(MiniTrailWidth, MiniTrailColor, null, GameShaders.Misc["CalamityMod:ExobladePierce"]); - Main.spriteBatch.EnterShaderRegion(); if (TrailTex == null) @@ -180,21 +171,18 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].Apply(); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30, Projectile.oldRot); + PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(Color.White); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(Color.White); - MiniTrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30, Projectile.oldRot); + PrimitiveSet.Prepare(Projectile.oldPos, new(MiniTrailWidth, MiniTrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); Main.spriteBatch.ExitShaderRegion(); //Draw the bloom above the trail Main.EntitySpriteDraw(bloomTex, Projectile.oldPos[2] + Projectile.Size / 2f - Main.screenPosition, null, (Color.White * 0.2f) with { A = 0 }, 0, bloomTex.Size() / 2f, 0.78f * Projectile.scale, 0, 0); - Main.EntitySpriteDraw(bloomTex, Projectile.oldPos[1] + Projectile.Size / 2f - Main.screenPosition, null, (Color.White * 0.5f) with { A = 0 }, 0, bloomTex.Size() / 2f, 0.2f * Projectile.scale, 0, 0); - - - + Main.EntitySpriteDraw(bloomTex, Projectile.oldPos[1] + Projectile.Size / 2f - Main.screenPosition, null, (Color.White * 0.5f) with { A = 0 }, 0, bloomTex.Size() / 2f, 0.2f * Projectile.scale, 0, 0); return false; } } diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index f5f53cd703..e0be4a3565 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -25,10 +26,6 @@ namespace CalamityMod.Projectiles.Melee public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public Player Owner => Main.player[Projectile.owner]; - public PrimitiveTrail SlashDrawer = null; - - public PrimitiveTrail PierceAfterimageDrawer = null; - const float BladeLength = 180; public int GetSwingTime @@ -454,10 +451,6 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.Opacity <= 0f || InPostBonkStasis) return false; - // Initialize the primitives drawers. - SlashDrawer ??= new(SlashWidthFunction, SlashColorFunction, null, GameShaders.Misc["CalamityMod:ExobladeSlash"]); - PierceAfterimageDrawer ??= new(PierceWidthFunction, PierceColorFunction, null, GameShaders.Misc["CalamityMod:ExobladePierce"]); - DrawSlash(); DrawPierceTrail(); DrawBlade(); @@ -480,7 +473,7 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladeSlash"].Shader.Parameters["flipped"].SetValue(Direction == 1); GameShaders.Misc["CalamityMod:ExobladeSlash"].Apply(); - SlashDrawer.Draw(GenerateSlashPoints(), Projectile.Center - Main.screenPosition, 95); + PrimitiveSet.Prepare(GenerateSlashPoints(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); Main.spriteBatch.ExitShaderRegion(); } @@ -499,13 +492,13 @@ namespace CalamityMod.Projectiles.Melee mainColor = Color.Lerp(Color.White, mainColor, 0.4f + 0.6f * (float)Math.Pow(LungeProgression, 0.5f)); secondaryColor = Color.Lerp(Color.White, secondaryColor, 0.4f + 0.6f * (float)Math.Pow(LungeProgression, 0.5f)); - Vector2 trailOffset = (Projectile.rotation - Direction * MathHelper.PiOver4).ToRotationVector2() * 98f + Projectile.Size * 0.5f - Main.screenPosition; + Vector2 trailOffset = (Projectile.rotation - Direction * MathHelper.PiOver4).ToRotationVector2() * 98f + Projectile.Size * 0.5f; GameShaders.Misc["CalamityMod:ExobladePierce"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); GameShaders.Misc["CalamityMod:ExobladePierce"].UseImage2("Images/Extra_189"); GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(mainColor); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:ExobladePierce"].Apply(); - PierceAfterimageDrawer.Draw(Projectile.oldPos.Take(51), trailOffset, 53); + PrimitiveSet.Prepare(Projectile.oldPos.Take(51), new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 53); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index 6fb40c5187..a151620d7d 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Tools; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Tools; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -19,7 +20,6 @@ namespace CalamityMod.Projectiles.Melee public override string Texture => "CalamityMod/Items/Tools/MarniteObliterator"; public static Asset GlowmaskTex; public static Asset BloomTex; - internal PrimitiveTrail TrailDrawer; public Player Owner => Main.player[Projectile.owner]; public ref float MoveInIntervals => ref Projectile.localAI[0]; @@ -125,7 +125,6 @@ namespace CalamityMod.Projectiles.Melee return 29.4f * completionRatio; } - public void DrawBeam(Texture2D beamTex, Vector2 direction, int beamIndex) { Vector2 startPos = Owner.MountedCenter + direction * 17f + direction.RotatedBy(MathHelper.PiOver2) * (float)Math.Cos(MathHelper.TwoPi * beamIndex / 3f + SpeenBeams * 0.06f) * 13f; @@ -174,12 +173,8 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(bloomTex, Projectile.Center - Main.screenPosition, null, Color.DeepSkyBlue * 0.3f, MathHelper.PiOver2, bloomTex.Size() / 2f, 0.3f * Projectile.scale, SpriteEffects.None, 0); - - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/DoubleTrail")); - TrailDrawer.Draw(new Vector2[] { Projectile.Center , Owner.MountedCenter - normalizedVelocity * 13f}, - Main.screenPosition, 30); + PrimitiveSet.Prepare(new Vector2[] { Projectile.Center, Owner.MountedCenter - normalizedVelocity * 13f }, new(WidthFunction, ColorFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index 3bd6d025e7..fb8c3375b6 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -13,7 +14,6 @@ namespace CalamityMod.Projectiles.Melee public class PrismTooth : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - internal PrimitiveTrail TrailDrawer; public const int Lifetime = 80; public Player Owner => Main.player[Projectile.owner]; public ref float ShootReach => ref Projectile.ai[0]; @@ -115,9 +115,6 @@ namespace CalamityMod.Projectiles.Melee if (Time <= 5f) return true; - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PrismaticStreak"]); - // Variable adjustment vector used to prevent the trail for starting somewhat that isn't behind // the crystal. This may appear in small amounts, with offsets of a few pixels, but at the speed // these crystals go, it's probably not something to worry too much about. @@ -135,7 +132,7 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f + generalOffset - Main.screenPosition, 65); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); Main.spriteBatch.ExitShaderRegion(); return true; } diff --git a/Projectiles/Melee/RendingNeedle.cs b/Projectiles/Melee/RendingNeedle.cs index 60ff8d71ef..b898c7ee36 100644 --- a/Projectiles/Melee/RendingNeedle.cs +++ b/Projectiles/Melee/RendingNeedle.cs @@ -8,6 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee @@ -16,7 +17,6 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; - internal PrimitiveTrail TrailDrawer; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; @@ -85,6 +85,7 @@ namespace CalamityMod.Projectiles.Melee return MathHelper.Lerp(0f, 14f * Projectile.scale, expansionCompletion); } + public Vector2 OffsetFunction(float completionRatio) => Projectile.Size * 0.5f - Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 30.5f; public override bool PreDraw(ref Color lightColor) { @@ -93,11 +94,8 @@ namespace CalamityMod.Projectiles.Melee Texture2D texture = Request("CalamityMod/Projectiles/Melee/RendingNeedle").Value; - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 30.5f - Main.screenPosition, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, OffsetFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, 0.5f), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); @@ -120,8 +118,6 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - return false; } diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 48381f102e..54a1ef52a0 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -31,7 +32,6 @@ namespace CalamityMod.Projectiles.Melee public ref float DashTime => ref Projectile.ai[1]; public Vector2 DashDestination = Vector2.Zero; - internal PrimitiveTrail TrailDrawer; // Rawest placeholder sound public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/ExoMechs/ApolloMissileLaunch") { Volume = 0.6f }; @@ -221,11 +221,9 @@ namespace CalamityMod.Projectiles.Melee Color shieldColor = Color.LightSalmon; // Main trail - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f + extraOffset - (direction * 80f), 10); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + extraOffset + Main.screenPosition - direction * 80f, + shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 10); ArrowEffect.Parameters["halfSpreadAngle"].SetValue(MathHelper.ToRadians(7.5f)); ArrowEffect.Parameters["edgeColor"].SetValue(headColor.ToVector3()); diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index aa3684678e..95cecc3c2c 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -9,13 +9,13 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { public class TaintedBladeSlasher : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - internal PrimitiveTrail TrailDrawer = null; public ref float SwordItemID => ref Projectile.ai[1]; public ref float VerticalOffset => ref Projectile.localAI[0]; public ref float Time => ref Projectile.localAI[1]; @@ -209,9 +209,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:FadingSolidTrail"]); - Texture2D forearmTexture = ModContent.Request("CalamityMod/Projectiles/Melee/TaintedForearm").Value; Texture2D armTexture = ModContent.Request("CalamityMod/Projectiles/Melee/TaintedArm").Value; Texture2D handTexture = ModContent.Request("CalamityMod/Projectiles/Melee/TaintedHand").Value; @@ -248,13 +245,6 @@ namespace CalamityMod.Projectiles.Melee Vector2 top = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f - Main.screenPosition; Vector2 offsetToBlade = (top - bottom).SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2) * 5f; - TrailDrawer.OverridingStickPointStart = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; - TrailDrawer.OverridingStickPointEnd = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; - - // Swap the ends if needed so that the trail faces the right direction. - if (Owner.direction == -1) - Utils.Swap(ref TrailDrawer.OverridingStickPointStart, ref TrailDrawer.OverridingStickPointEnd); - Vector2[] drawPoints = new Vector2[Projectile.oldPos.Length]; Vector2 perpendicularDirection = BladeOffsetDirection.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.PiOver2); for (int i = 1; i < drawPoints.Length; i++) @@ -265,7 +255,15 @@ namespace CalamityMod.Projectiles.Melee drawPoints[i] = Projectile.Center + perpendicularDirection.RotatedBy(i * -0.014f * Owner.direction) * i * -Owner.direction * 6f; } - TrailDrawer.Draw(drawPoints, BladeCenterPosition - Projectile.position - Main.screenPosition, 67); + var leftVertexPosition = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; + var rightVertexPosition = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; + + // Swap the ends if needed so that the trail faces the right direction. + if (Owner.direction == -1) + Utils.Swap(ref leftVertexPosition, ref rightVertexPosition); + + PrimitiveSet.Prepare(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => BladeCenterPosition - Projectile.position, + shader: GameShaders.Misc["CalamityMod:FadingSolidTrail"], initialVertexPositionsOverride: (leftVertexPosition, rightVertexPosition)), 67); } // Draw the blade. diff --git a/Projectiles/Melee/TerratomereBeam.cs b/Projectiles/Melee/TerratomereBeam.cs index 115f4ad104..3f247b6ddb 100644 --- a/Projectiles/Melee/TerratomereBeam.cs +++ b/Projectiles/Melee/TerratomereBeam.cs @@ -4,6 +4,7 @@ using Terraria.ModLoader; using Terraria.Graphics.Shaders; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { @@ -11,8 +12,6 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public Vector2[] ControlPoints; - - public PrimitiveTrail SlashDrawer = null; public bool Flipped => Projectile.ai[0] == 1f; @@ -46,9 +45,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - // Initialize the primitive drawer. - SlashDrawer ??= new(SlashWidthFunction, SlashColorFunction, null, GameShaders.Misc["CalamityMod:ExobladeSlash"]); - // Draw the slash effect. Main.spriteBatch.EnterShaderRegion(); @@ -59,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee points.Add(ControlPoints[i] + ControlPoints[i].SafeNormalize(Vector2.Zero) * (Projectile.scale - 1f) * 40f); for (int i = 0; i < 3; i++) - SlashDrawer.Draw(points, Projectile.Center - Main.screenPosition, 65); + PrimitiveSet.Prepare(points, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 65); Main.spriteBatch.ExitShaderRegion(); return false; diff --git a/Projectiles/Melee/TerratomereBigSlash.cs b/Projectiles/Melee/TerratomereBigSlash.cs index a156170c03..641f0fb86c 100644 --- a/Projectiles/Melee/TerratomereBigSlash.cs +++ b/Projectiles/Melee/TerratomereBigSlash.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; using Terraria.Graphics.Shaders; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { @@ -12,8 +13,6 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public int TargetIndex = -1; - - public PrimitiveTrail SlashDrawer = null; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -63,16 +62,13 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - // Initialize the slash drawer. - SlashDrawer ??= new PrimitiveTrail(SlashWidthFunction, SlashColorFunction, null, GameShaders.Misc["CalamityMod:ExobladePierce"]); - GameShaders.Misc["CalamityMod:ExobladePierce"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/BlobbyNoise")); GameShaders.Misc["CalamityMod:ExobladePierce"].UseImage2("Images/Extra_189"); GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(Terratomere.TerraColor1); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(Terratomere.TerraColor2); for (int i = 0; i < 4; i++) - SlashDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); return false; } diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 64f582b1a2..8790e3996c 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -11,13 +11,13 @@ using Terraria.Graphics.Shaders; using Terraria.Audio; using static CalamityMod.CalamityUtils; using System.Linq; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { public class TerratomereHoldoutProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - public PrimitiveTrail SlashDrawer = null; public Player Owner => Main.player[Projectile.owner]; @@ -230,9 +230,6 @@ namespace CalamityMod.Projectiles.Melee public void DrawSlash() { - // Initialize the primitive drawer. - SlashDrawer ??= new(SlashWidthFunction, SlashColorFunction, null, GameShaders.Misc["CalamityMod:ExobladeSlash"]); - // Draw the slash effect. Main.spriteBatch.EnterShaderRegion(); @@ -240,7 +237,7 @@ namespace CalamityMod.Projectiles.Melee PrepareSlashShader(Direction == 1); if (SwingCompletionAtStartOfTrail > SwingCompletionRatio) - SlashDrawer.Draw(GenerateSlashPoints(), Projectile.Center - Main.screenPosition, 95); + PrimitiveSet.Prepare(GenerateSlashPoints(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/ViolenceSlashProjectile.cs b/Projectiles/Melee/ViolenceSlashProjectile.cs index 6d97af7fcb..89736bbf14 100644 --- a/Projectiles/Melee/ViolenceSlashProjectile.cs +++ b/Projectiles/Melee/ViolenceSlashProjectile.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Melee public class ViolenceSlashProjectile : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - internal PrimitiveTrail SliceAfterimageDrawer = null; internal Player Owner => Main.player[Projectile.owner]; internal ref float Time => ref Projectile.ai[0]; internal float SwingSine => (float)Math.Sin(MathHelper.TwoPi * Time / 50f); @@ -98,9 +98,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (SliceAfterimageDrawer is null) - SliceAfterimageDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); - GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture")); Texture2D spearProjectile = ModContent.Request(Texture).Value; @@ -116,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee positions.Add(position); } - SliceAfterimageDrawer.Draw(positions, Projectile.Size * 0.5f - Main.screenPosition, 50); + PrimitiveSet.Prepare(positions, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); return true; } } diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index 7afda2d432..da80a0724f 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.Melee public class ViolenceThrownProjectile : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - internal PrimitiveTrail StreakDrawer = null; internal Player Owner => Main.player[Projectile.owner]; internal ref float Time => ref Projectile.ai[0]; public override string Texture => "CalamityMod/Items/Weapons/Melee/Violence"; @@ -197,9 +197,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (StreakDrawer is null) - StreakDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); Texture2D spearProjectile = ModContent.Request(Texture).Value; @@ -218,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee drawPoints[i] -= (Projectile.oldRot[i] + MathHelper.PiOver4).ToRotationVector2() * Projectile.height * 0.5f; if (Time > Projectile.oldPos.Length) - StreakDrawer.Draw(drawPoints, Projectile.Size * 0.5f - Main.screenPosition, 88); + PrimitiveSet.Prepare(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 88); Vector2 drawPosition = Projectile.Center - Main.screenPosition; for (int i = 0; i < 6; i++) diff --git a/Projectiles/Melee/WulfrumScrew.cs b/Projectiles/Melee/WulfrumScrew.cs index c7c5861ff4..d497a35f4c 100644 --- a/Projectiles/Melee/WulfrumScrew.cs +++ b/Projectiles/Melee/WulfrumScrew.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Sounds; @@ -18,7 +19,6 @@ namespace CalamityMod.Projectiles.Melee public class WulfrumScrew : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult = Color.White; @@ -200,17 +200,12 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - //Draw a trail - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); //Draw the screw with chroma abberation diff --git a/Projectiles/Ranged/ExoCrystalArrow.cs b/Projectiles/Ranged/ExoCrystalArrow.cs index 88af4e505c..f795becc29 100644 --- a/Projectiles/Ranged/ExoCrystalArrow.cs +++ b/Projectiles/Ranged/ExoCrystalArrow.cs @@ -9,13 +9,14 @@ using CalamityMod.Particles; using Terraria.Graphics.Shaders; using Microsoft.Xna.Framework.Graphics; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Graphics.Primitives; +using Microsoft.CodeAnalysis; namespace CalamityMod.Projectiles.Ranged { public class ExoCrystalArrow : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public PrimitiveTrail PierceAfterimageDrawer = null; public bool CreateLightning => Projectile.ai[0] == 1f; @@ -77,8 +78,6 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - PierceAfterimageDrawer ??= new(PrimitiveWidthFunction, PrimitiveColorFunction, null, GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"]); - float localIdentityOffset = Projectile.identity * 0.1372f; Color mainColor = CalamityUtils.MulticolorLerp((Main.GlobalTimeWrappedHourly * 2f + localIdentityOffset) % 1f, Color.Cyan, Color.Lime, Color.GreenYellow, Color.Goldenrod, Color.Orange); Color secondaryColor = CalamityUtils.MulticolorLerp((Main.GlobalTimeWrappedHourly * 2f + localIdentityOffset + 0.2f) % 1f, Color.Cyan, Color.Lime, Color.GreenYellow, Color.Goldenrod, Color.Orange); @@ -86,14 +85,13 @@ namespace CalamityMod.Projectiles.Ranged mainColor = Color.Lerp(Color.White, mainColor, 0.85f); secondaryColor = Color.Lerp(Color.White, secondaryColor, 0.85f); - Vector2 trailOffset = Projectile.Size * 0.5f - Main.screenPosition; + Vector2 trailOffset = Projectile.Size * 0.5f; GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseImage2("Images/Extra_189"); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseColor(mainColor); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].Apply(); - PierceAfterimageDrawer.Draw(Projectile.oldPos, trailOffset, 53); - + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"]), 53); Texture2D tex = ModContent.Request(Texture).Value; Vector2 origin = tex.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Ranged/ExoLightningBolt.cs b/Projectiles/Ranged/ExoLightningBolt.cs index cbc45ce972..307fb9d459 100644 --- a/Projectiles/Ranged/ExoLightningBolt.cs +++ b/Projectiles/Ranged/ExoLightningBolt.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; using System; @@ -17,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged public class ExoLightningBolt : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - internal PrimitiveTrail LightningDrawer; public bool HasPlayedSound; @@ -162,13 +162,10 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]); - GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].Apply(); - LightningDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 18); + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]), 18); return false; } diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index 70214893b6..b4048dfc0c 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Graphics.Primitives; using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -17,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; private static readonly int trailLength = 35; - private PrimitiveTrail trailDrawer; internal List trailPositions; // Lifetime of a bullet. Defined in terms of updates because Terraria's engine is trash. @@ -212,11 +212,8 @@ namespace CalamityMod.Projectiles.Ranged if (trailPositions is null) return false; - if (trailDrawer is null) - trailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - trailDrawer.Draw(trailPositions, Projectile.Size * 0.5f - Main.screenPosition, trailLength); + PrimitiveSet.Prepare(trailPositions, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), trailLength); return false; } diff --git a/Projectiles/Ranged/MeowCreature.cs b/Projectiles/Ranged/MeowCreature.cs index 94a6ac41c4..3daeb2a679 100644 --- a/Projectiles/Ranged/MeowCreature.cs +++ b/Projectiles/Ranged/MeowCreature.cs @@ -1,3 +1,4 @@ +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -14,8 +15,6 @@ namespace CalamityMod.Projectiles.Ranged { public new string LocalizationCategory => "Projectiles.Ranged"; - internal PrimitiveTrail TrailDrawer; - public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; @@ -63,11 +62,7 @@ namespace CalamityMod.Projectiles.Ranged // The creature glows public override void PostDraw(Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); - - TrailDrawer.Draw(Projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), Projectile.Size * 0.5f - Main.screenPosition, 30); - + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 30); Texture2D glow = ModContent.Request(Texture).Value; Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } diff --git a/Projectiles/Ranged/MineralMortarProjectile.cs b/Projectiles/Ranged/MineralMortarProjectile.cs index 77b5756a05..b21bc0299c 100644 --- a/Projectiles/Ranged/MineralMortarProjectile.cs +++ b/Projectiles/Ranged/MineralMortarProjectile.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -176,10 +177,8 @@ namespace CalamityMod.Projectiles.Ranged float rotation = Projectile.rotation + MathHelper.PiOver2; Vector2 origin = texture.Size() * 0.5f; - PrimitiveTrail trail = new PrimitiveTrail(TrailWidthFunction, ColorTrailFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture")); - trail.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 50); - + PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidthFunction, ColorTrailFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 50); if (CalamityConfig.Instance.Afterimages) { for (int i = 0; i < 3; i++) diff --git a/Projectiles/Ranged/PristineFire.cs b/Projectiles/Ranged/PristineFire.cs index 66e34181a0..7ac5652133 100644 --- a/Projectiles/Ranged/PristineFire.cs +++ b/Projectiles/Ranged/PristineFire.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -16,9 +17,6 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Particles/MediumMist"; - // Helix trail thing - public PrimitiveTrail HelixTrail = null; - public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 20; @@ -92,9 +90,6 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (HelixTrail is null) - HelixTrail = new PrimitiveTrail(HelixTrailWidthFunction, HelixTrailColorFunction); - // Draw a double helix trail for (int direction = -1; direction <= 1; direction += 2) { @@ -109,7 +104,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 sinOffset = (Vector2.UnitY * direction * MathF.Sin(i * MathHelper.Pi * 0.125f) * 24f).RotatedBy(Projectile.oldRot[i]); trailPositions.Add(Projectile.oldPos[i] + sinOffset); } - HelixTrail.Draw(trailPositions, Projectile.Size * 0.5f- Main.screenPosition, 60); + PrimitiveSet.Prepare(trailPositions, new(HelixTrailWidthFunction, HelixTrailColorFunction, (_) => Projectile.Size * 0.5f), 60); } return false; } diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs index 40755b24cf..0a3cfc47dc 100644 --- a/Projectiles/Ranged/SpeedBlasterShot.cs +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -1,4 +1,5 @@ using CalamityMod.Graphics.Metaballs; +using CalamityMod.Graphics.Primitives; using CalamityMod.Particles; using Microsoft.Xna.Framework; using System.Linq; @@ -18,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged public static readonly SoundStyle ShotImpact = new("CalamityMod/Sounds/Item/SplatshotImpact") { PitchVariance = 0.3f, Volume = 2.5f }; public static readonly SoundStyle ShotImpactBig = new("CalamityMod/Sounds/Item/SplatshotBigImpact") { PitchVariance = 0.3f, Volume = 4f }; - internal PrimitiveTrail TrailDrawer; public override void SetStaticDefaults() { @@ -180,10 +180,7 @@ namespace CalamityMod.Projectiles.Ranged internal Color ColorFunction(float completionRatio) => GetColor(Projectile.ai[0]) * Projectile.Opacity; public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); - - TrailDrawer.Draw(Projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), Projectile.Size * 0.5f - Main.screenPosition, 20); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 20); return true; } } diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index 8b540dd328..2dab8db792 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -8,6 +8,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Ranged { @@ -16,7 +17,6 @@ namespace CalamityMod.Projectiles.Ranged public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public PrimitiveTrail TrailDrawer = null; private const int Lifetime = 180; private static Color ShaderColorOne = new Color(237, 194, 66); private static Color ShaderColorTwo = new Color(235, 227, 117); @@ -100,13 +100,10 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - Vector2 overallOffset = Projectile.Size * 0.5f - Main.screenPosition; + Vector2 overallOffset = Projectile.Size * 0.5f; overallOffset += Projectile.velocity * 1.4f; - TrailDrawer.Draw(Projectile.oldPos, overallOffset, 92); // 58 + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); return false; } diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index fc0f71474f..95392e0182 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -6,13 +6,13 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Ranged { public class TheMaelstromShark : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public PrimitiveTrail LightningTrailDrawer = null; public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 6; @@ -97,11 +97,8 @@ namespace CalamityMod.Projectiles.Ranged Vector2 drawPosition = Projectile.Center - Main.screenPosition; SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - if (LightningTrailDrawer is null) - LightningTrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - LightningTrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 60); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 60); Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } diff --git a/Projectiles/Ranged/WulfrumScrapBullet.cs b/Projectiles/Ranged/WulfrumScrapBullet.cs index 2c1fd2b869..fd26a60f77 100644 --- a/Projectiles/Ranged/WulfrumScrapBullet.cs +++ b/Projectiles/Ranged/WulfrumScrapBullet.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -12,7 +13,6 @@ namespace CalamityMod.Projectiles.Ranged public class WulfrumScrapBullet : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - internal PrimitiveTrail TrailDrawer; public override void SetStaticDefaults() { @@ -60,12 +60,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30); - + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); return false; } } diff --git a/Projectiles/Rogue/DynamicPursuerElectricity.cs b/Projectiles/Rogue/DynamicPursuerElectricity.cs index 7692ecc939..307247065f 100644 --- a/Projectiles/Rogue/DynamicPursuerElectricity.cs +++ b/Projectiles/Rogue/DynamicPursuerElectricity.cs @@ -1,7 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using System; -using System.IO; -using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,7 +11,6 @@ namespace CalamityMod.Projectiles.Rogue public class DynamicPursuerElectricity : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - internal PrimitiveTrail LightningDrawer; public const int MaximumBranchingIterations = 3; public const float LightningTurnRandomnessFactor = 1.7f; @@ -116,7 +114,7 @@ namespace CalamityMod.Projectiles.Rogue internal float WidthFunction(float completionRatio) { - float baseWidth = MathHelper.Lerp(2f, 6f, (float)Math.Sin(MathHelper.Pi * 4f * completionRatio) * 0.5f + 0.5f) * Projectile.scale; + float baseWidth = MathHelper.Lerp(4f, 7f, (float)Math.Sin(MathHelper.Pi * 4f * completionRatio) * 0.5f + 0.5f) * Projectile.scale; return baseWidth * (float)Math.Sin(MathHelper.Pi * completionRatio); } internal Color ColorFunction(float completionRatio) @@ -126,10 +124,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - - LightningDrawer.Draw(Projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), Projectile.Size * 0.5f - Main.screenPosition, 300); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); return false; } } diff --git a/Projectiles/Rogue/FishboneBoomerangProjectile.cs b/Projectiles/Rogue/FishboneBoomerangProjectile.cs index 1d248d3f0f..b49727d24e 100644 --- a/Projectiles/Rogue/FishboneBoomerangProjectile.cs +++ b/Projectiles/Rogue/FishboneBoomerangProjectile.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Projectiles.Rogue public class FishboneBoomerangProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - internal PrimitiveTrail TrailRenderer; public override string Texture => "CalamityMod/Items/Weapons/Rogue/FishboneBoomerang"; public static int ChargeupTime = 20; diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index a4f6404e97..68bfa13cb7 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -6,13 +6,13 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Rogue { public class ScarletDevilProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - internal PrimitiveTrail TrailDrawer; public ref float ShootTimer => ref Projectile.ai[0]; public override string Texture => "CalamityMod/Items/Weapons/Rogue/ScarletDevil"; @@ -175,11 +175,9 @@ namespace CalamityMod.Projectiles.Rogue } else { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); - GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, 60); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, false, + shader: GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]), 60); Texture2D spearTexture = ModContent.Request(Texture).Value; diff --git a/Projectiles/Rogue/StormfrontLightning.cs b/Projectiles/Rogue/StormfrontLightning.cs index 6c3cf7292f..562e292843 100644 --- a/Projectiles/Rogue/StormfrontLightning.cs +++ b/Projectiles/Rogue/StormfrontLightning.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Rogue; using CalamityMod.Sounds; @@ -21,7 +22,6 @@ namespace CalamityMod.Projectiles.Rogue public class StormfrontLightning : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - internal PrimitiveTrail LightningDrawer; private int noTileHitCounter = 81; //Using other projectile's methods to not collide until a certain time has passed, allowing use inside caves @@ -180,13 +180,11 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { //Just gonna use Dom's work on Heavenly Gale, tried to do a new one myself but I barely understand the .fx files and how they work, might revist it again eventually - Shade - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]); - GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].Apply(); - LightningDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.3f - Main.screenPosition, 10); + PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.3f, false, + shader: GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]), 10); return false; } diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 4373aa131a..00e1882c66 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -9,13 +9,13 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Rogue { public class WulfrumKnifeProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult = Color.White; public override string Texture => "CalamityMod/Items/Weapons/Rogue/WulfrumKnife"; @@ -127,16 +127,12 @@ namespace CalamityMod.Projectiles.Rogue Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index 4f91de5f77..571e684ea6 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using static CalamityMod.CalamityUtils; using static Terraria.ModLoader.ModContent; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Summon { @@ -28,8 +29,6 @@ namespace CalamityMod.Projectiles.Summon public static readonly SoundStyle ZapSound = SoundID.Item94 with { Volume = SoundID.Item94.Volume * 0.5f }; public static readonly SoundStyle SlapSound = new("CalamityMod/Sounds/Custom/WetSlap", 4); - internal PrimitiveTrail TrailRenderer; - public List Segments; public Player Owner => Main.player[Projectile.owner]; public ref float Initialized => ref Projectile.ai[0]; @@ -238,13 +237,9 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - if (TrailRenderer is null) - TrailRenderer = new PrimitiveTrail(PrimWidthFunction, PrimColorFunction); - Vector2[] segmentPositions = Segments.Select(x => x.position).ToArray(); - TrailRenderer.Draw(segmentPositions, -Main.screenPosition, 66); - + PrimitiveSet.Prepare(segmentPositions, new(PrimWidthFunction, PrimColorFunction), 66); Texture2D tex = Request(Texture).Value; diff --git a/Projectiles/Summon/CosmilampBeam.cs b/Projectiles/Summon/CosmilampBeam.cs index e4b7bb63f1..8ca0f13065 100644 --- a/Projectiles/Summon/CosmilampBeam.cs +++ b/Projectiles/Summon/CosmilampBeam.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -12,7 +13,6 @@ namespace CalamityMod.Projectiles.Summon public class CosmilampBeam : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - internal PrimitiveTrail TrailDrawer; public ref float Timer => ref Projectile.ai[0]; @@ -105,15 +105,13 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - // Initialize the trail drawer. - TrailDrawer ??= new(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - Projectile.localAI[0] = 0f; GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 42); + var primSet = PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 42); Projectile.localAI[0] = 1f; - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 42); + if (primSet.HasValue) + primSet.Value.Render(); return false; } } diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index 333bd465f0..1528615ff5 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using System; using System.IO; using System.Linq; @@ -11,7 +12,6 @@ namespace CalamityMod.Projectiles.Summon public class DaedalusLightning : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - internal PrimitiveTrail LightningDrawer; public const int MaximumBranchingIterations = 3; public const float LightningTurnRandomnessFactor = 1.7f; @@ -137,10 +137,7 @@ namespace CalamityMod.Projectiles.Summon } public override bool PreDraw(ref Color lightColor) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - - LightningDrawer.Draw(Projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), Projectile.Size * 0.5f - Main.screenPosition, 300); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); return false; } #endregion diff --git a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs index c36ee78ca1..5c371e9c66 100644 --- a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs +++ b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using System; @@ -17,10 +18,6 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public ref float Time => ref Projectile.ai[1]; - public PrimitiveTrail LightningDrawer; - - public PrimitiveTrail LightningBackgroundDrawer; - public override string Texture => "CalamityMod/Projectiles/Boss/AresTeslaOrb"; public override void SetStaticDefaults() @@ -113,17 +110,12 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public override bool PreDraw(ref Color lightColor) { - if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - if (LightningBackgroundDrawer is null) - LightningBackgroundDrawer = new PrimitiveTrail(BackgroundWidthFunction, BackgroundColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); - Projectile orbToAttachTo = GetOrbToAttachTo(); if (orbToAttachTo != null) { List arcPoints = AresTeslaOrb.DetermineElectricArcPoints(Projectile.Center, orbToAttachTo.Center, 117); - LightningBackgroundDrawer.Draw(arcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(arcPoints, -Main.screenPosition, 90); + PrimitiveSet.Prepare(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveSet.Prepare(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 1900e43ff9..00290cc4f6 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -15,6 +15,7 @@ using Terraria.Graphics.Effects; using static Terraria.ModLoader.ModContent; using ReLogic.Content; using System.IO; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Summon { @@ -44,7 +45,6 @@ namespace CalamityMod.Projectiles.Summon } } - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult; public Player healedPlayer; @@ -464,8 +464,6 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ZapTrail")); Vector2[] drawPos = new Vector2[] { Projectile.Center, Projectile.Center, healedPlayer.Center + (Projectile.Center - healedPlayer.Center) * 0.5f + Vector2.UnitY * 40f, healedPlayer.Center, healedPlayer.Center }; @@ -473,7 +471,7 @@ namespace CalamityMod.Projectiles.Summon CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1.8f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - TrailDrawer.Draw(drawPos, - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(drawPos, new(WidthFunction, ColorFunction, (_) => offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Summon/WulfrumEnergyBurst.cs b/Projectiles/Summon/WulfrumEnergyBurst.cs index 8e1bc1fa0d..406b4e6c84 100644 --- a/Projectiles/Summon/WulfrumEnergyBurst.cs +++ b/Projectiles/Summon/WulfrumEnergyBurst.cs @@ -10,6 +10,7 @@ using static Terraria.ModLoader.ModContent; using Terraria.Graphics.Shaders; using Terraria.Graphics.Effects; using ReLogic.Content; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Summon { @@ -39,7 +40,6 @@ namespace CalamityMod.Projectiles.Summon public static float HomingRange = 350; public static float HomingAngle = MathHelper.PiOver4 * 1f; - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult = Color.White; public override void SetStaticDefaults() @@ -180,16 +180,12 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ZapTrail")); CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1.5f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Summon/WulfrumFusionBolt.cs b/Projectiles/Summon/WulfrumFusionBolt.cs index 3b9f7f3bc1..ac265cc5fa 100644 --- a/Projectiles/Summon/WulfrumFusionBolt.cs +++ b/Projectiles/Summon/WulfrumFusionBolt.cs @@ -9,6 +9,7 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using CalamityMod.Particles; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Summon { @@ -39,7 +40,6 @@ namespace CalamityMod.Projectiles.Summon public static float HomingRange = 250; public static float HomingAngle = MathHelper.PiOver4 * 1.65f; - internal PrimitiveTrail TrailDrawer; internal Color PrimColorMult = Color.White; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -187,15 +187,12 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 0.5f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition + offset, 30); + PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Typeless/GemTechArmorGem.cs b/Projectiles/Typeless/GemTechArmorGem.cs index 31fbc3ece8..ff4bf52fc6 100644 --- a/Projectiles/Typeless/GemTechArmorGem.cs +++ b/Projectiles/Typeless/GemTechArmorGem.cs @@ -6,6 +6,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Typeless { @@ -16,7 +17,6 @@ namespace CalamityMod.Projectiles.Typeless public ref float Variant => ref Projectile.ai[1]; public const int UpwardFlyTime = 24; public const int RedirectTime = 12; - public PrimitiveTrail FlameTrailDrawer = null; public override string Texture => "CalamityMod/Projectiles/Typeless/GemTechYellowGem"; @@ -139,9 +139,6 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - if (FlameTrailDrawer is null) - FlameTrailDrawer = new PrimitiveTrail(TrailWidth, TrailColor, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); @@ -174,7 +171,7 @@ namespace CalamityMod.Projectiles.Typeless Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(Color.White), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); if (Projectile.ai[0] > UpwardFlyTime + RedirectTime) - FlameTrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 71); + PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 71); return false; } diff --git a/Projectiles/Typeless/MythrilFlare.cs b/Projectiles/Typeless/MythrilFlare.cs index 7d80270c08..0978506c57 100644 --- a/Projectiles/Typeless/MythrilFlare.cs +++ b/Projectiles/Typeless/MythrilFlare.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; @@ -10,7 +11,6 @@ namespace CalamityMod.Projectiles.Typeless public class MythrilFlare : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public PrimitiveTrail FlameTrailDrawer = null; public ref float Time => ref Projectile.ai[0]; public const int AttackDelay = 22; @@ -93,12 +93,9 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - if (FlameTrailDrawer is null) - FlameTrailDrawer = new PrimitiveTrail(TrailWidth, TrailColor, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); - FlameTrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 74); + PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 74); return false; } diff --git a/Projectiles/Typeless/SuicideBomberDemon.cs b/Projectiles/Typeless/SuicideBomberDemon.cs index 95a4448cf0..b409412ca0 100644 --- a/Projectiles/Typeless/SuicideBomberDemon.cs +++ b/Projectiles/Typeless/SuicideBomberDemon.cs @@ -7,6 +7,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Typeless { @@ -20,7 +21,6 @@ namespace CalamityMod.Projectiles.Typeless } public ref float Time => ref Projectile.ai[1]; public Player Owner => Main.player[Projectile.owner]; - public PrimitiveTrail FlameTrailDrawer = null; public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 12; @@ -229,10 +229,6 @@ namespace CalamityMod.Projectiles.Typeless { Main.spriteBatch.EnterShaderRegion(); - // Initialize the flame trail drawer. - if (FlameTrailDrawer is null) - FlameTrailDrawer = new PrimitiveTrail(FlameTrailWidthFunction, FlameTrailColorFunction, null, GameShaders.Misc["CalamityMod:ImpFlameTrail"]); - // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); @@ -268,7 +264,7 @@ namespace CalamityMod.Projectiles.Typeless Vector2 trailOffset = Projectile.Size * 0.5f; trailOffset += (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 20f; - FlameTrailDrawer.Draw(Projectile.oldPos, trailOffset - Main.screenPosition, 61); + PrimitiveSet.Prepare(Projectile.oldPos, new(FlameTrailWidthFunction, FlameTrailColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 61); } Main.spriteBatch.ExitShaderRegion(); diff --git a/Projectiles/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index 3a986703b6..cdc008c50b 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -13,6 +13,7 @@ using ReLogic.Utilities; using CalamityMod.Items.Accessories; using System.Collections.Generic; using System.Linq; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Typeless { @@ -20,7 +21,6 @@ namespace CalamityMod.Projectiles.Typeless { public new string LocalizationCategory => "Projectiles.Typeless"; public Player Owner => Main.player[Projectile.owner]; - internal PrimitiveTrail TrailRenderer; public HookState State { @@ -231,16 +231,11 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - if (TrailRenderer is null) - TrailRenderer = new PrimitiveTrail(PrimWidthFunction, PrimColorFunction); - Vector2[] segmentPositions = new Vector2[] {Projectile.Center, Owner.Center }; if (State == HookState.Grappling) segmentPositions = Owner.GetModPlayer().Segments.Select(x => x.position).ToArray(); - - TrailRenderer.Draw(segmentPositions, -Main.screenPosition, 30); - + PrimitiveSet.Prepare(new List(segmentPositions) { Owner.Center }, new(PrimWidthFunction, PrimColorFunction), 30); Texture2D texture = TextureAssets.Projectile[Type].Value; From 63649365d0fd68e5e7b53c7feb176c02658c5c40 Mon Sep 17 00:00:00 2001 From: Toasty <74939552+toasty599@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:04:05 +0000 Subject: [PATCH 13/48] Follow up to #23, Primitive System performance increase. (#24) - Increase performance via pooling, buffers, int -> short, and most linq removal. --- .../{PrimitiveSet.cs => PrimitiveRenderer.cs} | 271 +++++++++--------- NPCs/AcidRain/AcidEel.cs | 2 +- NPCs/ExoMechs/Apollo/Apollo.cs | 6 +- NPCs/ExoMechs/Ares/AresBody.cs | 16 +- NPCs/ExoMechs/Artemis/Artemis.cs | 6 +- NPCs/SupremeCalamitas/BrimstoneHeart.cs | 2 +- Projectiles/Boss/ApolloChargeTelegraph.cs | 2 +- Projectiles/Boss/AresTeslaOrb.cs | 4 +- Projectiles/Boss/ArtemisChargeTelegraph.cs | 2 +- Projectiles/Boss/ArtemisSpinLaserbeam.cs | 2 +- .../Boss/CirrusPhotonRipperPrismTooth.cs | 2 +- Projectiles/Boss/DraedonSummonLaser.cs | 2 +- Projectiles/Boss/DyingSun.cs | 2 +- Projectiles/Boss/InfernadoRevenge.cs | 2 +- .../DraedonsArsenal/PhaseslayerProjectile.cs | 2 +- .../DraedonsArsenal/SnakeEyesProjectile.cs | 2 +- Projectiles/Enemy/GammRayBurst.cs | 2 +- Projectiles/Magic/ApotheosisEnergy.cs | 2 +- Projectiles/Magic/ArtAttackStar.cs | 2 +- Projectiles/Magic/EternityHex.cs | 2 +- Projectiles/Magic/ExoVortex.cs | 2 +- Projectiles/Magic/ExoVortex2.cs | 2 +- Projectiles/Magic/FabBolt.cs | 2 +- Projectiles/Magic/FabRay.cs | 2 +- Projectiles/Magic/RainbowRocket.cs | 2 +- Projectiles/Magic/RancorLaserbeam.cs | 2 +- Projectiles/Magic/WulfrumBolt.cs | 2 +- Projectiles/Melee/EonBolt.cs | 2 +- Projectiles/Melee/Exobeam.cs | 4 +- Projectiles/Melee/ExobladeProj.cs | 6 +- Projectiles/Melee/MarniteObliteratorProj.cs | 2 +- Projectiles/Melee/PrismTooth.cs | 2 +- Projectiles/Melee/RendingNeedle.cs | 2 +- Projectiles/Melee/StygianShieldAttack.cs | 2 +- Projectiles/Melee/TaintedBladeSlasher.cs | 2 +- Projectiles/Melee/TerratomereBeam.cs | 2 +- Projectiles/Melee/TerratomereBigSlash.cs | 2 +- Projectiles/Melee/TerratomereHoldoutProj.cs | 2 +- Projectiles/Melee/ViolenceSlashProjectile.cs | 2 +- Projectiles/Melee/ViolenceThrownProjectile.cs | 2 +- Projectiles/Melee/WulfrumScrew.cs | 2 +- Projectiles/Ranged/ExoCrystalArrow.cs | 2 +- Projectiles/Ranged/ExoLightningBolt.cs | 2 +- Projectiles/Ranged/MarksmanShot.cs | 2 +- Projectiles/Ranged/MeowCreature.cs | 2 +- Projectiles/Ranged/MineralMortarProjectile.cs | 2 +- Projectiles/Ranged/PristineFire.cs | 2 +- Projectiles/Ranged/SpeedBlasterShot.cs | 2 +- Projectiles/Ranged/TelluricGlareArrow.cs | 2 +- Projectiles/Ranged/TheMaelstromShark.cs | 2 +- Projectiles/Ranged/WulfrumScrapBullet.cs | 2 +- .../Rogue/DynamicPursuerElectricity.cs | 2 +- Projectiles/Rogue/ScarletDevilProjectile.cs | 2 +- Projectiles/Rogue/StormfrontLightning.cs | 2 +- Projectiles/Rogue/WulfrumKnifeProj.cs | 2 +- .../Summon/CnidarianJellyfishOnTheString.cs | 2 +- Projectiles/Summon/CosmilampBeam.cs | 7 +- Projectiles/Summon/DaedalusLightning.cs | 2 +- .../Summon/SmallAresArms/MinionTeslaOrb.cs | 4 +- Projectiles/Summon/WulfrumDroid.cs | 2 +- Projectiles/Summon/WulfrumEnergyBurst.cs | 2 +- Projectiles/Summon/WulfrumFusionBolt.cs | 2 +- Projectiles/Typeless/GemTechArmorGem.cs | 2 +- Projectiles/Typeless/MythrilFlare.cs | 2 +- Projectiles/Typeless/SuicideBomberDemon.cs | 2 +- Projectiles/Typeless/WulfrumHook.cs | 2 +- 66 files changed, 227 insertions(+), 211 deletions(-) rename Graphics/Primitives/{PrimitiveSet.cs => PrimitiveRenderer.cs} (50%) diff --git a/Graphics/Primitives/PrimitiveSet.cs b/Graphics/Primitives/PrimitiveRenderer.cs similarity index 50% rename from Graphics/Primitives/PrimitiveSet.cs rename to Graphics/Primitives/PrimitiveRenderer.cs index a911dd3b20..1ed294efa0 100644 --- a/Graphics/Primitives/PrimitiveSet.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -9,44 +9,55 @@ using Terraria.Graphics.Shaders; namespace CalamityMod.Graphics.Primitives { /// - /// This both acts as an instanceable struct containing primitive trail data, and as a manager that creates and renders said instances.

- /// To use normally, in the draw method of an NPC or Projectile call .
+ /// This manages rendering primitives in via the provided method.

+ /// To use normally, in the draw method of an NPC or Projectile call .
/// /// The first param should be the positions to use for the trail. /// The second is a struct that allows you to choose a desired configuration of settings to use with the trail, to allow for customization. /// The third controls how many points are created for the trail, and the fourth determines whether the primitive is subsequently rendered. - /// If you do not render in , you MUST call manually on the created instance to make it actually appear. /// - /// If you wish to use pixelation, you MUST make the NPC/Projectile inherit and use instead.
+ /// If you wish to use pixelation, you MUST make the NPC/Projectile inherit and use instead of predraw..
/// You can also optionally specify a render layer with . It is by default. ///
- public readonly struct PrimitiveSet + public static class PrimitiveRenderer { - #region Instance Members - /// - /// The vertices of the set. - /// - public readonly VertexPosition2DColorTexture[] Vertices; - - /// - /// The indices of the set. - /// - public readonly int[] Indices; - - /// - /// The settings of the set. - /// - public readonly PrimitiveSettings Settings; - - private PrimitiveSet(VertexPosition2DColorTexture[] vertices, int[] indices, PrimitiveSettings settings) - { - Vertices = vertices; - Indices = indices; - Settings = settings; - } - #endregion - #region Static Members + private static DynamicVertexBuffer VertexBuffer; + + private static DynamicIndexBuffer IndexBuffer; + + private static PrimitiveSettings MainSettings; + + private static Vector2[] MainPositions; + + private static VertexPosition2DColorTexture[] MainVertices; + + private static short[] MainIndices; + + private const short MaxPositions = 1000; + + private const short MaxVertices = 3072; + + private const short MaxIndices = 8192; + + private static short PositionsIndex; + + private static short VerticesIndex; + + private static short IndicesIndex; + + static PrimitiveRenderer() + { + Main.QueueMainThreadAction(() => + { + MainPositions = new Vector2[MaxPositions]; + MainVertices = new VertexPosition2DColorTexture[MaxVertices]; + MainIndices = new short[MaxIndices]; + VertexBuffer ??= new DynamicVertexBuffer(Main.instance.GraphicsDevice, VertexPosition2DColorTexture.VertexDeclaration2D, MaxVertices, BufferUsage.WriteOnly); + IndexBuffer ??= new DynamicIndexBuffer(Main.instance.GraphicsDevice, IndexElementSize.SixteenBits, MaxIndices, BufferUsage.WriteOnly); + }); + } + private static void PerformPixelationSafetyChecks(PrimitiveSettings settings) { // Don't allow accidental screw ups with these. @@ -57,63 +68,53 @@ namespace CalamityMod.Graphics.Primitives } /// - /// Prepares a based on the provided information, and optionally renders it. + /// Renders a primitive trail. /// - /// The list of positions to use. Keep in mind that these are expected to be in world position, and is automatically subtracted from them all. + /// The list of positions to use. Keep in mind that these are expected to be in world position, and is automatically subtracted from them all.
At least 4 points are required to use smoothing. /// The primitive draw settings to use. /// The amount of points to use. More is higher detailed, but less performant. By default, is the number of positions provided. Going above 100 is NOT recommended. - /// Whether to render the set. - /// The prepared set. - public static PrimitiveSet? Prepare(IEnumerable positions, PrimitiveSettings settings, int? pointsToCreate = null, bool render = true) + public static void RenderTrail(List positions, PrimitiveSettings settings, int? pointsToCreate = null) => RenderTrail(positions.ToArray(), settings, pointsToCreate); + + /// + /// Renders a primitive trail. + /// + /// The list of positions to use. Keep in mind that these are expected to be in world position, and is automatically subtracted from them all.
At least 4 points are required to use smoothing. + /// The primitive draw settings to use. + /// The amount of points to use. More is higher detailed, but less performant. By default, is the number of positions provided. Going above 100 is NOT recommended. + public static void RenderTrail(Vector2[] positions, PrimitiveSettings settings, int? pointsToCreate = null) { PerformPixelationSafetyChecks(settings); - int positionCount = positions.Count(); - // Return if not enough to draw anything. - if (positionCount <= 2) - return null; + if (positions.Length <= 2) + return; - // Cull out any zeroed points. - positions = positions.Where(p => p != Vector2.Zero); - List trailPoints = PreparePointsRectangleTrail(positions, settings, pointsToCreate ?? positionCount).ToList(); + // Return if too many to draw anything, + if (positions.Length >= MaxPositions) + return; + + // IF this is false, a correct position trail could not be made and rendering should not continue. + if (!AssignPointsRectangleTrail(positions, settings, pointsToCreate ?? positions.Length)) + return; // A trail with only one point or less has nothing to connect to, and therefore, can't make a trail. - if (trailPoints.Count <= 2) - return null; + if (MainPositions.Length <= 2) + return; - // If the trail point has any NaN positions, don't draw anything. - if (trailPoints.Any(point => point.HasNaNs())) - return null; + MainSettings = settings; - // If the trail points are all equal, don't draw anything. - if (trailPoints.All(point => point == trailPoints[0])) - return null; + AssignVerticesRectangleTrail(); + AssignIndicesRectangleTrail(); - IEnumerable vertices = CreateVerticesRectangleTrail(trailPoints.ToList(), settings); - int[] indices = CreateIndicesRectangleTrail(trailPoints.Count); - - // Create the set, and just return it if not asked to render. - PrimitiveSet set = new(vertices.ToArray(), indices, settings); - if (!render) - return set; - - // Else render the set and return it. - return set.Render(); + // Else render without wasting resources creating a set. + PrivateRender(); + return; } - #endregion - #region Instance Methods - /// - /// Renders the provided primitive set to the screen. - /// - /// The provided set. - public PrimitiveSet Render() + private static void PrivateRender() { - PerformPixelationSafetyChecks(Settings); - - if (Indices.Length % 6 != 0 || Vertices.Length <= 3) - return this; + if (IndicesIndex % 6 != 0 || VerticesIndex <= 3) + return; // Perform screen culling, for performance reasons. Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone; @@ -122,65 +123,73 @@ namespace CalamityMod.Graphics.Primitives Matrix view; Matrix projection; - if (Settings.Pixelate) + if (MainSettings.Pixelate) CalcuatePixelatedPerspectiveMatrices(out view, out projection); else CalamityUtils.CalculatePerspectiveMatricies(out view, out projection); - var shaderToUse = Settings.Shader ?? GameShaders.Misc["CalamityMod:StandardPrimitiveShader"]; + var shaderToUse = MainSettings.Shader ?? GameShaders.Misc["CalamityMod:StandardPrimitiveShader"]; shaderToUse.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection); shaderToUse.Apply(); - // Render the set. - Main.instance.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Vertices, 0, Vertices.Length, Indices, 0, Indices.Length / 3); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - return this; + VertexBuffer.SetData(MainVertices, 0, VerticesIndex, SetDataOptions.Discard); + IndexBuffer.SetData(MainIndices, 0, IndicesIndex, SetDataOptions.Discard); + + Main.instance.GraphicsDevice.SetVertexBuffer(VertexBuffer); + Main.instance.GraphicsDevice.Indices = IndexBuffer; + Main.instance.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, VerticesIndex, 0, IndicesIndex / 3); } #endregion #region Set Preperation - private static IEnumerable PreparePointsRectangleTrail(IEnumerable positions, PrimitiveSettings settings, int pointsToCreate) + private static bool AssignPointsRectangleTrail(Vector2[] positions, PrimitiveSettings settings, int pointsToCreate) { // Don't smoothen the points unless explicitly told do so. if (!settings.Smoothen) { - List basePoints = positions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); - List endPoints = new(); + PositionsIndex = 0; - if (basePoints.Count <= 2) - return endPoints; + // Would like to remove this, but unsure how else to properly ensure that none are zero. + positions = positions.Where(originalPosition => originalPosition != Vector2.Zero).ToArray(); + + if (positions.Length <= 2) + return false; // Remap the original positions across a certain length. for (int i = 0; i < pointsToCreate; i++) { float completionRatio = i / (float)(pointsToCreate - 1f); - int currentIndex = (int)(completionRatio * (basePoints.Count - 1)); - Vector2 currentPoint = basePoints[currentIndex]; - Vector2 nextPoint = basePoints[(currentIndex + 1) % basePoints.Count]; - endPoints.Add(Vector2.Lerp(currentPoint, nextPoint, completionRatio * (basePoints.Count - 1) % 0.99999f) - Main.screenPosition); + int currentIndex = (int)(completionRatio * (positions.Length - 1)); + Vector2 currentPoint = positions[currentIndex]; + Vector2 nextPoint = positions[(currentIndex + 1) % positions.Length]; + MainPositions[PositionsIndex] = Vector2.Lerp(currentPoint, nextPoint, completionRatio * (positions.Length - 1) % 0.99999f) - Main.screenPosition; + PositionsIndex++; } - return endPoints; + return true; } + // Due to the first point being manually added, points should be added starting at the second position instead of the first. + PositionsIndex = 1; + + // Create the control points for the spline. List controlPoints = new(); - for (int i = 0; i < positions.Count(); i++) + for (int i = 0; i < positions.Length; i++) { // Don't incorporate points that are zeroed out. // They are almost certainly a result of incomplete oldPos arrays. - if (positions.ElementAt(i) == Vector2.Zero) + if (positions[i] == Vector2.Zero) continue; - float completionRatio = i / (float)positions.Count(); + float completionRatio = i / (float)positions.Length; Vector2 offset = -Main.screenPosition; if (settings.OffsetFunction != null) offset += settings.OffsetFunction(completionRatio); - controlPoints.Add(positions.ElementAt(i) + offset); + controlPoints.Add(positions[i] + offset); } - List points = new(); // Avoid stupid index errors. if (controlPoints.Count <= 4) - return controlPoints; + return false; for (int j = 0; j < pointsToCreate; j++) { @@ -211,27 +220,27 @@ namespace CalamityMod.Graphics.Primitives else farRight = controlPoints[localSplineIndex + 2]; - points.Add(Vector2.CatmullRom(farLeft, left, right, farRight, localSplineInterpolant)); + MainPositions[PositionsIndex] = Vector2.CatmullRom(farLeft, left, right, farRight, localSplineInterpolant); + PositionsIndex++; } // Manually insert the front and end points. - points.Insert(0, controlPoints.First()); - points.Add(controlPoints.Last()); - - return points; + MainPositions[0] = controlPoints.First(); + MainPositions[PositionsIndex] = controlPoints.Last(); + PositionsIndex++; + return true; } - private static IEnumerable CreateVerticesRectangleTrail(List positions, PrimitiveSettings settings) + private static void AssignVerticesRectangleTrail() { - List vertices = new(); - - for (int i = 0; i < positions.Count; i++) + VerticesIndex = 0; + for (int i = 0; i < PositionsIndex; i++) { - float completionRatio = i / (float)(positions.Count - 1); - float widthAtVertex = settings.WidthFunction(completionRatio); - Color vertexColor = settings.ColorFunction(completionRatio); - Vector2 currentPosition = positions[i]; - Vector2 directionToAhead = i == positions.Count - 1 ? (positions[i] - positions[i - 1]).SafeNormalize(Vector2.Zero) : (positions[i + 1] - positions[i]).SafeNormalize(Vector2.Zero); + float completionRatio = i / (float)(PositionsIndex - 1); + float widthAtVertex = MainSettings.WidthFunction(completionRatio); + Color vertexColor = MainSettings.ColorFunction(completionRatio); + Vector2 currentPosition = MainPositions[i]; + Vector2 directionToAhead = i == PositionsIndex - 1 ? (MainPositions[i] - MainPositions[i - 1]).SafeNormalize(Vector2.Zero) : (MainPositions[i + 1] - MainPositions[i]).SafeNormalize(Vector2.Zero); Vector2 leftCurrentTextureCoord = new(completionRatio, 0f); Vector2 rightCurrentTextureCoord = new(completionRatio, 1f); @@ -244,45 +253,51 @@ namespace CalamityMod.Graphics.Primitives Vector2 right = currentPosition + sideDirection * widthAtVertex; // Override the initial vertex positions if requested. - if (i == 0 && settings.InitialVertexPositionsOverride.HasValue && settings.InitialVertexPositionsOverride.Value.Item1 != Vector2.Zero && settings.InitialVertexPositionsOverride.Value.Item2 != Vector2.Zero) + if (i == 0 && MainSettings.InitialVertexPositionsOverride.HasValue && MainSettings.InitialVertexPositionsOverride.Value.Item1 != Vector2.Zero && MainSettings.InitialVertexPositionsOverride.Value.Item2 != Vector2.Zero) { - left = settings.InitialVertexPositionsOverride.Value.Item1; - right = settings.InitialVertexPositionsOverride.Value.Item2; + left = MainSettings.InitialVertexPositionsOverride.Value.Item1; + right = MainSettings.InitialVertexPositionsOverride.Value.Item2; } // What this is doing, at its core, is defining a rectangle based on two triangles. // These triangles are defined based on the width of the strip at that point. // The resulting rectangles combined are what make the trail itself. - vertices.Add(new VertexPosition2DColorTexture(left, vertexColor, leftCurrentTextureCoord)); - vertices.Add(new VertexPosition2DColorTexture(right, vertexColor, rightCurrentTextureCoord)); + MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(left, vertexColor, leftCurrentTextureCoord); + VerticesIndex++; + MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(right, vertexColor, rightCurrentTextureCoord); + VerticesIndex++; } - - return vertices; } - private static int[] CreateIndicesRectangleTrail(int pointCount) + private static void AssignIndicesRectangleTrail() { // What this is doing is basically representing each point on the vertices list as // indices. These indices should come together to create a tiny rectangle that acts // as a segment on the trail. This is achieved here by splitting the indices (or rather, points) // into 2 triangles, which requires 6 points. // The logic here basically determines which indices are connected together. - int totalIndices = (pointCount - 1) * 6; - int[] indices = new int[totalIndices]; - - for (int i = 0; i < pointCount - 2; i++) + IndicesIndex = 0; + for (short i = 0; i < PositionsIndex - 2; i++) { - int startingTriangleIndex = i * 6; - int connectToIndex = i * 2; - indices[startingTriangleIndex] = connectToIndex; - indices[startingTriangleIndex + 1] = connectToIndex + 1; - indices[startingTriangleIndex + 2] = connectToIndex + 2; - indices[startingTriangleIndex + 3] = connectToIndex + 2; - indices[startingTriangleIndex + 4] = connectToIndex + 1; - indices[startingTriangleIndex + 5] = connectToIndex + 3; - } + short connectToIndex = (short)(i * 2); + MainIndices[IndicesIndex] = connectToIndex; + IndicesIndex++; - return indices; + MainIndices[IndicesIndex] = (short)(connectToIndex + 1); + IndicesIndex++; + + MainIndices[IndicesIndex] = (short)(connectToIndex + 2); + IndicesIndex++; + + MainIndices[IndicesIndex] = (short)(connectToIndex + 2); + IndicesIndex++; + + MainIndices[IndicesIndex] = (short)(connectToIndex + 1); + IndicesIndex++; + + MainIndices[IndicesIndex] = (short)(connectToIndex + 3); + IndicesIndex++; + } } private static void CalcuatePixelatedPerspectiveMatrices(out Matrix viewMatrix, out Matrix projectionMatrix) diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index f724c32fa1..b4245e62ea 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.AcidRain Vector2 tailDrawPosition = segmentPositions[^1] - tailRotation.ToRotationVector2() * 4f; SpriteEffects tailDirection = NPC.velocity.X < 0f ? SpriteEffects.None : SpriteEffects.FlipVertically; Main.EntitySpriteDraw(tailTexture, tailDrawPosition, tailArea, NPC.GetAlpha(Color.White), tailRotation, tailArea.Size() * new Vector2(0f, 0.5f), NPC.scale, tailDirection, 0); - PrimitiveSet.Prepare(segmentPositions, new(SegmentWidthFunction, _ => NPC.GetAlpha(Color.White), pixelate: false, shader: GameShaders.Misc["CalamityMod:PrimitiveTexture"]), 36); + PrimitiveRenderer.RenderTrail(segmentPositions, new(SegmentWidthFunction, _ => NPC.GetAlpha(Color.White), pixelate: false, shader: GameShaders.Misc["CalamityMod:PrimitiveTexture"]), 36); } return false; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index aa350c4a84..25d9ae45d9 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1554,7 +1554,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo currentSegmentRotation += segmentRotationOffset; } - PrimitiveSet.Prepare(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); + PrimitiveRenderer.RenderTrail(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); } int instanceCount = (int)MathHelper.Lerp(1f, 15f, ChargeComboFlash); @@ -1619,11 +1619,11 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int i = 0; i < 4; i++) { Vector2 drawOffset = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 8f; - PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); + PrimitiveRenderer.RenderTrail(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } else - PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); + PrimitiveRenderer.RenderTrail(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 2345f31467..7a7798463c 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1328,13 +1328,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.Opacity > 0f && !NPC.IsABestiaryIconDummy) { List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition + arm2Rotation.ToRotationVector2() * -direction * 20f, 250290787); - PrimitiveSet.Prepare(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); // Draw electricity between the final arm and the hand. List handElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm2DrawPosition - arm2Rotation.ToRotationVector2() * direction * 100f, handPosition, 27182); - PrimitiveSet.Prepare(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } shoulderDrawPosition += Vector2.UnitY * NPC.gfxOffY - screenOffset; @@ -1390,13 +1390,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (NPC.Opacity > 0f && !NPC.IsABestiaryIconDummy) { List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm1DrawPosition - arm2Rotation.ToRotationVector2() * direction * 10f, arm1DrawPosition + arm2Rotation.ToRotationVector2() * direction * 20f, 31416); - PrimitiveSet.Prepare(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arm2ElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arm2ElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); // Draw electricity between the final arm and the hand. List handElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm2DrawPosition - arm2Rotation.ToRotationVector2() * direction * 20f, handPosition, 27182); - PrimitiveSet.Prepare(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(handElectricArcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(handElectricArcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } shoulderDrawPosition += Vector2.UnitY * NPC.gfxOffY - screenOffset; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index b417ddd3b6..43ef3dad83 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1448,7 +1448,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis currentSegmentRotation += segmentRotationOffset; } - PrimitiveSet.Prepare(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); + PrimitiveRenderer.RenderTrail(ribbonDrawPositions, new(RibbonTrailWidthFunction, RibbonTrailColorFunction), 66); } int instanceCount = (int)MathHelper.Lerp(1f, 15f, ChargeFlash); @@ -1513,11 +1513,11 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis for (int i = 0; i < 4; i++) { Vector2 drawOffset = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 8f; - PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); + PrimitiveRenderer.RenderTrail(drawPositions, new(FlameTrailWidthFunctionBig, FlameTrailColorFunctionBig, (_) => drawOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } else - PrimitiveSet.Prepare(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); + PrimitiveRenderer.RenderTrail(drawPositions, new(FlameTrailWidthFunction, FlameTrailColorFunction, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 70); } } diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 23144ecd84..17129ee0f2 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Center, ChainEndpoints[i] + NPC.DirectionTo(ChainEndpoints[i]) * 25f }; - PrimitiveSet.Prepare(points, new(PrimitiveWidthFunction, PrimitiveColorFunction), 40); + PrimitiveRenderer.RenderTrail(points, new(PrimitiveWidthFunction, PrimitiveColorFunction), 40); } return true; diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index a5bb6afc74..125a6dd6d7 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Boss // It is not used anywhere else. Projectile.ai[0] = i; - PrimitiveSet.Prepare(positions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:Flame"]), 55); + PrimitiveRenderer.RenderTrail(positions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:Flame"]), 55); } return false; } diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 99d55c8eba..96c7223a95 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -229,8 +229,8 @@ namespace CalamityMod.Projectiles.Boss if (orbToAttachTo != null) { List arcPoints = DetermineElectricArcPoints(Projectile.Center, orbToAttachTo.Center, 117); - PrimitiveSet.Prepare(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/ArtemisChargeTelegraph.cs b/Projectiles/Boss/ArtemisChargeTelegraph.cs index fd7e3467be..8c0191b771 100644 --- a/Projectiles/Boss/ArtemisChargeTelegraph.cs +++ b/Projectiles/Boss/ArtemisChargeTelegraph.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.Center, Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitY) * TelegraphWidth }; - PrimitiveSet.Prepare(drawPositions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:Flame"]), 87); + PrimitiveRenderer.RenderTrail(drawPositions, new(TelegraphPrimitiveWidth, TelegraphPrimitiveColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:Flame"]), 87); return false; } } diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 6a55ac5076..a778ba6bb6 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss GameShaders.Misc["CalamityMod:ArtemisLaser"].UseColor(Color.Cyan); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage1("Images/Extra_189"); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage2("Images/Misc/Perlin"); - PrimitiveSet.Prepare(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); + PrimitiveRenderer.RenderTrail(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); return false; } diff --git a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs index 49bfa8f1d4..ab1abcbb1e 100644 --- a/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs +++ b/Projectiles/Boss/CirrusPhotonRipperPrismTooth.cs @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); Main.spriteBatch.ExitShaderRegion(); return true; } diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index a14e209bfc..aa3971225f 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Boss basePoints[i] = Projectile.Center - Vector2.UnitY * i / basePoints.Length * LaserLength; Vector2 overallOffset = Projectile.Size * 0.5f; - PrimitiveSet.Prepare(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); + PrimitiveRenderer.RenderTrail(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); return false; } diff --git a/Projectiles/Boss/DyingSun.cs b/Projectiles/Boss/DyingSun.cs index eaa8d6dbed..9696f6a6a6 100644 --- a/Projectiles/Boss/DyingSun.cs +++ b/Projectiles/Boss/DyingSun.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Boss rotationPoints.Add(adjustedAngle); drawPoints.Add(Vector2.Lerp(Projectile.Center - offsetDirection * Radius / 2f, Projectile.Center + offsetDirection * Radius / 2f, i / 16f)); } - PrimitiveSet.Prepare(drawPoints, new(SunWidthFunction, SunColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 24); + PrimitiveRenderer.RenderTrail(drawPoints, new(SunWidthFunction, SunColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 24); } return false; } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index aa22ca54c2..e4dab247a0 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); drawPoints[drawPoints.Length - 1] = bottom; - PrimitiveSet.Prepare(drawPoints, new((_) => Projectile.width * 0.5f + 16f, ColorFunction, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 85); + PrimitiveRenderer.RenderTrail(drawPoints, new((_) => Projectile.width * 0.5f + 16f, ColorFunction, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 85); Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; for (int i = 0; i < 110; i++) diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 3707159fce..01c8f34799 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -324,7 +324,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float angularTurn = i * swingAngularDirection * -0.09f; drawPoints[i] = Projectile.position + perpendicularDirection.RotatedBy(angularTurn) * offsetFactor; } - PrimitiveSet.Prepare(drawPoints, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + bladeOffset, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); + PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + bladeOffset, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); Main.EntitySpriteDraw(bladeTexture, Projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, Projectile.rotation + MathHelper.PiOver2, origin, Projectile.scale, SpriteEffects.None, 0); Main.EntitySpriteDraw(hiltTexture, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs index 9659a70e50..62dc95c8a0 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesProjectile.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); return false; } } diff --git a/Projectiles/Enemy/GammRayBurst.cs b/Projectiles/Enemy/GammRayBurst.cs index a4e3fe6007..ca00fcc4c4 100644 --- a/Projectiles/Enemy/GammRayBurst.cs +++ b/Projectiles/Enemy/GammRayBurst.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Enemy GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage1("Images/Extra_189"); GameShaders.Misc["CalamityMod:ArtemisLaser"].UseImage2("Images/Misc/Perlin"); - PrimitiveSet.Prepare(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); + PrimitiveRenderer.RenderTrail(baseDrawPoints, new(LaserWidthFunction, LaserColorFunction, shader: GameShaders.Misc["CalamityMod:ArtemisLaser"]), 64); return false; } diff --git a/Projectiles/Magic/ApotheosisEnergy.cs b/Projectiles/Magic/ApotheosisEnergy.cs index 3b07f3cd4f..409d2dcbf4 100644 --- a/Projectiles/Magic/ApotheosisEnergy.cs +++ b/Projectiles/Magic/ApotheosisEnergy.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 85); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 85); return false; } } diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index 5df5a7651c..b1b740d1b6 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -225,7 +225,7 @@ namespace CalamityMod.Projectiles.Magic GameShaders.Misc["CalamityMod:ArtAttack"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); GameShaders.Misc["CalamityMod:ArtAttack"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ArtAttack"]), 180); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ArtAttack"]), 180); Main.spriteBatch.ExitShaderRegion(); Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(Color.White), Projectile.rotation, origin, Projectile.scale, 0, 0); diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index 687f365e50..a8906062d9 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 84); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 84); return false; } } diff --git a/Projectiles/Magic/ExoVortex.cs b/Projectiles/Magic/ExoVortex.cs index 6c6d692ac4..0a62500f66 100644 --- a/Projectiles/Magic/ExoVortex.cs +++ b/Projectiles/Magic/ExoVortex.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Magic // Draw the streak trail. GameShaders.Misc["CalamityMod:SideStreakTrail"].UseImage1("Images/Misc/Perlin"); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); Main.spriteBatch.EnterShaderRegion(BlendState.Additive); GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); diff --git a/Projectiles/Magic/ExoVortex2.cs b/Projectiles/Magic/ExoVortex2.cs index 709bc151f2..e9a5505221 100644 --- a/Projectiles/Magic/ExoVortex2.cs +++ b/Projectiles/Magic/ExoVortex2.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Magic // Draw the streak trail. GameShaders.Misc["CalamityMod:SideStreakTrail"].UseImage1("Images/Misc/Perlin"); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveTrailColor, PrimitiveOffsetFunction, shader: GameShaders.Misc["CalamityMod:SideStreakTrail"]), 51); Main.spriteBatch.EnterShaderRegion(BlendState.Additive); GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index aaa9f19de2..0c2fe68207 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 80); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, smoothen: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 80); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index a8549dc517..2613214198 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new PrimitiveSettings(WidthFunction, ColorFunction, OffsetFunction, pixelate: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 32); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new PrimitiveSettings(WidthFunction, ColorFunction, OffsetFunction, pixelate: false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 32); return false; } diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index 5f877720b9..47fc617a81 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { Projectile.oldPos[0] = Projectile.position + Projectile.velocity.SafeNormalize(Vector2.Zero) * 50f; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity), 80); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity), 80); Texture2D rocketTexture = ModContent.Request(Texture).Value; Main.EntitySpriteDraw(rocketTexture, diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 8730747df1..023978211a 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < basePoints.Length; i++) basePoints[i] = Projectile.Center + Projectile.velocity * i / (basePoints.Length - 1f) * LaserLength; - PrimitiveSet.Prepare(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); + PrimitiveRenderer.RenderTrail(basePoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, shader: GameShaders.Misc["CalamityMod:Flame"]), 92); return false; } diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index 348177d500..cfc61cf935 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -197,7 +197,7 @@ namespace CalamityMod.Projectiles.Magic { PrimColorMult = colorMod; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Melee/EonBolt.cs b/Projectiles/Melee/EonBolt.cs index d1ddcad5d6..7dfa68a3c0 100644 --- a/Projectiles/Melee/EonBolt.cs +++ b/Projectiles/Melee/EonBolt.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Texture2D texture = Request("CalamityMod/Projectiles/Melee/GalaxiaBolt").Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, 0.5f), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 7c8c37c4a7..c7d6d046fd 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -171,12 +171,12 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(Color.White); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(Color.White); - PrimitiveSet.Prepare(Projectile.oldPos, new(MiniTrailWidth, MiniTrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(MiniTrailWidth, MiniTrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); Main.spriteBatch.ExitShaderRegion(); diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index e0be4a3565..9084d6c121 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -432,7 +432,7 @@ namespace CalamityMod.Projectiles.Melee public Color PierceColorFunction(float completionRatio) => Color.Lime * Projectile.Opacity; //The trail color doesnt matter here - public IEnumerable GenerateSlashPoints() + public List GenerateSlashPoints() { List result = new(); @@ -473,7 +473,7 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladeSlash"].Shader.Parameters["flipped"].SetValue(Direction == 1); GameShaders.Misc["CalamityMod:ExobladeSlash"].Apply(); - PrimitiveSet.Prepare(GenerateSlashPoints(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); + PrimitiveRenderer.RenderTrail(GenerateSlashPoints(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); Main.spriteBatch.ExitShaderRegion(); } @@ -498,7 +498,7 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(mainColor); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:ExobladePierce"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos.Take(51), new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 53); + PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(51).ToArray(), new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 53); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index a151620d7d..bf20de65ad 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(bloomTex, Projectile.Center - Main.screenPosition, null, Color.DeepSkyBlue * 0.3f, MathHelper.PiOver2, bloomTex.Size() / 2f, 0.3f * Projectile.scale, SpriteEffects.None, 0); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/DoubleTrail")); - PrimitiveSet.Prepare(new Vector2[] { Projectile.Center, Owner.MountedCenter - normalizedVelocity * 13f }, new(WidthFunction, ColorFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(new Vector2[] { Projectile.Center, Owner.MountedCenter - normalizedVelocity * 13f }, new(WidthFunction, ColorFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index fb8c3375b6..0974f059dd 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); Main.spriteBatch.ExitShaderRegion(); return true; } diff --git a/Projectiles/Melee/RendingNeedle.cs b/Projectiles/Melee/RendingNeedle.cs index b898c7ee36..1123b48b69 100644 --- a/Projectiles/Melee/RendingNeedle.cs +++ b/Projectiles/Melee/RendingNeedle.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee Texture2D texture = Request("CalamityMod/Projectiles/Melee/RendingNeedle").Value; GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, OffsetFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, OffsetFunction, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, 0.5f), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 54a1ef52a0..57cdbaf87d 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -222,7 +222,7 @@ namespace CalamityMod.Projectiles.Melee // Main trail GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + extraOffset + Main.screenPosition - direction * 80f, + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + extraOffset + Main.screenPosition - direction * 80f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 10); ArrowEffect.Parameters["halfSpreadAngle"].SetValue(MathHelper.ToRadians(7.5f)); diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 95cecc3c2c..ee548fb87e 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -262,7 +262,7 @@ namespace CalamityMod.Projectiles.Melee if (Owner.direction == -1) Utils.Swap(ref leftVertexPosition, ref rightVertexPosition); - PrimitiveSet.Prepare(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => BladeCenterPosition - Projectile.position, + PrimitiveRenderer.RenderTrail(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => BladeCenterPosition - Projectile.position, shader: GameShaders.Misc["CalamityMod:FadingSolidTrail"], initialVertexPositionsOverride: (leftVertexPosition, rightVertexPosition)), 67); } diff --git a/Projectiles/Melee/TerratomereBeam.cs b/Projectiles/Melee/TerratomereBeam.cs index 3f247b6ddb..98e28883c2 100644 --- a/Projectiles/Melee/TerratomereBeam.cs +++ b/Projectiles/Melee/TerratomereBeam.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee points.Add(ControlPoints[i] + ControlPoints[i].SafeNormalize(Vector2.Zero) * (Projectile.scale - 1f) * 40f); for (int i = 0; i < 3; i++) - PrimitiveSet.Prepare(points, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 65); + PrimitiveRenderer.RenderTrail(points, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 65); Main.spriteBatch.ExitShaderRegion(); return false; diff --git a/Projectiles/Melee/TerratomereBigSlash.cs b/Projectiles/Melee/TerratomereBigSlash.cs index 641f0fb86c..7f1ccc9d30 100644 --- a/Projectiles/Melee/TerratomereBigSlash.cs +++ b/Projectiles/Melee/TerratomereBigSlash.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(Terratomere.TerraColor2); for (int i = 0; i < 4; i++) - PrimitiveSet.Prepare(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); return false; } diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 8790e3996c..5dee9fcaec 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Melee PrepareSlashShader(Direction == 1); if (SwingCompletionAtStartOfTrail > SwingCompletionRatio) - PrimitiveSet.Prepare(GenerateSlashPoints(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); + PrimitiveRenderer.RenderTrail(GenerateSlashPoints().ToArray(), new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 95); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/ViolenceSlashProjectile.cs b/Projectiles/Melee/ViolenceSlashProjectile.cs index 89736bbf14..9158e821fd 100644 --- a/Projectiles/Melee/ViolenceSlashProjectile.cs +++ b/Projectiles/Melee/ViolenceSlashProjectile.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee positions.Add(position); } - PrimitiveSet.Prepare(positions, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); + PrimitiveRenderer.RenderTrail(positions, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]), 50); return true; } } diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index da80a0724f..8900e7f882 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee drawPoints[i] -= (Projectile.oldRot[i] + MathHelper.PiOver4).ToRotationVector2() * Projectile.height * 0.5f; if (Time > Projectile.oldPos.Length) - PrimitiveSet.Prepare(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 88); + PrimitiveRenderer.RenderTrail(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 88); Vector2 drawPosition = Projectile.Center - Main.screenPosition; for (int i = 0; i < 6; i++) diff --git a/Projectiles/Melee/WulfrumScrew.cs b/Projectiles/Melee/WulfrumScrew.cs index d497a35f4c..4487c854a8 100644 --- a/Projectiles/Melee/WulfrumScrew.cs +++ b/Projectiles/Melee/WulfrumScrew.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Melee CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); //Draw the screw with chroma abberation diff --git a/Projectiles/Ranged/ExoCrystalArrow.cs b/Projectiles/Ranged/ExoCrystalArrow.cs index f795becc29..790353c8c0 100644 --- a/Projectiles/Ranged/ExoCrystalArrow.cs +++ b/Projectiles/Ranged/ExoCrystalArrow.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Ranged GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseColor(mainColor); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"]), 53); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"]), 53); Texture2D tex = ModContent.Request(Texture).Value; Vector2 origin = tex.Size() * 0.5f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; diff --git a/Projectiles/Ranged/ExoLightningBolt.cs b/Projectiles/Ranged/ExoLightningBolt.cs index 307fb9d459..4d1bc1e6f0 100644 --- a/Projectiles/Ranged/ExoLightningBolt.cs +++ b/Projectiles/Ranged/ExoLightningBolt.cs @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Ranged GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]), 18); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]), 18); return false; } diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index b4048dfc0c..5afea94f6a 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -213,7 +213,7 @@ namespace CalamityMod.Projectiles.Ranged return false; GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - PrimitiveSet.Prepare(trailPositions, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), trailLength); + PrimitiveRenderer.RenderTrail(trailPositions, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), trailLength); return false; } diff --git a/Projectiles/Ranged/MeowCreature.cs b/Projectiles/Ranged/MeowCreature.cs index 3daeb2a679..c86d636e43 100644 --- a/Projectiles/Ranged/MeowCreature.cs +++ b/Projectiles/Ranged/MeowCreature.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged // The creature glows public override void PostDraw(Color lightColor) { - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 30); Texture2D glow = ModContent.Request(Texture).Value; Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); } diff --git a/Projectiles/Ranged/MineralMortarProjectile.cs b/Projectiles/Ranged/MineralMortarProjectile.cs index b21bc0299c..6d9d685dfd 100644 --- a/Projectiles/Ranged/MineralMortarProjectile.cs +++ b/Projectiles/Ranged/MineralMortarProjectile.cs @@ -178,7 +178,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 origin = texture.Size() * 0.5f; GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture")); - PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidthFunction, ColorTrailFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 50); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidthFunction, ColorTrailFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 50); if (CalamityConfig.Instance.Afterimages) { for (int i = 0; i < 3; i++) diff --git a/Projectiles/Ranged/PristineFire.cs b/Projectiles/Ranged/PristineFire.cs index 7ac5652133..e2e3d4705d 100644 --- a/Projectiles/Ranged/PristineFire.cs +++ b/Projectiles/Ranged/PristineFire.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 sinOffset = (Vector2.UnitY * direction * MathF.Sin(i * MathHelper.Pi * 0.125f) * 24f).RotatedBy(Projectile.oldRot[i]); trailPositions.Add(Projectile.oldPos[i] + sinOffset); } - PrimitiveSet.Prepare(trailPositions, new(HelixTrailWidthFunction, HelixTrailColorFunction, (_) => Projectile.Size * 0.5f), 60); + PrimitiveRenderer.RenderTrail(trailPositions, new(HelixTrailWidthFunction, HelixTrailColorFunction, (_) => Projectile.Size * 0.5f), 60); } return false; } diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs index 0a3cfc47dc..92f322dfa0 100644 --- a/Projectiles/Ranged/SpeedBlasterShot.cs +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Ranged internal Color ColorFunction(float completionRatio) => GetColor(Projectile.ai[0]) * Projectile.Opacity; public override bool PreDraw(ref Color lightColor) { - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 20); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f), 20); return true; } } diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index 2dab8db792..cdb20f40e5 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/FabstaffStreak")); Vector2 overallOffset = Projectile.Size * 0.5f; overallOffset += Projectile.velocity * 1.4f; - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => overallOffset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 92); return false; } diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index 95392e0182..d560c6a9c5 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 60); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 60); Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } diff --git a/Projectiles/Ranged/WulfrumScrapBullet.cs b/Projectiles/Ranged/WulfrumScrapBullet.cs index fd26a60f77..09cfa52d89 100644 --- a/Projectiles/Ranged/WulfrumScrapBullet.cs +++ b/Projectiles/Ranged/WulfrumScrapBullet.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); return false; } } diff --git a/Projectiles/Rogue/DynamicPursuerElectricity.cs b/Projectiles/Rogue/DynamicPursuerElectricity.cs index 307247065f..c684cf4d79 100644 --- a/Projectiles/Rogue/DynamicPursuerElectricity.cs +++ b/Projectiles/Rogue/DynamicPursuerElectricity.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool PreDraw(ref Color lightColor) { - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); return false; } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 68bfa13cb7..6f47f1ddfd 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Rogue else { GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, false, + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, false, shader: GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]), 60); Texture2D spearTexture = ModContent.Request(Texture).Value; diff --git a/Projectiles/Rogue/StormfrontLightning.cs b/Projectiles/Rogue/StormfrontLightning.cs index 562e292843..6c1b3236d3 100644 --- a/Projectiles/Rogue/StormfrontLightning.cs +++ b/Projectiles/Rogue/StormfrontLightning.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].UseImage1("Images/Misc/Perlin"); GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"].Apply(); - PrimitiveSet.Prepare(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.3f, false, + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.3f, false, shader: GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"]), 10); return false; } diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 00e1882c66..205b90da10 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Rogue CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index 571e684ea6..362bf33118 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -239,7 +239,7 @@ namespace CalamityMod.Projectiles.Summon { Vector2[] segmentPositions = Segments.Select(x => x.position).ToArray(); - PrimitiveSet.Prepare(segmentPositions, new(PrimWidthFunction, PrimColorFunction), 66); + PrimitiveRenderer.RenderTrail(segmentPositions, new(PrimWidthFunction, PrimColorFunction), 66); Texture2D tex = Request(Texture).Value; diff --git a/Projectiles/Summon/CosmilampBeam.cs b/Projectiles/Summon/CosmilampBeam.cs index 8ca0f13065..87ad061d9c 100644 --- a/Projectiles/Summon/CosmilampBeam.cs +++ b/Projectiles/Summon/CosmilampBeam.cs @@ -107,11 +107,12 @@ namespace CalamityMod.Projectiles.Summon { Projectile.localAI[0] = 0f; GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - var primSet = PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 42); + var settings = new PrimitiveSettings(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, settings, 42); Projectile.localAI[0] = 1f; - if (primSet.HasValue) - primSet.Value.Render(); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, settings, 42); + return false; } } diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index 1528615ff5..42fbd834b3 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Summon } public override bool PreDraw(ref Color lightColor) { - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f, false), 90); return false; } #endregion diff --git a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs index 5c371e9c66..566685e222 100644 --- a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs +++ b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs @@ -114,8 +114,8 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms if (orbToAttachTo != null) { List arcPoints = AresTeslaOrb.DetermineElectricArcPoints(Projectile.Center, orbToAttachTo.Center, 117); - PrimitiveSet.Prepare(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); - PrimitiveSet.Prepare(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arcPoints, new(BackgroundWidthFunction, BackgroundColorFunction, smoothen: false), 90); + PrimitiveRenderer.RenderTrail(arcPoints, new(WidthFunction, ColorFunction, smoothen: false), 90); } lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 00290cc4f6..b603524057 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -471,7 +471,7 @@ namespace CalamityMod.Projectiles.Summon CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1.8f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveSet.Prepare(drawPos, new(WidthFunction, ColorFunction, (_) => offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(drawPos, new(WidthFunction, ColorFunction, (_) => offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Summon/WulfrumEnergyBurst.cs b/Projectiles/Summon/WulfrumEnergyBurst.cs index 406b4e6c84..3a042342ef 100644 --- a/Projectiles/Summon/WulfrumEnergyBurst.cs +++ b/Projectiles/Summon/WulfrumEnergyBurst.cs @@ -185,7 +185,7 @@ namespace CalamityMod.Projectiles.Summon CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1.5f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Summon/WulfrumFusionBolt.cs b/Projectiles/Summon/WulfrumFusionBolt.cs index ac265cc5fa..1208dce2db 100644 --- a/Projectiles/Summon/WulfrumFusionBolt.cs +++ b/Projectiles/Summon/WulfrumFusionBolt.cs @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Summon { PrimColorMult = colorMod; - PrimitiveSet.Prepare(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); Main.spriteBatch.End(); diff --git a/Projectiles/Typeless/GemTechArmorGem.cs b/Projectiles/Typeless/GemTechArmorGem.cs index ff4bf52fc6..28d9652699 100644 --- a/Projectiles/Typeless/GemTechArmorGem.cs +++ b/Projectiles/Typeless/GemTechArmorGem.cs @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Typeless Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(Color.White), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); if (Projectile.ai[0] > UpwardFlyTime + RedirectTime) - PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 71); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 71); return false; } diff --git a/Projectiles/Typeless/MythrilFlare.cs b/Projectiles/Typeless/MythrilFlare.cs index 0978506c57..56ebc10890 100644 --- a/Projectiles/Typeless/MythrilFlare.cs +++ b/Projectiles/Typeless/MythrilFlare.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Typeless { // Prepare the flame trail shader with its map texture. GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/EternityStreak")); - PrimitiveSet.Prepare(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 74); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 74); return false; } diff --git a/Projectiles/Typeless/SuicideBomberDemon.cs b/Projectiles/Typeless/SuicideBomberDemon.cs index b409412ca0..909fa94286 100644 --- a/Projectiles/Typeless/SuicideBomberDemon.cs +++ b/Projectiles/Typeless/SuicideBomberDemon.cs @@ -264,7 +264,7 @@ namespace CalamityMod.Projectiles.Typeless Vector2 trailOffset = Projectile.Size * 0.5f; trailOffset += (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 20f; - PrimitiveSet.Prepare(Projectile.oldPos, new(FlameTrailWidthFunction, FlameTrailColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 61); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FlameTrailWidthFunction, FlameTrailColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"]), 61); } Main.spriteBatch.ExitShaderRegion(); diff --git a/Projectiles/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index cdc008c50b..ec8940faf4 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Typeless if (State == HookState.Grappling) segmentPositions = Owner.GetModPlayer().Segments.Select(x => x.position).ToArray(); - PrimitiveSet.Prepare(new List(segmentPositions) { Owner.Center }, new(PrimWidthFunction, PrimColorFunction), 30); + PrimitiveRenderer.RenderTrail(new List(segmentPositions) { Owner.Center }, new(PrimWidthFunction, PrimColorFunction, smoothen: State is HookState.Grappling), 30); Texture2D texture = TextureAssets.Projectile[Type].Value; From a0e10c0493346009d2deb73fbc83fa21f015ebbe Mon Sep 17 00:00:00 2001 From: Dominic Karma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 3 Mar 2024 19:33:44 -0600 Subject: [PATCH 14/48] Fixing Primitive Width Function Distortions (#25) * Change width storage definitions * Update primitive shaders --- Effects/ArtAttackTrail.fx | 14 ++++++++------ Effects/ArtAttackTrail.xnb | Bin 2820 -> 2884 bytes Effects/ArtemisLaserShader.fx | 10 ++++++---- Effects/ArtemisLaserShader.xnb | Bin 3492 -> 3552 bytes Effects/BasicPrimitiveShader.fx | 7 +++---- Effects/BasicPrimitiveShader.xnb | Bin 2020 -> 2020 bytes Effects/BordernadoFire.fx | 8 +++++--- Effects/BordernadoFire.xnb | Bin 3168 -> 3228 bytes Effects/Dyes/PrismaticRayShader.fx | 9 ++++++--- Effects/Dyes/PrismaticRayShader.xnb | Bin 3128 -> 3128 bytes Effects/ExobladePierceShader.fx | 8 ++++++-- Effects/ExobladePierceShader.xnb | Bin 3584 -> 3672 bytes Effects/ExobladeSlashShader.fx | 15 +++++++++------ Effects/ExobladeSlashShader.xnb | Bin 3888 -> 3836 bytes Effects/FadedUVMapStreak.fx | 9 ++++++--- Effects/FadedUVMapStreak.xnb | Bin 2916 -> 2976 bytes Effects/FadingSolidTrail.fx | 11 +++++++---- Effects/FadingSolidTrail.xnb | Bin 2660 -> 2708 bytes Effects/Flame.fx | 8 +++++--- Effects/Flame.xnb | Bin 3272 -> 3344 bytes Effects/HeavenlyGaleLightningShader.fx | 9 ++++++--- Effects/HeavenlyGaleLightningShader.xnb | Bin 2648 -> 2696 bytes Effects/HeavenlyGaleTrailShader.fx | 9 ++++++--- Effects/HeavenlyGaleTrailShader.xnb | Bin 3724 -> 3812 bytes Effects/ImpFlameTrail.fx | 11 +++++++---- Effects/ImpFlameTrail.xnb | Bin 2848 -> 2884 bytes Effects/PhaseslayerRipShader.fx | 11 +++++++---- Effects/PhaseslayerRipShader.xnb | Bin 2192 -> 2252 bytes Effects/PrimTextureOverlayShader.fx | 17 +++++++++++------ Effects/PrimTextureOverlayShader.xnb | Bin 2796 -> 2832 bytes Effects/PrimitiveClearShader.fx | 15 ++++++++++----- Effects/PrimitiveClearShader.xnb | Bin 1176 -> 1260 bytes Effects/PrismCrystalStreak.fx | 10 ++++++---- Effects/PrismCrystalStreak.xnb | Bin 2988 -> 3048 bytes Effects/ScarletDevilStreak.fx | 10 ++++++---- Effects/ScarletDevilStreak.xnb | Bin 2988 -> 3048 bytes Effects/SideStreakTrail.fx | 15 +++++++++------ Effects/SideStreakTrail.xnb | Bin 3360 -> 3348 bytes Effects/StandardPrimitiveShader.fx | 5 ++--- Effects/StandardPrimitiveShader.xnb | Bin 2024 -> 2024 bytes Graphics/Primitives/PrimitiveRenderer.cs | 11 +++++------ .../VertexPosition2DColorTexture.cs | 11 +++++++---- 42 files changed, 143 insertions(+), 90 deletions(-) diff --git a/Effects/ArtAttackTrail.fx b/Effects/ArtAttackTrail.fx index b91dddd7ce..9580d97725 100644 --- a/Effects/ArtAttackTrail.fx +++ b/Effects/ArtAttackTrail.fx @@ -20,22 +20,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -52,6 +51,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + // Read the fade map as a streak. float4 fadeMapColor = tex2D(uImage1, coords - float2(uTime * 0.6, 0)); float opacity = fadeMapColor.r; @@ -63,7 +65,7 @@ technique Technique1 { pass TrailPass { - VertexShader = compile vs_2_0 VertexShaderFunction(); - PixelShader = compile ps_2_0 PixelShaderFunction(); + VertexShader = compile vs_3_0 VertexShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } diff --git a/Effects/ArtAttackTrail.xnb b/Effects/ArtAttackTrail.xnb index 8c6d6b95d4e5a63e6f2539e0dcb92144fe48cb54..fae13d42ef8e8f251459cc54dceefc3887b75df7 100644 GIT binary patch delta 639 zcmYLGJxjw-6umb|le9|^rIaFwgZKlggNwG+MF&5?Ko=MPKsR;E6Z`=w+5EtWxMY*; z+QG%GdmS=ladvQPJohEkkO%jickX%T-FMUcXgY(#{$-8#M$QA@k6vzhn0EP&`7HV} zw#?UGJ8hXQvwdX}ky#Y8VwHAJd;Mj=BP=qb1G~qa=(w?wj_n}_?;v-u)cN{F_k^fs zkQYDy6x+g2z0dB{+aC*Wg70)v(aygWBBOy`A}^G>hMLLIHAEr1UTok{A_h+}lONj9 z;RjAaivqF)K#b*s^kWe6YYZg}{CH6}374q<{X`j*V84jhu+Q2jQ3!zpE%8z)V!=$F z?j_1Y1ThR^V0z*}1DyuxB$-YcmZ@!sCOBlGN>kkg7as089<_w_-Qf7btNq zKG5gaIv6haU|EJUzOun2;e#7YZA@E}DRt*y1p2^JA7E~Hb$lVEdc z4uaZ5`e8Wub zPf?OY)XU4fT&(L@yx`}B ztEl0m#+Rf$Mqx_(HbBAzp$x&K8+p1}kQkZ90TDqnI@d*l@;Ikhpz%~ANa-4_LE!dw zGO$umPL{%&=5>fjjMe;DZT!B@ojw)qk8Fzz?UR{WJ!`JceLW2#Ot3H*ohH~aSo~t! UV13Qxw>kr8gCv(<&;@#qA5&|Az5oCK diff --git a/Effects/ArtemisLaserShader.fx b/Effects/ArtemisLaserShader.fx index d642d6197f..9c814be75f 100644 --- a/Effects/ArtemisLaserShader.fx +++ b/Effects/ArtemisLaserShader.fx @@ -21,22 +21,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -55,6 +54,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + // Read the fade map as a streak. float bloomFadeout = pow(sin(coords.y * 3.141), 4); float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x * 20 - uTime * 5.5), coords.y)); diff --git a/Effects/ArtemisLaserShader.xnb b/Effects/ArtemisLaserShader.xnb index 5440f33bfb7c36e637a51cb37e3bfaaab8d7c9df..af315e0e31dca0047ba8137d7ea81856d8827e3b 100644 GIT binary patch delta 638 zcmZWlJxc>o5S)Fv%OwU$VI!u{Mgm%h*rd`VU||ywJV+s0YpYSXd3RkIR)Th`dF0FRG&nc4$-A4X7=eA0U3sue zX3+q>ZSyXIUdx*?2KnB8{@Bz3Jh9fUKGIbnZfpX+hjKh9ztjiijc4Gw{@U+9>fGlX zm}}f0+WS#$r@69nux4w;9SQ7Nu_}puDlT_ulmkozgk3gqo&fNOldi``TpucqatPyW zR*1ymB-Ys!H3FTb(GTx>?uYR_?-+V0A7B(0SU!EJ=|l#htMR}s>7uwG1)8SLGz*C? z$N{*_OkHrdYmnpjWvufUB>AIDlpE`WH$viBO|Hq3sL4bIWri6=QW(XGb9Qf{vZc|~ zUSp{&!+HV^XaCSs-1Yh1Hs1>9ZlL)Q~E)MwxqP)RL`o!Xp z#gweYc5o3Y{(vqWf{T;53h~~Af}nimH4ZZdb`C*OZ8p*Y@_ z?|6hDx5S2sRCp-95HW1&D?+>&;pyC!s6Twiy8uv|*st}8y+1ktFm$jLfNB7Y>Tl!m zGr($td4u@Dxg12*PP0-ut5FSQ)$E`qZ_N_Aa%h(K5I`Vko(_@H0q7GREeMF`|NSBn z0+7zG$Gsxa-Qa((D<`>Pk$QqAfF{891VkQYBgGiyyycvv6FNHu8s*i%RqReniSsD| zZ%@w}_@u{bjfixk?`0@qmdYSU?h}-VYlhi_NW(h$+s%j_BNI0f)nWss1 zN$+aVCV6SC7kPx`nJLSRV>z@6ONn9MplE*#<)>A4(#PT}_(?p3Qvls(n0TKWJ3jhEBRApmmZfS9K XWibE%vy22z0}2D+0s!QY|Nj60hbY5Ph?k%U%xQiXbtKM#MrJ8^JC)vyUV%LIVYWfv&x-b42`En#MuBR#R3-&H<`2YX_ delta 478 zcmY+8JxBvV6olvP<#O?om?8+;Xo6T63kwSoAs6fff3OHx#xjkSXeBwVVi(!Ups+z~ zPK$%!U*k_HBw}M_W05+7f{4xe_5z}?3vcJmH?xOBuY=a=(%hCwrG4v&uJ%vr6q5xi zlO;VWiSoKkh#UzyEjB3HJQMRoXnq>sB)%fecXLxz+O35=0H=O%?Hqpu`4zwvNU4|9 zL*XSge+Lu_fa_@8U>&$~^jkCSRx9*JLfv&9+l$Uyx2yA@{br~GyE}B-P?;O{hdEK! zDfx817Qg7fJoR$3d)4ZU1}vHE8?PAt2p~A4MzNHN0DNLDQ1l6bA{13R+!Jeo+uQ3I zE<;N2evBD{2(>6W%HnGR1`zsu_WJ)hkGVi)*dwO6j7vh81OGyeUU4s&em_z4Wx^gN z$O(ItJh^O7@?5dASp%LjIJeiWF&*o1JOsgVO?hvpDI%Y3hs@?ce4A|JRiIM~0^kP? Cb#Ms) diff --git a/Effects/Dyes/PrismaticRayShader.fx b/Effects/Dyes/PrismaticRayShader.fx index 3dfb2c6ce1..e6101a07cb 100644 --- a/Effects/Dyes/PrismaticRayShader.fx +++ b/Effects/Dyes/PrismaticRayShader.fx @@ -20,14 +20,14 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) @@ -35,7 +35,6 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -49,6 +48,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float coordsFactor = 40; if (uOpacity >= 0) coordsFactor *= uOpacity; diff --git a/Effects/Dyes/PrismaticRayShader.xnb b/Effects/Dyes/PrismaticRayShader.xnb index a7d900ca9ea4ecc9aa5e2a2ceb4bd44ed504d71e..64a1fef3defc59eec45679e14e28681a9a18c761 100644 GIT binary patch delta 49 zcmV-10M7ro7`Pa)E&>8;U9&I(2>}DPN(YlX1Kk4v005I51d{;(v#7o0JAUx2>}BEZUB=!1Kk6vWCfEP1d{f}lq_8^PirAXxbcM6j^PeT0OoM1&QwNp*16 zDp>gq0%TgaX zfHWz&u4BLnV1$~#_hB|=gw8RVz8-x=-J_3Qu2SlSYCcA1p04bn@P2`%ZpmuNfHmGz za9+5eWl95TU1*qvFXDqO&HurMAVY}d851PPJk+GEQ*EgAUZ_JE3JS*A?Tx|C;|U^Q9~>Il*o4TIo)EUaINUn|jYe;;Pu`?6#!BXG4) i@TX7ak5Jgwy+XX*a&tOX{=00XCqiFq_VQHm4Jms<`Fie5*0?o!c>v5 z7QxCl2&A#tRxEsg^~}tQu*2M+@60`SS3TRy#>b;eBba4(GM+uY3g%~Wp(f{kCD)># z_B(!}-$mdL%!|ma|LR=ny@#LX5Wrwvd<@sc(c1}N3<}rp`yuNV81lA*dDT4?J^$`* zPX$nbSl;(3R@R_&8vs8|Nxkf#cDw_lge+QC@Xt!i8Z4ZU9Z?JvL2p%FyO0a>&=cnA zeKjReE}5`Ux~*tNg_>=FHeRsbxLul392)u=P31g0agef#H51)M>D|wPYkXyr{$w+ek*H3)f4rnU=LT(rIc&5ht%^T_JPtL2F2KWV} Cb7V{a diff --git a/Effects/ExobladeSlashShader.fx b/Effects/ExobladeSlashShader.fx index 5d340a58b2..2525066b8a 100644 --- a/Effects/ExobladeSlashShader.fx +++ b/Effects/ExobladeSlashShader.fx @@ -23,22 +23,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -54,6 +53,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + if (flipped) coords.y = 1 - coords.y; @@ -103,7 +106,7 @@ technique Technique1 { pass TrailPass { - VertexShader = compile vs_2_0 VertexShaderFunction(); - PixelShader = compile ps_2_0 PixelShaderFunction(); + VertexShader = compile vs_3_0 VertexShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } diff --git a/Effects/ExobladeSlashShader.xnb b/Effects/ExobladeSlashShader.xnb index 5a61b1bcb988a907e5fae85eaf5c80c40af6786b..6dbc5546091c930539e587c8213324c931e74258 100644 GIT binary patch delta 1295 zcmYjRziSjh7=7RF-rgiJS&V5Ef20vCY(y>Nov~36LC8W73qcdL2?QcG!fqNXi#^UJ zL2wV$;tC0*kLg6XfPE0ISb_-t1%{08o4HHw*twnW&3kX&%{Y*MC*^YxJg7)*^s^snW!LJa&_F8ya2)>QBrhy3}3rkO5th`)(wRDZ6 zcWa;I+*(XHwD!o}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xZH=*;bDL zgy&{6;vTDg65FOd#J}vw}ZOLbIY_4#0}|J*lh+Cj}^)uhF~>;DP#V;#|CGuAAw4 z1{-mMy8NCf_m5z$=8jnaCzv&+@wxK&!9AC1@LMB~H{6fnh4RQ)9Sq4`d?u#$J`*oM z;WP2H+{B0H=>GXSR)lqlExr%FH-n|dd?yCm8uPjh_B6&+iSA1NHe!tevc4m(p%l?y DPB96T diff --git a/Effects/FadedUVMapStreak.fx b/Effects/FadedUVMapStreak.fx index 906d2ded1f..2c0a1b0891 100644 --- a/Effects/FadedUVMapStreak.fx +++ b/Effects/FadedUVMapStreak.fx @@ -19,19 +19,19 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; @@ -48,6 +48,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + // Read the fade map as a streak. float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x - uTime * 2.5), coords.y)); float opacity = fadeMapColor.r; diff --git a/Effects/FadedUVMapStreak.xnb b/Effects/FadedUVMapStreak.xnb index 8c734f97eec1676ae065c9e7e0e4c948d7bd67e6..b02dc3b856e6ee43eed7a54234fa19e7846203c6 100644 GIT binary patch delta 426 zcmYk1u}cFn6vn@o-1Y8UZcscob#QRf(xoo;aFGrQ4gsM!IypKxIGEj~l37R*m)PN? ztI)3g2SNoq++U!JgK)lF!5Z=)`F(lc`%xGVz$^#y`~(OEQv2{#?R!2=U-N0&op>&p zw_2?Z*H|gV?{&xXfH^Q>kHzvlG|f1phUv!JH&L+;2-f=)r@zp~49k7rIVbjP}5y|P>EL$#07;UP*MQvNdn4|bOL;Rc5h z9EJzgX7g~~7zNj0KBx|-%}TPH$-hJ%LQA-TL}hx(k>qcgr=%%4(dZ+&rln{mQ1+_| F_yumJT4DeI delta 384 zcmYk2F-XHe6o&tIm)Nu-83ZdhD2RhDDp@Ro32qLG4hMo$!P&*Z!NH6bm&y%J!WD6e z9U?(p1iQL93U%lZaM!gE-$lg2J$U@@|G)P*Q_rU=`#YN_E*)N0uIc&y)*%T%cjXLP(6#L^4=y3s7cUY&1w}$Fq`|oyu>_8Sjxc8|01x- u9%Z2_)w|V|y5LJjs4@RxM?&eV>NZmo{aIa=5=k~wJEfW&2;}Xe0Db^2MOBUf diff --git a/Effects/FadingSolidTrail.fx b/Effects/FadingSolidTrail.fx index 4aaf9c8139..c1a278309d 100644 --- a/Effects/FadingSolidTrail.fx +++ b/Effects/FadingSolidTrail.fx @@ -20,22 +20,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -48,6 +47,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + if (shouldFlip == 1) coords.y = 1 - coords.y; diff --git a/Effects/FadingSolidTrail.xnb b/Effects/FadingSolidTrail.xnb index c57e61edc435804796a5fad38e8b1ca2018b0dab..da31239f2cd56650fc355a6c9bc705f8ad8fbab0 100644 GIT binary patch delta 200 zcmYL=F%E)26b0um$`TtIwXpF77It9)-D_C1tiZ_5jYl4Lq!~(PSUd4ivJK(Y* zG5IfPz8+8=&r#gt3xwr77HEVyR&U}C^BzCX_8>B4cG?5F)1PJelzSKLY~*D7+sy diff --git a/Effects/Flame.fx b/Effects/Flame.fx index 98f17cfbf3..a987f6e0c5 100644 --- a/Effects/Flame.fx +++ b/Effects/Flame.fx @@ -19,14 +19,14 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) @@ -34,7 +34,6 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -48,6 +47,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + // Read the fade map as a streak. float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.y), frac(coords.x - uTime * 1.4 * uSaturation))); fadeMapColor.r *= pow(coords.x, 0.04); diff --git a/Effects/Flame.xnb b/Effects/Flame.xnb index 6c73b5e2b024b9c58bed76a4584592c3f9496ae9..e8bbede739530eb0130e4b5006f5c3fde8958012 100644 GIT binary patch delta 495 zcmYjMu}T9$5Ph?k&+}&xmvot%?l^3+%z3!3H4f+v) zUKdA%{+)OyI_sZi_K0r#pV_vk19;@Bd#}s2-uXkl1!M(^=ISfnwD`CbQB1B*M1 z1Ev9}`txYS{6OEx>LTyK^0|aZ!ZB~P6WrBra-O9AmaF9Ia^7bL7@=$V(n)9pVzUBd z2tx6JaxpQIs{%LxDMFwe*gZSjoggB<&+))#Jcm(+n<-~!dt*|}@_|bH7@OlIVoi(L z9&3qUsQwFx#4HUZQo}Tq9_Gs%oWVFORpB^<3`+-p7CcMt5pi9nR)V9%s>!=TS3SQF zn(XuqplW*e4-Zw~HqaV#(V06n%9`mHxKI7hm#f9A>+@t{cDK=((Ogf|-#flzr6oWx(CjrMB+<7w61{r`{@=sJb<2Uu P_KMr&S#JWJrc%HUN|bps diff --git a/Effects/HeavenlyGaleLightningShader.fx b/Effects/HeavenlyGaleLightningShader.fx index 449fe01b37..5cc778204b 100644 --- a/Effects/HeavenlyGaleLightningShader.fx +++ b/Effects/HeavenlyGaleLightningShader.fx @@ -19,14 +19,14 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) @@ -34,7 +34,6 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -45,6 +44,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float distortion = lerp(-1, 1, tex2D(uImage1, coords + float2(0, uTime * sign(coords.y > 0.5 ? -1 : 1) * 1.81)).r); float opacity = pow(sin((coords.y + distortion * 0.15) * 3.141), distortion * 3.95 + 7); return color * pow(opacity, 0.25) + opacity; diff --git a/Effects/HeavenlyGaleLightningShader.xnb b/Effects/HeavenlyGaleLightningShader.xnb index 6d5783ec441eb182035f6379890401f5bbf99448..c58caf86c17e7218d5e3000024614a2232545cef 100644 GIT binary patch delta 503 zcmY*VJxT*X6#m|9HoI83g%M(qDHFCbAWjOKL3AMp$SH)B zDHbg3yukXsnI+(|1MmBp_q{i}!TdCv+>akqnJ=>!*)QK#Vylr%MK)gep?WvdM1ajO z*%@<@RKMxhd^+i~hqu3eK~#~gAq_#mVqIGVs< z4HHC6vm?jLFcJnpJ*Hn!kZY{uP4H7zk2PU1-*Gx{Nv;h&;u5hhYd7oB97#38a($PO zJ2`9)`(O9eTX%IB5H>}_mug(m-Qi1+)0d3l+Baei)_&d{NAKn{f0d(bZ_q5-7We}- C+h4B$ delta 447 zcmY+Ay-LJD6ot>7F+bR(aD}z9(aOR%aF=Za3&CO_udq*Gxl>xnE~#7)W(yI5NF)#7 zQ;1ty1T1XC7s#H;L{>vCGxu=rmveKozaAv{<>We&e39HswRl(xim^-ubt!z};z>>Q z?P**O^;)TKRs2M6MD zUNn$ez`O|Ha$pA#_N^5dCn$SO^;)^2z6x{R2bQr>$NBBy2;u8zKu+uEsmNEDb#PRZ zZXlzfv643ZKmZWVVCEl0F^Go*aPaX?&tIRh+{S5Yd)<;gfU(;!#-3|}G!q>&p>zp- j`o_hqtRLcr)cl_bAKGphHd1Ko_w-SA^@l<;Z(CpkP>5JE diff --git a/Effects/HeavenlyGaleTrailShader.fx b/Effects/HeavenlyGaleTrailShader.fx index bece1e91a6..1d260d1c50 100644 --- a/Effects/HeavenlyGaleTrailShader.fx +++ b/Effects/HeavenlyGaleTrailShader.fx @@ -23,14 +23,14 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) @@ -38,7 +38,6 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -54,6 +53,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float bloomOpacity = pow(sin(coords.y * 3.141), 5.6); float noise = tex2D(uImage1, coords * 3 - float2(uTime * 2.44, 0)); float brightnessStreak = tex2D(uImage2, coords * float2(2, 1) - float2(uTime * 1.61, 0)) + noise * bloomOpacity; diff --git a/Effects/HeavenlyGaleTrailShader.xnb b/Effects/HeavenlyGaleTrailShader.xnb index fcf28f8d71bb0bfa15a652e3c83180ef175de21c..376ffea6ed54e032192f35b43dc375c12658d160 100644 GIT binary patch delta 721 zcmYjOu}Z{15PiFwWTS`ytq*Pd0I?M>UT1S?5wNqiR#33G?X@^LTVX{|xay8;Y(y=E z^9!!ANNeQ>#5bFZ3fW}d%$s>{Hdn2(We>ZZvsjha_Ev8%j~|Yd1_oAN%I8L(C=60_ zY*Z(ioSJi^+~g~{F#7;rc-r^h)y~$|BtHP+7@41C@A)j-dj;~Gbtn0RdB*w2bovae zzX5(%@;2mMoB8(OX|db0qcwoK=&LmIO{^KmfB}?aZIrNIk*A3Hy{lvGVpN{ZxT@lx2WKKaNL*l~sR)gCxoJsJh;~4NU2^-9bAOM%5^b0)MyvJ}5 zdECCPN4$;YP!lX7GB2V51k6R`_IQg{OnDZ2Q4ORJwxH-yGmY#KD4HXPnF7%(Tu?cb4H1I#y1YjjJB=g_V+zLe}v!zG1Xg|3?zp8*A DmZFK~ delta 632 zcmY+AJ4*vW6ot>7$vzCkMXZBq1Ur%RW=&@!S_INrSy(G5SY&!rL}Dw92nwk-q_GjS z6yh&PW3jE3KVUsGn~(@Q?7iPT_nFuG^{9K)z6zv&7d@!FHhw-8b+$K*)UDbLhxh72 z!eOk>HGs*bzSgoc`3Z0I@zZayPu7|xpXn?)d_Mt#0EuljCn>oB()4ROeRDh{CrgQ2 zK;r|j2aZSN)Q|zg*XmJEXIp@xH;_273tQ0^&&BZnSlY@2=-3LtPa7c5Lgbczr%?hS zE46~9R_59OBi77Ko5?`p@{Q`nxphDYTu|tj4HN~Pj5hs_-SoqFW>(^~M~oMCn?or! zWsZqC)EZwh&rxK7Z(8wj+IHQ?Dy9dF<^}zx6pZ-bH&Td2$kgjVsc1aBa1y>Lz;)JUS6tl5UaPchQ#x4$Qczwt#l)lUF RI5uh4UZkqOIq#q-fIlXCe3SqH diff --git a/Effects/ImpFlameTrail.fx b/Effects/ImpFlameTrail.fx index ea13593261..62f56b6ccf 100644 --- a/Effects/ImpFlameTrail.fx +++ b/Effects/ImpFlameTrail.fx @@ -19,22 +19,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -48,6 +47,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + // Fade out at the edges of the trail to give a blur effect. // This is very important. float flameStreakBrightness = tex2D(uImage1, float2(frac(coords.x - uTime * 2.9), coords.y)).r; diff --git a/Effects/ImpFlameTrail.xnb b/Effects/ImpFlameTrail.xnb index 9eb4fe0468bcff013da52aa3afe1680bbd4f6259..e687b0d305b211a3511f3595ddc04b86d8ced6d6 100644 GIT binary patch delta 442 zcmYjMy-LJD7@Ti&YjQRLPtH;s!OkKG+IS(@Tq9Tntn95VtmM`=$g!26up&0mB9aHt z!p3K~L$1gRh+v_``t8Q!gbeKbWSGzNU;E+lVRkO*U>x4i_0#>B1fX}t89_gaZ93Ic zu_qofy%xL^)nCCk(X{@MKePqlnK8KgwEIbt42}RP5SvN-mQLc~3ouK8G}Wuo$tbMW z0j@?tQEd1T0FeUniU70ZJz`!~9e_W_uD)n{_~q+ rr@hz(P%&=X_5Na&`EnO-6h-rq?CHyHPZF!Bueuks9L@xq!dl=LIOk!1 delta 420 zcmY+9u}TCn5QhJm+udyz1uI{|LL0d}!W~-+5wSTeBHP#q z7B)V^iCnQSAcBP!agrz~B#@c^oBy9Y^=z+ud^kGGs6Xvq()r!ZlvufXmrrS_zU2X- ze&Ic)LA{|~3C)N4B)V_jvM<`ce)szThI9Q~&h^3L5s)#o1r{YxmPJtvMMu4!pNy5; z1X!vG<=S=tIk^EUM}Q?%b}i~8J#Ug8-Y|rj=-zJ041r^>gVttp|8P#sEsIYdP%Pf! z8QIm4HAXZOXeN+1nLtRr2&FoiLqh-S)laP>3$zmnQ=0T*dD{3FlntzsjZ;`K7p8ewzMvJgU`g>F_y)l?Q;z@u diff --git a/Effects/PhaseslayerRipShader.fx b/Effects/PhaseslayerRipShader.fx index 1df56dcc69..aae9057d79 100644 --- a/Effects/PhaseslayerRipShader.fx +++ b/Effects/PhaseslayerRipShader.fx @@ -19,22 +19,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -47,6 +46,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float slashMapColor = tex2D(uImage1, coords); float opacity = 1 - slashMapColor.r; return color * pow(opacity, 3); diff --git a/Effects/PhaseslayerRipShader.xnb b/Effects/PhaseslayerRipShader.xnb index 44fa03af038724c7a7333cd9843e517684d33e53..17147153cd9655bff0e6a8356d801315e2fa8c6d 100644 GIT binary patch delta 221 zcmYLBI|{-;5Ph@x?2^Ke%F@PrC^>*#z`{TO8??&$A{cGWwm zPj~=W00kc~16W4^#QKk={bEfjHf-jI6;s-!q2Ikm2tvE_PI4M094kk8Nv#GA$0S2J=kKVV{bGU5M!1_l6p`XW96 diff --git a/Effects/PrimTextureOverlayShader.fx b/Effects/PrimTextureOverlayShader.fx index d4b7a4abed..2155a9b554 100644 --- a/Effects/PrimTextureOverlayShader.fx +++ b/Effects/PrimTextureOverlayShader.fx @@ -21,22 +21,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -46,9 +45,15 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; - float2 coords = input.TextureCoordinates * uPrimitiveSize / uImageSize1; + float2 baseCoords = input.TextureCoordinates.xy; + + // Account for texture distortion artifacts. + baseCoords.y = (baseCoords.y - 0.5) / input.TextureCoordinates.z + 0.5; + + float2 coords = baseCoords * uPrimitiveSize / uImageSize1; + coords.x = 1 - frac(coords.x); - coords.y = saturate(input.TextureCoordinates.y); + coords.y = saturate(baseCoords.y); if (flipVertically) coords.y = 1 - coords.y; diff --git a/Effects/PrimTextureOverlayShader.xnb b/Effects/PrimTextureOverlayShader.xnb index 7f4004da661b3c945b46cf3213e5ffa0762af376..68fbd495f09cefba3d735a47c61e1b2a6b057fec 100644 GIT binary patch delta 282 zcmYLCF$%&!5S+bBV$>pvC>DYr@Bwy;HdZzg$P@Ghc6#;}k#u5l7J{TPkO%k)TgAfC z2iV2U5eV$S3^P0PZHFB&lnD79W=*e{B48#_9Hb#JA0DXYppa3r{c_k@$NUo(FOlQ?2)hcg+Pnc!E EANX7~!vFvP delta 246 zcmYj}Jqp4=5QX3DCbFhU;SYAXfCsQs#M(~C6$E=bU3-g!bipDPf}}B!tJo?QmN`Hw z*U1vlff?T8d-I}UHBjMlzICbcVs)ZLd`St(jMjW}ItrnZiFgVi8OewI7?afUMpRy% zJBeD9yUtkb^%Q>-0Gx*g{OG4;(dvklpSgep6lYNIww~A<&CglSb~GN1=d9HS78zOA hXSOOV3v5wtVF)Ab-^c76t|&Vgj=N12M>)&;>w;0JVVR88$e9_42a5gLasgE_ eLTzK6Y|7#*#(#m4;mHJuF7^jZK=%Lt3=9CDn<(f2 delta 142 zcmaFEIfIiu!q2Ikm2t*I_PIC)Y4)G6Ol2S1?XtdcrW- zj%m{592PD$<_+=;3`{_Y1_lQH2~hR~1`hrOP7Dk{4g5gyCmS}0Fl#XKvI12xLRE21 c?qu;5V}8KM@MHqe5}*nE7np$T|Nj{n0P#H^h5!Hn diff --git a/Effects/PrismCrystalStreak.fx b/Effects/PrismCrystalStreak.fx index ce7a206a52..f6a31ef4c4 100644 --- a/Effects/PrismCrystalStreak.fx +++ b/Effects/PrismCrystalStreak.fx @@ -19,22 +19,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -49,6 +48,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float areaFadeGlow = lerp(1.2, 17, coords.x); if (coords.x < 0.25) areaFadeGlow = lerp(areaFadeGlow, 1.2, 1 - coords.x / 0.25); diff --git a/Effects/PrismCrystalStreak.xnb b/Effects/PrismCrystalStreak.xnb index 10e8411c269b3bc46671dcfbdb60d8b84159c564..42b0a656bc897a07dfbcdb79082a761a235ac190 100644 GIT binary patch delta 508 zcmYLFJxjw-6utK)Y5IW{>`;pcf`}i#Kq=T-CqWd4fNR13;3D|kDppY*4y}kO;u0My zMcu66B(&gON*y|M716~Zo|hIIa(VZhch0>hxl8tv_Vz|@*W%upeaYGT8L{E_3nJGf!pjo&svxH#$Qy7X;24<6cgLV(3TsXRt4=tz3co?5 zbxsvOzzqRF2JBV!T<+g#43G0a7rlhhHONu1$i$|H&Ua_v5Ccbux~`3y!UiT&A{nL- zPK|>URp3ej8yV@5Nalhxamnf+lCZHK`y6!WtycBmqvAfisLPNo(YK?H|D7YD)rAcD{bt`#c5p#||3aVZ@l z-L2pxw6jAgIAm}Y(Z%6;@=`w_H@tK1J?Ea6yq3D9e08sK>~i-af5pz-t;0-FhtKie z5Mz0^o{MJW80b@8GWF`t5%YHM&Hdto;ox+u)ocbt>b}*S4fcs#LB0kqqk@}vvq?mj zm*7YKQ+ed?JPZfB{o$Z)c?bOC$7+D;hhYdEQR?GHhhB+u(TTTKlkozPK%>E)uW^t> zo&t`UI@%$^!xp3078Fi6F_|IF;HELhnNFpcC{)#7t-)*v-l)tk)rPTvzo?PXMH|49 z{|6M3XbH1rYo7I8N^}mjh@b)su?%LUvfx=z;CAL|F=o;WW=kvff<82fVlUCfzeE&E tB$8yJ=c)M>q{Y`T6XR4&v4b$KHTVhJiRKDR_;W$wnhWwpP|`4l=o>vBanAq% diff --git a/Effects/ScarletDevilStreak.fx b/Effects/ScarletDevilStreak.fx index a037bd7333..fcddc3fb79 100644 --- a/Effects/ScarletDevilStreak.fx +++ b/Effects/ScarletDevilStreak.fx @@ -19,22 +19,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -49,6 +48,9 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float4 color = input.Color; float2 coords = input.TextureCoordinates; + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float areaFadeGlow = lerp(1.2, 17, coords.x); if (coords.x < 0.25) areaFadeGlow = lerp(areaFadeGlow, 1.2, 1 - coords.x / 0.25); diff --git a/Effects/ScarletDevilStreak.xnb b/Effects/ScarletDevilStreak.xnb index e360f61523c6ff7dc4de3e6279be6b4b0efa0c48..325f0c696c10f9e1e034a20095a4b655ee0b148f 100644 GIT binary patch delta 501 zcmYLEze~el5WV}7G--Osiy~Nb8kC;V(_4B-f*sbUuD_M@gZ}} ztBV8X=CpRqeAF!I`;5_-@ylmK)IvF(_UU@HQgL>P3_-R}BwtWDlvAx_B3=W3_Z_aO z{jU9<>)M;IYF`K6X>YYU?UM8Mv!tq}cmuray6_l3ijRTkiI2xZ@@ewnN9D~%47wRuM^>A33)@1TN4zFI1zCS%oO@l*kiI3CxN}5mDzw^BT{>AgW(ke zz#4GSP`*5zDGZJK?~7hS=xgM9$@t7pfG+eGpb#TPjQYNbn!^PqT_PD=2w#Px6b;~7 z3Ktpakx1sFG`3{#Jf1RfANO4EIzGE7;Ew-@)Wf`le4%fQ^GozzFFwyfQ%l@(!u%A} IzY0U5KX0RT8UO$Q delta 500 zcmYjOJxjw-6g~I7q>Wty7Azv7Afo;WQ;Ulrf7{^#k68ch0@%-1CyR%CJ(bAJr~x8Fq>{Vs-9&f>Bk@MGy{E zgJ4Nth%`nm>r7;S^lpF2$#inP*XwpYAb99?m%U@aR&XQYD$Be3NOu7kUX!1>&()cG z@Hm|uj;E8B;Vtq{pW7a5?E5}-K;~nIr%pu*;gz$~)bSdi*l3I6M!aai35a9CAhG}+ zF_^u+fB2BYR zW1jbIBvFC2&Y+45xr}BA^5A(;;(qRFFlVv{=1Xhlfi5*kAWjmM{}LhAOr(*9FAJ+% lOv|s4&W$rMVvAvHWAGDp5U!Lq_yfJtt(5euLefrC;2RB@Zyf*t diff --git a/Effects/SideStreakTrail.fx b/Effects/SideStreakTrail.fx index a4fcdc08e3..34203b1809 100644 --- a/Effects/SideStreakTrail.fx +++ b/Effects/SideStreakTrail.fx @@ -19,22 +19,21 @@ struct VertexShaderInput { float4 Position : POSITION0; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; struct VertexShaderOutput { float4 Position : SV_POSITION; float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; + float3 TextureCoordinates : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; - output.Color = input.Color; output.TextureCoordinates = input.TextureCoordinates; @@ -46,6 +45,10 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float innerBrightnessIntensity = 2.7; float4 color = input.Color; float2 coords = input.TextureCoordinates; + + // Account for texture distortion artifacts. + coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5; + float bloomOpacity = pow(cos(coords.y * 4.8 - 0.8), 55 + pow(coords.x, 4) * 700); // Create some noisy opaque blotches in the inner part of the trail. @@ -66,7 +69,7 @@ technique Technique1 { pass TrailPass { - VertexShader = compile vs_2_0 VertexShaderFunction(); - PixelShader = compile ps_2_0 PixelShaderFunction(); + VertexShader = compile vs_3_0 VertexShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } diff --git a/Effects/SideStreakTrail.xnb b/Effects/SideStreakTrail.xnb index 4720c1c32bc3659d8f8f40a1f637766e1d95aa53..c7637c97af39ef724070b87b2a134151849397df 100644 GIT binary patch delta 1115 zcmYjQzl#$=6n<}Ke|Z<&!UMe^+$q>;6)er=qGeD713~)(@p{W0v9Yk&u-DvyI3hNS zUHbDM$o&I?5FxfUHfM9=_ug!Bh73FJ$M?POy_s>{qi!~NJba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d;`HT#c*Dz%=GcYi0mS9d}6k=fD2C_p^lQZ%%3rkZCf#MTb S{Fu3zA22aInehKV0|Njgdl8=i diff --git a/Graphics/Primitives/PrimitiveRenderer.cs b/Graphics/Primitives/PrimitiveRenderer.cs index 1ed294efa0..a8f360899f 100644 --- a/Graphics/Primitives/PrimitiveRenderer.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -236,14 +236,13 @@ namespace CalamityMod.Graphics.Primitives VerticesIndex = 0; for (int i = 0; i < PositionsIndex; i++) { - float completionRatio = i / (float)(PositionsIndex - 1); + float completionRatio = (i - 1f) / (float)(PositionsIndex - 1); float widthAtVertex = MainSettings.WidthFunction(completionRatio); Color vertexColor = MainSettings.ColorFunction(completionRatio); Vector2 currentPosition = MainPositions[i]; Vector2 directionToAhead = i == PositionsIndex - 1 ? (MainPositions[i] - MainPositions[i - 1]).SafeNormalize(Vector2.Zero) : (MainPositions[i + 1] - MainPositions[i]).SafeNormalize(Vector2.Zero); - - Vector2 leftCurrentTextureCoord = new(completionRatio, 0f); - Vector2 rightCurrentTextureCoord = new(completionRatio, 1f); + Vector2 leftCurrentTextureCoord = new(completionRatio, 0.5f - widthAtVertex * 0.5f); + Vector2 rightCurrentTextureCoord = new(completionRatio, 0.5f + widthAtVertex * 0.5f); // Point 90 degrees away from the direction towards the next point, and use it to mark the edges of the rectangle. // This doesn't use RotatedBy for the sake of performance (there can potentially be a lot of trail points). @@ -262,9 +261,9 @@ namespace CalamityMod.Graphics.Primitives // What this is doing, at its core, is defining a rectangle based on two triangles. // These triangles are defined based on the width of the strip at that point. // The resulting rectangles combined are what make the trail itself. - MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(left, vertexColor, leftCurrentTextureCoord); + MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(left, vertexColor, leftCurrentTextureCoord, widthAtVertex); VerticesIndex++; - MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(right, vertexColor, rightCurrentTextureCoord); + MainVertices[VerticesIndex] = new VertexPosition2DColorTexture(right, vertexColor, rightCurrentTextureCoord, widthAtVertex); VerticesIndex++; } } diff --git a/Graphics/Primitives/VertexPosition2DColorTexture.cs b/Graphics/Primitives/VertexPosition2DColorTexture.cs index 0ac7154e44..715c4351f5 100644 --- a/Graphics/Primitives/VertexPosition2DColorTexture.cs +++ b/Graphics/Primitives/VertexPosition2DColorTexture.cs @@ -22,7 +22,10 @@ namespace CalamityMod.Graphics.Primitives /// /// The texture-coordinate of the vertex. /// - public readonly Vector2 TextureCoordinates; + /// + /// The Z component isn't actually related to 3D, it holds the width of the vertex at the given point, since arbitrary data cannot be saved on a per-vertex basis and needs to be contained within some pre-defined format. + /// + public readonly Vector3 TextureCoordinates; /// /// The vertex declaration. This declares the layout and size of the data in the vertex shader. @@ -33,14 +36,14 @@ namespace CalamityMod.Graphics.Primitives { new(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0), new(8, VertexElementFormat.Color, VertexElementUsage.Color, 0), - new(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0), + new(12, VertexElementFormat.Vector3, VertexElementUsage.TextureCoordinate, 0) }); - public VertexPosition2DColorTexture(Vector2 position, Color color, Vector2 textureCoordinates) + public VertexPosition2DColorTexture(Vector2 position, Color color, Vector2 textureCoordinates, float widthCorrectionFactor) { Position = position; Color = color; - TextureCoordinates = textureCoordinates; + TextureCoordinates = new(textureCoordinates, widthCorrectionFactor); } } } From 248cda1855e50f31f3ba34e148bbee670bc83638 Mon Sep 17 00:00:00 2001 From: Dominic Karma <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 8 Mar 2024 18:46:22 -0600 Subject: [PATCH 15/48] Fix Aerialite Multiplayer Problems (#26) Change aerialite generation --- NPCs/HiveMind/HiveMind.cs | 2 +- NPCs/Perforator/PerforatorHive.cs | 2 +- Systems/WorldgenManagementSystem.cs | 2 +- World/AerialiteOreGen.cs | 126 ++++++++++++++++------------ 4 files changed, 76 insertions(+), 56 deletions(-) diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 0d711521f0..a92016ec05 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1138,7 +1138,7 @@ namespace CalamityMod.NPCs.HiveMind { string key = "Mods.CalamityMod.Status.Progression.SkyOreText"; Color messageColor = Color.Cyan; - AerialiteOreGen.Generate(true); + AerialiteOreGen.Enchant(); CalamityUtils.DisplayLocalizedText(key, messageColor); } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 7eddc1ae75..3a397a365e 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -524,7 +524,7 @@ namespace CalamityMod.NPCs.Perforator { string key = "Mods.CalamityMod.Status.Progression.SkyOreText"; Color messageColor = Color.Cyan; - AerialiteOreGen.Generate(true); + AerialiteOreGen.Enchant(); CalamityUtils.DisplayLocalizedText(key, messageColor); } diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index e2eb6a6fb3..c2b973c148 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -216,7 +216,7 @@ namespace CalamityMod.Systems tasks.Insert(++currentFinalIndex, new PassLegacy("Aerialite", (progress, config) => { progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.Aerialite").Value; - AerialiteOreGen.Generate(false); + AerialiteOreGen.Generate(); })); // Draedon Labs diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 467c7d153f..fa45cc4210 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -1,75 +1,95 @@ -using Terraria; +using CalamityMod.Tiles.Ores; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.DataStructures; -using Terraria.GameContent.Generation; using Terraria.WorldBuilding; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Linq; -using System.Collections.Generic; -using CalamityMod.DataStructures; namespace CalamityMod.World { public class AerialiteOreGen { - public static void Generate(bool Convert) + /// + /// The chance for a cloud tile the be randomly changed into a blotch of disenchanted aerialite ore during world generation. + /// + public const int CloudOreConversionChance = 365; + + public static void Generate() { - if (Main.netMode != NetmodeID.MultiplayerClient) + // Don't attempt to generate anything client-side. Only the server is allowed to do that. + if (Main.netMode == NetmodeID.MultiplayerClient) + return; + + // Loop through every tile above the world's surface, searching for potential candidates for aerialite generation. + for (int x = 5; x < Main.maxTilesX - 5; x++) { - for (int x = 5; x < Main.maxTilesX - 5; x++) + for (int y = 5; y < Main.worldSurface; y++) { - for (int y = 5; y < Main.worldSurface; y++) + Tile tile = Main.tile[x, y]; + + // The following conditions must happen in order for aerialite to generate: + // 1. The original tile ID must be that of a cloud. + // 2. The original tile must not be empty air. + // 3. A random dice-roll must land correctly, to ensure that patches of ore are occasional. + // If any of these conditions are not met, this loop iteration is skipped. + if (tile.TileType != TileID.Cloud || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) + continue; + + int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); + ShapeData circle = new ShapeData(); + ShapeData biggerCircle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + // Big cloud circle. + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius + 1), Actions.Chain(new GenAction[] { - if (!Convert) - { - Tile tile = Main.tile[x, y]; + blotchMod.Output(biggerCircle) + })); - if (WorldGen.genRand.Next(365) == 0 && tile.TileType == TileID.Cloud && tile.HasTile) - { - ShapeData circle = new ShapeData(); - ShapeData biggerCircle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(x, y), new ModShapes.All(biggerCircle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)TileID.Cloud) + })); - int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); + // Circle of ore. + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); - //big cloud circle - WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius + 1), Actions.Chain(new GenAction[] - { - blotchMod.Output(biggerCircle) - })); + WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } + } + } - WorldUtils.Gen(new Point(x, y), new ModShapes.All(biggerCircle), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(), - new Actions.PlaceTile((ushort)TileID.Cloud) - })); + public static void Enchant() + { + // Don't attempt to change tile states client-side. + if (Main.netMode == NetmodeID.MultiplayerClient) + return; - //circle of ore - WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); + // Loop through every tile above the world's surface, searching for aerialite to generate. + ushort disenchantedOreID = (ushort)ModContent.TileType(); + ushort enchantedOreID = (ushort)ModContent.TileType(); + for (int x = 5; x < Main.maxTilesX - 5; x++) + { + for (int y = 5; y < Main.worldSurface; y++) + { + if (Main.tile[x, y].TileType != disenchantedOreID) + continue; - WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.ClearTile(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - } - } + // Enchant the ore and re-evaluate nearby framing. + Main.tile[x, y].TileType = enchantedOreID; + WorldGen.SquareTileFrame(x, y); - if (Convert) - { - if (Main.tile[x, y].TileType == ModContent.TileType()) - { - WorldGen.SquareTileFrame(x, y, true); - Main.tile[x, y].TileType = (ushort)ModContent.TileType(); - } - } - } + // Inform all clients of the tile change. + if (Main.netMode == NetmodeID.Server) + NetMessage.SendTileSquare(-1, x, y); } } } From 36139412a5c0a988712d3af4936dc711db9cd551 Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Thu, 21 Mar 2024 03:00:55 +0900 Subject: [PATCH 16/48] Fix truffle worm bug (#27) * Fix truffle worm bug * Removed hardcoded indices --- ILEditing/ILChangesLoading.cs | 3 ++ ILEditing/VanillaBugfixingILChanges.cs | 48 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index abd6038bb1..1e48d9ae87 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -151,6 +151,9 @@ namespace CalamityMod.ILEditing // Fix vanilla not accounting for spritebatch modification in held projectile drawing On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState; + // Fix vanilla not accounting for multiple bobbers when fishing with truffle worm + IL_Player.ItemCheck_CheckFishingBobbers += FixTruffleWormFishing; + //Additional detours that are in their own item files given they are only relevant to these specific items: //Rover drive detours on Player.DrawInfernoRings to draw its shield //Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 81b8656eca..389d9634bc 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -6,6 +6,7 @@ using System; using Terraria; using Terraria.DataStructures; using Terraria.Graphics.Renderers; +using Terraria.ID; namespace CalamityMod.ILEditing { @@ -69,5 +70,52 @@ namespace CalamityMod.ILEditing } } #endregion + + #region Fix Vanilla Not Accounting For Multiple Bobbers When Fishing With Truffle Worm + private void FixTruffleWormFishing(ILContext il) + { + var cursor = new ILCursor(il); + + // Initialize a flag variable whether truffle worm was used. + il.Method.Body.Variables.Add(new VariableDefinition(il.Module.TypeSystem.Boolean)); + byte truffleWormUsed = (byte) (il.Method.Body.Variables.Count - 1); + cursor.Emit(OpCodes.Ldc_I4_0); + cursor.Emit(OpCodes.Stloc_S, truffleWormUsed); + + // Move after beq.s, which is before Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait gets called + if (!cursor.TryGotoNext(MoveType.After, i => i.Match(OpCodes.Beq_S))) + { + LogFailure("FixTruffleWormFishing", "Could not locate beq.s before Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait."); + return; + } + + // Skip if truffle worm was already used. + var loopEnd = il.DefineLabel(); + cursor.Emit(OpCodes.Ldloc_S, truffleWormUsed); + cursor.Emit(OpCodes.Brtrue_S, loopEnd); + + // Find the call to Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("ItemCheck_CheckFishingBobber_PickAndConsumeBait"))) + { + LogFailure("FixTruffleWormFishing", "Could not locate the call to Player.ItemCheck_CheckFishingBobber_PickAndConsumeBait."); + return; + } + + // Retrive baitTypeUsed, compare with truffle worm, and save it. + cursor.Emit(OpCodes.Ldloc_S, (byte)4); + cursor.Emit(OpCodes.Ldc_I4, ItemID.TruffleWorm); + cursor.Emit(OpCodes.Ceq); + cursor.Emit(OpCodes.Stloc_S, truffleWormUsed); + + // Move before next ldloc.0, which is the end of the loop + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc0())) + { + LogFailure("FixTruffleWormFishing", "Could not find the end of the loop."); + return; + } + + cursor.MarkLabel(loopEnd); + } + #endregion } } From e4c30dc3c06b2d1ced36d40d7451c792728448a7 Mon Sep 17 00:00:00 2001 From: AlienBlox <122119961+AlienBlox@users.noreply.github.com> Date: Sun, 14 Apr 2024 16:26:49 +0100 Subject: [PATCH 17/48] Updated Buff name (#29) Fixed the name of the Baby Boomer buff --- Localization/en-US/Mods.CalamityMod.Buffs.hjson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 33803350fd..8cf9d0da1d 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1517,6 +1517,6 @@ AbsorberAffliction: { } YoungDukeBuff: { - DisplayName: Young Duke Buff - Description: Mods.CalamityMod.Buffs.YoungDukeBuff.Description + DisplayName: Baby Boomer + Description: The mutated fishron will intoxicate your foes } From 08acae63b4d7cf6846e715ec848330b82705aedb Mon Sep 17 00:00:00 2001 From: JavyzTaken <36089970+JavyzTaken@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:09:28 +0200 Subject: [PATCH 18/48] Made Bloody Worm Food and Teratoma only shimmerable after the respective boss is killed. (#30) --- Items/SummonItems/BloodyWormFood.cs | 2 ++ Items/SummonItems/Teratoma.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 08df866136..a78f2d3142 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -50,11 +50,13 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { + Condition downedPerfs = new(CalamityUtils.GetText("Condition.DownedPerfs"), () => DownedBossSystem.downedPerforator); CreateRecipe(). AddIngredient(ItemID.CrimtaneBar, 3). AddIngredient(7). AddIngredient(ItemID.Vertebrae, 13). AddTile(TileID.DemonAltar). + AddDecraftCondition(downedPerfs). Register(); } } diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index 9b8193bb86..b1b9e15a89 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -50,11 +50,13 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { + Condition downedHM = new(CalamityUtils.GetText("Condition.DownedHM"), () => DownedBossSystem.downedHiveMind); CreateRecipe(). AddIngredient(ItemID.DemoniteBar, 3). AddIngredient(7). AddIngredient(ItemID.RottenChunk, 13). AddTile(TileID.DemonAltar). + AddDecraftCondition(downedHM). Register(); } } From d7ec6bf71a95721825a1ebaa995ae6ed20876e83 Mon Sep 17 00:00:00 2001 From: JavyzTaken <36089970+JavyzTaken@users.noreply.github.com> Date: Sat, 27 Apr 2024 22:27:52 +0200 Subject: [PATCH 19/48] Prefix changes are now applied in a detour of GrantPrefixBenefits instead of in GlobalItem:UpdateAccessory (#31) --- ILEditing/BalancingILChanges.cs | 78 +++++++++++++++++++++++++++++++++ ILEditing/ILChangesLoading.cs | 3 ++ Items/CalamityGlobalItem.cs | 73 ------------------------------ 3 files changed, 81 insertions(+), 73 deletions(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index b2e14bc1a9..fbb1cbd80c 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -324,6 +324,84 @@ namespace CalamityMod.ILEditing } #endregion + #region Item Prefix Changes + private static void PrefixChanges(On_Player.orig_GrantPrefixBenefits orig, Player self, Item item) + { + orig(self, item); + // Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR + if (item.prefix == PrefixID.Hard) + { + /* Prehardmode = 1 + * Hardmode = 2 + * Post-Moon Lord = 3 + * Post-DoG = 4 + */ + + if (DownedBossSystem.downedDoG) + self.statDefense += 3; + else if (NPC.downedMoonlord) + self.statDefense += 2; + else if (Main.hardMode) + self.statDefense += 1; + + self.endurance += 0.0025f; + } + if (item.prefix == PrefixID.Guarding) + { + /* Prehardmode = 2 + * Hardmode = 3 + * Post-Moon Lord = 4 + * Post-DoG = 6 + */ + + if (DownedBossSystem.downedDoG) + self.statDefense += 4; + else if (NPC.downedMoonlord) + self.statDefense += 2; + else if (Main.hardMode) + self.statDefense += 1; + + self.endurance += 0.005f; + } + if (item.prefix == PrefixID.Armored) + { + /* Prehardmode = 3 + * Hardmode = 5 + * Post-Moon Lord = 6 + * Post-DoG = 8 + */ + + if (DownedBossSystem.downedDoG) + self.statDefense += 5; + else if (NPC.downedMoonlord) + self.statDefense += 3; + else if (Main.hardMode) + self.statDefense += 2; + + self.endurance += 0.0075f; + } + if (item.prefix == PrefixID.Warding) + { + /* Prehardmode = 4 + * Hardmode = 6 + * Post-Moon Lord = 8 + * Post-DoG = 10 + */ + + if (DownedBossSystem.downedDoG) + self.statDefense += 6; + else if (NPC.downedMoonlord) + self.statDefense += 4; + else if (Main.hardMode) + self.statDefense += 2; + self.endurance += 0.01f; + } + + if (item.prefix == PrefixID.Lucky) + self.luck += 0.05f; + } + #endregion + #region Damage Variance Dampening and Luck Removal private static int AdjustDamageVariance(Terraria.On_Main.orig_DamageVar_float_int_float orig, float dmg, int percent, float luck) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 1e48d9ae87..dc43409ef2 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -113,6 +113,9 @@ namespace CalamityMod.ILEditing IL_Player.Update += ManaRegenDelayAdjustment; IL_Player.UpdateManaRegen += ManaRegenAdjustment; + // Item prefix changes + On_Player.GrantPrefixBenefits += PrefixChanges; + // Debuff balancing IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 8699c788af..d1bf4f9242 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1490,79 +1490,6 @@ namespace CalamityMod.Items if (item.type == ItemID.EoCShield || item.type == ItemID.Tabi || item.type == ItemID.MasterNinjaGear) modPlayer.DashID = string.Empty; - - // Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR - if (item.prefix == PrefixID.Hard) - { - /* Prehardmode = 1 - * Hardmode = 2 - * Post-Moon Lord = 3 - * Post-DoG = 4 - */ - - if (DownedBossSystem.downedDoG) - player.statDefense += 3; - else if (NPC.downedMoonlord) - player.statDefense += 2; - else if (Main.hardMode) - player.statDefense += 1; - - player.endurance += 0.0025f; - } - if (item.prefix == PrefixID.Guarding) - { - /* Prehardmode = 2 - * Hardmode = 3 - * Post-Moon Lord = 4 - * Post-DoG = 6 - */ - - if (DownedBossSystem.downedDoG) - player.statDefense += 4; - else if (NPC.downedMoonlord) - player.statDefense += 2; - else if (Main.hardMode) - player.statDefense += 1; - - player.endurance += 0.005f; - } - if (item.prefix == PrefixID.Armored) - { - /* Prehardmode = 3 - * Hardmode = 5 - * Post-Moon Lord = 6 - * Post-DoG = 8 - */ - - if (DownedBossSystem.downedDoG) - player.statDefense += 5; - else if (NPC.downedMoonlord) - player.statDefense += 3; - else if (Main.hardMode) - player.statDefense += 2; - - player.endurance += 0.0075f; - } - if (item.prefix == PrefixID.Warding) - { - /* Prehardmode = 4 - * Hardmode = 6 - * Post-Moon Lord = 8 - * Post-DoG = 10 - */ - - if (DownedBossSystem.downedDoG) - player.statDefense += 6; - else if (NPC.downedMoonlord) - player.statDefense += 4; - else if (Main.hardMode) - player.statDefense += 2; - - player.endurance += 0.01f; - } - - if (item.prefix == PrefixID.Lucky) - player.luck += 0.05f; } #endregion From 645484a1c4a3fdbd253c7222735afec34b63a002 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Sun, 28 Apr 2024 01:38:50 +0500 Subject: [PATCH 20/48] Moved Cobalt/Palladium ore gen to hardmode gen thread (#32) --- NPCs/CalamityGlobalNPCLoot.cs | 10 ---------- Systems/WorldgenManagementSystem.cs | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 50451023f8..2e5d6215b2 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1805,16 +1805,6 @@ namespace CalamityMod.NPCs string key2 = "Mods.CalamityMod.Status.Progression.UglyBossText"; Color messageColor2 = Color.Aquamarine; CalamityUtils.DisplayLocalizedText(key2, messageColor2); - - // TODO -- this should probably be moved to a thread like Aureus meteor - if (CalamityConfig.Instance.EarlyHardmodeProgressionRework) - { - string key3 = "Mods.CalamityMod.Status.Progression.HardmodeOreTier1Text"; - Color messageColor3 = new Color(50, 255, 130); - CalamityUtils.SpawnOre(TileID.Cobalt, 12E-05, 0.45f, 0.7f, 3, 8); - CalamityUtils.SpawnOre(TileID.Palladium, 12E-05, 0.45f, 0.7f, 3, 8); - CalamityUtils.DisplayLocalizedText(key3, messageColor3); - } } break; diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index c2b973c148..1d7bde379f 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -291,10 +291,37 @@ namespace CalamityMod.Systems } // An Astral Meteor always falls at the beginning of Hardmode. + // T1 Hardmode Ores always generate after killing Wall of Flesh. public override void ModifyHardmodeTasks(List tasks) { int announceIndex = tasks.FindIndex(match => match.Name == "Hardmode Announcement"); + // + // EARLY HARDMODE REWORK + // + { + var hardmodeOreT1Pass = new PassLegacy("CalamityMod:EarlyHMRework_HardmodeOreTier1", (progress, config) => + { + string key = CalamityMod.Instance.GetLocalization("Status.Progression.HardmodeOreTier1Text").Value; + Color messageColor = new Color(50, 255, 130); + + CalamityUtils.SpawnOre(TileID.Cobalt, 12E-05, 0.45f, 0.7f, 3, 8); + CalamityUtils.SpawnOre(TileID.Palladium, 12E-05, 0.45f, 0.7f, 3, 8); + + CalamityUtils.DisplayLocalizedText(key, messageColor); + }); + + // Disable gen pass if Early Hardmode Rework is disabled. + // Could just not add/remove gen pass, but that could lead to mod conflicts + // in case whatever mod targets this specific gen pass. + if (!CalamityConfig.Instance.EarlyHardmodeProgressionRework) + { + hardmodeOreT1Pass.Disable(); + } + + tasks.Insert(announceIndex, hardmodeOreT1Pass); + } + // Insert the Astral biome generation right before the final hardmode announcement. tasks.Insert(announceIndex, new PassLegacy("AstralMeteor", (progress, config) => { From 33942ebdd9a6643eebfdcb435d7ba961c0cb7461 Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sun, 28 Apr 2024 05:40:45 +0900 Subject: [PATCH 21/48] Clowns now summon Chattering Teeth Bombs & Fixed Herpling AI bug (#33) --- NPCs/CalamityGlobalAI.cs | 152 ++++++++++++++++++++++++++++++-------- NPCs/CalamityGlobalNPC.cs | 1 + 2 files changed, 124 insertions(+), 29 deletions(-) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 6ca9db0a96..1bf8483ec5 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -3165,19 +3165,29 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; npc.ai[2] += 1f; - if (npc.ai[2] > (CalamityWorld.death ? 60f : 180f)) + float bombDelay = CalamityWorld.death ? 60f : 180f; + if (npc.ai[2] > bombDelay) { Vector2 spawnPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f - (float)(npc.direction * 24), npc.position.Y + 4f); - int velocityX = 3 * npc.direction; - int velocityY = -5; - int clownBomb = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, velocityX, velocityY, ProjectileID.HappyBomb, 0, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[clownBomb].timeLeft = 300; - if (CalamityWorld.death) + if (!Main.rand.NextBool(5) || NPC.AnyNPCs(NPCID.ChatteringTeethBomb)) { - Main.projectile[clownBomb].extraUpdates += 1; - Main.projectile[clownBomb].timeLeft = 600; + int velocityX = 3 * npc.direction; + int velocityY = -5; + int clownBomb = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition.X, spawnPosition.Y, velocityX, velocityY, ProjectileID.HappyBomb, 0, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[clownBomb].timeLeft = 300; + if (CalamityWorld.death) + { + Main.projectile[clownBomb].extraUpdates += 1; + Main.projectile[clownBomb].timeLeft = 600; + } + npc.ai[2] = 0f; + } + else + { + npc.ai[2] = -bombDelay * 2; + int chatteringTeethBomb = NPC.NewNPC(npc.GetSource_FromAI(), (int)spawnPosition.X, (int)spawnPosition.Y, NPCID.ChatteringTeethBomb); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, chatteringTeethBomb, 0f, 0f, 0f, 0, 0, 0); } - npc.ai[2] = 0f; } } @@ -8851,11 +8861,88 @@ namespace CalamityMod.NPCs npc.spriteDirection = npc.direction; } - if (npc.wet && npc.type != NPCID.Derpling) + if (npc.type == NPCID.ChatteringTeethBomb) + { + Vector2 dustOffset = new Vector2(-6f, -10f); + dustOffset.X *= npc.spriteDirection; + if (npc.ai[1] != 5f && Main.rand.NextBool(3)) + { + npc.position += npc.netOffset; + int dustID = Dust.NewDust(npc.Center + dustOffset - Vector2.One * 5f, 4, 4, DustID.Torch); + Dust dust = Main.dust[dustID]; + dust.scale = 1.5f; + dust.noGravity = true; + dust.velocity = dust.velocity * 0.25f + Vector2.Normalize(dustOffset) * 1f; + dust.velocity = dust.velocity.RotatedBy(-(float)Math.PI / 2f * (float)npc.direction); + npc.position -= npc.netOffset; + } + if (npc.ai[1] == 5f) + { + npc.velocity = Vector2.Zero; + npc.position.X += npc.width / 2; + npc.position.Y += npc.height / 2; + npc.width = 160; + npc.height = 160; + npc.position.X -= npc.width / 2; + npc.position.Y -= npc.height / 2; + npc.dontTakeDamage = true; + npc.position += npc.netOffset; + if (npc.ai[2] > 7f) + { + for (int i = 0; i < 8; i++) + { + Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); + } + for (int i = 0; i < 32; i++) + { + int dustID = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); + Dust dust = Main.dust[dustID]; + dust.velocity *= 3f; + dust.noGravity = true; + dustID = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); + dust = Main.dust[dustID]; + dust.velocity *= 2f; + dust.noGravity = true; + } + for (int i = 0; i < 2; i++) + { + int goreID = Gore.NewGore(npc.GetSource_FromThis(), npc.position + new Vector2((float)(npc.width * Main.rand.Next(100)) / 100f, (float)(npc.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default(Vector2), Main.rand.Next(GoreID.Smoke1, GoreID.Smoke3 + 1)); + Gore gore = Main.gore[goreID]; + gore.velocity *= 0.3f; + gore.velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f; + gore.velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f; + } + if (npc.ai[2] == 9f) + { + SoundEngine.PlaySound(SoundID.Item14, npc.position); + } + } + if (npc.ai[2] == 1f) + { + npc.life = -1; + npc.HitEffect(); + npc.active = false; + } + npc.position -= npc.netOffset; + return false; + } + } + + if (npc.type == NPCID.ChatteringTeethBomb && npc.ai[1] != 5f) + { + if (npc.wet || Vector2.Distance(npc.Center, Main.player[npc.target].Center) < 64f) + { + npc.ai[1] = 5f; + npc.ai[2] = 10f; + npc.netUpdate = true; + return false; + } + } + else if (npc.wet && npc.type != NPCID.Derpling) { if (npc.collideX) { - npc.direction *= -npc.direction; + npc.direction *= -1; // Fixed bug where herplings didn't change direction from left to right npc.spriteDirection = npc.direction; } @@ -8970,28 +9057,35 @@ namespace CalamityMod.NPCs npc.ai[1] += 1f; } } - else if (npc.ai[1] == 3f) - { - npc.velocity.Y = -9f; - npc.velocity.X = npc.velocity.X + (float)(2 * npc.direction); - if (herplingTargetDist < 350f && herplingTargetDist > 200f) - { - npc.velocity.X = npc.velocity.X + (float)npc.direction; - } - npc.ai[0] = CalamityWorld.death ? -100f : -200f; - npc.ai[1] = 0f; - npc.ai[3] = npc.position.X; - } else { - npc.velocity.Y = -5f; - npc.velocity.X = npc.velocity.X + (float)(4 * npc.direction); - if (herplingTargetDist < 350f && herplingTargetDist > 200f) + if (npc.type == NPCID.ChatteringTeethBomb) { - npc.velocity.X = npc.velocity.X + (float)npc.direction; + SoundEngine.PlaySound(SoundID.Zombie124, npc.position); + } + if (npc.ai[1] == 3f) + { + npc.velocity.Y = -9f; + npc.velocity.X = npc.velocity.X + (float)(2 * npc.direction); + if (herplingTargetDist < 350f && herplingTargetDist > 200f) + { + npc.velocity.X = npc.velocity.X + (float)npc.direction; + } + npc.ai[0] = CalamityWorld.death ? -100f : -200f; + npc.ai[1] = 0f; + npc.ai[3] = npc.position.X; + } + else + { + npc.velocity.Y = -5f; + npc.velocity.X = npc.velocity.X + (float)(4 * npc.direction); + if (herplingTargetDist < 350f && herplingTargetDist > 200f) + { + npc.velocity.X = npc.velocity.X + (float)npc.direction; + } + npc.ai[0] = CalamityWorld.death ? -60f : -120f; + npc.ai[1] += 1f; } - npc.ai[0] = CalamityWorld.death ? -60f : -120f; - npc.ai[1] += 1f; } } else if (npc.ai[0] >= -30f) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3181e0645c..32d244820c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3621,6 +3621,7 @@ namespace CalamityMod.NPCs { case NPCID.Herpling: case NPCID.Derpling: + case NPCID.ChatteringTeethBomb: return CalamityGlobalAI.BuffedHerplingAI(npc, Mod); } } From adcc1c197676ba57913fbe9d2de06bc7c6ae351f Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sun, 28 Apr 2024 05:48:16 +0900 Subject: [PATCH 22/48] Fix splitting worm bestiary bug (#34) --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/VanillaBugfixingILChanges.cs | 12 +++++ NPCs/CalamityGlobalNPCLoot.cs | 68 ++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index dc43409ef2..4493392853 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -150,6 +150,7 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; + On_NPC.PlayerInteraction += FixSplittingWormInteraction; // Fix vanilla not accounting for spritebatch modification in held projectile drawing On_PlayerDrawLayers.DrawHeldProj += FixHeldProjectileBlendState; diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 389d9634bc..3675d4c63b 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -46,6 +46,18 @@ namespace CalamityMod.ILEditing } #endregion Fixing Splitting Worm Banner Spam in Deathmode + #region Fixing Splitting Worm Interaction in Deathmode + // CONTEXT FOR FIX: In Death Mode, normal worms are capable of splitting similarly to the Eater of Worlds. This comes with problems with bestiary entries. The entries are incremented only when + // the killed npc is the head segment and it has been interacted at least once. These two conditions may be violated because NPC.NPCLoot only triggers once because of the above fix. + // The fix for former condition is in CalamityGlobalNPCLoot.OnKill. For the latter condition, NPC.PlayerInteraction should broadcast interaction to every other worm segments. + // This is already done for vanilla worm enemies like EOW. + private static void FixSplittingWormInteraction(On_NPC.orig_PlayerInteraction orig, NPC npc, int player) + { + orig(npc, player); + CalamityGlobalNPC.SplittingWormBroadcastInteractionWrapper(npc, player); + } + #endregion + #region Fixing Vanilla Not Accounting For Spritebatch Modification in Held Projectiles private static bool HasLoggedHeldProjectileBlendStateCatch = false; private void FixHeldProjectileBlendState(On_PlayerDrawLayers.orig_DrawHeldProj orig, PlayerDrawSet drawinfo, Projectile proj) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 2e5d6215b2..670ba70021 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1737,6 +1737,10 @@ namespace CalamityMod.NPCs if (CalamityWorld.death && !SplittingWormLootBlockWrapper(npc, Mod)) DropHelper.BlockEverything(); + // Correctly increment bestiary entries for splitting worms + if (npc.AnyInteractions()) + SplittingWormBestiaryUpdate(npc); + // Check whether bosses should be spawned naturally as a result of this NPC's death. CheckBossSpawn(npc); @@ -1993,6 +1997,70 @@ namespace CalamityMod.NPCs #endregion #region Splitting Worm Loot + internal static void SplittingWormBroadcastInteractionWrapper(NPC npc, int player) + { + if (!CalamityWorld.death) + return; + + switch (npc.type) + { + case NPCID.DiggerHead: + case NPCID.DiggerBody: + case NPCID.DiggerTail: + SplittingWormBroadcastInteraction(npc, player, NPCID.DiggerHead, NPCID.DiggerBody, NPCID.DiggerTail); + return; + case NPCID.SeekerHead: + case NPCID.SeekerBody: + case NPCID.SeekerTail: + SplittingWormBroadcastInteraction(npc, player, NPCID.SeekerHead, NPCID.SeekerBody, NPCID.SeekerTail); + return; + case NPCID.DuneSplicerHead: + case NPCID.DuneSplicerBody: + case NPCID.DuneSplicerTail: + SplittingWormBroadcastInteraction(npc, player, NPCID.DuneSplicerHead, NPCID.DuneSplicerBody, NPCID.DuneSplicerTail); + return; + } + } + + internal static void SplittingWormBroadcastInteraction(NPC npc, int player, int head, int body, int tail) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == head || Main.npc[i].type == body || Main.npc[i].type == tail)) + { + Main.npc[i].ApplyInteraction(player); + } + } + } + + internal static void SplittingWormBestiaryUpdate(NPC npc) + { + if (!CalamityWorld.death) + return; + + switch (npc.type) + { + case NPCID.DiggerBody: + case NPCID.DiggerTail: + NPC diggerHead = new(); + diggerHead.SetDefaults(NPCID.DiggerHead); + Main.BestiaryTracker.Kills.RegisterKill(diggerHead); + return; + case NPCID.SeekerBody: + case NPCID.SeekerTail: + NPC seekerHead = new(); + seekerHead.SetDefaults(NPCID.SeekerHead); + Main.BestiaryTracker.Kills.RegisterKill(seekerHead); + return; + case NPCID.DuneSplicerBody: + case NPCID.DuneSplicerTail: + NPC duneSplicerHead = new(); + duneSplicerHead.SetDefaults(NPCID.DuneSplicerHead); + Main.BestiaryTracker.Kills.RegisterKill(duneSplicerHead); + return; + } + } + internal static bool SplittingWormLootBlockWrapper(NPC npc, Mod mod) { if (!CalamityWorld.death) From 6b60acd841b48f9f4aa426738aad00eaa2d25a1a Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sun, 28 Apr 2024 05:52:38 +0900 Subject: [PATCH 23/48] Fix Arid Artifact bug (#35) --- Utilities/MiscUtils.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index dd81e33cd4..3914365dd7 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -254,7 +254,11 @@ namespace CalamityMod // 0.6f is the minimum for vanilla but Calamity changes it to 0.2f // Windy days occur when wind speed is at least 0.5f (0.4f in vanilla) so this should never cause a windy day float windSpeed = 0f; - if (Main.windSpeedCurrent < 0.2f && Main.windSpeedCurrent > 0f) + if (Main.windSpeedCurrent == 0f) + { + windSpeed = Main.rand.NextFloat(0.2f, 0.4f) * (Main.rand.Next(0, 2) * 2 - 1); + } + else if (Main.windSpeedCurrent < 0.2f && Main.windSpeedCurrent > 0f) { windSpeed = Main.rand.NextFloat(0.2f, 0.4f); } From 1da1a257adf9965309ab115969f901c0f7ad6d1b Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sun, 28 Apr 2024 06:04:56 +0900 Subject: [PATCH 24/48] Fix Baby Cannonball Jellyfish bestiary bug (#36) --- NPCs/Abyss/BabyCannonballJellyfish.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NPCs/Abyss/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs index 005e45e222..1799c81f6d 100644 --- a/NPCs/Abyss/BabyCannonballJellyfish.cs +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -19,11 +19,12 @@ namespace CalamityMod.NPCs.Abyss public class BabyCannonballJellyfish : ModNPC { public bool hasBeenHit = false; + public int explosionDamage; public override void SetStaticDefaults() { Main.npcFrameCount[NPC.type] = 7; - //Main.npcCatchable[NPC.type] = true; + Main.npcCatchable[NPC.type] = true; NPCID.Sets.CountsAsCritter[NPC.type] = true; } @@ -34,7 +35,8 @@ namespace CalamityMod.NPCs.Abyss NPC.chaseable = false; NPC.aiStyle = -1; AIType = -1; - NPC.damage = 30; + NPC.damage = 0; + explosionDamage = 30; NPC.width = 28; NPC.height = 36; NPC.defense = 0; @@ -157,7 +159,7 @@ namespace CalamityMod.NPCs.Abyss NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox))) - player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, NPC.direction); + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), explosionDamage, NPC.direction); for (int k = 0; k < 8; k++) { int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 1f); @@ -169,8 +171,6 @@ namespace CalamityMod.NPCs.Abyss NPC.netUpdate = true; } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => NPC.life <= 0; - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 2; k++) From ae69405e71ef60436ff7988bfe7f2ac55a2ce017 Mon Sep 17 00:00:00 2001 From: JavidPack Date: Thu, 2 May 2024 10:13:24 -0600 Subject: [PATCH 25/48] Fix IndexOutOfRangeException in ILChanges.ColorBlightedGel (#37) --- ILEditing/VanillaStupidityFixingILChanges.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index a6d129466d..5ce54fa4cd 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -289,7 +289,7 @@ namespace CalamityMod.ILEditing // Sync the color changes. if (colorWasChanged) - NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, itemID, 1f); + NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, itemIndex, 1f); } #endregion Color Blighted Gel From 5757d54f566382547d904e7ab5226cf0bbe52331 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Thu, 2 May 2024 22:00:59 +0500 Subject: [PATCH 26/48] Base --- CalamityConditions.cs | 96 +++++++++++++++++++++++++++++ Items/SummonItems/BloodyWormFood.cs | 15 +++-- Items/SummonItems/Teratoma.cs | 3 +- NPCs/CalamityGlobalTownNPC.cs | 14 ++--- NPCs/TownNPCs/DILF.cs | 2 +- NPCs/TownNPCs/FAP.cs | 4 +- NPCs/TownNPCs/SEAHOE.cs | 2 +- NPCs/TownNPCs/THIEF.cs | 8 +-- Tiles/Pylons/AstralPylonTile.cs | 3 +- Tiles/Pylons/CragsPylonTile.cs | 3 +- Tiles/Pylons/SulphurPylonTile.cs | 3 +- Tiles/Pylons/SunkenPylonTile.cs | 3 +- Utilities/DropHelper.cs | 68 ++++++++++---------- 13 files changed, 157 insertions(+), 67 deletions(-) create mode 100644 CalamityConditions.cs diff --git a/CalamityConditions.cs b/CalamityConditions.cs new file mode 100644 index 0000000000..41fbf295d3 --- /dev/null +++ b/CalamityConditions.cs @@ -0,0 +1,96 @@ +using System; +using CalamityMod.World; +using Terraria; +using Terraria.Localization; + +namespace CalamityMod +{ + public static class CalamityConditions + { + private static Condition Create(string key, Func predicate) + { + return new Condition( + Language.GetText($"Mods.CalamityMod.Condition.{key}"), + predicate + ); + } + + // + // Config based conditions + // + + public static readonly Condition PotionSellingConfig = Create("Drops.PotionConfig", () => CalamityConfig.Instance.PotionSelling); + + // + // Player conditions + // + + public static readonly Condition PlayerHasRogueArmor = Create("HasRogueArmor", () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); + public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0); + public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning); + + // + // Calamity Event Flag conditions + // + + public static readonly Condition DownedAcidRainT1 = Create("Drops.DownedT1AR", () => DownedBossSystem.downedEoCAcidRain); + public static readonly Condition DownedAcidRainT2 = Create("Drops.DownedT2AR", () => DownedBossSystem.downedAquaticScourgeAcidRain); + + // + // Calamity Boss Flag conditions + // + + public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge); + public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedDesertScourge); + public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind); + public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator); + public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod); + public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen); + public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge); + public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental); + public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone); + public static readonly Condition DownedLeviathan = Create("Drops.DownedLebi", () => DownedBossSystem.downedLeviathan); + public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus); + public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer); + public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager); + public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus); + public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians); + public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly); + public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence); + public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus); + public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver); + public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid); + public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast); + public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke); + public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG); + public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon); + public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs); + public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas); + public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm); + public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM); + public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode); + public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS); + + // Mixed + public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.TODO", () => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator); + public static readonly Condition DownedCalamitasCloneOrPlantera = Create("Drops.DownedCalPlant", () => DownedBossSystem.downedCalamitasClone || Condition.DownedPlantera.IsMet()); + + // Vanilla + public static readonly Condition DownedBetsy = Create("Drops.DownedBetsy", () => DownedBossSystem.downedBetsy); + + // + // Calamity Biome conditions + // + + public static readonly Condition InAstral = Create("InAstral", () => Main.LocalPlayer.Calamity().ZoneAstral); + public static readonly Condition InCrag = Create("InCrag", () => Main.LocalPlayer.Calamity().ZoneCalamity); + public static readonly Condition InSulph = Create("InSulph", () => Main.LocalPlayer.Calamity().ZoneSulphur); + public static readonly Condition InSunken = Create("InSunken", () => Main.LocalPlayer.Calamity().ZoneSunkenSea); + + // + // World based conditions + // + + public static readonly Condition InRevengeanceMode = Create("Condition.InRev", () => CalamityWorld.revenge); + } +} diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index a78f2d3142..afde718345 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -50,14 +50,13 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { - Condition downedPerfs = new(CalamityUtils.GetText("Condition.DownedPerfs"), () => DownedBossSystem.downedPerforator); - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 3). - AddIngredient(7). - AddIngredient(ItemID.Vertebrae, 13). - AddTile(TileID.DemonAltar). - AddDecraftCondition(downedPerfs). - Register(); + CreateRecipe() + .AddIngredient(ItemID.CrimtaneBar, 3) + .AddIngredient(7) + .AddIngredient(ItemID.Vertebrae, 13) + .AddTile(TileID.DemonAltar) + .AddDecraftCondition(CalamityConditions.DownedPerforator) + .Register(); } } } diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index b1b9e15a89..6f5f8f3247 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -50,13 +50,12 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { - Condition downedHM = new(CalamityUtils.GetText("Condition.DownedHM"), () => DownedBossSystem.downedHiveMind); CreateRecipe(). AddIngredient(ItemID.DemoniteBar, 3). AddIngredient(7). AddIngredient(ItemID.RottenChunk, 13). AddTile(TileID.DemonAltar). - AddDecraftCondition(downedHM). + AddDecraftCondition(Condition.Hardmode). Register(); } } diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index a192ded31d..9260b663af 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1067,14 +1067,14 @@ namespace CalamityMod.NPCs bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.9; - Condition potionSells = new(CalamityUtils.GetText("Condition.PotionConfig"), () => CalamityConfig.Instance.PotionSelling); + Condition potionSells = CalamityConditions.PotionSellingConfig; Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); - Condition roguePlayer = new(CalamityUtils.GetText("Condition.HasRogueArmor"), () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); - Condition wingedPlayer = new(CalamityUtils.GetText("Condition.HasWings"), () => Main.LocalPlayer.wingTimeMax > 0); - Condition revengeance = new(CalamityUtils.GetText("Condition.InRev"), () => CalamityWorld.revenge); - Condition drunk = new(CalamityUtils.GetText("Condition.AlcoholPoison"), () => Main.LocalPlayer.Calamity().alcoholPoisoning); - Condition downedPolterghast = new(CalamityUtils.GetText("Condition.PostPolter"), () => DownedBossSystem.downedPolterghast); - Condition downedDoG = new(CalamityUtils.GetText("Condition.PostDoG"), () => DownedBossSystem.downedDoG); + Condition roguePlayer = CalamityConditions.PlayerHasRogueArmor; + Condition wingedPlayer = CalamityConditions.PlayerHasWings; + Condition revengeance = CalamityConditions.InRevengeanceMode; + Condition drunk = CalamityConditions.PlayerAlcoholPoisoned; + Condition downedPolterghast = CalamityConditions.DownedPolterghast; + Condition downedDoG = CalamityConditions.DownedDevourerOfGods; if (type == NPCID.Merchant) { diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index d692fdbc60..6b0f00db73 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.TownNPCs public override void AddShops() { - Condition potionSells = new(CalamityUtils.GetText("Condition.PotionConfig"), () => CalamityConfig.Instance.PotionSelling); + Condition potionSells = CalamityConditions.PotionSellingConfig; NPCShop shop = new(Type); shop.Add(ModContent.ItemType()) .Add(ModContent.ItemType()) diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 2aa452a208..c8b3de85df 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -300,8 +300,8 @@ namespace CalamityMod.NPCs.TownNPCs public override void AddShops() { - Condition potionSells = new(CalamityUtils.GetText("Condition.PotionConfig"), () => CalamityConfig.Instance.PotionSelling); - Condition downedAureus = new(CalamityUtils.GetText("Condition.PostAureus"), () => DownedBossSystem.downedAstrumAureus); + Condition potionSells = CalamityConditions.PotionSellingConfig; + Condition downedAureus = CalamityConditions.DownedAstrumAureus; NPCShop shop = new(Type); shop.AddWithCustomValue(ItemID.LovePotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 8f4b9f19ec..4678f5ae7d 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.TownNPCs } public override void AddShops() { - Condition downedOldDuke = new(CalamityUtils.GetText("Condition.PostOD"), () => DownedBossSystem.downedBoomerDuke); + Condition downedOldDuke = CalamityConditions.DownedOldDuke; NPCShop shop = new(Type); shop.Add(ModContent.ItemType()) diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index ade7a0d833..29602dd9a0 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -259,10 +259,10 @@ namespace CalamityMod.NPCs.TownNPCs } public override void AddShops() { - Condition potionSells = new(CalamityUtils.GetText("Condition.PotionConfig"), () => CalamityConfig.Instance.PotionSelling); - Condition downedCalclone = new(CalamityUtils.GetText("Condition.PostCal"), () => DownedBossSystem.downedCalamitasClone); - Condition downedDoG = new(CalamityUtils.GetText("Condition.PostDoG"), () => DownedBossSystem.downedDoG); - Condition downedYharon = new(CalamityUtils.GetText("Condition.PostYharon"), () => DownedBossSystem.downedYharon); + Condition potionSells = CalamityConditions.PotionSellingConfig; + Condition downedCalclone = CalamityConditions.DownedCalamitasClone; + Condition downedDoG = CalamityConditions.DownedDevourerOfGods; + Condition downedYharon = CalamityConditions.DownedYharon; NPCShop shop = new(Type); shop.AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) diff --git a/Tiles/Pylons/AstralPylonTile.cs b/Tiles/Pylons/AstralPylonTile.cs index 9a95f6053f..1aeac063ef 100644 --- a/Tiles/Pylons/AstralPylonTile.cs +++ b/Tiles/Pylons/AstralPylonTile.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Tiles.Pylons public override NPCShop.Entry GetNPCShopEntry() { - Condition biomeCondition = new Condition(CalamityUtils.GetText("Condition.InAstral"), () => Main.LocalPlayer.Calamity().ZoneAstral); - return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, biomeCondition); + return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, CalamityConditions.InAstral); } diff --git a/Tiles/Pylons/CragsPylonTile.cs b/Tiles/Pylons/CragsPylonTile.cs index fa711e50a6..a4987d44d6 100644 --- a/Tiles/Pylons/CragsPylonTile.cs +++ b/Tiles/Pylons/CragsPylonTile.cs @@ -19,8 +19,7 @@ namespace CalamityMod.Tiles.Pylons public override NPCShop.Entry GetNPCShopEntry() { - Condition biomeCondition = new Condition(CalamityUtils.GetText("Condition.InCrag"), () => Main.LocalPlayer.Calamity().ZoneCalamity); - return new NPCShop.Entry(AssociatedItem, biomeCondition); + return new NPCShop.Entry(AssociatedItem, CalamityConditions.InCrag); } //Doesnt require npcs to function diff --git a/Tiles/Pylons/SulphurPylonTile.cs b/Tiles/Pylons/SulphurPylonTile.cs index 825e594738..39f2718703 100644 --- a/Tiles/Pylons/SulphurPylonTile.cs +++ b/Tiles/Pylons/SulphurPylonTile.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Tiles.Pylons public override NPCShop.Entry GetNPCShopEntry() { - Condition biomeCondition = new Condition(CalamityUtils.GetText("Condition.InSulph"), () => Main.LocalPlayer.Calamity().ZoneSulphur); - return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, biomeCondition); + return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, CalamityConditions.InSulph); } public override bool ValidTeleportCheck_BiomeRequirements(TeleportPylonInfo pylonInfo, SceneMetrics sceneData) => BiomeTileCounterSystem.SulphurTiles >= 100; diff --git a/Tiles/Pylons/SunkenPylonTile.cs b/Tiles/Pylons/SunkenPylonTile.cs index 74dc1115c1..8f48db51bf 100644 --- a/Tiles/Pylons/SunkenPylonTile.cs +++ b/Tiles/Pylons/SunkenPylonTile.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Tiles.Pylons public override NPCShop.Entry GetNPCShopEntry() { - Condition biomeCondition = new Condition(CalamityUtils.GetText("Condition.InSunken"), () => Main.LocalPlayer.Calamity().ZoneSunkenSea); - return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, biomeCondition); + return new NPCShop.Entry(AssociatedItem, Condition.AnotherTownNPCNearby, CalamityConditions.InSunken); } public override bool ValidTeleportCheck_BiomeRequirements(TeleportPylonInfo pylonInfo, SceneMetrics sceneData) => BiomeTileCounterSystem.SunkenSeaTiles >= 100; diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 5ce9c2e0bf..3e9d3800fc 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -561,13 +561,13 @@ namespace CalamityMod }); #region Boss Defeat Conditionals - public static IItemDropRuleCondition PostKS(bool ui = true) => If(() => NPC.downedSlimeKing, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedKS")); - public static IItemDropRuleCondition PostDS(bool ui = true) => If(() => DownedBossSystem.downedDesertScourge, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDS")); + public static IItemDropRuleCondition PostKS(bool ui = true) => If(Condition.DownedKingSlime.Predicate, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedKS")); + public static IItemDropRuleCondition PostDS(bool ui = true) => CalamityConditions.DownedDesertScourge.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostEoC(bool ui = true) => If(() => NPC.downedBoss1, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedEoC")); - public static IItemDropRuleCondition PostCrab(bool ui = true) => If(() => DownedBossSystem.downedCrabulon, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedCrab")); + public static IItemDropRuleCondition PostCrab(bool ui = true) => CalamityConditions.DownedCrabulon.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostEvil1(bool ui = true) => If(() => NPC.downedBoss2, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed" + (WorldGen.crimson ? "BoC" : "EoW"))); - public static IItemDropRuleCondition PostHM(bool ui = true) => If(() => DownedBossSystem.downedHiveMind, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedHM")); - public static IItemDropRuleCondition PostPerfs(bool ui = true) => If(() => DownedBossSystem.downedPerforator, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedPerfs")); + public static IItemDropRuleCondition PostHM(bool ui = true) => CalamityConditions.DownedHiveMind.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostPerfs(bool ui = true) => CalamityConditions.DownedPerforator.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostEvil2(bool ui = true) => If(() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed" + (WorldGen.crimson ? "Perfs" : "HM"))); public static IItemDropRuleCondition PostQB(bool ui = true) => If(() => NPC.downedQueenBee, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedQB")); public static IItemDropRuleCondition PostDeer(bool ui = true) => If(() => NPC.downedDeerclops, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDeer")); @@ -575,46 +575,46 @@ namespace CalamityMod public static IItemDropRuleCondition PostSG(bool ui = true) => If(() => DownedBossSystem.downedSlimeGod, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSG")); public static IItemDropRuleCondition Hardmode(bool ui = true) => If(() => Main.hardMode, ui, CalamityUtils.GetTextValue("Condition.Drops.Hardmode")); public static IItemDropRuleCondition PostQS(bool ui = true) => If(() => NPC.downedQueenSlime, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedQS")); - public static IItemDropRuleCondition PostCryo(bool ui = true) => If(() => DownedBossSystem.downedCryogen, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedCryo")); - public static IItemDropRuleCondition PostAS(bool ui = true) => If(() => DownedBossSystem.downedAquaticScourge, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedAS")); - public static IItemDropRuleCondition PostBrim(bool ui = true) => If(() => DownedBossSystem.downedBrimstoneElemental, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedBrim")); + public static IItemDropRuleCondition PostCryo(bool ui = true) => CalamityConditions.DownedCryogen.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostAS(bool ui = true) => CalamityConditions.DownedAquaticScourge.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostBrim(bool ui = true) => CalamityConditions.DownedBrimstoneElemental.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostDest(bool ui = true) => If(() => NPC.downedMechBoss1, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDest")); public static IItemDropRuleCondition PostTwins(bool ui = true) => If(() => NPC.downedMechBoss2, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedTwins")); public static IItemDropRuleCondition PostSP(bool ui = true) => If(() => NPC.downedMechBoss3, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSP")); public static IItemDropRuleCondition Post1Mech(bool ui = true) => If(() => NPC.downedMechBossAny, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed1Mech")); public static IItemDropRuleCondition Post3Mechs(bool ui = true) => If(() => NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed3Mechs")); - public static IItemDropRuleCondition PostCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitasClone, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedCal")); + public static IItemDropRuleCondition PostCal(bool ui = true) => CalamityConditions.DownedCalamitasClone.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostPlant(bool ui = true) => If(() => NPC.downedPlantBoss, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedPlant")); - public static IItemDropRuleCondition PostCalPlant(bool ui = true) => If(() => DownedBossSystem.downedCalamitasClone || NPC.downedPlantBoss, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedCalPlant")); - public static IItemDropRuleCondition PostLevi(bool ui = true) => If(() => DownedBossSystem.downedLeviathan, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedLebi")); - public static IItemDropRuleCondition PostAureus(bool ui = true) => If(() => DownedBossSystem.downedAstrumAureus, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedAureus")); + public static IItemDropRuleCondition PostCalPlant(bool ui = true) => CalamityConditions.DownedCalamitasCloneOrPlantera.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostLevi(bool ui = true) => CalamityConditions.DownedLeviathan.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostAureus(bool ui = true) => CalamityConditions.DownedAstrumAureus.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostGolem(bool ui = true) => If(() => NPC.downedGolemBoss, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedGolem")); - public static IItemDropRuleCondition PostPBG(bool ui = true) => If(() => DownedBossSystem.downedPlaguebringer, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedPBG")); + public static IItemDropRuleCondition PostPBG(bool ui = true) => CalamityConditions.DownedPlaguebringer.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostEoL(bool ui = true) => If(() => NPC.downedEmpressOfLight, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedEoL")); public static IItemDropRuleCondition PostFish(bool ui = true) => If(() => NPC.downedFishron, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedFish")); - public static IItemDropRuleCondition PostRav(bool ui = true) => If(() => DownedBossSystem.downedRavager, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedRav")); + public static IItemDropRuleCondition PostRav(bool ui = true) => CalamityConditions.DownedRavager.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostLC(bool ui = true) => If(() => NPC.downedAncientCultist, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedLC")); - public static IItemDropRuleCondition PostAD(bool ui = true) => If(() => DownedBossSystem.downedAstrumDeus, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedAD")); + public static IItemDropRuleCondition PostAD(bool ui = true) => CalamityConditions.DownedAstrumDeus.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostML(bool ui = true) => If(() => NPC.downedMoonlord, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedML")); - public static IItemDropRuleCondition PostGuard(bool ui = true) => If(() => DownedBossSystem.downedGuardians, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedGuard")); - public static IItemDropRuleCondition PostBirb(bool ui = true) => If(() => DownedBossSystem.downedDragonfolly, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedBirb")); - public static IItemDropRuleCondition PostProv(bool ui = true) => If(() => DownedBossSystem.downedProvidence, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedProv")); - public static IItemDropRuleCondition PostSig(bool ui = true) => If(() => DownedBossSystem.downedSignus, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSig")); - public static IItemDropRuleCondition PostSW(bool ui = true) => If(() => DownedBossSystem.downedStormWeaver, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSW")); - public static IItemDropRuleCondition PostCV(bool ui = true) => If(() => DownedBossSystem.downedCeaselessVoid, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedCV")); - public static IItemDropRuleCondition PostPolter(bool ui = true) => If(() => DownedBossSystem.downedPolterghast, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedPolter")); - public static IItemDropRuleCondition PostOD(bool ui = true) => If(() => DownedBossSystem.downedBoomerDuke, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedOD")); - public static IItemDropRuleCondition PostDoG(bool ui = true) => If(() => DownedBossSystem.downedDoG, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDoG")); - public static IItemDropRuleCondition PostYharon(bool ui = true) => If(() => DownedBossSystem.downedYharon, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedYharon")); - public static IItemDropRuleCondition PostExos(bool ui = true) => If(() => DownedBossSystem.downedExoMechs, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedExos")); - public static IItemDropRuleCondition PostSCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitas, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSCal")); - public static IItemDropRuleCondition PostAEW(bool ui = true) => If(() => DownedBossSystem.downedPrimordialWyrm, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedAEW")); - public static IItemDropRuleCondition PostClam(bool ui = true) => If(() => DownedBossSystem.downedCLAM, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedClam")); - public static IItemDropRuleCondition PostClamHM(bool ui = true) => If(() => DownedBossSystem.downedCLAMHardMode, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedClamHM")); - public static IItemDropRuleCondition PostGSS(bool ui = true) => If(() => DownedBossSystem.downedGSS, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedGSS")); - public static IItemDropRuleCondition PostBetsy(bool ui = true) => If(() => DownedBossSystem.downedBetsy, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedBetsy")); - public static IItemDropRuleCondition PostT1AR(bool ui = true) => If(() => DownedBossSystem.downedEoCAcidRain, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedT1AR")); - public static IItemDropRuleCondition PostT2AR(bool ui = true) => If(() => DownedBossSystem.downedAquaticScourgeAcidRain, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedT2AR")); + public static IItemDropRuleCondition PostGuard(bool ui = true) => CalamityConditions.DownedGuardians.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostBirb(bool ui = true) => CalamityConditions.DownedBumblebird.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostProv(bool ui = true) => CalamityConditions.DownedProvidence.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSig(bool ui = true) => CalamityConditions.DownedSignus.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSW(bool ui = true) => CalamityConditions.DownedStormWeaver.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostCV(bool ui = true) => CalamityConditions.DownedCeaselessVoid.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostPolter(bool ui = true) => CalamityConditions.DownedPolterghast.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostOD(bool ui = true) => CalamityConditions.DownedOldDuke.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostDoG(bool ui = true) => CalamityConditions.DownedDevourerOfGods.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostYharon(bool ui = true) => CalamityConditions.DownedYharon.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostExos(bool ui = true) => CalamityConditions.DownedExoMechs.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSCal(bool ui = true) => CalamityConditions.DownedSupremeCalamitas.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostAEW(bool ui = true) => CalamityConditions.DownedPrimordialWyrm.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostClam(bool ui = true) => CalamityConditions.DownedClam.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostClamHM(bool ui = true) => CalamityConditions.DownedBuffedClam.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostGSS(bool ui = true) => CalamityConditions.DownedGreatSandShark.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostBetsy(bool ui = true) => CalamityConditions.DownedBetsy.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostT1AR(bool ui = true) => CalamityConditions.DownedAcidRainT1.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostT2AR(bool ui = true) => CalamityConditions.DownedAcidRainT2.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); #endregion #endregion From 161be4fe54d35cb749e2c590449d7b83b3d93518 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Thu, 2 May 2024 22:04:29 +0500 Subject: [PATCH 27/48] Fixed config condition having `Drops` prefix --- CalamityConditions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalamityConditions.cs b/CalamityConditions.cs index 41fbf295d3..fda507399c 100644 --- a/CalamityConditions.cs +++ b/CalamityConditions.cs @@ -19,7 +19,7 @@ namespace CalamityMod // Config based conditions // - public static readonly Condition PotionSellingConfig = Create("Drops.PotionConfig", () => CalamityConfig.Instance.PotionSelling); + public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityConfig.Instance.PotionSelling); // // Player conditions From bb5148e2cfca70fa15517a0ff6413978df59e53e Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Thu, 2 May 2024 23:04:09 +0500 Subject: [PATCH 28/48] Ported most/all player iterations --- CalPlayer/CalamityPlayerOnHit.cs | 7 +-- Events/AcidRainEvent.cs | 33 +++-------- Events/BossRushEvent.cs | 56 +++++++------------ Items/Accessories/ProfanedSoulArtifact.cs | 11 ++-- Items/Accessories/ProfanedSoulCrystal.cs | 5 +- Items/Accessories/RoverDrive.cs | 12 ++-- Items/Accessories/TheSponge.cs | 11 ++-- Items/Armor/LunicCorps/LunicCorpsHelmet.cs | 11 ++-- Items/Materials/WulfrumMetalScrap.cs | 4 +- Items/Mounts/AlicornMount.cs | 6 +- Items/Weapons/Rogue/Mycoroot.cs | 7 +-- NPCs/Abyss/BabyCannonballJellyfish.cs | 7 ++- NPCs/Abyss/CannonballJellyfish.cs | 10 +++- NPCs/AcidRain/BloodwormNormal.cs | 5 +- NPCs/Astral/Atlas.cs | 14 ++--- NPCs/Astral/Nova.cs | 8 +-- NPCs/CalamityAI.cs | 27 ++++----- NPCs/CalamityGlobalAI.cs | 10 ++-- NPCs/CalamityGlobalNPC.cs | 14 +---- NPCs/DesertScourge/DesertNuisanceHead.cs | 13 ++--- NPCs/DesertScourge/DesertScourgeHead.cs | 17 +++--- NPCs/DraedonLabThings/Androomba.cs | 9 +-- .../NanodroidDysfunctional.cs | 6 +- NPCs/DraedonLabThings/NanodroidPlagueGreen.cs | 6 +- NPCs/DraedonLabThings/NanodroidPlagueRed.cs | 6 +- NPCs/DraedonLabThings/RepairUnitCritter.cs | 6 +- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 16 +++--- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 14 ++--- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 16 +++--- NPCs/Leviathan/Anahita.cs | 8 +-- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 13 ++--- NPCs/Perforator/PerforatorHeadLarge.cs | 13 ++--- NPCs/Perforator/PerforatorHeadSmall.cs | 13 ++--- NPCs/PlagueEnemies/PlaguebringerMiniboss.cs | 9 +-- .../PlagueHomingMissile.cs | 5 +- .../PlaguebringerGoliath.cs | 7 +-- NPCs/PrimordialWyrm/PrimordialWyrmHead.cs | 16 +++--- NPCs/Providence/Providence.cs | 6 +- NPCs/SlimeGod/CrimulanPaladin.cs | 6 +- NPCs/SlimeGod/EbonianPaladin.cs | 6 +- NPCs/SlimeGod/SplitCrimulanPaladin.cs | 6 +- NPCs/SlimeGod/SplitEbonianPaladin.cs | 6 +- NPCs/TownNPCs/AndroombaFriendly.cs | 6 +- NPCs/TownNPCs/FAP.cs | 5 +- NPCs/TownNPCs/THIEF.cs | 5 +- .../VanillaNPCOverrides/Bosses/DeerclopsAI.cs | 12 ++-- .../VanillaNPCOverrides/Bosses/DestroyerAI.cs | 13 ++--- .../Bosses/EaterOfWorldsAI.cs | 17 +++--- .../Bosses/EmpressofLightAI.cs | 11 ++-- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 5 +- NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs | 4 +- Projectiles/Boss/OldDukeVortex.cs | 4 +- .../Boss/OverlyDramaticDukeSummoner.cs | 4 +- Projectiles/CalamityGlobalProjectile.cs | 5 +- Projectiles/Enemy/FlakAcid.cs | 4 +- Projectiles/Pets/LadShark.cs | 3 +- Projectiles/Rogue/IcebreakerHammer.cs | 3 +- Projectiles/Summon/WulfrumDroid.cs | 8 +-- .../Typeless/BossRushEndEffectThing.cs | 7 +-- Projectiles/Typeless/WulfrumLureSignal.cs | 6 +- Systems/WorldMiscUpdateSystem.cs | 6 +- TileEntities/TEChargingStation.cs | 5 +- TileEntities/TEHostileFireTurret.cs | 7 +-- TileEntities/TEHostileIceTurret.cs | 7 +-- TileEntities/TEHostileLabTurret.cs | 7 +-- TileEntities/TEHostileLaserTurret.cs | 7 +-- TileEntities/TEHostileOnyxTurret.cs | 7 +-- TileEntities/TEHostilePlagueTurret.cs | 7 +-- TileEntities/TEHostileWaterTurret.cs | 8 +-- TileEntities/TELabHologramProjector.cs | 13 ++--- TileEntities/TEPowerCellFactory.cs | 6 +- Utilities/DropHelper.cs | 5 +- World/AstralBiome.cs | 15 ++--- 73 files changed, 280 insertions(+), 423 deletions(-) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index a6e99b607d..71ae324a97 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1405,16 +1405,15 @@ namespace CalamityMod.CalPlayer float lowestHealthCheck = 0f; int healTarget = Player.whoAmI; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player otherPlayer in Main.ActivePlayers) { - Player otherPlayer = Main.player[i]; - if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) + if (!otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) { float playerDist = Vector2.Distance(target.Center, otherPlayer.Center); if (playerDist < 1200f && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) { lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = i; + healTarget = otherPlayer.whoAmI; } } } diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index d946bc32a9..6c7ee3be30 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -107,14 +107,8 @@ namespace CalamityMod.Events { get { - int playerCount = 0; - for (int i = 0; i < Main.player.Length; i++) - { - if (Main.player[i].active) - { - playerCount++; - } - } + int playerCount = Main.CurrentFrameFlags.ActivePlayersCount; + if (DownedBossSystem.downedPolterghast) return (int)(Math.Log(playerCount + Math.E - 1) * 170f); else if (DownedBossSystem.downedAquaticScourge) @@ -189,12 +183,7 @@ namespace CalamityMod.Events if (AcidRainEventIsOngoing || (!NPC.downedBoss1 && !Main.hardMode && !DownedBossSystem.downedAquaticScourge) || BossRushEvent.BossRushActive) return; - int playerCount = 0; - for (int i = 0; i < Main.player.Length; i++) - { - if (Main.player[i].active) - playerCount++; - } + int playerCount = Main.CurrentFrameFlags.ActivePlayersCount; if (playerCount > 0) { @@ -243,12 +232,8 @@ namespace CalamityMod.Events if (!HasStartedAcidicDownpour) { int sulphSeaWidth = SulphurousSea.BiomeWidth; - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[playerIndex]; - if (!player.active) - continue; - // An artificial biome can be made, and therefore, the event could be started by an artificial biome. // While fighting the event in an artificial biome is not bad, having it be started by a patch of Sulphurous Sand // would definitely be strange. @@ -387,11 +372,9 @@ namespace CalamityMod.Events if ((int)Main.time == (int)(Main.nightLength - 1f) && !Main.dayTime && Main.rand.NextBool(increasedEventChance ? 3 : 300)) { bool shouldNotStartEvent = false; - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player player in Main.ActivePlayers) { - if (!Main.player[playerIndex].active) - continue; - if (Main.player[playerIndex].Calamity().noStupidNaturalARSpawns) + if (player.Calamity().noStupidNaturalARSpawns) { shouldNotStartEvent = true; break; @@ -407,9 +390,9 @@ namespace CalamityMod.Events // Attempt to force an Acid Rain immediately after the EoC is dead when someone wanders to the sea. if (NPC.downedBoss1 && !DownedBossSystem.downedEoCAcidRain && !HasBeenForceStartedByEoCDefeat) { - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[playerIndex].active && Main.player[playerIndex].Calamity().ZoneSulphur) + if (player.Calamity().ZoneSulphur) { HasBeenForceStartedByEoCDefeat = true; TryStartEvent(); diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index d1bb856f19..1fcad8cc9b 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -318,14 +318,10 @@ namespace CalamityMod.Events new Boss(ModContent.NPCType(), spawnContext: type => { - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[playerIndex]; - if (p is not null && p.active) - { - if (p.FindBuffIndex(ModContent.BuffType()) > -1) - p.ClearBuff(ModContent.BuffType()); - } + if (p.FindBuffIndex(ModContent.BuffType()) > -1) + p.ClearBuff(ModContent.BuffType()); } Player player = Main.player[ClosestPlayerToWorldCenter]; @@ -413,19 +409,15 @@ namespace CalamityMod.Events BossRushDialogueSystem.StartDialogue(BossRushDialoguePhase.TierOneComplete); // Teleport players to where they came from - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[playerIndex]; - if (p is not null && p.active) + if (p.Calamity().BossRushReturnPosition.HasValue) { - if (p.Calamity().BossRushReturnPosition.HasValue) - { - CalamityPlayer.ModTeleport(p, p.Calamity().BossRushReturnPosition.Value, false, TeleportationStyleID.TeleportationPotion); - p.Calamity().BossRushReturnPosition = null; - } + CalamityPlayer.ModTeleport(p, p.Calamity().BossRushReturnPosition.Value, false, TeleportationStyleID.TeleportationPotion); p.Calamity().BossRushReturnPosition = null; - SoundEngine.PlaySound(TeleportSound with { Volume = 1.6f }, p.Center); } + p.Calamity().BossRushReturnPosition = null; + SoundEngine.PlaySound(TeleportSound with { Volume = 1.6f }, p.Center); } }, // Plantera: End of Tier 2 @@ -622,13 +614,9 @@ namespace CalamityMod.Events public static void End() { // Reset BossRushReturnPosition - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[playerIndex]; - if (p is not null && p.active) - { - p.Calamity().BossRushReturnPosition = null; - } + p.Calamity().BossRushReturnPosition = null; } if (Main.netMode == NetmodeID.SinglePlayer) @@ -729,18 +717,14 @@ namespace CalamityMod.Events CalamityUtils.KillAllHostileProjectiles(); HostileProjectileKillCounter = 3; - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[playerIndex]; - if (p is not null && p.active) - { - p.Calamity().BossRushReturnPosition = p.Center; - Vector2? underworld = CalamityPlayer.GetUnderworldPosition(p); - if (!underworld.HasValue) - break; - CalamityPlayer.ModTeleport(p, underworld.Value, false, TeleportationStyleID.TeleportationPotion); - SoundEngine.PlaySound(TeleportSound with { Volume = 1.6f }, p.Center); - } + p.Calamity().BossRushReturnPosition = p.Center; + Vector2? underworld = CalamityPlayer.GetUnderworldPosition(p); + if (!underworld.HasValue) + break; + CalamityPlayer.ModTeleport(p, underworld.Value, false, TeleportationStyleID.TeleportationPotion); + SoundEngine.PlaySound(TeleportSound with { Volume = 1.6f }, p.Center); } } @@ -788,12 +772,12 @@ namespace CalamityMod.Events { if (Main.netMode != NetmodeID.MultiplayerClient) { - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player p in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (p.dead) continue; - int animation = Projectile.NewProjectile(new EntitySource_WorldEvent(), Main.player[i].Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, i); + int animation = Projectile.NewProjectile(new EntitySource_WorldEvent(), p.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, p.whoAmI); if (Main.projectile.IndexInRange(animation)) Main.projectile[animation].ai[0] = tier; } diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 73435d4366..5135eb5d63 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -36,10 +36,9 @@ namespace CalamityMod.Items.Accessories get { bool result = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -110,10 +109,9 @@ namespace CalamityMod.Items.Accessories // Visibility is not net synced, for example. bool alreadyDrawnShieldForPlayer = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -127,6 +125,7 @@ namespace CalamityMod.Items.Accessories // Scale the shield is drawn at. // The "i" parameter is to make different player's shields not be perfectly synced. + int i = player.whoAmI; float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + i * 0.2f)); if (!alreadyDrawnShieldForPlayer) diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 2e1ec84035..acee5d0e7e 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -42,10 +42,9 @@ namespace CalamityMod.Items.Accessories get { bool result = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index cb944d74ce..439eb1af70 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -36,10 +36,9 @@ namespace CalamityMod.Items.Accessories get { bool result = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -104,10 +103,9 @@ namespace CalamityMod.Items.Accessories // Visibility is not net synced, for example. bool alreadyDrawnShieldForPlayer = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -119,7 +117,7 @@ namespace CalamityMod.Items.Accessories continue; // The shield very gently grows and shrinks - float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + i * 0.2f)); + float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + player.whoAmI * 0.2f)); if (!alreadyDrawnShieldForPlayer) { diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 0c105a0a3d..bc93e1448c 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -45,10 +45,9 @@ namespace CalamityMod.Items.Accessories get { bool result = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -171,10 +170,9 @@ namespace CalamityMod.Items.Accessories // Visibility is not net synced, for example. bool alreadyDrawnShieldForPlayer = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -187,6 +185,7 @@ namespace CalamityMod.Items.Accessories // Scale the shield is drawn at. The Sponge shield gently grows and shrinks; it should be largely imperceptible. // The "i" parameter is to make different player's shields not be perfectly synced. + int i = player.whoAmI; float baseScale = 0.155f; float maxExtraScale = 0.025f; float extraScalePulseInterpolant = MathF.Pow(4f, MathF.Sin(Main.GlobalTimeWrappedHourly * 0.791f + i) - 1); diff --git a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs index 58a4fa7c33..611ea672bc 100644 --- a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs +++ b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs @@ -41,10 +41,9 @@ namespace CalamityMod.Items.Armor.LunicCorps get { bool result = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -112,10 +111,9 @@ namespace CalamityMod.Items.Armor.LunicCorps // Visibility is not net synced, for example. bool alreadyDrawnShieldForPlayer = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active || player.outOfRange || player.dead) + if (player.outOfRange || player.dead) continue; CalamityPlayer modPlayer = player.Calamity(); @@ -126,6 +124,7 @@ namespace CalamityMod.Items.Armor.LunicCorps // Scale the shield is drawn at. The Lunic Corps shield sticks very close to the body to mimic Halo and occasionally pulses. // The "i" parameter is to make different player's shields not be perfectly synced. + int i = player.whoAmI; float baseScale = 0.11f; float maxExtraScale = 0.013f; float extraScalePulseInterpolant = MathF.Pow(12f, MathF.Sin(Main.GlobalTimeWrappedHourly * 1.6f + i) - 1); diff --git a/Items/Materials/WulfrumMetalScrap.cs b/Items/Materials/WulfrumMetalScrap.cs index 5752684df2..1e32325171 100644 --- a/Items/Materials/WulfrumMetalScrap.cs +++ b/Items/Materials/WulfrumMetalScrap.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Items.Materials bool closePlayer = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - if ((Main.player[i].Center - Item.Center).Length() < 1200 && Main.player[i].GetModPlayer().battery) + if ((player.Center - Item.Center).Length() < 1200 && player.GetModPlayer().battery) { closePlayer = true; break; diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 3e03ae4e5b..7f363781da 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -85,12 +85,8 @@ namespace CalamityMod.Items.Mounts public override void Dismount(Player player, ref bool skipDust) { bool anyPlayerOnFabMount = false; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player2 in Main.ActivePlayers) { - Player player2 = Main.player[i]; - if (!player2.active) - continue; - // The player that is dismounting is technically not on the mount anymore. if (player2.Calamity().fab && player2.whoAmI != player.whoAmI) { diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index 1234245668..c168bd84f7 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -43,12 +43,11 @@ namespace CalamityMod.Items.Weapons.Rogue if (spore.WithinBounds(Main.maxProjectiles)) Main.projectile[spore].ai[1] = 1f; } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player other in Main.ActivePlayers) { - Player other = Main.player[i]; - if (other is null || !other.active || other.dead) + if (other.dead) continue; - if ((other.team == player.team && player.team != 0) || player.whoAmI == i) + if ((other.team == player.team && player.team != 0) || player.whoAmI == other.whoAmI) { if (player.Distance(other.Center) <= 800f) other.AddBuff(ModContent.BuffType(), 900); diff --git a/NPCs/Abyss/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs index 1799c81f6d..f37e23f812 100644 --- a/NPCs/Abyss/BabyCannonballJellyfish.cs +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -158,8 +158,13 @@ namespace CalamityMod.NPCs.Abyss NPC.height = (int)(NPC.height * 3f); NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound - foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox))) + foreach (Player player in Main.ActivePlayers) + { + if (player.dead || !NPC.Hitbox.Intersects(player.Hitbox)) + continue; + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), explosionDamage, NPC.direction); + } for (int k = 0; k < 8; k++) { int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 1f); diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 9ac54fa763..b13a6e1a4a 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -267,8 +267,14 @@ namespace CalamityMod.NPCs.Abyss NPC.width = NPC.height; NPC.position -= NPC.Size * 0.5f; //hitbox expansion + adjustments SoundEngine.PlaySound(SoundID.Item14, NPC.Center); //bomb sound - foreach (Player player in Main.player.Where(player => player.active && !player.dead && NPC.Hitbox.Intersects(player.Hitbox))) - player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage * 3, NPC.direction); //Due to how slow the jelly is, this might catch you unaware, but then you'll never get hit by it again + foreach (Player player in Main.ActivePlayers) + { + if (player.dead || !NPC.Hitbox.Intersects(player.Hitbox)) + continue; + + //Due to how slow the jelly is, this might catch you unaware, but then you'll never get hit by it again + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage * 3, NPC.direction); + } for (int k = 0; k < 25; k++) { int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.MoonBoulder, 0f, -1f, 0, default, 2f); diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index c303aa1459..a525547dcb 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -56,10 +56,9 @@ namespace CalamityMod.NPCs.AcidRain NPC.velocity.X = xSpeed * NPC.ai[0]; NPC.spriteDirection = (int)NPC.ai[0]; bool flee = false; - for (int i = 0; i < Main.player.Length; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player.active && !player.dead && Vector2.Distance(player.Center, NPC.Center) <= 220f) + if (!player.dead && Vector2.Distance(player.Center, NPC.Center) <= 220f) { flee = true; break; diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 10abbd321b..7baa072efa 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -263,13 +263,13 @@ namespace CalamityMod.NPCs.Astral centerY - height / 2, width, height); - for (int i = 0; i < Main.player.Length; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead && Main.player[i].getRect().Intersects(hitbox)) + if (!player.dead && player.getRect().Intersects(hitbox)) { - Vector2 before = Main.player[i].velocity; - Main.player[i].Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, NPC.direction); - Vector2 after = Main.player[i].velocity; + Vector2 before = player.velocity; + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, NPC.direction); + Vector2 after = player.velocity; Vector2 difference = after - before; float horMult = 3.5f; @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.Astral swingYeet = true; } - if (Main.player[i].noKnockback) + if (player.noKnockback) { horMult *= 0.5f; verMult *= 0.5f; @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.Astral difference *= new Vector2(horMult, verMult); - Main.player[i].velocity = before + difference; + player.velocity = before + difference; } } } diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 4453eb8aea..3e29dbb6e2 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -209,12 +209,12 @@ namespace CalamityMod.NPCs.Astral if (Main.netMode != NetmodeID.MultiplayerClient) { - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i].getRect().Intersects(myRect)) + if (player.getRect().Intersects(myRect)) { - int direction = NPC.Center.X - Main.player[i].Center.X < 0 ? -1 : 1; - Main.player[i].Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, direction); + int direction = NPC.Center.X - player.Center.X < 0 ? -1 : 1; + player.Hurt(PlayerDeathReason.ByNPC(NPC.whoAmI), NPC.damage, direction); } } } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 0bada01b73..a8fcf6dc2e 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3934,16 +3934,13 @@ namespace CalamityMod.NPCs if (npc.position.Y > player.position.Y) { - for (int m = 0; m < Main.maxPlayers; m++) + foreach (Player m in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle rectangle2 = new Rectangle((int)m.position.X - noFlyZone, (int)m.position.Y - noFlyZone, noFlyZone * 2, height); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - noFlyZone, (int)Main.player[m].position.Y - noFlyZone, noFlyZone * 2, height); - if (rectangle.Intersects(rectangle2)) - { - outsideNoFlyZone = false; - break; - } + outsideNoFlyZone = false; + break; } } if (outsideNoFlyZone) @@ -4522,20 +4519,20 @@ namespace CalamityMod.NPCs } float succPower = 0.125f + finalPhaseDustRatio * 0.125f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - float distance = Vector2.Distance(Main.player[i].Center, npc.Center); - if (distance < suckDistance && Main.player[i].grappling[0] == -1) + float distance = Vector2.Distance(plr.Center, npc.Center); + if (distance < suckDistance && plr.grappling[0] == -1) { - if (Collision.CanHit(npc.Center, 1, 1, Main.player[i].Center, 1, 1)) + if (Collision.CanHit(npc.Center, 1, 1, plr.Center, 1, 1)) { float distanceRatio = distance / suckDistance; float multiplier = 1f - distanceRatio; - if (Main.player[i].Center.X < npc.Center.X) - Main.player[i].velocity.X += succPower * multiplier; + if (plr.Center.X < npc.Center.X) + plr.velocity.X += succPower * multiplier; else - Main.player[i].velocity.X -= succPower * multiplier; + plr.velocity.X -= succPower * multiplier; } } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 1bf8483ec5..c6d2fbd8e3 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -1161,11 +1161,11 @@ namespace CalamityMod.NPCs int nailCount = Main.rand.Next(3, 6); int[] players = new int[nailCount]; int i = 0; - for (int j = 0; j < Main.player.Length; j++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[j].active && !Main.player[j].dead && Collision.CanHitLine(npc.position, npc.width, npc.height, Main.player[j].position, Main.player[j].width, Main.player[j].height)) + if (!plr.dead && Collision.CanHitLine(npc.position, npc.width, npc.height, plr.position, plr.width, plr.height)) { - players[i] = j; + players[i] = plr.whoAmI; i++; if (i == nailCount) { @@ -7637,9 +7637,9 @@ namespace CalamityMod.NPCs bool spawnTwinkle = npc.ai[1] >= (CalamityWorld.death ? 60f : 120f); if (!spawnTwinkle && npc.velocity.Y == 0f) { - for (int j = 0; j < Main.maxPlayers; j++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[j].active && !Main.player[j].dead && Main.player[j].Distance(npc.Center) < 800f && Main.player[j].Center.Y < npc.Center.Y && Math.Abs(Main.player[j].Center.X - npc.Center.X) < 20f) + if (!plr.dead && plr.Distance(npc.Center) < 800f && plr.Center.Y < npc.Center.Y && Math.Abs(plr.Center.X - npc.Center.X) < 20f) { spawnTwinkle = true; break; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 32d244820c..bee91818bf 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6230,9 +6230,9 @@ namespace CalamityMod.NPCs #region Player Counts public static bool AnyLivingPlayers() { - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i] != null && Main.player[i].active && !Main.player[i].dead && !Main.player[i].ghost) + if (!player.dead && !player.ghost) { return true; } @@ -6247,15 +6247,7 @@ namespace CalamityMod.NPCs return 1; } - int players = 0; - for (int i = 0; i < Main.maxPlayers; i++) - { - if (Main.player[i] != null && Main.player[i].active) - { - players++; - } - } - return players; + return Main.CurrentFrameFlags.ActivePlayersCount; } #endregion diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 9c0732dded..70af0714f8 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -167,16 +167,13 @@ namespace CalamityMod.NPCs.DesertScourge bool shouldDirectlyChase = true; if (NPC.position.Y > Main.player[NPC.target].position.Y) { - for (int m = 0; m < 255; m++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle rectangle2 = new Rectangle((int)plr.position.X - directChaseDistance, (int)plr.position.Y - directChaseDistance, directChaseDistance * 2, directChaseDistance * 2); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - directChaseDistance, (int)Main.player[m].position.Y - directChaseDistance, directChaseDistance * 2, directChaseDistance * 2); - if (rectangle.Intersects(rectangle2)) - { - shouldDirectlyChase = false; - break; - } + shouldDirectlyChase = false; + break; } } if (shouldDirectlyChase) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 4b558ac7d8..1ad7c807c8 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -354,18 +354,15 @@ namespace CalamityMod.NPCs.DesertScourge { int rectWidth = directChaseDistance * 2; int rectHeight = directChaseDistance * 2; - for (int m = 0; m < 255; m++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[m].active) + int rectX = (int)plr.position.X - directChaseDistance; + int rectY = (int)plr.position.Y - directChaseDistance; + Rectangle directChaseRect = new Rectangle(rectX, rectY, rectWidth, rectHeight); + if (rectangle.Intersects(directChaseRect)) { - int rectX = (int)Main.player[m].position.X - directChaseDistance; - int rectY = (int)Main.player[m].position.Y - directChaseDistance; - Rectangle directChaseRect = new Rectangle(rectX, rectY, rectWidth, rectHeight); - if (rectangle.Intersects(directChaseRect)) - { - shouldDirectlyChase = false; - break; - } + shouldDirectlyChase = false; + break; } } if (shouldDirectlyChase) diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index 99458991a0..ae09efe713 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -78,9 +78,8 @@ namespace CalamityMod.NPCs.DraedonLabThings NPC.ai[2] *= -1; } // If she sees someone, start running - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { ChangeAI(1); @@ -143,12 +142,8 @@ namespace CalamityMod.NPCs.DraedonLabThings break; } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { Main.BestiaryTracker.Kills.RegisterKill(NPC); diff --git a/NPCs/DraedonLabThings/NanodroidDysfunctional.cs b/NPCs/DraedonLabThings/NanodroidDysfunctional.cs index 0b710d0dda..d9c9f41edc 100644 --- a/NPCs/DraedonLabThings/NanodroidDysfunctional.cs +++ b/NPCs/DraedonLabThings/NanodroidDysfunctional.cs @@ -36,12 +36,8 @@ namespace CalamityMod.NPCs.DraedonLabThings { Lighting.AddLight(NPC.Center, 0.25f, 0.1f, 0f); } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { NPC nPC = new NPC(); diff --git a/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs b/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs index 7063b0f70c..9d75bb45d2 100644 --- a/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs +++ b/NPCs/DraedonLabThings/NanodroidPlagueGreen.cs @@ -36,12 +36,8 @@ namespace CalamityMod.NPCs.DraedonLabThings { Lighting.AddLight(NPC.Center, 0.03f, 0.3f, 0.05f); } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { NPC nPC = new NPC(); diff --git a/NPCs/DraedonLabThings/NanodroidPlagueRed.cs b/NPCs/DraedonLabThings/NanodroidPlagueRed.cs index 316f219b8c..d6ccfe8717 100644 --- a/NPCs/DraedonLabThings/NanodroidPlagueRed.cs +++ b/NPCs/DraedonLabThings/NanodroidPlagueRed.cs @@ -36,12 +36,8 @@ namespace CalamityMod.NPCs.DraedonLabThings { Lighting.AddLight(NPC.Center, 0.3f, 0.03f, 0f); } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { NPC nPC = new NPC(); diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 9f8d5e76b0..0d71c27a94 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -131,12 +131,8 @@ namespace CalamityMod.NPCs.DraedonLabThings } Time++; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { Main.BestiaryTracker.Kills.RegisterKill(NPC); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index b262f0b856..246be4a731 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -283,16 +283,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; @@ -347,16 +347,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 8c4d93d0a7..cb09c1182b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -281,12 +281,12 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { @@ -345,16 +345,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 73454ad0cf..267eed162d 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -281,16 +281,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; @@ -345,16 +345,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 6007a3c6b1..6c045a6ae8 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -489,13 +489,7 @@ namespace CalamityMod.NPCs.Leviathan float restingPlayerDistance = (float)Math.Sqrt(restingPlayerXDist * restingPlayerXDist + restingPlayerYDist * restingPlayerYDist); NPC.ai[1] += 1f; - int activePlayerAmt = 0; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && (vector - Main.player[i].Center).Length() < 1000f) - activePlayerAmt++; - } - NPC.ai[1] += activePlayerAmt / 2; + NPC.ai[1] += Main.CurrentFrameFlags.ActivePlayersCount / 2; bool spawnedBubble = false; float bubbleDelay = 20f; diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index a97631312d..8a25c963ad 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -165,16 +165,13 @@ namespace CalamityMod.NPCs.NormalNPCs bool outsideNoFlyZone = true; if (NPC.position.Y > Main.player[NPC.target].position.Y) { - for (int m = 0; m < 255; m++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle noFlyArea = new Rectangle((int)player.position.X - noFlyZone, (int)player.position.Y - noFlyZone, noFlyZone * 2, noFlyZone * 2); + if (rectangle.Intersects(noFlyArea)) { - Rectangle noFlyArea = new Rectangle((int)Main.player[m].position.X - noFlyZone, (int)Main.player[m].position.Y - noFlyZone, noFlyZone * 2, noFlyZone * 2); - if (rectangle.Intersects(noFlyArea)) - { - outsideNoFlyZone = false; - break; - } + outsideNoFlyZone = false; + break; } } if (outsideNoFlyZone) diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 74c0216cc6..796db7929b 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -255,16 +255,13 @@ namespace CalamityMod.NPCs.Perforator bool outsideFlyingRadius = true; if (NPC.position.Y > player.position.Y) { - for (int m = 0; m < 255; m++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle rectangle2 = new Rectangle((int)plr.position.X - stopFlyingRadius, (int)plr.position.Y - stopFlyingRadius, stopFlyingRadius * 2, stopFlyingRadius * 2); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - stopFlyingRadius, (int)Main.player[m].position.Y - stopFlyingRadius, stopFlyingRadius * 2, stopFlyingRadius * 2); - if (rectangle.Intersects(rectangle2)) - { - outsideFlyingRadius = false; - break; - } + outsideFlyingRadius = false; + break; } } if (outsideFlyingRadius) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index dd79644dc6..904ddb6b9e 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -228,16 +228,13 @@ namespace CalamityMod.NPCs.Perforator bool outsideFlyRadius = true; if (NPC.position.Y > player.position.Y) { - for (int m = 0; m < 255; m++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle rectangle2 = new Rectangle((int)plr.position.X - stopFlyingRadius, (int)plr.position.Y - stopFlyingRadius, stopFlyingRadius * 2, stopFlyingRadius * 2); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - stopFlyingRadius, (int)Main.player[m].position.Y - stopFlyingRadius, stopFlyingRadius * 2, stopFlyingRadius * 2); - if (rectangle.Intersects(rectangle2)) - { - outsideFlyRadius = false; - break; - } + outsideFlyRadius = false; + break; } } if (outsideFlyRadius) diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 78e7b7d9d7..204bb62417 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -92,14 +92,7 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.timeLeft = 750; } } - int playerAmt = 0; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && (NPC.Center - Main.player[i].Center).Length() < 1000f) - { - playerAmt++; - } - } + int playerAmt = Main.CurrentFrameFlags.ActivePlayersCount; if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) { NPC.TargetClosest(); diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index f60f882457..e83a3eaebc 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -140,10 +140,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } float distanceBeforeExploding = 42f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player.active && !player.dead && Vector2.Distance(player.Center, NPC.Center) <= distanceBeforeExploding) + if (!player.dead && Vector2.Distance(player.Center, NPC.Center) <= distanceBeforeExploding) { CheckDead(); NPC.life = 0; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 6b7f5bfe78..8f6b66774c 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -202,12 +202,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vectorCenter = NPC.Center; // Count nearby players - int activePlayers = 0; - for (int i = 0; i < Main.maxPlayers; i++) - { - if (Main.player[i].active && !Main.player[i].dead && (vectorCenter - Main.player[i].Center).Length() < 1000f) - activePlayers++; - } + int activePlayers = Main.CurrentFrameFlags.ActivePlayersCount; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 896e52d12c..eda8cb775b 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -601,16 +601,16 @@ namespace CalamityMod.NPCs.PrimordialWyrm int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; @@ -896,16 +896,16 @@ namespace CalamityMod.NPCs.PrimordialWyrm int numProjectiles = 0; float maxDistance = 2400f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (plr.dead) continue; - Vector2 playerCenter = Main.player[i].Center; + Vector2 playerCenter = plr.Center; float distance = Vector2.Distance(playerCenter, NPC.Center); if (distance < maxDistance) { - whoAmIArray[numProjectiles] = i; + whoAmIArray[numProjectiles] = plr.whoAmI; targetCenterArray[numProjectiles] = playerCenter; int projectileLimit = numProjectiles + 1; numProjectiles = projectileLimit; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 1b0547687b..e0cea09394 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1266,10 +1266,10 @@ namespace CalamityMod.NPCs.Providence if (NPC.ai[3] % 60f == 0f && expertMode) { List targets = new List(); - for (int p = 0; p < Main.maxPlayers; p++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[p].active && !Main.player[p].dead) - targets.Add(p); + if (!plr.dead) + targets.Add(plr.whoAmI); if (targets.Count > 4) break; diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 23bfbfd72c..b80fa876b4 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -431,10 +431,10 @@ namespace CalamityMod.NPCs.SlimeGod if (enraged && expertMode) { List targets = new List(); - for (int p = 0; p < Main.maxPlayers; p++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[p].active && !Main.player[p].dead) - targets.Add(p); + if (!plr.dead) + targets.Add(plr.whoAmI); if (targets.Count > 1) break; diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index 09a2661ab7..5f1f30779b 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -444,10 +444,10 @@ namespace CalamityMod.NPCs.SlimeGod if (enraged && expertMode) { List targets = new List(); - for (int p = 0; p < Main.maxPlayers; p++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[p].active && !Main.player[p].dead) - targets.Add(p); + if (!plr.dead) + targets.Add(plr.whoAmI); if (targets.Count > 1) break; diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 344477b686..7b1e087116 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -413,10 +413,10 @@ namespace CalamityMod.NPCs.SlimeGod if (enraged && expertMode) { List targets = new List(); - for (int p = 0; p < Main.maxPlayers; p++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[p].active && !Main.player[p].dead) - targets.Add(p); + if (!plr.dead) + targets.Add(plr.whoAmI); if (targets.Count > 1) break; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 80772fbe31..dc61e4df74 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -430,10 +430,10 @@ namespace CalamityMod.NPCs.SlimeGod if (enraged && expertMode) { List targets = new List(); - for (int p = 0; p < Main.maxPlayers; p++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[p].active && !Main.player[p].dead) - targets.Add(p); + if (!plr.dead) + targets.Add(plr.whoAmI); if (targets.Count > 1) break; diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index 386817f6b0..843e7e3da3 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -96,12 +96,8 @@ namespace CalamityMod.NPCs.TownNPCs break; } - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - if (player is null || !player.active) - continue; - if (NPC.Hitbox.Intersects(player.HitboxForBestiaryNearbyCheck)) { Main.BestiaryTracker.Chats.RegisterChatStartWith(NPC); diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 2aa452a208..099711abf7 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -93,11 +93,10 @@ namespace CalamityMod.NPCs.TownNPCs if (CalamityWorld.spawnedCirrus) return true; - for (int k = 0; k < Main.maxPlayers; k++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[k]; bool hasVodka = player.InventoryHas(ModContent.ItemType()) || player.PortableStorageHas(ModContent.ItemType()); - if (player.active && hasVodka) + if (hasVodka) return Main.hardMode; } return false; diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index ade7a0d833..8e93342d25 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -82,11 +82,10 @@ namespace CalamityMod.NPCs.TownNPCs if (CalamityWorld.spawnedBandit) return true; - for (int k = 0; k < Main.maxPlayers; k++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[k]; bool rich = player.InventoryHas(ItemID.PlatinumCoin) || player.PortableStorageHas(ItemID.PlatinumCoin); - if (player.active && rich) + if (rich) return NPC.downedBoss3; } return false; diff --git a/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs index a5e98cc159..ff0ea8bd53 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DeerclopsAI.cs @@ -539,22 +539,22 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (shadowHandTimer / shadowHandSpawnRate >= 3) npc.localAI[2] = 0f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - if (npc.Boss_CanShootExtraAt(i, rotation % 3, 3, 1200f, alwaysSkipMainTarget: false)) + if (npc.Boss_CanShootExtraAt(player.whoAmI, rotation % 3, 3, 1200f, alwaysSkipMainTarget: false)) { // Normal shadow hand spawn behavior // Modified to make the shadow hand spawns fair - RandomizeInsanityShadowFor(Main.player[i], isHostile: true, out var spawnPosition, out var spawnVelocity, out var ai, out var ai2); + RandomizeInsanityShadowFor(player, isHostile: true, out var spawnPosition, out var spawnVelocity, out var ai, out var ai2); // Spawn hands to cut the player off and force them back towards Deerclops // This only happens if the player is triggering Deerclops' increased DR float minShadowHandSpawnDistanceFromPlayer = 450f; - float playerDistanceFromDeerclops = Vector2.Distance(npc.Center, Main.player[i].Center); + float playerDistanceFromDeerclops = Vector2.Distance(npc.Center, player.Center); if (playerDistanceFromDeerclops >= 450f) { - spawnPosition = (Main.player[i].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (playerDistanceFromDeerclops + minShadowHandSpawnDistanceFromPlayer); - spawnVelocity = (Main.player[i].Center - spawnPosition).SafeNormalize(Vector2.UnitY) * spawnVelocity.Length(); + spawnPosition = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (playerDistanceFromDeerclops + minShadowHandSpawnDistanceFromPlayer); + spawnVelocity = (player.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * spawnVelocity.Length(); } Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, spawnVelocity, shadowHand, shadowHandDamage, 0f, Main.myPlayer, ai, ai2); diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index abbaa9444e..a6ff1b17e3 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -342,16 +342,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.position.Y > player.position.Y) { - for (int m = 0; m < Main.maxPlayers; m++) + foreach (Player plr in Main.ActivePlayers) { - if (Main.player[m].active) + Rectangle noFlyRectangle = new Rectangle((int)plr.position.X - noFlyZone, (int)plr.position.Y - noFlyZone, noFlyZone * 2, height); + if (rectangle.Intersects(noFlyRectangle)) { - Rectangle noFlyRectangle = new Rectangle((int)Main.player[m].position.X - noFlyZone, (int)Main.player[m].position.Y - noFlyZone, noFlyZone * 2, height); - if (rectangle.Intersects(noFlyRectangle)) - { - outsideNoFlyZone = false; - break; - } + outsideNoFlyZone = false; + break; } } if (outsideNoFlyZone) diff --git a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs index 012513d062..569bb91213 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs @@ -281,16 +281,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses noFlyZone = 100; bool freeMoveAnyway = true; - for (int k = 0; k < Main.maxPlayers; k++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[k].active) + Rectangle rectangle2 = new Rectangle((int)player.position.X - noFlyZone, (int)player.position.Y - noFlyZone, noFlyZone * 2, noFlyZone * 2); + if (rectangle.Intersects(rectangle2)) { - Rectangle rectangle2 = new Rectangle((int)Main.player[k].position.X - noFlyZone, (int)Main.player[k].position.Y - noFlyZone, noFlyZone * 2, noFlyZone * 2); - if (rectangle.Intersects(rectangle2)) - { - freeMoveAnyway = false; - break; - } + freeMoveAnyway = false; + break; } } if (freeMoveAnyway) @@ -430,9 +427,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (shouldDespawn && !bossRush) { bool everyoneDead = true; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead) + if (!player.dead) { everyoneDead = false; break; diff --git a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs index eeebea7535..d304bb653c 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EmpressofLightAI.cs @@ -502,12 +502,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses continue; // Spawn extra Ethereal Lances per player. - for (int j = 0; j < Main.maxPlayers; j++) + foreach (Player player in Main.ActivePlayers) { - if (!npc.Boss_CanShootExtraAt(j, lanceFrequency % 3, 3, 2400f)) + if (!npc.Boss_CanShootExtraAt(player.whoAmI, lanceFrequency % 3, 3, 2400f)) continue; - Player extraPlayer = Main.player[j]; + Player extraPlayer = player; playerCenter = extraPlayer.Center; if (Vector2.Dot(extraPlayer.velocity.SafeNormalize(Vector2.UnitY), lanceDirection) > 0f) lanceDirection *= -1f; @@ -988,12 +988,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses continue; int multiplayerExtraStraightLances = (int)(npc.ai[1] / etherealLanceGateValue); - for (int l = 0; l < Main.maxPlayers; l++) + foreach (Player player in Main.ActivePlayers) { - if (!npc.Boss_CanShootExtraAt(l, multiplayerExtraStraightLances % 3, 3, 2400f)) + if (!npc.Boss_CanShootExtraAt(player.whoAmI, multiplayerExtraStraightLances % 3, 3, 2400f)) continue; - Player player = Main.player[l]; inverseTargetVel = -player.velocity; inverseTargetVel.SafeNormalize(-Vector2.UnitY); targetCenter = player.Center; diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 8efb918101..b148838e04 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -842,10 +842,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (attackTimer == 0f && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 leechNPCCenter = npc.Center + leechCenterOffset; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player6 in Main.ActivePlayers) { - Player player6 = Main.player[i]; - if (player6.active && !player6.dead && Vector2.Distance(player6.Center, leechNPCCenter) <= 3000f) + if (!player6.dead && Vector2.Distance(player6.Center, leechNPCCenter) <= 3000f) { Vector2 targetLeechDist = Main.player[npc.target].Center - leechNPCCenter; if (targetLeechDist != Vector2.Zero) diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index ef2300c683..020beef416 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -440,9 +440,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Bee spawn timer npc.ai[1] += 1f; int beeSpawnTimer = 0; - for (int i = 0; i < 255; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead && (npc.Center - Main.player[i].Center).Length() < 1000f) + if (!player.dead && (npc.Center - player.Center).Length() < 1000f) beeSpawnTimer++; } npc.ai[1] += beeSpawnTimer / 2; diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index 4aafd1b355..c3e39933e9 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -124,10 +124,8 @@ namespace CalamityMod.Projectiles.Boss float distanceRequired = 800f * Projectile.scale; float succPower = Main.zenithWorld ? 1f : 0.5f; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { - Player player = Main.player[i]; - float distance = Vector2.Distance(player.Center, Projectile.Center); if (distance < distanceRequired && player.grappling[0] == -1) { diff --git a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs index cb9ce5fdf4..a69053f2a5 100644 --- a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs +++ b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.alpha = (int)MathHelper.Lerp(0f, 255f, (Projectile.ai[0] - 600f) / 120f); bool canSpawnBoomer = false; - for (int i = 0; i < Main.player.Length; i++) + foreach (Player player in Main.ActivePlayers) { - if (!Main.player[i].dead && Projectile.Distance(Main.player[i].Center) < 12000f) + if (!player.dead && Projectile.Distance(player.Center) < 12000f) { canSpawnBoomer = true; break; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 234d740617..5e093f7fb3 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3142,10 +3142,9 @@ namespace CalamityMod.Projectiles float lowestHealthCheck = 0f; int healTarget = projectile.owner; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player otherPlayer in Main.ActivePlayers) { - Player otherPlayer = Main.player[i]; - if (otherPlayer.active && !otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) + if (!otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) { float playerDist = Vector2.Distance(projectile.Center, otherPlayer.Center); if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) diff --git a/Projectiles/Enemy/FlakAcid.cs b/Projectiles/Enemy/FlakAcid.cs index af856067b2..f9cb7d39bf 100644 --- a/Projectiles/Enemy/FlakAcid.cs +++ b/Projectiles/Enemy/FlakAcid.cs @@ -35,9 +35,9 @@ namespace CalamityMod.Projectiles.Enemy Projectile.velocity.Y += 0.15f; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - for (int i = 0; i < Main.player.Length; i++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[i].Distance(Projectile.Center) < 60f) + if (player.Distance(Projectile.Center) < 60f) { Projectile.Kill(); } diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index 773fa8c408..0c086d5ec6 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -78,9 +78,8 @@ namespace CalamityMod.Projectiles.Pets npc.Calamity().ladHearts = CalamityUtils.SecondsToFrames(9f); } } - for (int k = 0; k < Main.maxPlayers; k++) + foreach (Player players in Main.ActivePlayers) { - Player players = Main.player[k]; if (!players.dead && Vector2.Distance(Projectile.Center, players.Center) <= radius) { if (players.Calamity().ladHearts <= 0) diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 958cbf080c..c383c2a93e 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -93,10 +93,9 @@ namespace CalamityMod.Projectiles.Rogue int buffType = ModContent.BuffType(); float radius = 112f; // 7 blocks - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player player in Main.ActivePlayers) { Player owner = Main.player[Projectile.owner]; - Player player = Main.player[i]; if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(Projectile.Center, player.Center) <= radius) { if (player.FindBuffIndex(buffType) == -1) diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index b603524057..4418cf5779 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -315,14 +315,14 @@ namespace CalamityMod.Projectiles.Summon if (Main.netMode == NetmodeID.MultiplayerClient && mouseDistanceToOwner > 120f) { - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player p in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead && (Main.player[i].team == Owner.team || Main.player[i].team == 0)) + if (!p.dead && (p.team == Owner.team || p.team == 0)) { - float mouseDistanceToPotentialTarget = (Main.player[i].MountedCenter - Owner.Calamity().mouseWorld).Length(); + float mouseDistanceToPotentialTarget = (p.MountedCenter - Owner.Calamity().mouseWorld).Length(); if (mouseDistanceToPotentialTarget < 120f && mouseDistanceToOwner > mouseDistanceToPotentialTarget) { - playerToBuff = Main.player[i]; + playerToBuff = p; mouseDistanceToOwner = mouseDistanceToPotentialTarget; } } diff --git a/Projectiles/Typeless/BossRushEndEffectThing.cs b/Projectiles/Typeless/BossRushEndEffectThing.cs index fdb981ba22..00d0b82485 100644 --- a/Projectiles/Typeless/BossRushEndEffectThing.cs +++ b/Projectiles/Typeless/BossRushEndEffectThing.cs @@ -45,16 +45,13 @@ namespace CalamityMod.Projectiles.Typeless public override void OnKill(int timeLeft) { BossRushEvent.End(); - for (int i = Main.maxPlayers - 1; i >= 0; i--) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (p is null || !p.active) - continue; int rock = Item.NewItem(p.GetSource_Misc("CalamityMod_BossRushRock"), (int)p.position.X, (int)p.position.Y, p.width, p.height, ModContent.ItemType()); if (Main.netMode == NetmodeID.Server) { Main.timeItemSlotCannotBeReusedFor[rock] = 54000; - NetMessage.SendData(MessageID.InstancedItem, i, -1, null, rock); + NetMessage.SendData(MessageID.InstancedItem, p.whoAmI, -1, null, rock); } } } diff --git a/Projectiles/Typeless/WulfrumLureSignal.cs b/Projectiles/Typeless/WulfrumLureSignal.cs index cdf334d20e..7d233427c4 100644 --- a/Projectiles/Typeless/WulfrumLureSignal.cs +++ b/Projectiles/Typeless/WulfrumLureSignal.cs @@ -43,13 +43,13 @@ namespace CalamityMod.Projectiles.Typeless if (Main.netMode == NetmodeID.MultiplayerClient) { float closestPlayerDistance = (Main.LocalPlayer.Center - Projectile.Center).Length(); - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player plr in Main.ActivePlayers) { - float newDistance = (Main.player[i].Center - Projectile.Center).Length(); + float newDistance = (plr.Center - Projectile.Center).Length(); if (newDistance < closestPlayerDistance) { closestPlayerDistance = newDistance; - player = Main.player[i]; + player = plr; } } } diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index d51e8c69bd..9283e4383a 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -101,12 +101,12 @@ namespace CalamityMod.Systems // Attempt to summon lab critters manually since they refuse to exist when using vanilla's spawn methods. // This needs to check all players since the method only runs server-side. - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player p in Main.ActivePlayers) { - if (!Main.player[i].active || Main.player[i].dead) + if (p.dead) continue; - CalamityGlobalNPC.AttemptToSpawnLabCritters(Main.player[i]); + CalamityGlobalNPC.AttemptToSpawnLabCritters(p); } // Make the cultist countdown happen much more quickly. diff --git a/TileEntities/TEChargingStation.cs b/TileEntities/TEChargingStation.cs index 49027f7f6a..19a318b807 100644 --- a/TileEntities/TEChargingStation.cs +++ b/TileEntities/TEChargingStation.cs @@ -140,10 +140,9 @@ namespace CalamityMod.TileEntities // If this charging station breaks, anyone's who's viewing it is no longer viewing it. public override void OnKill() { - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active) + if (p.dead) continue; // Use reflection to stop TML from spitting an error here. diff --git a/TileEntities/TEHostileFireTurret.cs b/TileEntities/TEHostileFireTurret.cs index 39f2801005..f3e47b7243 100644 --- a/TileEntities/TEHostileFireTurret.cs +++ b/TileEntities/TEHostileFireTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostileIceTurret.cs b/TileEntities/TEHostileIceTurret.cs index a86f093a07..7b1a7705bd 100644 --- a/TileEntities/TEHostileIceTurret.cs +++ b/TileEntities/TEHostileIceTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostileLabTurret.cs b/TileEntities/TEHostileLabTurret.cs index eaec3d3652..739e752fe4 100644 --- a/TileEntities/TEHostileLabTurret.cs +++ b/TileEntities/TEHostileLabTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostileLaserTurret.cs b/TileEntities/TEHostileLaserTurret.cs index 139a7fd3c6..d1d36aa0b0 100644 --- a/TileEntities/TEHostileLaserTurret.cs +++ b/TileEntities/TEHostileLaserTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostileOnyxTurret.cs b/TileEntities/TEHostileOnyxTurret.cs index 4408656a11..f3bd4e45ec 100644 --- a/TileEntities/TEHostileOnyxTurret.cs +++ b/TileEntities/TEHostileOnyxTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostilePlagueTurret.cs b/TileEntities/TEHostilePlagueTurret.cs index f33c756275..3435fc73e4 100644 --- a/TileEntities/TEHostilePlagueTurret.cs +++ b/TileEntities/TEHostilePlagueTurret.cs @@ -85,10 +85,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +95,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TEHostileWaterTurret.cs b/TileEntities/TEHostileWaterTurret.cs index 5e6082e611..6634863735 100644 --- a/TileEntities/TEHostileWaterTurret.cs +++ b/TileEntities/TEHostileWaterTurret.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.DraedonStructures; using Microsoft.Xna.Framework; using System.IO; +using System.Threading.Tasks; using Terraria; using Terraria.ModLoader; @@ -85,10 +86,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active || p.dead) + if (p.dead) continue; float distSQ = p.DistanceSQ(targetingCenter); @@ -96,7 +96,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = p.Center; - indexToSet = i; + indexToSet = p.whoAmI; } } diff --git a/TileEntities/TELabHologramProjector.cs b/TileEntities/TELabHologramProjector.cs index b61fc5d077..017ee44471 100644 --- a/TileEntities/TELabHologramProjector.cs +++ b/TileEntities/TELabHologramProjector.cs @@ -35,11 +35,10 @@ namespace CalamityMod.TileEntities // If one is, pop up. Vector2 projectorCenterPos = Center; float distSQ = PopupDistance * PopupDistance; - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active) // The lack of a dead check is intentional. Dead players keep hologram boxes on for amusement. - continue; + // The lack of a dead check is intentional. Dead players keep hologram boxes on for amusement. + if (p.DistanceSQ(projectorCenterPos) < distSQ) { PoppingUp = true; @@ -72,12 +71,8 @@ namespace CalamityMod.TileEntities // If this projector breaks, anyone who's viewing it is no longer viewing it. public override void OnKill() { - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active) - continue; - // Use reflection to stop TML from spitting an error here. // Try-catching will not stop this error, TML will print it to console anyway. The error is harmless. ModPlayer[] mpStorageArray = (ModPlayer[])typeof(Player).GetField("modPlayers", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(p); diff --git a/TileEntities/TEPowerCellFactory.cs b/TileEntities/TEPowerCellFactory.cs index da86d0bf1c..bc51f1ff86 100644 --- a/TileEntities/TEPowerCellFactory.cs +++ b/TileEntities/TEPowerCellFactory.cs @@ -103,12 +103,8 @@ namespace CalamityMod.TileEntities // If this factory breaks, anyone who's viewing it is no longer viewing it. public override void OnKill() { - for (int i = 0; i < Main.maxPlayers; ++i) + foreach (Player p in Main.ActivePlayers) { - Player p = Main.player[i]; - if (!p.active) - continue; - // Use reflection to stop TML from spitting an error here. // Try-catching will not stop this error, TML will print it to console anyway. The error is harmless. ModPlayer[] mpStorageArray = (ModPlayer[])typeof(Player).GetField("modPlayers", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(p); diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 5ce9c2e0bf..6f356ca6ac 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -1154,9 +1154,8 @@ namespace CalamityMod NPC npc = info.npc; int idx = Item.NewItem(npc.GetSource_Loot(), npc.Center, itemId, stack, true, -1); Main.timeItemSlotCannotBeReusedFor[idx] = protectionTime; - for (int i = 0; i < Main.maxPlayers; ++i) - if (Main.player[i].active) - NetMessage.SendData(MessageID.InstancedItem, i, -1, null, idx); + foreach (Player player in Main.ActivePlayers) + NetMessage.SendData(MessageID.InstancedItem, player.whoAmI, -1, null, idx); Main.item[idx].active = false; } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 68a534ad96..511e3caa50 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -83,13 +83,10 @@ namespace CalamityMod.World // Clients in multiplayer don't drop meteors. if (Main.netMode == NetmodeID.MultiplayerClient) return; - for (int i = 0; i < 255; i++) + foreach (Player _ in Main.ActivePlayers) { - if (Main.player[i].active) - { - meteorDropped = false; - break; - } + meteorDropped = false; + break; } // Check whether there is already too much ore. @@ -257,11 +254,11 @@ namespace CalamityMod.World } int avoidRectangleSize = 35; Rectangle rectangle = new Rectangle((i - avoidRectangleSize) * 16, (j - avoidRectangleSize) * 16, avoidRectangleSize * 2 * 16, avoidRectangleSize * 2 * 16); - for (int k = 0; k < Main.maxPlayers; k++) + foreach (Player player in Main.ActivePlayers) { - if (Main.player[k].active) + if (player.active) { - Rectangle value = new Rectangle((int)(Main.player[k].position.X + (float)(Main.player[k].width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(Main.player[k].position.Y + (float)(Main.player[k].height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + Rectangle value = new Rectangle((int)(player.position.X + (float)(player.width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(player.position.Y + (float)(player.height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); if (rectangle.Intersects(value)) { return false; From 2bce64b0c2a4e040b880ad742003b789d38e600a Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Fri, 3 May 2024 07:10:53 +0500 Subject: [PATCH 29/48] Finalized (seems about done) --- CalamityConditions.cs | 13 +- .../en-US/Mods.CalamityMod.Condition.hjson | 116 ++++++++---------- Utilities/DropHelper.cs | 11 +- 3 files changed, 63 insertions(+), 77 deletions(-) diff --git a/CalamityConditions.cs b/CalamityConditions.cs index fda507399c..8cce78968e 100644 --- a/CalamityConditions.cs +++ b/CalamityConditions.cs @@ -29,6 +29,13 @@ namespace CalamityMod public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0); public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning); + // + // NPC conditions + // + + /// Don't use this. It's always `true`. + public static readonly Condition TrasherTextCondition = Create("Drops.TrasherKill", () => true); + // // Calamity Event Flag conditions // @@ -72,7 +79,7 @@ namespace CalamityMod public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS); // Mixed - public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.TODO", () => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator); + public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.DownedHMOrPerfs",() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator); public static readonly Condition DownedCalamitasCloneOrPlantera = Create("Drops.DownedCalPlant", () => DownedBossSystem.downedCalamitasClone || Condition.DownedPlantera.IsMet()); // Vanilla @@ -91,6 +98,8 @@ namespace CalamityMod // World based conditions // - public static readonly Condition InRevengeanceMode = Create("Condition.InRev", () => CalamityWorld.revenge); + public static readonly Condition InRevengeanceMode = Create("InRev", () => CalamityWorld.revenge); + public static readonly Condition InRevengeanceModeNotMasterMode = Create("InRev", () => !Main.masterMode && CalamityWorld.revenge); + public static readonly Condition InRevengeanceModeOrMasterMode = Create("InRevOrMM", () => Main.masterMode || CalamityWorld.revenge); } } diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index b8d5dadc72..6dbe1feb52 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -1,64 +1,43 @@ // Drop conditions Drops: { - Cynosure: Drops once you have defeated both Draedon and Calamitas - DownedKS: Drops after defeating King Slime - DownedDS: Drops after defeating the Desert Scourge - DownedEoC: Drops after defeating the Eye of Cthulhu - DownedCrab: Drops after defeating Crabulon - DownedEoW: Drops after defeating the Eater of Worlds - DownedBoC: Drops after defeating the Brain of Cthulhu - DownedHM: Drops after defeating the Hive Mind - DownedPerfs: Drops after defeating the Perforators - DownedQB: Drops after defeating the Queen Bee - DownedDeer: Drops after defeating Deerclops - DownedSkele: Drops after defeating Skeletron - DownedSG: Drops after defeating the Slime God - Hardmode: Drops in Hardmode - DownedQS: Drops after defeating Queen Slime - DownedCryo: Drops after defeating Cryogen - DownedAS: Drops after defeating the Aquatic Scourge - DownedBrim: Drops after defeating the Brimstone Elemental - DownedDest: Drops after defeating the Destroyer - DownedTwins: Drops after defeating the Twins - DownedSP: Drops after defeating Skeletron Prime - Downed1Mech: Drops after defeating a Mechanical Boss - Downed3Mechs: Drops after defeating all three Mechanical Bosses - DownedCal: Drops after defeating Calamitas Clone - DownedPlant: Drops after defeating Plantera - DownedCalPlant: Drops after defeating Calamitas or Plantera - DownedLevi: Drops after defeating the Leviathan and Anahita - DownedAureus: Drops after defeating Astrum Aureus - DownedGolem: Drops after defeating Golem - DownedPBG: Drops after defeating the Plaguebringer Goliath - DownedEoL: Drops after defeating the Empress of Light - DownedFish: Drops after defeating Duke Fishron - DownedRav: Drops after defeating the Ravager - DownedLC: Drops after defeating the Lunatic Cultist - DownedAD: Drops after defeating Astrum Deus - DownedML: Drops after defeating the Moon Lord - DownedGuard: Drops after defeating the Profaned Guardians - DownedBirb: Drops after defeating the Dragonfolly - DownedProv: Drops after defeating Providence - DownedSig: Drops after defeating Signus - DownedSW: Drops after defeating the Storm Weaver - DownedCV: Drops after defeating the Ceaseless Void - DownedPolter: Drops after defeating the Polterghast - DownedOD: Drops after defeating the Old Duke - DownedDoG: Drops after defeating the Devourer of Gods - DownedYharon: Drops after defeating Yharon - DownedExos: Drops after defeating the Exo Mechs - DownedSCal: Drops after defeating Calamitas - DownedAEW: Drops after defeating the Primordial Wyrm - DownedClam: Drops after defeating the Giant Clam - DownedClamHM: Drops after defeating the Giant Clam in Hardmode - DownedGSS: Drops after defeating the Great Sand Shark - DownedBetsy: Drops after defeating Betsy - DownedT1AR: Drops after defeating the first tier of Acid Rain - DownedT2AR: Drops after defeating the second tier of Acid Rain + Cynosure: After defeating both Draedon and Calamitas + DownedDS: After defeating the Desert Scourge + DownedCrab: After defeating Crabulon + DownedHM: After defeating the Hive Mind + DownedPerfs: After defeating the Perforators + DownedHMOrPerfs: After defeating the Hive Mind or the Perforators + DownedSG: After defeating the Slime God + DownedCryo: After defeating Cryogen + DownedAS: After defeating the Aquatic Scourge + DownedBrim: After defeating the Brimstone Elemental + DownedDest: After defeating the Destroyer + DownedCal: After defeating Calamitas Clone + DownedCalPlant: After defeating Calamitas or Plantera + DownedLevi: After defeating the Leviathan and Anahita + DownedAureus: After defeating Astrum Aureus + DownedPBG: After defeating the Plaguebringer Goliath + DownedRav: After defeating the Ravager + DownedAD: After defeating Astrum Deus + DownedGuard: After defeating the Profaned Guardians + DownedBirb: After defeating the Dragonfolly + DownedProv: After defeating Providence + DownedSig: After defeating Signus + DownedSW: After defeating the Storm Weaver + DownedCV: After defeating the Ceaseless Void + DownedPolter: After defeating the Polterghast + DownedOD: After defeating the Old Duke + DownedDoG: After defeating the Devourer of Gods + DownedYharon: After defeating Yharon + DownedExos: After defeating the Exo Mechs + DownedSCal: After defeating Calamitas + DownedAEW: After defeating the Primordial Wyrm + DownedClam: After defeating the Giant Clam + DownedClamHM: After defeating the Giant Clam in Hardmode + DownedGSS: After defeating the Great Sand Shark + DownedBetsy: After defeating Betsy + DownedT1AR: After defeating the first tier of Acid Rain + DownedT2AR: After defeating the second tier of Acid Rain FirstKill: Drops only on the first kill - IsGFB: This is an Everything Seed drop rate - IsRev: This is a Revengeance Mode drop rate - IsDeath: This is a Death Mode drop rate MechBoss: Drops on the first kill of the final Mechanical Boss ProvidenceHallow: ''' @@ -84,15 +63,16 @@ PotionConfig: While the Town NPC Potion Selling configuration option is enabled HasFlareGun: While holding a Flare Gun upgrade HasRogueArmor: While wearing rogue armor HasWings: While wearing wings -InAstral: While in the Astral Infection -InCrag: While in the Brimstone Crags -InSulph: While in the Sulphurous Sea -InSunken: While in the Sunken Sea +InAstral: In the Astral Infection +InCrag: In the Brimstone Crags +InSulph: In the Sulphurous Sea +InSunken: In the Sunken Sea InRev: In Revengeance Mode +IsRevOrMM: In Revengeance Mode or in Master Mode AlcoholPoison: While inflicted with Alcohol Poisoning -PostCal: After Calamitas Clone has been defeated -PostAureus: After Astrum Aureus has been defeated -PostPolter: After Polterghast has been defeated -PostOD: After the Old Duke has been defeated -PostDoG: After the Devourer of Gods has been defeated -PostYharon: After Yharon has been defeated +PostCal: After defeating Calamitas Clone +PostAureus: After defeating Astrum Aureus +PostPolter: After defeating Polterghast +PostOD: After defeating the Old Duke +PostDoG: After defeating the Devourer of Gods +PostYharon: After defeating Yharon diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 3e9d3800fc..ad900797be 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -549,16 +549,13 @@ namespace CalamityMod return trasherNearby; }); // The text is a separate rule so it doesn't show up on the non-Trasher Fishing Rod drop which only occurs if the Angler is not fed to a Trasher - public static IItemDropRuleCondition TrasherText = If((info) => true, true, CalamityUtils.GetTextValue("Condition.Drops.TrasherKill")); + public static IItemDropRuleCondition TrasherText => CalamityConditions.TrasherTextCondition.ToDropCondition(ShowItemDropInUI.Always); // Get Fixed Boi seed drop rule - public static IItemDropRuleCondition GFB = If((info) => Main.zenithWorld, () => Main.zenithWorld, CalamityUtils.GetTextValue("Condition.Drops.IsGFB")); + public static IItemDropRuleCondition GFB => Condition.ZenithWorld.ToDropCondition(ShowItemDropInUI.WhenConditionSatisfied); - public static IItemDropRuleCondition RevNoMaster = If((info) => !Main.masterMode && CalamityWorld.revenge, () => !Main.masterMode && CalamityWorld.revenge, CalamityUtils.GetTextValue("Condition.Drops.IsRev")); - public static IItemDropRuleCondition RevAndMaster = If((info) => Main.masterMode || CalamityWorld.revenge, () => Main.masterMode || CalamityWorld.revenge, () => - { - return Main.masterMode ? Language.GetTextValue("Bestiary_ItemDropConditions.IsMasterMode") : CalamityUtils.GetTextValue("Condition.Drops.IsRev"); - }); + public static IItemDropRuleCondition RevNoMaster => CalamityConditions.InRevengeanceModeNotMasterMode.ToDropCondition(ShowItemDropInUI.WhenConditionSatisfied); + public static IItemDropRuleCondition RevAndMaster => CalamityConditions.InRevengeanceModeOrMasterMode.ToDropCondition(ShowItemDropInUI.WhenConditionSatisfied); #region Boss Defeat Conditionals public static IItemDropRuleCondition PostKS(bool ui = true) => If(Condition.DownedKingSlime.Predicate, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedKS")); From 3874d1632ba4ef6884b56f1048ad4878d6a544ed Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Fri, 3 May 2024 07:14:34 +0500 Subject: [PATCH 30/48] Oops, forgot about boss defeat conditions --- Utilities/DropHelper.cs | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index ad900797be..ee4fe58292 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -558,41 +558,41 @@ namespace CalamityMod public static IItemDropRuleCondition RevAndMaster => CalamityConditions.InRevengeanceModeOrMasterMode.ToDropCondition(ShowItemDropInUI.WhenConditionSatisfied); #region Boss Defeat Conditionals - public static IItemDropRuleCondition PostKS(bool ui = true) => If(Condition.DownedKingSlime.Predicate, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedKS")); + public static IItemDropRuleCondition PostKS(bool ui = true) => Condition.DownedKingSlime.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostDS(bool ui = true) => CalamityConditions.DownedDesertScourge.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostEoC(bool ui = true) => If(() => NPC.downedBoss1, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedEoC")); + public static IItemDropRuleCondition PostEoC(bool ui = true) => Condition.DownedEyeOfCthulhu.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostCrab(bool ui = true) => CalamityConditions.DownedCrabulon.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostEvil1(bool ui = true) => If(() => NPC.downedBoss2, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed" + (WorldGen.crimson ? "BoC" : "EoW"))); + public static IItemDropRuleCondition PostEvil1(bool ui = true) => Condition.DownedEowOrBoc.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostHM(bool ui = true) => CalamityConditions.DownedHiveMind.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostPerfs(bool ui = true) => CalamityConditions.DownedPerforator.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostEvil2(bool ui = true) => If(() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed" + (WorldGen.crimson ? "Perfs" : "HM"))); - public static IItemDropRuleCondition PostQB(bool ui = true) => If(() => NPC.downedQueenBee, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedQB")); - public static IItemDropRuleCondition PostDeer(bool ui = true) => If(() => NPC.downedDeerclops, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDeer")); - public static IItemDropRuleCondition PostSkele(bool ui = true) => If(() => NPC.downedBoss3, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSkele")); - public static IItemDropRuleCondition PostSG(bool ui = true) => If(() => DownedBossSystem.downedSlimeGod, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSG")); - public static IItemDropRuleCondition Hardmode(bool ui = true) => If(() => Main.hardMode, ui, CalamityUtils.GetTextValue("Condition.Drops.Hardmode")); - public static IItemDropRuleCondition PostQS(bool ui = true) => If(() => NPC.downedQueenSlime, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedQS")); + public static IItemDropRuleCondition PostEvil2(bool ui = true) => CalamityConditions.DownedHiveMindOrPerforator.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostQB(bool ui = true) => Condition.DownedQueenBee.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostDeer(bool ui = true) => Condition.DownedDeerclops.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSkele(bool ui = true) => Condition.DownedSkeletron.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSG(bool ui = true) => CalamityConditions.DownedSlimeGod.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition Hardmode(bool ui = true) => Condition.Hardmode.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostQS(bool ui = true) => Condition.DownedQueenSlime.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostCryo(bool ui = true) => CalamityConditions.DownedCryogen.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostAS(bool ui = true) => CalamityConditions.DownedAquaticScourge.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostBrim(bool ui = true) => CalamityConditions.DownedBrimstoneElemental.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostDest(bool ui = true) => If(() => NPC.downedMechBoss1, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedDest")); - public static IItemDropRuleCondition PostTwins(bool ui = true) => If(() => NPC.downedMechBoss2, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedTwins")); - public static IItemDropRuleCondition PostSP(bool ui = true) => If(() => NPC.downedMechBoss3, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedSP")); - public static IItemDropRuleCondition Post1Mech(bool ui = true) => If(() => NPC.downedMechBossAny, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed1Mech")); - public static IItemDropRuleCondition Post3Mechs(bool ui = true) => If(() => NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3, ui, CalamityUtils.GetTextValue("Condition.Drops.Downed3Mechs")); + public static IItemDropRuleCondition PostDest(bool ui = true) => Condition.DownedDestroyer.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostTwins(bool ui = true) => Condition.DownedTwins.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostSP(bool ui = true) => Condition.DownedSkeletronPrime.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition Post1Mech(bool ui = true) => Condition.DownedMechBossAny.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition Post3Mechs(bool ui = true) => Condition.DownedMechBossAll.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostCal(bool ui = true) => CalamityConditions.DownedCalamitasClone.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostPlant(bool ui = true) => If(() => NPC.downedPlantBoss, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedPlant")); + public static IItemDropRuleCondition PostPlant(bool ui = true) => Condition.DownedPlantera.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostCalPlant(bool ui = true) => CalamityConditions.DownedCalamitasCloneOrPlantera.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostLevi(bool ui = true) => CalamityConditions.DownedLeviathan.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostAureus(bool ui = true) => CalamityConditions.DownedAstrumAureus.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostGolem(bool ui = true) => If(() => NPC.downedGolemBoss, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedGolem")); + public static IItemDropRuleCondition PostGolem(bool ui = true) => Condition.DownedGolem.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostPBG(bool ui = true) => CalamityConditions.DownedPlaguebringer.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostEoL(bool ui = true) => If(() => NPC.downedEmpressOfLight, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedEoL")); - public static IItemDropRuleCondition PostFish(bool ui = true) => If(() => NPC.downedFishron, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedFish")); + public static IItemDropRuleCondition PostEoL(bool ui = true) => Condition.DownedEmpressOfLight.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); + public static IItemDropRuleCondition PostFish(bool ui = true) => Condition.DownedDukeFishron.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostRav(bool ui = true) => CalamityConditions.DownedRavager.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostLC(bool ui = true) => If(() => NPC.downedAncientCultist, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedLC")); + public static IItemDropRuleCondition PostLC(bool ui = true) => Condition.DownedCultist.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostAD(bool ui = true) => CalamityConditions.DownedAstrumDeus.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); - public static IItemDropRuleCondition PostML(bool ui = true) => If(() => NPC.downedMoonlord, ui, CalamityUtils.GetTextValue("Condition.Drops.DownedML")); + public static IItemDropRuleCondition PostML(bool ui = true) => Condition.DownedMoonLord.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostGuard(bool ui = true) => CalamityConditions.DownedGuardians.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostBirb(bool ui = true) => CalamityConditions.DownedBumblebird.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); public static IItemDropRuleCondition PostProv(bool ui = true) => CalamityConditions.DownedProvidence.ToDropCondition(ui ? ShowItemDropInUI.Always : ShowItemDropInUI.Never); From 12ea0ed131359dc50c5bbf81e155a306b853c7c9 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Fri, 3 May 2024 15:46:30 +0500 Subject: [PATCH 31/48] More progress --- CalPlayer/CalamityPlayer.cs | 5 +- CalPlayer/CalamityPlayerDashEffects.cs | 12 ++-- CalPlayer/CalamityPlayerHitHurt.cs | 22 +++---- CalPlayer/CalamityPlayerMiscEffects.cs | 65 ++++++++----------- Events/AcidRainEvent.cs | 6 +- .../Primitives/PrimitivePixelationSystem.cs | 6 +- .../MiracleBlightRenderer.cs | 6 +- ILEditing/MechanicILChanges.cs | 7 +- Items/Accessories/TheCamper.cs | 5 +- Items/Accessories/ToxicHeart.cs | 5 +- Items/Accessories/WarbanneroftheSun.cs | 10 ++- Items/AlicornonaStick.cs | 4 +- Items/Mounts/AlicornMount.cs | 8 +-- Items/SuperDummy.cs | 7 +- Items/Weapons/Ranged/ConferenceCall.cs | 7 +- Items/Weapons/Ranged/Disseminator.cs | 7 +- NPCs/Abyss/ColossalSquid.cs | 25 ++++--- NPCs/Abyss/EidolonWyrmBody.cs | 4 +- NPCs/Abyss/EidolonWyrmBodyAlt.cs | 4 +- NPCs/Abyss/EidolonWyrmTail.cs | 4 +- NPCs/Abyss/GulperEelBody.cs | 4 +- NPCs/Abyss/GulperEelBodyAlt.cs | 4 +- NPCs/Abyss/GulperEelTail.cs | 4 +- NPCs/Abyss/OarfishBody.cs | 4 +- NPCs/Abyss/OarfishTail.cs | 4 +- NPCs/Astral/HiveEnemy.cs | 2 + NPCs/AstrumAureus/AureusSpawn.cs | 25 ++++--- NPCs/AstrumDeus/AstrumDeusHead.cs | 5 +- NPCs/BrimstoneElemental/Brimling.cs | 25 ++++--- NPCs/CalClone/CalScreenShaderData.cs | 6 +- NPCs/CalClone/CalSky.cs | 6 +- NPCs/CalamityAI.cs | 48 ++++++-------- NPCs/CalamityGlobalAI.cs | 45 +++++++------ NPCs/CalamityGlobalNPCLoot.cs | 10 +-- NPCs/Crabulon/CrabShroom.cs | 25 ++++--- NPCs/DesertScourge/DesertNuisanceBody.cs | 10 +-- NPCs/DesertScourge/DesertNuisanceTail.cs | 10 +-- NPCs/DesertScourge/DesertScourgeBody.cs | 10 +-- NPCs/DesertScourge/DesertScourgeTail.cs | 10 +-- NPCs/DevourerofGods/CosmicGuardianBody.cs | 10 +-- NPCs/DevourerofGods/CosmicGuardianHead.cs | 6 +- NPCs/DevourerofGods/CosmicGuardianTail.cs | 10 +-- NPCs/DevourerofGods/DevourerofGodsBody.cs | 10 +-- NPCs/DevourerofGods/DevourerofGodsHead.cs | 36 +++++----- NPCs/DevourerofGods/DevourerofGodsTail.cs | 10 +-- NPCs/DevourerofGods/DoGScreenShaderData.cs | 6 +- NPCs/DevourerofGods/DoGSky.cs | 6 +- NPCs/ExoMechs/Apollo/Apollo.cs | 5 +- NPCs/ExoMechs/Artemis/Artemis.cs | 5 +- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 10 +-- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 10 +-- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 10 +-- NPCs/Leviathan/AquaticAberration.cs | 25 ++++--- NPCs/Leviathan/LevScreenShaderData.cs | 6 +- NPCs/Leviathan/LevSky.cs | 6 +- NPCs/NormalNPCs/ArmoredDiggerBody.cs | 5 +- 56 files changed, 252 insertions(+), 400 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5dc5c9c044..a8c0fc5775 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2949,10 +2949,9 @@ namespace CalamityMod.CalPlayer } if (Main.netMode != NetmodeID.MultiplayerClient) { - for (int l = 0; l < Main.maxNPCs; l++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[l]; - if (npc.active && !npc.friendly && !npc.dontTakeDamage && Vector2.Distance(Player.Center, npc.Center) <= 3000f) + if (!npc.friendly && !npc.dontTakeDamage && Vector2.Distance(Player.Center, npc.Center) <= 3000f) npc.AddBuff(ModContent.BuffType(), 600, false); } } diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 0a5cce0e2e..af2786cf88 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -72,15 +72,13 @@ namespace CalamityMod.CalPlayer if (HasCustomDash && Player.dashDelay < 0) { Rectangle hitArea = new Rectangle((int)(Player.position.X + Player.velocity.X * 0.5 - 4f), (int)(Player.position.Y + Player.velocity.Y * 0.5 - 4), Player.width + 8, Player.height + 8); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - NPC n = Main.npc[i]; - // Ignore critters with the Guide to Critter Companionship if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type]) continue; - if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) + if (!n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) { if (hitArea.Intersects(n.getRect()) && (n.noTileCollide || Player.CanHit(n))) { @@ -541,15 +539,13 @@ namespace CalamityMod.CalPlayer public int DoMountDashDamage(Rectangle myRect, float Damage, float Knockback, int NPCImmuneTime, int PlayerImmuneTime) { int totalHurtNPCs = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - NPC n = Main.npc[i]; - // Ignore critters with the Guide to Critter Companionship if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type]) continue; - if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) + if (!n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) { Rectangle npcHitbox = n.getRect(); if (myRect.Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height))) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index ab15a94dc9..b84a070442 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -224,10 +224,10 @@ namespace CalamityMod.CalPlayer if (hInferno) { - for (int x = 0; x < Main.maxNPCs; x++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[x].active && Main.npc[x].type == ModContent.NPCType()) - Main.npc[x].active = false; + if (n.type == ModContent.NPCType()) + n.active = false; } } @@ -1434,15 +1434,13 @@ namespace CalamityMod.CalPlayer // This also strikes the NPCs as a side effect if (gSabatonFalling) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - NPC n = Main.npc[i]; - // Ignore critters with the Guide to Critter Companionship if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type]) continue; - if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) + if (!n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0) { Rectangle npcHitbox = n.getRect(); if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height))) @@ -2219,10 +2217,9 @@ namespace CalamityMod.CalPlayer if ((fBarrier || (aquaticHeart && NPC.downedBoss3)) && !areThereAnyDamnBosses) { SoundEngine.PlaySound(SoundID.Item27, Player.Center); - for (int m = 0; m < Main.maxNPCs; m++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[m]; - if (!npc.active || npc.friendly || npc.dontTakeDamage) + if (npc.friendly || npc.dontTakeDamage) continue; float npcDist = (npc.Center - Player.Center).Length(); @@ -2250,10 +2247,9 @@ namespace CalamityMod.CalPlayer // and also doesn't have random chance (why does Brain of Confusion not guarantee confusion on hit) if (aBrain || amalgam) { - for (int m = 0; m < Main.maxNPCs; m++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[m]; - if (!npc.active || npc.friendly || npc.dontTakeDamage) + if (npc.friendly || npc.dontTakeDamage) continue; float npcDist = (npc.Center - Player.Center).Length(); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9338322a15..b99288c74d 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -456,10 +456,9 @@ namespace CalamityMod.CalPlayer float enemyDistance = maxProxRageDistance + 1f; float bossDistance = maxProxRageDistance + 1f; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc is null || npc.type == 0 || !npc.IsAnEnemy() || !npc.Calamity().ProvidesProximityRage) + if (npc.type == 0 || !npc.IsAnEnemy() || !npc.Calamity().ProvidesProximityRage) continue; // Take the longer of the two directions for the NPC's hitbox to be generous. @@ -716,10 +715,9 @@ namespace CalamityMod.CalPlayer sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage); bool brightenedSigil = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; - if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type]) + if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type]) continue; // Brighten the sigil because it is dealing damage. This can only happen once per hit event. @@ -731,7 +729,7 @@ namespace CalamityMod.CalPlayer // Create a direct strike to hit this specific NPC. var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, i); + Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI); // Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is. sigilStrike.DamageType = Player.GetBestClass(); @@ -868,16 +866,15 @@ namespace CalamityMod.CalPlayer alreadyTargetedNPCs.Add((int)Main.projectile[i].ai[0]); } - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; - if (!target.active || target.friendly || target.lifeMax < 5 || alreadyTargetedNPCs.Contains(i) || target.realLife >= 0 || + if (target.friendly || target.lifeMax < 5 || alreadyTargetedNPCs.Contains(target.whoAmI) || target.realLife >= 0 || target.dontTakeDamage || target.immortal || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type]) continue; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (Main.myPlayer == Player.whoAmI && Main.npc[i].WithinRange(Player.Center, 2000f)) - Projectile.NewProjectile(source, Main.npc[i].Center, Vector2.Zero, bullseyeType, 0, 0f, Player.whoAmI, i); + if (Main.myPlayer == Player.whoAmI && target.WithinRange(Player.Center, 2000f)) + Projectile.NewProjectile(source, target.Center, Vector2.Zero, bullseyeType, 0, 0f, Player.whoAmI, target.whoAmI); if (spiritOriginBullseyeShootCountdown <= 0) spiritOriginBullseyeShootCountdown = 45; } @@ -1240,14 +1237,13 @@ namespace CalamityMod.CalPlayer { float maxDistance = 300f; int target = -1; - for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[npcIndex]; float targetDist = Vector2.Distance(npc.Center, Player.Center); if (targetDist < maxDistance && npc.Calamity().arcZapCooldown == 0 && npc.CanBeChasedBy()) { maxDistance = targetDist; - target = npcIndex; + target = npc.whoAmI; } } @@ -1821,10 +1817,9 @@ namespace CalamityMod.CalPlayer { if (Main.rand.NextBool(5)) { - for (int l = 0; l < Main.maxNPCs; l++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[l]; - if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) + if (npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; if (!npc.buffImmune[buffType] && Vector2.Distance(Player.Center, npc.Center) <= freezeDist) @@ -2747,10 +2742,9 @@ namespace CalamityMod.CalPlayer { if (Main.netMode != NetmodeID.MultiplayerClient && !areThereAnyDamnBosses) { - for (int m = 0; m < Main.maxNPCs; m++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[m]; - if (!npc.active || npc.friendly || npc.dontTakeDamage) + if (npc.friendly || npc.dontTakeDamage) continue; float distance = (npc.Center - Player.Center).Length(); if (distance < 120f) @@ -3115,14 +3109,13 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_FromThis(TarragonHeadSummon.LifeAuraEntitySourceContext); float range = 300f; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) + if (npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; if (Vector2.Distance(Player.Center, npc.Center) <= range) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, i); + Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); } } } @@ -3143,14 +3136,13 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_ItemUse(Player.ActiveItem()); float range = 200f; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) + if (npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; if (Vector2.Distance(Player.Center, npc.Center) <= range) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, i); + Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); // Occasionally spawn cute sparks so it looks like an electrical aura if (Main.rand.NextBool(10)) @@ -3186,17 +3178,16 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_FromThis(HydrothermicArmor.InfernoPotionEntitySourceContext); float range = 300f; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) + if (npc.friendly || npc.damage <= 0 || npc.dontTakeDamage) continue; if (Vector2.Distance(Player.Center, npc.Center) <= range) { npc.AddBuff(ModContent.BuffType(), 120); if (brimLoreInfernoTimer == 0) - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, i); + Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, npc.whoAmI); } } } @@ -4183,12 +4174,8 @@ namespace CalamityMod.CalPlayer if (Main.myPlayer != Player.whoAmI) return; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc is null || !npc.active) - return; - bool holdingsol = ((Player.HeldItem.type >= ItemID.GreenSolution && Player.HeldItem.type <= ItemID.RedSolution) || (Player.HeldItem.type >= ItemID.SandSolution && Player.HeldItem.type <= ItemID.DirtSolution) || Player.HeldItem.type == ModContent.ItemType()); if (npc.Hitbox.Contains(Main.MouseWorld.ToPoint()) && holdingsol && Player.Distance(npc.Center) < 450) { @@ -4268,7 +4255,7 @@ namespace CalamityMod.CalPlayer } } if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, i); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } } diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 6c7ee3be30..dc9410496b 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -65,10 +65,10 @@ namespace CalamityMod.Events { get { - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - if (Main.npc[i].active && (PossibleMinibossesAS.Select(miniboss => miniboss.Key).Contains(Main.npc[i].type) || - PossibleMinibossesPolter.Select(miniboss => miniboss.Key).Contains(Main.npc[i].type))) + if ((PossibleMinibossesAS.Select(miniboss => miniboss.Key).Contains(npc.type) || + PossibleMinibossesPolter.Select(miniboss => miniboss.Key).Contains(npc.type))) { return true; } diff --git a/Graphics/Primitives/PrimitivePixelationSystem.cs b/Graphics/Primitives/PrimitivePixelationSystem.cs index 27a40a1efd..ad2a82fc40 100644 --- a/Graphics/Primitives/PrimitivePixelationSystem.cs +++ b/Graphics/Primitives/PrimitivePixelationSystem.cs @@ -84,12 +84,10 @@ namespace CalamityMod.Graphics.Primitives } // Check every active NPC. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - var npc = Main.npc[i]; - // If the NPC is active, a mod NPC, and uses the interface, add it to the list of primitives to draw this frame. - if (npc.active && npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC) + if (npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC) { var listToUse = pixelPrimitiveNPC.LayerToRenderTo switch { diff --git a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs index 2f6ee9af3f..9fdab1f84a 100644 --- a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs @@ -89,14 +89,12 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers ActuallyDoPreDraw = true; // Draw every npc to a single target that should have the miracle blight visual. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { // Extra check to ensure that index errors will not occur. If not in range, something has gone wrong and the loop should terminate. - if (!Main.npc.IndexInRange(i)) + if (!Main.npc.IndexInRange(npc.whoAmI)) break; - NPC npc = Main.npc[i]; - if (ValidToDraw(npc)) Main.instance.DrawNPC(npc.whoAmI, npc.behindTiles); } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index a36155c22a..01a4f20dc6 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -734,12 +734,9 @@ namespace CalamityMod.ILEditing } // Draw NPCs. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active) - continue; - - if (Main.npc[i].ModNPC is IAdditiveDrawer d) + if (n.ModNPC is IAdditiveDrawer d) d.AdditiveDraw(Main.spriteBatch); } diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index ec7a9d6d49..bca2639277 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -58,13 +58,12 @@ namespace CalamityMod.Items.Accessories if (auraCounter == 9) { auraCounter = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.IsAnEnemy() && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= range) { int campingFireDamage = (int)player.GetBestClassDamage().ApplyTo(Main.rand.Next(20, 41)); - Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), campingFireDamage, 0f, player.whoAmI, i); + Projectile.NewProjectileDirect(source, npc.Center, Vector2.Zero, ModContent.ProjectileType(), campingFireDamage, 0f, player.whoAmI, npc.whoAmI); } } } diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index f93462c333..b1aa634f9a 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -40,9 +40,8 @@ namespace CalamityMod.Items.Accessories { if (random == 0) { - for (int l = 0; l < Main.maxNPCs; l++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[l]; if (nPC.IsAnEnemy() && !nPC.dontTakeDamage && !nPC.buffImmune[plagueDebuff] && Vector2.Distance(player.Center, nPC.Center) <= 300f) { if (nPC.FindBuffIndex(plagueDebuff) == -1) @@ -53,7 +52,7 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, player.whoAmI, l); + Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 0f, player.whoAmI, nPC.whoAmI); } } } diff --git a/Items/Accessories/WarbanneroftheSun.cs b/Items/Accessories/WarbanneroftheSun.cs index 793f4ead92..ef3d7d7d80 100644 --- a/Items/Accessories/WarbanneroftheSun.cs +++ b/Items/Accessories/WarbanneroftheSun.cs @@ -49,26 +49,24 @@ namespace CalamityMod.Items.Accessories float bonus = 0f; int closestNPC = -1; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; if (nPC.IsAnEnemy() && !nPC.dontTakeDamage) { - closestNPC = i; + closestNPC = nPC.whoAmI; break; } } float distance = -1f; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[j]; if (nPC.IsAnEnemy() && !nPC.dontTakeDamage) { float distance2 = Math.Abs(nPC.position.X + (float)(nPC.width / 2) - (player.position.X + (float)(player.width / 2))) + Math.Abs(nPC.position.Y + (float)(nPC.height / 2) - (player.position.Y + (float)(player.height / 2))); if (distance == -1f || distance2 < distance) { distance = distance2; - closestNPC = j; + closestNPC = nPC.whoAmI; } } } diff --git a/Items/AlicornonaStick.cs b/Items/AlicornonaStick.cs index 9c3ce74d19..4f30a42f0b 100644 --- a/Items/AlicornonaStick.cs +++ b/Items/AlicornonaStick.cs @@ -26,9 +26,9 @@ namespace CalamityMod.Items { int offset = player.direction == 1 ? 5 : -Item.width - 5; Rectangle itemRect = new Rectangle((int)player.Center.X + offset, (int)player.position.Y - 10, Item.width, Item.height); - foreach (NPC npc in Main.npc) + foreach (NPC npc in Main.ActiveNPCs) { - if (npc.active && npc != null && !npc.dontTakeDamage && npc.type != ModContent.NPCType()) + if (!npc.dontTakeDamage && npc.type != ModContent.NPCType()) { if (itemRect.Intersects(npc.getRect())) { diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 7f363781da..1a7411a2ef 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -71,12 +71,12 @@ namespace CalamityMod.Items.Mounts public override void SetMount(Player player, ref bool skipDust) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - if (Main.npc[i].type == ModContent.NPCType()) + if (npc.type == ModContent.NPCType()) { - Main.npc[i].active = false; - Main.npc[i].netUpdate = true; + npc.active = false; + npc.netUpdate = true; break; } } diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index 3e13915c33..696b377cd2 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -30,16 +30,15 @@ namespace CalamityMod.Items public static void DeleteDummies() { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc.type == ModContent.NPCType() && npc.active) + if (npc.type == ModContent.NPCType()) { npc.life = 0; npc.active = false; if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, i); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } } diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs index 87052ebb5e..83590b12fc 100644 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ b/Items/Weapons/Ranged/ConferenceCall.cs @@ -58,16 +58,15 @@ namespace CalamityMod.Items.Weapons.Ranged int[] targets = new int[maxTargets]; int targetArrayIndex = 0; Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc.active && npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal) + if (npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal) { if (npc.Hitbox.Intersects(rectangle)) { if (targetArrayIndex < maxTargets) { - targets[targetArrayIndex] = i; + targets[targetArrayIndex] = npc.whoAmI; targetArrayIndex++; } else diff --git a/Items/Weapons/Ranged/Disseminator.cs b/Items/Weapons/Ranged/Disseminator.cs index d96ddb02bd..4b15251c6c 100644 --- a/Items/Weapons/Ranged/Disseminator.cs +++ b/Items/Weapons/Ranged/Disseminator.cs @@ -58,16 +58,15 @@ namespace CalamityMod.Items.Weapons.Ranged int[] targets = new int[maxTargets]; int targetArrayIndex = 0; Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc.active && npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal) + if (npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal) { if (npc.Hitbox.Intersects(rectangle)) { if (targetArrayIndex < maxTargets) { - targets[targetArrayIndex] = i; + targets[targetArrayIndex] = npc.whoAmI; targetArrayIndex++; } else diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index c5677cd416..13f98c04e9 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -505,24 +505,21 @@ namespace CalamityMod.NPCs.Abyss } } float pushVelocity = 0.05f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC otherNPC in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (otherNPC.whoAmI != NPC.whoAmI && otherNPC.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, otherNPC.Center) < 160f) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 160f) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < otherNPC.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < otherNPC.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index c1a8c86b08..984675fada 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -52,9 +52,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index 2cbfd9e8f6..03cee01aa1 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -52,9 +52,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index 463c697b83..39a982ae46 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -52,9 +52,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index 8fab0776de..c36096f82a 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -57,9 +57,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 292bae06f1..1fcff37a05 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -57,9 +57,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index 7381e75b4f..7e982bde24 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -57,9 +57,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 71dad1d575..9187f74332 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -54,9 +54,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index f9bf228a3c..7dbde2561a 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -54,9 +54,9 @@ namespace CalamityMod.NPCs.Abyss // Check if other segments are still alive, if not, die bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; diff --git a/NPCs/Astral/HiveEnemy.cs b/NPCs/Astral/HiveEnemy.cs index 4bcb6e9171..b4afa4ad95 100644 --- a/NPCs/Astral/HiveEnemy.cs +++ b/NPCs/Astral/HiveEnemy.cs @@ -119,6 +119,8 @@ namespace CalamityMod.NPCs.Astral if (NPC.life <= 0) { int type = ModContent.NPCType(); + + // TODO: Should this use `Main.ActiveNPCs` iterator? for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].type == type) diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 848c2a6de0..bfcf75df58 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -110,24 +110,21 @@ namespace CalamityMod.NPCs.AstrumAureus // Push away from each other float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < (160f + 30f * (NPC.scale - 1f))) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < (160f + 30f * (NPC.scale - 1f))) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X = NPC.velocity.X - pushVelocity; - else - NPC.velocity.X = NPC.velocity.X + pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X = NPC.velocity.X - pushVelocity; + else + NPC.velocity.X = NPC.velocity.X + pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y = NPC.velocity.Y - pushVelocity; - else - NPC.velocity.Y = NPC.velocity.Y + pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y = NPC.velocity.Y - pushVelocity; + else + NPC.velocity.Y = NPC.velocity.Y + pushVelocity; } } } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 4e0f3ff8a2..18b8869295 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -237,10 +237,9 @@ namespace CalamityMod.NPCs.AstrumDeus return; // Killing ANY split Deus makes all other Deus heads die immediately. - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC otherWormHead in Main.ActiveNPCs) { - NPC otherWormHead = Main.npc[i]; - if (otherWormHead.active && otherWormHead.type == NPC.type) + if (otherWormHead.type == NPC.type) { // Kill the other worm head after setting it to not drop loot. otherWormHead.Calamity().newAI[0] = 0f; diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index bb7d4fa158..922f6464ed 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -196,24 +196,21 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Push away from other Brimlings float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 40f * NPC.scale) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 40f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/CalClone/CalScreenShaderData.cs b/NPCs/CalClone/CalScreenShaderData.cs index 11ee4782e0..af7b7ada08 100644 --- a/NPCs/CalClone/CalScreenShaderData.cs +++ b/NPCs/CalClone/CalScreenShaderData.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.CalClone return; } CalIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == CalType) + if (n.type == CalType) { - CalIndex = i; + CalIndex = n.whoAmI; break; } } diff --git a/NPCs/CalClone/CalSky.cs b/NPCs/CalClone/CalSky.cs index e7d242d4d0..21beea7407 100644 --- a/NPCs/CalClone/CalSky.cs +++ b/NPCs/CalClone/CalSky.cs @@ -52,11 +52,11 @@ namespace CalamityMod.NPCs.CalClone return true; } CalIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == CalType) + if (n.type == CalType) { - CalIndex = i; + CalIndex = n.whoAmI; break; } } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index a8fcf6dc2e..e71bdad042 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -336,9 +336,9 @@ namespace CalamityMod.NPCs if (!head) { bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { shouldDespawn = false; break; @@ -3621,12 +3621,8 @@ namespace CalamityMod.NPCs // Despawns the other deus worm segments int bodyID = ModContent.NPCType(); int tailID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC wormseg in Main.ActiveNPCs) { - NPC wormseg = Main.npc[i]; - if (!wormseg.active) - continue; - if ((wormseg.type == bodyID || wormseg.type == tailID) && Main.npc[(int)wormseg.ai[2]].Calamity().newAI[0] != 3f) { wormseg.life = 0; @@ -3804,9 +3800,9 @@ namespace CalamityMod.NPCs { bool shouldDespawn = true; int headType = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].type != headType || !Main.npc[i].active) + if (n.type != headType) continue; shouldDespawn = false; break; @@ -3968,17 +3964,17 @@ namespace CalamityMod.NPCs int tailType = ModContent.NPCType(); if ((double)npc.position.Y < Main.topWorld + 16f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].type == headType || Main.npc[i].type == bodyType || Main.npc[i].type == tailType) + if (n.type == headType || n.type == bodyType || n.type == tailType) { - Main.npc[i].active = false; + n.active = false; - Main.npc[i].netUpdate = true; + n.netUpdate = true; // Prevent netUpdate from being blocked by the spam counter. - if (Main.npc[i].netSpam >= 10) - Main.npc[i].netSpam = 9; + if (n.netSpam >= 10) + n.netSpam = 9; } } } @@ -4693,10 +4689,9 @@ namespace CalamityMod.NPCs // Count up all Dark Energy HP values int totalDarkEnergyHP = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC darkEnergy in Main.ActiveNPCs) { - NPC darkEnergy = Main.npc[i]; - if (darkEnergy.active && darkEnergy.type == ModContent.NPCType()) + if (darkEnergy.type == ModContent.NPCType()) totalDarkEnergyHP += darkEnergy.life; } @@ -5798,18 +5793,17 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 0f || npc.ai[0] == 1f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) + if (n.whoAmI != npc.whoAmI && n.type == npc.type) { - Vector2 otherSwarmerDirection = Main.npc[i].Center - npc.Center; + Vector2 otherSwarmerDirection = n.Center - npc.Center; if (otherSwarmerDirection.Length() < (npc.width + npc.height)) { otherSwarmerDirection.Normalize(); otherSwarmerDirection *= -0.1f; npc.velocity += otherSwarmerDirection; - NPC nPC6 = Main.npc[i]; - nPC6.velocity -= otherSwarmerDirection; + n.velocity -= otherSwarmerDirection; } } } @@ -7779,11 +7773,11 @@ namespace CalamityMod.NPCs if (!DogPhase1) { bool noYVelocity = npc.velocity.Y == 0f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (n.whoAmI != npc.whoAmI && n.active && n.type == npc.type && Math.Abs(npc.position.X - n.position.X) + Math.Abs(npc.position.Y - n.position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) + if (npc.position.X < n.position.X) { npc.velocity.X -= 0.05f; } @@ -7791,7 +7785,7 @@ namespace CalamityMod.NPCs { npc.velocity.X += 0.05f; } - if (npc.position.Y < Main.npc[i].position.Y) + if (npc.position.Y < n.position.Y) { npc.velocity.Y -= 0.05f; } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index c6d2fbd8e3..a8fc97d361 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -1963,9 +1963,9 @@ namespace CalamityMod.NPCs { npc.hide = false; // I'd assume the Drakomire is drawn by the rider if it's present - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == NPCID.SolarDrakomireRider && Main.npc[i].ai[0] == (float)npc.whoAmI) + if (n.type == NPCID.SolarDrakomireRider && n.ai[0] == (float)npc.whoAmI) { npc.hide = true; break; @@ -2065,11 +2065,11 @@ namespace CalamityMod.NPCs dust.customData = npc; } // Adjust velocity based on the other storm drivers who want to pump your face full of bullets - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npcType && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (n.whoAmI != npc.whoAmI && n.type == npcType && Math.Abs(npc.position.X - n.position.X) + Math.Abs(npc.position.Y - n.position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) + if (npc.position.X < n.position.X) { npc.velocity.X -= 0.05f; } @@ -2077,7 +2077,7 @@ namespace CalamityMod.NPCs { npc.velocity.X += 0.05f; } - if (npc.position.Y < Main.npc[i].position.Y) + if (npc.position.Y < n.position.Y) { npc.velocity.Y -= 0.05f; } @@ -2172,11 +2172,11 @@ namespace CalamityMod.NPCs npc.velocity.Y += 0.25f; } } - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npcType && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (i != npc.whoAmI && n.type == npcType && Math.Abs(npc.position.X - n.position.X) + Math.Abs(npc.position.Y - n.position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) + if (npc.position.X < n.position.X) { npc.velocity.X -= 0.05f; } @@ -2184,7 +2184,7 @@ namespace CalamityMod.NPCs { npc.velocity.X += 0.05f; } - if (npc.position.Y < Main.npc[i].position.Y) + if (npc.position.Y < n.position.Y) { npc.velocity.Y -= 0.05f; } @@ -2248,11 +2248,11 @@ namespace CalamityMod.NPCs { npc.velocity.Y = -8f; } - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npcType && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (i != npc.whoAmI && n.type == npcType && Math.Abs(npc.position.X - n.position.X) + Math.Abs(npc.position.Y - n.position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) + if (npc.position.X < n.position.X) { npc.velocity.X -= 0.1f; } @@ -2260,7 +2260,7 @@ namespace CalamityMod.NPCs { npc.velocity.X += 0.1f; } - if (npc.position.Y < Main.npc[i].position.Y) + if (npc.position.Y < n.position.Y) { npc.velocity.Y -= 0.1f; } @@ -7568,11 +7568,11 @@ namespace CalamityMod.NPCs { turnAroundDelayMult = 3; bool noYVelocity = npc.velocity.Y == 0f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (n.whoAmI != npc.whoAmI && n.type == npc.type && Math.Abs(npc.position.X - n.position.X) + Math.Abs(npc.position.Y - n.position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) + if (npc.position.X < n.position.X) { npc.velocity.X -= 0.05f; } @@ -7580,7 +7580,7 @@ namespace CalamityMod.NPCs { npc.velocity.X += 0.05f; } - if (npc.position.Y < Main.npc[i].position.Y) + if (npc.position.Y < n.position.Y) { npc.velocity.Y -= 0.05f; } @@ -10598,12 +10598,12 @@ namespace CalamityMod.NPCs npc.noTileCollide = true; npc.knockBackResist = 0f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i == npc.whoAmI || !Main.npc[i].active || Main.npc[i].type != npc.type) + if (i == npc.whoAmI || n.type != npc.type) continue; - Vector2 targetDirection = Main.npc[i].Center - npc.Center; + Vector2 targetDirection = n.Center - npc.Center; if (!(targetDirection.Length() < 50f)) continue; @@ -10618,8 +10618,7 @@ namespace CalamityMod.NPCs targetDirection *= 0.4f; npc.velocity -= targetDirection; - NPC nPC = Main.npc[i]; - nPC.velocity += targetDirection; + n.velocity += targetDirection; } if (npc.type == NPCID.ShadowFlameApparition) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 670ba70021..042b1a19db 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -2024,11 +2024,11 @@ namespace CalamityMod.NPCs internal static void SplittingWormBroadcastInteraction(NPC npc, int player, int head, int body, int tail) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == head || Main.npc[i].type == body || Main.npc[i].type == tail)) + if (n.whoAmI != npc.whoAmI && (n.type == head || n.type == body || n.type == tail)) { - Main.npc[i].ApplyInteraction(player); + n.ApplyInteraction(player); } } } @@ -2098,9 +2098,9 @@ namespace CalamityMod.NPCs bool CheckSegments(int head, int body, int tail) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == head || Main.npc[i].type == body || Main.npc[i].type == tail)) + if (n.whoAmI != npc.whoAmI && (n.type == head || n.type == body || n.type == tail)) { return false; } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index a4e7110938..fc200219e1 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -94,24 +94,21 @@ namespace CalamityMod.NPCs.Crabulon if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) { float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 30f * NPC.scale) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 30f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 0b2b291868..8e3c8e3aaf 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -59,15 +59,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 4d71065aab..45b9df16d2 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -59,15 +59,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 3154b76c7e..baa9a5683b 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -75,15 +75,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index cf3751c621..2a5825cfdb 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -74,15 +74,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index f9eda53cda..7cb2fde750 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -80,15 +80,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 24aa6058cd..c86d5ae48a 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -186,11 +186,11 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) velocityMult *= 2f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && (Main.npc[i].type == NPC.type || Main.npc[i].type == ModContent.NPCType()) && i != NPC.whoAmI) + if ((n.type == NPC.type || n.type == ModContent.NPCType()) && n.whoAmI != NPC.whoAmI) { - Vector2 distFromHead = Main.npc[i].Center - NPC.Center; + Vector2 distFromHead = n.Center - NPC.Center; if (distFromHead.Length() < 400f) { distFromHead.Normalize(); diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index f7688b5818..d17f3d3dfb 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -77,15 +77,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 4d138aa544..d6171d5278 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -185,15 +185,7 @@ namespace CalamityMod.NPCs.DevourerofGods Player player = Main.player[NPC.target]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index aa673bc98f..2c8849bc94 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2392,20 +2392,20 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.netSpam >= 10) NPC.netSpam = 9; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) + if (n.type == ModContent.NPCType() || n.type == ModContent.NPCType()) { - Main.npc[i].position = newPosition; + n.position = newPosition; - if (Main.npc[i].type == ModContent.NPCType()) - ((DevourerofGodsTail)Main.npc[i].ModNPC).setInvulTime(720); + if (n.type == ModContent.NPCType()) + ((DevourerofGodsTail)n.ModNPC).setInvulTime(720); - Main.npc[i].netUpdate = true; + n.netUpdate = true; // Prevent netUpdate from being blocked by the spam counter. - if (Main.npc[i].netSpam >= 10) - Main.npc[i].netSpam = 9; + if (n.netSpam >= 10) + n.netSpam = 9; } } @@ -2436,28 +2436,28 @@ namespace CalamityMod.NPCs.DevourerofGods ModContent.NPCType(), ModContent.NPCType() }; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (segments.Contains(Main.npc[i].type) && Main.npc[i].active && - (Main.npc[i].type == segments[1] || Main.npc[i].ModNPC().SegmentIndex == index)) + if (segments.Contains(n.type) && n.active && + (n.type == segments[1] || n.ModNPC().SegmentIndex == index)) { for (int j = 0; j < 20; j++) { - Dust cosmicBurst = Dust.NewDustPerfect(Main.npc[i].Center + Main.rand.NextVector2Circular(25f, 25f), 234); + Dust cosmicBurst = Dust.NewDustPerfect(n.Center + Main.rand.NextVector2Circular(25f, 25f), 234); cosmicBurst.scale = 1.7f; cosmicBurst.velocity = Main.rand.NextVector2Circular(9f, 9f); cosmicBurst.noGravity = true; } - Main.npc[i].life = 0; - Main.npc[i].HitEffect(); - Main.npc[i].active = false; + n.life = 0; + n.HitEffect(); + n.active = false; - Main.npc[i].netUpdate = true; + n.netUpdate = true; // Prevent netUpdate from being blocked by the spam counter. - if (Main.npc[i].netSpam >= 10) - Main.npc[i].netSpam = 9; + if (n.netSpam >= 10) + n.netSpam = 9; destroyedSegments++; break; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 1387a0a641..adff984ff5 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -194,15 +194,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.takenDamageMultiplier = 1.25f; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/DevourerofGods/DoGScreenShaderData.cs b/NPCs/DevourerofGods/DoGScreenShaderData.cs index 2dd556a00a..4b61cae155 100644 --- a/NPCs/DevourerofGods/DoGScreenShaderData.cs +++ b/NPCs/DevourerofGods/DoGScreenShaderData.cs @@ -23,11 +23,11 @@ namespace CalamityMod.NPCs.DevourerofGods return; } DoGIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == DoGType) + if (n.type == DoGType) { - DoGIndex = i; + DoGIndex = n.whoAmI; break; } } diff --git a/NPCs/DevourerofGods/DoGSky.cs b/NPCs/DevourerofGods/DoGSky.cs index e6a5f12315..a904aedbbb 100644 --- a/NPCs/DevourerofGods/DoGSky.cs +++ b/NPCs/DevourerofGods/DoGSky.cs @@ -62,11 +62,11 @@ namespace CalamityMod.NPCs.DevourerofGods return true; } DoGIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == DoGType) + if (n.type == DoGType) { - DoGIndex = i; + DoGIndex = n.whoAmI; break; } } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 25d9ae45d9..08756dcd9f 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1744,10 +1744,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override bool CheckDead() { // Kill Artemis if he's still alive when Apollo dies - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == ModContent.NPCType() && nPC.life > 0) + if (nPC.type == ModContent.NPCType() && nPC.life > 0) { nPC.life = 0; nPC.HitEffect(); diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 43ef3dad83..5c4b401b65 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1579,10 +1579,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override bool CheckDead() { // Kill Apollo if he's still alive when Artemis dies - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == ModContent.NPCType() && nPC.life > 0) + if (nPC.type == ModContent.NPCType() && nPC.life > 0) { nPC.life = 0; nPC.HitEffect(); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 246be4a731..c550341121 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -141,15 +141,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index cb09c1182b..c8a528fe70 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -139,15 +139,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 267eed162d..7f9eff19e8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -139,15 +139,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos bool expertMode = Main.expertMode || bossRush; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 4d238e6259..1c50389895 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -223,24 +223,21 @@ namespace CalamityMod.NPCs.Leviathan if (death) { float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 80f * NPC.scale) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 80f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/Leviathan/LevScreenShaderData.cs b/NPCs/Leviathan/LevScreenShaderData.cs index 2cd7258460..7e19bb5df7 100644 --- a/NPCs/Leviathan/LevScreenShaderData.cs +++ b/NPCs/Leviathan/LevScreenShaderData.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.Leviathan return; } LevIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == LevType) + if (n.type == LevType) { - LevIndex = i; + LevIndex = n.whoAmI; break; } } diff --git a/NPCs/Leviathan/LevSky.cs b/NPCs/Leviathan/LevSky.cs index 5ee402bbb5..034ee8f27e 100644 --- a/NPCs/Leviathan/LevSky.cs +++ b/NPCs/Leviathan/LevSky.cs @@ -67,11 +67,11 @@ namespace CalamityMod.NPCs.Leviathan return true; } LevIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == LevType) + if (n.type == LevType) { - LevIndex = i; + LevIndex = n.whoAmI; break; } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 0a3b9e0fb0..0ee61efc05 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -77,10 +77,9 @@ namespace CalamityMod.NPCs.NormalNPCs else { // find a new npc to attatch to in gfb, it's not a bug, it's a feature:tm: - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC host in Main.ActiveNPCs) { - NPC host = Main.npc[i]; - if (host.active && !host.friendly && !host.dontTakeDamage && host.type != ModContent.NPCType() && host.type != ModContent.NPCType() && host.type != ModContent.NPCType()) + if (!host.friendly && !host.dontTakeDamage && host.type != ModContent.NPCType() && host.type != ModContent.NPCType() && host.type != ModContent.NPCType()) { NPC.ai[1] = host.whoAmI; NPC.ai[3] = host.whoAmI; From e2628cd0964b12ae20c820da489e0a0bfa44f508 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Sun, 5 May 2024 16:19:16 +0500 Subject: [PATCH 32/48] Yawn --- NPCs/CalamityAI.cs | 10 +--- NPCs/NormalNPCs/PlanterasFreeTentacle.cs | 25 ++++---- NPCs/NormalNPCs/WulfrumAmplifier.cs | 6 +- NPCs/OldDuke/OldDukeToothBall.cs | 25 ++++---- NPCs/OldDuke/SulphurousSharkron.cs | 25 ++++---- NPCs/Perforator/PerforatorBodyLarge.cs | 10 +--- NPCs/Perforator/PerforatorBodySmall.cs | 10 +--- NPCs/Perforator/PerforatorHeadMedium.cs | 5 +- NPCs/Perforator/PerforatorTailLarge.cs | 10 +--- NPCs/Perforator/PerforatorTailSmall.cs | 10 +--- .../PbGScreenShaderData.cs | 10 +--- NPCs/PlaguebringerGoliath/PbGSky.cs | 10 +--- NPCs/Polterghast/PolterPhantom.cs | 8 +-- NPCs/Polterghast/Polterghast.cs | 8 +-- NPCs/Polterghast/PolterghastHook.cs | 4 +- NPCs/PrimordialWyrm/PrimordialWyrmBody.cs | 10 +--- NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs | 10 +--- NPCs/PrimordialWyrm/PrimordialWyrmTail.cs | 10 +--- NPCs/ProfanedGuardians/ProfanedRocks.cs | 32 +++++----- NPCs/Ravager/RavagerBody.cs | 24 ++++---- NPCs/Signus/SignusScreenShaderData.cs | 12 +--- NPCs/Signus/SignusSky.cs | 10 +--- NPCs/SlimeGod/SlimeGodCore.cs | 11 ++-- NPCs/StormWeaver/StormWeaverBody.cs | 10 +--- NPCs/StormWeaver/StormWeaverTail.cs | 10 +--- NPCs/SunkenSea/SeaSerpent2.cs | 10 +--- NPCs/SunkenSea/SeaSerpent3.cs | 10 +--- NPCs/SunkenSea/SeaSerpent4.cs | 10 +--- NPCs/SunkenSea/SeaSerpent5.cs | 10 +--- NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 3 +- .../Bosses/BrainOfCthulhuAI.cs | 25 ++++---- NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs | 10 ++-- .../VanillaNPCOverrides/Bosses/DestroyerAI.cs | 18 ++---- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 59 ++++++++----------- NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs | 14 ++--- .../VanillaNPCOverrides/Bosses/SkeletronAI.cs | 7 +-- .../Bosses/SkeletronPrimeAI.cs | 3 +- NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs | 18 +++--- NPCs/Yharon/YScreenShader.cs | 10 +--- NPCs/Yharon/YSky.cs | 10 +--- Projectiles/CalamityGlobalProjectile.cs | 12 ++-- .../Damageable/DamageableProjectile.cs | 12 ++-- .../HydraulicVoltCrasherProjectile.cs | 12 ++-- .../DraedonsArsenal/PulsePistolShot.cs | 10 ++-- Projectiles/DraedonsArsenal/PulseRifleShot.cs | 8 +-- Projectiles/Magic/ArtAttackStar.cs | 16 ++--- Projectiles/Magic/BlindingLight.cs | 7 +-- Projectiles/Melee/AtaraxiaHoming.cs | 14 ++--- Projectiles/Melee/Cyclone.cs | 3 +- Projectiles/Rogue/AlphaSeeker.cs | 7 +-- Projectiles/Rogue/DynamicPursuerProjectile.cs | 10 ++-- Projectiles/Rogue/MeteorFistStealth.cs | 5 +- Projectiles/Summon/ApexShark.cs | 3 +- Projectiles/Summon/AquasScepterCloud.cs | 4 +- .../Typeless/ArtifactOfResilienceShards.cs | 15 +++-- UI/VanillaBossBars/AstrumDeusBossBar.cs | 21 ++----- UI/VanillaBossBars/CeaselessVoidBossBar.cs | 11 ++-- UI/VanillaBossBars/CryogenBossBar.cs | 9 ++- UI/VanillaBossBars/ExoMechsBossBar.cs | 11 ++-- UI/VanillaBossBars/LeviathanAnahitaBossBar.cs | 5 +- UI/VanillaBossBars/RavagerBossBar.cs | 21 ++----- UI/VanillaBossBars/SlimeGodBossBar.cs | 9 ++- Utilities/ProjectileUtils.cs | 20 +++---- 63 files changed, 273 insertions(+), 504 deletions(-) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index e71bdad042..2fa37d76a2 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3664,11 +3664,8 @@ namespace CalamityMod.NPCs // Mark all existing body and tail segments as inactive. This instantly frees up their NPC slots for the freshly spawned worms. int bodyID = ModContent.NPCType(); int tailID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var wormseg in Main.ActiveNPCs) { - NPC wormseg = Main.npc[i]; - if (!wormseg.active) - continue; if (wormseg.type == bodyID || wormseg.type == tailID) { wormseg.life = 0; @@ -4707,10 +4704,9 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(SoundID.NPCDeath44, npc.Center); // Kill all Dark Energies - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var darkEnergy in Main.ActiveNPCs) { - NPC darkEnergy = Main.npc[i]; - if (darkEnergy.active && darkEnergy.type == ModContent.NPCType()) + if (darkEnergy.type == ModContent.NPCType()) { darkEnergy.HitEffect(); darkEnergy.active = false; diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 705e426cab..89a05197aa 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -163,24 +163,21 @@ namespace CalamityMod.NPCs.NormalNPCs } float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 40f * NPC.scale) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 40f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 2e889b8e30..74b070ed1b 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -156,12 +156,8 @@ namespace CalamityMod.NPCs.NormalNPCs } } - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var npcAtIndex in Main.ActiveNPCs) { - NPC npcAtIndex = Main.npc[i]; - if (!npcAtIndex.active) - continue; - // For some strange reason, the Wulfrum enemies are not counted when SuperchargableEnemies is a static list declared up front. // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Amplifier is before the other enemies). if (!SuperchargableEnemies.Contains(npcAtIndex.type) && npcAtIndex.type != ModContent.NPCType()) diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 88cd360c59..8f06afed12 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -143,24 +143,21 @@ namespace CalamityMod.NPCs.OldDuke NPC.velocity.Y = (NPC.velocity.Y * inertia + targetYDist) / (inertia + 1f); float toothBallAccel = bossRush ? 0.65f : 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 48f) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 48f) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= toothBallAccel; - else - NPC.velocity.X += toothBallAccel; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= toothBallAccel; + else + NPC.velocity.X += toothBallAccel; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= toothBallAccel; - else - NPC.velocity.Y += toothBallAccel; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= toothBallAccel; + else + NPC.velocity.Y += toothBallAccel; } } } diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index d75a67bd55..befa2189c9 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -184,24 +184,21 @@ namespace CalamityMod.NPCs.OldDuke } float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 160f) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 160f) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } } } diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index b75c658e6d..23c19425d7 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -68,15 +68,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(true); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 8cacdd5260..621ecd5f0e 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -68,15 +68,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(true); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 5b958674a2..dd630d549e 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -484,11 +484,12 @@ namespace CalamityMod.NPCs.Perforator } } - for (int i = 0; i < Main.maxNPCs; i++) + // ???? + /*for (int i = 0; i < Main.maxNPCs; i++) { if (i != NPC.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPC.type || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) return; - } + }*/ } public override void BossLoot(ref string name, ref int potionType) diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index decd23463b..2561093d85 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -68,15 +68,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(true); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index f64eadc007..f7dfa409d6 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -68,15 +68,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(true); - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs b/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs index 004be2aa36..c7c11f361a 100644 --- a/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs +++ b/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs @@ -22,15 +22,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { return; } - PbGIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == PbGType) - { - PbGIndex = i; - break; - } - } + PbGIndex = NPC.FindFirstNPC(PbGType); } public override void Update(GameTime gameTime) diff --git a/NPCs/PlaguebringerGoliath/PbGSky.cs b/NPCs/PlaguebringerGoliath/PbGSky.cs index 7ac452626c..994450eea1 100644 --- a/NPCs/PlaguebringerGoliath/PbGSky.cs +++ b/NPCs/PlaguebringerGoliath/PbGSky.cs @@ -51,15 +51,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { return true; } - PbGIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == PbGType) - { - PbGIndex = i; - break; - } - } + PbGIndex = NPC.FindFirstNPC(PbGType); //this.DoGIndex = DoGIndex; return PbGIndex != -1; } diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index d6f60702e6..629c998c72 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -199,12 +199,12 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitX = 0f; float movementLimitY = 0f; int numHooks = 4; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { - movementLimitX += Main.npc[i].Center.X; - movementLimitY += Main.npc[i].Center.Y; + movementLimitX += n.Center.X; + movementLimitY += n.Center.Y; } } movementLimitX /= numHooks; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 05f9fa0d76..daec971879 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -446,12 +446,12 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitX = 0f; float movementLimitY = 0f; int numHooks = 4; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) { - movementLimitX += Main.npc[i].Center.X; - movementLimitY += Main.npc[i].Center.Y; + movementLimitX += n.Center.X; + movementLimitY += n.Center.Y; } } movementLimitX /= numHooks; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 3966ad294b..d1c5cd53ad 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -220,9 +220,9 @@ namespace CalamityMod.NPCs.Polterghast if (!despawnBoost && NPC.localAI[0] <= 0f && NPC.ai[0] != 0f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (i != NPC.whoAmI && Main.npc[i].active && Main.npc[i].type == NPC.type && (Main.npc[i].velocity.X != 0f || Main.npc[i].velocity.Y != 0f)) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type && (n.velocity.X != 0f || n.velocity.Y != 0f)) NPC.localAI[0] = 180f; } } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs index f36e27e98e..43a2b244b9 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs @@ -68,16 +68,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive. If not, die. - bool shouldDespawn = true; int wyrmHeadID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == wyrmHeadID) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(wyrmHeadID); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs index f4263b6cde..fd3fe2856d 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs @@ -68,16 +68,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive. If not, die. - bool shouldDespawn = true; int wyrmHeadID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == wyrmHeadID) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(wyrmHeadID); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs index 2a4545fa9b..1c5d5c4b9c 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs @@ -57,16 +57,8 @@ namespace CalamityMod.NPCs.PrimordialWyrm NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive. If not, die. - bool shouldDespawn = true; int wyrmHeadID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == wyrmHeadID) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(wyrmHeadID); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 4919b3fdf2..64287f2492 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -218,29 +218,25 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (death) { float pushVelocity = bossRush ? 0.2f : 0.15f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) + if (Vector2.Distance(NPC.Center, n.Center) < 160f) { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 160f) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - - // Slow down so they don't push away from each other too far + if (NPC.position.X < n.position.X) + NPC.velocity.X -= pushVelocity; else - NPC.velocity *= 0.95f; + NPC.velocity.X += pushVelocity; + + if (NPC.position.Y < n.position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; } + // Slow down so they don't push away from each other too far + else + NPC.velocity *= 0.95f; } } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 49b2079dd2..33aa22f20e 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -192,19 +192,19 @@ namespace CalamityMod.NPCs.Ravager bool leftClawActive = false; bool freeHeadActive = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) headActive = true; - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) rightClawActive = true; - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) leftClawActive = true; - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) rightLegActive = true; - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) leftLegActive = true; - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType()) freeHeadActive = true; } @@ -603,13 +603,13 @@ namespace CalamityMod.NPCs.Ravager if (expertMode) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].type == ModContent.NPCType() && Main.npc[i].ai[0] == 0f) + if (n.type == ModContent.NPCType() && n.ai[0] == 0f) { - Main.npc[i].ai[1] = -1f; - Main.npc[i].direction = NPC.direction; - Main.npc[i].netUpdate = true; + n.ai[1] = -1f; + n.direction = NPC.direction; + n.netUpdate = true; } } diff --git a/NPCs/Signus/SignusScreenShaderData.cs b/NPCs/Signus/SignusScreenShaderData.cs index 32af221316..a2fa44c859 100644 --- a/NPCs/Signus/SignusScreenShaderData.cs +++ b/NPCs/Signus/SignusScreenShaderData.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.Graphics.Shaders; using Terraria.ModLoader; @@ -20,15 +20,7 @@ namespace CalamityMod.NPCs.Signus { return; } - SignusIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == SignusType) - { - SignusIndex = i; - break; - } - } + SignusIndex = NPC.FindFirstNPC(SignusType); } public override void Apply() diff --git a/NPCs/Signus/SignusSky.cs b/NPCs/Signus/SignusSky.cs index fe449714bb..a128b08f8c 100644 --- a/NPCs/Signus/SignusSky.cs +++ b/NPCs/Signus/SignusSky.cs @@ -60,15 +60,7 @@ namespace CalamityMod.NPCs.Signus { return true; } - SignusIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == SignusType) - { - SignusIndex = i; - break; - } - } + SignusIndex = NPC.FindFirstNPC(SignusType); return SignusIndex != -1; } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index ca478c3440..e8fc58c69f 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -486,19 +486,16 @@ namespace CalamityMod.NPCs.SlimeGod float ignoreAllSlimesDistanceThreshold = 3200f; // Find all slimes within a generous area. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - int npcType = Main.npc[i].type; + int npcType = n.type; if (npcType != largeCrimulanPaladin && npcType != splitCrimulanPaladin && npcType != largeEbonianPaladin && npcType != splitEbonianPaladin) continue; - if (!Main.npc[i].active) + if (!NPC.WithinRange(n.Center, ignoreAllSlimesDistanceThreshold)) continue; - if (!NPC.WithinRange(Main.npc[i].Center, ignoreAllSlimesDistanceThreshold)) - continue; - - largeSlimes.Add(Main.npc[i]); + largeSlimes.Add(n); } // If no slimes were found, don't bother doing any more calculations. Just use the player's center. diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index db749693ef..5198d9fc16 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -158,15 +158,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 3ff0f7a02e..44746cc8e0 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -150,15 +150,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/SunkenSea/SeaSerpent2.cs b/NPCs/SunkenSea/SeaSerpent2.cs index fc7e14a9cb..693213f08b 100644 --- a/NPCs/SunkenSea/SeaSerpent2.cs +++ b/NPCs/SunkenSea/SeaSerpent2.cs @@ -56,15 +56,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/SunkenSea/SeaSerpent3.cs b/NPCs/SunkenSea/SeaSerpent3.cs index 7c8873f0fa..56e8ecbeac 100644 --- a/NPCs/SunkenSea/SeaSerpent3.cs +++ b/NPCs/SunkenSea/SeaSerpent3.cs @@ -54,15 +54,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/SunkenSea/SeaSerpent4.cs b/NPCs/SunkenSea/SeaSerpent4.cs index 9442d632d8..10f15960c0 100644 --- a/NPCs/SunkenSea/SeaSerpent4.cs +++ b/NPCs/SunkenSea/SeaSerpent4.cs @@ -54,15 +54,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/SunkenSea/SeaSerpent5.cs b/NPCs/SunkenSea/SeaSerpent5.cs index 6728bd8461..996d81e0ed 100644 --- a/NPCs/SunkenSea/SeaSerpent5.cs +++ b/NPCs/SunkenSea/SeaSerpent5.cs @@ -54,15 +54,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.realLife = (int)NPC.ai[2]; // Check if other segments are still alive, if not, die - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); if (!shouldDespawn) { if (NPC.ai[1] <= 0f) diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 9455c06678..a21e98db49 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -137,9 +137,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas int shootRate = BossRushEvent.BossRushActive ? 120 : 180; if (timer > shootRate) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC seeker in Main.ActiveNPCs) { - NPC seeker = Main.npc[i]; if (seeker.type == NPC.type) { if (seeker == NPC) diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index 9df41cebe8..a955f87ac5 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -649,24 +649,21 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (death) { float pushVelocity = 0.5f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != npc.whoAmI && n.type == npc.type) { - if (i != npc.whoAmI && Main.npc[i].type == npc.type) + if (Vector2.Distance(npc.Center, n.Center) < 48f) { - if (Vector2.Distance(npc.Center, Main.npc[i].Center) < 48f) - { - if (npc.position.X < Main.npc[i].position.X) - npc.velocity.X -= pushVelocity; - else - npc.velocity.X += pushVelocity; + if (npc.position.X < n.position.X) + npc.velocity.X -= pushVelocity; + else + npc.velocity.X += pushVelocity; - if (npc.position.Y < Main.npc[i].position.Y) - npc.velocity.Y -= pushVelocity; - else - npc.velocity.Y += pushVelocity; - } + if (npc.position.Y < n.position.Y) + npc.velocity.Y -= pushVelocity; + else + npc.velocity.Y += pushVelocity; } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index c174ecf722..582442d7ef 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -500,10 +500,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if ((int)(npc.ai[1] - 4f) / fireballFireRate == 2) { List list4 = new List(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == NPCID.CultistBossClone && Main.npc[i].ai[3] == npc.whoAmI) - list4.Add(i); + if (n.type == NPCID.CultistBossClone && n.ai[3] == npc.whoAmI) + list4.Add(n.whoAmI); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -822,9 +822,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if ((int)(npc.ai[1] - 4f) / ancientLightSpawnRate == 2) { List list7 = new List(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].type == NPCID.CultistBossClone && Main.npc[i].ai[3] == npc.whoAmI) + if (n.type == NPCID.CultistBossClone && n.ai[3] == npc.whoAmI) list7.Add(i); } diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index a6ff1b17e3..169f5c1f4e 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -121,15 +121,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Check if other segments are still alive, if not, die if (npc.type > NPCID.TheDestroyer) { - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == NPCID.TheDestroyer) - { - shouldDespawn = false; - break; - } - } + bool shouldDespawn = !NPC.AnyNPCs(NPCID.TheDestroyer); if (!shouldDespawn) { if (npc.ai[1] <= 0f) @@ -696,17 +688,17 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses probeTargetY *= distanceFromTarget; } - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) + if (n.whoAmI != npc.whoAmI && n.type == npc.type) { - Vector2 otherProbeDist = Main.npc[i].Center - npc.Center; + Vector2 otherProbeDist = n.Center - npc.Center; if (otherProbeDist.Length() < (npc.width + npc.height)) { otherProbeDist = otherProbeDist.SafeNormalize(Vector2.UnitY); otherProbeDist *= -0.1f; npc.velocity += otherProbeDist; - Main.npc[i].velocity -= otherProbeDist; + n.velocity -= otherProbeDist; } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index b148838e04..bd5e272b70 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -443,10 +443,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.HitEffect(0, 1337.0); npc.checkDead(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC5 in Main.ActiveNPCs) { - NPC nPC5 = Main.npc[i]; - if (nPC5.active && (nPC5.type == NPCID.MoonLordHand || nPC5.type == NPCID.MoonLordHead)) + if (nPC5.type == NPCID.MoonLordHand || nPC5.type == NPCID.MoonLordHead) { nPC5.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -509,10 +508,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[1] >= 60f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC5 in Main.ActiveNPCs) { - NPC nPC5 = Main.npc[i]; - if (nPC5.active && (nPC5.type == NPCID.MoonLordFreeEye || nPC5.type == NPCID.MoonLordHand || nPC5.type == NPCID.MoonLordHead)) + if (nPC5.type == NPCID.MoonLordFreeEye || nPC5.type == NPCID.MoonLordHand || nPC5.type == NPCID.MoonLordHead) { nPC5.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -584,13 +582,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Main.npc[(int)npc.localAI[2]].netUpdate = true; } - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC7 in Main.ActiveNPCs) { - NPC nPC7 = Main.npc[i]; if (nPC7.active && nPC7.type == NPCID.MoonLordFreeEye) { - NPC nPC6 = nPC7; - nPC6.position += value8; + nPC7.position += value8; nPC7.netUpdate = true; } } @@ -1594,26 +1590,23 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (eyeCount > 1) { int eyesSynced = 1; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active) + if (n.whoAmI != npc.whoAmI && n.type == npc.type) { - if (i != npc.whoAmI && Main.npc[i].type == npc.type) - { - Main.npc[i].ai[0] = 0f; - Main.npc[i].ai[1] = 0f; - Main.npc[i].ai[2] = 0f; - Main.npc[i].localAI[0] = 0f; - Main.npc[i].localAI[1] = 0f; - Main.npc[i].localAI[2] = 0f; - calamityGlobalNPC.newAI[0] = 1f; - calamityGlobalNPC.newAI[1] = 0f; - npc.netUpdate = true; + n.ai[0] = 0f; + n.ai[1] = 0f; + n.ai[2] = 0f; + n.localAI[0] = 0f; + n.localAI[1] = 0f; + n.localAI[2] = 0f; + calamityGlobalNPC.newAI[0] = 1f; + calamityGlobalNPC.newAI[1] = 0f; + npc.netUpdate = true; - eyesSynced++; - if (eyesSynced >= eyeCount) - break; - } + eyesSynced++; + if (eyesSynced >= eyeCount) + break; } } } @@ -2151,14 +2144,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses int rightHandHeal = -1; int headHeal = headNPCType; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].ai[3] == k) + if (n.ai[3] == k) { - if (leftHandHeal == -1 && Main.npc[i].type == NPCID.MoonLordHand && Main.npc[i].ai[2] == 0f) - leftHandHeal = i; - if (rightHandHeal == -1 && Main.npc[i].type == NPCID.MoonLordHand && Main.npc[i].ai[2] == 1f) - rightHandHeal = i; + if (leftHandHeal == -1 && n.type == NPCID.MoonLordHand && n.ai[2] == 0f) + leftHandHeal = n.whoAmI; + if (rightHandHeal == -1 && n.type == NPCID.MoonLordHand && n.ai[2] == 1f) + rightHandHeal = n.whoAmI; if (leftHandHeal != -1 && rightHandHeal != -1 && headHeal != -1) break; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index c4479e2103..75c8d4c46a 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -97,13 +97,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float hookPositionX = 0f; float hookPositionY = 0f; int numHooksSpawned = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].aiStyle == NPCAIStyleID.PlanteraHook) + if (n.aiStyle == NPCAIStyleID.PlanteraHook) { - hookPositionX += Main.npc[i].Center.X; - hookPositionY += Main.npc[i].Center.Y; - hookArray[numHooksSpawned] = i; + hookPositionX += n.Center.X; + hookPositionY += n.Center.Y; + hookArray[numHooksSpawned] = n.whoAmI; numHooksSpawned++; if (numHooksSpawned >= maxHooks) @@ -846,9 +846,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Set timer to new amount if a different hook is currently moving if (!despawn && npc.localAI[0] <= 0f && npc.ai[0] != 0f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && (Main.npc[i].velocity.X != 0f || Main.npc[i].velocity.Y != 0f)) + if (n.whoAmI != npc.whoAmI && n.type == npc.type && (n.velocity.X != 0f || n.velocity.Y != 0f)) npc.localAI[0] = Main.rand.Next(60, 301); } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index c658223715..ea8b4af0c4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -115,12 +115,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } // Hand immunity - int numHandsAlive = 0; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == NPCID.SkeletronHand) - numHandsAlive++; - } + int numHandsAlive = NPC.CountNPCS(NPCID.SkeletronHand); bool handsDead = numHandsAlive == 0; npc.chaseable = handsDead; calamityGlobalNPC.DR = numHandsAlive > 0 ? 0.9999f : 0.05f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs index a7eb64e482..4b437c77d1 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs @@ -116,9 +116,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Kill all arms if Prime Head enters phase 2 if (phase2 && !allArmsDead) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC npc2 = Main.npc[i]; if (npc2.type == NPCID.PrimeCannon || npc2.type == NPCID.PrimeLaser || npc2.type == NPCID.PrimeSaw || npc2.type == NPCID.PrimeVice) { npc2.life = -1; diff --git a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs index 00c33bf5ac..04177a5364 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs @@ -79,10 +79,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } if (Main.netMode != NetmodeID.MultiplayerClient && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) - npc.timeLeft = Main.npc[i].timeLeft - 1; + if (n.whoAmI != npc.whoAmI && (n.type == NPCID.Retinazer || n.type == NPCID.Spazmatism) && n.timeLeft - 1 > npc.timeLeft) + npc.timeLeft = n.timeLeft - 1; } } @@ -412,10 +412,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient && !Main.player[npc.target].dead && npc.timeLeft < 10) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) - npc.timeLeft = Main.npc[i].timeLeft - 1; + if (n.whoAmI != npc.whoAmI && (n.type == NPCID.Retinazer || n.type == NPCID.Spazmatism) && n.timeLeft - 1 > npc.timeLeft) + npc.timeLeft = n.timeLeft - 1; } } @@ -1236,10 +1236,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Despawn Twins at the same time if (Main.netMode != NetmodeID.MultiplayerClient && !Main.player[npc.target].dead && npc.timeLeft < 10) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) - npc.timeLeft = Main.npc[i].timeLeft - 1; + if (n.whoAmI != npc.whoAmI && (n.type == NPCID.Retinazer || n.type == NPCID.Spazmatism) && n.timeLeft - 1 > npc.timeLeft) + npc.timeLeft = n.timeLeft - 1; } } diff --git a/NPCs/Yharon/YScreenShader.cs b/NPCs/Yharon/YScreenShader.cs index 5676c17ffe..3d7ab6e75a 100644 --- a/NPCs/Yharon/YScreenShader.cs +++ b/NPCs/Yharon/YScreenShader.cs @@ -23,15 +23,7 @@ namespace CalamityMod.NPCs.Yharon { return; } - YIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == YType) - { - YIndex = i; - break; - } - } + YIndex = NPC.FindFirstNPC(YType); } public override void Update(GameTime gameTime) diff --git a/NPCs/Yharon/YSky.cs b/NPCs/Yharon/YSky.cs index 8af8610893..c98cc5e47a 100644 --- a/NPCs/Yharon/YSky.cs +++ b/NPCs/Yharon/YSky.cs @@ -60,15 +60,7 @@ namespace CalamityMod.NPCs.Yharon { return true; } - YIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == YType) - { - YIndex = i; - break; - } - } + YIndex = NPC.FindFirstNPC(YType); //this.DoGIndex = DoGIndex; return YIndex != -1; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5e093f7fb3..5a8342bd92 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2354,17 +2354,17 @@ namespace CalamityMod.Projectiles float maxDistance = 460f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(projectile, false)) + if (n.CanBeChasedBy(projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (n.height / 2); - bool canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + bool canHit = Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1); - if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + if (Vector2.Distance(n.Center, projectile.Center) < (maxDistance + extraDistance) && canHit) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Damageable/DamageableProjectile.cs b/Projectiles/Damageable/DamageableProjectile.cs index 8e53c481f7..9fc0c55e0a 100644 --- a/Projectiles/Damageable/DamageableProjectile.cs +++ b/Projectiles/Damageable/DamageableProjectile.cs @@ -169,14 +169,14 @@ namespace CalamityMod.Projectiles.Damageable public virtual bool NPCCollisionCheck() { Player player = Main.player[Projectile.owner]; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].IsAnEnemy() && DamageSources.HasFlag(DamageSourceType.HostileNPCs)) + if (n.IsAnEnemy() && DamageSources.HasFlag(DamageSourceType.HostileNPCs)) { - if (Main.npc[i].Hitbox.Intersects(Projectile.Hitbox) && !NPCsToIgnore.Contains(Main.npc[i].type)) + if (n.Hitbox.Intersects(Projectile.Hitbox) && !NPCsToIgnore.Contains(n.type)) { - int damage = Main.DamageVar(Main.npc[i].damage); - int bannerBuffId = Item.NPCtoBanner(Main.npc[i].BannerID()); + int damage = Main.DamageVar(n.damage); + int bannerBuffId = Item.NPCtoBanner(n.BannerID()); if (bannerBuffId > 0 && player.HasNPCBannerBuff(bannerBuffId)) { if (Main.expertMode) @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Damageable } CombatText.NewText(new Rectangle((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height), CombatText.DamagedFriendly, damage); Life -= damage; - HitEffectNPC(damage, Main.npc[i]); + HitEffectNPC(damage, n); DamageImmunityFrames = MaxDamageImmunityFrames; NetUpdate(true); return true; diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index f750ec6e0d..69da7b233c 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -129,19 +129,19 @@ namespace CalamityMod.Projectiles.DraedonsArsenal chargeCooldown = 60; TryToSuperchargeNPC(target); int extraZaps = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i != target.whoAmI && - Main.npc[i].CanBeChasedBy(Projectile, false) && - Main.npc[i].Distance(target.Center) < 240f && + if (n.whoAmI != target.whoAmI && + n.CanBeChasedBy(Projectile, false) && + n.Distance(target.Center) < 240f && extraZaps < 3) { - if (TryToSuperchargeNPC(Main.npc[i])) + if (TryToSuperchargeNPC(n)) { for (float increment = 0f; increment <= 1f; increment += 0.05f) { - Vector2 spawnPosition = Vector2.Lerp(target.Center, Main.npc[i].Center, increment); + Vector2 spawnPosition = Vector2.Lerp(target.Center, n.Center, increment); Dust dust = Dust.NewDustPerfect(spawnPosition, 226); dust.velocity = Vector2.Zero; dust.scale = 1.6f; diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index a121b81a2c..43d6bae92e 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -90,15 +90,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float minDistance = 600f; List potentialTargets = new List(); - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - bool legalTarget = Main.npc[i] != target && Main.npc[i].active && Main.npc[i].CanBeChasedBy(null); - float distanceToTarget = Projectile.Distance(Main.npc[i].Center); - if (legalTarget && distanceToTarget < minDistance && !NPCsAlreadyHit.Contains(Main.npc[i])) + bool legalTarget = n != target && n.CanBeChasedBy(null); + float distanceToTarget = Projectile.Distance(n.Center); + if (legalTarget && distanceToTarget < minDistance && !NPCsAlreadyHit.Contains(n)) { minDistance = distanceToTarget; // The NPCs at the bottom will always be at the bottom of the list because it works via a minimum distance. - potentialTargets.Add(Main.npc[i]); + potentialTargets.Add(n); } } diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index 8f8b09c5af..f874fce325 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -96,14 +96,14 @@ namespace CalamityMod.Projectiles.DraedonsArsenal else alreadyTargetedNPCType = target.whoAmI; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].CanBeChasedBy(Projectile, false) || !Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (!n.CanBeChasedBy(Projectile, false) || !Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) continue; - if (alreadyTargetedNPCType != Main.npc[i].whoAmI && Projectile.Center.ManhattanDistance(Main.npc[i].Center) < 600f) + if (alreadyTargetedNPCType != n.whoAmI && Projectile.Center.ManhattanDistance(n.Center) < 600f) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.SafeDirectionTo(Main.npc[i].Center) * 5f, Projectile.type, (int)(Projectile.damage * 0.4f), 0f, Projectile.owner, Main.npc[i].whoAmI, Projectile.ai[1] + 1f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.SafeDirectionTo(n.Center) * 5f, Projectile.type, (int)(Projectile.damage * 0.4f), 0f, Projectile.owner, n.whoAmI, Projectile.ai[1] + 1f); break; } } diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index b1b740d1b6..a48a5d4349 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -133,9 +133,9 @@ namespace CalamityMod.Projectiles.Magic { float damageFactor = MathHelper.Lerp(1f, ArtAttack.MaxDamageBoostFactor, Utils.GetLerpValue(0f, ArtAttack.MaxDamageBoostTime, Time, true)); int damage = (int)(Projectile.damage * damageFactor); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (!Main.npc[i].CanBeChasedBy()) + if (!n.CanBeChasedBy()) continue; bool enemyIsInShape = false; @@ -158,9 +158,9 @@ namespace CalamityMod.Projectiles.Magic Rectangle shapeRectangle = Utils.CenteredRectangle(center, area); for (int j = 0; j < cleanOldPositions.Count; j++) { - Vector2 left = Main.npc[i].Center - Vector2.UnitX * 2000f; - Vector2 right = Main.npc[i].Center + Vector2.UnitX * 2000f; - bool inRangeOfStars = shapeRectangle.Intersects(Main.npc[i].Hitbox); + Vector2 left = n.Center - Vector2.UnitX * 2000f; + Vector2 right = n.Center + Vector2.UnitX * 2000f; + bool inRangeOfStars = shapeRectangle.Intersects(n.Hitbox); bool lineCheck = Collision.CheckLinevLine(left, right, cleanOldPositions[j], cleanOldPositions[(j + 1) % cleanOldPositions.Count]).Length > 0; if (lineCheck && inRangeOfStars) { @@ -172,12 +172,12 @@ namespace CalamityMod.Projectiles.Magic // Strike an enemy if it's in the shape. if (enemyIsInShape) { - SoundEngine.PlaySound(SoundID.DD2_LightningBugZap, Main.npc[i].Center); - CreateDustExplosionEffect(Main.npc[i].Center); + SoundEngine.PlaySound(SoundID.DD2_LightningBugZap, n.Center); + CreateDustExplosionEffect(n.Center); if (Main.myPlayer == Projectile.owner) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.npc[i].Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Projectile.owner, i); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Projectile.owner, n.whoAmI); } } } diff --git a/Projectiles/Magic/BlindingLight.cs b/Projectiles/Magic/BlindingLight.cs index 6f34a06510..2e0835f332 100644 --- a/Projectiles/Magic/BlindingLight.cs +++ b/Projectiles/Magic/BlindingLight.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.Graphics.Effects; @@ -79,10 +79,9 @@ namespace CalamityMod.Projectiles.Magic private void DivideDamageAmongstTargets() { int numTargets = 0; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (var npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc is null || !npc.active || npc.friendly || npc.dontTakeDamage || npc.immortal) + if (npc.friendly || npc.dontTakeDamage || npc.immortal) continue; if (Projectile.Colliding(default, npc.Hitbox)) ++numTargets; diff --git a/Projectiles/Melee/AtaraxiaHoming.cs b/Projectiles/Melee/AtaraxiaHoming.cs index 8391011adf..5363ce6ffa 100644 --- a/Projectiles/Melee/AtaraxiaHoming.cs +++ b/Projectiles/Melee/AtaraxiaHoming.cs @@ -52,19 +52,19 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[1] == 0f) { // Find the closest target. The range decreases each time you find a closer target. - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { // Chlorophyte Bullets actually home in a diamond instead of a circle because they don't perform a square root here. - float d = Math.Abs(Projectile.Center.X - Main.npc[i].Center.X) + Math.Abs(Projectile.Center.Y - Main.npc[i].Center.Y); - if (d < homingRange && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + float d = Math.Abs(Projectile.Center.X - n.Center.X) + Math.Abs(Projectile.Center.Y - n.Center.Y); + if (d < homingRange && Collision.CanHit(Projectile.Center, 1, 1, n.position, n.width, n.height)) { homingRange = d; - posX = Main.npc[i].Center.X; - posY = Main.npc[i].Center.Y; + posX = n.Center.X; + posY = n.Center.Y; foundTarget = true; - targetIndex = i; + targetIndex = n.whoAmI; } } } diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/Cyclone.cs index 155fe2442c..c341cf0123 100644 --- a/Projectiles/Melee/Cyclone.cs +++ b/Projectiles/Melee/Cyclone.cs @@ -65,9 +65,8 @@ namespace CalamityMod.Projectiles.Melee } float projX = Projectile.Center.X; float projY = Projectile.Center.Y; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { float npcCenterX = npc.position.X + (float)(npc.width / 2); diff --git a/Projectiles/Rogue/AlphaSeeker.cs b/Projectiles/Rogue/AlphaSeeker.cs index 2363a0251d..ef808a489e 100644 --- a/Projectiles/Rogue/AlphaSeeker.cs +++ b/Projectiles/Rogue/AlphaSeeker.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -141,10 +141,9 @@ namespace CalamityMod.Projectiles.Rogue { int target = -1; float minDist = HomingStartRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (var npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.type == NPCID.TargetDummy) + if (npc.type == NPCID.TargetDummy) continue; if (npc.CanBeChasedBy(Projectile, false)) diff --git a/Projectiles/Rogue/DynamicPursuerProjectile.cs b/Projectiles/Rogue/DynamicPursuerProjectile.cs index 8272ab76b5..18373a3dfe 100644 --- a/Projectiles/Rogue/DynamicPursuerProjectile.cs +++ b/Projectiles/Rogue/DynamicPursuerProjectile.cs @@ -241,18 +241,18 @@ namespace CalamityMod.Projectiles.Rogue float targettingDistance = MaxTargetSearchDistance * 2f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var n in Main.ActiveNPCs) { - if (i == target.whoAmI) + if (n.whoAmI == target.whoAmI) continue; - if (Main.npc[i].CanBeChasedBy(Projectile)) + if (n.CanBeChasedBy(Projectile)) { - float potentialNewDistance = (Projectile.Center - Main.npc[i].Center).Length(); + float potentialNewDistance = (Projectile.Center - n.Center).Length(); if (potentialNewDistance < targettingDistance && potentialNewDistance < closestNPCDistance) { closestNPCDistance = potentialNewDistance; - newTarget = Main.npc[i]; + newTarget = n; nextTarget = newTarget; if (Projectile.timeLeft < 300) Projectile.timeLeft = 300; diff --git a/Projectiles/Rogue/MeteorFistStealth.cs b/Projectiles/Rogue/MeteorFistStealth.cs index 8abb17f4d8..8f28a51574 100644 --- a/Projectiles/Rogue/MeteorFistStealth.cs +++ b/Projectiles/Rogue/MeteorFistStealth.cs @@ -157,16 +157,15 @@ namespace CalamityMod.Projectiles.Rogue // Get the closest enemy to the fist if (Projectile.penetrate != -1) { - for (int i = 0; i < Main.npc.Length; i++) + foreach (var npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && npc != target) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index 583c47f688..1110f10e34 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -126,9 +126,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[i]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/AquasScepterCloud.cs b/Projectiles/Summon/AquasScepterCloud.cs index 29558b9a37..803c272bf6 100644 --- a/Projectiles/Summon/AquasScepterCloud.cs +++ b/Projectiles/Summon/AquasScepterCloud.cs @@ -57,10 +57,8 @@ namespace CalamityMod.Projectiles.Summon } - for (int i = 0; i < Main.maxNPCs; i++) + foreach (var npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy()) { float between = Vector2.Distance(npc.Center, Projectile.Center); diff --git a/Projectiles/Typeless/ArtifactOfResilienceShards.cs b/Projectiles/Typeless/ArtifactOfResilienceShards.cs index 01a4adbd88..05031e49be 100644 --- a/Projectiles/Typeless/ArtifactOfResilienceShards.cs +++ b/Projectiles/Typeless/ArtifactOfResilienceShards.cs @@ -88,17 +88,16 @@ namespace CalamityMod.Projectiles.Typeless } if (projectile.ModProjectile is ArtifactOfResilienceShard1) { - for (int i = 0; i < Main.npc.Length; i++) + foreach (var n in Main.ActiveNPCs) { - if (Main.npc[i].active && - Main.npc[i].Distance(StartingPosition) < projectile.ai[1] && - Main.npc[i].damage > 0) + if (n.Distance(StartingPosition) < projectile.ai[1] && + n.damage > 0) { - if (Main.npc[i].Calamity().relicOfResilienceCooldown <= 0) + if (n.Calamity().relicOfResilienceCooldown <= 0) { - Main.npc[i].Calamity().relicOfResilienceCooldown = 600; - Main.npc[i].Calamity().relicOfResilienceWeakness = 180; - Main.npc[i].AddBuff(ModContent.BuffType(), Main.npc[i].Calamity().relicOfResilienceWeakness); + n.Calamity().relicOfResilienceCooldown = 600; + n.Calamity().relicOfResilienceWeakness = 180; + n.AddBuff(ModContent.BuffType(), n.Calamity().relicOfResilienceWeakness); } } } diff --git a/UI/VanillaBossBars/AstrumDeusBossBar.cs b/UI/VanillaBossBars/AstrumDeusBossBar.cs index 6934616d86..3d06a16a8b 100644 --- a/UI/VanillaBossBars/AstrumDeusBossBar.cs +++ b/UI/VanillaBossBars/AstrumDeusBossBar.cs @@ -29,10 +29,9 @@ namespace CalamityMod.UI.VanillaBossBars lifeMax = 0f; // Determine the real health by finding more of itself - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC worm = Main.npc[i]; - if (worm.active && worm.type == target.type) + foreach (NPC worm in Main.ActiveNPCs) + { + if (worm.type == target.type) { // In Death Mode, every worm must be killed if (CalamityWorld.death) @@ -57,16 +56,8 @@ namespace CalamityMod.UI.VanillaBossBars public bool FindMoreWorms(ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC target = Main.npc[i]; - if (target.active && target.type == NPCType()) - { - info.npcIndexToAimAt = i; - return true; - } - } - return false; + info.npcIndexToAimAt = NPC.FindFirstNPC(ModContent.NPCType()); + return info.npcIndexToAimAt != -1; } } -} \ No newline at end of file +} diff --git a/UI/VanillaBossBars/CeaselessVoidBossBar.cs b/UI/VanillaBossBars/CeaselessVoidBossBar.cs index 61eb81d341..8306531c75 100644 --- a/UI/VanillaBossBars/CeaselessVoidBossBar.cs +++ b/UI/VanillaBossBars/CeaselessVoidBossBar.cs @@ -50,15 +50,14 @@ namespace CalamityMod.UI.VanillaBossBars FalseNPCSegment.SetDefaults(NPCType(), target.GetMatchingSpawnParams()); shieldMax = (int)(FalseNPCSegment.lifeMax * ExpectedBallsCounter * (1 - RatioToCombust)); shield -= (int)(FalseNPCSegment.lifeMax * ExpectedBallsCounter * RatioToCombust); - - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC part = Main.npc[i]; - if (part.active && part.type == NPCType()) + + foreach (NPC part in Main.ActiveNPCs) + { + if (part.type == NPCType()) shield += part.life; } } return true; } } -} \ No newline at end of file +} diff --git a/UI/VanillaBossBars/CryogenBossBar.cs b/UI/VanillaBossBars/CryogenBossBar.cs index e6d5fdda42..0202bd81cc 100644 --- a/UI/VanillaBossBars/CryogenBossBar.cs +++ b/UI/VanillaBossBars/CryogenBossBar.cs @@ -39,10 +39,9 @@ namespace CalamityMod.UI.VanillaBossBars shieldMax = 0f; // Determine the shield health - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC part = Main.npc[i]; - if (part.active && part.type == NPCType()) + foreach (NPC part in Main.ActiveNPCs) + { + if (part.type == NPCType()) { shield += part.life; shieldMax += part.lifeMax; @@ -51,4 +50,4 @@ namespace CalamityMod.UI.VanillaBossBars return true; } } -} \ No newline at end of file +} diff --git a/UI/VanillaBossBars/ExoMechsBossBar.cs b/UI/VanillaBossBars/ExoMechsBossBar.cs index ebaca057f2..1dcca283e8 100644 --- a/UI/VanillaBossBars/ExoMechsBossBar.cs +++ b/UI/VanillaBossBars/ExoMechsBossBar.cs @@ -79,16 +79,15 @@ namespace CalamityMod.UI.VanillaBossBars lifeMax += FalseNPCSegment.lifeMax; // Find the others - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC ecco in Main.ActiveNPCs) { - NPC ecco = Main.npc[i]; - if (ecco.active && ecco.type == NPCType() && target.type != NPCType()) + if (ecco.type == NPCType() && target.type != NPCType()) life += ecco.life; - if (ecco.active && ecco.type == NPCType() && target.type != NPCType()) + if (ecco.type == NPCType() && target.type != NPCType()) life += ecco.life; - if (ecco.active && ecco.type == NPCType() && target.type != NPCType()) + if (ecco.type == NPCType() && target.type != NPCType()) life += ecco.life; } } @@ -152,4 +151,4 @@ namespace CalamityMod.UI.VanillaBossBars return false; } } -} \ No newline at end of file +} diff --git a/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs b/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs index 06b6d8665a..1347d038d0 100644 --- a/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs +++ b/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs @@ -36,11 +36,10 @@ namespace CalamityMod.UI.VanillaBossBars lifeMax = target.lifeMax; // Find the partner in question - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC wife in Main.ActiveNPCs) { - NPC wife = Main.npc[i]; int targetCouple = target.type == NPCType() ? NPCType() : NPCType(); - if (wife.active && wife.type == targetCouple) + if (wife.type == targetCouple) { life += wife.life; lifeMax += wife.lifeMax; diff --git a/UI/VanillaBossBars/RavagerBossBar.cs b/UI/VanillaBossBars/RavagerBossBar.cs index bc1d6fcaed..d47b95f187 100644 --- a/UI/VanillaBossBars/RavagerBossBar.cs +++ b/UI/VanillaBossBars/RavagerBossBar.cs @@ -46,10 +46,9 @@ namespace CalamityMod.UI.VanillaBossBars } // Determine the current health of the parts - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC part = Main.npc[i]; - if (part.active && RavagerParts.Contains(part.type)) + foreach (NPC part in Main.ActiveNPCs) + { + if (RavagerParts.Contains(part.type)) { life += part.life; } @@ -59,16 +58,8 @@ namespace CalamityMod.UI.VanillaBossBars public bool FindRavagerBody(ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC target = Main.npc[i]; - if (target.active && target.type == NPCType()) - { - info.npcIndexToAimAt = i; - return true; - } - } - return false; + info.npcIndexToAimAt = NPC.FindFirstNPC(ModContent.NPCType()); + return info.npcIndexToAimAt != -1; } } -} \ No newline at end of file +} diff --git a/UI/VanillaBossBars/SlimeGodBossBar.cs b/UI/VanillaBossBars/SlimeGodBossBar.cs index 0d3f8b2cf3..55b4e4f7f5 100644 --- a/UI/VanillaBossBars/SlimeGodBossBar.cs +++ b/UI/VanillaBossBars/SlimeGodBossBar.cs @@ -44,10 +44,9 @@ namespace CalamityMod.UI.VanillaBossBars lifeMax += FalseNPCSegment.lifeMax; // Determine the current health of each slime - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC part = Main.npc[i]; - if (part.active && SlimeGodSlimes.Contains(part.type)) + foreach (NPC part in Main.ActiveNPCs) + { + if (SlimeGodSlimes.Contains(part.type)) { life += part.life; } @@ -55,4 +54,4 @@ namespace CalamityMod.UI.VanillaBossBars return true; } } -} \ No newline at end of file +} diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index a8840f284a..f68b178eea 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -107,15 +107,15 @@ namespace CalamityMod bool locatedTarget = false; // Find a target. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - 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)) + float extraDistance = (n.width / 2) + (n.height / 2); + if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance)) continue; - if (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1)) { - destination = Main.npc[i].Center; + destination = n.Center; locatedTarget = true; break; } @@ -279,17 +279,17 @@ namespace CalamityMod int[] targetArray = new int[maxTargets]; int targetArrayIndex = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(projectile, false)) + if (n.CanBeChasedBy(projectile, false)) { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (n.width / 2) + (n.height / 2); bool canHit = true; if (extraDistance < maxDistance) - canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + canHit = Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1); - if (projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit) + if (projectile.WithinRange(n.Center, maxDistance + extraDistance) && canHit) { if (targetArrayIndex < maxTargets) { From 1a85f860e917554bbe718878e8583155c323bbd0 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 17:34:00 +0500 Subject: [PATCH 33/48] Finished porting npc loops --- NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs | 6 +-- .../DraedonsArsenal/TeslaCannonShot.cs | 8 +-- Projectiles/Magic/BlackAnurianPlankton.cs | 12 ++--- Projectiles/Magic/EventHorizonStar.cs | 10 ++-- Projectiles/Magic/HadalUrnJellyfish.cs | 10 ++-- Projectiles/Magic/NebulaCloudCore.cs | 10 ++-- Projectiles/Magic/SHPB.cs | 8 +-- Projectiles/Magic/WulfrumBolt.cs | 4 +- Projectiles/Magic/WulfrumManaDrain.cs | 6 +-- .../Melee/BalefulHarvesterProjectile.cs | 14 +++-- Projectiles/Melee/CosmicShivTrail.cs | 7 ++- Projectiles/Melee/DivineHatchetBoomerang.cs | 9 ++-- Projectiles/Melee/DraconicSpark.cs | 8 +-- Projectiles/Melee/DragonRageStaff.cs | 5 +- Projectiles/Melee/Galaxia_AriesWrath.cs | 3 +- Projectiles/Melee/GalaxyBlast.cs | 5 +- Projectiles/Melee/GalaxyBlastType2.cs | 5 +- Projectiles/Melee/GalaxyBlastType3.cs | 5 +- .../MendedBiomeBlade_TrueGrovetendersTouch.cs | 3 +- Projectiles/Melee/StygianShieldThrown.cs | 7 ++- Projectiles/Melee/TenebreusTidesWaterSpear.cs | 5 +- Projectiles/Melee/TenebreusTidesWaterSword.cs | 5 +- Projectiles/Melee/Tornado.cs | 3 +- ...TrueBiomeBlade_LamentationsOfTheChained.cs | 3 +- Projectiles/Melee/UrchinSpikeFugu.cs | 5 +- Projectiles/Melee/VoidEssence.cs | 8 +-- Projectiles/Melee/WulfrumScrewdriverProj.cs | 4 +- Projectiles/Melee/Yoyos/ObliteratorYoyo.cs | 10 ++-- Projectiles/Melee/Yoyos/OracleYoyo.cs | 7 ++- Projectiles/Ranged/DrataliornusFlame.cs | 8 ++- Projectiles/Ranged/ExoLight.cs | 6 +-- Projectiles/Ranged/Nanomachine.cs | 12 ++--- Projectiles/Ranged/ThePackMissile.cs | 8 +-- .../Ranged/UniversalGenesisStarcaller.cs | 3 +- Projectiles/Ranged/VeriumBulletProj.cs | 3 +- Projectiles/Rogue/AuroradicalStar.cs | 11 ++-- Projectiles/Rogue/BlunderBoosterLightning.cs | 5 +- Projectiles/Rogue/BouncyBol.cs | 11 ++-- Projectiles/Rogue/CobaltEnergy.cs | 9 ++-- Projectiles/Rogue/DestructionBolt.cs | 8 +-- Projectiles/Rogue/ElementalDiskProj.cs | 3 +- Projectiles/Rogue/EnchantedAxeProj.cs | 5 +- Projectiles/Rogue/EquanimityDarkShard.cs | 7 ++- .../Rogue/FishboneBoomerangProjectile.cs | 10 ++-- Projectiles/Rogue/GildedDaggerProj.cs | 11 ++-- Projectiles/Rogue/GleamingDaggerProj.cs | 11 ++-- Projectiles/Rogue/IceStarProjectile.cs | 10 ++-- Projectiles/Rogue/IcebreakerHammer.cs | 5 +- Projectiles/Rogue/NanoblackSplit.cs | 7 ++- Projectiles/Rogue/NanoblackStealthSplit.cs | 7 ++- Projectiles/Rogue/NightsGazeStar.cs | 7 ++- Projectiles/Rogue/NychthemeronOrb.cs | 5 +- Projectiles/Rogue/RadiantStar2.cs | 22 ++++---- Projectiles/Rogue/RadiantStarKnife.cs | 3 +- Projectiles/Rogue/RealityRuptureMini.cs | 12 ++--- Projectiles/Rogue/ReaperProjectile.cs | 5 +- Projectiles/Rogue/RegulusEnergy.cs | 10 ++-- Projectiles/Rogue/ScourgeoftheDesertProj.cs | 6 +-- Projectiles/Rogue/ShatteredSunKnife.cs | 20 +++---- .../Rogue/ShatteredSunScorchedBlade.cs | 20 +++---- Projectiles/Rogue/ShockGrenadeBolt.cs | 5 +- Projectiles/Rogue/SpearofDestinyProjectile.cs | 12 ++--- Projectiles/Rogue/StellarKnifeProj.cs | 12 ++--- Projectiles/Rogue/SupernovaHoming.cs | 10 ++-- Projectiles/Rogue/TerraDiskProjectile.cs | 3 +- Projectiles/Rogue/TimeBoltKnife.cs | 10 ++-- Projectiles/Rogue/VeneratedKnife.cs | 5 +- Projectiles/Summon/AstrageldonSummon.cs | 3 +- Projectiles/Summon/BabyPlaguebringer.cs | 3 +- .../Summon/BrimstoneElementalMinion.cs | 3 +- .../Summon/CnidarianJellyfishOnTheString.cs | 8 +-- Projectiles/Summon/CosmicEnergySpiral.cs | 5 +- Projectiles/Summon/CosmicViperHomingRocket.cs | 10 ++-- Projectiles/Summon/Dreadmine.cs | 10 ++-- Projectiles/Summon/EndoCooperBody.cs | 3 +- Projectiles/Summon/EndoIceShard.cs | 6 +-- Projectiles/Summon/HowlsHeartFireball.cs | 3 +- Projectiles/Summon/IceSentry.cs | 5 +- Projectiles/Summon/OldDukeSharkVomit.cs | 8 +-- Projectiles/Summon/SakuraBullet.cs | 3 +- Projectiles/Summon/SepulcherMinion.cs | 12 ++--- Projectiles/Summon/SilvaCrystal.cs | 7 +-- Projectiles/Summon/SolarGod.cs | 3 +- Projectiles/Summon/SolarPixie.cs | 3 +- Projectiles/Summon/Spikecrag.cs | 8 +-- Projectiles/Summon/StormjawBaby.cs | 8 ++- Projectiles/Summon/Umbrella/MagicBird.cs | 8 +-- Projectiles/Summon/Umbrella/MagicUmbrella.cs | 9 ++-- Projectiles/Summon/VictideSeaSnail.cs | 3 +- .../Summon/VoidConcentrationBlackhole.cs | 12 ++--- Projectiles/Summon/WaterElementalMinion.cs | 10 ++-- Projectiles/Summon/WulfrumEnergyBurst.cs | 4 +- Projectiles/Summon/WulfrumFusionBolt.cs | 4 +- Projectiles/Typeless/CursorProj.cs | 8 +-- Projectiles/Typeless/CursorProjSplit.cs | 8 +-- Projectiles/Typeless/KelvinCatalystStar.cs | 10 ++-- Projectiles/Typeless/LunicBeam.cs | 8 +-- Projectiles/Typeless/MagnusBeam.cs | 8 +-- Projectiles/Typeless/OmegaBlueTentacle.cs | 5 +- Skies/CryogenSky.cs | 10 +--- Skies/DrunkCrabScreenShaderData.cs | 20 +------ Skies/SCalScreenShaderData.cs | 10 +--- Skies/SCalSky.cs | 10 +--- Skies/StormWeaverFlashSky.cs | 10 +--- TileEntities/TEPlayerFireTurret.cs | 7 ++- TileEntities/TEPlayerIceTurret.cs | 7 ++- TileEntities/TEPlayerLabTurret.cs | 7 ++- TileEntities/TEPlayerLaserTurret .cs | 7 ++- TileEntities/TEPlayerOnyxTurret.cs | 7 ++- TileEntities/TEPlayerPlagueTurret.cs | 7 ++- TileEntities/TEPlayerWaterTurret.cs | 7 ++- UI/BossHealthBarManager.cs | 46 ++++++++-------- UI/BossRushUI.cs | 10 ++-- .../EnchantmentManager.cs | 4 +- UI/VanillaBossBars/ExoMechsBossBar.cs | 53 +++++++++---------- UI/VanillaBossBars/LeviathanAnahitaBossBar.cs | 16 +++--- Utilities/DropHelper.cs | 12 ++--- Utilities/NPCUtils.cs | 20 +++---- Utilities/ProjectileUtils.cs | 9 ++-- 119 files changed, 424 insertions(+), 585 deletions(-) diff --git a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs index 75c8d4c46a..c4b29a59c4 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/PlanteraAI.cs @@ -627,14 +627,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.getGoodWorld) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].aiStyle == NPCAIStyleID.PlanteraHook) + if (n.aiStyle == NPCAIStyleID.PlanteraHook) { for (int j = 0; j < totalTentacles / 2 - 1; j++) { int hookIndex = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI); - Main.npc[hookIndex].ai[3] = i + 1; + Main.npc[hookIndex].ai[3] = n.whoAmI + 1; } } } diff --git a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs index a9ac5ec782..91dfa10a9d 100644 --- a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs +++ b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs @@ -96,14 +96,14 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { if (arcs < 10) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].CanBeChasedBy(Projectile, false) || !Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (!n.CanBeChasedBy(Projectile, false) || !Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) continue; - if (Projectile.Center.ManhattanDistance(Main.npc[i].Center) < 600f) + if (Projectile.Center.ManhattanDistance(n.Center) < 600f) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.SafeDirectionTo(Main.npc[i].Center) * 2f, Projectile.type, (int)(Projectile.damage * 0.6), Projectile.knockBack * 0.6f, Projectile.owner, 0f, -1f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.SafeDirectionTo(n.Center) * 2f, Projectile.type, (int)(Projectile.damage * 0.6), Projectile.knockBack * 0.6f, Projectile.owner, 0f, -1f); Projectile.ai[1] = 60f; diff --git a/Projectiles/Magic/BlackAnurianPlankton.cs b/Projectiles/Magic/BlackAnurianPlankton.cs index e60b867d46..321fb1c5bb 100644 --- a/Projectiles/Magic/BlackAnurianPlankton.cs +++ b/Projectiles/Magic/BlackAnurianPlankton.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -57,14 +57,14 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.ai[0] > 30f) { Projectile.ai[0] = 30f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && !Main.npc[i].wet) + if (n.CanBeChasedBy(Projectile, false) && !n.wet) { - float npcX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); - if (npcDist < 800f && npcDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + if (npcDist < 800f && npcDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { homingRange = npcDist; projX = npcX; diff --git a/Projectiles/Magic/EventHorizonStar.cs b/Projectiles/Magic/EventHorizonStar.cs index e5ad6b45e2..98a656a697 100644 --- a/Projectiles/Magic/EventHorizonStar.cs +++ b/Projectiles/Magic/EventHorizonStar.cs @@ -93,15 +93,15 @@ namespace CalamityMod.Projectiles.Magic float inertia = 25f; float homingSpeed = 23f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (homingRange + extraDistance)) + if (Vector2.Distance(n.Center, Projectile.Center) < (homingRange + extraDistance)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Magic/HadalUrnJellyfish.cs b/Projectiles/Magic/HadalUrnJellyfish.cs index 4d4aef0ef4..62e5e44d96 100644 --- a/Projectiles/Magic/HadalUrnJellyfish.cs +++ b/Projectiles/Magic/HadalUrnJellyfish.cs @@ -75,17 +75,17 @@ namespace CalamityMod.Projectiles.Magic //Detect if any enemies are very close int maxDistance = 10; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (n.width / 2) + (n.height / 2); bool canHit = true; if (extraDistance < maxDistance) - canHit = Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + canHit = Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1); - if (Projectile.WithinRange(Main.npc[i].Center, maxDistance + extraDistance) && canHit) + if (Projectile.WithinRange(n.Center, maxDistance + extraDistance) && canHit) { neartarget = true; } diff --git a/Projectiles/Magic/NebulaCloudCore.cs b/Projectiles/Magic/NebulaCloudCore.cs index d6666420d1..ed319b9e30 100644 --- a/Projectiles/Magic/NebulaCloudCore.cs +++ b/Projectiles/Magic/NebulaCloudCore.cs @@ -169,17 +169,17 @@ namespace CalamityMod.Projectiles.Magic int npcTrack = 0; if (Projectile.ai[1] == 0f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(this)) + if (n.CanBeChasedBy(this)) { - Vector2 npcCenter = Main.npc[i].Center; - if (Projectile.Distance(npcCenter) < homingRange && Collision.CanHit(new Vector2(Projectile.position.X + Projectile.width / 2, Projectile.position.Y + Projectile.height / 2), 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + Vector2 npcCenter = n.Center; + if (Projectile.Distance(npcCenter) < homingRange && Collision.CanHit(new Vector2(Projectile.position.X + Projectile.width / 2, Projectile.position.Y + Projectile.height / 2), 1, 1, n.position, n.width, n.height)) { homingRange = Projectile.Distance(npcCenter); projCenter = npcCenter; isHoming = true; - npcTrack = i; + npcTrack = n.whoAmI; } } } diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index 0e15e88b72..27a7ba82ed 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -68,12 +68,12 @@ namespace CalamityMod.Projectiles.Magic float projY = Projectile.Center.Y; float explodeRange = 250f; bool canExplode = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - float npcX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); if (npcDist < explodeRange) { diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index cfc61cf935..3fc17e8371 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -67,10 +67,8 @@ namespace CalamityMod.Projectiles.Magic float bestScore = 0; NPC bestTarget = null; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC potentialTarget in Main.ActiveNPCs) { - NPC potentialTarget = Main.npc[i]; - if (!potentialTarget.CanBeChasedBy(null, false)) continue; diff --git a/Projectiles/Magic/WulfrumManaDrain.cs b/Projectiles/Magic/WulfrumManaDrain.cs index 91f819ab36..94200a851e 100644 --- a/Projectiles/Magic/WulfrumManaDrain.cs +++ b/Projectiles/Magic/WulfrumManaDrain.cs @@ -94,11 +94,9 @@ namespace CalamityMod.Projectiles.Magic { float collisionPoint = 0f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC struckNPC in Main.ActiveNPCs) { - NPC struckNPC = Main.npc[i]; - - if (!struckNPC.active || struckNPC.townNPC || struckNPC.friendly) + if (struckNPC.townNPC || struckNPC.friendly) continue; float distance = struckNPC.Distance(Projectile.Center); diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index 6abc9e648a..b97798b738 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -73,21 +73,19 @@ namespace CalamityMod.Projectiles.Melee else { float homingRange = 1000f; - int inc; - for (int i = 0; i < Main.maxNPCs; i = inc + 1) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float npcX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); - if (npcDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + if (npcDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { homingRange = npcDist; - Projectile.ai[0] = (float)i; + Projectile.ai[0] = (float)n.whoAmI; } } - inc = i; } } diff --git a/Projectiles/Melee/CosmicShivTrail.cs b/Projectiles/Melee/CosmicShivTrail.cs index 01c7d802d6..ce3d12178f 100644 --- a/Projectiles/Melee/CosmicShivTrail.cs +++ b/Projectiles/Melee/CosmicShivTrail.cs @@ -115,10 +115,9 @@ namespace CalamityMod.Projectiles.Melee return; Player owner = Main.player[Projectile.owner]; - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; - if (!target.active || target.dontTakeDamage || target.friendly) + if (target.dontTakeDamage || target.friendly) continue; // Shock any valid target within range. Check all four corners of their hitbox. @@ -137,7 +136,7 @@ namespace CalamityMod.Projectiles.Melee target.StrikeNPC(target.CalculateHitInfo(damage, 0, crit, 0)); if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); + NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, target.whoAmI, damage, 0f, 0f, crit ? 1 : 0, 0, 0); } } } diff --git a/Projectiles/Melee/DivineHatchetBoomerang.cs b/Projectiles/Melee/DivineHatchetBoomerang.cs index bb9734bcd1..5f92f2f2dd 100644 --- a/Projectiles/Melee/DivineHatchetBoomerang.cs +++ b/Projectiles/Melee/DivineHatchetBoomerang.cs @@ -165,21 +165,20 @@ namespace CalamityMod.Projectiles.Melee //find a nearby NPC to track float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { bool hasHitNPC = false; for (int j = 0; j < previousNPCs.Count; j++) { - if (previousNPCs[j] == i) + if (previousNPCs[j] == npc.whoAmI) { hasHitNPC = true; } } - NPC npc = Main.npc[i]; if (npc == target) { - previousNPCs.Add(i); + previousNPCs.Add(npc.whoAmI); } if (npc.CanBeChasedBy(Projectile, false) && npc != target && !hasHitNPC) { @@ -187,7 +186,7 @@ namespace CalamityMod.Projectiles.Melee if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Melee/DraconicSpark.cs b/Projectiles/Melee/DraconicSpark.cs index 0f0d594376..fc168a7351 100644 --- a/Projectiles/Melee/DraconicSpark.cs +++ b/Projectiles/Melee/DraconicSpark.cs @@ -46,12 +46,12 @@ namespace CalamityMod.Projectiles.Melee float targetY = Projectile.Center.Y; bool foundTarget = false; float maxRange = MaxHomingRange; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - float iterCenterX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float iterCenterY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float iterCenterX = n.position.X + (float)(n.width / 2); + float iterCenterY = n.position.Y + (float)(n.height / 2); float dist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - iterCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - iterCenterY); if (dist < maxRange) { diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 5973f399e6..20943dfd06 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -191,13 +191,12 @@ namespace CalamityMod.Projectiles.Melee Rectangle myRect = Projectile.Hitbox; if (Projectile.owner == Main.myPlayer) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; bool voodooDolls = Projectile.owner < Main.maxPlayers && (npc.type == NPCID.Guide && player.killGuide || npc.type == NPCID.Clothier && player.killClothier); bool friendlyProjs = Projectile.friendly && (!npc.friendly || voodooDolls); bool hostileProjs = Projectile.hostile && npc.friendly && !npc.dontTakeDamageFromHostiles; - if (npc.active && !npc.dontTakeDamage && (friendlyProjs || hostileProjs) && (Projectile.owner < 0 || npc.immune[Projectile.owner] == 0 || Projectile.maxPenetrate == 1)) + if (!npc.dontTakeDamage && (friendlyProjs || hostileProjs) && (Projectile.owner < 0 || npc.immune[Projectile.owner] == 0 || Projectile.maxPenetrate == 1)) { if (npc.noTileCollide || !Projectile.ownerHitCheck || (ProjectileLoader.CanHitNPC(Projectile, npc) ?? false)) { diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index d0e7cd2ecc..b2e1e6e179 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -88,9 +88,8 @@ namespace CalamityMod.Projectiles.Melee { float longestReach = MaxProjReach; NPC target = null; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (!excludedTargets.Contains(npc) && npc.CanBeChasedBy() && !npc.friendly && !npc.townNPC) { float distance = Vector2.Distance(hitFrom, npc.Center); diff --git a/Projectiles/Melee/GalaxyBlast.cs b/Projectiles/Melee/GalaxyBlast.cs index fffe60486e..40daf00f84 100644 --- a/Projectiles/Melee/GalaxyBlast.cs +++ b/Projectiles/Melee/GalaxyBlast.cs @@ -79,16 +79,15 @@ namespace CalamityMod.Projectiles.Melee { int npcTracker = -1; float homingRange = 60f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; if (nPC.CanBeChasedBy(Projectile, false)) { float npcDistance = Projectile.Distance(nPC.Center); if (npcDistance < homingRange && Collision.CanHitLine(Projectile.Center, 0, 0, nPC.Center, 0, 0)) { homingRange = npcDistance; - npcTracker = i; + npcTracker = nPC.whoAmI; } } } diff --git a/Projectiles/Melee/GalaxyBlastType2.cs b/Projectiles/Melee/GalaxyBlastType2.cs index d48506f7bc..972ec53f1c 100644 --- a/Projectiles/Melee/GalaxyBlastType2.cs +++ b/Projectiles/Melee/GalaxyBlastType2.cs @@ -80,16 +80,15 @@ namespace CalamityMod.Projectiles.Melee { int npcTracker = -1; float homingRange = 60f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; if (nPC.CanBeChasedBy(Projectile, false)) { float npcDistance = Projectile.Distance(nPC.Center); if (npcDistance < homingRange && Collision.CanHitLine(Projectile.Center, 0, 0, nPC.Center, 0, 0)) { homingRange = npcDistance; - npcTracker = i; + npcTracker = nPC.whoAmI; } } } diff --git a/Projectiles/Melee/GalaxyBlastType3.cs b/Projectiles/Melee/GalaxyBlastType3.cs index 42903a8258..4555006dfc 100644 --- a/Projectiles/Melee/GalaxyBlastType3.cs +++ b/Projectiles/Melee/GalaxyBlastType3.cs @@ -79,16 +79,15 @@ namespace CalamityMod.Projectiles.Melee { int npcTracker = -1; float homingRange = 60f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; if (nPC.CanBeChasedBy(Projectile, false)) { float npcDistance = Projectile.Distance(nPC.Center); if (npcDistance < homingRange && Collision.CanHitLine(Projectile.Center, 0, 0, nPC.Center, 0, 0)) { homingRange = npcDistance; - npcTracker = i; + npcTracker = nPC.whoAmI; } } } diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs index fe00ddb07e..f48f6e2a5e 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs @@ -132,9 +132,8 @@ namespace CalamityMod.Projectiles.Melee { float longestReach = MaxTangleReach; NPC target = null; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (!excludedTargets.Contains(npc) && npc.CanBeChasedBy() && !npc.friendly && !npc.townNPC) { float distance = Vector2.Distance(hitFrom, npc.Center); diff --git a/Projectiles/Melee/StygianShieldThrown.cs b/Projectiles/Melee/StygianShieldThrown.cs index bea6327383..72d22920b4 100644 --- a/Projectiles/Melee/StygianShieldThrown.cs +++ b/Projectiles/Melee/StygianShieldThrown.cs @@ -115,17 +115,16 @@ namespace CalamityMod.Projectiles.Melee // Find the closest NPC targetable float range = MaxHomingRange; int targetNPC = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; - if (!target.CanBeChasedBy(Projectile) || PreviousNPCs.Contains(i)) + if (!target.CanBeChasedBy(Projectile) || PreviousNPCs.Contains(target.whoAmI)) continue; float distance = Vector2.Distance(target.Center, Projectile.Center); if (distance < range && Collision.CanHit(Projectile, target)) { range = distance; - targetNPC = i; + targetNPC = target.whoAmI; } } diff --git a/Projectiles/Melee/TenebreusTidesWaterSpear.cs b/Projectiles/Melee/TenebreusTidesWaterSpear.cs index 05a3840fc4..ed67f22819 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSpear.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSpear.cs @@ -121,9 +121,8 @@ namespace CalamityMod.Projectiles.Melee int whoAmI = -1; Vector2 targetSpot = Projectile.Center; float detectRange = 700f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(npc.Center, Projectile.Center); @@ -131,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee { detectRange = targetDist; targetSpot = npc.Center; - whoAmI = i; + whoAmI = npc.whoAmI; } } } diff --git a/Projectiles/Melee/TenebreusTidesWaterSword.cs b/Projectiles/Melee/TenebreusTidesWaterSword.cs index f4b305e391..b4227689fc 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSword.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSword.cs @@ -103,9 +103,8 @@ namespace CalamityMod.Projectiles.Melee int whoAmI = -1; Vector2 targetSpot = Projectile.Center; float detectRange = 700f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(npc.Center, Projectile.Center); @@ -113,7 +112,7 @@ namespace CalamityMod.Projectiles.Melee { detectRange = targetDist; targetSpot = npc.Center; - whoAmI = i; + whoAmI = npc.whoAmI; } } } diff --git a/Projectiles/Melee/Tornado.cs b/Projectiles/Melee/Tornado.cs index 8a0fe3f3eb..6e1b19a6df 100644 --- a/Projectiles/Melee/Tornado.cs +++ b/Projectiles/Melee/Tornado.cs @@ -82,9 +82,8 @@ namespace CalamityMod.Projectiles.Melee } float projX = Projectile.Center.X; float projY = Projectile.Center.Y; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { float npcCenterX = npc.position.X + (float)(npc.width / 2); diff --git a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs index 34e6c90b6f..cde782bee1 100644 --- a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs +++ b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs @@ -142,9 +142,8 @@ namespace CalamityMod.Projectiles.Melee { float longestReach = MaxTangleReach; NPC target = null; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (!excludedTargets.Contains(npc) && npc.CanBeChasedBy() && !npc.friendly && !npc.townNPC) { float distance = Vector2.Distance(hitFrom, npc.Center); diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 32fa5908ae..301d95a46a 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -29,15 +29,14 @@ namespace CalamityMod.Projectiles.Melee { float maxRange = 100f; int npcIndex = -1; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) { float targetDist = (npc.Center - Projectile.Center).Length(); if (targetDist < maxRange) { - npcIndex = i; + npcIndex = npc.whoAmI; maxRange = targetDist; } } diff --git a/Projectiles/Melee/VoidEssence.cs b/Projectiles/Melee/VoidEssence.cs index f04b58b948..692aea191f 100644 --- a/Projectiles/Melee/VoidEssence.cs +++ b/Projectiles/Melee/VoidEssence.cs @@ -88,19 +88,15 @@ namespace CalamityMod.Projectiles.Melee int targetIdx = -1; float maxHomingRange = 400f; bool hasHomingTarget = false; - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc == null || !npc.active) - continue; - // Won't home in through walls and won't chase invulnerable targets. if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < maxHomingRange) { - targetIdx = i; + targetIdx = npc.whoAmI; maxHomingRange = dist; hasHomingTarget = true; } diff --git a/Projectiles/Melee/WulfrumScrewdriverProj.cs b/Projectiles/Melee/WulfrumScrewdriverProj.cs index 055f9e5eaf..e06f69f78e 100644 --- a/Projectiles/Melee/WulfrumScrewdriverProj.cs +++ b/Projectiles/Melee/WulfrumScrewdriverProj.cs @@ -132,10 +132,8 @@ namespace CalamityMod.Projectiles.Melee float bestScore = 0; NPC bestTarget = null; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC potentialTarget in Main.ActiveNPCs) { - NPC potentialTarget = Main.npc[i]; - if (!potentialTarget.CanBeChasedBy(null, false)) continue; diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index d630b7e18f..216ed1159c 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -65,19 +65,15 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { List targets = new List(); float laserRange = 300f; - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC n in Main.ActiveNPCs) { - ref NPC n = ref Main.npc[i]; - if (n is null || !n.active) - continue; - if (n.CanBeChasedBy(Projectile, false) && (n.Center - Projectile.Center).Length() <= laserRange && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - targets.Add(i); + targets.Add(n.whoAmI); // Bosses are added 5 times instead of 1 so that they are preferentially but not exclusively targeted. if (n.boss) for (int j = 0; j < 4; ++j) - targets.Add(i); + targets.Add(n.whoAmI); } } if (targets.Count == 0) diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 7c0b87a262..54db87c83f 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -221,10 +221,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos return; Player owner = Main.player[Projectile.owner]; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; - if (!target.active || target.dontTakeDamage || target.friendly) + if (target.dontTakeDamage || target.friendly) continue; // Shock any valid target within range. Check all four corners of their hitbox. @@ -241,7 +240,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos int finalDamage = (int)owner.GetTotalDamage().ApplyTo(baseDamage); if (Projectile.owner == Main.myPlayer) { - Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), finalDamage, 0f, Projectile.owner, i); + Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), finalDamage, 0f, Projectile.owner, target.whoAmI); if (p.whoAmI.WithinBounds(Main.maxProjectiles)) p.DamageType = DamageClass.MeleeNoSpeed; } diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index c80e073847..d898a477a0 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -73,11 +73,9 @@ namespace CalamityMod.Projectiles.Ranged int possibleTarget = -1; float closestDistance = 700f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - - if (npc.active && npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && + if (npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal && Collision.CanHit(Projectile.Center, 0, 0, npc.Center, 0, 0)) { float distance = Vector2.Distance(Projectile.Center, npc.Center); @@ -85,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged if (closestDistance > distance) { closestDistance = distance; - possibleTarget = i; + possibleTarget = npc.whoAmI; } } } diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index 25dc0f5244..0971c27bc8 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -71,10 +71,10 @@ namespace CalamityMod.Projectiles.Ranged Projectile.scale = MathHelper.Lerp(0.001f, 1f, Utils.GetLerpValue(0f, 25f, Time, true)); if (Projectile.localAI[0] == 0f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false)) - NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f; + if (n.CanBeChasedBy(Projectile.GetSource_FromThis(), false)) + NPCDestination = n.Center + n.velocity * 5f; } InitialCenter = Projectile.Center; Projectile.localAI[0] = 1f; diff --git a/Projectiles/Ranged/Nanomachine.cs b/Projectiles/Ranged/Nanomachine.cs index 75f9d5c6a7..d6410d7a2a 100644 --- a/Projectiles/Ranged/Nanomachine.cs +++ b/Projectiles/Ranged/Nanomachine.cs @@ -84,20 +84,20 @@ namespace CalamityMod.Projectiles.Ranged int targetID = 0; if (Projectile.ai[1] == 0f) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && (Projectile.ai[1] == 0f || Projectile.ai[1] == (float)(i + 1))) + if (n.CanBeChasedBy(Projectile, false) && (Projectile.ai[1] == 0f || Projectile.ai[1] == (float)(i + 1))) { - float targetX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float targetY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float targetX = n.position.X + (float)(n.width / 2); + float targetY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - targetX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - targetY); - if (targetDist < constant && Collision.CanHit(new Vector2(Projectile.position.X + (float)(Projectile.width / 2), Projectile.position.Y + (float)(Projectile.height / 2)), 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + if (targetDist < constant && Collision.CanHit(new Vector2(Projectile.position.X + (float)(Projectile.width / 2), Projectile.position.Y + (float)(Projectile.height / 2)), 1, 1, n.position, n.width, n.height)) { constant = targetDist; projX = targetX; projY = targetY; canHit = true; - targetID = i; + targetID = n.whoAmI; } } } diff --git a/Projectiles/Ranged/ThePackMissile.cs b/Projectiles/Ranged/ThePackMissile.cs index 4275d0a5f7..75b884a75a 100644 --- a/Projectiles/Ranged/ThePackMissile.cs +++ b/Projectiles/Ranged/ThePackMissile.cs @@ -36,11 +36,11 @@ namespace CalamityMod.Projectiles.Ranged Vector2 targetCenter = Projectile.Center; float minTargetDistance = 2500f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - float distanceFromTarget = Projectile.Center.ManhattanDistance(Main.npc[i].Center); + float distanceFromTarget = Projectile.Center.ManhattanDistance(n.Center); if (distanceFromTarget < 200f) { if (Projectile.owner == Main.myPlayer) @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged else if (distanceFromTarget < minTargetDistance) { minTargetDistance = distanceFromTarget; - targetCenter = Main.npc[i].Center; + targetCenter = n.Center; homeIn = true; } } diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index 8fedbd47d4..3fe690c60b 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -87,9 +87,8 @@ namespace CalamityMod.Projectiles.Ranged bool bossFound = false; int life = 0; Vector2 targetVec = Projectile.Center; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (bossFound && !npc.IsABoss()) continue; if (npc.CanBeChasedBy(Projectile, false)) diff --git a/Projectiles/Ranged/VeriumBulletProj.cs b/Projectiles/Ranged/VeriumBulletProj.cs index c88c124d7d..58860907cd 100644 --- a/Projectiles/Ranged/VeriumBulletProj.cs +++ b/Projectiles/Ranged/VeriumBulletProj.cs @@ -84,9 +84,8 @@ namespace CalamityMod.Projectiles.Ranged if (!homeIn) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float extraDistance = (npc.width / 2) + (npc.height / 2); diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index 30c8ad5c1c..e68ea44f36 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -72,16 +72,15 @@ namespace CalamityMod.Projectiles.Rogue //Home in float maxDistance = 800f; int targetIndex = -1; - int i; - for (i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (n.width / 2) + (n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance)) { - targetIndex = i; + targetIndex = n.whoAmI; break; } } diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index a6c2dfa5ae..191a430104 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -57,16 +57,15 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = -1; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/BouncyBol.cs b/Projectiles/Rogue/BouncyBol.cs index 0d312c0f8d..35e9a14dd2 100644 --- a/Projectiles/Rogue/BouncyBol.cs +++ b/Projectiles/Rogue/BouncyBol.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -47,21 +47,20 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { bool hasHitNPC = false; for (int j = 0; j < previousNPCs.Count; j++) { - if (previousNPCs[j] == i) + if (previousNPCs[j] == npc.whoAmI) { hasHitNPC = true; } } - NPC npc = Main.npc[i]; if (npc == target) { - previousNPCs.Add(i); + previousNPCs.Add(npc.whoAmI); } if (npc.CanBeChasedBy(Projectile, false) && npc != target && !hasHitNPC) { @@ -69,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/CobaltEnergy.cs b/Projectiles/Rogue/CobaltEnergy.cs index 69d3ed5d4e..eab8edce99 100644 --- a/Projectiles/Rogue/CobaltEnergy.cs +++ b/Projectiles/Rogue/CobaltEnergy.cs @@ -59,21 +59,20 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { bool hasHitNPC = false; for (int j = 0; j < previousNPCs.Count; j++) { - if (previousNPCs[j] == i) + if (previousNPCs[j] == npc.whoAmI) { hasHitNPC = true; } } - NPC npc = Main.npc[i]; if (npc == target) { - previousNPCs.Add(i); + previousNPCs.Add(npc.whoAmI); } if (npc.CanBeChasedBy(Projectile, false) && npc != target && !hasHitNPC) { @@ -81,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index d7dad8bd93..fd67b5fbff 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -55,16 +55,16 @@ namespace CalamityMod.Projectiles.Rogue { int index = -1; float otherConstant = 300f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 npcCenter = Main.npc[i].Center; + Vector2 npcCenter = n.Center; float targetDist = Vector2.Distance(npcCenter, Projectile.Center); if (targetDist < otherConstant && index == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, npcCenter, 1, 1)) { otherConstant = targetDist; - index = i; + index = n.whoAmI; } } } diff --git a/Projectiles/Rogue/ElementalDiskProj.cs b/Projectiles/Rogue/ElementalDiskProj.cs index 8f2c0c7268..3f90caa6b7 100644 --- a/Projectiles/Rogue/ElementalDiskProj.cs +++ b/Projectiles/Rogue/ElementalDiskProj.cs @@ -116,9 +116,8 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 300f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float extraDistance = npc.width / 2 + npc.height / 2; diff --git a/Projectiles/Rogue/EnchantedAxeProj.cs b/Projectiles/Rogue/EnchantedAxeProj.cs index e983fd061d..9501976f77 100644 --- a/Projectiles/Rogue/EnchantedAxeProj.cs +++ b/Projectiles/Rogue/EnchantedAxeProj.cs @@ -73,16 +73,15 @@ namespace CalamityMod.Projectiles.Rogue float minDist = 999f; int index = 0; // Get the closest enemy to the axe - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/EquanimityDarkShard.cs b/Projectiles/Rogue/EquanimityDarkShard.cs index 46fcc5ab9f..5b056ca4a0 100644 --- a/Projectiles/Rogue/EquanimityDarkShard.cs +++ b/Projectiles/Rogue/EquanimityDarkShard.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; @@ -30,16 +30,15 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/FishboneBoomerangProjectile.cs b/Projectiles/Rogue/FishboneBoomerangProjectile.cs index b49727d24e..5786c00fd0 100644 --- a/Projectiles/Rogue/FishboneBoomerangProjectile.cs +++ b/Projectiles/Rogue/FishboneBoomerangProjectile.cs @@ -168,18 +168,18 @@ namespace CalamityMod.Projectiles.Rogue float closestNPCDistance = 10000f; float targettingDistance = 400f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (i == target.whoAmI) + if (n.whoAmI == target.whoAmI) continue; - if (Main.npc[i].CanBeChasedBy(Projectile)) + if (n.CanBeChasedBy(Projectile)) { - float potentialNewDistance = (Projectile.Center - Main.npc[i].Center).Length(); + float potentialNewDistance = (Projectile.Center - n.Center).Length(); if (potentialNewDistance < targettingDistance && potentialNewDistance < closestNPCDistance) { closestNPCDistance = potentialNewDistance; - newTarget = Main.npc[i]; + newTarget = n; } } } diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index 56a0f11ac7..1c85297dee 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using Terraria; @@ -70,21 +70,20 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { bool hasHitNPC = false; for (int j = 0; j < previousNPCs.Count; j++) { - if (previousNPCs[j] == i) + if (previousNPCs[j] == npc.whoAmI) { hasHitNPC = true; } } - NPC npc = Main.npc[i]; if (npc == target) { - previousNPCs.Add(i); + previousNPCs.Add(npc.whoAmI); } if (npc.CanBeChasedBy(Projectile, false) && npc != target && !hasHitNPC) { @@ -92,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index ad36a49670..447bf599d0 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using Terraria; @@ -70,21 +70,20 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { bool hasHitNPC = false; for (int j = 0; j < previousNPCs.Count; j++) { - if (previousNPCs[j] == i) + if (previousNPCs[j] == npc.whoAmI) { hasHitNPC = true; } } - NPC npc = Main.npc[i]; if (npc == target) { - previousNPCs.Add(i); + previousNPCs.Add(npc.whoAmI); } if (npc.CanBeChasedBy(Projectile, false) && npc != target && !hasHitNPC) { @@ -92,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index 1756a355ab..549445eefe 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -51,15 +51,15 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = Projectile.Calamity().stealthStrike ? 800f : 400f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index c383c2a93e..cfc9332937 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -64,10 +64,9 @@ namespace CalamityMod.Projectiles.Rogue int buffType = ModContent.BuffType(); float radius = 112f; // 7 blocks - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[i]; - if (nPC.active && !nPC.dontTakeDamage && !nPC.buffImmune[buffType] && Vector2.Distance(Projectile.Center, nPC.Center) <= radius) + if (!nPC.dontTakeDamage && !nPC.buffImmune[buffType] && Vector2.Distance(Projectile.Center, nPC.Center) <= radius) { if (nPC.FindBuffIndex(buffType) == -1) nPC.AddBuff(buffType, 60, false); diff --git a/Projectiles/Rogue/NanoblackSplit.cs b/Projectiles/Rogue/NanoblackSplit.cs index 02acd5659f..5b5b9e37f4 100644 --- a/Projectiles/Rogue/NanoblackSplit.cs +++ b/Projectiles/Rogue/NanoblackSplit.cs @@ -128,10 +128,9 @@ namespace CalamityMod.Projectiles.Rogue bool bossFound = false; int target = -1; float minDist = HomingStartRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.type == NPCID.TargetDummy) + if (npc.type == NPCID.TargetDummy) continue; // If we've found a valid boss target, ignore ALL targets which aren't bosses. @@ -149,7 +148,7 @@ namespace CalamityMod.Projectiles.Rogue if (npc.boss) bossFound = true; minDist = distToNPC; - target = i; + target = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/NanoblackStealthSplit.cs b/Projectiles/Rogue/NanoblackStealthSplit.cs index f47d6f7550..4881561c22 100644 --- a/Projectiles/Rogue/NanoblackStealthSplit.cs +++ b/Projectiles/Rogue/NanoblackStealthSplit.cs @@ -137,10 +137,9 @@ namespace CalamityMod.Projectiles.Rogue bool bossFound = false; int target = -1; float minDist = HomingStartRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.type == NPCID.TargetDummy) + if (npc.type == NPCID.TargetDummy) continue; // If we've found a valid boss target, ignore ALL targets which aren't bosses. @@ -158,7 +157,7 @@ namespace CalamityMod.Projectiles.Rogue if (npc.boss) bossFound = true; minDist = distToNPC; - target = i; + target = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/NightsGazeStar.cs b/Projectiles/Rogue/NightsGazeStar.cs index b44f27a51d..33284710b1 100644 --- a/Projectiles/Rogue/NightsGazeStar.cs +++ b/Projectiles/Rogue/NightsGazeStar.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; @@ -65,16 +65,15 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/NychthemeronOrb.cs b/Projectiles/Rogue/NychthemeronOrb.cs index 367c0c5c4e..2927406455 100644 --- a/Projectiles/Rogue/NychthemeronOrb.cs +++ b/Projectiles/Rogue/NychthemeronOrb.cs @@ -64,16 +64,15 @@ namespace CalamityMod.Projectiles.Rogue // Follow Enemy float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 91ef243b35..7b46365b10 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; @@ -41,30 +41,30 @@ namespace CalamityMod.Projectiles.Rogue float projY = Projectile.Center.Y; float homeRange = Projectile.Calamity().stealthStrike ? 1800f : 600f; float homingSpeed = 0.25f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { - float npcCenterX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcCenterY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcCenterX = n.position.X + (float)(n.width / 2); + float npcCenterY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); if (targetDist < homeRange) { - if (Main.npc[i].position.X < projX) + if (n.position.X < projX) { - Main.npc[i].velocity.X += homingSpeed; + n.velocity.X += homingSpeed; } else { - Main.npc[i].velocity.X -= homingSpeed; + n.velocity.X -= homingSpeed; } - if (Main.npc[i].position.Y < projY) + if (n.position.Y < projY) { - Main.npc[i].velocity.Y += homingSpeed; + n.velocity.Y += homingSpeed; } else { - Main.npc[i].velocity.Y -= homingSpeed; + n.velocity.Y -= homingSpeed; } } } diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index 2486e3c7eb..bcf0aae582 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -41,9 +41,8 @@ namespace CalamityMod.Projectiles.Rogue float projY = Projectile.Center.Y; float homeRange = Projectile.Calamity().stealthStrike ? 1800f : 600f; float homingSpeed = 0.25f; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !npc.boss) { float npcX = npc.position.X + (float)(npc.width / 2); diff --git a/Projectiles/Rogue/RealityRuptureMini.cs b/Projectiles/Rogue/RealityRuptureMini.cs index 3e7ae26d62..60e8562298 100644 --- a/Projectiles/Rogue/RealityRuptureMini.cs +++ b/Projectiles/Rogue/RealityRuptureMini.cs @@ -53,16 +53,16 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 350f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); - bool canHit = Projectile.Calamity().stealthStrike || Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); + bool canHit = Projectile.Calamity().stealthStrike || Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && canHit) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && canHit) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index f716ff8824..14e9786b1a 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -87,10 +87,9 @@ namespace CalamityMod.Projectiles.Rogue Vector2 homingTarget = Projectile.Center; bool foundTarget = false; Vector2 targetVelocity = new Vector2(0f); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC potentialTarget in Main.ActiveNPCs) { - NPC potentialTarget = Main.npc[i]; - if (potentialTarget.CanBeChasedBy(Projectile, false) && Projectile.WithinRange(Main.npc[i].Center, homingRange)) + if (potentialTarget.CanBeChasedBy(Projectile, false) && Projectile.WithinRange(potentialTarget.Center, homingRange)) { if (!foundTarget) { diff --git a/Projectiles/Rogue/RegulusEnergy.cs b/Projectiles/Rogue/RegulusEnergy.cs index abfca67bbe..542fdcb0f4 100644 --- a/Projectiles/Rogue/RegulusEnergy.cs +++ b/Projectiles/Rogue/RegulusEnergy.cs @@ -54,15 +54,15 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 500f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index 1f708cbb8c..169e781b77 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -101,10 +101,10 @@ namespace CalamityMod.Projectiles.Rogue } if (InsideTiles) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile.GetSource_FromThis(), false)) - NPCDestination = Main.npc[i].Center + Main.npc[i].velocity * 5f; + if (n.CanBeChasedBy(Projectile.GetSource_FromThis(), false)) + NPCDestination = n.Center + n.velocity * 5f; } TimeUnderground++; diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index e27b3b368d..1f44a9e1ef 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -90,30 +90,30 @@ namespace CalamityMod.Projectiles.Rogue { float projX = Projectile.Center.X; float projY = Projectile.Center.Y; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { - float npcCenterX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcCenterY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcCenterX = n.position.X + (float)(n.width / 2); + float npcCenterY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); if (targetDist < 600f) { - if (Main.npc[i].position.X < projX) + if (n.position.X < projX) { - Main.npc[i].velocity.X += 0.25f; + n.velocity.X += 0.25f; } else { - Main.npc[i].velocity.X -= 0.25f; + n.velocity.X -= 0.25f; } - if (Main.npc[i].position.Y < projY) + if (n.position.Y < projY) { - Main.npc[i].velocity.Y += 0.25f; + n.velocity.Y += 0.25f; } else { - Main.npc[i].velocity.Y -= 0.25f; + n.velocity.Y -= 0.25f; } } } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 36deeca44d..3f7f5fd760 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -112,30 +112,30 @@ namespace CalamityMod.Projectiles.Rogue { float projX = Projectile.Center.X; float projY = Projectile.Center.Y; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { - float npcCenterX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcCenterY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcCenterX = n.position.X + (float)(n.width / 2); + float npcCenterY = n.position.Y + (float)(n.height / 2); float targetDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); if (targetDistance < 600f) { - if (Main.npc[i].position.X < projX) + if (n.position.X < projX) { - Main.npc[i].velocity.X += 0.25f; + n.velocity.X += 0.25f; } else { - Main.npc[i].velocity.X -= 0.25f; + n.velocity.X -= 0.25f; } - if (Main.npc[i].position.Y < projY) + if (n.position.Y < projY) { - Main.npc[i].velocity.Y += 0.25f; + n.velocity.Y += 0.25f; } else { - Main.npc[i].velocity.Y -= 0.25f; + n.velocity.Y -= 0.25f; } } } diff --git a/Projectiles/Rogue/ShockGrenadeBolt.cs b/Projectiles/Rogue/ShockGrenadeBolt.cs index 6433576e54..e33e28c6db 100644 --- a/Projectiles/Rogue/ShockGrenadeBolt.cs +++ b/Projectiles/Rogue/ShockGrenadeBolt.cs @@ -54,16 +54,15 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index ff055dbf9b..7caa8c056a 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -63,16 +63,16 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 200f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); - bool canHit = Projectile.Calamity().stealthStrike || Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); + bool canHit = Projectile.Calamity().stealthStrike || Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && canHit) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && canHit) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/StellarKnifeProj.cs b/Projectiles/Rogue/StellarKnifeProj.cs index e9a8c194d0..7d70ca9c02 100644 --- a/Projectiles/Rogue/StellarKnifeProj.cs +++ b/Projectiles/Rogue/StellarKnifeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System.IO; @@ -69,15 +69,15 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 600f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index a9793a17b9..21dc29bd9d 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -47,15 +47,15 @@ namespace CalamityMod.Projectiles.Rogue float maxDistance = 500f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Rogue/TerraDiskProjectile.cs b/Projectiles/Rogue/TerraDiskProjectile.cs index e68019dd05..6fec82862f 100644 --- a/Projectiles/Rogue/TerraDiskProjectile.cs +++ b/Projectiles/Rogue/TerraDiskProjectile.cs @@ -143,9 +143,8 @@ namespace CalamityMod.Projectiles.Rogue const float maxDistance = 300f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float extraDistance = npc.width / 2 + npc.height / 2; diff --git a/Projectiles/Rogue/TimeBoltKnife.cs b/Projectiles/Rogue/TimeBoltKnife.cs index 6f82034099..88aafef7fb 100644 --- a/Projectiles/Rogue/TimeBoltKnife.cs +++ b/Projectiles/Rogue/TimeBoltKnife.cs @@ -132,9 +132,8 @@ namespace CalamityMod.Projectiles.Rogue int whoAmI = -1; Vector2 targetSpot = Projectile.Center; float detectRange = 1000f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(npc.Center, Projectile.Center); @@ -142,7 +141,7 @@ namespace CalamityMod.Projectiles.Rogue { detectRange = targetDist; targetSpot = npc.Center; - whoAmI = i; + whoAmI = npc.whoAmI; } } } @@ -304,10 +303,9 @@ namespace CalamityMod.Projectiles.Rogue int buffType = ModContent.BuffType(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && !npc.buffImmune[buffType] && Vector2.Distance(Projectile.Center, npc.Center) <= radius) + if (!npc.dontTakeDamage && !npc.buffImmune[buffType] && Vector2.Distance(Projectile.Center, npc.Center) <= radius) { if (npc.FindBuffIndex(buffType) == -1) npc.AddBuff(buffType, 60, false); diff --git a/Projectiles/Rogue/VeneratedKnife.cs b/Projectiles/Rogue/VeneratedKnife.cs index 1e98831f53..b1762f4465 100644 --- a/Projectiles/Rogue/VeneratedKnife.cs +++ b/Projectiles/Rogue/VeneratedKnife.cs @@ -37,16 +37,15 @@ namespace CalamityMod.Projectiles.Rogue { float minDist = 999f; int index = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < minDist) { minDist = dist; - index = i; + index = npc.whoAmI; } } } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index 5bb58587ae..bc1610fa94 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -123,9 +123,8 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { bool lineOfSight = Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height); diff --git a/Projectiles/Summon/BabyPlaguebringer.cs b/Projectiles/Summon/BabyPlaguebringer.cs index c2e73d0f19..10230156e1 100644 --- a/Projectiles/Summon/BabyPlaguebringer.cs +++ b/Projectiles/Summon/BabyPlaguebringer.cs @@ -100,9 +100,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[i]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 26c28e707c..5dfabdaa7b 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -117,9 +117,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack && !passive) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[i]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs index 362bf33118..ed6e82f054 100644 --- a/Projectiles/Summon/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Summon/CnidarianJellyfishOnTheString.cs @@ -143,16 +143,16 @@ namespace CalamityMod.Projectiles.Summon int[] targetArray = new int[maxTargets]; int targetsAquired = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { if (targetsAquired == maxTargets) break; - if (Main.npc[i].CanBeChasedBy(Projectile)) + if (n.CanBeChasedBy(Projectile)) { - if ((CnidarianPos - Main.npc[i].Center).Length() < targettingDistance) + if ((CnidarianPos - n.Center).Length() < targettingDistance) { - targetArray[targetsAquired] = i; + targetArray[targetsAquired] = n.whoAmI; targetsAquired++; } } diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index c62e9bcf6b..1de027a696 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -76,9 +76,8 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[i]; if (nPC2.CanBeChasedBy(Projectile, false)) { float maxTargetDist = Vector2.Distance(nPC2.Center, Projectile.Center); @@ -87,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon targetDist = maxTargetDist; projPos = nPC2.Center; canAttack = true; - target = i; + target = nPC2.whoAmI; } } } diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index fb259bdc3e..9ef293710e 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -86,15 +86,15 @@ namespace CalamityMod.Projectiles.Summon } if (!homeIn) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 51b9079b8c..e5a621e983 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -140,17 +140,17 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float npcX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float npcY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); if (npcDist < attackDistance) { attackDistance = npcDist; - center12 = Main.npc[i].Center; + center12 = n.Center; canAttack = true; } } diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 259fe2c373..d86a78e584 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -173,9 +173,8 @@ namespace CalamityMod.Projectiles.Summon } if (!gotoenemy) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[i]; if (nPC2.CanBeChasedBy(Projectile, false)) { float disttoobjective = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index 968df25c26..1ae45e4685 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -80,12 +80,8 @@ namespace CalamityMod.Projectiles.Summon } if (!hasHomingTarget) { - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc == null || !npc.active) - continue; - if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index 1d30b2da43..d87d06d379 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -82,9 +82,8 @@ namespace CalamityMod.Projectiles.Summon } if (!homeIn) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float extraDistance = (npc.width / 2) + (npc.height / 2); diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 170aa4b52c..e6532ff2ba 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -117,16 +117,15 @@ namespace CalamityMod.Projectiles.Summon float maxDistance = 1000f; int possibleTarget = -1; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile)) { float npcDistance = Projectile.Distance(npc.Center); if (npcDistance < maxDistance) { maxDistance = npcDistance; - possibleTarget = i; + possibleTarget = npc.whoAmI; } } } diff --git a/Projectiles/Summon/OldDukeSharkVomit.cs b/Projectiles/Summon/OldDukeSharkVomit.cs index ac6ea79da9..e0133fd23e 100644 --- a/Projectiles/Summon/OldDukeSharkVomit.cs +++ b/Projectiles/Summon/OldDukeSharkVomit.cs @@ -73,18 +73,14 @@ namespace CalamityMod.Projectiles.Summon } if (!hasHomingTarget) { - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc is null || !npc.active) - continue; - if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < maxHomingRange && Collision.CanHit(Projectile.Center, Projectile.width, Projectile.height, npc.Center, npc.width, npc.height)) { - targetIdx = i; + targetIdx = npc.whoAmI; maxHomingRange = dist; hasHomingTarget = true; } diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index f6b29e3023..ccc5cff891 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -65,9 +65,8 @@ namespace CalamityMod.Projectiles.Summon } if (!homeIn) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if ((npc.CanBeChasedBy(Projectile, false) || (npc.type == NPCID.DukeFishron && (!npc.dontTakeDamage || npc.ai[0] > 9f))) && npc.active) { float extraDistance = (npc.width / 2) + (npc.height / 2); diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index 131c073214..48a9ab090f 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -503,16 +503,16 @@ namespace CalamityMod.Projectiles.Summon } float distance = searchDistance * searchDistance; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy() && Main.npc[i].type != heartType) + if (n.CanBeChasedBy() && n.type != heartType) { - float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (n.width / 2) + (n.height / 2); - if (Main.npc[i].WithinRange(Projectile.Center, distance + extraDistance)) + if (n.WithinRange(Projectile.Center, distance + extraDistance)) { - distance = Main.npc[i].DistanceSQ(Projectile.Center); - closestTarget = Main.npc[i]; + distance = n.DistanceSQ(Projectile.Center); + closestTarget = n; } } } diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 2df2ba0adb..c1779f7474 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -114,20 +114,17 @@ namespace CalamityMod.Projectiles.Summon } if (targetID < 0) { - int targetIDCopy; - for (int i = 0; i < Main.maxNPCs; i = targetIDCopy + 1) + foreach (NPC target in Main.ActiveNPCs) { - NPC target = Main.npc[i]; if (target.CanBeChasedBy(Projectile, false)) { float targetDistance = Projectile.Distance(target.Center); if (targetDistance < attackRange && Collision.CanHitLine(Projectile.Center, 0, 0, target.Center, 0, 0)) { attackRange = targetDistance; - targetID = i; + targetID = target.whoAmI; } } - targetIDCopy = i; } } if (targetID != -1) diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index e6564dbf6f..86c0d50238 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -100,9 +100,8 @@ namespace CalamityMod.Projectiles.Summon } if (!foundTarget) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float npcDist = Vector2.Distance(Projectile.Center, npc.Center); diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 2f85317f15..e812f41623 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -100,9 +100,8 @@ namespace CalamityMod.Projectiles.Summon } if (!foundTarget) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float npcDist = Vector2.Distance(Projectile.Center, npc.Center); diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index 1390798a71..8c274335b4 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -58,13 +58,13 @@ namespace CalamityMod.Projectiles.Summon float maxDistance = 1000f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, Projectile.width, Projectile.height, Main.npc[i].Center, Main.npc[i].width, Main.npc[i].height)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, Projectile.width, Projectile.height, n.Center, n.width, n.height)) { homeIn = true; break; diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 2f8b3a1654..a3e4514dda 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -111,15 +111,14 @@ namespace CalamityMod.Projectiles.Summon } if (targetIndex < 0) { - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { float num1 = (npc.Center - Projectile.Center).Length(); if (num1 < maxDistance) { - targetIndex = i; + targetIndex = npc.whoAmI; maxDistance = num1; } } @@ -309,9 +308,8 @@ namespace CalamityMod.Projectiles.Summon else { Rectangle rectangle = new Rectangle((int)(Projectile.position.X + Projectile.velocity.X * 0.5f - 4f), (int)(Projectile.position.Y + Projectile.velocity.Y * 0.5f - 4f), Projectile.width + 8, Projectile.height + 8); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false) && npc.immune[Projectile.owner] <= 0) { Rectangle rect = npc.getRect(); diff --git a/Projectiles/Summon/Umbrella/MagicBird.cs b/Projectiles/Summon/Umbrella/MagicBird.cs index 84ee27ffa4..960cbb188e 100644 --- a/Projectiles/Summon/Umbrella/MagicBird.cs +++ b/Projectiles/Summon/Umbrella/MagicBird.cs @@ -88,18 +88,14 @@ namespace CalamityMod.Projectiles.Summon.Umbrella } if (!hasHomingTarget) { - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (npc is null || !npc.active) - continue; - if (npc.CanBeChasedBy(Projectile, false)) { float dist = (Projectile.Center - npc.Center).Length(); if (dist < maxHomingRange) { - targetIdx = i; + targetIdx = npc.whoAmI; maxHomingRange = dist; hasHomingTarget = true; } diff --git a/Projectiles/Summon/Umbrella/MagicUmbrella.cs b/Projectiles/Summon/Umbrella/MagicUmbrella.cs index 718cd70589..18ec15c00a 100644 --- a/Projectiles/Summon/Umbrella/MagicUmbrella.cs +++ b/Projectiles/Summon/Umbrella/MagicUmbrella.cs @@ -255,16 +255,15 @@ namespace CalamityMod.Projectiles.Summon.Umbrella return selectedTarget.whoAmI; } - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(this) && (npc.boss || !blackListedTargets.Contains(i))) + foreach (NPC npc in Main.ActiveNPCs) + { + if (npc.CanBeChasedBy(this) && (npc.boss || !blackListedTargets.Contains(npc.whoAmI))) { float npcDist = npc.Distance(center); if (npcDist <= MagicHat.Range && (npcDist <= closestDist || closestDist == -1f)) { closestDist = npcDist; - target = i; + target = npc.whoAmI; } } } diff --git a/Projectiles/Summon/VictideSeaSnail.cs b/Projectiles/Summon/VictideSeaSnail.cs index 235ee2837f..67314786a2 100644 --- a/Projectiles/Summon/VictideSeaSnail.cs +++ b/Projectiles/Summon/VictideSeaSnail.cs @@ -154,9 +154,8 @@ namespace CalamityMod.Projectiles.Summon bool foundTarget = false; float maxDist = 300f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile, false)) { if (Vector2.Distance(Projectile.Center, npc.Center) < maxDist && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height)) diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index 058c45b90f..68a08c994f 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -166,14 +166,14 @@ namespace CalamityMod.Projectiles.Summon } Projectile.frameCounter++; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) + { + if (!n.friendly && CalamityGlobalNPC.ShouldAffectNPC(n)) { - if (Main.npc[i].active && !Main.npc[i].friendly && CalamityGlobalNPC.ShouldAffectNPC(Main.npc[i])) - { - if (Vector2.Distance(Projectile.Center, Main.npc[i].Center) <= radius) - ApplySucc(Main.npc[i]); - } + if (Vector2.Distance(Projectile.Center, n.Center) <= radius) + ApplySucc(n); } + } if (Projectile.scale >= 2.5f) //it's boom o' clock diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 1e3faffa33..2681d5dc12 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -125,14 +125,14 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float targetX = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float targetY = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float targetX = n.position.X + (float)(n.width / 2); + float targetY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - targetX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - targetY); - if (targetDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + if (targetDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { attackRange = targetDist; projX = targetX; diff --git a/Projectiles/Summon/WulfrumEnergyBurst.cs b/Projectiles/Summon/WulfrumEnergyBurst.cs index 3a042342ef..e5237425b9 100644 --- a/Projectiles/Summon/WulfrumEnergyBurst.cs +++ b/Projectiles/Summon/WulfrumEnergyBurst.cs @@ -65,10 +65,8 @@ namespace CalamityMod.Projectiles.Summon float bestScore = 0; NPC bestTarget = null; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC potentialTarget in Main.ActiveNPCs) { - NPC potentialTarget = Main.npc[i]; - if (!potentialTarget.CanBeChasedBy(null, false)) continue; diff --git a/Projectiles/Summon/WulfrumFusionBolt.cs b/Projectiles/Summon/WulfrumFusionBolt.cs index 1208dce2db..292eb5a80a 100644 --- a/Projectiles/Summon/WulfrumFusionBolt.cs +++ b/Projectiles/Summon/WulfrumFusionBolt.cs @@ -68,10 +68,8 @@ namespace CalamityMod.Projectiles.Summon float bestScore = 0; NPC bestTarget = null; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC potentialTarget in Main.ActiveNPCs) { - NPC potentialTarget = Main.npc[i]; - if (!potentialTarget.CanBeChasedBy(null, false)) continue; diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index 059f41d89a..6cdd482946 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -57,16 +57,16 @@ namespace CalamityMod.Projectiles.Typeless { int targetID = -1; float hitDistance = 300f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 targetCenter = Main.npc[i].Center; + Vector2 targetCenter = n.Center; float targetDist = Vector2.Distance(targetCenter, Projectile.Center); if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1)) { hitDistance = targetDist; - targetID = i; + targetID = n.whoAmI; } } } diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index f107778b0b..72409defed 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -58,16 +58,16 @@ namespace CalamityMod.Projectiles.Typeless { int targetID = -1; float hitDistance = 300f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 targetCenter = Main.npc[i].Center; + Vector2 targetCenter = n.Center; float targetDist = Vector2.Distance(targetCenter, Projectile.Center); if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1)) { hitDistance = targetDist; - targetID = i; + targetID = n.whoAmI; } } } diff --git a/Projectiles/Typeless/KelvinCatalystStar.cs b/Projectiles/Typeless/KelvinCatalystStar.cs index 7945edcc91..e4dceba154 100644 --- a/Projectiles/Typeless/KelvinCatalystStar.cs +++ b/Projectiles/Typeless/KelvinCatalystStar.cs @@ -41,15 +41,15 @@ namespace CalamityMod.Projectiles.Typeless float maxDistance = 500f; bool homeIn = false; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + float extraDistance = (float)(n.width / 2) + (float)(n.height / 2); - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + if (Vector2.Distance(n.Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)) { - center = Main.npc[i].Center; + center = n.Center; homeIn = true; break; } diff --git a/Projectiles/Typeless/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs index cdcbcd0404..fd41325c2a 100644 --- a/Projectiles/Typeless/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -46,16 +46,16 @@ namespace CalamityMod.Projectiles.Typeless { int targetID = -1; float hitDistance = 150f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 targetCenter = Main.npc[i].Center; + Vector2 targetCenter = n.Center; float targetDist = Vector2.Distance(targetCenter, Projectile.Center); if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1)) { hitDistance = targetDist; - targetID = i; + targetID = n.whoAmI; } } } diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 5c1004dc87..65c993b872 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -37,16 +37,16 @@ namespace CalamityMod.Projectiles.Typeless { int targetIdx = -1; float npcRange = 150f; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 npcPos = Main.npc[i].Center; + Vector2 npcPos = n.Center; float npcDist = Vector2.Distance(npcPos, Projectile.Center); if (npcDist < npcRange && targetIdx == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, npcPos, 1, 1)) { npcRange = npcDist; - targetIdx = i; + targetIdx = n.whoAmI; } } } diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 43a84d9e1f..3aa52f4ea3 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -95,16 +95,15 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ai[0] = 10 + Main.rand.Next(10); float maxDistance = hentai ? 900f : 600f; int target = -1; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(Projectile)) { float npcDistance = Projectile.Distance(npc.Center); if (npcDistance < maxDistance) { maxDistance = npcDistance; - target = i; + target = npc.whoAmI; } } } diff --git a/Skies/CryogenSky.cs b/Skies/CryogenSky.cs index 1bbd055d07..cca9964898 100644 --- a/Skies/CryogenSky.cs +++ b/Skies/CryogenSky.cs @@ -101,15 +101,7 @@ namespace CalamityMod.Skies if (CryogenIndex >= 0 && Main.npc[CryogenIndex].active && Main.npc[CryogenIndex].type == cryogenType) return true; - CryogenIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == cryogenType) - { - CryogenIndex = i; - break; - } - } + CryogenIndex = NPC.FindFirstNPC(cryogenType); return CryogenIndex != -1; } diff --git a/Skies/DrunkCrabScreenShaderData.cs b/Skies/DrunkCrabScreenShaderData.cs index 6eee00117e..2d67cb7706 100644 --- a/Skies/DrunkCrabScreenShaderData.cs +++ b/Skies/DrunkCrabScreenShaderData.cs @@ -47,14 +47,7 @@ namespace CalamityMod.Skies if (!shouldForceDeactivateCirrusShader) { - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == CirrusType) - { - CirrusIndex = i; - break; - } - } + CirrusIndex = NPC.FindFirstNPC(CirrusType); } } else @@ -62,16 +55,7 @@ namespace CalamityMod.Skies if (CrabIndex >= 0 && Main.npc[CrabIndex].active && Main.npc[CrabIndex].type == CrabType) return; - CrabIndex = -1; - - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == CrabType) - { - CrabIndex = i; - break; - } - } + CrabIndex = NPC.FindFirstNPC(CrabType); } } diff --git a/Skies/SCalScreenShaderData.cs b/Skies/SCalScreenShaderData.cs index c8541d92ea..9282bb4878 100644 --- a/Skies/SCalScreenShaderData.cs +++ b/Skies/SCalScreenShaderData.cs @@ -24,15 +24,7 @@ namespace CalamityMod.Skies { return; } - SCalIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == SCalType) - { - SCalIndex = i; - break; - } - } + SCalIndex = NPC.FindFirstNPC(SCalType); } public override void Update(GameTime gameTime) diff --git a/Skies/SCalSky.cs b/Skies/SCalSky.cs index dd3e8ed6ae..078a00fefc 100644 --- a/Skies/SCalSky.cs +++ b/Skies/SCalSky.cs @@ -196,15 +196,7 @@ namespace CalamityMod.Skies if (SCalIndex >= 0 && Main.npc[SCalIndex].active && Main.npc[SCalIndex].type == SCalType) return true; - SCalIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == SCalType) - { - SCalIndex = i; - break; - } - } + SCalIndex = NPC.FindFirstNPC(SCalType); return SCalIndex != -1; } diff --git a/Skies/StormWeaverFlashSky.cs b/Skies/StormWeaverFlashSky.cs index 42471c402e..82de86c339 100644 --- a/Skies/StormWeaverFlashSky.cs +++ b/Skies/StormWeaverFlashSky.cs @@ -18,15 +18,7 @@ namespace CalamityMod.Skies if (StormWeaverHeadIndex >= 0 && Main.npc[StormWeaverHeadIndex].active && Main.npc[StormWeaverHeadIndex].type == weaverType) return; - StormWeaverHeadIndex = -1; - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].active && Main.npc[i].type == weaverType) - { - StormWeaverHeadIndex = i; - break; - } - } + StormWeaverHeadIndex = NPC.FindFirstNPC(weaverType); } public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) diff --git a/TileEntities/TEPlayerFireTurret.cs b/TileEntities/TEPlayerFireTurret.cs index ab3c4b4289..5b7e5eec73 100644 --- a/TileEntities/TEPlayerFireTurret.cs +++ b/TileEntities/TEPlayerFireTurret.cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerIceTurret.cs b/TileEntities/TEPlayerIceTurret.cs index 70c2a4695f..392f479ad8 100644 --- a/TileEntities/TEPlayerIceTurret.cs +++ b/TileEntities/TEPlayerIceTurret.cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerLabTurret.cs b/TileEntities/TEPlayerLabTurret.cs index 3fe6b8dcf0..c6a0f41649 100644 --- a/TileEntities/TEPlayerLabTurret.cs +++ b/TileEntities/TEPlayerLabTurret.cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerLaserTurret .cs b/TileEntities/TEPlayerLaserTurret .cs index 04da3948c7..d59516f463 100644 --- a/TileEntities/TEPlayerLaserTurret .cs +++ b/TileEntities/TEPlayerLaserTurret .cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerOnyxTurret.cs b/TileEntities/TEPlayerOnyxTurret.cs index be4a48643a..89b1cfe8d9 100644 --- a/TileEntities/TEPlayerOnyxTurret.cs +++ b/TileEntities/TEPlayerOnyxTurret.cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerPlagueTurret.cs b/TileEntities/TEPlayerPlagueTurret.cs index 4e32a901c3..fc089f89f5 100644 --- a/TileEntities/TEPlayerPlagueTurret.cs +++ b/TileEntities/TEPlayerPlagueTurret.cs @@ -69,10 +69,9 @@ namespace CalamityMod.TileEntities //This turret can switch targets at any time - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -80,7 +79,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/TileEntities/TEPlayerWaterTurret.cs b/TileEntities/TEPlayerWaterTurret.cs index 25768063d9..c4b2d4b3f8 100644 --- a/TileEntities/TEPlayerWaterTurret.cs +++ b/TileEntities/TEPlayerWaterTurret.cs @@ -88,10 +88,9 @@ namespace CalamityMod.TileEntities Vector2 ret = InvalidTarget; float distSQToBeat = MaxRange * MaxRange; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; - if (!npc.active || npc.friendly || npc.CountsAsACritter) + if (npc.friendly || npc.CountsAsACritter) continue; float distSQ = npc.DistanceSQ(targetingCenter); @@ -99,7 +98,7 @@ namespace CalamityMod.TileEntities { distSQToBeat = distSQ; ret = npc.Center; - indexToSet = i; + indexToSet = npc.whoAmI; } } diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 6c8057c280..f800dada03 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -331,17 +331,17 @@ namespace CalamityMod.UI if (npc.ai[0] == 2f) life = 0L; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - bool isMoonLordPiece = Main.npc[i].type == NPCID.MoonLordHand || Main.npc[i].type == NPCID.MoonLordHead; - if (!Main.npc[i].active || !isMoonLordPiece || Main.npc[i].ai[3] != npc.whoAmI) + bool isMoonLordPiece = n.type == NPCID.MoonLordHand || n.type == NPCID.MoonLordHead; + if (!isMoonLordPiece || n.ai[3] != npc.whoAmI) continue; // Don't count HP towards the total if the NPC is in its dead state. - if (Main.npc[i].Calamity().newAI[0] == 1f) + if (n.Calamity().newAI[0] == 1f) continue; - life += checkingForMaxLife ? Main.npc[i].lifeMax : Main.npc[i].life; + life += checkingForMaxLife ? n.lifeMax : n.life; } return life; @@ -365,15 +365,15 @@ namespace CalamityMod.UI public override void Update(IBigProgressBar currentBar, ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - // Ignore inactive NPCs and NPCs that should not be given a bar, even if it meets other criteria. - if (!Main.npc[i].active || BossExclusionList.Contains(Main.npc[i].type)) + // Ignore NPCs that should not be given a bar, even if it meets other criteria. + if (BossExclusionList.Contains(n.type)) continue; - bool isEoWSegment = Main.npc[i].type == NPCID.EaterofWorldsBody || Main.npc[i].type == NPCID.EaterofWorldsTail; - if ((Main.npc[i].IsABoss() && !isEoWSegment) || MinibossHPBarList.Contains(Main.npc[i].type) || Main.npc[i].Calamity().CanHaveBossHealthBar) - AttemptToAddBar(i); + bool isEoWSegment = n.type == NPCID.EaterofWorldsBody || n.type == NPCID.EaterofWorldsTail; + if ((n.IsABoss() && !isEoWSegment) || MinibossHPBarList.Contains(n.type) || n.Calamity().CanHaveBossHealthBar) + AttemptToAddBar(n.whoAmI); } for (int i = 0; i < Bars.Count; i++) @@ -467,12 +467,12 @@ namespace CalamityMod.UI return life; // Otherwise, check if any of said relationship NPCs are enraged. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active || Main.npc[i].life <= 0 || !OneToMany[NPCType].Contains(Main.npc[i].type)) + if (n.life <= 0 || !OneToMany[NPCType].Contains(n.type)) continue; - life += Main.npc[i].life; + life += n.life; } return life; @@ -499,12 +499,12 @@ namespace CalamityMod.UI return maxLife; // Otherwise, check if any of said relationship NPCs are enraged. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active || Main.npc[i].life <= 0 || !OneToMany[NPCType].Contains(Main.npc[i].type)) + if (n.life <= 0 || !OneToMany[NPCType].Contains(n.type)) continue; - maxLife += Main.npc[i].lifeMax; + maxLife += n.lifeMax; } return maxLife; @@ -525,12 +525,12 @@ namespace CalamityMod.UI return false; // Otherwise, check if any of said relationship NPCs are enraged. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active || Main.npc[i].life <= 0 || !OneToMany[NPCType].Contains(Main.npc[i].type)) + if (n.life <= 0 || !OneToMany[NPCType].Contains(n.type)) continue; - if (Main.npc[i].Calamity().CurrentlyEnraged) + if (n.Calamity().CurrentlyEnraged) return true; } return false; @@ -551,12 +551,12 @@ namespace CalamityMod.UI return false; // Otherwise, check if any of said relationship NPCs are increasing their defense or DR. - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active || Main.npc[i].life <= 0 || !OneToMany[NPCType].Contains(Main.npc[i].type)) + if (n.life <= 0 || !OneToMany[NPCType].Contains(n.type)) continue; - if (Main.npc[i].Calamity().CurrentlyIncreasingDefenseOrDR) + if (n.Calamity().CurrentlyIncreasingDefenseOrDR) return true; } return false; diff --git a/UI/BossRushUI.cs b/UI/BossRushUI.cs index 57742fa04f..59fe2b7009 100644 --- a/UI/BossRushUI.cs +++ b/UI/BossRushUI.cs @@ -39,14 +39,12 @@ namespace CalamityMod.UI { int totalLife = 0; int totalLifeMax = 0; - for (int i = 0; i < Main.npc.Length; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!Main.npc[i].active) - continue; - if (types.Contains(Main.npc[i].type)) + if (types.Contains(n.type)) { - totalLife += Main.npc[i].life; - totalLifeMax += Main.npc[i].lifeMax; + totalLife += n.life; + totalLifeMax += n.lifeMax; } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 3f76bf1485..bae63dcc0b 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -282,9 +282,9 @@ namespace CalamityMod.UI.CalamitasEnchants bool orbIsPresent = false; int orbType = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[i].type != orbType || Main.npc[i].target != player.whoAmI || !Main.npc[i].active) + if (n.type != orbType || n.target != player.whoAmI) continue; orbIsPresent = true; diff --git a/UI/VanillaBossBars/ExoMechsBossBar.cs b/UI/VanillaBossBars/ExoMechsBossBar.cs index 1dcca283e8..fe9edf9c4e 100644 --- a/UI/VanillaBossBars/ExoMechsBossBar.cs +++ b/UI/VanillaBossBars/ExoMechsBossBar.cs @@ -96,9 +96,8 @@ namespace CalamityMod.UI.VanillaBossBars public void ValidateAllMechs(ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC target = Main.npc[i]; + foreach (NPC target in Main.ActiveNPCs) + { // Find out first whether or not each of the mechs are in hiding if (target.type == NPCType()) HideAres = target.Opacity < 0.5f; @@ -119,33 +118,29 @@ namespace CalamityMod.UI.VanillaBossBars public bool FindMechsAgain(ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC target = Main.npc[i]; - if (target.active) + foreach (NPC target in Main.ActiveNPCs) + { + // Get the index of the mech that's not hiding + if (target.type == NPCType() && !HideAres) { - // Get the index of the mech that's not hiding - if (target.type == NPCType() && !HideAres) - { - info.npcIndexToAimAt = i; - return true; - } - else if (target.type == NPCType() && !HideArtemis) - { - info.npcIndexToAimAt = i; - return true; - } - else if (target.type == NPCType() && !HideThanatos) - { - info.npcIndexToAimAt = i; - return true; - } - // Failsafe - else if (target.type == NPCType() || target.type == NPCType() || target.type == NPCType()) - { - info.npcIndexToAimAt = i; - return true; - } + info.npcIndexToAimAt = target.whoAmI; + return true; + } + else if (target.type == NPCType() && !HideArtemis) + { + info.npcIndexToAimAt = target.whoAmI; + return true; + } + else if (target.type == NPCType() && !HideThanatos) + { + info.npcIndexToAimAt = target.whoAmI; + return true; + } + // Failsafe + else if (target.type == NPCType() || target.type == NPCType() || target.type == NPCType()) + { + info.npcIndexToAimAt = target.whoAmI; + return true; } } return false; diff --git a/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs b/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs index 1347d038d0..8394d9a395 100644 --- a/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs +++ b/UI/VanillaBossBars/LeviathanAnahitaBossBar.cs @@ -52,11 +52,10 @@ namespace CalamityMod.UI.VanillaBossBars // Determine Anahita's shield health only if she's solo (she can't just block Leviathan out of existence) if (target.type == NPCType() && !NPC.AnyNPCs(NPCType())) - { - for (int i = 0; i < Main.maxNPCs; i++) + { + foreach (NPC part in Main.ActiveNPCs) { - NPC part = Main.npc[i]; - if (part.active && part.type == NPCType()) + if (part.type == NPCType()) { shield += part.life; shieldMax += part.lifeMax; @@ -68,17 +67,16 @@ namespace CalamityMod.UI.VanillaBossBars public bool FindTheRightFish(ref BigProgressBarInfo info) { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC target = Main.npc[i]; + foreach (NPC target in Main.ActiveNPCs) + { if (target.active && target.type == NPCType()) { - info.npcIndexToAimAt = i; + info.npcIndexToAimAt = target.whoAmI; return true; } else if (target.active && target.type == NPCType()) { - info.npcIndexToAimAt = i; + info.npcIndexToAimAt = target.whoAmI; return true; } } diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 6f356ca6ac..7b78e5db41 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -212,16 +212,15 @@ namespace CalamityMod int r = wormHead.whoAmI; float minDist = 1E+06f; - for (int i = 0; i < Main.npc.Length; ++i) + foreach (NPC n in Main.ActiveNPCs) { - NPC n = Main.npc[i]; - if (n != null && n.active && idsToCheck.Contains(n.type)) + if (idsToCheck.Contains(n.type)) { float dist = (n.Center - playerPos).Length(); if (dist < minDist) { minDist = dist; - r = i; + r = n.whoAmI; } } } @@ -535,10 +534,9 @@ namespace CalamityMod public static IItemDropRuleCondition AnglerFedToTrasherCondition = If((info) => { bool trasherNearby = false; - for (int i = 0; i < Main.maxNPCs; ++i) + foreach (NPC nearby in Main.ActiveNPCs) { - NPC nearby = Main.npc[i]; - if (nearby is null || !nearby.active || nearby.type != ModContent.NPCType()) + if (nearby.type != ModContent.NPCType()) continue; if (info.npc.Distance(nearby.Center) < TrasherEatDistance) { diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 84565bea36..59af3caafa 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -38,9 +38,9 @@ namespace CalamityMod return 0; int count = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC n in Main.ActiveNPCs) { - if (!typesToCheck.Contains(Main.npc[i].type) || !Main.npc[i].active) + if (!typesToCheck.Contains(n.type)) continue; count++; @@ -174,18 +174,14 @@ namespace CalamityMod public static bool AnyBossNPCS(bool checkForMechs = false) { - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - if (Main.npc[i] != null) + if (npc.IsABoss()) { - NPC npc = Main.npc[i]; - if (npc.IsABoss()) - { - // Added due to the new mech boss ore progression, return true if any mech is alive and checkForMechs is true, reduces mech boss projectile damage if true. - if (checkForMechs) - return npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer; - return true; - } + // Added due to the new mech boss ore progression, return true if any mech is alive and checkForMechs is true, reduces mech boss projectile damage if true. + if (checkForMechs) + return npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer; + return true; } } return FindFirstProjectile(ProjectileType()) != -1; diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index f68b178eea..528ec0c0fb 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -233,9 +233,8 @@ namespace CalamityMod int[] array = new int[Main.maxNPCs]; int targetArrayA = 0; int targetArrayB = 0; - for (int i = 0; i < Main.maxNPCs; i++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile, false)) { float enemyDist = Vector2.Distance(projectile.Center, npc.Center); @@ -243,12 +242,12 @@ namespace CalamityMod { if (Collision.CanHit(projectile.position, 1, 1, npc.position, npc.width, npc.height) && enemyDist > 50f) { - array[targetArrayB] = i; + array[targetArrayB] = npc.whoAmI; targetArrayB++; } else if (targetArrayB == 0) { - array[targetArrayA] = i; + array[targetArrayA] = npc.whoAmI; targetArrayA++; } } @@ -293,7 +292,7 @@ namespace CalamityMod { if (targetArrayIndex < maxTargets) { - targetArray[targetArrayIndex] = i; + targetArray[targetArrayIndex] = n.whoAmI; targetArrayIndex++; homeIn = true; } From e2c261e69ef37ffb0e522bb39331e72f7eb34f3c Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 18:07:24 +0500 Subject: [PATCH 34/48] Some of the projectile iterators --- CalPlayer/CalamityPlayer.cs | 12 ++--- CalPlayer/CalamityPlayerHitHurt.cs | 6 +-- CalPlayer/CalamityPlayerMiscEffects.cs | 29 ++++++----- CalPlayer/DrawLayers/AndromedaMechLayer.cs | 4 +- .../Primitives/PrimitivePixelationSystem.cs | 6 +-- ILEditing/MechanicILChanges.cs | 7 +-- Items/Accessories/NebulousCore.cs | 4 +- Items/Accessories/WulfrumAcrobaticsPack.cs | 15 +++--- Items/CalamityGlobalItem.cs | 50 +++++++++---------- Items/Tools/WulfrumDiggingTurtle.cs | 5 +- Items/Weapons/DraedonsArsenal/PoleWarper.cs | 12 ++--- Items/Weapons/Melee/BladecrestOathsword.cs | 6 +-- Items/Weapons/Melee/Exoblade.cs | 17 +++++-- Items/Weapons/Ranged/ChickenCannon.cs | 5 +- Items/Weapons/Ranged/Hydra.cs | 12 ++--- Items/Weapons/Rogue/Nychthemeron.cs | 12 ++--- Items/Weapons/Rogue/Sacrifice.cs | 14 +++--- Items/Weapons/Summon/AresExoskeleton.cs | 8 +-- Items/Weapons/Summon/BrittleStarStaff.cs | 10 ++-- 19 files changed, 115 insertions(+), 119 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a8c0fc5775..075c4c06a7 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4715,23 +4715,23 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer && !endoCooper && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable) { int spearsFired = 0; - - for (int i = 0; i < Main.projectile.Length; i++) + + foreach (Projectile p in Main.ActiveProjectiles) { if (spearsFired == 2) break; - if (Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].friendly) + if (p.owner == Player.whoAmI && p.friendly) { - bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType(); + bool attack = p.type == ModContent.ProjectileType(); if (attack) { int numSpears = profanedCrystalBuffs ? 12 : 6; - int dam = (int)(Main.projectile[i].originalDamage * (profanedCrystalBuffs ? 1f : 0.25f)); + int dam = (int)(p.originalDamage * (profanedCrystalBuffs ? 1f : 0.25f)); for (int x = 0; x < numSpears; x++) { float angle = MathHelper.TwoPi / numSpears * x; - int proj = Projectile.NewProjectile(source, Main.projectile[i].Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, pscState, 0f); + int proj = Projectile.NewProjectile(source, p.Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType(), dam, 0f, Player.whoAmI, pscState, 0f); Main.projectile[proj].originalDamage = dam; } spearsFired++; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index b84a070442..8f86221423 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2307,11 +2307,11 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach(Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == Player.whoAmI) + if (p.type == ModContent.ProjectileType() && p.owner == Player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); break; } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b99288c74d..c1be6e8b04 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -858,12 +858,12 @@ namespace CalamityMod.CalPlayer { int bullseyeType = ModContent.ProjectileType(); List alreadyTargetedNPCs = new List(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != bullseyeType || !Main.projectile[i].active || Main.projectile[i].owner != Player.whoAmI) + if (p.type != bullseyeType || p.owner != Player.whoAmI) continue; - alreadyTargetedNPCs.Add((int)Main.projectile[i].ai[0]); + alreadyTargetedNPCs.Add((int)p.ai[0]); } foreach (NPC target in Main.ActiveNPCs) @@ -1131,10 +1131,9 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 6 && Main.myPlayer == Player.whoAmI) { bool[] tentaclesPresent = new bool[6]; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - Projectile projectile = Main.projectile[i]; - if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.owner == Main.myPlayer && projectile.ai[1] >= 0f && projectile.ai[1] < 6f) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Main.myPlayer && projectile.ai[1] >= 0f && projectile.ai[1] < 6f) tentaclesPresent[(int)projectile.ai[1]] = true; } @@ -3347,11 +3346,11 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == Player.whoAmI) + if (p.type == ModContent.ProjectileType() && p.owner == Player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); break; } } @@ -3383,12 +3382,12 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { int auraType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != auraType || !Main.projectile[i].active || Main.projectile[i].owner != Player.whoAmI) + if (p.type != auraType || p.owner != Player.whoAmI) continue; - Main.projectile[i].Kill(); + p.Kill(); break; } } @@ -3406,12 +3405,12 @@ namespace CalamityMod.CalPlayer else if (Player.whoAmI == Main.myPlayer) { int shieldType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != shieldType || !Main.projectile[i].active || Main.projectile[i].owner != Player.whoAmI) + if (p.type != shieldType || p.owner != Player.whoAmI) continue; - Main.projectile[i].Kill(); + p.Kill(); break; } } diff --git a/CalPlayer/DrawLayers/AndromedaMechLayer.cs b/CalPlayer/DrawLayers/AndromedaMechLayer.cs index 49ec26064a..e15b7c80df 100644 --- a/CalPlayer/DrawLayers/AndromedaMechLayer.cs +++ b/CalPlayer/DrawLayers/AndromedaMechLayer.cs @@ -34,9 +34,9 @@ namespace CalamityMod.CalPlayer.DrawLayers int robot = -1; int andromedaMechID = ModContent.ProjectileType(); - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == andromedaMechID && Main.projectile[i].owner == drawPlayer.whoAmI) + if (p.type == andromedaMechID && p.owner == drawPlayer.whoAmI) { robot = i; break; diff --git a/Graphics/Primitives/PrimitivePixelationSystem.cs b/Graphics/Primitives/PrimitivePixelationSystem.cs index ad2a82fc40..19d5fb1b5c 100644 --- a/Graphics/Primitives/PrimitivePixelationSystem.cs +++ b/Graphics/Primitives/PrimitivePixelationSystem.cs @@ -65,12 +65,10 @@ namespace CalamityMod.Graphics.Primitives var afterProjectiles = new List(); // Check every active projectile. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - // If the projectile is active, a mod projectile, and uses the interface, add it to the list of primitives to draw this frame. - if (projectile.active && projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile) + if (projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile) { var listToUse = pixelPrimitiveProjectile.LayerToRenderTo switch { diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 01a4f20dc6..620eefd8f0 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -724,12 +724,9 @@ namespace CalamityMod.ILEditing Main.spriteBatch.SetBlendState(BlendState.Additive); // Draw Projectiles. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!Main.projectile[i].active) - continue; - - if (Main.projectile[i].ModProjectile is IAdditiveDrawer d) + if (p.ModProjectile is IAdditiveDrawer d) d.AdditiveDraw(Main.spriteBatch); } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index bc9c165501..b5fc4b712e 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Items.Accessories if (Main.rand.NextBool(15)) { int numProj = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType()) + if (p.owner == player.whoAmI && p.type == ModContent.ProjectileType()) { numProj++; } diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index c25f090ead..a03fba6af5 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -361,10 +361,9 @@ namespace CalamityMod.Items.Accessories if (bestGrapplePos != Point.Zero) { //Clear any hooks that might have been flying before then. - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != Player.whoAmI || p.type != ProjectileType()) + if (p.owner != Player.whoAmI || p.type != ProjectileType()) continue; if (p.ModProjectile is WulfrumHook) @@ -412,10 +411,9 @@ namespace CalamityMod.Items.Accessories if (triggersSet.Grapple && Player.releaseHook) { //Clear any previous non-wulfrum hooks / Any hooks that just got shot (should already be handled by the global proj - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != Player.whoAmI || p.aiStyle != 7 || p.type == ProjectileType()) + if (p.owner != Player.whoAmI || p.aiStyle != 7 || p.type == ProjectileType()) continue; p.Kill(); @@ -443,10 +441,9 @@ namespace CalamityMod.Items.Accessories //Jumping out of the hook if (triggersSet.Jump && Player.releaseJump) { - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != Player.whoAmI || p.type != ProjectileType()) + if (p.owner != Player.whoAmI || p.type != ProjectileType()) continue; //Only clear hooks that are attached to stuff diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d1bf4f9242..151fc33d72 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -531,11 +531,11 @@ namespace CalamityMod.Items } if (item.type == ItemID.PearlwoodBow) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && (Main.projectile[i].type == ModContent.ProjectileType() || Main.projectile[i].type == ModContent.ProjectileType()) && Main.projectile[i].owner == player.whoAmI) + if ((p.type == ModContent.ProjectileType() || p.type == ModContent.ProjectileType()) && p.owner == player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); } } for (int i = -8; i <= 8; i += 8) @@ -674,9 +674,9 @@ namespace CalamityMod.Items if (player.ActiveItem().type == ModContent.ItemType()) { bool hasBlades = false; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].localAI[1] == 0f) + if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) { hasBlades = true; break; @@ -684,22 +684,22 @@ namespace CalamityMod.Items } if (hasBlades) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].ModProjectile is IgneousBlade) + if (p.ModProjectile is IgneousBlade) { - if (Main.projectile[i].ModProjectile().Firing) + if (p.ModProjectile().Firing) continue; } - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].localAI[1] == 0f) + if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) { - Main.projectile[i].rotation = MathHelper.PiOver2 + MathHelper.PiOver4; - Main.projectile[i].velocity = Main.projectile[i].SafeDirectionTo(Main.MouseWorld, Vector2.UnitY) * 22f; - Main.projectile[i].rotation += Main.projectile[i].velocity.ToRotation(); - Main.projectile[i].ai[0] = 180f; - Main.projectile[i].ModProjectile().Firing = true; - Main.projectile[i].tileCollide = true; - Main.projectile[i].netUpdate = true; + p.rotation = MathHelper.PiOver2 + MathHelper.PiOver4; + p.velocity = p.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY) * 22f; + p.rotation += p.velocity.ToRotation(); + p.ai[0] = 180f; + p.ModProjectile().Firing = true; + p.tileCollide = true; + p.netUpdate = true; } } } @@ -707,13 +707,13 @@ namespace CalamityMod.Items } if (player.ActiveItem().type == ModContent.ItemType() && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].ModProjectile is VoidConcentrationAura) + if (p.ModProjectile is VoidConcentrationAura) { - if (Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (p.owner == player.whoAmI) { - Main.projectile[i].ModProjectile().HandleRightClick(); + p.ModProjectile().HandleRightClick(); break; } } @@ -724,18 +724,18 @@ namespace CalamityMod.Items { bool canContinue = true; int count = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == player.whoAmI) + if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) { - if (Main.projectile[i].ai[1] > 1f) + if (p.ai[1] > 1f) { canContinue = false; break; } - else if (Main.projectile[i].ai[1] == 0f) + else if (p.ai[1] == 0f) { - if (((GlacialEmbracePointyThing)Main.projectile[i].ModProjectile).circlingPlayer) + if (((GlacialEmbracePointyThing)p.ModProjectile).circlingPlayer) count++; } } diff --git a/Items/Tools/WulfrumDiggingTurtle.cs b/Items/Tools/WulfrumDiggingTurtle.cs index 95718e8b63..7018324832 100644 --- a/Items/Tools/WulfrumDiggingTurtle.cs +++ b/Items/Tools/WulfrumDiggingTurtle.cs @@ -53,10 +53,9 @@ namespace CalamityMod.Items.Tools { bool explodedAny = false; - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != player.whoAmI || p.type != Item.shoot) + if (p.owner != player.whoAmI || p.type != Item.shoot) continue; p.ai[1] = 1f; diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index dede135af4..2e8d1edb0a 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -56,9 +56,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal float magnetCount = 0f; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (p.type == type && p.owner == player.whoAmI) { magnetCount++; } @@ -67,12 +67,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal // Adjust the offset of all existing magnets such that they form a psuedo-circle. // This offset is used when determining where a magnet should move to relative to its true destination (such as the player or an enemy). int magnetIndex = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (p.type == type && p.owner == player.whoAmI) { - ((PoleWarperSummon)Main.projectile[i].ModProjectile).Time = 0f; - ((PoleWarperSummon)Main.projectile[i].ModProjectile).AngularOffset = MathHelper.TwoPi * magnetIndex / magnetCount; + ((PoleWarperSummon)p.ModProjectile).Time = 0f; + ((PoleWarperSummon)p.ModProjectile).AngularOffset = MathHelper.TwoPi * magnetIndex / magnetCount; magnetIndex++; } } diff --git a/Items/Weapons/Melee/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index 931e3562c0..5c78b117de 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -35,12 +35,12 @@ namespace CalamityMod.Items.Weapons.Melee public override bool CanUseItem(Player player) { int bladeProjID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != bladeProjID || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + if (p.type != bladeProjID || p.owner != player.whoAmI) continue; - return Main.projectile[i].ModProjectile().PostSwingRepositionDelay <= 0f; + return p.ModProjectile().PostSwingRepositionDelay <= 0f; } return base.CanUseItem(player); diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 0576af4659..743d745de3 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -100,15 +100,24 @@ namespace CalamityMod.Items.Weapons.Melee float state = 0; //If there are any exoblades in "stasis" after a bonk, the attack should be an empowered slash instead - if (Main.projectile.Any(n => n.active && n.owner == player.whoAmI && n.type == ProjectileType() && n.ai[0] == 1 && n.ai[1] == 1 && n.timeLeft > LungeCooldown)) + bool empoweredSlash = false; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.owner == player.whoAmI && p.type == Item.shoot && p.ai[0] == 1 && p.ai[1] == 1 && p.timeLeft > LungeCooldown) + { + empoweredSlash = true; + break; + } + } + + if (empoweredSlash) { state = 2; //Put all the "post bonk" stasised exoblades into regular cooldown for the right click ljunge - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != player.whoAmI || p.type != Item.shoot || p.ai[0] != 1 || p.ai[1] != 1) + if (p.owner != player.whoAmI || p.type != Item.shoot || p.ai[0] != 1 || p.ai[1] != 1) continue; p.timeLeft = LungeCooldown; diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index d87044c85b..bd9e55241f 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -66,10 +66,9 @@ namespace CalamityMod.Items.Weapons.Ranged private void DetonateRockets(Player player) { - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (!p.active || p.owner != player.whoAmI || p.type != Item.shoot) + if (p.owner != player.whoAmI || p.type != Item.shoot) continue; // All rockets will instantly explode on the next frame and send packets to indicate as such. diff --git a/Items/Weapons/Ranged/Hydra.cs b/Items/Weapons/Ranged/Hydra.cs index e3605d5f86..24683fe27e 100644 --- a/Items/Weapons/Ranged/Hydra.cs +++ b/Items/Weapons/Ranged/Hydra.cs @@ -68,11 +68,11 @@ namespace CalamityMod.Items.Weapons.Ranged } else if (player.ActiveItem().type != Item.type || player.dead || !player.active) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { //Destroy all heads - if (Main.projectile[i].type == HeadID && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].active) - Main.projectile[i].Kill(); + if (p.type == HeadID && p.owner == player.whoAmI) + p.Kill(); } HeadSpawnTimer = 0; } @@ -111,11 +111,11 @@ namespace CalamityMod.Items.Weapons.Ranged Projectile.NewProjectile(source, newPos, spreadVelocity * spreadDirection, Item.shoot, damage, knockback, player.whoAmI); } - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { //Force all heads to shoot - if (Main.projectile[i].type == HeadID && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].active) - Main.projectile[i].ai[1] = 1f; + if (p.type == HeadID && p.owner == player.whoAmI) + p.ai[1] = 1f; } return false; } diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index c2ea5bae27..55c9228905 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -32,10 +32,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) + if (p.type == Item.shoot && p.owner == player.whoAmI) { p.ai[0] = 1f; } @@ -93,12 +92,11 @@ namespace CalamityMod.Items.Weapons.Rogue // Ideally new projectiles will fill in the most recently vacated spots in the pattern int[] activeSlots = new int[10] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.type == ModContent.ProjectileType() && proj.owner == player.whoAmI && proj.active && proj.localAI[0] == 0f && activeSlots[(int)proj.localAI[1]] == -1) + if (proj.type == ModContent.ProjectileType() && proj.owner == player.whoAmI && proj.localAI[0] == 0f && activeSlots[(int)proj.localAI[1]] == -1) { - activeSlots[(int)proj.localAI[1]] = i; + activeSlots[(int)proj.localAI[1]] = proj.whoAmI; } } diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 87a880fec0..922f06a10f 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -39,18 +39,18 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.altFunctionUse == 2) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + if (p.type != type || p.owner != player.whoAmI) continue; - if (Main.projectile[i].ai[0] != 1f) + if (p.ai[0] != 1f) continue; - NPC attachedNPC = Main.npc[(int)Main.projectile[i].ai[1]]; - Main.projectile[i].ai[0] = 2f; - Main.projectile[i].ModProjectile().AbleToHealOwner = attachedNPC.type != NPCID.TargetDummy && attachedNPC.type != ModContent.NPCType(); - Main.projectile[i].netUpdate = true; + NPC attachedNPC = Main.npc[(int)p.ai[1]]; + p.ai[0] = 2f; + p.ModProjectile().AbleToHealOwner = attachedNPC.type != NPCID.TargetDummy && attachedNPC.type != ModContent.NPCType(); + p.netUpdate = true; } //TODO: Add something here to avoid stealth being consumed return false; diff --git a/Items/Weapons/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index cbf43d0fc4..2734afd15e 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -113,13 +113,13 @@ namespace CalamityMod.Items.Weapons.Summon // If the player owns a panel, make it fade away. if (player.ownedProjectileCounts[panelID] >= 1) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != panelID || Main.projectile[i].owner != player.whoAmI || !Main.projectile[i].active) + if (p.type != panelID || p.owner != player.whoAmI) continue; - Main.projectile[i].ai[0] = 1f; - Main.projectile[i].netUpdate = true; + p.ai[0] = 1f; + p.netUpdate = true; } } diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 662054a9d7..01a536adff 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -53,13 +53,13 @@ namespace CalamityMod.Items.Weapons.Summon Item.noUseGraphic = true; } int bladeIndex = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (p.type == type && p.owner == player.whoAmI) { - Main.projectile[i].ModProjectile().StarIndex = bladeIndex++; - Main.projectile[i].ModProjectile().AITimer = 0f; - Main.projectile[i].netUpdate = true; + p.ModProjectile().StarIndex = bladeIndex++; + p.ModProjectile().AITimer = 0f; + p.netUpdate = true; } } return false; From 77847a7e01577b8982b03c13a058dea502e639a6 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 19:31:35 +0500 Subject: [PATCH 35/48] Ported projectile iterators --- Items/Weapons/Summon/Cosmilamp.cs | 8 ++--- Items/Weapons/Summon/DazzlingStabberStaff.cs | 8 ++--- Items/Weapons/Summon/DormantBrimseeker.cs | 6 ++-- Items/Weapons/Summon/EndoHydraStaff.cs | 6 ++-- Items/Weapons/Summon/FlamsteedRing.cs | 18 +++++------ Items/Weapons/Summon/GlacialEmbrace.cs | 24 +++++++------- Items/Weapons/Summon/IgneousExaltation.cs | 24 +++++++------- Items/Weapons/Summon/StaffoftheMechworm.cs | 17 +++++----- Items/Weapons/Summon/StarspawnHelixStaff.cs | 10 +++--- Items/Weapons/Summon/ViralSprout.cs | 8 ++--- Items/Weapons/Summon/ViridVanguard.cs | 10 +++--- Items/Weapons/Typeless/RelicOfResilience.cs | 8 ++--- NPCs/AcidRain/SulphurousSkater.cs | 14 ++++---- NPCs/CalamityAI.cs | 14 +++----- NPCs/CalamityGlobalNPC.cs | 15 ++++----- NPCs/DevourerofGods/DevourerofGodsBody.cs | 4 +-- NPCs/DevourerofGods/DevourerofGodsHead.cs | 3 +- NPCs/ExoMechs/Artemis/Artemis.cs | 6 ++-- NPCs/Other/DemonPortal.cs | 10 +++--- NPCs/Other/THELORDE.cs | 3 +- NPCs/Providence/Providence.cs | 6 ++-- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 30 +++++++---------- .../BaseIdleHoldoutProjectile.cs | 4 +-- Projectiles/Boss/AresTeslaOrb.cs | 8 ++--- .../Damageable/DamageableProjectile.cs | 16 +++++----- .../HydraulicVoltCrasherProjectile.cs | 9 +++--- .../DraedonsArsenal/PoleWarperSummon.cs | 20 ++++++------ .../DraedonsArsenal/SnakeEyesSummon.cs | 5 ++- Projectiles/Magic/BlindingLight.cs | 5 ++- Projectiles/Magic/EternityHex.cs | 5 +-- Projectiles/Magic/GranitePulse.cs | 7 ++-- Projectiles/Magic/IceBlock.cs | 3 +- Projectiles/Magic/RancorLaserbeam.cs | 6 ++-- Projectiles/Magic/SmallSpirit.cs | 8 ++--- Projectiles/Melee/MicrowaveAura.cs | 5 ++- Projectiles/Melee/OrderbringerAura.cs | 10 +++--- Projectiles/Melee/StygianShieldAttack.cs | 5 ++- Projectiles/Melee/WulfrumScrewdriverProj.cs | 3 +- .../Melee/Yoyos/SulphurousGrabberYoyo.cs | 5 ++- Projectiles/Ranged/MagnomalyAura.cs | 5 ++- Projectiles/Ranged/PrismMine.cs | 5 ++- Projectiles/Rogue/AlphaSeeker.cs | 7 ++-- Projectiles/Rogue/FinalDawnThrow2.cs | 6 ++-- Projectiles/Rogue/FrostyFlareProj.cs | 10 +++--- Projectiles/Rogue/FrostyFlareStealth.cs | 10 +++--- Projectiles/Rogue/MalachiteStealth.cs | 10 +++--- Projectiles/Rogue/NychthemeronOrb.cs | 5 ++- Projectiles/Rogue/SearedPanProjectile.cs | 32 +++++++++---------- Projectiles/Rogue/TerraDiskProjectile2.cs | 5 ++- .../Summon/AtlasMunitionsAutocannon.cs | 20 ++++++------ .../Summon/AtlasMunitionsAutocannonHeld.cs | 8 ++--- Projectiles/Summon/BlackDragonBody.cs | 12 +++---- Projectiles/Summon/BlackDragonTail.cs | 12 +++---- Projectiles/Summon/DormantBrimseekerAura.cs | 24 +++++++------- Projectiles/Summon/DreadmineTurret.cs | 4 +-- Projectiles/Summon/GiantIbanRobotOfDoom.cs | 27 +++++++--------- .../Summon/GlacialEmbracePointyThing.cs | 8 ++--- Projectiles/Summon/LanternSoul.cs | 4 +-- Projectiles/Summon/MK2FlaskSummon.cs | 6 ++-- Projectiles/Summon/MechwormBody.cs | 6 ++-- Projectiles/Summon/MechwormHead.cs | 10 +++--- Projectiles/Summon/MutatedTruffleMinion.cs | 5 ++- Projectiles/Summon/PlantationStaffTentacle.cs | 6 ++-- Projectiles/Summon/SeekerSummonProj.cs | 3 +- Projectiles/Summon/SkeletalDragonMother.cs | 10 +++--- .../Summon/SmallAresArms/ExoskeletonPanel.cs | 24 +++++++------- .../Summon/SmallAresArms/MinionTeslaOrb.cs | 8 ++--- Projectiles/Summon/WhiteDragonBody.cs | 12 +++---- Projectiles/Summon/WhiteDragonTail.cs | 12 +++---- Projectiles/Summon/WulfrumDroid.cs | 5 ++- .../EnchantmentManager.cs | 4 +-- Utilities/NPCUtils.cs | 7 ++-- Utilities/ProjectileUtils.cs | 25 +++++++-------- Utilities/RicoshotUtils.cs | 15 ++++----- 74 files changed, 343 insertions(+), 405 deletions(-) diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index 7d9a868889..64fab450d3 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -45,12 +45,12 @@ namespace CalamityMod.Items.Weapons.Summon if (player.altFunctionUse != 2) { // Reset the timer for all lamps, to re-align the formation. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].active) + if (pro.type == type && pro.owner == player.whoAmI) { - Main.projectile[i].ModProjectile().Timer = 0f; - Main.projectile[i].netUpdate = true; + pro.ModProjectile().Timer = 0f; + pro.netUpdate = true; } } diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 63e9915dff..4355ba8e85 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -48,12 +48,12 @@ namespace CalamityMod.Items.Weapons.Summon angleMax += MathHelper.ToRadians((player.ownedProjectileCounts[Item.shoot] - 8) * 2.5f); } angleMax = angleMax > MathHelper.ToRadians(105f) ? MathHelper.ToRadians(105f) : angleMax; // More intuative than using a min function - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + if (p.type == type && p.owner == player.whoAmI) { - Main.projectile[i].ai[1] = (index / CalamityUtils.CountProjectiles(type)) * angleMax - angleMax / 2f; - Main.projectile[i].netUpdate = true; + p.ai[1] = (index / CalamityUtils.CountProjectiles(type)) * angleMax - angleMax / 2f; + p.netUpdate = true; index++; } } diff --git a/Items/Weapons/Summon/DormantBrimseeker.cs b/Items/Weapons/Summon/DormantBrimseeker.cs index 4c2bb3a4ce..9d632037a1 100644 --- a/Items/Weapons/Summon/DormantBrimseeker.cs +++ b/Items/Weapons/Summon/DormantBrimseeker.cs @@ -32,11 +32,11 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float totalSlots = 0f; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].minion && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (p.minion && p.owner == player.whoAmI) { - totalSlots += Main.projectile[i].minionSlots; + totalSlots += p.minionSlots; } } if (totalSlots < player.maxMinions) diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index 496a0f5c8e..f4699f3de1 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -39,11 +39,11 @@ namespace CalamityMod.Items.Weapons.Summon { bool bodyExists = false; int bodyIndex = -1; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + if (p.type == type && p.owner == player.whoAmI) { - bodyIndex = i; + bodyIndex = p.whoAmI; bodyExists = true; break; } diff --git a/Items/Weapons/Summon/FlamsteedRing.cs b/Items/Weapons/Summon/FlamsteedRing.cs index e3b102d464..e1fa8a389c 100644 --- a/Items/Weapons/Summon/FlamsteedRing.cs +++ b/Items/Weapons/Summon/FlamsteedRing.cs @@ -122,13 +122,12 @@ namespace CalamityMod.Items.Weapons.Summon // If the player has any robots, kill them all. if (player.ownedProjectileCounts[Item.shoot] > 0) { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == Item.shoot && - Main.projectile[i].owner == player.whoAmI) + if (p.type == Item.shoot && + p.owner == player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); } } if (CalamityPlayer.areThereAnyDamnBosses) @@ -151,13 +150,12 @@ namespace CalamityMod.Items.Weapons.Summon int robotIndex = -1; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == player.whoAmI) + if (p.type == ModContent.ProjectileType() && + p.owner == player.whoAmI) { - robotIndex = i; + robotIndex = p.whoAmI; break; } } diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index ce81847306..4cb39665a5 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -35,11 +35,11 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float totalMinionSlots = 0f; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].minion && Main.projectile[i].owner == player.whoAmI) + if (pro.minion && pro.owner == player.whoAmI) { - totalMinionSlots += Main.projectile[i].minionSlots; + totalMinionSlots += pro.minionSlots; } } if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) @@ -50,29 +50,29 @@ namespace CalamityMod.Items.Weapons.Summon if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = Item.damage; int pointyThingCount = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + if (pro.type == type && pro.owner == player.whoAmI) { - if (!(Main.projectile[i].ModProjectile as GlacialEmbracePointyThing).circlingPlayer) + if (!(pro.ModProjectile as GlacialEmbracePointyThing).circlingPlayer) continue; pointyThingCount++; } } float angleVariance = MathHelper.TwoPi / pointyThingCount; float angle = 0f; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].ai[1] == 0f) + if (pro.type == type && pro.owner == player.whoAmI && pro.ai[1] == 0f) { - if (!(Main.projectile[i].ModProjectile as GlacialEmbracePointyThing).circlingPlayer) + if (!(pro.ModProjectile as GlacialEmbracePointyThing).circlingPlayer) continue; - Main.projectile[i].ai[0] = angle; - Main.projectile[i].netUpdate = true; + pro.ai[0] = angle; + pro.netUpdate = true; angle += angleVariance; for (int j = 0; j < 22; j++) { - Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, DustID.Ice); + Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, DustID.Ice); dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index f30bc2b7d8..dc354b4b21 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -37,11 +37,11 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float totalMinionSlots = 0f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].minion && Main.projectile[i].owner == player.whoAmI) + if (pro.minion && pro.owner == player.whoAmI) { - totalMinionSlots += Main.projectile[i].minionSlots; + totalMinionSlots += pro.minionSlots; } } if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) @@ -51,16 +51,16 @@ namespace CalamityMod.Items.Weapons.Summon if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = Item.damage; int swordCount = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + if (pro.type == type && pro.owner == player.whoAmI) { - if ((Main.projectile[i].ModProjectile as IgneousBlade).Firing) + if ((pro.ModProjectile as IgneousBlade).Firing) continue; swordCount++; for (int j = 0; j < 22; j++) { - Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); + Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, 6); dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } @@ -68,17 +68,17 @@ namespace CalamityMod.Items.Weapons.Summon } float angleVariance = MathHelper.TwoPi / swordCount; float angle = 0f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].localAI[1] == 0f) + if (pro.type == type && pro.owner == player.whoAmI && pro.localAI[1] == 0f) { - if ((Main.projectile[i].ModProjectile as IgneousBlade).Firing) + if ((pro.ModProjectile as IgneousBlade).Firing) continue; - Main.projectile[i].ai[0] = angle; + pro.ai[0] = angle; angle += angleVariance; for (int j = 0; j < 22; j++) { - Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); + Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, 6); dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); dust.noGravity = true; } diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 5cc6fe5d08..1edb8a11f6 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -37,10 +37,9 @@ namespace CalamityMod.Items.Weapons.Summon { float neededSlots = 1; float foundSlotsCount = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.active && p.minion && p.owner == player.whoAmI) + if (p.minion && p.owner == player.whoAmI) { foundSlotsCount += p.minionSlots; if (foundSlotsCount + neededSlots > player.maxMinions) @@ -102,17 +101,17 @@ namespace CalamityMod.Items.Weapons.Summon { int head = -1; int tail = -1; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer) + if (p.owner == Main.myPlayer) { - if (head == -1 && Main.projectile[i].type == ModContent.ProjectileType()) + if (head == -1 && p.type == ModContent.ProjectileType()) { - head = i; + head = p.whoAmI; } - if (tail == -1 && Main.projectile[i].type == ModContent.ProjectileType()) + if (tail == -1 && p.type == ModContent.ProjectileType()) { - tail = i; + tail = p.whoAmI; } if (head != -1 && tail != -1) { diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index fd98d1a8b1..decd5b5389 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -44,13 +44,13 @@ namespace CalamityMod.Items.Weapons.Summon } int bladeIndex = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (pro.type == type && pro.owner == player.whoAmI) { - Main.projectile[i].ModProjectile().ProbeIndex = bladeIndex++; - Main.projectile[i].ModProjectile().AITimer = 0f; - Main.projectile[i].netUpdate = true; + pro.ModProjectile().ProbeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } } diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 822d0453c7..1d69d843a1 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -39,13 +39,13 @@ namespace CalamityMod.Items.Weapons.Summon Main.projectile[p].originalDamage = Item.damage; int minionCount = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + if (pro.type != type || pro.owner != player.whoAmI) continue; - Main.projectile[i].localAI[0] = minionCount; - Main.projectile[i].netUpdate = true; + pro.localAI[0] = minionCount; + pro.netUpdate = true; minionCount++; } } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 64781b3446..4ce5120c19 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -63,13 +63,13 @@ namespace CalamityMod.Items.Weapons.Summon } int bladeIndex = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + if (pro.type == type && pro.owner == player.whoAmI) { - Main.projectile[i].ModProjectile().BladeIndex = bladeIndex++; - Main.projectile[i].ModProjectile().AITimer = 0f; - Main.projectile[i].netUpdate = true; + pro.ModProjectile().BladeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } } diff --git a/Items/Weapons/Typeless/RelicOfResilience.cs b/Items/Weapons/Typeless/RelicOfResilience.cs index db7549197f..4f699b7e5e 100644 --- a/Items/Weapons/Typeless/RelicOfResilience.cs +++ b/Items/Weapons/Typeless/RelicOfResilience.cs @@ -56,12 +56,12 @@ namespace CalamityMod.Items.Weapons.Typeless }; if (player.ownedProjectileCounts[Item.shoot] > 0) { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == Item.shoot) + if (p.type == Item.shoot) { - Main.projectile[i].Center = Main.MouseWorld; - Main.projectile[i].netUpdate = true; + p.Center = Main.MouseWorld; + p.netUpdate = true; } } } diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index d5502e57d5..ffca1f65e9 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -178,20 +178,20 @@ namespace CalamityMod.NPCs.AcidRain float minimumDistance = 2400f; Projectile closestBubble = null; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != bubbleType || !Main.projectile[i].active) + if (p.type != bubbleType) continue; - if (Math.Abs(NPC.Center.X - Main.projectile[i].Center.X) >= minimumDistance || - Main.projectile[i].Center.Y <= NPC.Bottom.Y || - !Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height)) + if (Math.Abs(NPC.Center.X - p.Center.X) >= minimumDistance || + p.Center.Y <= NPC.Bottom.Y || + !Collision.CanHit(NPC.position, NPC.width, NPC.height, p.position, p.width, p.height)) { continue; } - minimumDistance = NPC.Distance(Main.projectile[i].Center); - closestBubble = Main.projectile[i]; + minimumDistance = NPC.Distance(p.Center); + closestBubble = p; } distanceToBubble = minimumDistance; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 2fa37d76a2..a4f92a3e10 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4884,17 +4884,13 @@ namespace CalamityMod.NPCs } // Despawn potentially hazardous projectiles when entering a new phase - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - Projectile projectile = Main.projectile[i]; - if (projectile.active) + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || - projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - if (projectile.timeLeft > 30) - projectile.timeLeft = 30; - } + if (projectile.timeLeft > 30) + projectile.timeLeft = 30; } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bee91818bf..eda47898f4 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4520,15 +4520,15 @@ namespace CalamityMod.NPCs { int bullseyeType = ProjectileType(); Projectile bullseye = null; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != bullseyeType || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + if (p.type != bullseyeType || p.owner != player.whoAmI) continue; // Only choose a bullseye if it is attached to the NPC that is being hit. - if (npc.whoAmI == (int)Main.projectile[i].ai[0]) + if (npc.whoAmI == (int)p.ai[0]) { - bullseye = Main.projectile[i]; + bullseye = p; break; } } @@ -6313,12 +6313,11 @@ namespace CalamityMod.NPCs return; Projectile proj = null; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - proj = Main.projectile[i]; - if (Main.projectile[i].active && Main.projectile[i].bobber && Main.projectile[i].owner == player.whoAmI) + proj = p; + if (p.bobber && p.owner == player.whoAmI) { - proj = Main.projectile[i]; break; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index d6171d5278..430d0602a7 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -326,9 +326,9 @@ namespace CalamityMod.NPCs.DevourerofGods private bool AnyTeleportRifts() { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == ModContent.ProjectileType()) + if (p.type == ModContent.ProjectileType()) return true; } return false; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2c8849bc94..f785d79e08 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2526,9 +2526,8 @@ namespace CalamityMod.NPCs.DevourerofGods private Vector2 GetRiftLocation(bool spawnDust) { Vector2 realSpot = default; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; if (proj.type == ModContent.ProjectileType()) { if (!spawnDust) diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 5c4b401b65..db6cb20f0e 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1122,11 +1122,11 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis { calamityGlobalNPC.newAI[3] = 0f; AIState = (float)Phase.Deathray; - for (int i = 0; i < Main.maxProjectiles; i ++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == ModContent.ProjectileType()) + if (p.type == ModContent.ProjectileType()) { - Main.projectile[i].active = false; + p.active = false; continue; } } diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 7e64b7d563..90319a3abb 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -47,14 +47,14 @@ namespace CalamityMod.NPCs.Other NPC.dontTakeDamage = true; NPC.netUpdate = true; int demonType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != demonType || !Main.projectile[i].active || Main.projectile[i].hostile) + if (p.type != demonType || p.hostile) continue; - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = false; - Main.projectile[i].netUpdate = true; + p.hostile = true; + p.friendly = false; + p.netUpdate = true; } } diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index 73744b4cd2..29f99b26c2 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -312,9 +312,8 @@ namespace CalamityMod.NPCs.Other NPC.ai[3] = 0f; NPC.aiStyle = (urAMemeNow ? -1 : aiChoice); NPC.netUpdate = true; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) { proj.Kill(); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index e0cea09394..ae5c7802f9 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1749,11 +1749,11 @@ namespace CalamityMod.NPCs.Providence DespawnSpecificProjectiles(); int laserType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!Main.projectile[i].active || Main.projectile[i].type != laserType) + if (p.type != laserType) continue; - Main.projectile[i].Kill(); + p.Kill(); } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index bd5e272b70..3bf3234916 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -315,19 +315,17 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[1] == 60f) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - Projectile projectile = Main.projectile[i]; - if (projectile.active && (projectile.type == ProjectileID.MoonLeech || projectile.type == ProjectileID.PhantasmalBolt || + if ((projectile.type == ProjectileID.MoonLeech || projectile.type == ProjectileID.PhantasmalBolt || projectile.type == ProjectileID.PhantasmalDeathray || projectile.type == ProjectileID.PhantasmalEye || projectile.type == ProjectileID.PhantasmalSphere)) projectile.Kill(); } - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC3 in Main.ActiveNPCs) { - NPC nPC3 = Main.npc[j]; - if (nPC3.active && nPC3.type == NPCID.MoonLordFreeEye) + if (nPC3.type == NPCID.MoonLordFreeEye) { nPC3.HitEffect(0, 9999.0); nPC3.active = false; @@ -846,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (targetLeechDist != Vector2.Zero) targetLeechDist.Normalize(); - Projectile.NewProjectile(npc.GetSource_FromAI(), leechNPCCenter.X, leechNPCCenter.Y, targetLeechDist.X, targetLeechDist.Y, ProjectileID.MoonLeech, 0, 0f, Main.myPlayer, npc.whoAmI + 1, i); + Projectile.NewProjectile(npc.GetSource_FromAI(), leechNPCCenter.X, leechNPCCenter.Y, targetLeechDist.X, targetLeechDist.Y, ProjectileID.MoonLeech, 0, 0f, Main.myPlayer, npc.whoAmI + 1, player6.whoAmI); } } } @@ -1384,10 +1382,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } sphereVelocity *= velocity; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile currentProjectile in Main.ActiveProjectiles) { - Projectile currentProjectile = Main.projectile[i]; - if (currentProjectile.active && currentProjectile.type == ProjectileID.PhantasmalSphere && currentProjectile.ai[1] == npc.whoAmI && currentProjectile.ai[0] != -1f) + if (currentProjectile.type == ProjectileID.PhantasmalSphere && currentProjectile.ai[1] == npc.whoAmI && currentProjectile.ai[0] != -1f) { currentProjectile.ai[0] = -1f; currentProjectile.velocity = sphereVelocity; @@ -1895,13 +1892,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.velocity = Vector2.UnitY * -7f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile trueEyeSpheres in Main.ActiveProjectiles) { - Projectile trueEyeSpheres = Main.projectile[i]; - if (trueEyeSpheres.active && trueEyeSpheres.type == type && trueEyeSpheres.ai[1] == npc.whoAmI && trueEyeSpheres.ai[0] != -1f) + if (trueEyeSpheres.type == type && trueEyeSpheres.ai[1] == npc.whoAmI && trueEyeSpheres.ai[0] != -1f) { - Projectile trueEyeSphereVel = trueEyeSpheres; - trueEyeSphereVel.velocity += npc.velocity; + trueEyeSpheres.velocity += npc.velocity; trueEyeSpheres.netUpdate = true; } } @@ -1927,10 +1922,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Vector2 trueEyeSphereVelocity = (npc.ai[2] - MathHelper.PiOver2).ToRotationVector2() * velocity; npc.velocity = trueEyeSphereVelocity * 2f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile trueEyeSphereProj in Main.ActiveProjectiles) { - Projectile trueEyeSphereProj = Main.projectile[i]; - if (trueEyeSphereProj.active && trueEyeSphereProj.type == type && trueEyeSphereProj.ai[1] == npc.whoAmI && trueEyeSphereProj.ai[0] != -1f) + if (trueEyeSphereProj.type == type && trueEyeSphereProj.ai[1] == npc.whoAmI && trueEyeSphereProj.ai[0] != -1f) { trueEyeSphereProj.ai[0] = -1f; trueEyeSphereProj.damage = damage; diff --git a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs index 0674196684..17102dbbe6 100644 --- a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles bool bladeIsPresent = false; int holdoutType = ItemProjectileRelationship[itemID]; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != holdoutType || Main.projectile[i].owner != player.whoAmI || !Main.projectile[i].active) + if (p.type != holdoutType || p.owner != player.whoAmI) continue; bladeIsPresent = true; diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 96c7223a95..4d6bd2cb5b 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -155,15 +155,15 @@ namespace CalamityMod.Projectiles.Boss bool expertMode = Main.expertMode || bossRush; float detachDistance = bossRush ? 1600f : death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - 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) + if (p.type != Projectile.type || p.ai[0] != Identity + 1f || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) continue; - if (Vector2.Distance(Projectile.Center, Main.projectile[i].Center) > detachDistance) + if (Vector2.Distance(Projectile.Center, p.Center) > detachDistance) continue; - return Main.projectile[i]; + return p; } return null; diff --git a/Projectiles/Damageable/DamageableProjectile.cs b/Projectiles/Damageable/DamageableProjectile.cs index 9fc0c55e0a..ad9730fc6b 100644 --- a/Projectiles/Damageable/DamageableProjectile.cs +++ b/Projectiles/Damageable/DamageableProjectile.cs @@ -201,20 +201,20 @@ namespace CalamityMod.Projectiles.Damageable } public virtual bool ProjectileCollisionCheck() { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - bool canBeHit = (Main.projectile[i].friendly && DamageSources.HasFlag(DamageSourceType.FriendlyProjectiles) || - Main.projectile[i].hostile && DamageSources.HasFlag(DamageSourceType.HostileProjectiles)) && - i != Projectile.whoAmI; - if (Main.projectile[i].active && canBeHit && Main.projectile[i].damage > 0) + bool canBeHit = (p.friendly && DamageSources.HasFlag(DamageSourceType.FriendlyProjectiles) || + p.hostile && DamageSources.HasFlag(DamageSourceType.HostileProjectiles)) && + p.whoAmI != Projectile.whoAmI; + if (canBeHit && p.damage > 0) { - if (Main.projectile[i].Colliding(Main.projectile[i].Hitbox, Projectile.Hitbox)) + if (p.Colliding(p.Hitbox, Projectile.Hitbox)) { - int damage = Main.DamageVar(Main.projectile[i].damage) * 2; + int damage = Main.DamageVar(p.damage) * 2; damage = Main.expertMode ? (int)(damage * Main.RegisteredGameModes[GameModeID.Expert].EnemyDamageMultiplier) : damage; CombatText.NewText(new Rectangle((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height), CombatText.DamagedFriendly, damage); Life -= damage; - HitEffectProjectile(damage, Main.projectile[i]); + HitEffectProjectile(damage, p); DamageImmunityFrames = MaxDamageImmunityFrames; if (Projectile.usesIDStaticNPCImmunity) DamageImmunityFrames = Projectile.idStaticNPCHitCooldown; diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 69da7b233c..da7aece0f7 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -160,13 +160,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // No more than 3 enemies with streams if (Owner.ownedProjectileCounts[attackType] > 3) return false; - + // Prevent supercharging an enemy twice. - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == attackType && - Main.projectile[i].ai[1] == i) + if (p.type == attackType && + p.ai[1] == p.whoAmI) { return false; } diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 93fab2bf0e..b09d4808c0 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -116,13 +116,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public void NPCMovement(NPC npc) { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == Projectile.type && - Main.projectile[i].active && + if (p.type == Projectile.type && Projectile.owner == Projectile.owner) { - PoleWarperSummon otherPole = (PoleWarperSummon)Main.projectile[i].ModProjectile; + PoleWarperSummon otherPole = (PoleWarperSummon)p.ModProjectile; if (otherPole.Time != Time && otherPole.Time != Time + 1) { otherPole.Time = Time; @@ -152,22 +151,21 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public void RepelMovement() { // This does not incorporate attraction on purpose. Doing so causes the minions to very easily become distracted. - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == Projectile.type && - Main.projectile[i].active && - Projectile.Distance(Main.projectile[i].Center) < 40f) + if (p.type == Projectile.type && + Projectile.Distance(p.Center) < 40f) { - PoleWarperSummon otherPole = (PoleWarperSummon)Main.projectile[i].ModProjectile; + PoleWarperSummon otherPole = (PoleWarperSummon)p.ModProjectile; if (otherPole.North != North) { - float distanceFromOtherPole = Projectile.Distance(Main.projectile[i].Center) + 1f; + float distanceFromOtherPole = Projectile.Distance(p.Center) + 1f; if (float.IsNaN(distanceFromOtherPole) || distanceFromOtherPole < 1f) { distanceFromOtherPole = 1f; } float repulsionSpeed = MaximumRepulsionSpeed * (float)Math.Pow(3f, -distanceFromOtherPole / 27f); - Projectile.velocity -= (Main.projectile[i].Center - Projectile.Center).SafeNormalize(Vector2.UnitY) * repulsionSpeed; + Projectile.velocity -= (p.Center - Projectile.Center).SafeNormalize(Vector2.UnitY) * repulsionSpeed; } } } diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index a789a53b17..ae7191de5e 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -139,10 +139,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // so it looks like the minion deflected his own projectile. if (HasShot) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj is not null && proj.active && proj.type == ModContent.ProjectileType() && proj.owner == Owner.whoAmI && proj.ModProjectile().MinionID == Projectile.whoAmI && proj.ModProjectile().HasRedirected) + if (proj.type == ModContent.ProjectileType() && proj.owner == Owner.whoAmI && proj.ModProjectile().MinionID == Projectile.whoAmI && proj.ModProjectile().HasRedirected) { Projectile.Center = proj.Center; SwitchAIState(AIState.Redirecting); diff --git a/Projectiles/Magic/BlindingLight.cs b/Projectiles/Magic/BlindingLight.cs index 2e0835f332..764b5c32d6 100644 --- a/Projectiles/Magic/BlindingLight.cs +++ b/Projectiles/Magic/BlindingLight.cs @@ -61,10 +61,9 @@ namespace CalamityMod.Projectiles.Magic { int lightBlade = ModContent.ProjectileType(); int extraDamage = 0; - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile otherProj in Main.ActiveProjectiles) { - Projectile otherProj = Main.projectile[i]; - if (otherProj is null || !otherProj.active || otherProj.owner != Projectile.owner || otherProj.type != lightBlade) + if (otherProj.owner != Projectile.owner || otherProj.type != lightBlade) continue; // Can only consume blades within the flash radius (which should be most if not all of them anyway) diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index a8906062d9..0480e672e8 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -177,11 +177,8 @@ namespace CalamityMod.Projectiles.Magic TargetNPCIndex = newTarget.whoAmI; // Adjust the target index for the other components of the projectile. - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (!proj.active) - continue; if (proj.owner != Projectile.owner) continue; if (proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType()) diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index ed6cc4df7c..cee8512730 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -67,15 +67,14 @@ namespace CalamityMod.Projectiles.Magic int index = 0; float findOldest = 0f; int projType = Projectile.type; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.active && proj.owner == Projectile.owner && proj.type == projType && proj.ai[1] < 3600f) + if (proj.owner == Projectile.owner && proj.type == projType && proj.ai[1] < 3600f) { projCount++; if (proj.ai[1] > findOldest) { - index = i; + index = proj.whoAmI; findOldest = proj.ai[1]; } } diff --git a/Projectiles/Magic/IceBlock.cs b/Projectiles/Magic/IceBlock.cs index 47f2706639..79f3da1091 100644 --- a/Projectiles/Magic/IceBlock.cs +++ b/Projectiles/Magic/IceBlock.cs @@ -35,9 +35,8 @@ namespace CalamityMod.Projectiles.Magic { Projectile.alpha = 20; } - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; if (proj.type == ModContent.ProjectileType() && proj.owner == Main.myPlayer) { Vector2 pos1 = new Vector2(proj.Center.X, proj.Center.Y - (proj.height * 0.5f) - 44f); diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 023978211a..9c52b27a05 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -21,12 +21,12 @@ namespace CalamityMod.Projectiles.Magic { get { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].identity != Projectile.ai[0] || !Main.projectile[i].active || Main.projectile[i].owner != Projectile.owner) + if (p.identity != Projectile.ai[0] || p.owner != Projectile.owner) continue; - return Main.projectile[i]; + return p; } return null; } diff --git a/Projectiles/Magic/SmallSpirit.cs b/Projectiles/Magic/SmallSpirit.cs index 3c24b7b56c..c341c337cf 100644 --- a/Projectiles/Magic/SmallSpirit.cs +++ b/Projectiles/Magic/SmallSpirit.cs @@ -15,15 +15,15 @@ namespace CalamityMod.Projectiles.Magic get { int spiritType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != spiritType || Main.projectile[i].identity != Projectile.ai[0] || - Main.projectile[i].owner != Projectile.owner) + if (p.type != spiritType || p.identity != Projectile.ai[0] || + p.owner != Projectile.owner) { continue; } - return Main.projectile[i]; + return p; } return null; } diff --git a/Projectiles/Melee/MicrowaveAura.cs b/Projectiles/Melee/MicrowaveAura.cs index f0249d327c..b907c07003 100644 --- a/Projectiles/Melee/MicrowaveAura.cs +++ b/Projectiles/Melee/MicrowaveAura.cs @@ -66,10 +66,9 @@ namespace CalamityMod.Projectiles.Melee private Projectile FindParent() { Projectile parent = null; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.identity == Projectile.ai[0] && p.active && p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) + if (p.identity == Projectile.ai[0] && p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) { parent = p; break; diff --git a/Projectiles/Melee/OrderbringerAura.cs b/Projectiles/Melee/OrderbringerAura.cs index ebf5317dae..bdc5e8c106 100644 --- a/Projectiles/Melee/OrderbringerAura.cs +++ b/Projectiles/Melee/OrderbringerAura.cs @@ -52,15 +52,15 @@ namespace CalamityMod.Projectiles.Melee int incTracker = 0; float aiTracker = 0f; int theProjectile = Projectile.type; - for (int i = 0; i < 1000; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && Main.projectile[i].type == theProjectile && Main.projectile[i].ai[1] < 3600f) + if (p.owner == Projectile.owner && p.type == theProjectile && p.ai[1] < 3600f) { projTimer++; - if (Main.projectile[i].ai[1] > aiTracker) + if (p.ai[1] > aiTracker) { - incTracker = i; - aiTracker = Main.projectile[i].ai[1]; + incTracker = p.whoAmI; + aiTracker = p.ai[1]; } } } diff --git a/Projectiles/Melee/StygianShieldAttack.cs b/Projectiles/Melee/StygianShieldAttack.cs index 57cdbaf87d..c34bdc48cf 100644 --- a/Projectiles/Melee/StygianShieldAttack.cs +++ b/Projectiles/Melee/StygianShieldAttack.cs @@ -69,10 +69,9 @@ namespace CalamityMod.Projectiles.Melee // Detach the owner from any mounts/hooks if (Owner.mount != null) Owner.mount.Dismount(Owner); - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (!proj.active || proj.owner != Owner.whoAmI || proj.aiStyle != ProjAIStyleID.Hook) + if (proj.owner != Owner.whoAmI || proj.aiStyle != ProjAIStyleID.Hook) continue; if (proj.aiStyle == ProjAIStyleID.Hook) proj.Kill(); diff --git a/Projectiles/Melee/WulfrumScrewdriverProj.cs b/Projectiles/Melee/WulfrumScrewdriverProj.cs index e06f69f78e..92bfebfb76 100644 --- a/Projectiles/Melee/WulfrumScrewdriverProj.cs +++ b/Projectiles/Melee/WulfrumScrewdriverProj.cs @@ -88,9 +88,8 @@ namespace CalamityMod.Projectiles.Melee //Check for launchable screws. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; if (proj.ModProjectile != null && proj.owner == Projectile.owner && proj.ModProjectile is WulfrumScrew screw && screw.BazingaTime == 0) { float collisionPoint = 0f; diff --git a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs index cd27228e10..b965c8a191 100644 --- a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs +++ b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs @@ -59,10 +59,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (bubbleStronkCounter >= 180) bubbleStronk = false; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.active && proj.type == ModContent.ProjectileType() && proj.ai[0] >= 40f && proj.owner == Projectile.owner) + if (proj.type == ModContent.ProjectileType() && proj.ai[0] >= 40f && proj.owner == Projectile.owner) { if (Projectile.Hitbox.Intersects(proj.Hitbox)) { diff --git a/Projectiles/Ranged/MagnomalyAura.cs b/Projectiles/Ranged/MagnomalyAura.cs index 7b2ba4cdc3..44c91fe234 100644 --- a/Projectiles/Ranged/MagnomalyAura.cs +++ b/Projectiles/Ranged/MagnomalyAura.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -30,9 +30,8 @@ namespace CalamityMod.Projectiles.Ranged { Projectile parent = Main.projectile[0]; bool active = false; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; if (p.identity == Projectile.ai[0] && p.active && p.type == ModContent.ProjectileType()) { parent = p; diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index e37bcf7ee2..28c0e2866d 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -68,10 +68,9 @@ namespace CalamityMod.Projectiles.Ranged public List LocateOtherMines() { List mines = new List(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.type != Projectile.type || !proj.active || proj.timeLeft <= 12 || i == Projectile.whoAmI) + if (proj.type != Projectile.type || proj.timeLeft <= 12 || proj.whoAmI == Projectile.whoAmI) continue; if (!Projectile.WithinRange(proj.Center, MineConnectDistanceMax)) continue; diff --git a/Projectiles/Rogue/AlphaSeeker.cs b/Projectiles/Rogue/AlphaSeeker.cs index ef808a489e..abb4c2339c 100644 --- a/Projectiles/Rogue/AlphaSeeker.cs +++ b/Projectiles/Rogue/AlphaSeeker.cs @@ -50,10 +50,9 @@ namespace CalamityMod.Projectiles.Rogue Projectile parent = Main.projectile[0]; bool active = false; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.identity == Projectile.ai[1] && p.active) + if (p.identity == Projectile.ai[1]) { parent = p; active = true; @@ -154,7 +153,7 @@ namespace CalamityMod.Projectiles.Rogue if (distToNPC < minDist) { minDist = distToNPC; - target = i; + target = npc.whoAmI; } } } diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index cfd96f4688..18f60e41a7 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -77,11 +77,9 @@ namespace CalamityMod.Projectiles.Rogue } // Kill any hooks from the projectile owner. - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - - if (!proj.active || proj.owner != player.whoAmI || proj.aiStyle != ProjAIStyleID.Hook) + if (proj.owner != player.whoAmI || proj.aiStyle != ProjAIStyleID.Hook) continue; if (proj.aiStyle == ProjAIStyleID.Hook) diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index 6a15281be3..c83f9145c7 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -97,15 +97,15 @@ namespace CalamityMod.Projectiles.Rogue int flaresFound = 0; int oldestFlare = -1; int oldestFlareTimeLeft = 300; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == Projectile.type && i != Projectile.whoAmI && Main.projectile[i].ai[1] == target.whoAmI) + if (p.owner == Main.myPlayer && p.type == Projectile.type && p.whoAmI != Projectile.whoAmI && p.ai[1] == target.whoAmI) { flaresFound++; - if (Main.projectile[i].timeLeft < oldestFlareTimeLeft) + if (p.timeLeft < oldestFlareTimeLeft) { - oldestFlareTimeLeft = Main.projectile[i].timeLeft; - oldestFlare = Main.projectile[i].whoAmI; + oldestFlareTimeLeft = p.timeLeft; + oldestFlare = p.whoAmI; } if (flaresFound >= maxFlares) break; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index d955ef43a1..964df5d3b7 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -106,15 +106,15 @@ namespace CalamityMod.Projectiles.Rogue int flaresFound = 0; int oldestFlare = -1; int oldestFlareTimeLeft = 300; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == Projectile.type && i != Projectile.whoAmI && Main.projectile[i].ai[1] == target.whoAmI) + if (p.owner == Main.myPlayer && p.type == Projectile.type && p.whoAmI != Projectile.whoAmI && p.ai[1] == target.whoAmI) { flaresFound++; - if (Main.projectile[i].timeLeft < oldestFlareTimeLeft) + if (p.timeLeft < oldestFlareTimeLeft) { - oldestFlareTimeLeft = Main.projectile[i].timeLeft; - oldestFlare = Main.projectile[i].whoAmI; + oldestFlareTimeLeft = p.timeLeft; + oldestFlare = p.whoAmI; } if (flaresFound >= maxFlares) break; diff --git a/Projectiles/Rogue/MalachiteStealth.cs b/Projectiles/Rogue/MalachiteStealth.cs index 871fb68e9a..a643060480 100644 --- a/Projectiles/Rogue/MalachiteStealth.cs +++ b/Projectiles/Rogue/MalachiteStealth.cs @@ -121,15 +121,15 @@ namespace CalamityMod.Projectiles.Rogue int kunaiFound = 0; int oldestKunai = -1; int oldestKunaiTimeLeft = lifeSpan; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == Projectile.type && i != Projectile.whoAmI && Main.projectile[i].ai[1] == target.whoAmI) + if (p.owner == Main.myPlayer && p.type == Projectile.type && p.whoAmI != Projectile.whoAmI && p.ai[1] == target.whoAmI) { kunaiFound++; - if (Main.projectile[i].timeLeft < oldestKunaiTimeLeft) + if (p.timeLeft < oldestKunaiTimeLeft) { - oldestKunaiTimeLeft = Main.projectile[i].timeLeft; - oldestKunai = Main.projectile[i].whoAmI; + oldestKunaiTimeLeft = p.timeLeft; + oldestKunai = p.whoAmI; } if (kunaiFound >= maxKunai) break; diff --git a/Projectiles/Rogue/NychthemeronOrb.cs b/Projectiles/Rogue/NychthemeronOrb.cs index 2927406455..022d104f1e 100644 --- a/Projectiles/Rogue/NychthemeronOrb.cs +++ b/Projectiles/Rogue/NychthemeronOrb.cs @@ -30,10 +30,9 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { bool isActive = false; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.identity == Projectile.ai[1] && p.active) + if (p.identity == Projectile.ai[1]) { isActive = true; } diff --git a/Projectiles/Rogue/SearedPanProjectile.cs b/Projectiles/Rogue/SearedPanProjectile.cs index 28d7ba76c3..1d5d1dbe8e 100644 --- a/Projectiles/Rogue/SearedPanProjectile.cs +++ b/Projectiles/Rogue/SearedPanProjectile.cs @@ -129,18 +129,18 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.owner == Main.myPlayer) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!Main.projectile[i].active || Main.projectile[i].owner != Projectile.owner) + if (p.owner != Projectile.owner) continue; - if (Main.projectile[i].ModProjectile is NiceCock) + if (p.ModProjectile is NiceCock) { if (!activate) - Main.projectile[i].Kill(); + p.Kill(); else { - Main.projectile[i].ModProjectile().homing = true; - Main.projectile[i].extraUpdates += 2; + p.ModProjectile().homing = true; + p.extraUpdates += 2; } } } @@ -151,14 +151,14 @@ namespace CalamityMod.Projectiles.Rogue { int fireballCount = 0; // Count how many fireballs exist already around the given target - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { // Keep the loop as short as possible - if (!Main.projectile[i].active || Main.projectile[i].owner != Projectile.owner || !Main.projectile[i].CountsAsClass() || targetIndex != (int)Main.projectile[i].ai[1]) + if (p.owner != Projectile.owner || !p.CountsAsClass() || targetIndex != (int)p.ai[1]) continue; - if (Main.projectile[i].ModProjectile is NiceCock) + if (p.ModProjectile is NiceCock) { - if (Main.projectile[i].ModProjectile().homing) + if (p.ModProjectile().homing) continue; fireballCount++; } @@ -166,16 +166,16 @@ namespace CalamityMod.Projectiles.Rogue // Adjust the angle of the existing fireballs around a target float angleVariance = MathHelper.TwoPi / fireballCount; float angle = 0f; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!Main.projectile[i].active || Main.projectile[i].owner != Projectile.owner || !Main.projectile[i].CountsAsClass() || targetIndex != (int)Main.projectile[i].ai[1]) + if (p.owner != Projectile.owner || !p.CountsAsClass() || targetIndex != (int)p.ai[1]) continue; - if (Main.projectile[i].ModProjectile is NiceCock) + if (p.ModProjectile is NiceCock) { - if (Main.projectile[i].ModProjectile().homing) + if (p.ModProjectile().homing) continue; - Main.projectile[i].ai[0] = angle; - Main.projectile[i].netUpdate = true; + p.ai[0] = angle; + p.netUpdate = true; angle += angleVariance; } } diff --git a/Projectiles/Rogue/TerraDiskProjectile2.cs b/Projectiles/Rogue/TerraDiskProjectile2.cs index 9ef33c60a2..5061370417 100644 --- a/Projectiles/Rogue/TerraDiskProjectile2.cs +++ b/Projectiles/Rogue/TerraDiskProjectile2.cs @@ -47,10 +47,9 @@ namespace CalamityMod.Projectiles.Rogue Projectile parent = Main.projectile[0]; bool active = false; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.identity == Projectile.ai[0] && p.active && p.type == ModContent.ProjectileType()) + if (p.identity == Projectile.ai[0] && p.type == ModContent.ProjectileType()) { parent = p; active = true; diff --git a/Projectiles/Summon/AtlasMunitionsAutocannon.cs b/Projectiles/Summon/AtlasMunitionsAutocannon.cs index 87dcd21d35..badccb7cf3 100644 --- a/Projectiles/Summon/AtlasMunitionsAutocannon.cs +++ b/Projectiles/Summon/AtlasMunitionsAutocannon.cs @@ -203,20 +203,20 @@ namespace CalamityMod.Projectiles.Summon if (!CannonIsMounted) { int detachedCannonID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != detachedCannonID || !Main.projectile[i].active || Main.projectile[i].owner != Projectile.owner) + if (p.type != detachedCannonID || p.owner != Projectile.owner) continue; - if (!Main.projectile[i].Hitbox.Intersects(Projectile.Hitbox)) + if (!p.Hitbox.Intersects(Projectile.Hitbox)) continue; - if (Main.projectile[i].ModProjectile().BeingHeld) + if (p.ModProjectile().BeingHeld) continue; - Main.projectile[i].Kill(); + p.Kill(); CannonIsMounted = true; - HeatInterpolant = Main.projectile[i].ModProjectile().HeatInterpolant; + HeatInterpolant = p.ModProjectile().HeatInterpolant; Projectile.netUpdate = true; break; } @@ -227,11 +227,11 @@ namespace CalamityMod.Projectiles.Summon { int podID = ModContent.ProjectileType(); int podUpperID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - bool validID = Main.projectile[i].type == podID || Main.projectile[i].type == podUpperID; - if (Main.projectile[i].active && validID && Main.projectile[i].owner == Projectile.owner) - Main.projectile[i].Kill(); + bool validID = p.type == podID || p.type == podUpperID; + if (validID && p.owner == Projectile.owner) + p.Kill(); } Projectile.Kill(); diff --git a/Projectiles/Summon/AtlasMunitionsAutocannonHeld.cs b/Projectiles/Summon/AtlasMunitionsAutocannonHeld.cs index 64bafe200f..95f60aedc5 100644 --- a/Projectiles/Summon/AtlasMunitionsAutocannonHeld.cs +++ b/Projectiles/Summon/AtlasMunitionsAutocannonHeld.cs @@ -172,11 +172,11 @@ namespace CalamityMod.Projectiles.Summon int podID = ModContent.ProjectileType(); int podUpperID = ModContent.ProjectileType(); int cannonID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - bool validID = Main.projectile[i].type == podID || Main.projectile[i].type == podUpperID || Main.projectile[i].type == cannonID; - if (Main.projectile[i].active && validID && Main.projectile[i].owner == Projectile.owner) - Main.projectile[i].Kill(); + bool validID = p.type == podID || p.type == podUpperID || p.type == cannonID; + if (validID && p.owner == Projectile.owner) + p.Kill(); } Projectile.Kill(); diff --git a/Projectiles/Summon/BlackDragonBody.cs b/Projectiles/Summon/BlackDragonBody.cs index 5640b97608..70d9f98792 100644 --- a/Projectiles/Summon/BlackDragonBody.cs +++ b/Projectiles/Summon/BlackDragonBody.cs @@ -63,10 +63,9 @@ namespace CalamityMod.Projectiles.Summon var live = false; Projectile nextSegment = new Projectile(); BlackDragonHead head = new BlackDragonHead(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == Type && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == Type && projectile.owner == Projectile.owner) { if (projectile.ModProjectile().segmentIndex == segmentIndex - 1) { @@ -74,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon nextSegment = projectile; } } - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (segmentIndex == 1) { @@ -108,10 +107,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { projectile.Kill(); } diff --git a/Projectiles/Summon/BlackDragonTail.cs b/Projectiles/Summon/BlackDragonTail.cs index 9cdd238f9f..0b9be2eff1 100644 --- a/Projectiles/Summon/BlackDragonTail.cs +++ b/Projectiles/Summon/BlackDragonTail.cs @@ -50,10 +50,9 @@ namespace CalamityMod.Projectiles.Summon Projectile nextSegment = new Projectile(); BlackDragonHead head = new BlackDragonHead(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (projectile.ModProjectile().segmentIndex == segmentIndex - 1) { @@ -61,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon nextSegment = projectile; } } - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (segmentIndex == 1) { @@ -96,10 +95,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { projectile.Kill(); } diff --git a/Projectiles/Summon/DormantBrimseekerAura.cs b/Projectiles/Summon/DormantBrimseekerAura.cs index 95a7453c4e..55c8759a40 100644 --- a/Projectiles/Summon/DormantBrimseekerAura.cs +++ b/Projectiles/Summon/DormantBrimseekerAura.cs @@ -71,20 +71,20 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(360)) dust.scale = 1.5f; } - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == Projectile.owner && Main.projectile[i].localAI[1] == 0f) + if (p.type == ModContent.ProjectileType() && + p.owner == Projectile.owner && p.localAI[1] == 0f) { - if (Main.projectile[i].Distance(Projectile.Center) < Projectile.localAI[1]) + if (p.Distance(Projectile.Center) < Projectile.localAI[1]) { for (int j = 0; j < 30; j++) { - Dust dust = Dust.NewDustPerfect(Main.projectile[i].Center, (int)CalamityDusts.Brimstone); + Dust dust = Dust.NewDustPerfect(p.Center, (int)CalamityDusts.Brimstone); dust.velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * 7f; } - Main.projectile[i].localAI[1] = 1f; - SoundEngine.PlaySound(SoundID.Item45, Main.projectile[i].Center); + p.localAI[1] = 1f; + SoundEngine.PlaySound(SoundID.Item45, p.Center); } } } @@ -99,18 +99,18 @@ namespace CalamityMod.Projectiles.Summon } public override void OnKill(int timeLeft) { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == Projectile.owner && Main.projectile[i].localAI[1] == 1f) + if (p.type == ModContent.ProjectileType() && + p.owner == Projectile.owner && p.localAI[1] == 1f) { for (int j = 0; j < 30; j++) { Dust dust = Dust.NewDustPerfect(Projectile.Center, (int)CalamityDusts.Brimstone); dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 7f; } - SoundEngine.PlaySound(SoundID.Item29, Main.projectile[i].Center); - Main.projectile[i].localAI[1] = 0f; + SoundEngine.PlaySound(SoundID.Item29, p.Center); + p.localAI[1] = 0f; } } } diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index 9bcb120628..09e7382078 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -50,9 +50,9 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(15)) { int mineAmt = 0; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) + if (p.owner == Main.myPlayer && p.type == ModContent.ProjectileType()) { mineAmt++; } diff --git a/Projectiles/Summon/GiantIbanRobotOfDoom.cs b/Projectiles/Summon/GiantIbanRobotOfDoom.cs index b99c8babf8..790f430e9c 100644 --- a/Projectiles/Summon/GiantIbanRobotOfDoom.cs +++ b/Projectiles/Summon/GiantIbanRobotOfDoom.cs @@ -156,13 +156,12 @@ namespace CalamityMod.Projectiles.Summon // If the player has any existing UIs, kill them all. if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == player.whoAmI) + if (p.type == ModContent.ProjectileType() && + p.owner == player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); } } } @@ -289,13 +288,12 @@ namespace CalamityMod.Projectiles.Summon } int slashIndex = -1; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == Projectile.owner) + if (p.type == ModContent.ProjectileType() && + p.owner == Projectile.owner) { - slashIndex = i; + slashIndex = p.whoAmI; break; } } @@ -310,13 +308,12 @@ namespace CalamityMod.Projectiles.Summon int laserBeamIndex = -1; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && - Main.projectile[i].type == ModContent.ProjectileType() && - Main.projectile[i].owner == Projectile.owner) + if (p.type == ModContent.ProjectileType() && + p.owner == Projectile.owner) { - laserBeamIndex = i; + laserBeamIndex = p.whoAmI; break; } } diff --git a/Projectiles/Summon/GlacialEmbracePointyThing.cs b/Projectiles/Summon/GlacialEmbracePointyThing.cs index c91831d4a8..1c1d96346b 100644 --- a/Projectiles/Summon/GlacialEmbracePointyThing.cs +++ b/Projectiles/Summon/GlacialEmbracePointyThing.cs @@ -240,12 +240,12 @@ namespace CalamityMod.Projectiles.Summon { target.AddBuff(BuffID.Frostburn2, 300); int circlers = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && Main.projectile[i].type == Projectile.type) + if (p.owner == Projectile.owner && p.type == Projectile.type) { - GlacialEmbracePointyThing pointy = (GlacialEmbracePointyThing)Main.projectile[i].ModProjectile; - if (Main.projectile[i].ai[1] > 2f) + GlacialEmbracePointyThing pointy = (GlacialEmbracePointyThing)p.ModProjectile; + if (p.ai[1] > 2f) circlers += Main.rand.Next(1, 4); } } diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs index bc29b7a921..34e89c889a 100644 --- a/Projectiles/Summon/LanternSoul.cs +++ b/Projectiles/Summon/LanternSoul.cs @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Summon } int flameCount = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) + if (p.owner == Main.myPlayer && p.type == ModContent.ProjectileType()) { flameCount++; } diff --git a/Projectiles/Summon/MK2FlaskSummon.cs b/Projectiles/Summon/MK2FlaskSummon.cs index 4b04ec3c16..cb1b5a60a2 100644 --- a/Projectiles/Summon/MK2FlaskSummon.cs +++ b/Projectiles/Summon/MK2FlaskSummon.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Projectiles.Summon Main.projectile[p].originalDamage = Projectile.originalDamage; int beeArrayIndex = 0; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile pro in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && Main.projectile[i].type == ModContent.ProjectileType()) + if (pro.owner == Projectile.owner && pro.type == ModContent.ProjectileType()) { - Main.projectile[i].ai[1] = beeArrayIndex; + pro.ai[1] = beeArrayIndex; beeArrayIndex++; } } diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 74715086f7..c215ebf707 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -174,11 +174,11 @@ namespace CalamityMod.Projectiles.Summon public static Projectile LocateHead(Projectile projectile) { int headType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != headType || !Main.projectile[i].active || Main.projectile[i].owner != projectile.owner) + if (p.type != headType || p.owner != projectile.owner) continue; - return Main.projectile[i]; + return p; } return null; } diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index db5c081c62..d69ac7f037 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -338,10 +338,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.Center = TeleportStartingPoint; // Reset the alpha and position across the entire worm for the next charge. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile otherProj in Main.ActiveProjectiles) { - Projectile otherProj = Main.projectile[i]; - if (!otherProj.active || otherProj.owner != Projectile.owner || i == Projectile.whoAmI) + if (otherProj.owner != Projectile.owner || otherProj.whoAmI == Projectile.whoAmI) continue; if (otherProj.type == ModContent.ProjectileType() || otherProj.type == ModContent.ProjectileType()) @@ -377,10 +376,9 @@ namespace CalamityMod.Projectiles.Summon private void CleanUpMechwormPortals() { int portalType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.type != portalType || !proj.active || proj.owner != Projectile.owner) + if (proj.type != portalType || proj.owner != Projectile.owner) continue; proj.Kill(); diff --git a/Projectiles/Summon/MutatedTruffleMinion.cs b/Projectiles/Summon/MutatedTruffleMinion.cs index 6b7a38f393..e7e1f7df40 100644 --- a/Projectiles/Summon/MutatedTruffleMinion.cs +++ b/Projectiles/Summon/MutatedTruffleMinion.cs @@ -193,10 +193,9 @@ namespace CalamityMod.Projectiles.Summon if (Target is not null) { // Find the vortex that it shot. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj is null || !proj.active || proj.type != ModContent.ProjectileType() || proj.owner != Owner.whoAmI || proj.timeLeft < MutatedTruffle.VortexTimeUntilNextState) + if (proj.type != ModContent.ProjectileType() || proj.owner != Owner.whoAmI || proj.timeLeft < MutatedTruffle.VortexTimeUntilNextState) continue; // Spin around the vortex. diff --git a/Projectiles/Summon/PlantationStaffTentacle.cs b/Projectiles/Summon/PlantationStaffTentacle.cs index e39fc24de4..bb70aaef9e 100644 --- a/Projectiles/Summon/PlantationStaffTentacle.cs +++ b/Projectiles/Summon/PlantationStaffTentacle.cs @@ -101,11 +101,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.Center = Vector2.Lerp(Projectile.Center, MainMinion.Center + DesiredLocation, interpolant); Projectile.rotation = (Projectile.Center - MainMinion.Center).ToRotation(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - - if (proj is null || !proj.active || proj.owner != Owner.whoAmI || proj.type != ModContent.ProjectileType() || proj.ModProjectile().State == PlantationStaffSummon.AIState.Ramming) + if (proj.owner != Owner.whoAmI || proj.type != ModContent.ProjectileType() || proj.ModProjectile().State == PlantationStaffSummon.AIState.Ramming) continue; State = AIState.Seeking; diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 56d49731cc..c295da262a 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -101,9 +101,8 @@ namespace CalamityMod.Projectiles.Summon // Make an imp laugh sound every so often if you're the first seeker in the projectile array. if (Main.rand.NextBool(1600)) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile seeker in Main.ActiveProjectiles) { - Projectile seeker = Main.projectile[i]; if (seeker.type == Projectile.type) { if (seeker == Projectile) diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 6a33794efb..b8864fe285 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -112,13 +112,13 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.Distance(player.Center) > 3250f) { Projectile.Center = player.Center; - for (int i = 0; i < Main.projectile.Length; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && - Main.projectile[i].type == ModContent.ProjectileType()) + if (p.owner == Projectile.owner && + p.type == ModContent.ProjectileType()) { - Main.projectile[i].Center = player.Center; - Main.projectile[i].netUpdate = true; + p.Center = player.Center; + p.netUpdate = true; } } Projectile.netUpdate = true; diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs index f570f49734..3daf18b25f 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonPanel.cs @@ -160,22 +160,22 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms // Dynamically update panel icons. for (int i = 0; i < 4; i++) PanelIcons[i].CurrentState = IconType.Inactive; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!arms.Contains(Main.projectile[i].type) || Main.projectile[i].owner != Projectile.owner || !Main.projectile[i].active) + if (!arms.Contains(p.type) || p.owner != Projectile.owner) continue; IconType stateFromID = IconType.Inactive; - if (Main.projectile[i].type == plasmaCannonID) + if (p.type == plasmaCannonID) stateFromID = IconType.Plasma; - if (Main.projectile[i].type == teslaCannonID) + if (p.type == teslaCannonID) stateFromID = IconType.Tesla; - if (Main.projectile[i].type == laserCannonID) + if (p.type == laserCannonID) stateFromID = IconType.Laser; - if (Main.projectile[i].type == gaussNukeID) + if (p.type == gaussNukeID) stateFromID = IconType.Gauss; - PanelIcons[(int)Main.projectile[i].ai[0]].CurrentState = stateFromID; + PanelIcons[(int)p.ai[0]].CurrentState = stateFromID; } // Handle fade effects. @@ -195,9 +195,9 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms if (ArmIDToSpawn >= 0) { bool armAlreadyExists = false; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!arms.Contains(Main.projectile[i].type) || Main.projectile[i].owner != Projectile.owner || !Main.projectile[i].active || Main.projectile[i].ai[0] != ArmIndex) + if (!arms.Contains(p.type) || p.owner != Projectile.owner || p.ai[0] != ArmIndex) continue; armAlreadyExists = true; @@ -215,12 +215,12 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms if (ShouldDeleteArmIndex) { SoundEngine.PlaySound(SoundID.Item74, Projectile.Center); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (!arms.Contains(Main.projectile[i].type) || Main.projectile[i].owner != Projectile.owner || !Main.projectile[i].active || Main.projectile[i].ai[0] != ArmIndex) + if (!arms.Contains(p.type) || p.owner != Projectile.owner || p.ai[0] != ArmIndex) continue; - Main.projectile[i].Kill(); + p.Kill(); } } diff --git a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs index 566685e222..629640cdb5 100644 --- a/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs +++ b/Projectiles/Summon/SmallAresArms/MinionTeslaOrb.cs @@ -74,15 +74,15 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms public Projectile GetOrbToAttachTo() { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != Projectile.type || Main.projectile[i].ai[0] != Identity + 1f || !Main.projectile[i].active) + if (p.type != Projectile.type || p.ai[0] != Identity + 1f) continue; - if (!Main.projectile[i].WithinRange(Projectile.Center, AresExoskeleton.TeslaOrbDetatchDistance)) + if (!p.WithinRange(Projectile.Center, AresExoskeleton.TeslaOrbDetatchDistance)) continue; - return Main.projectile[i]; + return p; } return null; diff --git a/Projectiles/Summon/WhiteDragonBody.cs b/Projectiles/Summon/WhiteDragonBody.cs index 0e27f7d625..3ff567bfa6 100644 --- a/Projectiles/Summon/WhiteDragonBody.cs +++ b/Projectiles/Summon/WhiteDragonBody.cs @@ -61,10 +61,9 @@ namespace CalamityMod.Projectiles.Summon var live = false; Projectile nextSegment = new Projectile(); WhiteDragonHead head = new WhiteDragonHead(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == Type && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == Type && projectile.owner == Projectile.owner) { if (projectile.ModProjectile().segmentIndex == segmentIndex - 1) { @@ -72,7 +71,7 @@ namespace CalamityMod.Projectiles.Summon nextSegment = projectile; } } - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (segmentIndex == 1) { @@ -105,10 +104,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { projectile.Kill(); } diff --git a/Projectiles/Summon/WhiteDragonTail.cs b/Projectiles/Summon/WhiteDragonTail.cs index 0dbbdb3352..8a14b34937 100644 --- a/Projectiles/Summon/WhiteDragonTail.cs +++ b/Projectiles/Summon/WhiteDragonTail.cs @@ -51,10 +51,9 @@ namespace CalamityMod.Projectiles.Summon Projectile nextSegment = new Projectile(); WhiteDragonHead head = new WhiteDragonHead(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (projectile.ModProjectile().segmentIndex == segmentIndex - 1) { @@ -62,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon nextSegment = projectile; } } - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { if (segmentIndex == 1) { @@ -97,10 +96,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - var projectile = Main.projectile[i]; - if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner && projectile.active) + if (projectile.type == ModContent.ProjectileType() && projectile.owner == Projectile.owner) { projectile.Kill(); } diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 4418cf5779..a00ca3037b 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -32,10 +32,9 @@ namespace CalamityMod.Projectiles.Summon get { int minionCount = 1; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj.active && proj.owner == Owner.whoAmI && proj.type == Type && proj.whoAmI != Projectile.whoAmI) + if (proj.owner == Owner.whoAmI && proj.type == Type && proj.whoAmI != Projectile.whoAmI) { minionCount++; } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index bae63dcc0b..358683ba33 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -222,9 +222,9 @@ namespace CalamityMod.UI.CalamitasEnchants player.Calamity().bladeArmEnchant = true; bool armsArePresent = false; int armType = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type != armType || Main.projectile[i].owner != player.whoAmI || !Main.projectile[i].active) + if (p.type != armType || p.owner != player.whoAmI) continue; armsArePresent = true; diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 59af3caafa..2ba264abc0 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -474,12 +474,11 @@ namespace CalamityMod return; Projectile projectile = null; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - projectile = Main.projectile[i]; - if (Main.projectile[i].active && Main.projectile[i].bobber && Main.projectile[i].owner == playerIndex) + if (p.bobber && p.owner == playerIndex) { - projectile = Main.projectile[i]; + projectile = p; break; } } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 528ec0c0fb..e5178baf2d 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -22,10 +22,9 @@ namespace CalamityMod { // Efficiently loop through all projectiles, using a specially designed continue continue that attempts to minimize the amount of OR // checks per iteration. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.type != projectileID || !p.active) + if (p.type != projectileID) continue; return true; @@ -37,10 +36,9 @@ namespace CalamityMod public static IEnumerable AllProjectilesByID(int projectileID) { // This uses the same efficient loop idea as AnyProjectiles. - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p.type != projectileID || !p.active) + if (p.type != projectileID) continue; yield return p; @@ -71,12 +69,12 @@ namespace CalamityMod if (Main.netMode == NetmodeID.SinglePlayer) return Main.projectile[identity]; - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].identity != identity || Main.projectile[i].owner != ownerIndex || !Main.projectile[i].active) + if (p.identity != identity || p.owner != ownerIndex) continue; - return Main.projectile[i]; + return p; } return null; } @@ -530,13 +528,12 @@ namespace CalamityMod int existingTurrets = player.ownedProjectileCounts[Type]; if (existingTurrets > 0) { - for (int i = 0; i < Main.maxProjectiles; i++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[i].type == Type && - Main.projectile[i].owner == player.whoAmI && - Main.projectile[i].active) + if (p.type == Type && + p.owner == player.whoAmI) { - Main.projectile[i].Kill(); + p.Kill(); existingTurrets--; if (existingTurrets <= 0) break; diff --git a/Utilities/RicoshotUtils.cs b/Utilities/RicoshotUtils.cs index 390c58c4c0..33e84c4c35 100644 --- a/Utilities/RicoshotUtils.cs +++ b/Utilities/RicoshotUtils.cs @@ -32,10 +32,9 @@ namespace CalamityMod int count = 0; int id = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile p = Main.projectile[i]; - if (p is null || !p.active || p.owner != player.whoAmI) + if (p.owner != player.whoAmI) continue; if (p.type == id) ++count; @@ -98,10 +97,9 @@ namespace CalamityMod // Search for all nearby coins. // Coins do not necessarily have to be owned by the same player as the searching projectile! int coinID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (!proj.active || proj.ModProjectile is null || proj.type != coinID) + if (proj.ModProjectile is null || proj.type != coinID) continue; // Coins that have already been struck are ignored. @@ -173,10 +171,9 @@ namespace CalamityMod bool foundAnyBullseye = false; float closestBullseyeDistance = DaawnlightSpiritOrigin.RicoshotSearchDistance; int bullseyeID = ModContent.ProjectileType(); - for (int i = 0; i < Main.maxProjectiles; ++i) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[i]; - if (proj is null || !proj.active || proj.ModProjectile is null || proj.type != bullseyeID || proj.owner != theShot.owner) + if (proj.ModProjectile is null || proj.type != bullseyeID || proj.owner != theShot.owner) continue; // Do a distance check. From 1042ab2393153ff7753bea8feb447451d736eded Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 19:39:59 +0500 Subject: [PATCH 36/48] More npc iterators --- NPCs/CalamityGlobalNPC.cs | 5 ++-- NPCs/StormWeaver/StormWeaverHead.cs | 20 +++++++------- NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs | 18 ++++++------- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 27 +++++++++---------- .../Bosses/WallOfFleshAI.cs | 6 ++--- Projectiles/Melee/AmidiasWhirlpool.cs | 12 ++++----- Projectiles/Melee/MourningSkull.cs | 14 +++++----- Projectiles/Pets/LadShark.cs | 5 ++-- Projectiles/Rogue/RadiantExplosion.cs | 20 +++++++------- .../Rogue/ShatteredSunScorchedBlade.cs | 3 +-- Projectiles/Summon/CosmicEnergySpiral.cs | 8 +++--- Projectiles/Summon/DaedalusCrystal.cs | 10 +++---- Projectiles/Summon/DankCreeperMinion.cs | 10 +++---- Projectiles/Summon/ForbiddenCircletEater.cs | 3 +-- Projectiles/Summon/HermitCrabMinion.cs | 3 +-- Projectiles/Summon/Hive.cs | 5 ++-- Projectiles/Summon/PhantomGuy.cs | 3 +-- Projectiles/Summon/PinkButterfly.cs | 7 +++-- Projectiles/Summon/ProfanedEnergy.cs | 12 ++++----- Projectiles/Summon/SandElementalMinion.cs | 3 +-- Projectiles/Summon/VileFeederProjectile.cs | 3 +-- Projectiles/Typeless/DemonshadeRedDevil.cs | 3 +-- Scenes/MusicScenes/BaseMusicSceneEffect.cs | 8 ++---- 23 files changed, 93 insertions(+), 115 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index eda47898f4..443433a04f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4846,10 +4846,9 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC in Main.ActiveNPCs) { - NPC nPC = Main.npc[j]; - if (nPC.active && !nPC.buffImmune[BuffType()] && npc.Distance(nPC.Center) < 100f && !nPC.dontTakeDamage && nPC.lifeMax > 5 && !nPC.friendly && !nPC.townNPC) + if (!nPC.buffImmune[BuffType()] && npc.Distance(nPC.Center) < 100f && !nPC.dontTakeDamage && nPC.lifeMax > 5 && !nPC.friendly && !nPC.townNPC) nPC.AddBuff(BuffType(), 300); } } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 14a4949b6a..5b16e9aea5 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -292,13 +292,13 @@ namespace CalamityMod.NPCs.StormWeaver if ((double)NPC.position.Y < Main.topWorld + 16f) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].active && (Main.npc[j].type == ModContent.NPCType() - || Main.npc[j].type == ModContent.NPCType() - || Main.npc[j].type == ModContent.NPCType())) + if ((n.type == ModContent.NPCType() + || n.type == ModContent.NPCType() + || n.type == ModContent.NPCType())) { - Main.npc[j].active = false; + n.active = false; } } } @@ -306,13 +306,13 @@ namespace CalamityMod.NPCs.StormWeaver if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 10000f && NPC.life > 0) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].type == ModContent.NPCType() - || Main.npc[j].type == ModContent.NPCType() - || Main.npc[j].type == ModContent.NPCType()) + if (n.type == ModContent.NPCType() + || n.type == ModContent.NPCType() + || n.type == ModContent.NPCType()) { - Main.npc[j].active = false; + n.active = false; } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index 582442d7ef..49f4d90ce7 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -164,13 +164,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].active && Main.npc[j].type == NPCID.CultistBossClone && Main.npc[j].ai[3] == npc.whoAmI) + if (n.type == NPCID.CultistBossClone && n.ai[3] == npc.whoAmI) { - Main.npc[j].life = 0; - Main.npc[j].HitEffect(0, 10.0); - Main.npc[j].active = false; + n.life = 0; + n.HitEffect(0, 10.0); + n.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); @@ -568,10 +568,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if ((npc.ai[1] == 20f & isCultist) && Main.netMode != NetmodeID.MultiplayerClient) { List list5 = new List(); - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].active && Main.npc[j].type == NPCID.CultistBossClone && Main.npc[j].ai[3] == npc.whoAmI) - list5.Add(j); + if (n.type == NPCID.CultistBossClone && n.ai[3] == npc.whoAmI) + list5.Add(n.whoAmI); } foreach (int current5 in list5) @@ -825,7 +825,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses foreach (NPC n in Main.ActiveNPCs) { if (n.type == NPCID.CultistBossClone && n.ai[3] == npc.whoAmI) - list7.Add(i); + list7.Add(n.whoAmI); } foreach (int current6 in list7) diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 3bf3234916..04cdd9132e 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -1726,24 +1726,21 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Fly towards Moon Lord Head and stay away from other True Eyes float freeEyeAccel = 0.5f; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].active) + if (n.whoAmI != npc.whoAmI && n.type == npc.type) { - if (j != npc.whoAmI && Main.npc[j].type == npc.type) + if (Vector2.Distance(npc.Center, n.Center) < 150f) { - if (Vector2.Distance(npc.Center, Main.npc[j].Center) < 150f) - { - if (npc.position.X < Main.npc[j].position.X) - npc.velocity.X = npc.velocity.X - freeEyeAccel; - else - npc.velocity.X = npc.velocity.X + freeEyeAccel; - - if (npc.position.Y < Main.npc[j].position.Y) - npc.velocity.Y = npc.velocity.Y - freeEyeAccel; - else - npc.velocity.Y = npc.velocity.Y + freeEyeAccel; - } + if (npc.position.X < n.position.X) + npc.velocity.X = npc.velocity.X - freeEyeAccel; + else + npc.velocity.X = npc.velocity.X + freeEyeAccel; + + if (npc.position.Y < n.position.Y) + npc.velocity.Y = npc.velocity.Y - freeEyeAccel; + else + npc.velocity.Y = npc.velocity.Y + freeEyeAccel; } } } diff --git a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs index a904b3cf91..6cc4b85821 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs @@ -402,11 +402,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { int hungryAmt = 0; float[] array = new float[10]; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (hungryAmt < 10 && Main.npc[j].active && Main.npc[j].type == NPCID.TheHungry) + if (hungryAmt < 10 && n.type == NPCID.TheHungry) { - array[hungryAmt] = Main.npc[j].ai[0]; + array[hungryAmt] = n.ai[0]; hungryAmt++; } } diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index 1d14113510..2fd27aa019 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -68,7 +68,6 @@ namespace CalamityMod.Projectiles.Melee } else if (homeTracker == 1) { - int inc; Projectile.rotation -= 0.104719758f; Vector2 projCenter = Projectile.Center; float homingRange = 150f; @@ -76,21 +75,20 @@ namespace CalamityMod.Projectiles.Melee int npcTracker = 0; if (Projectile.ai[1] == 0f) { - for (int j = 0; j < Main.maxNPCs; j = inc + 1) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - Vector2 npcCenter = Main.npc[j].Center; - if (Projectile.Distance(npcCenter) < homingRange && Collision.CanHit(new Vector2(Projectile.position.X + (float)(Projectile.width / 2), Projectile.position.Y + (float)(Projectile.height / 2)), 1, 1, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + Vector2 npcCenter = n.Center; + if (Projectile.Distance(npcCenter) < homingRange && Collision.CanHit(new Vector2(Projectile.position.X + (float)(Projectile.width / 2), Projectile.position.Y + (float)(Projectile.height / 2)), 1, 1, n.position, n.width, n.height)) { homingRange = Projectile.Distance(npcCenter); projCenter = npcCenter; isHoming = true; - npcTracker = j; + npcTracker = n.whoAmI; break; } } - inc = j; } if (isHoming) { diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index 6f056934c1..308824f444 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -74,21 +74,19 @@ namespace CalamityMod.Projectiles.Melee else { float homingRange = 1000f; - int inc; - for (int j = 0; j < Main.maxNPCs; j = inc + 1) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float targetX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float targetY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float targetX = n.position.X + (float)(n.width / 2); + float targetY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - targetX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - targetY); - if (targetDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + if (targetDist < homingRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { homingRange = targetDist; - Projectile.ai[0] = (float)j; + Projectile.ai[0] = (float)n.whoAmI; } } - inc = j; } } diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index 0c086d5ec6..5549bba071 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -69,10 +69,9 @@ namespace CalamityMod.Projectiles.Pets SoundEngine.PlaySound(SoundID.Zombie15, Projectile.position); //mouse squeak sound float radius = 240f; // 15 blocks - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[j]; - if (npc.active && !npc.dontTakeDamage && Vector2.Distance(Projectile.Center, npc.Center) <= radius) + if (!npc.dontTakeDamage && Vector2.Distance(Projectile.Center, npc.Center) <= radius) { if (npc.Calamity().ladHearts <= 0) npc.Calamity().ladHearts = CalamityUtils.SecondsToFrames(9f); diff --git a/Projectiles/Rogue/RadiantExplosion.cs b/Projectiles/Rogue/RadiantExplosion.cs index eb5a206d36..90dd1a23ba 100644 --- a/Projectiles/Rogue/RadiantExplosion.cs +++ b/Projectiles/Rogue/RadiantExplosion.cs @@ -60,30 +60,30 @@ namespace CalamityMod.Projectiles.Rogue { float projX = Projectile.Center.X; float projY = Projectile.Center.Y; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[j].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + if (n.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) { - float npcCenterX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float npcCenterY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float npcCenterX = n.position.X + (float)(n.width / 2); + float npcCenterY = n.position.Y + (float)(n.height / 2); float targetDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); if (targetDist < 600f) { - if (Main.npc[j].position.X < projX) + if (n.position.X < projX) { - Main.npc[j].velocity.X += 0.25f; + n.velocity.X += 0.25f; } else { - Main.npc[j].velocity.X -= 0.25f; + n.velocity.X -= 0.25f; } - if (Main.npc[j].position.Y < projY) + if (n.position.Y < projY) { - Main.npc[j].velocity.Y += 0.25f; + n.velocity.Y += 0.25f; } else { - Main.npc[j].velocity.Y -= 0.25f; + n.velocity.Y -= 0.25f; } } } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 3f7f5fd760..3755f8669a 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -76,9 +76,8 @@ namespace CalamityMod.Projectiles.Rogue float targetDistStore; Vector2 homingPos = Projectile.position; bool isHoming = false; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index 1de027a696..e1ba5e3f27 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -179,12 +179,12 @@ namespace CalamityMod.Projectiles.Summon float projY = Projectile.position.Y; float homeDistance = 1200f; bool isInRange = false; - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float npcX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float npcY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); if (npcDistance < homeDistance) { diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index 7e43adef7d..aac2c3f685 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -111,14 +111,14 @@ namespace CalamityMod.Projectiles.Summon } if (!isInRange) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float otherNPCX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float otherNPCY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float otherNPCX = n.position.X + (float)(n.width / 2); + float otherNPCY = n.position.Y + (float)(n.height / 2); float otherNPCDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - otherNPCX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - otherNPCY); - if (otherNPCDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + if (otherNPCDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { attackRange = otherNPCDist; projX = otherNPCX; diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 07c506c085..7029149f40 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -103,14 +103,14 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float otherNPCX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float otherNPCY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float otherNPCX = n.position.X + (float)(n.width / 2); + float otherNPCY = n.position.Y + (float)(n.height / 2); float otherNPCDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - otherNPCX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - otherNPCY); - if (otherNPCDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + if (otherNPCDist < attackRange && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { attackRange = otherNPCDist; projX = otherNPCX; diff --git a/Projectiles/Summon/ForbiddenCircletEater.cs b/Projectiles/Summon/ForbiddenCircletEater.cs index 6263c0dca4..16dc09a5c1 100644 --- a/Projectiles/Summon/ForbiddenCircletEater.cs +++ b/Projectiles/Summon/ForbiddenCircletEater.cs @@ -89,9 +89,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[j]; if (npc.CanBeChasedBy(Projectile, false)) { float npcX = npc.position.X + (float)(npc.width / 2); diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index dff0a079d2..f454140c76 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -117,9 +117,8 @@ namespace CalamityMod.Projectiles.Summon } if (!chaseNPC) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC npcTarget in Main.ActiveNPCs) { - NPC npcTarget = Main.npc[j]; if (npcTarget.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(npcTarget.Center, Projectile.Center); diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index 609038c0ef..1dc594d2ef 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -69,9 +69,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); @@ -80,7 +79,7 @@ namespace CalamityMod.Projectiles.Summon attackDist = targetDist; projPos = nPC2.Center; canAttack = true; - target = j; + target = nPC2.whoAmI; } } } diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index bedbe64fb8..54c83ddaf7 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -90,9 +90,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 4fcfccd7bd..d948314f43 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -106,10 +106,9 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; - if ((nPC2.CanBeChasedBy(Projectile, false) || nPC2.type == NPCID.DukeFishron) && nPC2.active) + if (nPC2.CanBeChasedBy(Projectile, false) || nPC2.type == NPCID.DukeFishron) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); if (!canAttack && targetDist < attackRange) @@ -117,7 +116,7 @@ namespace CalamityMod.Projectiles.Summon attackRange = targetDist; projPos = nPC2.Center; canAttack = true; - targetIndex = j; + targetIndex = nPC2.whoAmI; } } } diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 723a7e324f..2b7628cd89 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -102,20 +102,20 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC n in Main.ActiveNPCs) { - if (Main.npc[j].CanBeChasedBy(Projectile, false)) + if (n.CanBeChasedBy(Projectile, false)) { - float npcX = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float npcY = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); + float npcX = n.position.X + (float)(n.width / 2); + float npcY = n.position.Y + (float)(n.height / 2); float npcDist = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcY); - if (npcDist < attackDistance && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + if (npcDist < attackDistance && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, n.position, n.width, n.height)) { attackDistance = npcDist; projX = npcX; projY = npcY; canAttack = true; - target = j; + target = n.whoAmI; } } } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index d8a45cdf7c..6880bae54f 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -106,9 +106,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack && !passive) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; if (nPC2.CanBeChasedBy(Projectile, false)) { float targetDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Projectiles/Summon/VileFeederProjectile.cs b/Projectiles/Summon/VileFeederProjectile.cs index bc93e881e2..d92563efc7 100644 --- a/Projectiles/Summon/VileFeederProjectile.cs +++ b/Projectiles/Summon/VileFeederProjectile.cs @@ -90,9 +90,8 @@ namespace CalamityMod.Projectiles.Summon } if (!canAttack) { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC npc in Main.ActiveNPCs) { - NPC npc = Main.npc[j]; if (npc.CanBeChasedBy(Projectile, false)) { float npcX = npc.position.X + (float)(npc.width / 2); diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs index 8d2b584ef3..5056300ba8 100644 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ b/Projectiles/Typeless/DemonshadeRedDevil.cs @@ -132,9 +132,8 @@ namespace CalamityMod.Projectiles.Typeless } else { - for (int j = 0; j < Main.maxNPCs; j++) + foreach (NPC nPC2 in Main.ActiveNPCs) { - NPC nPC2 = Main.npc[j]; if (nPC2.CanBeChasedBy(Projectile, false)) { float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center); diff --git a/Scenes/MusicScenes/BaseMusicSceneEffect.cs b/Scenes/MusicScenes/BaseMusicSceneEffect.cs index 03b7271f85..921411b0ae 100644 --- a/Scenes/MusicScenes/BaseMusicSceneEffect.cs +++ b/Scenes/MusicScenes/BaseMusicSceneEffect.cs @@ -71,12 +71,8 @@ namespace CalamityMod.Systems Rectangle screenRect = new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); int musicDistance = MusicDistance * 2; - for (int j = 0; j < Main.maxNPCs; j++) - { - NPC npc = Main.npc[j]; - if (!npc.active) - continue; - + foreach (NPC npc in Main.ActiveNPCs) + { bool inList = false; if (npc.type == NPCType) { From 3227606723664d14d643c461770c62a313bcae7a Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 19:40:55 +0500 Subject: [PATCH 37/48] Item iterator --- CalPlayer/CalamityPlayerMiscEffects.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c1be6e8b04..f5acf6e2d9 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1864,10 +1864,9 @@ namespace CalamityMod.CalPlayer // Ceaseless Hunger Potion buff if (ceaselessHunger) { - for (int j = 0; j < Main.maxItems; j++) + foreach (Item item in Main.ActiveItems) { - Item item = Main.item[j]; - if (item.active && item.noGrabDelay == 0 && item.playerIndexTheItemIsReservedFor == Player.whoAmI) + if (item.noGrabDelay == 0 && item.playerIndexTheItemIsReservedFor == Player.whoAmI) { item.beingGrabbed = true; if (Player.Center.X > item.Center.X) From c667616b69cc79763acdcce657fa2d8162379c40 Mon Sep 17 00:00:00 2001 From: BasicallyIAmFox <65787578+BasicallyIAmFox@users.noreply.github.com> Date: Wed, 8 May 2024 19:44:49 +0500 Subject: [PATCH 38/48] More proj iterators --- Items/Weapons/Summon/AbandonedSlimeStaff.cs | 5 ++- NPCs/CalamityGlobalNPC.cs | 35 +++++++++---------- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 14 ++++---- Projectiles/Boss/FlareBomb.cs | 27 +++++++------- Projectiles/Melee/WhiteBoltAura.cs | 12 +++---- Projectiles/Summon/BabyBloodCrawler.cs | 5 ++- 6 files changed, 45 insertions(+), 53 deletions(-) diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index ef5fe4c6ab..e70213af12 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Weapons.Summon player.jumpSpeedBoost += 0.5f; double minionCount = 0; - for (int j = 0; j < Main.projectile.Length; j++) + foreach (Projectile projectile in Main.ActiveProjectiles) { - Projectile projectile = Main.projectile[j]; - if (projectile.active && projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType()) + if (projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType()) { minionCount += projectile.minionSlots; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 443433a04f..f6ee79b786 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -588,11 +588,10 @@ namespace CalamityMod.NPCs npc.lifeRegen = 0; int projectileCount = 0; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && - (Main.projectile[j].type == ProjectileType() || Main.projectile[j].type == ProjectileType() || Main.projectile[j].type == ProjectileType()) && - Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) + if ((p.type == ProjectileType() || p.type == ProjectileType() || p.type == ProjectileType()) && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { projectileCount++; } @@ -613,10 +612,10 @@ namespace CalamityMod.NPCs npc.lifeRegen = 0; int projectileCount = 0; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && Main.projectile[j].type == ProjectileType() && - Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) + if (p.type == ProjectileType() && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { projectileCount++; } @@ -635,12 +634,12 @@ namespace CalamityMod.NPCs { int projectileCount = 0; int owner = 255; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && Main.projectile[j].type == ProjectileType() && - Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) + if (p.type == ProjectileType() && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { - owner = Main.projectile[j].owner; + owner = p.owner; projectileCount++; if (projectileCount >= 5) { @@ -677,13 +676,13 @@ namespace CalamityMod.NPCs if (clamDebuff > 0) { int projectileCount = 0; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) + if (p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { - if (Main.projectile[j].type == ProjectileType()) + if (p.type == ProjectileType()) projectileCount += 2; - if (Main.projectile[j].type == ProjectileType()) + if (p.type == ProjectileType()) projectileCount++; } } @@ -694,10 +693,10 @@ namespace CalamityMod.NPCs if (irradiated > 0) { int projectileCount = 0; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && Main.projectile[j].type == ProjectileType() && - Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) + if (p.type == ProjectileType() && + p.ai[0] == 1f && p.ai[1] == npc.whoAmI) { projectileCount++; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index 04cdd9132e..6880b1b798 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -472,16 +472,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[1] == 40f) { - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile projectile2 in Main.ActiveProjectiles) { - Projectile projectile2 = Main.projectile[j]; - if (projectile2.active && (projectile2.type == ProjectileID.MoonLeech || projectile2.type == ProjectileID.PhantasmalBolt || + if ((projectile2.type == ProjectileID.MoonLeech || projectile2.type == ProjectileID.PhantasmalBolt || projectile2.type == ProjectileID.PhantasmalDeathray || projectile2.type == ProjectileID.PhantasmalEye || projectile2.type == ProjectileID.PhantasmalSphere)) { projectile2.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, j, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, projectile2.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -851,16 +850,15 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if ((attackTimer == 120f || attackTimer == 150f || attackTimer == 180f || attackTimer == 210f || attackTimer == 240f) && Main.netMode != NetmodeID.MultiplayerClient) { - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile projectile6 in Main.ActiveProjectiles) { - Projectile projectile6 = Main.projectile[j]; - if (projectile6.active && projectile6.type == ProjectileID.MoonLeech && Main.player[(int)projectile6.ai[1]].FindBuffIndex(BuffID.MoonLeech) != -1) + if (projectile6.type == ProjectileID.MoonLeech && Main.player[(int)projectile6.ai[1]].FindBuffIndex(BuffID.MoonLeech) != -1) { Vector2 targetCenter = Main.player[npc.target].Center; int moonLeech = NPC.NewNPC(npc.GetSource_FromAI(), (int)targetCenter.X, (int)targetCenter.Y, NPCID.MoonLordLeechBlob); Main.npc[moonLeech].netUpdate = true; Main.npc[moonLeech].ai[0] = npc.whoAmI + 1; - Main.npc[moonLeech].ai[1] = j; + Main.npc[moonLeech].ai[1] = projectile6.whoAmI; } } } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 78ea47fe01..c60376c6d7 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -80,24 +80,21 @@ namespace CalamityMod.Projectiles.Boss return; float acceleration = 0.5f; - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active) + if (p.whoAmI != Projectile.whoAmI && p.type == Projectile.type) { - if (j != Projectile.whoAmI && Main.projectile[j].type == Projectile.type) + if (Vector2.Distance(Projectile.Center, p.Center) < 24f) { - if (Vector2.Distance(Projectile.Center, Main.projectile[j].Center) < 24f) - { - if (Projectile.position.X < Main.projectile[j].position.X) - Projectile.velocity.X -= acceleration; - else - Projectile.velocity.X += acceleration; - - if (Projectile.position.Y < Main.projectile[j].position.Y) - Projectile.velocity.Y -= acceleration; - else - Projectile.velocity.Y += acceleration; - } + if (Projectile.position.X < p.position.X) + Projectile.velocity.X -= acceleration; + else + Projectile.velocity.X += acceleration; + + if (Projectile.position.Y < p.position.Y) + Projectile.velocity.Y -= acceleration; + else + Projectile.velocity.Y += acceleration; } } } diff --git a/Projectiles/Melee/WhiteBoltAura.cs b/Projectiles/Melee/WhiteBoltAura.cs index 195648c6bc..d361a79873 100644 --- a/Projectiles/Melee/WhiteBoltAura.cs +++ b/Projectiles/Melee/WhiteBoltAura.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -51,15 +51,15 @@ namespace CalamityMod.Projectiles.Melee int incTracker = 0; float aiTracker = 0f; int theProjectile = Projectile.type; - for (int j = 0; j < 1000; j++) + foreach (Projectile p in Main.ActiveProjectiles) { - if (Main.projectile[j].active && Main.projectile[j].owner == Projectile.owner && Main.projectile[j].type == theProjectile && Main.projectile[j].ai[1] < 3600f) + if (p.owner == Projectile.owner && p.type == theProjectile && p.ai[1] < 3600f) { projTimer++; - if (Main.projectile[j].ai[1] > aiTracker) + if (p.ai[1] > aiTracker) { - incTracker = j; - aiTracker = Main.projectile[j].ai[1]; + incTracker = p.whoAmI; + aiTracker = p.ai[1]; } } } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index 93babecfea..9b14867e46 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -48,11 +48,10 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - for (int j = 0; j < Main.maxProjectiles; j++) + foreach (Projectile proj in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[j]; // Short circuits to make the loop as fast as possible - if (!proj.active || proj.owner != Projectile.owner || !proj.minion || proj.Calamity().lineColor != 1) + if (proj.owner != Projectile.owner || !proj.minion || proj.Calamity().lineColor != 1) continue; if (proj.type == Projectile.type) { From 94ff1ee0d24ca07fea31cdef6cf6c81acb2c358e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 13 May 2024 16:47:13 -0400 Subject: [PATCH 39/48] Umcumbering Stone also has no sell value --- Items/CalamityGlobalItemTweaks.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 877fc5ffeb..4b73cceaba 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -601,6 +601,7 @@ namespace CalamityMod.Items { ItemID.SpicyPepper, Do(Value(Item.sellPrice(copper: 40))) }, { ItemID.Starfruit, Do(Value(Item.sellPrice(copper: 40))) }, { ItemID.PortableStool, Do(Value(Item.sellPrice(copper: 20))) }, // Step Stool + { ItemID.UncumberingStone, Do(Worthless) }, { ItemID.ViciousMushroom, Do(Worthless) }, { ItemID.VileMushroom, Do(Worthless) }, #endregion From adf6c847b0ddfb0b5237ba2bd119f42776228e57 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 13 May 2024 14:35:28 -0700 Subject: [PATCH 40/48] Moved Depth Crusher from Morays to Viperfish Mostly so you can't get it by just going to the ocean --- NPCs/Abyss/MorayEel.cs | 1 - NPCs/Abyss/Viperfish.cs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 35c2d095df..7da581930d 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -118,7 +118,6 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.Flipper, 20); - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 15, 10)); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index f774286a91..c81ad502c2 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -3,6 +3,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -10,6 +11,7 @@ using ReLogic.Content; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -158,6 +160,7 @@ namespace CalamityMod.NPCs.Abyss var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); postLevi.Add(ModContent.ItemType(), 4); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); } public override void HitEffect(NPC.HitInfo hit) From de2bb4a48326b48e5e40d239f10a34c1d813450b Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 13 May 2024 18:00:42 -0400 Subject: [PATCH 41/48] Cluster Rocket fragments grant ID-static iframes --- Projectiles/CalamityGlobalProjectileTweaks.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 658c5faae7..916a1412a8 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -133,9 +133,9 @@ namespace CalamityMod.Projectiles { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) }, { ProjectileID.CursedBullet, standardBulletTweaks }, { ProjectileID.ClusterRocketI, Do(LocalIFrames(15)) }, - { ProjectileID.ClusterFragmentsI, Do(LocalIFrames(15)) }, + { ProjectileID.ClusterFragmentsI, Do(IDStaticIFrames(15)) }, { ProjectileID.ClusterRocketII, Do(LocalIFrames(15)) }, - { ProjectileID.ClusterFragmentsII, Do(LocalIFrames(15)) }, + { ProjectileID.ClusterFragmentsII, Do(IDStaticIFrames(15)) }, { ProjectileID.ClusterSnowmanRocketI, Do(LocalIFrames(15)) }, { ProjectileID.ClusterSnowmanRocketII, Do(LocalIFrames(15)) }, { ProjectileID.DD2SquireSonicBoom, Do(PiercingExact(3)) }, // Flying Dragon From 1bb44ca194ebb2b1cf00fb22db588fc7ccf12d0f Mon Sep 17 00:00:00 2001 From: Lion8cake <69915693+Lion8cake@users.noreply.github.com> Date: Tue, 14 May 2024 08:01:59 +1000 Subject: [PATCH 42/48] Astral infection biome code overhaul (#28) Omitting gigantic messy co-authoring list due to the 1.4.4 force push. --- Backgrounds/AstralDesertSurfaceBGStyle.cs | 108 +++++++++-- Backgrounds/AstralDesertSurfaceFar.png | Bin 18650 -> 23663 bytes Backgrounds/AstralSnowSurfaceBGStyle.cs | 129 ++++++++++++- Backgrounds/AstralSnowSurfaceFar.png | Bin 18650 -> 0 bytes Backgrounds/AstralSnowSurfaceMiddle.png | Bin 13227 -> 8694 bytes Backgrounds/AstralSurfaceBGStyle.cs | 139 ++++++++++++-- Backgrounds/AstralSurfaceClose.png | Bin 64249 -> 27708 bytes .../AstralSurfaceCloseGlow.png | Bin Backgrounds/AstralSurfaceFar.png | Bin 18650 -> 23728 bytes Backgrounds/AstralSurfaceFogBGStyle.cs | 37 ---- Backgrounds/AstralSurfaceFront.png | Bin 0 -> 57227 bytes .../AstralSurfaceFrontGlow.png | Bin Backgrounds/AstralSurfaceHorizon.png | Bin 0 -> 3527 bytes Backgrounds/AstralSurfaceMiddle.png | Bin 22833 -> 20405 bytes .../AstralSurfaceMiddleGlow.png | Bin Backgrounds/AstralUG4_0.png | Bin 0 -> 1922 bytes Backgrounds/AstralUG4_1.png | Bin 0 -> 1751 bytes Backgrounds/AstralUG4_2.png | Bin 0 -> 1652 bytes Backgrounds/AstralUndergroundBGStyle.cs | 7 +- BiomeManagers/AbovegroundAstralBiome.cs | 34 ---- .../AbovegroundAstralBiomeSurface.cs | 41 ---- BiomeManagers/AbovegroundAstralDesertBiome.cs | 43 ----- BiomeManagers/AbovegroundAstralSnowBiome.cs | 41 ---- BiomeManagers/AstralInfectionBiome.cs | 94 +++++++++ .../{ => BestiaryCategories}/AcidRainBiome.cs | 0 .../BestiaryCategories/AstralCaveDesert.cs | 11 ++ .../BestiaryCategories/AstralDesert.cs | 11 ++ BiomeManagers/BestiaryCategories/AstralIce.cs | 11 ++ .../BestiaryCategories/AstralUnderground.cs | 11 ++ BiomeManagers/UndergroundAstralBiome.cs | 33 ---- CalPlayer/CalamityPlayer.cs | 5 +- CalamityMod.cs | 32 ++-- ILEditing/ILHelperMethods.cs | 2 +- Items/Weapons/Melee/CosmicShiv.cs | 2 +- .../en-US/Mods.CalamityMod.Biomes.hjson | 34 ++-- ModSupport/WeakReferenceSupport.cs | 1 + NPCs/Astral/Aries.cs | 2 +- NPCs/Astral/AstralProbe.cs | 2 +- NPCs/Astral/AstralSlime.cs | 2 +- NPCs/Astral/AstralachneaWall.cs | 3 +- NPCs/Astral/Atlas.cs | 2 +- NPCs/Astral/FusionFeeder.cs | 3 +- NPCs/Astral/Hadarian.cs | 3 +- NPCs/Astral/HiveEnemy.cs | 3 +- NPCs/Astral/Hiveling.cs | 3 +- NPCs/Astral/Mantis.cs | 2 +- NPCs/Astral/Nova.cs | 2 +- NPCs/Astral/SightseerCollider.cs | 2 +- NPCs/Astral/SightseerSpitter.cs | 2 +- NPCs/Astral/StellarCulex.cs | 3 +- NPCs/Astral/Twinkler.cs | 2 +- NPCs/AstrumAureus/AstrumAureus.cs | 4 +- NPCs/AstrumDeus/AstrumDeusHead.cs | 2 +- NPCs/TownNPCs/AndroombaFriendly.cs | 4 +- Projectiles/Magic/ExoVortex.cs | 1 + Projectiles/Magic/ExoVortex2.cs | 1 + Projectiles/Melee/CosmicShivAura.cs | 19 +- Projectiles/Melee/CosmicShivBlade.cs | 17 +- Projectiles/Melee/CosmicShivTrail.cs | 44 +++++ Projectiles/Melee/EonBolt.cs | 1 + .../Melee/Shortswords/CosmicShivProj.cs | 10 +- Skies/AstralDesertSurfaceClose.png | Bin 5031 -> 0 bytes Skies/AstralDesertSurfaceFar.png | Bin 18650 -> 0 bytes Skies/AstralDesertSurfaceMiddle.png | Bin 5402 -> 0 bytes Skies/AstralSky.cs | 1 + Skies/AstralSkyDesert.cs | 137 -------------- Skies/AstralSkySnow.cs | 171 ----------------- Skies/AstralSkySurface.cs | 179 ------------------ Skies/AstralSnowSurfaceMiddle.png | Bin 8694 -> 0 bytes Skies/AstralSurfaceClose.png | Bin 27708 -> 0 bytes Skies/AstralSurfaceFar.png | Bin 13320 -> 0 bytes Skies/AstralSurfaceFront.png | Bin 40727 -> 0 bytes Skies/AstralSurfaceHorizon.png | Bin 3772 -> 0 bytes Skies/AstralSurfaceMiddle.png | Bin 20405 -> 0 bytes .../CodebreakerUI.Communication.cs | 1 + 75 files changed, 631 insertions(+), 823 deletions(-) delete mode 100644 Backgrounds/AstralSnowSurfaceFar.png rename {Skies => Backgrounds}/AstralSurfaceCloseGlow.png (100%) delete mode 100644 Backgrounds/AstralSurfaceFogBGStyle.cs create mode 100644 Backgrounds/AstralSurfaceFront.png rename {Skies => Backgrounds}/AstralSurfaceFrontGlow.png (100%) create mode 100644 Backgrounds/AstralSurfaceHorizon.png rename {Skies => Backgrounds}/AstralSurfaceMiddleGlow.png (100%) create mode 100644 Backgrounds/AstralUG4_0.png create mode 100644 Backgrounds/AstralUG4_1.png create mode 100644 Backgrounds/AstralUG4_2.png delete mode 100644 BiomeManagers/AbovegroundAstralBiome.cs delete mode 100644 BiomeManagers/AbovegroundAstralBiomeSurface.cs delete mode 100644 BiomeManagers/AbovegroundAstralDesertBiome.cs delete mode 100644 BiomeManagers/AbovegroundAstralSnowBiome.cs create mode 100644 BiomeManagers/AstralInfectionBiome.cs rename BiomeManagers/{ => BestiaryCategories}/AcidRainBiome.cs (100%) create mode 100644 BiomeManagers/BestiaryCategories/AstralCaveDesert.cs create mode 100644 BiomeManagers/BestiaryCategories/AstralDesert.cs create mode 100644 BiomeManagers/BestiaryCategories/AstralIce.cs create mode 100644 BiomeManagers/BestiaryCategories/AstralUnderground.cs delete mode 100644 BiomeManagers/UndergroundAstralBiome.cs delete mode 100644 Skies/AstralDesertSurfaceClose.png delete mode 100644 Skies/AstralDesertSurfaceFar.png delete mode 100644 Skies/AstralDesertSurfaceMiddle.png delete mode 100644 Skies/AstralSkyDesert.cs delete mode 100644 Skies/AstralSkySnow.cs delete mode 100644 Skies/AstralSkySurface.cs delete mode 100644 Skies/AstralSnowSurfaceMiddle.png delete mode 100644 Skies/AstralSurfaceClose.png delete mode 100644 Skies/AstralSurfaceFar.png delete mode 100644 Skies/AstralSurfaceFront.png delete mode 100644 Skies/AstralSurfaceHorizon.png delete mode 100644 Skies/AstralSurfaceMiddle.png diff --git a/Backgrounds/AstralDesertSurfaceBGStyle.cs b/Backgrounds/AstralDesertSurfaceBGStyle.cs index 51d1c01ef7..181f0d7222 100644 --- a/Backgrounds/AstralDesertSurfaceBGStyle.cs +++ b/Backgrounds/AstralDesertSurfaceBGStyle.cs @@ -1,22 +1,23 @@ -using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using System.Reflection; +using System; +using Terraria.Graphics.Effects; +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; namespace CalamityMod.Backgrounds { public class AstralDesertSurfaceBGStyle : ModSurfaceBackgroundStyle { - public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) - { - b -= 75f; - return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - } + internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic); + readonly int CloseBGYOffset = 475; + readonly int MiddleBGYOffset = 475; public override void ModifyFarFades(float[] fades, float transitionSpeed) { - // This just fades in the background and fades out other backgrounds. for (int i = 0; i < fades.Length; i++) { if (i == Slot) @@ -33,5 +34,90 @@ namespace CalamityMod.Backgrounds } } } + + public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon"); + + public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralDesertSurfaceFar"); + + public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralDesertSurfaceMiddle"); + + public override bool PreDrawCloseBackground(SpriteBatch spriteBatch) + { + //Please see AstralSurfaceBGStyle for comments, code is pretty much identical here + float screenOff = (float)screenOffField.GetValue(Main.instance); + float scAdj = (float)scAdjField.GetValue(Main.instance); + Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null); + Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A); + bool canBGDraw = false; + if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen)) + canBGDraw = true; + if (Main.mapFullscreen) + canBGDraw = false; + int offset = 30; + if (Main.gameMenu) + offset = 0; + if (WorldGen.drunkWorldGen) + offset = -180; + float surfacePosition = (float)Main.worldSurface; + if (surfacePosition == 0f) + surfacePosition = 1f; + float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f; + double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f); + float bgGlobalScaleMultiplier = 2f; + int pushBGTopHack; + int offset2 = -180; + int menuOffset = 0; + if (Main.gameMenu) + { + menuOffset -= offset2; + } + pushBGTopHack = menuOffset; + pushBGTopHack += offset; + pushBGTopHack += offset2; + if (canBGDraw) + { + var bgScale = 1.25f; + var bgParallax = 0.4; + var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + var bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceMiddle.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); + var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + bgTopY = 320 + pushBGTopHack; + + var bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceMiddle.Width, CalamityMod.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + + bgScale = 1.31f; + bgParallax = 0.43; + bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceClose.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); + bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + { + bgTopY = 400 + pushBGTopHack; + bgStartX -= 80; + } + + bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceClose.Width, CalamityMod.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + } + return false; + } } } diff --git a/Backgrounds/AstralDesertSurfaceFar.png b/Backgrounds/AstralDesertSurfaceFar.png index a2337a7d8fe1277ad1b4e44d3e8beb1282f81fbf..e8b7a01e29f2aeb0dfd2b9844e69460b67f7048d 100644 GIT binary patch literal 23663 zcmeFYcT`hb^gnn}pQtEUo`tTWq9P(fDAFuXP!Uj2dJ&?uNR0#`gkV9W3rKJJ01+u6 zLV(bMltfBEYJh|wEeIi@h7i&w?>l9!->g~l-~2aOE6Kh0oPDxC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`TW2eYqM8Y+^Zit%{`XY4DDGfD6rMS^BoyyAyNq(U>su0g%WHfZahN< z*DZ%z-{>jKNy~>0x>mSjOL@b(R*-W@tbIHg2N!1|cnN?N@cdpz<{mUpvptGgZ~~g- z4|{OEG||){cuINJN+j0qJ3N+{RR3G$=`S7b!0q;NJE5x|b=gP41(qH(e5#jbcYtWe z_TNsRGXE%O+E`?qsm*(Y6^B2=6=#CdmK{c?apPQn0>BWR$iF@%v+yMr06!{mLRaawl%0HlyDw7{Z~HI8{d2G3)tUD z`wrl^!KN`%bj7Cqwec1#TZ@{cec6Eu6ntvXIl$Kd%fx4$1d4k;g&#{9q4;zj8bqkj46i zAM%d<{lpB}BW&ve0;EGc1%V}CJ{P*>g4alDa|6Tu*ll7V|8IK@bisVS?~zM# zIKD4=`+=t&F0sRAgF(=<-f3{=9Cq~zE=I}o@-BwfzrG+7mYn4_5mGJFMa=$P0=)vvGPaD_cSbd z`WYy1{o~U-=e4PVK*!kc+m#-e8)*Y%8bg>uK&Co`$putvR8xF@;k8XNz+kcdaQ19X zd8hfJ%bT`FVdQ I&MBb@08L}L*Z=?k diff --git a/Backgrounds/AstralSnowSurfaceBGStyle.cs b/Backgrounds/AstralSnowSurfaceBGStyle.cs index 993decd710..239fc427b3 100644 --- a/Backgrounds/AstralSnowSurfaceBGStyle.cs +++ b/Backgrounds/AstralSnowSurfaceBGStyle.cs @@ -1,18 +1,25 @@ -using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using System.Reflection; +using System; +using Terraria.Graphics.Effects; +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Terraria.GameContent.UI.States; namespace CalamityMod.Backgrounds { public class AstralSnowSurfaceBGStyle : ModSurfaceBackgroundStyle { - public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); + internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic); + readonly int FrontBGYOffset = 275; + readonly int CloseBGYOffset = 175; + readonly int MiddleBGYOffset = 475; public override void ModifyFarFades(float[] fades, float transitionSpeed) { - // This just fades in the background and fades out other backgrounds. for (int i = 0; i < fades.Length; i++) { if (i == Slot) @@ -29,5 +36,113 @@ namespace CalamityMod.Backgrounds } } } + + public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon"); + + public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceFar"); + + public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralSnowSurfaceMiddle"); + + public override bool PreDrawCloseBackground(SpriteBatch spriteBatch) + { + //Please see AstralSurfaceBGStyle for comments, code is pretty much identical here + float screenOff = (float)screenOffField.GetValue(Main.instance); + float scAdj = (float)scAdjField.GetValue(Main.instance); + Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null); + Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A); + bool canBGDraw = false; + if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen)) + canBGDraw = true; + if (Main.mapFullscreen) + canBGDraw = false; + int offset = 30; + if (Main.gameMenu) + offset = 0; + if (WorldGen.drunkWorldGen) + offset = -180; + float surfacePosition = (float)Main.worldSurface; + if (surfacePosition == 0f) + surfacePosition = 1f; + float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f; + double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f); + float bgGlobalScaleMultiplier = 2f; + int pushBGTopHack; + int offset2 = -180; + int menuOffset = 0; + if (Main.gameMenu) + { + menuOffset -= offset2; + } + pushBGTopHack = menuOffset; + pushBGTopHack += offset; + pushBGTopHack += offset2; + if (canBGDraw) + { + var bgScale = 1.25f; + var bgParallax = 0.4; + var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + var bgWidthScaled = (int)((float)CalamityMod.AstralSnowSurfaceMiddle.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); + var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + bgTopY = 320 + pushBGTopHack; + + var bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSnowSurfaceMiddle.Width, CalamityMod.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + + bgScale = 1.31f; + bgParallax = 0.43; + bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); + bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + { + bgTopY = 400 + pushBGTopHack; + bgStartX -= 80; + } + + bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + bgScale = 1.34f; + bgParallax = 0.49; + bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); + bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + { + bgTopY = 480 + pushBGTopHack; + bgStartX -= 120; + } + + bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + } + return false; + } } } diff --git a/Backgrounds/AstralSnowSurfaceFar.png b/Backgrounds/AstralSnowSurfaceFar.png deleted file mode 100644 index e1b3614aa86a9a103056872c4bb968565f3b87b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18650 zcmeFY19x3v)F6Cf-`KXT#__|Ad!NlHRb?3zL;^$r08r#)CDj1{8vF=R4-W;tg_opFfN#(?VoG8FP@91C zVg>^MP=KnUrWE)+CMqK-0T%X@Pytj7~KJ(pbZPt8PhWCk)X&N=nF}~pq@c;~?%TS&nr~mZr34v;b z%`Qg_dFqtRw`j7zHG+Z|uWESjVe*e{R=BBj^J*UUSmMu;eV16Optkv+ilJP5&VHXE zsxzsq04p)cO1*8K;I(BSbYXjsSddyD=JlMAk@GW!I}Q)7QLmDM@lZKjAKyhF5&$_I zU8hS-C7DOP$-{F@{IeIlc8Uc3t9CQWy%z#KC6X97D(Rn6o)$wS9ly1}8{poP6A*M+ zhS%$oT2${|<-sW4S{gC_yIiExj(7_E3Kcvgo+9KC-(*cnORZ_hl{|iQs>6h68m{pw z7P2G;bP|V%cB7E|R1Pi^wNh*U0X$pPp^|$J*ELfKTMz@diDg8;{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vbPeRY;$T#51T&x{0#rbxOiQ8wvWUJjFG!O{)6xm zymvt=egvG`gpZQkY|XbG8qI#GGXiG__ER6R&mus;YsI`rI@kCuLO5ce3#CvBg-FH} zCFsL0Vw-*vTQJxFoZU` diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index 8c8a7ee21c..c89092d701 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -1,22 +1,24 @@ -using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using System.Reflection; +using System; +using Terraria.Graphics.Effects; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Backgrounds { public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle { - public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) - { - scale *= 0.75f; - return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - } + internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo scAdjField = typeof(Main).GetField("scAdj", BindingFlags.Instance | BindingFlags.NonPublic); + internal static readonly FieldInfo COSBMAplhaField = typeof(Main).GetField("ColorOfSurfaceBackgroundsModified", BindingFlags.Static | BindingFlags.NonPublic); + readonly int FrontBGYOffset = 275; //Offsets for the height positioning. Make these 0 for backgrounds that want to be the same as treeline backgrounds (backgrounds that have the front 3 layers as trees) + readonly int CloseBGYOffset = 175; + readonly int MiddleBGYOffset = 475; public override void ModifyFarFades(float[] fades, float transitionSpeed) { - // This just fades in the background and fades out other backgrounds. for (int i = 0; i < fades.Length; i++) { if (i == Slot) @@ -33,5 +35,120 @@ namespace CalamityMod.Backgrounds } } } + + public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceHorizon"); //5th layer (Horizon) + + public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralSurfaceFar"); //4th layer (Far) + + public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Skies/AstralSurfaceMiddle"); //Fallback texture, not nessesarily needed since predraw returns false + + public override bool PreDrawCloseBackground(SpriteBatch spriteBatch) //Taken from vanilla to draw the front 3 layers, edited to fit tmod and astral background needs + { + float screenOff = (float)screenOffField.GetValue(Main.instance); + float scAdj = (float)scAdjField.GetValue(Main.instance); + Color COSBMAplha = (Color)COSBMAplhaField.GetValue(null); + Color ColorOfSurfaceBackgroundsModified = new Color(63, 51, 90, COSBMAplha.A); //Astral Biome Coloration with the alpha as the background fade + bool canBGDraw = false; + if ((!Main.remixWorld || (Main.gameMenu && !WorldGen.remixWorldGen)) && (!WorldGen.remixWorldGen || !WorldGen.drunkWorldGen)) + canBGDraw = true; + if (Main.mapFullscreen) + canBGDraw = false; + int offset = 30; + if (Main.gameMenu) + offset = 0; + if (WorldGen.drunkWorldGen) + offset = -180; + float surfacePosition = (float)Main.worldSurface; + if (surfacePosition == 0f) + surfacePosition = 1f; + float screenPosition = Main.screenPosition.Y + (float)(Main.screenHeight / 2) - 600f; + double backgroundTopMagicNumber = (0f - screenPosition + screenOff / 2f) / (surfacePosition * 16f); + float bgGlobalScaleMultiplier = 2f; + int pushBGTopHack; + int offset2 = -180; + int menuOffset = 0; + if (Main.gameMenu) + { + menuOffset -= offset2; + } + pushBGTopHack = menuOffset; + pushBGTopHack += offset; + pushBGTopHack += offset2; //Offsets to the background placement + if (canBGDraw) //If the background can draw (player is not in a remix world or is not in a map). This can probably be removed since backgrounds already go through these checks + { + //3rd layer (Middle) + var bgScale = 1.25f; //Scale of the furthest of the closest background layers (3rd layer) + var bgParallax = 0.4; //The parallax of the background layer + var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; //the Y position of the background + bgScale *= bgGlobalScaleMultiplier; //Scale of the background + var bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); + var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer + if (Main.gameMenu) + bgTopY = 320 + pushBGTopHack; //increases the height in the main menu + + var bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + //Draw the texture and its glowmask to each loop of the texture + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddle.Width, CalamityMod.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddleGlow.Width, CalamityMod.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + + //2nd layer (Close) + //Repeat of above with slight changes to variables + bgScale = 1.31f; + bgParallax = 0.43; + bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); + bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + { + bgTopY = 400 + pushBGTopHack; + bgStartX -= 80; //the initial postion of where the background starts in the main menu is pushed back to not be directly ontop, mostly for tree bgs that use the same treeline texture but faded + } + + bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + + //1st layer (Front) + //Repeat of above with slight changes to variables + bgScale = 1.34f; + bgParallax = 0.49; + bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; + bgScale *= bgGlobalScaleMultiplier; + bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); + bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); + if (Main.gameMenu) + { + bgTopY = 480 + pushBGTopHack; + bgStartX -= 120; + } + + bgLoops = Main.screenWidth / bgWidthScaled + 2; + if ((double)Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int i = 0; i < bgLoops; i++) + { + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + } + } + } + return false; //Stop the drawing of the base close background texture (note: does NOT stop the drawing of the Middle and Far textures because tmodloader is slight stupid :blushing:) + } } } diff --git a/Backgrounds/AstralSurfaceClose.png b/Backgrounds/AstralSurfaceClose.png index 6701b9a71cdf85c534cec38eca82370ac83b92ad..166e8bc48d327d5ec4d54eeb09ab539a6da6b2f1 100644 GIT binary patch literal 27708 zcmeFZXIN8N*fzQnibzpZiUfT9Cpp%+I5=}H%b#BnTx3Nk9_P!$kV znnLK9j1IyKB~nbJ1_40~5D-WLDf>KezH_eguL9MKlkEy$DeH# zWY@_egcJ_j9dJTO628UP%SgkQOO0(+@MZZ$JJ)c8Di2I)0&e`W1RB4yZ$&7wp(R0kv+(7w! z$G3_UWXJRl?HIQG4~)GSLKA=tQ;`b*bg+u@b#J$Tq8wsbRFY^0&X zD8~A8w%(Ey8p&d1G5(&D7Qbe#m!L|Ph@*a*PR#nEnq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jf#9#B@$cr9Uf~;s{gIZ^p_5I;CB1CozT^fy6gkt0&5Q%KGjRJJ3zE! z_iraqnST^D^G*}KOpJjgO1HtCK;}b!cQV-ZXx9u1gm<0=lVkvff`d#~DOlemGS1)X zdjYHYq~yMQ%^+Yi%VdB-IL1+S=B-aRQfwP>O9)tA+ZxmtPB@R8{;QDbjqg481?=yn zeFt#dVAGf=x?twl}JzU)8+3OzOG9^h+&W#Y4L0>wSQ;twPvn@3JKVC@E< z=^2?}KM}o%S?bwWh(m5AyOK_Dft3_+7{jfDDpx%bN517_3Sf{|dH4v1zj8bqki+_g zAM%d<{lpyEBW&vfupBX9t}=`+=t&F0sRAgF(=<-f3{=9Cq~zE=I}o@-BwfzrG+7mYn4_5mGJFMa=$P0=)vvGPaD_cSbd z`WYy1{o~U-=e4PVK*!kc+m#-e8)*Y%8bg>uK&Co`$putvR8xF@;k8XNz+kcdaQ19X zd8hfJ%bT`FVdQ I&MBb@05;9G#Q*>R diff --git a/Backgrounds/AstralSurfaceFogBGStyle.cs b/Backgrounds/AstralSurfaceFogBGStyle.cs deleted file mode 100644 index aab1ea3fba..0000000000 --- a/Backgrounds/AstralSurfaceFogBGStyle.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Terraria.ModLoader; - -namespace CalamityMod.Backgrounds -{ - public class AstralSurfaceFogBGStyle : ModSurfaceBackgroundStyle - { - public override int ChooseFarTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseMiddleTexture() => BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - - public override int ChooseCloseTexture(ref float scale, ref double parallax, ref float a, ref float b) - { - scale *= 0.75f; - return BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel"); - } - - public override void ModifyFarFades(float[] fades, float transitionSpeed) - { - // This just fades in the background and fades out other backgrounds. - for (int i = 0; i < fades.Length; i++) - { - if (i == Slot) - { - fades[i] += transitionSpeed; - if (fades[i] > 1f) - fades[i] = 1f; - } - else - { - fades[i] -= transitionSpeed; - if (fades[i] < 0f) - fades[i] = 0f; - } - } - } - } -} diff --git a/Backgrounds/AstralSurfaceFront.png b/Backgrounds/AstralSurfaceFront.png new file mode 100644 index 0000000000000000000000000000000000000000..5d603a737bcb52480d38f67e1c3fa78d98d2ce84 GIT binary patch literal 57227 zcmeEt`9IWO^#5y6))JyDQ6%f663H@DmZB1BY#~|3HW871CMml~S+j*KWf|*`Y*`{? zH-oWDjC~n1!x;0O>ivCuACK?%m+v3&na5)uuY1qEuY1mU-sPNo?|DVsyQ_DELx=+a zfFrkVY8wLp3nR&7#&($T*gqC8!FYhYjP08E{}rG4$buk|X;pu-36J;fQE2zGbZYj7LIk745i>mtC%GuhrY zfAnIj=?qQN&C;!6UP`YVD9}~99U>HRL+Ht2rn`n7LN8|T-*CSF`Sz)|x*ynPej!a_ z;~ad#kDG5{BrT2V>T{yH=4csZWXks|ztiljv8#T;nr7=?&u=$i-@ER&r@3nMGUWT8 z-~S-+KM4E}0{?@+{}%!uIt$VJR}jILjJ3UnOVfkO{pU6IA_`(*f*uNHP?KhutLgu> z<$cYrdoS=V+f?SjOa?_=v+8j?0bn zH-muy0Qs+aQ{OUM&53*lVO;aSdJ(!^XxWvgHvvHFKc0wh8Y-Y;47Kht{}VMP;63{v zUf&q+0l=f0Fx0{(NDBbMoBk4}H<BTP3Rc4zx39+ zKobK1{b>dr0Hi(IO#i(8U$($QQVPiVKTNe=DzdveN-{K+{wpXTfIP+uAS+(}Rr~a} z(R`fZpVlm<|1<{N4Cy!wAm#p*KH{nSW3gd}|MJ#ig{2*8>Smboj(;G0;A6SMK$zzr z!kjZojJhgv|F|4}B*4f$Jo2wB%Jxq#?Z29gBsXA!V?2O!1u>**Yrc)A6=?qG@5}(Q z{k7m9I>0y7dIinIkUHfbHW%3MGN?67|LM@T%+hp`K?wNYf>tPkJQ)5)Q{ps(3IJwo zXoh}G=Kqi`O@7bEAWlpF1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9=-UlR6_pzm=QWZBvQAY{b0eMV-&m&iVANAnnY zmXB~oCxG7H{@yOx%+{vP#9}+RzCN(6z*)+Cd$u|JbTDc?1+$7R&xNN-qdZ#D9%h;hn+f;p5Mg zLF%}t_!nf`?nC?oK#l16UV7$V0eyBx&rdJHM}@aiiXVynT3*i`5$kOdd3I!l{tWiH zxrfLe&12MY&`a$#0dEKHMakxs{kqs~#jY#SzDHt<`rH22r+;*N7iRzn*}_E+6dPBL zA6?P25VeJGKi_sOBz!HLKd$NPzUa75PxqD5%A#pxsfC{@#|okj-wQ((YO6%QvX}TT z#c4SJYUS&F$VU(No-|g*?-l-vH`aQ@KLCKI_58EPJx4q*kH9~pd%yUf75puc-|LWQ z%>byeat454pOrI0JNwMtBad04nE>J#uw~!-m9<{mI?K^^_F1U)r&&tlRJRh7)Al=Huh~v^_rlYPL>)1>V3I6^OkY=>TYn ze_=}pz-)Y>*BF^OuihY&G;MkaegNpfKdTjeUY3qq&i-s&jXbMIe)4aH6JW#v;GYv& zG7f-R+R?LHpO?|IG)vEOd#`+EC^-QHEkEC_xgRopY6jo$u1a@=sso^etw2=x+C%8k z9y(ckTh-dB)vmR)nS$dvkS@G;{ z(UZpvrDwW*ML_C+6X1TR^~KVcZrN9F!H@$$&<96U;mk33A899l@nqXc<3`wYY4>&b zQGaDtEN0kJ{0l7yKui1!D;xl&hyN-AqLz-v8#$kh<^#Y=tX&{@TVa$(un9!qf8rCr zblWP^as=${1ekRI2qh;#@2ds+JeOx??U|Zk)$_YWPd+o$W&sFV2b=)+L)7=$zH~+3 zycef)0N6N>@PH~I?eNI;zXDen`4_TfYl(lMK2d literal 0 HcmV?d00001 diff --git a/Skies/AstralSurfaceFrontGlow.png b/Backgrounds/AstralSurfaceFrontGlow.png similarity index 100% rename from Skies/AstralSurfaceFrontGlow.png rename to Backgrounds/AstralSurfaceFrontGlow.png diff --git a/Backgrounds/AstralSurfaceHorizon.png b/Backgrounds/AstralSurfaceHorizon.png new file mode 100644 index 0000000000000000000000000000000000000000..fa58141a90048adf89e4a9abc8e1bcd3c458c851 GIT binary patch literal 3527 zcmeHIZA?>V6ut$ws0e7XO=&8aITB1P3`n7c!o|<}1@$X&j7k+SRf`s^6=_S0)6FcP zU1p|ifOXj>PHC|;7D_=zy0m_AZ(LnlRw!bnUDwj8*e`C|yW9QVpZ(j9zR7#edveZu z^5)5Np7+b$6}04~_@w{Wt=xfw-}3{+zczcx*a z7d*ID009YYZOhG1=5CH&$XE zJ4scGg4qa2JA{g*Nf)%_7rK7a=c16C72HdCjMYibc^iK8vC7BzZq$#;g7RpJALXgD zg140QSyfCoEsAR}mW$gn5*(+Wk&c#(x!fo?fd*!fg)TR0X~=!Gf;G8cHEfnFBtGvf zK*#>DQAt}x^~2s}E|{v#^P^0x8hb=4f~rKCXvr`q{Ne2)7o(y(FpKKbJCUvd$rQ-( z@B~GVntM;kU>*gUR9vO1jFc%n#0fS6&@d>4dxdmZ>E8@$?wqvD!*v##-FE4;IBi{Vpw4U1(QVKsa;}!rXsmI50g{D zpCts3t(tCfG(!2@2dCI_0rzz2zIpU$w!XTM@mR|?F{-$|8q*%jJ6AfD)oMUxPe?T8`6C5FZ%96~%#8w%C(u#) znHT9NjM~BB{y~nUgt5k?8SN0%@8I1B4ki1=z@s;_c2T0WhH4GrKBnq*sens?Cho4Q zo%nW~0AO`TSVWa9X#NR$<_8P6`SQ74}JDG4^;We literal 0 HcmV?d00001 diff --git a/Backgrounds/AstralSurfaceMiddle.png b/Backgrounds/AstralSurfaceMiddle.png index 89b568c3be4fe85000949d2fbcd95dc7c5f77ff6..d3f984c00173cb54c66d563a2002cd5ad7b9876a 100644 GIT binary patch literal 20405 zcmd42i93{E_&&w1{Pd1Akpb@i%urqo#PcHm ze^bua7GOnz75G0NJ>3B~5ljEqRr#wyyg(3whNCJ=xc>h;w$OE%T%Sll5%bTv5%?9p zx&QM_Cn*rmXO<$n|8?%Rn<(Iv{!*RjHvI1z+g%9RWkwIQ?Y1lYS-L0>#`^yE3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k}< zIRqOjs`2NSM}gD5_zGhW{kLWQy(;Ga*KRg^5h+{zmGesnE$(LQgnrq^{!Ybj|L|<_=OUt_Mb9x4 S4p8|^xOTI{cKZ@GSMVR8E*)P0 diff --git a/Skies/AstralSurfaceMiddleGlow.png b/Backgrounds/AstralSurfaceMiddleGlow.png similarity index 100% rename from Skies/AstralSurfaceMiddleGlow.png rename to Backgrounds/AstralSurfaceMiddleGlow.png diff --git a/Backgrounds/AstralUG4_0.png b/Backgrounds/AstralUG4_0.png new file mode 100644 index 0000000000000000000000000000000000000000..73f3bad550b5918699e665cfaf726e26d49bc09c GIT binary patch literal 1922 zcmY+Fc~sJA7stU3(~KM!vIX91RI({ivrNl9w{j!Vmr2bW#Y}O@B_%_$Jeo!32sUmB zI*D79yA~oX>ST&bnPV>4I7XU?iI4(68SCww_kI7k&pr2?d(Lyd_j8}`bHm5WRZC;L z1_%Vwa(8n^Z)Dm=pw!hi&VuUrn2iKZK)X7EnB1Ln8-+@QgQo)sRG+IUKc~7;Z;Ern zCV)U&o_`H+Pi$2f2n2z-J3IKL1Pe+%qxCSlJ-phh%OrKm!`~gwucDTK<`?=mOb;@&^YjF~8GOE~$L%Z<>$Y{PBZ72Tw*c8~tGmF~j<;de(;6NExT z;BJ0oaSLoou3y3~lr2uQM{pIB776BW&Q1YRH-X*lAOs8FJ=m7^bb(VIjuVTzQxp1@ z0sa~NA|Pco2P=6P_;_N0-@)j!eO=$XFvk|*yzd>w`^!|N{M9ANv$yhqzsS-I`RI9e zwD-)|m4!;I&W+_b(bDo)56JErm%%(^e4TvCsm^ zeK{{wq2{o=NTW*Q1$9ca5P^&8G(K%Z!B^Je8Cc54amXDgZ-v8gDJJ2}uSXGx{@**p~K~ve%Fb zDyo>I=FtagFnfz%dD{*2$()FqT;H$jLyIlwScPQhos*Cne z1a+Hqbu*LULUN#Gt%mv(F{l_k<9FY`YniL*XVB4na6C(mXr^h?(h=%U)nu(4KvfyHfI|A7uI&Bx=!Vx*EXzJIT_`4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?i*J%N(6xYO*JmYrJt^wL#=i-2KjG!fbPUP(2bAv8L;wH) literal 0 HcmV?d00001 diff --git a/Backgrounds/AstralUG4_1.png b/Backgrounds/AstralUG4_1.png new file mode 100644 index 0000000000000000000000000000000000000000..bf9978ceeb464aaebd47ed1872343b3c355dd496 GIT binary patch literal 1751 zcmV;|1}OQ7P)001xu1^@s6mZ@=W00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D25d=0K~#8N?VL|+ z6;%|*c{NZTplyLxQm~MsL6ng2$DkF6i3I!?G%?YIAtt(X?Z$-*7cSJjE_F+EXQIZ1 zm`0;9L}LUbNCQY~Yzu7-r4*zn=g!ZB4-WGlE$>1-zXe}s-hFrO%$@VSGc$*&?AiU= zr8)m{VEo)=xr*w@py@TRbC_JeV=40G>UVS3^Blcu`A zEVCcoE4oazAKI0TPmc@zd9a;*KmK4!`&{$iWd8<1CjN6kbs*04$%%ue-@kCobj#jV zrqEn{z!WF??v8Y3|609vM1e*GXv8Qu4=`@F|K{kVsqP1#ZyMNV3cGqh-}mCDA)Uo{8R$Z1}@)b!H1ans&s4w=HXPuH4O<}Wm*-TAW(cO16HFR z@LDil#y9Kg0e?>QfXqL4A@ul0Jz#KKQF}dLaR(f>Es1)-%al2jI-{5Cvi_E>2P}R8 zVW#Fk95BdA{q=xFW%QndTTPD-q%(Wx)>H>}xNpkzSYNvTRTi;;v#2v@Bx?>>=8T%7 zL_Og3@9#Bw{=)%-tkho*SVX|CZ=xRXGTwbObw=7Zx*l*MR+U@)tgc0FK6TgB9iINH%)Sv_D` z&Jy*2>G<6$^?=iz|8T${D-Ev)Bw}E2BpI-_S0}91$pFWIs0X|f-CnNw4+jjg67_(x zoig;a>I53$o+B|{#y4Bv56JvSJzy{^aO(lv7p1Gcv8i;m z=G6nXG^MLe+Id%#UIeqAoIt@*Xy+02fLD$~e?e|mJ>YcbKO8W~%2oA%dPeIqPRRS= z#*d`PUjN8k)1$-be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-&(?|$GlDkEtA?oBsJe!@1%Tvb*O8|{-Yf6;LT6i;LayG~ z)Ij`!g$8(9r@BL{1xXI9qfFH4TGwVNTLVQ%o&SLy(D72;I9tMF3b%^4lq8K)LaP5> z(gX{y2tUS23c2<(WJiW5;FNylq~yV)wqOF{KXiV3q`-nmB!tQ@9L}cXDzz=;v2B$- zhmrUXo;k(vh?6B=&kS1%zf7<`;NYyE(-%^qiTuHxZ(g`N0WsrJ6m{5nZ#$9O~L`>RXEd<{sMbw8Rq~1 literal 0 HcmV?d00001 diff --git a/Backgrounds/AstralUndergroundBGStyle.cs b/Backgrounds/AstralUndergroundBGStyle.cs index 71f1ec2c50..f3c9455798 100644 --- a/Backgrounds/AstralUndergroundBGStyle.cs +++ b/Backgrounds/AstralUndergroundBGStyle.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Backgrounds { @@ -6,8 +7,8 @@ namespace CalamityMod.Backgrounds { public override void FillTextureArray(int[] textureSlots) { - for (int i = 0; i <= 3; i++) - textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/AstralUG" + i.ToString()); + for (int i = 0; i <= 4; i++) + textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot(i == 4 ? "CalamityMod/Backgrounds/AstralUG" + i.ToString() + "_" + Main.hellBackStyle : "CalamityMod/Backgrounds/AstralUG" + i.ToString()); } } } diff --git a/BiomeManagers/AbovegroundAstralBiome.cs b/BiomeManagers/AbovegroundAstralBiome.cs deleted file mode 100644 index aea59f5567..0000000000 --- a/BiomeManagers/AbovegroundAstralBiome.cs +++ /dev/null @@ -1,34 +0,0 @@ -using CalamityMod.Items.Placeables.Furniture; -using CalamityMod.Systems; -using Terraria; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class AbovegroundAstralBiome : ModBiome - { - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); - public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralSurfaceFogBGStyle"); - public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/AstralUndergroundBGStyle"); - public override int BiomeTorchItemType => ModContent.ItemType(); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon"; - public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space; - - public override bool IsBiomeActive(Player player) - { - return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950; - } - - public override void SpecialVisuals(Player player, bool isActive) - { - player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); - - } - } -} diff --git a/BiomeManagers/AbovegroundAstralBiomeSurface.cs b/BiomeManagers/AbovegroundAstralBiomeSurface.cs deleted file mode 100644 index d68e9ed700..0000000000 --- a/BiomeManagers/AbovegroundAstralBiomeSurface.cs +++ /dev/null @@ -1,41 +0,0 @@ -using CalamityMod.Items.Placeables.Furniture; -using CalamityMod.Systems; -using Terraria; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class AbovegroundAstralBiomeSurface : ModBiome - { - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); - public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralSurfaceBGStyle"); - public override int BiomeTorchItemType => ModContent.ItemType(); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space; - - public override bool IsBiomeActive(Player player) - { - return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneSnow && !player.ZoneDesert; - } - - public override void SpecialVisuals(Player player, bool isActive) - { - if (SkyManager.Instance["CalamityMod:AstralSurface"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSurface"].IsActive()) - { - if (isActive) - { - SkyManager.Instance.Activate("CalamityMod:AstralSurface"); - } - else - { - SkyManager.Instance.Deactivate("CalamityMod:AstralSurface"); - } - } - } - - } -} diff --git a/BiomeManagers/AbovegroundAstralDesertBiome.cs b/BiomeManagers/AbovegroundAstralDesertBiome.cs deleted file mode 100644 index 37058fdce9..0000000000 --- a/BiomeManagers/AbovegroundAstralDesertBiome.cs +++ /dev/null @@ -1,43 +0,0 @@ -using CalamityMod.Items.Placeables.Furniture; -using CalamityMod.Systems; -using Terraria; -using Terraria.GameContent.Events; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class AbovegroundAstralDesertBiome : ModBiome - { - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); - public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralDesertSurfaceBGStyle"); - public override int BiomeTorchItemType => ModContent.ItemType(); - public override SceneEffectPriority Priority => Sandstorm.Happening && !(Main.slimeRain || Main.eclipse) ? SceneEffectPriority.Environment : SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon"; - // Could use its own unique background - public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space; - - public override bool IsBiomeActive(Player player) - { - return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneDesert && !player.ZoneSnow; - } - - public override void SpecialVisuals(Player player, bool isActive) - { - if (SkyManager.Instance["CalamityMod:AstralDesert"] != null && isActive != SkyManager.Instance["CalamityMod:AstralDesert"].IsActive()) - { - if (isActive) - { - SkyManager.Instance.Activate("CalamityMod:AstralDesert"); - } - else - { - SkyManager.Instance.Deactivate("CalamityMod:AstralDesert"); - } - } - } - } -} diff --git a/BiomeManagers/AbovegroundAstralSnowBiome.cs b/BiomeManagers/AbovegroundAstralSnowBiome.cs deleted file mode 100644 index 029513ce91..0000000000 --- a/BiomeManagers/AbovegroundAstralSnowBiome.cs +++ /dev/null @@ -1,41 +0,0 @@ -using CalamityMod.Items.Placeables.Furniture; -using CalamityMod.Systems; -using Terraria; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class AbovegroundAstralSnowBiome : ModBiome - { - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); - public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralSnowSurfaceBGStyle"); - public override int BiomeTorchItemType => ModContent.ItemType(); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space; - - public override bool IsBiomeActive(Player player) - { - return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneSnow; - } - - public override void SpecialVisuals(Player player, bool isActive) - { - if (SkyManager.Instance["CalamityMod:AstralSnow"] != null && isActive != SkyManager.Instance["CalamityMod:AstralSnow"].IsActive()) - { - if (isActive) - { - SkyManager.Instance.Activate("CalamityMod:AstralSnow"); - } - else - { - SkyManager.Instance.Deactivate("CalamityMod:AstralSnow"); - } - } - } - - } -} diff --git a/BiomeManagers/AstralInfectionBiome.cs b/BiomeManagers/AstralInfectionBiome.cs new file mode 100644 index 0000000000..264845baae --- /dev/null +++ b/BiomeManagers/AstralInfectionBiome.cs @@ -0,0 +1,94 @@ +using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Systems; +using Terraria; +using Terraria.Graphics.Effects; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers +{ + public class AstralInfectionBiome : ModBiome + { + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); + public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle + { + get + { + if (Main.LocalPlayer.ZoneSnow) //Snow + { + return ModContent.Find("CalamityMod/AstralSnowSurfaceBGStyle"); + } + else if (Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow) //Desert + { + return ModContent.Find("CalamityMod/AstralDesertSurfaceBGStyle"); + } + else //surface + { + return ModContent.Find("CalamityMod/AstralSurfaceBGStyle"); + } + } + } + + public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle + { + get + { + if (Main.LocalPlayer.ZoneSnow) + { + return ModContent.Find("CalamityMod/AstralUndergroundBGStyle"); // Could use its own unique background + } + return ModContent.Find("CalamityMod/AstralUndergroundBGStyle"); + } + } + + public override int BiomeTorchItemType => ModContent.ItemType(); + public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon"; + public override string BackgroundPath + { + get { + if (Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow) + { + //desert + return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; // Could use its own unique background + } + else if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight) + { + //underground + return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; // Could use its own unique background + } + else + { + return "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + } + } + } + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + + public override int Music + { + get + { + if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight) + { + return CalamityMod.Instance.GetMusicFromMusicMod("AstralInfectionUnderground") ?? MusicID.Space; + } + return CalamityMod.Instance.GetMusicFromMusicMod("AstralInfection") ?? MusicID.Space; + } + } + + public override bool IsBiomeActive(Player player) + { + return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950; + } + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + if (Main.LocalPlayer.ZoneDirtLayerHeight || Main.LocalPlayer.ZoneRockLayerHeight || Main.LocalPlayer.ZoneUnderworldHeight) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); //underground + } + } + } +} diff --git a/BiomeManagers/AcidRainBiome.cs b/BiomeManagers/BestiaryCategories/AcidRainBiome.cs similarity index 100% rename from BiomeManagers/AcidRainBiome.cs rename to BiomeManagers/BestiaryCategories/AcidRainBiome.cs diff --git a/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs new file mode 100644 index 0000000000..8f7d2a9a30 --- /dev/null +++ b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs @@ -0,0 +1,11 @@ +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers.BestiaryCategories +{ + public class AstralCaveDesert : ModBiome //Unused, currently + { + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralCaveDesertIcon"; + + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + } +} diff --git a/BiomeManagers/BestiaryCategories/AstralDesert.cs b/BiomeManagers/BestiaryCategories/AstralDesert.cs new file mode 100644 index 0000000000..29b0a3f907 --- /dev/null +++ b/BiomeManagers/BestiaryCategories/AstralDesert.cs @@ -0,0 +1,11 @@ +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers.BestiaryCategories +{ + public class AstralDesert : ModBiome + { + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon"; + + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + } +} diff --git a/BiomeManagers/BestiaryCategories/AstralIce.cs b/BiomeManagers/BestiaryCategories/AstralIce.cs new file mode 100644 index 0000000000..f478ae1ee9 --- /dev/null +++ b/BiomeManagers/BestiaryCategories/AstralIce.cs @@ -0,0 +1,11 @@ +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers.BestiaryCategories +{ + public class AstralIce : ModBiome //Unused, currently + { + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralIceIcon"; + + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + } +} diff --git a/BiomeManagers/BestiaryCategories/AstralUnderground.cs b/BiomeManagers/BestiaryCategories/AstralUnderground.cs new file mode 100644 index 0000000000..42d924fd5b --- /dev/null +++ b/BiomeManagers/BestiaryCategories/AstralUnderground.cs @@ -0,0 +1,11 @@ +using Terraria.ModLoader; + +namespace CalamityMod.BiomeManagers.BestiaryCategories +{ + public class AstralUnderground : ModBiome + { + public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon"; + + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + } +} diff --git a/BiomeManagers/UndergroundAstralBiome.cs b/BiomeManagers/UndergroundAstralBiome.cs deleted file mode 100644 index f83a02d83f..0000000000 --- a/BiomeManagers/UndergroundAstralBiome.cs +++ /dev/null @@ -1,33 +0,0 @@ -using CalamityMod.Systems; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.BiomeManagers -{ - public class UndergroundAstralBiome : ModBiome - { - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); - public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("CalamityMod/AstralUndergroundBGStyle"); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon"; - // Could use its own unique background - public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - - public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralInfectionUnderground") ?? MusicID.Space; - - public override bool IsBiomeActive(Player player) - { - return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight); - } - - public override void SpecialVisuals(Player player, bool isActive) - { - player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); - } - - // Just slightly above the above-ground astral biomes. - public override float GetWeight(Player player) => 0.51f; - } -} diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6bc8f2c496..e505c7e3b9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1089,10 +1089,7 @@ namespace CalamityMod.CalPlayer #region Biome public bool ZoneCalamity => Player.InModBiome(ModContent.GetInstance()); - public bool ZoneAstral => (Player.InModBiome(ModContent.GetInstance()) || - Player.InModBiome(ModContent.GetInstance()) || - Player.InModBiome(ModContent.GetInstance()) || - Player.InModBiome(ModContent.GetInstance())) && !ZoneAbyss; + public bool ZoneAstral => Player.InModBiome(ModContent.GetInstance()) && !ZoneAbyss; public bool ZoneSunkenSea => Player.InModBiome(ModContent.GetInstance()); public bool ZoneSulphur => Player.InModBiome(ModContent.GetInstance()); public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4; diff --git a/CalamityMod.cs b/CalamityMod.cs index db4492d4f8..62b15634c1 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -92,13 +92,10 @@ namespace CalamityMod public static Texture2D AstralSurfaceCloseGlow; public static Texture2D AstralSurfaceMiddle; public static Texture2D AstralSurfaceMiddleGlow; - public static Texture2D AstralSurfaceFar; - public static Texture2D AstralSurfaceHorizon; // Astral Desert Sky/BG public static Texture2D AstralDesertSurfaceClose; public static Texture2D AstralDesertSurfaceMiddle; - public static Texture2D AstralDesertSurfaceFar; // Astral Snow Sky/BG public static Texture2D AstralSnowSurfaceMiddle; @@ -278,22 +275,19 @@ namespace CalamityMod { // Astral Sky/BG AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFront = ModContent.Request("CalamityMod/Skies/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Skies/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceClose = ModContent.Request("CalamityMod/Skies/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Skies/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddle = ModContent.Request("CalamityMod/Skies/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Skies/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFar = ModContent.Request("CalamityMod/Skies/AstralSurfaceFar", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceHorizon = ModContent.Request("CalamityMod/Skies/AstralSurfaceHorizon", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; - // Astral Desert Sky/BG - AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Skies/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Skies/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - AstralDesertSurfaceFar = ModContent.Request("CalamityMod/Skies/AstralDesertSurfaceFar", AssetRequestMode.ImmediateLoad).Value; + //Astral Desert Sky/BG + AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; + AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - // Astral Snow Sky/BG - AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Skies/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + //Astral Snow Sky/BG + AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; // Sulpher Sea Sky/BG SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value; @@ -352,10 +346,6 @@ namespace CalamityMod SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky(); SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); - SkyManager.Instance["CalamityMod:AstralSurface"] = new AstralSkySurface(); - SkyManager.Instance["CalamityMod:AstralDesert"] = new AstralSkyDesert(); - SkyManager.Instance["CalamityMod:AstralSnow"] = new AstralSkySnow(); - SkyManager.Instance["CalamityMod:MonolithAstral"] = new AstralMonolithSky(); SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky(); SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); diff --git a/ILEditing/ILHelperMethods.cs b/ILEditing/ILHelperMethods.cs index bd8175fb1f..01f2379f0e 100644 --- a/ILEditing/ILHelperMethods.cs +++ b/ILEditing/ILHelperMethods.cs @@ -64,7 +64,7 @@ namespace CalamityMod.ILEditing SoundEngine.PlaySound(SoundID.DoorClosed, new Vector2(doorX * 16, doorY * 16)); return true; } - + private static Texture2D SelectLavaTexture(Texture2D initialTexture, LiquidTileType type) { // Use the initial texture if it isn't lava. diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index eb19732c3d..b7e5f75b48 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -43,4 +43,4 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } -} +} \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Biomes.hjson b/Localization/en-US/Mods.CalamityMod.Biomes.hjson index 7751dea39b..f6834ea4a1 100644 --- a/Localization/en-US/Mods.CalamityMod.Biomes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Biomes.hjson @@ -1,29 +1,28 @@ // For general uses Abyss: Abyss AstralInfection: Astral Infection -AstralDesert: Astral Desert AstralSnow: Astral Snow BrimstoneCrags: Brimstone Crags SulphurousSea: Sulphurous Sea SunkenSea: Sunken Sea -AbovegroundAstralBiome: { - DisplayName: Astral Infection - TownNPCDialogueName: Astral Infection -} - -AbovegroundAstralBiomeSurface: { - DisplayName: Astral Surface - TownNPCDialogueName: Astral Infection -} - -AbovegroundAstralDesertBiome: { +AstralDesert: { DisplayName: Astral Desert Surface TownNPCDialogueName: Astral Desert } -AbovegroundAstralSnowBiome: { - DisplayName: Astral Snow Surface +AstralBiome: { + DisplayName: Astral Infection + TownNPCDialogueName: Astral Infection +} + +AstralInfectionBiome: { + DisplayName: Astral Infection + TownNPCDialogueName: Astral Infection +} + +AstralIce: { + DisplayName: Astral Ice TownNPCDialogueName: Astral Snow } @@ -72,7 +71,12 @@ SunkenSeaBiome: { TownNPCDialogueName: Sunken Sea } -UndergroundAstralBiome: { +AstralUnderground: { DisplayName: Astral Underground TownNPCDialogueName: Underground Astral Infection } + +AstralCaveDesert: { + DisplayName: Astral Cave Desert + TownNPCDialogueName: the Astral Cave Desert +} diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 32f4280027..086ae693e4 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 76984fe721..1ea110d392 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 337b44f461..b57bd3c99d 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index bd9d700934..9959c22d91 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 988cf850db..ab3c5fc0d1 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Sounds; using CalamityMod.World; +using CalamityMod.BiomeManagers.BestiaryCategories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -58,7 +59,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 5089169c16..197c13bfff 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 49a6b73e71..9df2efe204 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.BiomeManagers.BestiaryCategories; using CalamityMod.Projectiles.Enemy; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -75,7 +76,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index f71ed2a2df..8882cf68c8 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Sounds; using CalamityMod.Tiles.AstralDesert; using CalamityMod.World; +using CalamityMod.BiomeManagers.BestiaryCategories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -58,7 +59,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/HiveEnemy.cs b/NPCs/Astral/HiveEnemy.cs index 75d9527c5d..634dd610c2 100644 --- a/NPCs/Astral/HiveEnemy.cs +++ b/NPCs/Astral/HiveEnemy.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Sounds; using CalamityMod.World; +using CalamityMod.BiomeManagers.BestiaryCategories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -50,7 +51,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; if (Main.zenithWorld) { NPC.scale = 3f; diff --git a/NPCs/Astral/Hiveling.cs b/NPCs/Astral/Hiveling.cs index 8d57509795..1815cf10a8 100644 --- a/NPCs/Astral/Hiveling.cs +++ b/NPCs/Astral/Hiveling.cs @@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Sounds; using CalamityMod.World; +using CalamityMod.BiomeManagers.BestiaryCategories; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -50,7 +51,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index f2abb227c0..f4416a41f4 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 3eec7f005b..6546f6889d 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 9e8dc3fec8..5b0a72f09c 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 018a3f7efe..18a292029b 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 7cdb6f1050..979055f748 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -5,6 +5,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.BiomeManagers.BestiaryCategories; using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -59,7 +60,7 @@ namespace CalamityMod.NPCs.Astral } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index d0b5d1794e..236659fd72 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Astral AIType = NPCID.LightningBug; AnimationType = NPCID.LightningBug; NPC.catchItem = (short)ModContent.ItemType(); - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index a99da6194b..c2222cc170 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; if (Main.getGoodWorld) NPC.scale *= 0.8f; @@ -439,7 +439,7 @@ namespace CalamityMod.NPCs.AstrumAureus } // Drop an Astral Meteor if applicable - ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor()); + ThreadPool.QueueUserWorkItem(_ => World.AstralBiome.PlaceAstralMeteor()); // Mark Astrum Aureus as dead DownedBossSystem.downedAstrumAureus = true; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index ed43b0fe56..0174243a2e 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.netAlways = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; if (Main.zenithWorld) { diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index b78f297891..5b2a262879 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -147,13 +147,13 @@ namespace CalamityMod.NPCs.TownNPCs type = ConvertType.Crimson; break; } - AstralBiome.ConvertFromAstral(x - 2, x + 2, y - 2, y + 2, type); + World.AstralBiome.ConvertFromAstral(x - 2, x + 2, y - 2, y + 2, type); WorldGen.Convert(x, y, conversionType, 2); } // Calamity solution(s) else if (conversionType == 8) { - AstralBiome.ConvertToAstral(x - 2, x + 2, y - 2, y + 2); + World.AstralBiome.ConvertToAstral(x - 2, x + 2, y - 2, y + 2); } // Solutions registered by other mods else diff --git a/Projectiles/Magic/ExoVortex.cs b/Projectiles/Magic/ExoVortex.cs index fed7e9cdfc..aba7ceed69 100644 --- a/Projectiles/Magic/ExoVortex.cs +++ b/Projectiles/Magic/ExoVortex.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/ExoVortex2.cs b/Projectiles/Magic/ExoVortex2.cs index d9351189ea..594aac4474 100644 --- a/Projectiles/Magic/ExoVortex2.cs +++ b/Projectiles/Magic/ExoVortex2.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Melee/CosmicShivAura.cs b/Projectiles/Melee/CosmicShivAura.cs index 5abefa744d..390c13d3d1 100644 --- a/Projectiles/Melee/CosmicShivAura.cs +++ b/Projectiles/Melee/CosmicShivAura.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnSpawn(IEntitySource source) { if (Main.npc[(int)Projectile.ai[0]] is not null || Main.npc[(int)Projectile.ai[0]].active) - target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object + target = Main.npc[(int)Projectile.ai[0]]; // Convert target.whoAmI to object } // ai[0] for ID of target to follow until the end of projectile's lifespan or the target cannot be found @@ -41,7 +41,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); } - Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; // Stay with target + // Stay with target + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; if (Projectile.ai[1] == CurrentSwordTimer) { @@ -49,10 +50,16 @@ namespace CalamityMod.Projectiles.Melee randomDirection.Normalize(); int randomDistance = Main.rand.Next(200, 426); Vector2 spawnPos = Projectile.Center + (randomDirection * randomDistance); - Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; // Sword moves a bit slower if spawned closer, moves faster if spawned further + + // Sword moves a bit slower if spawned closer, moves faster if spawned further + Vector2 velocity = Vector2.Normalize(Projectile.Center - spawnPos) * Utils.GetLerpValue(-100, 426, randomDistance, clamped: true) * 20f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.8f, Projectile.owner, randomDistance); - Projectile.ai[1] = 0; // Reset timer - CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); // Determine when next sword will spawn + + // Reset timer + Projectile.ai[1] = 0; + + // Determine when next sword will spawn + CurrentSwordTimer = Main.rand.Next(SwordsAverageDelay - SwordsRandomOffset, SwordsAverageDelay + SwordsRandomOffset); } Projectile.ai[1]++; diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 10b158513a..5ae1c83de6 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -66,13 +66,18 @@ namespace CalamityMod.Projectiles.Melee float rotation = Projectile.rotation; Color randomColor = Projectile.GetAlpha(lightColor); + // Afterimages to make the blade look longer float scaleMult = 1.2f; - for (int i = 0; i < Projectile.oldPos.Length; i++) // Afterimages to make the blade look longer + for (int i = 0; i < Projectile.oldPos.Length; i++) { Vector2 drawPos = Projectile.oldPos[i] + (Projectile.Size / 2f) - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); Color color = randomColor * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color, rotation, origin, Projectile.scale * scaleMult, SpriteEffects.None, 0f); // Smaller, more visible layer - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color * 0.5f, rotation, origin, Projectile.scale * 1.6f * scaleMult, SpriteEffects.None, 0f); // Bigger, less visible layer + + // Smaller, more visible layer + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color, rotation, origin, Projectile.scale * scaleMult, SpriteEffects.None, 0f); + + // Bigger, less visible layer + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(sourceRectangle), color * 0.5f, rotation, origin, Projectile.scale * 1.6f * scaleMult, SpriteEffects.None, 0f); scaleMult *= 0.95f; } @@ -88,12 +93,14 @@ namespace CalamityMod.Projectiles.Melee } } - public override Color? GetAlpha(Color lightColor) // Probably not the right way to use this function, but it works (hopefully) + // Probably not the right way to use this function, but it works (hopefully) + public override Color? GetAlpha(Color lightColor) { + // Take random color from a list and make it more white Color color = CosmicShivTrail.DustColors[ColorIndex] * Projectile.Opacity; color = Color.Lerp(color, Color.White, 0.6f); color.A = 0; - return color; // Take random color from a list and make it more white + return color; } } } diff --git a/Projectiles/Melee/CosmicShivTrail.cs b/Projectiles/Melee/CosmicShivTrail.cs index 8c7d14eb67..d5ba91fb4c 100644 --- a/Projectiles/Melee/CosmicShivTrail.cs +++ b/Projectiles/Melee/CosmicShivTrail.cs @@ -7,6 +7,14 @@ using Terraria; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Reflection.Metadata; +using Microsoft.Xna.Framework.Graphics; +using System.Diagnostics.Contracts; +using Terraria.GameContent; +using Terraria.Audio; namespace CalamityMod.Projectiles.Melee { @@ -104,6 +112,40 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(ModContent.BuffType(), 60); } + // pretty much entirely from the Oracle circular damage code + private void CircularDamage(float radius) + { + if (Projectile.owner != Main.myPlayer) + return; + Player owner = Main.player[Projectile.owner]; + + for (int i = 0; i < Main.npc.Length; ++i) + { + NPC target = Main.npc[i]; + if (!target.active || target.dontTakeDamage || target.friendly) + continue; + + // Shock any valid target within range. Check all four corners of their hitbox. + float d1 = Vector2.Distance(Projectile.Center, target.Hitbox.TopLeft()); + float d2 = Vector2.Distance(Projectile.Center, target.Hitbox.TopRight()); + float d3 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomLeft()); + float d4 = Vector2.Distance(Projectile.Center, target.Hitbox.BottomRight()); + float dist = MathHelper.Min(d1, d2); + dist = MathHelper.Min(dist, d3); + dist = MathHelper.Min(dist, d4); + + if (dist <= radius) + { + int damage = (int)(Projectile.damage * ExplosionDamageMultiplier); + bool crit = Main.rand.Next(100) <= owner.GetCritChance() + 4; + target.StrikeNPC(target.CalculateHitInfo(damage, 0, crit, 0)); + + if (Main.netMode != NetmodeID.SinglePlayer) + NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); + } + } + } + // Very similar to CosmicShivBlade PreDraw public override bool PreDraw(ref Color lightColor) { @@ -187,6 +229,8 @@ namespace CalamityMod.Projectiles.Melee dust.fadeIn = -1f; } } + + CircularDamage(80f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/EonBolt.cs b/Projectiles/Melee/EonBolt.cs index d6aaba4fd7..ff20bd185c 100644 --- a/Projectiles/Melee/EonBolt.cs +++ b/Projectiles/Melee/EonBolt.cs @@ -8,6 +8,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.Graphics.Primitives; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/Shortswords/CosmicShivProj.cs b/Projectiles/Melee/Shortswords/CosmicShivProj.cs index ce21686f54..15a8518531 100644 --- a/Projectiles/Melee/Shortswords/CosmicShivProj.cs +++ b/Projectiles/Melee/Shortswords/CosmicShivProj.cs @@ -1,9 +1,14 @@ -using System; +using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -57,7 +62,8 @@ namespace CalamityMod.Projectiles.Melee.Shortswords OnHitEffect(); if (NumHits < 3) - { // Just to avoid insanity from stacking so many super dummies or hitting many worm segments at once + { + // Just to avoid insanity from stacking so many super dummies or hitting many worm segments at once // 2x bonus for true melee hits (spawns an additional aura plus the one aura from the cosmic shiv ball) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, target.whoAmI); NumHits++; diff --git a/Skies/AstralDesertSurfaceClose.png b/Skies/AstralDesertSurfaceClose.png deleted file mode 100644 index c96ebe2cfdcbcd532b028f289dd4f5104aa04206..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5031 zcmeHL`CAfL7rsDP* zE+-wm0N5r?Ava}V(hE^C?)wjl_i{b~>Uy-MrC?jQ{b_pu8uI1W$#4K*z{AZ4FRh1! zq+Gg`Cr!S^HwFG}3M|go+?DzSP`n7*E8)-)us%4Kv&V!P#?lQJp{hZ_UvLWx>jOBx0!auWkGlMCBH z(mtEXu!7zRb>QBiFMz<8LS$I+3nK~mbJm5B1=Qtw2mT575D=CBhJrmi9fzXQ#a9US zuGTjoj6*h^H4*fWh9H5nk|giMH^G4CBFk2ls)!UB))@&D^Kz$07ygpNRf`6;z^rjks3M`A$My@!VPm%s3V@WbW&*)zN+zLKJQ zp4BpaKiVpyK;Ua{W~fV!U+PgN;$SI{U)!-fH#{~0rCvEBN59s$xVG?uZ=skU8zSo_1930VtnbD%KoT&Xg6#83~Ndu4D;;>Rm@MiVN{{rZ0J zH{-=ashrvRhn2==&o_rrx$f?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1Q^Cayra+bAh`j~hP^97eXd;tT-#7CykgFg9d z`LQ2D3m$U1T~O4Q3wx)m%?7UTh5HMr(9_skuYg3pK5dlj{+&ln`olNEyhvIh7f7zH z*dhD|LJJN}tj0)McFjy86@kvn9#Z%fk9c%f0oDK{32V8~$^3QSzS7Z^4E3Hro;FImF3|d8;oa zsd=m9wG^1JB0A@4F$=BVAF#oDW0pwHxHa|rSn1#SR4bvi;o|;+)%0D>Tu-O+tDDOO zK*DMa+@V`by}0BU`eNacv}43esGb)(AyIqj%b*Diw89ff&||^3&eJL?oe?1EKy~^3 zXQY~sab*NoS?XAl>uOaSm(&>(_nU?zoOQI-{GF%!kZ%ZBZ_o74OuoNy4Z$Kx+K3Yx z)1D}Bpa`-XZUTNM$xxNMz|Ayu;AIH2lM4eU+rN?DMEJG||1Wk3+E{$E1*tRe{9+Y= RO#SB*#RX4rtUEzU`!C|>gO~sS diff --git a/Skies/AstralDesertSurfaceFar.png b/Skies/AstralDesertSurfaceFar.png deleted file mode 100644 index a2337a7d8fe1277ad1b4e44d3e8beb1282f81fbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18650 zcmeFY1y>wVupr#H5AN;~T!Xv2ySpd21b252?jaDIKyY_=hu|7K_)gxw@9pl{{eHo2 zpEIX>`qs6&Rn?_YDoWBQhy;iL0HDaqNT>k-H24vs0Uio`3olKZ0Npe_OF z#S{hrpa2yG4N35ONpWQ*1#K;LBXeVW@ZbM;{XY!+--Ch3vY%jPfdJgpl+@q<@4f)_ z2RLf*$s>G{(RBp?P|v>~#Lp!AbMQ+%H%T2gb!RI#Pg565;FGDXlN+;>r5hP1Gb=Oq zORV`807!_)N{DKB8J%xL746X^SD3B|UcQe$i1jD*GmF@aPF1B{e=it*K$1$JuI2867;al)z|(8PTv)dARW9RT8J<_Zf2;bz0SwAK#KH46n$g!eO1KD1 zNN$fXY}IiItpnFR;I+M*@P+qQbF=p2GQ4+;bn~c5j?oQIh&x~qU5@e$IsK<^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`S7b!0q;NJE5x|b=gP41(qH(e5#jbcYtWe z_TNsRGXE%O+E`?qsm*(Y6^B2=6=#CdmK{c?apPQn0>BWR$iF@%v+yMr06!{mLRaawl%0HlyDw7{Z~HI8{d2G3)tUD z`wrl^!KN`%bj7Cqwec1#TZ@{cec6Eu6ntvXIl$Kd%fx4$1d4k;g&#{9q4;zj8bqkj46i zAM%d<{lpB}BW&ve0;EGc1%V}CJ{P*>g4alDa|6Tu*ll7V|8IK@bisVS?~zM# zIKD4=`+=t&F0sRAgF(=<-f3{=9Cq~zE=I}o@-BwfzrG+7mYn4_5mGJFMa=$P0=)vvGPaD_cSbd z`WYy1{o~U-=e4PVK*!kc+m#-e8)*Y%8bg>uK&Co`$putvR8xF@;k8XNz+kcdaQ19X zd8hfJ%bT`FVdQ I&MBb@08L}L*Z=?k diff --git a/Skies/AstralDesertSurfaceMiddle.png b/Skies/AstralDesertSurfaceMiddle.png deleted file mode 100644 index 6b5c33dee80cd4243d98a029ce2c3404f793204b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5402 zcmeHL`8yQa8$V;R&Y-akBSe=(mTA#kyTYUpS&JAHk}zg4Su(Oj#Jx9C*}0)8Bb7BX z2BQTHWeG8ZkR>xECR^X>Px$_Pd!Oe#=e+NEp0j-3&-;1KbJ85_vEpJVF#v$L&2h`q z0PNroAuA$KewWRwQTXK%PGgUP$Gy8g^PL?57Iqc@)MmjpeFOo30tZ`XD}LO^CpF0mjfYX|=IzRuSVaLx90FY?^)gWD=mFM|Ed7_m& z(J9oQ808aw0fhNn3?b@n_CLEO|8KzHw4Yf0_;juSGMdmO1WJ^)n! z=!Tvi%`z++NQEUE6&DxM0m(2V#4USp8&2Lk)hb~DTj~L%{kroGPy3(4$=J!O_7*2E zzXBv>-5KYngCTHo0NZr@8se!ml=WxB^?F~KCH@j3x-0?t;~x5;kX$viNTqTtv}gLi z!pTec*&zJ8Q>^5(85Q>xK+Mz=7q*w%bU>IrEi}IZD&wfC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#1VBa0cZoz}#Uz`wGrW^cqO#z(NhnkD|gX3+#Cx3(Rn+dy}s}hviyquEjs$d+OK~r8!LOu$47D3{s&0=*v$X{ diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index c919a6f549..7290303387 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -6,6 +6,7 @@ using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.ModLoader; +using System.Reflection; namespace CalamityMod.Skies { diff --git a/Skies/AstralSkyDesert.cs b/Skies/AstralSkyDesert.cs deleted file mode 100644 index f786d156da..0000000000 --- a/Skies/AstralSkyDesert.cs +++ /dev/null @@ -1,137 +0,0 @@ -using CalamityMod.Systems; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Skies -{ - public class AstralSkyDesert : CustomSky - { - private bool skyActive; - private float opacity; - - private const float Scale = 2f; - - public override void Deactivate(params object[] args) - { - skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow; - } - - public override void Reset() - { - skyActive = false; - } - - public override bool IsActive() - { - return skyActive || opacity > 0f; - } - - public override void Activate(Vector2 position, params object[] args) - { - skyActive = true; - } - public override Color OnTileColor(Color inColor) - { - return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity); - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - // Small worlds, default draw height. - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - // Medium worlds. - if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4; - - // Large worlds (and anything bigger). - if (Main.maxTilesX >= 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140; - - // Background from here starting from the back layer to the front layer. - float width = Main.screenWidth / 2f; - float height = Main.screenHeight / 2f; - Color color = new Color(63, 51, 90, 255) * opacity; - if (maxDepth >= 9f && minDepth < 9f) - { - float screenParralaxMultiplier = 0.16f; - Texture2D texture = CalamityMod.AstralSurfaceHorizon; - int x = (int)(Main.screenPosition.X * screenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * screenParralaxMultiplier); - y -= 1380; // 1000 - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 8f && minDepth < 8f) - { - float screenParralaxMultiplier = 0.4f; - Texture2D texture = CalamityMod.AstralDesertSurfaceFar; - int x = (int)(Main.screenPosition.X * 0.5f * screenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.45f * screenParralaxMultiplier); - y -= 1520; // 1000 - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 7f && minDepth < 7f) - { - float screenParralaxMultiplier = 0.4f; - Texture2D texture = CalamityMod.AstralDesertSurfaceMiddle; - int x = (int)(Main.screenPosition.X * 0.8f * screenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.5f * screenParralaxMultiplier); - y -= 1900; // 1000 - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 6f && minDepth < 6f) - { - float screenParralaxMultiplier = 0.4f; - Texture2D texture = CalamityMod.AstralDesertSurfaceClose; - int x = (int)(Main.screenPosition.X * 1f * screenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.55f * screenParralaxMultiplier); - y -= 2050; // 1000 - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - texture.Size() / 2f * Scale, null, color, 0f, new Vector2(0f, (float)AstralBiomeHeight), Scale, SpriteEffects.None, 0f); - } - } - } - - public override void Update(GameTime gameTime) - { - if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu) - skyActive = false; - - if (skyActive && opacity < 1f) - opacity += 0.02f; - else if (!skyActive && opacity > 0f) - opacity -= 0.02f; - } - - public override float GetCloudAlpha() - { - return (1f - opacity) * 0.97f + 0.03f; - } - } -} diff --git a/Skies/AstralSkySnow.cs b/Skies/AstralSkySnow.cs deleted file mode 100644 index 277b92f4fd..0000000000 --- a/Skies/AstralSkySnow.cs +++ /dev/null @@ -1,171 +0,0 @@ -using CalamityMod.Systems; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Skies -{ - public class AstralSkySnow : CustomSky - { - private bool skyActive; - private float opacity; - - private const float Scale = 2.0f; - private const float ScreenParralaxMultiplier = 0.4f; - - public override void Deactivate(params object[] args) - { - skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && Main.LocalPlayer.ZoneSnow && !Main.LocalPlayer.ZoneDesert; - } - - public override void Reset() - { - skyActive = false; - } - - public override bool IsActive() - { - return skyActive || opacity > 0f; - } - - public override void Activate(Vector2 position, params object[] args) - { - skyActive = true; - } - - public override Color OnTileColor(Color inColor) - { - return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity); - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - // Small worlds, default draw height. - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - // Medium worlds. - if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4; - - // Large worlds (and anything bigger). - if (Main.maxTilesX >= 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140; - - // Background from here starting from the back layer to the front layer. - float width = Main.screenWidth / 2f; - float height = Main.screenHeight / 2f; - Color textureColor = new Color(116, 96, 164, 255) * opacity; - Vector2 origin = new Vector2(0f, AstralBiomeHeight); - if (maxDepth >= 9f && minDepth < 9f) - { - Texture2D texture = CalamityMod.AstralSurfaceHorizon; - int x = (int)(Main.screenPosition.X * 0.4f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.4f * ScreenParralaxMultiplier); - y -= 1380; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 8f && minDepth < 8f) - { - Texture2D texture = CalamityMod.AstralSurfaceFar; - int x = (int)(Main.screenPosition.X * 0.5f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.45f * ScreenParralaxMultiplier); - y -= 1520; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 7f && minDepth < 7f) - { - Texture2D texture = CalamityMod.AstralSnowSurfaceMiddle; - int x = (int)(Main.screenPosition.X * 0.8f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier); - y -= 1900; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 6f && minDepth < 6f) - { - Texture2D texture = CalamityMod.AstralSurfaceClose; - int x = (int)(Main.screenPosition.X * 0.9f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.55f * ScreenParralaxMultiplier); - y -= 1880; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - - Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow; - Color textureGlowColor = Color.White * 0.7f * opacity; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 5f && minDepth < 5f) - { - Texture2D texture = CalamityMod.AstralSurfaceFront; - int x = (int)(Main.screenPosition.X * 1.1f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.6f * ScreenParralaxMultiplier); - y -= 2100; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - - Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow; - Color textureGlowColor = Color.White * 0.9f * opacity; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - } - - public override void Update(GameTime gameTime) - { - if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu) - skyActive = false; - - if (skyActive && opacity < 1f) - opacity += 0.02f; - else if (!skyActive && opacity > 0f) - opacity -= 0.02f; - } - - public override float GetCloudAlpha() - { - return (1f - opacity) * 0.97f + 0.03f; - } - } -} diff --git a/Skies/AstralSkySurface.cs b/Skies/AstralSkySurface.cs deleted file mode 100644 index b4eead4ca8..0000000000 --- a/Skies/AstralSkySurface.cs +++ /dev/null @@ -1,179 +0,0 @@ -using CalamityMod.Systems; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Skies -{ - public class AstralSkySurface : CustomSky - { - private bool skyActive; - private float opacity; - - private const float Scale = 2f; - private const float ScreenParralaxMultiplier = 0.4f; - - public override void Deactivate(params object[] args) - { - skyActive = Main.LocalPlayer.Calamity().ZoneAstral && !Main.LocalPlayer.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow; - } - - public override void Reset() - { - skyActive = false; - } - - public override bool IsActive() - { - return skyActive || opacity > 0f; - } - - public override void Activate(Vector2 position, params object[] args) - { - skyActive = true; - } - - public override Color OnTileColor(Color inColor) - { - return Color.Lerp(inColor, new Color(63, 51, 90, inColor.A), opacity); - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - // Small worlds, default draw height. - int AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 2; - - // Medium worlds. - if (Main.maxTilesX >= 6400 && Main.maxTilesX < 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 4; - - // Large worlds (and anything bigger). - if (Main.maxTilesX >= 8400) - AstralBiomeHeight = (World.AstralBiome.YStart + (int)Main.worldSurface) / 140; - - // Background from here starting from the back layer to the front layer. - float width = Main.screenWidth / 2f; - float height = Main.screenHeight / 2f; - Color textureColor = new Color(63, 51, 90, 255) * opacity; - Vector2 origin = new Vector2(0f, AstralBiomeHeight); - if (maxDepth >= 9f && minDepth < 9f) - { - Texture2D texture = CalamityMod.AstralSurfaceHorizon; - int x = (int)(Main.screenPosition.X * 0.4f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.4f * ScreenParralaxMultiplier); - y -= 1380; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 8f && minDepth < 8f) - { - Texture2D texture = CalamityMod.AstralSurfaceFar; - int x = (int)(Main.screenPosition.X * 0.5f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.45f * ScreenParralaxMultiplier); - y -= 1520; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 7f && minDepth < 7f) - { - Texture2D texture = CalamityMod.AstralSurfaceMiddle; - int x = (int)(Main.screenPosition.X * 0.8f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.5f * ScreenParralaxMultiplier); - y -= 1900; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - - Texture2D textureglow = CalamityMod.AstralSurfaceMiddleGlow; - Color textureGlowColor = Color.White * 0.5f * opacity; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 6f && minDepth < 6f) - { - Texture2D texture = CalamityMod.AstralSurfaceClose; - int x = (int)(Main.screenPosition.X * 0.9f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.55f * ScreenParralaxMultiplier); - y -= 1880; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - - Texture2D textureglow = CalamityMod.AstralSurfaceCloseGlow; - Color textureGlowColor = Color.White * 0.7f * opacity; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - - if (maxDepth >= 5f && minDepth < 5f) - { - Texture2D texture = CalamityMod.AstralSurfaceFront; - int x = (int)(Main.screenPosition.X * 1.1f * ScreenParralaxMultiplier); - x %= (int)(texture.Width * Scale); - int y = (int)(Main.screenPosition.Y * 0.6f * ScreenParralaxMultiplier); - y -= 2100; // 1000 - Vector2 position = texture.Size() / 2f * Scale; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(texture, pos - position, null, textureColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - - Texture2D textureglow = CalamityMod.AstralSurfaceFrontGlow; - Color textureGlowColor = Color.White * 0.9f * opacity; - for (int k = -1; k <= 1; k++) - { - var pos = new Vector2(width - x + texture.Width * k * Scale, height - y); - spriteBatch.Draw(textureglow, pos - position, null, textureGlowColor, 0f, origin, Scale, SpriteEffects.None, 0f); - } - } - } - - public override void Update(GameTime gameTime) - { - if (!Main.LocalPlayer.Calamity().ZoneAstral || Main.gameMenu) - skyActive = false; - - if (skyActive && opacity < 1f) - opacity += 0.02f; - else if (!skyActive && opacity > 0f) - opacity -= 0.02f; - } - - public override float GetCloudAlpha() - { - return (1f - opacity) * 0.97f + 0.03f; - } - } -} diff --git a/Skies/AstralSnowSurfaceMiddle.png b/Skies/AstralSnowSurfaceMiddle.png deleted file mode 100644 index ff4e5fc23638fa5d22d98210ce60007c18f9f218..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8694 zcmeHMc{r5q{(r_;vX*2>q0}*oGKv(klu0^SN`(~DkX?yHm^1}#7*dbYET{T{2Vq;ygZbN%kY z8aT(9q)du3{^XVn0p+-uP``UIV>`IOV&+KdQzU}VWmA6G;`*h22Ps42oJKbZF=Jz6 zIT@~q1ft*NOw!n)biyYYjRt;dYiQwzoxG>>fMVOA*6h8gsH3e_jH=!FG*;MB0_1qo zSn1dDXMyfCrV={_zCX#2+l^;dmpSJFZzr9MKyvS`SRQ;)M{9~d*&7)fXZD8Y3U9gh zm=)HQ+6uBbE)E3=0B@Nw#mc0k!PB&Xt^>7CqQ+7gW6~hD=-q=LnO7h;zw54iQT5N* zt5%F&Jrdqh+sfu8qBAMeU|p&|n5En~6x{Z^~ND zr$C`1TZo}NN#a(dlq5l<=Ea}LWYE6I@4imNbAMCg`e`CPYw+ULSB;qr5k1Ad`TRwU z8$1?7fW2rb(3{SNh_RVD&vt+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R#&CYCk5P5I!Il%9fCH z<2Hb45Cqv8Kr>?cA>;j2iPFl6T9cgvr#emNE^GyD=x0o(f?)lzhC0-?Edc7|HJMdKJtp)pHKfkF7bEw`-|8A-tIqf z)j?X3e_P9cxgS_ae+NoCNKO8^jkNGTte*eOO@gu1)Bnsy`Y;C4&A+#ESSj{*Z{`1U z)ktgn|4Y?KEAk(5v1q;d<_OGyDMGuFV|hEl@*`=-QNi-_A73#6m?iR{+B&r<@jHJ f|MOv2ZdJSL$Ljl2mVHhg(lUpgU7boD{jdEu)Q6*B diff --git a/Skies/AstralSurfaceFar.png b/Skies/AstralSurfaceFar.png deleted file mode 100644 index de6901e9e46893bdc9ad1a1a1f22c3acb563047d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13320 zcmch8XIK+k_wP4;;ksh&77PF%iS-Y00DVdk0NvL%7G|fzzAR02r}*{; z-T7K8D5k*a5d1-E0{ZJ@IU=`{ES;g;C)CEnmH+MAvyAj}t=GES#eI@=y8idcd5F2y zT}^12mW4JxlOkmP`=kQ@5juv#qO|`@I4T7dA%Ot#zr5-rG?E~Q1OFA~+D<9rY!grP z_ZIxE;Fc6Y9{6Z@f26)S`CCYo@H+)GU=gnx3uWv=a2@le%UFOe*RHS-0~5M8EX{R) z#)w4TM@Fh38!WxXLnj#)>yspMd8@@{U?hK6%R9-ByP92ByU2O7Ny&lCc(`eWPJavn zR_@%e`uU2sK`EV}#-5$Q67gR;okg#wt01+zUUcdQ#lyy^f1w>;OzID0Qvcx6R*~>A zn$B(Lfc2qIEKDl;X+*7?uGxY0dpdRURey`X^cqF30?szq{4SQY@5IMGakDVLxowBS zYgn#Br}GtH;qqJ{01X?h;lCf&RY#&1)fja*pHJ#f3j9sKxJ$36%U<{6fPGr0*7{pG zvY%Ukm}CDVkLA0Ht1Vb%mcOI(MC5^P)-NugyUeDo1%pI`S4h}W(S~zD(!`wO;k$1A z(<%RyIxApkNm2LIoW}d^KwDPAM}0aU%?48|tZPf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ym8pyFV0AoObXf3c- zWAJ;jo03%nfRnTTJG1wm(L~Yjimv($2BS*}>enj)-akjS0(1cY8VKN7XGDehZLI*a zbM5^Zcn|wdTUBSnKNtY;^pR6ot~1@<_6yB+d7N`g|8Efg71{sjm?G2yA}j09>x02y zbaJQuviSckrnRr@1OX5LIwJl@&+}6NK$j{2Rszu5jR3&-&><|KZ^DTnpsV=rmi^Z} zoGZk?v`x?VnQ45*YmLF+qSM;n|78I1Bcu`Aun2o}1ps1gf!Iz|_}>fxo?~>S&%pZ_ dCkAwj{{v=Ih>$11a%BJj002ovPDHLkV1jto2VDRF diff --git a/Skies/AstralSurfaceHorizon.png b/Skies/AstralSurfaceHorizon.png deleted file mode 100644 index 8f448fb3b4bef90c3edb3ceb77d9537a20d8fcc6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3772 zcmeHIe^gV~9lwDf6y#Ss@CUys-Dyj0flLEM$*3Tr!ynbPrL}dE@&l=W8xU7dWx<$-#3n#MkOw9q$$Psm?KW3AYIcri{bTpM zci(-V_x*mppZmG@CcoLVAnz>@^UpPVHdROp7tFiT0OeUNS+QGVk8;S9YRNjU< zZKb)+dfWTho9%BU&}i#< zXP|&Y7B1~dfpDxBaD^U>G{y?F)_Ni|zrj$ti@8k7&Wo?9t$krtZzhnPrxRRfZvc!h zdmnYt#23k8J!(wXIg26qvNErTbkVQe1%7o2TpKn~czJc&9x!y_Ae1;17K#QGh}V~T zlKv~2IWF>$OWW_A?Ka9!rvhGDU9Qk9qA!H9kL#K)jV5S56EQs1*xz7D!?t=C{AU;J z2v%S8sF5p6JJk?Pzso&UpA$r`^1urAVkkMK$N72^*6z#0&{$9jn9Y0i32@?^kE(!C zzPyy0K>N-foygj7$7uVe5%l(!S*^yG~L%H<1Dt3vKTPq3-r4< zc$>7_g>%zB zsdzzq-SnyXFbEpCNf9NA2l|N`;aU1Z@fLn$t8YzC(YYB1*RuEuFWk9d`Vu`tzvtH& z1C#pf#Z!q@Ywks6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&8wo0W|Cqi%0~TMxI2Pi05;$z9km*E*s?1#Mj- zRl3E6M^qJ|yo&(TMKtvv>YG}Upl>p$XDr$Z)58)YYWl=2#=wKn4ENIL2*=6K7SPPb z;bmDM7nks|0+%KjmWK-Dz`nk~_kpjc3RpZiJ_zZ0z;F1448^+$c2bV8CPM(sn_;nq zZ{RXKc!QM(05okIQ From 43df7aabfadec51c0fe70d6283bebe89a7c352b3 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 13 May 2024 15:21:38 -0700 Subject: [PATCH 43/48] NER rarity fix --- Items/Weapons/Ranged/NitroExpressRifle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index fcaa47df0d..8964b33364 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -29,13 +29,13 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7.5f; - Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.UseSound = FireSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; - Item.rare = ModContent.RarityType(); + Item.rare = ItemRarityID.LightRed; Item.Calamity().canFirePointBlankShots = true; } From c3f416ce6fcca2cef9679fca59f120a1dfdcb7f1 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 13 May 2024 19:00:35 -0400 Subject: [PATCH 44/48] Fixed the Stealth Meter having a delay between appearing full and being full --- UI/MiscTextures/StealthMeterBar.png | Bin 244 -> 210 bytes UI/MiscTextures/StealthMeterBarFull.png | Bin 246 -> 228 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/UI/MiscTextures/StealthMeterBar.png b/UI/MiscTextures/StealthMeterBar.png index 36d0552574689f73d2d5a1a46fa32b157f3e6576..64a040088cd7e0627de21947fa741a23e2dea551 100644 GIT binary patch delta 188 zcmeyuc!^Q5Gr-TCmrII^fq{Y7)59eQNUH#`6bBoSykGFob)up|J!gSOWHAE+-(e7D zJf6QI1t^*B>EamT;hikOx;R0krzy~Y%k7{6dr!cug@-Dh)oTdrPk0pAvZ;gl{JuNw zn?5x6ZGM@s-Jr3unZv+u(|uMx$$D+Y4GfA0(zW?g1=;On>o`*%vP<{xWxm|3*Wz|i h17vIhBQrC@9Cso9iPz>eo&eg(;OXk;vd$@?2>{OGJn#Sj delta 222 zcmcb__=QoiGr-TCmrII^fq{Y7)59eQNSgq$6bBoS{Bf^-?LIW82|tP diff --git a/UI/MiscTextures/StealthMeterBarFull.png b/UI/MiscTextures/StealthMeterBarFull.png index 86048fd0978b4a01df37bef3df1be2bc0eeb9274..92f0fe7dc6983ba622ff38283585f3df6c3c0421 100644 GIT binary patch delta 152 zcmeyy_=HihGr-TCmrII^fq{Y7)59eQNUH#`6bBoSykGFob)urFRHdhjV~B@$vIOhm z1d*PmKm#tfg9hw90kalPELRC&E#nrRVcx;;_}7xX4<c z%5t7lO-)}92C!*0w7yxuy%4NjLn7k90S1P`mm*j0ol2?%TE^h%>gTe~DWM4frg$^B delta 170 zcmaFD_>EDqGr-TCmrII^fq{Y7)59eQNSgq$6bBoS{Bf^-?LM zVNDfe|F_4QE!FYhuLKQd(E~|l1@nyK%=vdqNWsly<1;W|V0fM<#{T@5T@TQD22WQ% Jmvv4FO#p76Gu{9I From 3c881ac6b634e56fb2349e05bd43ed87f3771e23 Mon Sep 17 00:00:00 2001 From: apotofkoolaid <72956636+apotofkoolaid@users.noreply.github.com> Date: Mon, 13 May 2024 19:13:02 -0500 Subject: [PATCH 45/48] Once again fixed Sandstorm music playing in Astral Deserts This issue cropped up again from the Astral's code overhaul --- BiomeManagers/AstralInfectionBiome.cs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/BiomeManagers/AstralInfectionBiome.cs b/BiomeManagers/AstralInfectionBiome.cs index 264845baae..980d34e0da 100644 --- a/BiomeManagers/AstralInfectionBiome.cs +++ b/BiomeManagers/AstralInfectionBiome.cs @@ -1,7 +1,7 @@ using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Systems; using Terraria; -using Terraria.Graphics.Effects; +using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +10,7 @@ namespace CalamityMod.BiomeManagers public class AstralInfectionBiome : ModBiome { public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); + public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle { get @@ -42,11 +43,28 @@ namespace CalamityMod.BiomeManagers } public override int BiomeTorchItemType => ModContent.ItemType(); - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; + + public override SceneEffectPriority Priority + { + get + { + if (Main.LocalPlayer.ZoneDesert && Sandstorm.Happening && !(Main.LocalPlayer.ZoneSnow || Main.slimeRain || Main.eclipse)) + { + return SceneEffectPriority.Environment; + } + else + { + return SceneEffectPriority.BiomeHigh; + } + } + } + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon"; + public override string BackgroundPath { - get { + get + { if (Main.LocalPlayer.ZoneDesert && !Main.LocalPlayer.ZoneSnow) { //desert From f094139bd9fb42b8d9adb6288146a7a8f5bd2c61 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 13 May 2024 19:01:52 -0600 Subject: [PATCH 46/48] Slick Cane tier shift + tweaks $$$ --- Items/Weapons/Rogue/SlickCane.cs | 14 +++---- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 3 +- NPCs/CalamityGlobalTownNPC.cs | 9 +++++ NPCs/TownNPCs/THIEF.cs | 2 +- Projectiles/Rogue/SlickCaneProjectile.cs | 37 +++++++++++++++++-- 5 files changed, 53 insertions(+), 12 deletions(-) diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 09d437d088..22ee59fe16 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -19,14 +19,14 @@ namespace CalamityMod.Items.Weapons.Rogue Item.channel = true; Item.useAnimation = 26; Item.useTime = 26; - Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 5f; + Item.useStyle = ItemUseStyleID.Shoot; + Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 22f; + Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; } @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 0.75f * (float)player.direction; - int projectileIndex = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, ai0, 0f); + float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 1.5f * (float)player.direction; + int projectileIndex = Projectile.NewProjectile(source, position.X, position.Y+100, velocity.X*2f, velocity.Y*2f, type, damage, knockback, player.whoAmI, ai0, 0f); if (projectileIndex.WithinBounds(Main.maxProjectiles)) Main.projectile[projectileIndex].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index d92ae3dc73..abd9755e31 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1084,7 +1084,8 @@ SlickCane: { Tooltip: ''' Swipes a cane that steals money from enemies - Stealth strikes gives a 1 in 15 chance for enemies to drop 1-3 gold coins when hit + Stealth strikes gives a 1 in 20 chance for enemies to drop 1-3 gold coins when hit + Stealth strikes' damage increases in proportion to money in the inventory (up to 2 platinum) 'Economy at its finest' ''' } diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 7800b4b05b..bd3ec4b36b 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -17,6 +17,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -1064,6 +1065,14 @@ namespace CalamityMod.NPCs defense += 20; } } + + public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) + { + //Not an axe but close enough + if (npc.type == NPCID.TaxCollector && projectile.type == ModContent.ProjectileType()) + return true; + return base.CanBeHitByProjectile(npc, projectile); + } #endregion #region Shop Stuff diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index ca0b761bf9..6fa9b34140 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs.TownNPCs .Add(ItemID.TigerClimbingGear) .AddWithCustomValue(ItemID.InvisibilityPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) .AddWithCustomValue(ItemID.NightOwlPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25), Condition.Hardmode) + .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25)) .Add(ModContent.ItemType(), Condition.DownedPirates) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 60), Condition.DownedMechBossAll) .Add(ModContent.ItemType(), downedCalclone) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 4c1acff6de..6c7d751b4d 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -1,9 +1,13 @@ using System; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -21,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = 42; Projectile.height = 36; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.timeLeft = 90; + Projectile.timeLeft = 120; Projectile.friendly = true; Projectile.hostile = false; Projectile.tileCollide = false; @@ -32,6 +36,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 2; Projectile.alpha = 180; + Projectile.scale = 1.25f; } public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; public override float TravelSpeed => 8f; @@ -80,11 +85,13 @@ namespace CalamityMod.Projectiles.Rogue float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); // Maximum of 50 silver, not counting steath strikes moneyValueToDrop = (int)MathHelper.Clamp(moneyValueToDrop, 0, 5000f); - if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(15)) + if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(20)) { moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 4), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); + SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center); } - + else if (moneyValueToDrop > 0f) + SoundEngine.PlaySound(TheSevensStriker.DoublesSound, Projectile.Center); while (moneyValueToDrop > 10000f) { int modifiedMoneyValue = (int)(moneyValueToDrop / 10000f); @@ -133,5 +140,29 @@ namespace CalamityMod.Projectiles.Rogue } } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + // Boost dmg in proportion to money, caps at 2 plat + if (Projectile.Calamity().stealthStrike) + { + Player player = Main.player[Projectile.owner]; + long money = Utils.CoinsCount(out bool overflow, player.inventory); + if (money >= 2000000) + money = 2000000; + if (money != 0) + { + modifiers.SourceDamage *= money / 500000 + 1; + SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); + for (int j = 0; j < 8; j++) + { + int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 3f); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity *= 5f; + dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 2f); + Main.dust[dust2].velocity *= 2f; + } + } + } + } } } From 471d640379d432ecf7aaff3fd8ebabd4610bb2f8 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 13 May 2024 19:23:50 -0600 Subject: [PATCH 47/48] double the money (calculation) --- Projectiles/Rogue/SlickCaneProjectile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 6c7d751b4d..5e325c56e6 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -146,12 +146,12 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.Calamity().stealthStrike) { Player player = Main.player[Projectile.owner]; - long money = Utils.CoinsCount(out bool overflow, player.inventory); + double money = Utils.CoinsCount(out bool overflow, player.inventory); if (money >= 2000000) money = 2000000; if (money != 0) { - modifiers.SourceDamage *= money / 500000 + 1; + modifiers.SourceDamage *= (float)(money / 500000 + 1); SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); for (int j = 0; j < 8; j++) { From 794cb9684775e636856a37c3c007ff577e43a6eb Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Mon, 13 May 2024 18:59:05 -0700 Subject: [PATCH 48/48] blood particles go rainbow with blood off --- Particles/BloodParticle.cs | 6 ++++++ Particles/BloodParticle2.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Particles/BloodParticle.cs b/Particles/BloodParticle.cs index 9bb8333486..bfe3e02e8f 100644 --- a/Particles/BloodParticle.cs +++ b/Particles/BloodParticle.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.Particles @@ -31,6 +32,11 @@ namespace CalamityMod.Particles Velocity.Y = MathHelper.Clamp(Velocity.Y + 0.9f, -22f, 22f); Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); Rotation = Velocity.ToRotation() + MathHelper.PiOver2; + // Cycle through disco colors if blood and gore is off + if (!ChildSafety.Disabled) + { + Color = Main.DiscoColor; + } } public override void CustomDraw(SpriteBatch spriteBatch) diff --git a/Particles/BloodParticle2.cs b/Particles/BloodParticle2.cs index ee8b9bf707..53320c9c1b 100644 --- a/Particles/BloodParticle2.cs +++ b/Particles/BloodParticle2.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.Particles @@ -29,6 +30,11 @@ namespace CalamityMod.Particles Velocity *= 0.98f; Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 4D)); Rotation = Velocity.ToRotation(); + // Cycle through disco colors if blood and gore is off + if (!ChildSafety.Disabled) + { + Color = Main.DiscoColor; + } } public override void CustomDraw(SpriteBatch spriteBatch)