33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Healing
|
|
{
|
|
public class TransfusionTrail : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Healing";
|
|
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = Projectile.height = 4;
|
|
Projectile.friendly = true;
|
|
Projectile.tileCollide = false;
|
|
Projectile.MaxUpdates = 4;
|
|
Projectile.timeLeft = 120 * Projectile.MaxUpdates;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f);
|
|
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.VampireHeal, 0f, 0f, 100);
|
|
Main.dust[dust].noGravity = true;
|
|
Main.dust[dust].velocity *= 0f;
|
|
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
|
|
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
|
|
}
|
|
}
|
|
}
|