Files
CalamityModPublic/Projectiles/Summon/IceClasperSummonProjectile.cs
T
GinYuH 177940845d TP support for vanilla-based projectiles
FeatherLarge is just a straight up resprite as the vanilla sprite it used was updated
Also the Belladonna seed is now animated (breaking critical change)
2024-10-22 21:32:54 -07:00

51 lines
1.7 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class IceClasperSummonProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/Melee/DarkIceZero";
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
ProjectileID.Sets.TrailingMode[Type] = 2;
ProjectileID.Sets.TrailCacheLength[Type] = 5;
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Summon;
Projectile.timeLeft = 300;
Projectile.width = Projectile.height = 28;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
if (!Main.dedServ)
{
Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.5f);
trailDust.noGravity = true;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 120);
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1);
return true;
}
}
}