Files
CalamityModPublic/Projectiles/Typeless/EmpyreanGlob.cs
T
CongratsIsTrash e0e167346e Added ProjectileID.Sets.CultistIsResistantTo on every homing projectile in Calamity
This does nothing for Calamity since we disable Cultist's homing resist.
However, since this is effectively used as a homing projectile set, this will help with crossmod compatibility.
I ask that everyone else who changes homing projectiles in any way to help maintain this.
2024-09-09 23:52:07 -04:00

36 lines
1.2 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class EmpyreanGlob : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true;
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.alpha = 100;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 200;
}
public override void AI()
{
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 4f)
{
int ourpleDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurpleTorch, 0f, 0f, 100, default, 1f);
Main.dust[ourpleDust].noGravity = true;
Main.dust[ourpleDust].velocity *= 0f;
}
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 8f, 20f);
}
}
}