Files
CalamityModPublic/Buffs/Summon/ShellfishBuff.cs
T
DominicKarma42 55e89c9b98 Replaced (hopefully) every magic number with a constant
Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
2020-05-30 17:56:36 -04:00

37 lines
1021 B
C#

using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class ShellfishBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Shellfish");
Description.SetDefault("The shellfish will protect you");
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<Shellfish>()] > 0)
{
modPlayer.shellfish = true;
}
if (!modPlayer.shellfish)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}