Files
CalamityModPublic/Buffs/Pets/DannyDevito.cs
T

30 lines
1.0 KiB
C#

using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class DannyDevito : ModBuff
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Danny Devito");
Description.SetDefault("The trash man is following you.");
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().trashMan = true;
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<DannyDevitoPet>()] <= 0;
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<DannyDevitoPet>(), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
}