Files
CalamityModPublic/Projectiles/Summon/IceSentryShard.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

71 lines
2.2 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class IceSentryShard : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/Boss/IceRain";
public override void SetDefaults()
{
Projectile.width = Projectile.height = 12;
Projectile.aiStyle = ProjAIStyleID.Arrow;
Projectile.coldDamage = true;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Summon;
}
public override void SetStaticDefaults()
{
ProjectileID.Sets.SentryShot[Projectile.type] = true;
}
public override void AI()
{
Projectile.velocity.Y += 0.2f;
if (Projectile.localAI[0] == 0f || Projectile.localAI[0] == 2f)
{
Projectile.scale += 0.01f;
Projectile.alpha -= 50;
if (Projectile.alpha <= 0)
{
Projectile.localAI[0] = 1f;
Projectile.alpha = 0;
}
}
else if (Projectile.localAI[0] == 1.0)
{
Projectile.scale -= 0.01f;
Projectile.alpha += 50;
if (Projectile.alpha >= byte.MaxValue)
{
Projectile.localAI[0] = 2f;
Projectile.alpha = byte.MaxValue;
}
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(200, 200, 200, Projectile.alpha);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
for (int index1 = 0; index1 < 3; ++index1)
{
int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Snow);
Main.dust[index2].noGravity = true;
Main.dust[index2].noLight = true;
Main.dust[index2].scale = 0.7f;
}
}
}
}