66 lines
2.3 KiB
C#
66 lines
2.3 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class ElementalDiskSplit : ModProjectile
|
|
{
|
|
public override string Texture => "CalamityMod/Items/Weapons/Rogue/ElementalDisk";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Elemental Disk");
|
|
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
|
|
ProjectileID.Sets.TrailingMode[Projectile.type] = 1;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 56;
|
|
Projectile.height = 56;
|
|
Projectile.alpha = 120;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.friendly = true;
|
|
Projectile.tileCollide = false;
|
|
Projectile.penetrate = -1;
|
|
Projectile.aiStyle = 3;
|
|
Projectile.timeLeft = 60;
|
|
AIType = ProjectileID.WoodenBoomerang;
|
|
Projectile.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Main.rand.NextBool(10))
|
|
{
|
|
int num250 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 66, Projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f);
|
|
Main.dust[num250].noGravity = true;
|
|
Main.dust[num250].velocity *= 0f;
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 90);
|
|
target.AddBuff(BuffID.Frostburn, 90);
|
|
target.AddBuff(ModContent.BuffType<HolyFlames>(), 90);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 90);
|
|
target.AddBuff(BuffID.Frostburn, 90);
|
|
target.AddBuff(ModContent.BuffType<HolyFlames>(), 90);
|
|
}
|
|
|
|
public override bool PreDraw(ref Color lightColor)
|
|
{
|
|
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
|
|
return false;
|
|
}
|
|
}
|
|
}
|