Files
CalamityModPublic/Projectiles/Magic/AcidicReed.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

62 lines
2.1 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class AcidicReed : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public static readonly SoundStyle SaxSound = new("CalamityMod/Sounds/Item/Saxophone/Sax", 6);
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
Projectile.timeLeft = 600;
Projectile.tileCollide = true;
Projectile.ignoreWater = false;
Projectile.penetrate = 1;
}
public override void AI()
{
if (Projectile.ai[0] == 1f)
{
SoundEngine.PlaySound(SaxSound, Projectile.Center);
Projectile.ai[0] = 0f;
}
if (Projectile.velocity.Y < 10f)
Projectile.velocity.Y += 0.25f;
Projectile.rotation = Projectile.velocity.ToRotation();
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
}
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;
}
}
}
}