Files
CalamityModPublic/Projectiles/Enemy/NuclearBulletLarge.cs
T
GinYuH e3d18efb7d renamed all sulfurs in the code to sulphur
because I'm nitpicky
shouldn't have any ingame effect/changelogs
2024-03-27 23:10:21 -07:00

47 lines
1.6 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Enemy
{
public class NuclearBulletLarge : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Enemy";
public override void SetDefaults()
{
Projectile.width = 30;
Projectile.height = 18;
Projectile.hostile = true;
Projectile.timeLeft = 240;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 1.25f);
Projectile.rotation = Projectile.velocity.ToRotation();
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (info.Damage <= 0)
return;
target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
}
public override void OnKill(int timeLeft)
{
for (int i = 0; i <= 2; i++)
{
int idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulphurousSeaAcid, 0, 0, 0, default, 0.75f);
Main.dust[idx].noGravity = true;
Main.dust[idx].velocity *= 3f;
idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulphurousSeaAcid, 0, 0, 0, default, 0.75f);
Main.dust[idx].noGravity = true;
Main.dust[idx].velocity *= 3f;
}
}
}
}