Added Bottled Panacea
This commit is contained in:
1 parent
447c61e2b3
commit
093678d65d
9 files changed
+97
-2
No files matched your search
@@ -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");
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 387 B |
Binary file not shown.
|
After Width: | Height: | Size: 235 B |
Binary file not shown.
|
After Width: | Height: | Size: 198 B |
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 399 B |
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<BottledPanacea>());
|
||||
PanaceaTimer = 60;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user