Files
CalamityModPublic/Projectiles/Magic/Snowball.cs
T
Andrew Marheine 925f6f0247 1 - Bosses are now affected by slowing debuffs but gain a 20 second immunity to them after they wear off.
2 - Reduced the duration of most slowing debuffs.
3 - Cal Clone Soul Seekers cannot fire while she's doing a bullet hell.
4 - Reworked enemy and boss debuff immunities to make more sense.
5 - Increased Aquatic Scourge and Desert Scourge HP because they're now vulnerable to debuffs.
6 - Reduced the damage of Bloodflare ranged set bonus phantoms.
7 - Adjusted DoG's fireball explosion spread.
8 - Leviathan hitboxes should work properly now.
9 - Sun Bats no longer derp out.
2021-05-18 00:57:06 -05:00

65 lines
2.3 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class Snowball : ModProjectile
{
public override void SetDefaults()
{
projectile.width = 16;
projectile.height = 16;
projectile.aiStyle = 1;
projectile.friendly = true;
projectile.magic = true;
projectile.coldDamage = true;
projectile.penetrate = 1;
projectile.extraUpdates = 1;
projectile.coldDamage = true;
}
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Snowball");
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Frostburn, 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 90);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(200, 200, 200, projectile.alpha);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item27, projectile.position);
//crystal bullet shards
for (int index1 = 0; index1 < 10; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, 0f, 0, new Color(), 1f);
Main.dust[index2].noGravity = true;
Main.dust[index2].velocity *= 2f;
}
if (projectile.owner == Main.myPlayer)
{
for (int index = 0; index < 6; ++index)
{
float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
int p = Projectile.NewProjectile(projectile.Center.X + SpeedX, projectile.Center.Y + SpeedY, SpeedX, SpeedY, ProjectileID.CrystalShard, projectile.damage / 2, 0f, projectile.owner);
Main.projectile[p].ranged = false;
Main.projectile[p].magic = true;
}
}
//insert ice shattering dust here
}
}
}