51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class IgneousBladeStrike : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Summon";
|
|
public override string Texture => "CalamityMod/Projectiles/Summon/IgneousBlade";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ProjectileID.Sets.MinionShot[Projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.friendly = true;
|
|
Projectile.width = 86;
|
|
Projectile.height = 36;
|
|
Projectile.minion = true;
|
|
Projectile.minionSlots = 0f;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.tileCollide = false;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = 4;
|
|
Projectile.timeLeft = 360;
|
|
Projectile.alpha = 127;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 + MathHelper.PiOver4;
|
|
}
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int i = 0; i < Main.rand.Next(28, 41); i++)
|
|
{
|
|
Dust.NewDustPerfect(
|
|
Projectile.Center + Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(10f),
|
|
6,
|
|
Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(1f, 4f));
|
|
}
|
|
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
|
|
}
|
|
}
|
|
}
|