Files
CalamityModPublic/Projectiles/Summon/SpikecragSpike.cs
T
2023-07-27 20:57:28 -07:00

45 lines
1.3 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Summon
{
public class SpikecragSpike : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
ProjectileID.Sets.SentryShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 6;
Projectile.height = 6;
Projectile.friendly = true;
Projectile.minion = true;
Projectile.minionSlots = 0f;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.aiStyle = ProjAIStyleID.Arrow;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity.Y += 0.1f;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.zenithWorld)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
}
}
}
}