Files
CalamityModPublic/Projectiles/Summon/DaedalusPellet.cs
T
CongratsIsTrash 45089b464d Even more debuff fixes
Plus changed mage Bloodflare set bonus
2024-06-06 14:32:53 -04:00

64 lines
2.1 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class DaedalusPellet : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 3;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 10;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.alpha = 255;
Projectile.timeLeft = 600;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Projectile.frameCounter++;
if (Projectile.frameCounter > 4)
{
Projectile.frame++;
if (Projectile.frame >= 3)
{
Projectile.frame = 0;
}
Projectile.frameCounter = 0;
}
if (Projectile.ai[0] == 0f)
{
Projectile.ai[0] = 1f;
SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFuryShot, Projectile.Center);
}
Projectile.alpha = Utils.Clamp(Projectile.alpha - 50, 0, 255);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 180);
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, 255, 255, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor);
return false;
}
}
}