Files
CalamityModPublic/Projectiles/Boss/DoGDeath.cs
T

53 lines
1.5 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class DoGDeath : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Death Beam");
}
public override void SetDefaults()
{
projectile.width = 10;
projectile.height = 10;
projectile.hostile = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.alpha = 255;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
projectile.timeLeft = 300;
cooldownSlot = 1;
}
public override void AI()
{
if (projectile.alpha > 0)
{
projectile.alpha -= 25;
}
if (projectile.alpha < 0)
{
projectile.alpha = 0;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, 255, 255, projectile.alpha);
}
}
}