Zeeks
Steampunker
Hello, i'm very new to modding and item coding and i wanted to know how to make my custom projectile pierce 5 enemy's before dissipating into a particle explosion (like how the rainbow rod does)
My current code:
I appreciate any help you give me, even if its just a tip or some kind words, thank you!
My current code:
Code:
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
namespace BrilliantStarMod.Items
{
public class GalaxyShot : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("you really should'nt be seeing this");
}
public override void SetDefaults()
{
projectile.width = 15;
projectile.height = 15;
projectile.aiStyle = 0;
projectile.friendly = true;
projectile.magic = true;
aiType = ProjectileID.Bullet;
projectile.rotation += 0.5f * (float)projectile.direction;
projectile.penetrate = 1;
}
public override void AI()
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.velocity.X * -0.5f, projectile.velocity.Y * -0.5f);
}
public override void Kill(int timeLeft)
{
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
Main.PlaySound(SoundID.Item10, projectile.position);
}
}
}