Files
CalamityModPublic/Projectiles/Rogue/RotBallProjectile.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

46 lines
1.9 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Rogue;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class RotBallProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Items/Weapons/Rogue/RotBall";
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = 3;
Projectile.aiStyle = ProjAIStyleID.ThrownProjectile;
Projectile.timeLeft = 600;
AIType = ProjectileID.ThrowingKnife;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BrainRot>(), 90);
if (Projectile.owner == Main.myPlayer && Projectile.Calamity().stealthStrike)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, -10f, ModContent.ProjectileType<StealthNimbusCloud>(), Projectile.damage / 2, 0f, Projectile.owner, 0f, 0f);
}
}
}
}