52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using CalamityMod.Dusts;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class FrogGore3 : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Summon";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ProjectileID.Sets.SentryShot[Projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.friendly = true;
|
|
Projectile.width = 14;
|
|
Projectile.height = 16;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.tileCollide = true;
|
|
Projectile.timeLeft = 360;
|
|
Projectile.alpha = 255;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.ai[0] += 1f;
|
|
if (Projectile.ai[0] < 10f)
|
|
{
|
|
Projectile.alpha = 255 - (int)(255 * Projectile.ai[0] / 10f);
|
|
}
|
|
Projectile.velocity.Y += 0.2f;
|
|
Projectile.rotation += Projectile.velocity.X * 0.03f;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Irradiated>(), 720);
|
|
|
|
public override void OnKill(int timeLeft)
|
|
{
|
|
for (int i = 0; i < Main.rand.Next(4, 8 + 1); i++)
|
|
{
|
|
Dust.NewDustPerfect(Projectile.Center + Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(10f),
|
|
(int)CalamityDusts.SulphurousSeaAcid,
|
|
Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(1f, 4f));
|
|
}
|
|
}
|
|
}
|
|
}
|