Files
CalamityModPublic/Projectiles/Boss/DestroyerCursedLaser.cs
T
Andrew Marheine 2a1f17e756 1 - Hopefully fixed Leviathan animation issue.
2 - Nerfed Slime God big slimes a bit, I fought them and they were pretty absurd compared to the other bosses.
3 - Skeletron and Skeletron Prime in rev+ don't deal contact damage for 3 seconds after spawning.
4 - Edited rev+ Destroyer lasers to be more fair rather than feeling like a total spamfest from hell.
5 - Edited Providence spawn aura.
6 - Cryogen projectiles are more visible.
2020-08-12 18:02:23 -05:00

66 lines
1.9 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class DestroyerCursedLaser : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Cursed Laser");
}
public override void SetDefaults()
{
projectile.width = 4;
projectile.height = 4;
projectile.hostile = true;
projectile.ignoreWater = true;
projectile.alpha = 255;
projectile.penetrate = 1;
projectile.timeLeft = 600;
projectile.scale = 1.8f;
projectile.extraUpdates = 2;
}
public override void AI()
{
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f);
if (projectile.alpha > 0)
{
projectile.alpha -= 125;
}
if (projectile.alpha < 0)
{
projectile.alpha = 0;
}
if (projectile.localAI[1] == 0f)
{
Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y);
projectile.localAI[1] = 1f;
}
if (projectile.velocity.Length() < 18f)
{
projectile.velocity *= 1.0025f;
}
}
public override Color? GetAlpha(Color lightColor)
{
if (projectile.alpha < 200)
{
return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0);
}
return Color.Transparent;
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.CursedInferno, 120);
}
}
}