Adjusts The Concoction
Can now be used if quick heal is spammed and heals enough that you can never accidentally quick heal with it if you have another healing potion in your inventory
This commit is contained in:
1 parent
14e23dadcd
commit
efe39d5a04
5 files changed
+65
-10
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using System;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -16,6 +17,7 @@ namespace CalamityMod.Buffs.Potions
|
||||
public class SwinesWrathBuff : ModBuff
|
||||
{
|
||||
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
|
||||
public static readonly SoundStyle TimerSound2 = new("CalamityMod/Sounds/Custom/TickingTimerReverb");
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -33,10 +35,14 @@ namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
|
||||
concoctionPlayer.swinesWrathCounter = -1;
|
||||
concoctionPlayer.spamTimer = 0;
|
||||
}
|
||||
|
||||
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
|
||||
{
|
||||
SoundEngine.PlaySound(TimerSound2 with { Volume = MathF.Pow((600f - concoctionPlayer.swinesWrathCounter) / 600f, 2) * 0.8f, MaxInstances = -1 }, player.Center); // Gets louder as time progresses
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f), MaxInstances = -1 }, player.Center); // Gets louder as time progresses
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Scenes.MusicScenes;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
@@ -15,7 +18,7 @@ namespace CalamityMod.Items.Potions
|
||||
public class TheConcoction : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static int healValue = 9999;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
@@ -26,15 +29,16 @@ namespace CalamityMod.Items.Potions
|
||||
new Color(246, 34, 79)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToHealingPotion(50, 56, 500);
|
||||
Item.DefaultToHealingPotion(50, 56, healValue);
|
||||
Item.value = Item.buyPrice(gold: 1);
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
TheConcoctionPlayer concoctionPlayer = player.GetModPlayer<TheConcoctionPlayer>();
|
||||
@@ -59,12 +63,39 @@ namespace CalamityMod.Items.Potions
|
||||
public class TheConcoctionPlayer : ModPlayer
|
||||
{
|
||||
public int swinesWrathCounter = -1;
|
||||
public int spamTimer = 0;
|
||||
public bool holdingHeal = false;
|
||||
|
||||
public int hoverTimer = 0;
|
||||
public bool wasHovering = false;
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (!holdingHeal && Player.controlQuickHeal && spamTimer >= 0 && Player.InventoryHas(ModContent.ItemType<TheConcoction>()))
|
||||
{
|
||||
Vector2 vel = -Vector2.UnitY.RotatedByRandom(0.4f);
|
||||
Particle chug = new CustomSpark(Player.Center + vel * 35, vel * Main.rand.NextFloat(2, 3), "CalamityMod/Items/Potions/TheConcoction", false, 22, 0.6f, Color.White, Vector2.One, false, false, 0, false, false, noShrink: true, spin: 0.01f * Math.Sign(vel.X));
|
||||
GeneralParticleHandler.SpawnParticle(chug);
|
||||
SoundStyle tryChug = new("CalamityMod/Sounds/Custom/AbilitySounds/PotionSicknessOver");
|
||||
SoundEngine.PlaySound(tryChug with { pitch = Main.rand.NextFloat(0.6f, 0.8f), MaxInstances = -1 }, Player.Center);
|
||||
spamTimer += 80;
|
||||
if (spamTimer > 230)
|
||||
spamTimer = 230;
|
||||
holdingHeal = true;
|
||||
}
|
||||
if (!Player.controlQuickHeal)
|
||||
holdingHeal = false;
|
||||
if (spamTimer > 0)
|
||||
spamTimer--;
|
||||
if (spamTimer >= 180)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item3, Player.Center);
|
||||
Player.HealPlayer(TheConcoction.healValue);
|
||||
Player.ConsumeItem(ModContent.ItemType<TheConcoction>());
|
||||
swinesWrathCounter = 1200;
|
||||
spamTimer = -1;
|
||||
}
|
||||
|
||||
if (swinesWrathCounter > 0)
|
||||
{
|
||||
swinesWrathCounter--;
|
||||
|
||||
@@ -159,8 +159,8 @@ SupremeManaPotion: {
|
||||
|
||||
TheConcoction: {
|
||||
DisplayName: The Concoction
|
||||
EasterEggText: Removes 500 life
|
||||
Tooltip: ""
|
||||
EasterEggText: Removes 9999 life
|
||||
Tooltip: "Can even be used while you have potion sickness if Quick Heal is repeatedly pressed"
|
||||
SalesPitch:
|
||||
'''
|
||||
'Aren't you tired of how unreliable your healing potions are? What if you're in the middle of a zombie horde and sick to the core of those things?!'
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using CalamityMod.Items.Potions;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Scenes.MusicScenes
|
||||
{
|
||||
public class TheConcoctionMusicScene : ModSceneEffect
|
||||
{
|
||||
public override bool IsSceneEffectActive(Player player)
|
||||
{
|
||||
TheConcoctionPlayer concoctionPlayer = Main.LocalPlayer.GetModPlayer<TheConcoctionPlayer>();
|
||||
return (concoctionPlayer.swinesWrathCounter <= 600 && concoctionPlayer.swinesWrathCounter != -1);
|
||||
}
|
||||
public override int Music => MusicLoader.GetMusicSlot(Mod, "Sounds/Music/Silence");
|
||||
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user