35 lines
755 B
C#
35 lines
755 B
C#
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Buffs
|
|
{
|
|
public class AngryChicken : ModBuff
|
|
{
|
|
public override void SetDefaults()
|
|
{
|
|
DisplayName.SetDefault("Son of Yharon");
|
|
Description.SetDefault("The Son of Yharon will protect you");
|
|
Main.buffNoTimeDisplay[Type] = true;
|
|
Main.buffNoSave[Type] = true;
|
|
}
|
|
|
|
public override void Update(Player player, ref int buffIndex)
|
|
{
|
|
CalamityPlayer modPlayer = player.GetModPlayer<CalamityPlayer>(mod);
|
|
if (player.ownedProjectileCounts[mod.ProjectileType("AngryChicken")] > 0)
|
|
{
|
|
modPlayer.aChicken = true;
|
|
}
|
|
if (!modPlayer.aChicken)
|
|
{
|
|
player.DelBuff(buffIndex);
|
|
buffIndex--;
|
|
}
|
|
else
|
|
{
|
|
player.buffTime[buffIndex] = 18000;
|
|
}
|
|
}
|
|
}
|
|
}
|