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

48 lines
1.4 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class BlazingSun : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override void SetDefaults()
{
Projectile.width = 130;
Projectile.height = 130;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.alpha = 0;
Projectile.timeLeft = 30;
}
public override void AI()
{
//Alpha
if (Projectile.timeLeft < 18)
{
Projectile.scale -= 0.05f;
if (Projectile.alpha < 255)
Projectile.alpha += 10;
if (Projectile.alpha > 255)
Projectile.alpha = 255;
}
if (Projectile.timeLeft >= 30)
{
Projectile.scale += 0.6f;
}
//Rotation
Projectile.rotation += 0.025f;
//Light is produced only when parry is available
if (Projectile.timeLeft >= 18)
Lighting.AddLight(Projectile.Center, new Vector3(240, 185, 7) * (3f / 255));
}
public override bool? CanDamage() => false;
}
}