From 7ccfd8ff2b7cb0cae75390cd3d23632bd27e80b9 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 18 May 2022 17:02:38 -0500 Subject: [PATCH] Rainbow cursor support --- ILEditing/MechanicILChanges.cs | 9 +++++++-- Items/Accessories/Calamity.cs | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 9167390c3a..5d85763c48 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -403,12 +403,12 @@ namespace CalamityMod.ILEditing // If the blazing mouse is actually going to do damage, draw an indicator aura. if (Main.LocalPlayer.Calamity().blazingCursorDamage && !Main.mapFullscreen) { - int size = 410; + int size = 375; float scale = MathHelper.Max(Main.screenWidth, Main.screenHeight) / size; ref FluidField calamityFireDrawer = ref Main.LocalPlayer.Calamity().CalamityFireDrawer; ref Vector2 firePosition = ref Main.LocalPlayer.Calamity().FireDrawerPosition; if (calamityFireDrawer is null || calamityFireDrawer.Size != size) - calamityFireDrawer = FluidFieldManager.CreateField(size, scale, 0.08f, 20f, 0.99f); + calamityFireDrawer = FluidFieldManager.CreateField(size, scale, 0.08f, 20f, 0.992f); // Update the fire draw position. firePosition = new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; @@ -421,6 +421,11 @@ namespace CalamityMod.ILEditing calamityFireDrawer.UpdateAction = () => { Color color = Color.Lerp(Color.Red, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 6f) * 0.5f + 0.5f); + + // Use a rainbow color if the player has the rainbow cursor equipped as well as Calamity. + if (Main.LocalPlayer.hasRainbowCursor) + color = Color.Lerp(color, Main.hslToRgb(Main.GlobalTimeWrappedHourly * 0.97f % 1f, 1f, 0.6f), 0.75f); + int horizontalArea = 2; int verticalArea = 2; diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 9f0b3e7963..c54eaffd5f 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Calamity"); Tooltip.SetDefault("Lights your cursor ablaze with the Witch's flames, summoning a burning sigil around it\n" + "Enemies touching the sigil take immense damage and are inflicted with Vulnerability Hex\n" + - "Equip in a vanity slot to change the cursor without dealing damage"); + "Equip in a vanity slot to change the cursor without dealing damage\n" + + "These changes work in conjunction with the Rainbow Cursor"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); }