Files
CalamityModPublic/Projectiles/Melee/BrimstoneBoom.cs
T
Andrew Marheine 204b7bc4f2 1 - Edited Evil Smasher to only lose 1 stack when you get hit and no longer creates fossil spikes on hit, buffed damage to compensate.
2 - Aegis Blade, Gauss Dagger, Galvanizing Glaive, Brimlance, Anarchy Blade, Ancient Crusher, Nebulash, Grand Guardian and Terra-cotta on hit projectiles now use ID static i-frames to avoid stacking damage potential on stationary/slow targets.
3 - Death Mode lightning should lag less now.
4 - Comet Quasher, Feralthorn Claymore and Greentide generate less projectiles on hit.
2021-07-04 11:50:30 -05:00

76 lines
2.6 KiB
C#

using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class BrimstoneBoom : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Boom");
}
public override void SetDefaults()
{
projectile.width = 20;
projectile.height = 20;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.melee = true;
projectile.penetrate = -1;
projectile.timeLeft = 5;
projectile.usesIDStaticNPCImmunity = true;
projectile.idStaticNPCHitCooldown = 10;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, 0.75f, 0f, 0f);
float num461 = 25f;
if (projectile.ai[0] > 180f)
{
num461 -= (projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
{
num461 = 0f;
projectile.Kill();
}
num461 *= 0.7f;
projectile.ai[0] += 4f;
int num462 = 0;
while (num462 < num461)
{
float num463 = Main.rand.Next(-10, 11);
float num464 = Main.rand.Next(-10, 11);
float num465 = Main.rand.Next(3, 9);
float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464);
num466 = num465 / num466;
num463 *= num466;
num464 *= num466;
int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f);
Main.dust[num467].noGravity = true;
Main.dust[num467].position.X = projectile.Center.X;
Main.dust[num467].position.Y = projectile.Center.Y;
Dust expr_149DF_cp_0 = Main.dust[num467];
expr_149DF_cp_0.position.X += Main.rand.Next(-10, 11);
Dust expr_14A09_cp_0 = Main.dust[num467];
expr_14A09_cp_0.position.Y += Main.rand.Next(-10, 11);
Main.dust[num467].velocity.X = num463;
Main.dust[num467].velocity.Y = num464;
num462++;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.immune[projectile.owner] = 6;
}
}
}