Improved Seething Discharge

Now functions similarly to Brimmy's cocoon attack
Fires an accelerating arc of hellblasts, every third attack also spawns a dart ring with homing capabilities
Also includes balance don't worry
This commit is contained in:
CongratsIsTrash committed 2024-07-19 11:03:56 -04:00
1 parent 7685e12eb4
commit 26ec4e9aa6
4 files changed
+75 -20

No files matched your search

+41 -16
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Magic;
using CalamityMod.NPCs.BrimstoneElemental;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Sounds;
using Microsoft.Xna.Framework;
using Terraria;
@@ -11,37 +12,61 @@ namespace CalamityMod.Items.Weapons.Magic
public class SeethingDischarge : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public int DartTimer = 0;
public override void SetDefaults()
{
Item.width = 28;
Item.height = 32;
Item.damage = 52;
Item.damage = 40;
Item.DamageType = DamageClass.Magic;
Item.mana = 15;
Item.useTime = 24;
Item.useAnimation = 24;
Item.mana = 20;
Item.useTime = 60;
Item.useAnimation = 60;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 6.75f;
Item.UseSound = CommonCalamitySounds.FlareSound;
Item.UseSound = BrimstoneElemental.ShellFireSound;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>();
Item.shootSpeed = 12f;
Item.shootSpeed = 10f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float SpeedX = velocity.X + 10f * 0.05f;
float SpeedY = velocity.Y + 10f * 0.05f;
float SpeedX2 = velocity.X - 10f * 0.05f;
float SpeedY2 = velocity.Y - 10f * 0.05f;
float SpeedX3 = velocity.X + 0f * 0.05f;
float SpeedY3 = velocity.Y + 0f * 0.05f;
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>(), damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, position.X, position.Y, SpeedX3, SpeedY3, type, damage, knockback, player.whoAmI, 0f, 0f);
DartTimer++;
// Spawn hellblasts
float diameter = 50f;
Vector2 projVelocity = velocity.SafeNormalize(Vector2.UnitY);
projVelocity *= diameter;
int totalProjectiles = 5;
float offsetAngle = MathHelper.Pi * 0.2f;
for (int j = 0; j < totalProjectiles; j++)
{
float radians = j - (totalProjectiles - 1f) / 2f;
Vector2 offset = projVelocity.RotatedBy(offsetAngle * radians);
Projectile.NewProjectile(source, player.Center + offset, velocity, ModContent.ProjectileType<SeethingDischargeBrimstoneHellblast>(), damage, knockback, player.whoAmI);
}
// Every 3rd attack, spawn a ring of homing darts
if (DartTimer == 3)
{
DartTimer = 0;
totalProjectiles = 8;
Vector2 initialOffset = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(0f, MathHelper.PiOver4));
for (int k = 0; k < totalProjectiles; k++)
{
velocity = initialOffset.RotatedBy(MathHelper.TwoPi * (k / (float)totalProjectiles)) * Item.shootSpeed;
Projectile.NewProjectile(source, player.Center, velocity, type, damage, 0f, player.whoAmI, 0f, 1f);
}
}
return false;
}
}
@@ -723,7 +723,11 @@ SanguineFlare: {
SeethingDischarge: {
DisplayName: Seething Discharge
Tooltip: Fires a barrage of brimstone blasts
Tooltip:
'''
Fires an accelerating arc of brimstone hellblasts
Every third attack spawns a brimstone dart ring which chases after foes
'''
}
Serpentine: {
@@ -35,13 +35,15 @@ namespace CalamityMod.Projectiles.Magic
public override void AI()
{
// Play a sound upon spawning
if (Projectile.ai[0] == 0f)
{
SoundEngine.PlaySound(BrimstoneElemental.DartSound, Projectile.Center);
Projectile.ai[0] = 1f;
}
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < (Projectile.ai[1] == 1f ? 12f : 16f))
// Accelerate over time
if ((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 16f) && Projectile.ai[1] != 1f)
{
Projectile.velocity *= 1.01f;
}
@@ -57,6 +59,30 @@ namespace CalamityMod.Projectiles.Magic
Projectile.frame = 0;
}
Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f);
// Seething Discharge darts have weak homing capabilities
if (Projectile.ai[1] == 1f && Projectile.timeLeft < 585)
{
float npcDistCompare = 480f;
int index = -1;
foreach (NPC n in Main.ActiveNPCs)
{
if (!n.CanBeChasedBy(Projectile, false))
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if (currentNPCDist < npcDistCompare)
{
npcDistCompare = currentNPCDist;
index = n.whoAmI;
}
}
if (index != -1)
{
float homingStrength = Main.rand.NextFloat(0.075f, 0.085f);
Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Main.npc[index].Center).ToRotation(), homingStrength).ToRotationVector2() * 12f;
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
@@ -30,11 +30,11 @@ namespace CalamityMod.Projectiles.Magic
Projectile.DamageType = DamageClass.Magic;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = 4;
Projectile.penetrate = 3;
Projectile.timeLeft = 255;
Projectile.alpha = 0;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = 20;
}
public override void AI()