Intentionally did not touch BloodBoilerFire, CorossiveFlames, DrizzlefishFire, DrizzlefishFireSplit, DrizzlefishFireball, ElementalFire, EssenceFire, PristineFire, PristineSecondary, ShadeFire, and TerraFireGreen
108 lines
4.3 KiB
C#
108 lines
4.3 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
|
|
namespace CalamityMod.Projectiles.Ranged
|
|
{
|
|
public class MeowFire2 : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Ranged";
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 6;
|
|
Projectile.height = 6;
|
|
Projectile.friendly = true;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.DamageType = DamageClass.Ranged;
|
|
Projectile.penetrate = 5;
|
|
Projectile.extraUpdates = 3;
|
|
Projectile.timeLeft = 95;
|
|
Projectile.usesIDStaticNPCImmunity = true;
|
|
Projectile.idStaticNPCHitCooldown = 10;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Projectile.ai[0] > 7f)
|
|
{
|
|
float dustScale = 1f;
|
|
if (Projectile.ai[0] == 8f)
|
|
{
|
|
dustScale = 0.25f;
|
|
}
|
|
else if (Projectile.ai[0] == 9f)
|
|
{
|
|
dustScale = 0.5f;
|
|
}
|
|
else if (Projectile.ai[0] == 10f)
|
|
{
|
|
dustScale = 0.75f;
|
|
}
|
|
Projectile.ai[0] += 1f;
|
|
for (int i = 0; i < 2; i++)
|
|
{
|
|
int pinkDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f);
|
|
Dust dust = Main.dust[pinkDust];
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
dust.noGravity = true;
|
|
dust.scale *= 1.75f;
|
|
dust.velocity.X *= 2f;
|
|
dust.velocity.Y *= 2f;
|
|
}
|
|
else
|
|
{
|
|
dust.scale *= 0.5f;
|
|
}
|
|
dust.velocity.X *= 1.2f;
|
|
dust.velocity.Y *= 1.2f;
|
|
dust.scale *= dustScale;
|
|
dust.velocity += Projectile.velocity;
|
|
if (!dust.noGravity)
|
|
{
|
|
dust.velocity *= 0.5f;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Projectile.ai[0] += 1f;
|
|
}
|
|
Projectile.rotation += 0.3f * (float)Projectile.direction;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Item58, Projectile.position);
|
|
Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
|
|
Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
|
|
Projectile.width = 10;
|
|
Projectile.height = 10;
|
|
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
|
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
|
for (int j = 0; j < 10; j++)
|
|
{
|
|
int dustHit = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f);
|
|
Main.dust[dustHit].velocity *= 3f;
|
|
if (Main.rand.NextBool())
|
|
{
|
|
Main.dust[dustHit].scale = 0.5f;
|
|
Main.dust[dustHit].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
|
}
|
|
}
|
|
for (int k = 0; k < 20; k++)
|
|
{
|
|
int dustHit2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1.5f);
|
|
Main.dust[dustHit2].noGravity = true;
|
|
Main.dust[dustHit2].velocity *= 5f;
|
|
dustHit2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 73, 0f, 0f, 100, default, 1f);
|
|
Main.dust[dustHit2].velocity *= 2f;
|
|
}
|
|
}
|
|
}
|
|
}
|