diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index ccb6632d8c..63aeac78ab 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -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(); - 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(), 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(), 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; } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 8c4fbd7b25..6b9586d2f2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -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: { diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index 098ba4593b..bbd4f3a18e 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -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(), 120); diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index f43a8400cc..2535e7ee60 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -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()