Files
CalamityModPublic/Projectiles/Melee/Blood2.cs
T
Xyk 279ce5d42e Added Brain Rot
Brain rot is the counterpart debuff to Burning Blood
Removed shadowflame from Hive minds clouds and replaced it with Brain Rot
Added Shadowflame to all of the Hive mind drops
Adjusted some Burning Blood durations to fit the new Brain Rot ones
Tweaked some more debuff visuals, mostly so the effects that scale with npc size don't go as mental as they did before on huge targets
2023-09-24 01:38:12 -07:00

47 lines
1.6 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class Blood2 : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 4;
Projectile.height = 4;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.penetrate = 1;
Projectile.timeLeft = 150;
}
public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 120 && target.CanBeChasedBy(Projectile);
public override void AI()
{
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 4f)
{
for (int num468 = 0; num468 < 2; num468++)
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
}
}
if (Projectile.timeLeft < 120)
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 450f, 6f, 20f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BurningBlood>(), 60);
}
}
}