Refactor and redo Shattered Prism
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Projectiles.FragmentedPrism
|
||||
{
|
||||
public class FragmentedPrismSingularity : ModProjectile
|
||||
{
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 12;
|
||||
Projectile.height = 12;
|
||||
Projectile.friendly = false;
|
||||
Projectile.hostile = false;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = 24;
|
||||
Projectile.alpha = 80;
|
||||
Projectile.hide = false;
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
float progress = 1f - Projectile.timeLeft / 24f;
|
||||
Projectile.scale = MathHelper.Lerp(0.8f, 1.2f, progress);
|
||||
Projectile.alpha = (int)MathHelper.Lerp(80f, 220f, progress);
|
||||
Lighting.AddLight(Projectile.Center, 0.05f, 0.1f, 0.25f);
|
||||
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(Projectile.Center - new Vector2(8f), 16, 16, DustID.BlueCrystalShard, 0f, 0f, 150, default, 0.8f);
|
||||
dust.velocity *= 0.2f;
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user