From 093678d65dc900008f2294686da004d50d47bf77 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 21 Nov 2025 20:18:47 -0500 Subject: [PATCH] Added Bottled Panacea --- Cooldowns/PanaceaCooldown.cs | 18 +++++ Cooldowns/PanaceaCooldown.png | Bin 0 -> 387 bytes Cooldowns/PanaceaCooldownOutline.png | Bin 0 -> 235 bytes Cooldowns/PanaceaCooldownOverlay.png | Bin 0 -> 198 bytes Items/Potions/BottledPanacea.cs | 67 ++++++++++++++++++ Items/Potions/BottledPanacea.png | Bin 0 -> 399 bytes .../Mods.CalamityMod.Items.Potions.hjson | 9 +++ Localization/en-US/Mods.CalamityMod.UI.hjson | 1 + NPCs/SunkenSea/PolypPanasea.cs | 4 +- 9 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 Cooldowns/PanaceaCooldown.cs create mode 100644 Cooldowns/PanaceaCooldown.png create mode 100644 Cooldowns/PanaceaCooldownOutline.png create mode 100644 Cooldowns/PanaceaCooldownOverlay.png create mode 100644 Items/Potions/BottledPanacea.cs create mode 100644 Items/Potions/BottledPanacea.png diff --git a/Cooldowns/PanaceaCooldown.cs b/Cooldowns/PanaceaCooldown.cs new file mode 100644 index 0000000000..cc2e416f71 --- /dev/null +++ b/Cooldowns/PanaceaCooldown.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using Terraria.Audio; +using Terraria.Localization; + +namespace CalamityMod.Cooldowns +{ + public class PanaceaCooldown : CooldownHandler + { + public static new string ID => "Panacea"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/PanaceaCooldown"; + public override Color OutlineColor => new Color(122, 198, 255); + public override Color CooldownStartColor => new Color(0, 128, 255); + public override Color CooldownEndColor => new Color(0, 255, 255); + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/PotionSicknessOver"); + } +} diff --git a/Cooldowns/PanaceaCooldown.png b/Cooldowns/PanaceaCooldown.png new file mode 100644 index 0000000000000000000000000000000000000000..290132735c2d86b7887071494d51fa1dc75f6145 GIT binary patch literal 387 zcmV-}0et?6P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0T@X{K~y+Tz0y5P zLQx#R;YSICpiKm!&)^4exd;w{b6ZopUm%*xtyO4k5JQ@R1{W6{baHEH5gHsE3JP(! zO$UxI7=gFnbpB^J_u-tI^T)0(j?;L)dHBl3b3Psp(c0;|YBrlGj7B5ye18repYFi> z+Xs>K|Aax-Xf(idIt8=Y3|wEHvO}7^a8p*TR>5#M1mp1-e81j; z$miF;QK?jj?r^zWfbh$Nx;d=5&b5-69;pxthhrSK>$ zYPA~Z^?F32(59@@=@7|62N!O=@@lnW&z%KXzu({bhh-`Z)$8>Xk|bH%9}EWUk%h7s hhJrNon=Ev2;SZ#@Y*PPue%1g0002ovPDHLkV1hm#pf>;j literal 0 HcmV?d00001 diff --git a/Cooldowns/PanaceaCooldownOutline.png b/Cooldowns/PanaceaCooldownOutline.png new file mode 100644 index 0000000000000000000000000000000000000000..f31edcf0b449a5d8be2ce60e7116f21003bf383e GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!3Iwk#}E(it5Y1g4k+-j%>MWP{KreWn|2(@ z5-!Md>$T>(wY6h+wY{0~>*Eie9lFosFDs~e%;x%KUZ+2euesvp=PBHGxcgG)MtuH; z*)mfk_k4K0{!r~F-XBL|cigvRTjjrxF@RHPQEe%kf)`8L^{dhhQv9b dzfCXMc%>`)mz~$m&;h!I!PC{xWt~$(69Dd}SP=jK literal 0 HcmV?d00001 diff --git a/Cooldowns/PanaceaCooldownOverlay.png b/Cooldowns/PanaceaCooldownOverlay.png new file mode 100644 index 0000000000000000000000000000000000000000..7d72fd3769a6ed54d09db0e8465025d39a481f19 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?}78*1_d5x$H#x)$AmXViR>4= zuO}_3p`@FZ_RO5&$K1a=0>4(R)_CRm()!^Von_+hPR;PE(7GJ^GvwGm(S5&9ufC*_ oY^5meS#7jTe3ORk$s47KjFIy+#P7Sifn3Sp>FVdQ&MBb@007cK5C8xG literal 0 HcmV?d00001 diff --git a/Items/Potions/BottledPanacea.cs b/Items/Potions/BottledPanacea.cs new file mode 100644 index 0000000000..347e59c2f1 --- /dev/null +++ b/Items/Potions/BottledPanacea.cs @@ -0,0 +1,67 @@ +using CalamityMod.Cooldowns; +using CalamityMod.DataStructures; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Potions +{ + public class BottledPanacea : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Potions"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 20; + ItemID.Sets.DrinkParticleColors[Type] = new Color[2] { + new Color(84, 215, 254), + new Color(35, 101, 192) + }; + } + + public override void SetDefaults() + { + Item.UseSound = SoundID.Item3; + Item.useStyle = ItemUseStyleID.DrinkLiquid; + Item.useTurn = true; + Item.useTime = Item.useAnimation = 17; + Item.maxStack = Item.CommonMaxStack; + Item.consumable = true; + Item.value = Item.sellPrice(silver: 2); + Item.rare = ItemRarityID.Blue; + } + + public override bool CanUseItem(Player player) => !player.HasCooldown(PanaceaCooldown.ID); + + public override bool? UseItem(Player player) + { + if (player.itemAnimation > 0 && player.itemTime == 0) + { + player.itemTime = Item.useTime; + SoundEngine.PlaySound(SoundID.Item4, player.Center); + + for (int i = Player.MaxBuffs - 1; i >= 0; i--) + { + int buffType = player.buffType[i]; + if (BuffDatasets.DebuffDataset[buffType] is not null && (BuffDatasets.DebuffDataset[buffType].SicknessDebuffScaling > 0 || BuffDatasets.DebuffDataset[buffType].ElectricDebuffScaling > 0)) + player.DelBuff(i); + } + + for (int i = 0; i < 4; i++) + { + Vector2 plusVel = new Vector2(Main.rand.NextFloat(-0.55f, 0.55f), Main.rand.NextFloat(-6f, 0f)); + HealingPlus plus = new(Main.rand.NextVector2FromRectangle(player.Hitbox), Main.rand.NextFloat(1.25f, 1.5f), plusVel, Color.SkyBlue, Color.SkyBlue, 20); + GeneralParticleHandler.SpawnParticle(plus); + } + for (int d = 0; d < 10; d++) + Dust.NewDust(player.position, player.width, player.height, DustID.BlueTorch); + + player.AddCooldown(PanaceaCooldown.ID, CalamityUtils.SecondsToFrames(30)); + } + return true; + } + } +} diff --git a/Items/Potions/BottledPanacea.png b/Items/Potions/BottledPanacea.png new file mode 100644 index 0000000000000000000000000000000000000000..8a98e6f6bfceac88cf4ff96ec22e18785a28ae1c GIT binary patch literal 399 zcmV;A0dW3_P)Px#1ZP1_K>z@;j|==^1poj6IY~r8R5(w)(mzN7VHn5p??n*^wP~{{Efvz#)E|n% zDTHWi5TvEi&72D&CPujB@k>V5CjnlLPEC#9Sa0;xQ6$hcrUF8?(Mg{_dM^* z%ZK+li$CUIH{|N|(N)*d>k+*OBEH*)CAL>~0VbzY60*RjRFum-UgsndoVNQQIXx8kEu>wEh2HeHQel}jp=a!<`WG7x~lt` z;Dz#W(q94~NgIH+h`daBGAq?r`)M11SMTj4feQzwe7zO|P57;>aysx2V^k=KFJ@hU tNNUH|@7M+SK_)RTl!#RFn@ke8@B^kTXaFom=t%$o002ovPDHLkV1jrEpeg_W literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index fe583cd6b0..8f627dff88 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -36,6 +36,15 @@ BlasphemousDonut: { ''' } +BottledPanacea: { + DisplayName: Bottled Panacea + Tooltip: + ''' + Cures you of all sickness and electricity debuffs when consumed + This has a 30 second cooldown + ''' +} + BoundingPotion: { DisplayName: Bounding Potion Tooltip: "{0}% increased jump speed and {1}% increased jump height" diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 447903f9c0..87001e5c43 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -127,6 +127,7 @@ Cooldowns: { OldDukeScalesFatigue: Stamina OmegaBlueActive: Abyssal Madness OmegaBlueCooldown: Abyssal Madness Cooldown + Panacea: Panacea Cooldown PermafrostConcoction: Permafrost's Concoction Cooldown PlagueBlackout: Plague Blackout Cooldown PotionSickness: Healing Cooldown diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index 384e6de48e..8d25c15808 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -16,6 +16,7 @@ using CalamityMod.Enums; using System.IO; using CalamityMod.Particles; using Terraria.Audio; +using CalamityMod.Items.Potions; namespace CalamityMod.NPCs.SunkenSea { @@ -480,8 +481,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (PanaceaTimer > 60) { - // TODO: add actual panacea item - Item.NewItem(NPC.GetSource_CatchEntity(NPC), (int)NPC.Center.X, (int)NPC.Center.Y, 1, 1, ItemID.FlaskofPoison); + Item.NewItem(NPC.GetSource_CatchEntity(NPC), (int)NPC.Center.X, (int)NPC.Center.Y, 1, 1, ModContent.ItemType()); PanaceaTimer = 60; } return false;