Files
CalamityModPublic/Projectiles/Summon/EndoFire.cs
T
Xyk 7aa44ad7d9 Changed all ~640 instances of Main.rand.NextBool(2) to remove the unnecessary 2
Also I forgot to push my reality rupture and ichor spear minor tweaks before hand so they're in here too.
Reality rupture stealth hit sound is louder.
Reality rupture stealth visual always has at least one big crack, cracks fade out.
There's more consistency in the spark particles on realty rupture stealth and ichor spear on hit sparks.
Reality Rupture stealth produces light.
2023-09-26 01:58:55 -07:00

111 lines
3.6 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class EndoFire : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public bool speedXChoice = false;
public bool speedYChoice = false;
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 22;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
Projectile.extraUpdates = 10;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 5;
Projectile.timeLeft = 300;
Projectile.tileCollide = false;
Projectile.coldDamage = true;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
float speedX = 1f;
float speedY = 1f;
if (!speedXChoice)
{
speedX = Main.rand.NextBool() ? 1.03f : 0.97f;
speedXChoice = true;
}
if (!speedYChoice)
{
speedY = Main.rand.NextBool() ? 1.03f : 0.97f;
speedYChoice = true;
}
Projectile.velocity.X *= speedX;
Projectile.velocity.X *= speedY;
if (Projectile.ai[0] > 20f)
{
float num296 = 1f;
if (Projectile.ai[0] == 21f)
{
num296 = 0.25f;
}
else if (Projectile.ai[0] == 22f)
{
num296 = 0.5f;
}
else if (Projectile.ai[0] == 23f)
{
num296 = 0.75f;
}
Projectile.ai[0] += 1f;
int num297 = Main.rand.NextBool() ? 68 : 67;
if (Main.rand.NextBool(4))
{
num297 = 80;
}
if (Main.rand.NextBool())
{
int num299 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num297, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 0.8f);
Dust dust = Main.dust[num299];
if (Main.rand.NextBool(3))
{
dust.scale *= 1.5f;
dust.velocity.X *= 1.2f;
dust.velocity.Y *= 1.2f;
}
else
{
dust.scale *= 0.85f;
}
dust.noGravity = true;
dust.velocity.X *= 0.8f;
dust.velocity.Y *= 0.8f;
dust.scale *= num296;
dust.velocity += Projectile.velocity;
dust.noLight = true;
}
}
else
{
Projectile.ai[0] += 1f;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frostburn, 180);
}
}
}