48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
|
|
namespace Decimation.Content.Projectiles.Item.Accessory.Trinity
|
|
{
|
|
public class TrinityBeam : DecimationProjectile
|
|
{
|
|
public override string Texture => "Terraria/Projectile_" + ProjectileID.LightBeam;
|
|
|
|
protected override void Init()
|
|
{
|
|
Projectile refProjectile = new Projectile();
|
|
refProjectile.CloneDefaults(ProjectileID.LightBeam);
|
|
|
|
projectile.width = refProjectile.width;
|
|
projectile.height = refProjectile.height;
|
|
projectile.hostile = false;
|
|
projectile.friendly = true;
|
|
projectile.light = .7f;
|
|
projectile.penetrate = -1;
|
|
projectile.tileCollide = false;
|
|
projectile.ignoreWater = true;
|
|
projectile.aiStyle = -1;
|
|
projectile.timeLeft = 180;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
|
}
|
|
|
|
public override void OnHitNPC(Terraria.NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Weak, 300);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Weak, 300);
|
|
}
|
|
|
|
public override void OnHitPlayer(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Weak, 300);
|
|
}
|
|
}
|
|
} |