Files
CalamityModPublic/Projectiles/Ranged/TheMaelstromExplosion.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

91 lines
4.2 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class TheMaelstromExplosion : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Explosion");
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 75;
}
public override void SetDefaults()
{
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.scale = 0.1f;
// Hardcoded spaghetti appearss to make the scale setting above tamper with the hitbox.
Projectile.width = Projectile.height = (int)(120 / Projectile.scale);
Projectile.timeLeft = 60;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 16;
}
public override void AI()
{
Projectile.scale = MathHelper.Lerp(Projectile.scale, 1f, 0.125f);
Projectile.Opacity = Projectile.scale * Utils.GetLerpValue(0f, 30f, Projectile.timeLeft, true);
// Emit sparks and dust.
if (Main.netMode != NetmodeID.Server)
{
int sparkLifetime = Main.rand.Next(22, 36);
float sparkScale = Main.rand.NextFloat(1f, 1.3f);
Color sparkColor = Color.Lerp(Color.Cyan, Color.DarkBlue, Main.rand.NextFloat(0.7f));
Vector2 sparkVelocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(3f, 8f);
SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 dustSpawnOffset = Main.rand.NextVector2Circular(Projectile.width, Projectile.height) * Projectile.scale * 0.4f;
Dust electricity = Dust.NewDustPerfect(Projectile.Center + dustSpawnOffset, 267);
electricity.color = Color.Cyan;
electricity.color.A = 84;
electricity.scale *= Main.rand.NextFloat(0.7f, 1.2f);
electricity.velocity = dustSpawnOffset.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.PiOver2).RotatedByRandom(0.37f);
electricity.velocity *= Main.rand.NextFloat(2f, 6f);
electricity.noGravity = true;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
public override void OnHitPvp(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Vector2 origin = texture.Size() * 0.5f;
float scale = Projectile.scale * Projectile.width / texture.Width;
Color frontAfterimageColor = Projectile.GetAlpha(Color.Lerp(Color.Cyan, Color.DarkBlue, Projectile.identity / 7f % 0.8f)) * 0.2f;
frontAfterimageColor.A = 0;
for (int i = 0; i < 12; i++)
{
Vector2 drawOffset = (MathHelper.TwoPi * i / 12f + Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 2f;
Vector2 afterimageDrawPosition = Projectile.Center + drawOffset - Main.screenPosition;
Main.EntitySpriteDraw(texture, afterimageDrawPosition, null, frontAfterimageColor, Projectile.rotation, origin, scale, SpriteEffects.None, 0);
}
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Size.Length() * Projectile.scale / 1.414f, targetHitbox);
}
public override bool? CanDamage() => Projectile.Opacity > 0.4f ? null : false;
}
}