Files

52 lines
1.6 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ForgottenWawiTech.Content.Projectiles.TridentOfTheSunken
{
public class TridentOfTheSunkenBlast : ModProjectile
{
public override string Texture => "ForgottenWawiTech/Assets/PlaceholderProj";
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.hostile = false;
Projectile.DamageType = DamageClass.Magic;
Projectile.timeLeft = 2;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.alpha = 255;
}
public override void AI()
{
if (Projectile.localAI[0] <= 0f)
{
Projectile.localAI[0] = 320f; // default radius if not provided
}
float radius = Projectile.localAI[0];
Projectile.position = Projectile.Center - new Vector2(radius);
Projectile.width = Projectile.height = (int)(radius * 2f);
Projectile.Center = Projectile.position + new Vector2(radius);
Lighting.AddLight(Projectile.Center, 0.2f, 0.35f, 0.8f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Suffocation, 600);
}
public override bool? CanDamage() => true;
}
}