28 lines
951 B
C#
28 lines
951 B
C#
using CalamityMod.Projectiles.Pets;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Buffs.Pets
|
|
{
|
|
public class PineappleBuff : ModBuff
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.buffNoTimeDisplay[Type] = true;
|
|
Main.vanityPet[Type] = true;
|
|
}
|
|
|
|
public override void Update(Player player, ref int buffIndex)
|
|
{
|
|
player.buffTime[buffIndex] = 18000;
|
|
player.Calamity().pineapplePet = true;
|
|
bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<PineapplePetProj>()] <= 0;
|
|
if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer)
|
|
{
|
|
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<PineapplePetProj>(), 0, 0f, player.whoAmI);
|
|
}
|
|
}
|
|
}
|
|
}
|