Files
CalamityModPublic/Projectiles/DraedonsArsenal/TaserExplosion.cs
T
Xyk 86025c0712 Arsenal Improvements Part 1
Part of my attempt to create a visual identity for each arsenal energy type that can be consistently applied across all items once they are reworked

This commit changes:
Taser - New left click and previous function is on right click with arsenal cooldown, vfx overhaul
Scattershot Skewer - Completely re-coded the entire thing, now has right and left click separation and can perform a skewer dash, vfx overhaul
Pulse Pistol - Completely re-coded how the orb tracking and movement works, hits twice before splitting instead of once, vfx overhaul
Pulse Rifle - Same as Pulse Pistol, vfx overhaul

Added 4 more dust types

Changed the dusts and colors used by Effects.ArsenalEffects

Fixed Plama typo
2025-03-26 20:21:27 -07:00

52 lines
1.8 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class TaserExplosion : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public float radius = 200;
public override void SetDefaults()
{
Projectile.width = 200;
Projectile.height = 200;
Projectile.friendly = true;
Projectile.ignoreWater = false;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 10;
Projectile.DamageType = DamageClass.Ranged;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
target.AddBuff(ModContent.BuffType<StaticDischarge>(), 300);
float minMult = 0.2f;
int hitsToMinMult = 7;
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
modifiers.SourceDamage *= damageMult;
Player Owner = Main.player[Projectile.owner];
Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center);
target.MoveNPC(launchVel, 12, true);
}
public override void AI()
{
}
public override bool PreDraw(ref Color lightColor)
{
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox);
}
}