30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using CalamityMod.Projectiles.Pets;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Buffs.Pets
|
|
{
|
|
// Regardless of what Reddit or others may think, let this code comment serve as evidence
|
|
// that Akato is not in any way canon, and is not in fact the son of Yharon in any capacity.
|
|
public class AkatoBuff : 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().akato = true;
|
|
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<Akato>()] <= 0;
|
|
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
|
|
{
|
|
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<Akato>(), 0, 0f, player.whoAmI);
|
|
}
|
|
}
|
|
}
|
|
}
|