Files
CalamityModPublic/Projectiles/Typeless/HolyExplosionSupreme.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

55 lines
2.4 KiB
C#

using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class HolyExplosionSupreme : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public Player Owner => Main.player[Projectile.owner];
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 90;
Projectile.height = 90;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 3;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 4;
}
public override void OnKill(int timeLeft)
{
SoundStyle HitSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastImpact") { Volume = 0.6f };
SoundEngine.PlaySound(HitSound, Projectile.Center);
Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
Projectile.width = 90;
Projectile.height = 90;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
for (int i = 0; i < 24; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 228, new Vector2(4.5f, 4.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.9f), 0, default, Main.rand.NextFloat(1.5f, 2.8f));
dust.shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
dust.noGravity = true;
}
for (int j = 0; j < 12; j++)
{
Vector2 dustVel = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel * 2, 259, dustVel, 0, default, 1f);
dust.shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
}
}
}
}