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

68 lines
2.6 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class IceBomb : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ice Bomb");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.hostile = true;
projectile.alpha = 50;
projectile.penetrate = 1;
projectile.timeLeft = 300;
}
public override void AI()
{
projectile.velocity *= 0.99f;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(255, 255, 255, projectile.alpha);
}
public override void Kill(int timeLeft)
{
Lighting.AddLight((int)((projectile.position.X + (projectile.width / 2)) / 16f), (int)((projectile.position.Y + (projectile.height / 2)) / 16f), 0.01f, 0.25f, 0.25f);
Main.PlaySound(SoundID.Item27, projectile.position);
float spread = 60f * 0.0174f;
double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2;
double deltaAngle = spread / 8f;
double offsetAngle;
int i;
if (projectile.owner == Main.myPlayer)
{
for (i = 0; i < 3; i++)
{
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<IceRain>(), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<IceRain>(), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f);
}
}
for (int k = 0; k < 3; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Frostburn, 120, true);
target.AddBuff(BuffID.Chilled, 90, true);
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
}
}
}