Files
CalamityModPublic/Projectiles/Typeless/DarkIce.cs
T
CongratsIsTrash ebc1efd30b Removed Glacial State
Replaced all of its use cases with Frozen, which inherits exactly its old effects
2026-03-17 21:28:44 -04:00

73 lines
2.5 KiB
C#

using System;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class DarkIce : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Projectiles/Melee/DarkIceZero";
public override void SetDefaults()
{
Projectile.width = 28;
Projectile.height = 28;
Projectile.aiStyle = ProjAIStyleID.Arrow;
AIType = ProjectileID.Bullet;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.ignoreWater = true;
Projectile.extraUpdates = 1;
Projectile.coldDamage = true;
Projectile.npcProj = true;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
}
public override void AI()
{
if (Projectile.localAI[0] != 1f)
{
Projectile.localAI[0] = 1f;
SoundEngine.PlaySound(SoundID.Item8, Projectile.Center);
}
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 16f)
{
Projectile.velocity *= 1.04f;
}
//make pretty dust
int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater, Projectile.velocity.X, Projectile.velocity.Y, 0, default, 1.25f);
Main.dust[index2].noGravity = true;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(BuffID.Frozen, 30);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(198, 197, 246);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
for (int i = 0; i < 30; i++)
{
int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater, 0f, 0f, 0, default, Main.rand.NextFloat(1f, 2f));
Main.dust[index2].noGravity = true;
Main.dust[index2].velocity *= 4f;
}
}
}
}