Files
CalamityModPublic/Projectiles/Typeless/GoldenGunProj.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

118 lines
4.5 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class GoldenGunProj : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 8;
Projectile.height = 8;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.penetrate = 1;
Projectile.alpha = 255;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 2;
}
public override void AI()
{
if (Projectile.localAI[0] < 5f)
{
Projectile.localAI[0] += 1f;
return;
}
int num3;
for (int num586 = 0; num586 < 1; num586 = num3 + 1)
{
for (int num587 = 0; num587 < 6; num587 = num3 + 1)
{
float num588 = Projectile.velocity.X / 6f * (float)num587;
float num589 = Projectile.velocity.Y / 6f * (float)num587;
int num590 = 6;
int num591 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num590, Projectile.position.Y + (float)num590), Projectile.width - num590 * 2, Projectile.height - num590 * 2, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[num591];
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
dust.noGravity = true;
dust.velocity *= 0.3f;
dust.velocity += Projectile.velocity * 0.5f;
dust.position = Projectile.Center;
dust.position.X -= num588;
dust.position.Y -= num589;
dust.velocity *= 0.2f;
num3 = num587;
}
if (Main.rand.NextBool(4))
{
int num592 = 6;
int num593 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num592, Projectile.position.Y + (float)num592), Projectile.width - num592 * 2, Projectile.height - num592 * 2, 170, 0f, 0f, 75, default, 0.65f);
Dust dust = Main.dust[num593];
dust.velocity *= 0.5f;
dust.velocity += Projectile.velocity * 0.5f;
}
num3 = num586;
}
}
public override void Kill(int timeLeft)
{
Projectile.velocity = Projectile.oldVelocity * 0.2f;
int num3;
for (int num362 = 0; num362 < 100; num362 = num3 + 1)
{
int num363 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[num363];
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
if (Main.rand.NextBool())
{
dust.alpha += 25;
}
if (Main.rand.NextBool())
{
dust.scale = 0.6f;
}
else
{
dust.noGravity = true;
}
dust.velocity *= 0.3f;
dust.velocity += Projectile.velocity;
dust.velocity *= 1f + (float)Main.rand.Next(-100, 101) * 0.01f;
dust.velocity.X += (float)Main.rand.Next(-50, 51) * 0.015f;
dust.velocity.Y += (float)Main.rand.Next(-50, 51) * 0.015f;
dust.position = Projectile.Center;
num3 = num362;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Ichor, 480);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, 480);
}
}