Files
CalamityModPublic/Projectiles/Magic/IceSpike.cs
T
Andrew Marheine cb6b42f43f 1 - Highest tier accessory reforges now reforge into other highest tier accessory reforges.
2 - Nerfed Amalgam extra projectile damage values.
3 - Arma bags now only drop on first boss kills.
4 - Nerfed Conference Call extra bullet damage by 30%.
5 - Cal Clone dashes are no longer predictive.
6 - Old Duke looks in the direction he's about to dash instead of directly at the player, if he's going to dash.
7 - Updated pillar spawn code a bit more.
8 - Pulse Rifle now works like it should and doesn't hit 4 times on a single target.
9 - Adjusted HomeInOnNPC calls to use projectile.tileCollide to decide homing through tiles or not.
2021-04-13 00:19:56 -05:00

54 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class IceSpike : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Boss/IceRain";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Spike");
}
public override void SetDefaults()
{
projectile.width = 12;
projectile.height = 12;
projectile.friendly = true;
projectile.penetrate = 1;
projectile.magic = true;
projectile.timeLeft = 240;
projectile.coldDamage = true;
}
public override void AI()
{
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + (MathHelper.Pi * 0.5f * projectile.direction);
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 200f, 10f, 20f);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item27, projectile.position);
for (int k = 0; k < 5; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, 0f, 0f);
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Frostburn, 240);
}
}
}