63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Magic
|
|
{
|
|
public class NuclearFuryProjectile : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Nuclear Fury");
|
|
Main.projFrames[projectile.type] = 3;
|
|
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
|
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 60;
|
|
projectile.height = 60;
|
|
projectile.alpha = 255;
|
|
projectile.friendly = true;
|
|
projectile.aiStyle = 71;
|
|
projectile.magic = true;
|
|
projectile.penetrate = -1;
|
|
projectile.timeLeft = 600;
|
|
projectile.tileCollide = false;
|
|
projectile.extraUpdates = 2;
|
|
projectile.ignoreWater = true;
|
|
aiType = 409;
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
|
|
for (int k = 0; k < 5; k++)
|
|
{
|
|
int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 34, 0f, 0f);
|
|
Main.dust[dust].velocity *= 0f;
|
|
Main.dust[dust].noGravity = true;
|
|
}
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(0, 0, 200, 0);
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.immune[projectile.owner] = 5;
|
|
}
|
|
|
|
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
|
{
|
|
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
|
return false;
|
|
}
|
|
}
|
|
}
|