Files
CalamityModPublic/Projectiles/Boss/IceRain.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

102 lines
2.9 KiB
C#

using Microsoft.Xna.Framework;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class IceRain : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Rain");
}
public override void SetDefaults()
{
projectile.width = 12;
projectile.height = 12;
projectile.hostile = true;
projectile.penetrate = -1;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(projectile.localAI[0]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
projectile.localAI[0] = reader.ReadSingle();
}
public override void AI()
{
Lighting.AddLight((int)((projectile.position.X + (projectile.width / 2)) / 16f), (int)((projectile.position.Y + (projectile.height / 2)) / 16f), 0f, 0.25f, 0.25f);
if (projectile.ai[0] != 2f)
projectile.aiStyle = 1;
if (projectile.ai[0] == 0f)
{
projectile.velocity.Y += 0.2f;
}
else if (projectile.ai[0] == 2f)
{
projectile.velocity.Y += 0.1f;
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
if (projectile.velocity.Y > 6f)
projectile.velocity.Y = 6f;
}
if (projectile.localAI[0] == 0f)
{
projectile.scale += 0.01f;
projectile.alpha -= 50;
if (projectile.alpha <= 0)
{
projectile.localAI[0] = 1f;
projectile.alpha = 0;
}
}
else
{
projectile.scale -= 0.01f;
projectile.alpha += 50;
if (projectile.alpha >= 255)
{
projectile.localAI[0] = 0f;
projectile.alpha = 255;
}
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, 255, 255, projectile.alpha);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 27, 0.25f);
for (int num373 = 0; num373 < 3; num373++)
{
int num374 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 76, 0f, 0f, 0, default, 1f);
Main.dust[num374].noGravity = true;
Main.dust[num374].noLight = true;
Main.dust[num374].scale = 0.7f;
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Frostburn, 60, true);
target.AddBuff(BuffID.Chilled, 30, true);
}
}
}