Files
CalamityModPublic/Projectiles/Melee/ElementBall.cs
T
Andrew Marheine 523aa76a76 1 - Plantera and her tentacles are immune to Venom.
2 - Moon Lord is immune to Nightwither.
3 - Adjusted the durations of most slowing debuffs and removed Glacial State from several weapons.
4 - Kami Flu now only slows enemies and bosses down for the first 3 seconds it's active.
2021-05-28 10:43:34 -05:00

48 lines
1.6 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ElementBall : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ball");
}
public override void SetDefaults()
{
projectile.width = 8;
projectile.height = 8;
projectile.friendly = true;
projectile.melee = true;
projectile.penetrate = 1;
projectile.extraUpdates = 2;
projectile.tileCollide = false;
projectile.timeLeft = 150;
}
public override void AI()
{
int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
Main.dust[num250].noGravity = true;
Main.dust[num250].velocity *= 0f;
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 200f, 12f, 20f);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
target.AddBuff(BuffID.Frostburn, 120);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
target.AddBuff(ModContent.BuffType<Plague>(), 120);
}
}
}