45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles
|
|
{
|
|
public class ChaotrixProjectile : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Chaotrix");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.CloneDefaults(ProjectileID.Yelets);
|
|
projectile.width = 16;
|
|
projectile.scale = 1.15f;
|
|
projectile.height = 16;
|
|
projectile.penetrate = 10;
|
|
projectile.melee = true;
|
|
aiType = 549;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Main.rand.Next(5) == 0)
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.OnFire, 300);
|
|
if (projectile.owner == Main.myPlayer)
|
|
{
|
|
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
|
}
|
|
}
|
|
}
|
|
} |