Files
CalamityModPublic/Projectiles/Rogue/TotalityTar.cs
T
Storm2103 348435a657 Some of the #balance results backlog (with some reconsiderations) and a tint dragon scales buff (to compensate the massive nerfs its gotten)
Executioner's blade should no longer kill Yharon on 2:30
Deep wounder should no longer be dogshit
Nerfed Fantasy Talismans
Sacrifice projectiles made faster
Nerfed Duststorm cloud's iframes and renamed the projectile so they show up on Cal Test Helpers
Buffed Sandslasher's velocity
Mega buffed Apoctolith
Made Young Duke use Local Iframes
Buffed AotC
Rebalanced Kylie and Frostcrush Valari
Buffed Plagued Fueled pack
Rebalanced Totality Breakers
Buffed Ballistic Poison bomb
Rebalanced Monkey Darts
Rebalanced Tarragon Darts a bit
2023-02-09 19:11:09 -06:00

119 lines
4.4 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Rogue
{
public class TotalityTar : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Totality Tar");
}
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 30;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.DamageType = RogueDamageClass.Instance;
}
public override void AI()
{
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 (Math.Abs(Projectile.velocity.X) < 0.01f)
{
Projectile.velocity.X = 0f;
Projectile.netUpdate = true;
}
}
Projectile.velocity.Y += 0.2f;
}
Projectile.rotation += Projectile.velocity.X * 0.1f;
if (Projectile.velocity.Y < 0.25f && Projectile.velocity.Y > 0.15f)
{
Projectile.velocity.X *= 0.8f;
}
Projectile.rotation = -Projectile.velocity.X * 0.05f;
if (Projectile.velocity.Y > 16f)
{
Projectile.velocity.Y = 16f;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
if (target.buffImmune[BuffID.Oiled])
{
target.buffImmune[BuffID.Oiled] = false;
}
target.AddBuff(BuffID.Oiled, 600);
target.AddBuff(BuffID.OnFire3, 300);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.OnFire3, 300);
}
public override void Kill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item74, Projectile.position);
Vector2 vector2 = new Vector2(20f, 20f);
for (int index = 0; index < 3; ++index)
Dust.NewDust(Projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f, 0, Color.Red, 1f);
for (int index1 = 0; index1 < 5; ++index1)
{
int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, 0.0f, 0.0f, 100, new Color(), 1.5f);
Dust dust = Main.dust[index2];
dust.velocity *= 1.4f;
}
for (int index1 = 0; index1 < 10; ++index1)
{
int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 2.5f);
Dust dust1 = Main.dust[index2];
dust1.noGravity = true;
dust1.velocity *= 5f;
int index3 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 1.5f);
Dust dust2 = Main.dust[index3];
dust2.velocity *= 3f;
}
int fireAmt = Main.rand.Next(2, 4);
if (Projectile.owner == Main.myPlayer)
{
for (int f = 0; f < fireAmt; f++)
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<TotalityFire>(), Projectile.damage, 1f, Main.myPlayer, 0f, 0f);
}
}
}
}
}