Files
CalamityModPublic/Projectiles/Enemy/SulphuricAcidMist.cs
T
Andrew Marheine 937d13bc50 1 - Adjusted a shitload of debuff durations for hostile NPCs and projectiles.
2 - Gave Banshee Hook explosions id-static i-frames.
3 - Heat Spirits only spawn in the brimstone crag and only drop Essence of Chaos in hardmode.
4 - Nerfed Beetle Might buffs by 50%.
2021-07-06 11:01:56 -05:00

84 lines
2.5 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Enemy
{
public class SulphuricAcidMist : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Acid Mist");
Main.projFrames[projectile.type] = 10;
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.hostile = true;
projectile.ignoreWater = true;
projectile.penetrate = 1;
projectile.timeLeft = 300;
projectile.alpha = 255;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 9)
{
projectile.frame = 0;
}
if (projectile.ai[1] == 0f)
{
projectile.ai[1] = 1f;
Main.PlaySound(SoundID.Item111, projectile.position);
}
if (projectile.velocity.X < 0f)
{
projectile.spriteDirection = -1;
projectile.rotation = (float)Math.Atan2((double)-(double)projectile.velocity.Y, (double)-(double)projectile.velocity.X);
}
else
{
projectile.spriteDirection = 1;
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
}
projectile.ai[0] += 1f;
if (projectile.ai[0] >= 180f)
{
if (projectile.alpha < 255)
{
projectile.alpha += 5;
if (projectile.alpha > 255)
{
projectile.alpha = 255;
projectile.Kill();
}
}
}
else if (projectile.alpha > 80)
{
projectile.alpha -= 30;
if (projectile.alpha < 80)
{
projectile.alpha = 80;
}
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
}
}
}