Files
CalamityModPublic/Buffs/Summon/CalamarisLamentBuff.cs
T
2023-09-17 12:00:52 -04:00

36 lines
989 B
C#

using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class CalamarisLamentBuff : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
//Main.persistentBuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<CalamarisLamentMinion>()] > 0)
{
modPlayer.CalamarisLament = true;
}
if (!modPlayer.CalamarisLament)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}