Files
CalamityModPublic/Projectiles/Ranged/RocketFire.cs
T
mountaindrew10 96942111c3 1 - Bloodfire Arrows no longer inflict Brimstone Flames.
2 - Holy Fire Bullets no longer inflicts On Fire!
3 - Icy Bullets no longer inflict Glacial State.
4 - Toxibow now inflicts Irradiated for 8 seconds.
5 - Corroded Caustibow no longer inflicts Sulphuric Poisoning but increased duration of Irradiated to 8 seconds.
6 - Flarewing Bow bats now inflict Hellfire.
7 - Arterial Assault no longer inflicts Brimstone Flames.
8 - Contagion no longer inflicts Plague.
9 - Deathwind now inflicts God Slayer Inferno instead of On Fire! and Frostburn.
10 - Drataliornus now only inflicts Dragonfire.
11 - The Maelstrom now inflicts Crush Depth.
12 - Eviscerator now inflicts Burning Blood.
13 - Clamor Rifle now inflicts Eutrophication.
14 - Hellborn now inflicts Hellfire on gun hits.
15 - Helstorm now inflicts Hellfire on gun hits.
16 - Leviatitan no longer inflicts Poisoned.
17 - Needler now inflicts Acid Venom.
18 - Ace's High no longer inflicts Brimstone Flames.
19 - Auralis no longer inflicts Cursed Inferno and Ichor.
20 - Claret Cannon no longer inflicts Brimstone Flames.
21 - Dragon's Breath no longer inflicts On Fire!
22 - Karasawa no longer inflicts any debuffs.
23 - Spyker now inflicts Acid Venom.
24 - Universal Genesis no longer inflicts any debuffs.
25 - Mineral Mortar now inflicts Armor Crunch.
26 - Blissful Bombardier now inflicts Holy Flames instead of Dragonfire.
27 - Chicken Cannon now inflicts Dragonfire.
28 - Scorched Earth no longer inflicts On Fire!
29 - Dragoon Drizzlefish now inflicts Brimstone Flames for 1 second with primary fireballs and 0.5 seconds with split fireballs.
30 - Meowthrower no longer inflicts any debuffs.
31 - Blood Boiler no longer inflicts Brimstone Flames.
32 - Elemental Eruption no longer inflicts any debuffs.
33 - Flak Kraken now inflicts Crush Depth.
34 - Elemental Blaster no longer inflicts any debuffs.
35 - Heavy Laser Rifle no longer inflicts On Fire!
36 - Spetic Skewer no longer inflicts Acid Venom.
37 - Starmada no longer inflicts any debuffs.
38 - Sulphuric Acid Cannon now inflicts Sulphuric Poisoning.
2022-12-06 02:31:06 -06:00

137 lines
4.6 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class RocketFire : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Rogue/TotalityFire";
private bool initialized = false;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Fire");
Main.projFrames[Projectile.type] = 3;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.penetrate = 3;
Projectile.timeLeft = 120;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.DamageType = DamageClass.Ranged;
Projectile.ignoreWater = true;
}
public override void AI()
{
//make it face the way it's going
if (Projectile.ai[1] > 0f)
{
Projectile.rotation = -Projectile.velocity.X * 0.05f + MathHelper.PiOver2;
}
else
{
Projectile.rotation = Projectile.velocity.ToRotation();
}
Projectile.ai[1]--;
//frames
if (!initialized)
{
initialized = true;
Projectile.frame = Main.rand.Next(Main.projFrames[Projectile.type]);
}
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame >= Main.projFrames[Projectile.type])
{
Projectile.frame = 0;
}
//movement
if (Projectile.velocity.X != Projectile.velocity.X)
{
Projectile.velocity.X *= -0.1f;
}
if (Projectile.velocity.X != Projectile.velocity.X)
{
Projectile.velocity.X *= -0.5f;
}
if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f)
{
Projectile.velocity.Y *= -0.5f;
}
Projectile.ai[0] += 1f;
if (Projectile.ai[0] > 5f)
{
Projectile.ai[0] = 5f;
if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f)
{
Projectile.velocity.X *= 0.97f;
if (Projectile.velocity.X > -0.01f && Projectile.velocity.X < 0.01f)
{
Projectile.velocity.X = 0f;
Projectile.netUpdate = true;
}
}
Projectile.velocity.Y += 0.2f;
}
if (Projectile.velocity.Y < 0.25f && Projectile.velocity.Y > 0.15f)
{
Projectile.velocity.X *= 0.8f;
}
if (Projectile.velocity.Y > 16f)
{
Projectile.velocity.Y = 16f;
}
//dust
if (Main.rand.NextBool(4))
{
int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[fire];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += (float)Main.rand.Next(50) * 0.01f;
dust.noGravity = true;
dust.velocity.Y -= 2f;
}
if (Main.rand.NextBool(10))
{
int fire = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 6, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[fire];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
dust.noGravity = true;
dust.velocity *= 0.1f;
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
Projectile.ai[1] = 10f;
return false;
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
}
}