Files
CalamityModPublic/Buffs/Pets/PlaguebringerBabBuff.cs
T

30 lines
1.1 KiB
C#

using CalamityMod.Projectiles.Pets;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class PlaguebringerBabBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Plaguebringer Bab");
Description.SetDefault("The baby plaguebringer sees you as the queen");
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().plaguebringerBab = true;
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<PlaguebringerBab>()] <= 0;
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
int bee = Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, ModContent.ProjectileType<PlaguebringerBab>(), 0, 0f, player.whoAmI, 0f, 0f);
Main.projectile[bee].frame = 2;
}
}
}
}