2 - Better Dark Heart Shaderain visibility. 3 - Hive Mind cannot spawn enemies that have contact damage if it's too close to the target.
57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Boss
|
|
{
|
|
public class ShaderainHostile : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Boss";
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 4;
|
|
Projectile.height = 40;
|
|
Projectile.hostile = true;
|
|
Projectile.penetrate = -1;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.timeLeft = 300;
|
|
Projectile.alpha = 255;
|
|
}
|
|
|
|
public override void OnKill(int timeLeft)
|
|
{
|
|
int shadeDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + (float)Projectile.height - 2f), 2, 2, DustID.Demonite, 0f, 0f, 0, default, 1f);
|
|
Dust dust = Main.dust[shadeDust];
|
|
dust.position.X -= 2f;
|
|
dust.alpha = 38;
|
|
dust.velocity *= 0.1f;
|
|
dust.velocity += -Projectile.oldVelocity * 0.25f;
|
|
dust.scale = 0.95f;
|
|
}
|
|
|
|
public override bool CanHitPlayer(Player target) => Projectile.timeLeft >= 85;
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
if (Projectile.timeLeft < 85)
|
|
{
|
|
byte b2 = (byte)(Projectile.timeLeft * 3);
|
|
byte a2 = (byte)(Projectile.alpha * (b2 / 255f));
|
|
return new Color(b2, b2, b2, a2);
|
|
}
|
|
return new Color(255, 255, 255, Projectile.alpha);
|
|
}
|
|
|
|
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
|
{
|
|
if (info.Damage <= 0)
|
|
return;
|
|
|
|
target.AddBuff(ModContent.BuffType<BrainRot>(), 120);
|
|
}
|
|
}
|
|
}
|