Files
CalamityModPublic/Projectiles/Typeless/PendantProjectile3.cs
T
Ozzatron d4b5160f98 1 - Fully replaced Momentum Capacitor. It is now a channeled Burden Breaker.
2 - Stealth no longer gives movement speed.
3 - Moved a bunch of CalamityGlobalProjectile utilities to CalamityUtils where they belong.
4 - Renamed several things in CalamityGlobalProjectile
2022-07-02 19:42:56 -04:00

51 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Buffs.StatDebuffs;
namespace CalamityMod.Projectiles.Typeless
{
public class PendantProjectile3 : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Prism Shard");
}
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.timeLeft = 220;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
}
public override void AI()
{
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f);
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
Projectile.rotation += Projectile.velocity.X * 1.25f;
for (int num457 = 0; num457 < 5; num457++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<Eutrophication>(), 60);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<Eutrophication>(), 60);
}
}
}