Files
CalamityModPublic/Projectiles/Melee/ChaosFlameLarge.cs
T

72 lines
2.3 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ChaosFlameLarge : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Flame");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
{
projectile.width = 28;
projectile.height = 28;
projectile.aiStyle = 44;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = 1;
projectile.timeLeft = 600;
aiType = ProjectileID.SporeCloud;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 4)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame >= Main.projFrames[projectile.type])
{
projectile.frame = 0;
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f);
if (Main.rand.NextBool(4))
{
int num469 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 174, 0f, 0f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
}
}
public override void Kill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
int num469 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, 0f, 0f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.OnFire, 180);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, Main.DiscoG, 53, projectile.alpha);
}
}
}