diff --git a/Gores/SupremeCalamitas/BrimstoneHeart_Gore1.png b/Gores/SupremeCalamitas/BrimstoneHeart_Gore1.png new file mode 100644 index 0000000000..491063f204 Binary files /dev/null and b/Gores/SupremeCalamitas/BrimstoneHeart_Gore1.png differ diff --git a/Gores/SupremeCalamitas/BrimstoneHeart_Gore2.png b/Gores/SupremeCalamitas/BrimstoneHeart_Gore2.png new file mode 100644 index 0000000000..cb35235480 Binary files /dev/null and b/Gores/SupremeCalamitas/BrimstoneHeart_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherArm_Gore.png b/Gores/SupremeCalamitas/SepulcherArm_Gore.png new file mode 100644 index 0000000000..fb7678cb5e Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherArm_Gore.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore1.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore1.png new file mode 100644 index 0000000000..cc91d0b99b Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore2.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore2.png new file mode 100644 index 0000000000..8d735724fc Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore3.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore3.png new file mode 100644 index 0000000000..3f01d98028 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore3.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore4.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore4.png new file mode 100644 index 0000000000..75e2bb2043 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore4.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore5.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore5.png new file mode 100644 index 0000000000..206ff5884f Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore5.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore6.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore6.png new file mode 100644 index 0000000000..1503860b0e Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore6.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore7.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore7.png new file mode 100644 index 0000000000..7f91f058e8 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore7.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore8.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore8.png new file mode 100644 index 0000000000..08f213b100 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore8.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody1_Gore9.png b/Gores/SupremeCalamitas/SepulcherBody1_Gore9.png new file mode 100644 index 0000000000..5909b57a8f Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody1_Gore9.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore1.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore1.png new file mode 100644 index 0000000000..66ad61c1c4 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore2.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore2.png new file mode 100644 index 0000000000..a0afe9c2c6 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore3.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore3.png new file mode 100644 index 0000000000..c51e0c6e39 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore3.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore4.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore4.png new file mode 100644 index 0000000000..27c13b1f12 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore4.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore5.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore5.png new file mode 100644 index 0000000000..56369887b4 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore5.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore6.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore6.png new file mode 100644 index 0000000000..a558507804 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore6.png differ diff --git a/Gores/SupremeCalamitas/SepulcherBody2_Gore7.png b/Gores/SupremeCalamitas/SepulcherBody2_Gore7.png new file mode 100644 index 0000000000..840e976c65 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherBody2_Gore7.png differ diff --git a/Gores/SupremeCalamitas/SepulcherForearm_Gore1.png b/Gores/SupremeCalamitas/SepulcherForearm_Gore1.png new file mode 100644 index 0000000000..8aebfc14ea Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherForearm_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherForearm_Gore2.png b/Gores/SupremeCalamitas/SepulcherForearm_Gore2.png new file mode 100644 index 0000000000..6272a4257c Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherForearm_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHand_Gore1.png b/Gores/SupremeCalamitas/SepulcherHand_Gore1.png new file mode 100644 index 0000000000..1481801d09 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHand_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHand_Gore2.png b/Gores/SupremeCalamitas/SepulcherHand_Gore2.png new file mode 100644 index 0000000000..e0534c6502 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHand_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHead_Gore1.png b/Gores/SupremeCalamitas/SepulcherHead_Gore1.png new file mode 100644 index 0000000000..955bb07c3e Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHead_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHead_Gore2.png b/Gores/SupremeCalamitas/SepulcherHead_Gore2.png new file mode 100644 index 0000000000..9615453c81 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHead_Gore2.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHead_Gore3.png b/Gores/SupremeCalamitas/SepulcherHead_Gore3.png new file mode 100644 index 0000000000..52ada3c123 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHead_Gore3.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHead_Gore4.png b/Gores/SupremeCalamitas/SepulcherHead_Gore4.png new file mode 100644 index 0000000000..7b37e0a607 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHead_Gore4.png differ diff --git a/Gores/SupremeCalamitas/SepulcherHead_Gore5.png b/Gores/SupremeCalamitas/SepulcherHead_Gore5.png new file mode 100644 index 0000000000..d8f20446d2 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherHead_Gore5.png differ diff --git a/Gores/SupremeCalamitas/SepulcherTail_Gore1.png b/Gores/SupremeCalamitas/SepulcherTail_Gore1.png new file mode 100644 index 0000000000..40ca1472d8 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherTail_Gore1.png differ diff --git a/Gores/SupremeCalamitas/SepulcherTail_Gore2.png b/Gores/SupremeCalamitas/SepulcherTail_Gore2.png new file mode 100644 index 0000000000..81a900a180 Binary files /dev/null and b/Gores/SupremeCalamitas/SepulcherTail_Gore2.png differ diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 70de6e6fe3..a08c3f5567 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -123,6 +123,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (npc.life <= 0) { + for (int i = 1; i <= 2; i++) + { + Vector2 heartGoreVelocity = new Vector2((i == 1).ToDirectionInt() * 3f, Main.rand.NextFloat(-2f, 0f)); + Gore.NewGorePerfect(npc.Center, heartGoreVelocity, mod.GetGoreSlot($"Gores/SupremeCalamitas/BrimstoneHeart_Gore{i}"), npc.scale); + } for (int i = 0; i < ChainEndpoints.Count; i++) TendrilDestructionEffects(i); } diff --git a/NPCs/SupremeCalamitas/SCalWormArm.cs b/NPCs/SupremeCalamitas/SCalWormArm.cs index 0042437d6c..126860646d 100644 --- a/NPCs/SupremeCalamitas/SCalWormArm.cs +++ b/NPCs/SupremeCalamitas/SCalWormArm.cs @@ -85,8 +85,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.dontCountMe = true; @@ -113,8 +111,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Die if the segment is not present. if (!Main.npc.IndexInRange((int)npc.ai[0]) || !Main.npc[(int)npc.ai[0]].active) { - npc.active = false; - npc.netUpdate = true; + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); return; } @@ -184,7 +183,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 armDrawPosition = Limbs[1].Center - Main.screenPosition; drawColor = Lighting.GetColor((int)(Limbs[1].Center.X / 16), (int)(Limbs[1].Center.Y / 16)); - spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), npc.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), npc.scale, SpriteEffects.FlipVertically, 0f); Vector2 handDrawPosition = armDrawPosition; SpriteEffects handDirection = npc.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -193,6 +192,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas return false; } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Vector2 forearmGoreSpawnPosition = Limbs[0].Center + Main.rand.NextVector2Circular(6f, 6f); + Vector2 armGoreSpawnPosition = Limbs[1].Center + Main.rand.NextVector2Circular(6f, 6f); + Vector2 handGoreSpawnPosition = armGoreSpawnPosition + Main.rand.NextVector2Circular(6f, 6f); + + Gore.NewGorePerfect(armGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherArm_Gore"), npc.scale); + for (int i = 1; i <= 2; i++) + Gore.NewGorePerfect(forearmGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherForearm_Gore{i}"), npc.scale); + for (int i = 1; i <= 2; i++) + Gore.NewGorePerfect(handGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherHand_Gore{i}"), npc.scale); + } + } + public override bool CheckActive() => false; public override bool PreNPCLoot() => false; diff --git a/NPCs/SupremeCalamitas/SCalWormArm.png b/NPCs/SupremeCalamitas/SCalWormArm.png index def9c46bf9..b45111f206 100644 Binary files a/NPCs/SupremeCalamitas/SCalWormArm.png and b/NPCs/SupremeCalamitas/SCalWormArm.png differ diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index ca7583e950..d9d756a982 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -44,8 +44,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.dontCountMe = true; } @@ -164,29 +162,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) + int variant = (int)(npc.localAI[3] / 2f % 2f); + if (variant == 0) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + for (int i = 1; i <= 9; i++) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + if (!Main.rand.NextBool(3)) + continue; + + Vector2 goreSpawnPosition = npc.Center; + Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(2f, 2f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherBody1_Gore{i}"), npc.scale); } } - for (int num623 = 0; num623 < 10; num623++) + else { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + for (int i = 1; i <= 7; i++) + { + if (!Main.rand.NextBool(3)) + continue; + + Vector2 goreSpawnPosition = npc.Center; + Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(2f, 2f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherBody2_Gore{i}"), npc.scale); + } } } } diff --git a/NPCs/SupremeCalamitas/SCalWormBody.png b/NPCs/SupremeCalamitas/SCalWormBody.png index 058b74c987..5e8b75333e 100644 Binary files a/NPCs/SupremeCalamitas/SCalWormBody.png and b/NPCs/SupremeCalamitas/SCalWormBody.png differ diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 05f6edd28e..501b36265e 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Typeless; using CalamityMod.World; using Microsoft.Xna.Framework; using System.IO; @@ -38,8 +39,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit13; - npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; npc.dontCountMe = true; @@ -151,6 +150,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.frame.Y = ((int)(npc.frameCounter / 5) + npc.whoAmI) % Main.npcFrameCount[npc.type] * frameHeight; } + public override void HitEffect(int hitDirection, double damage) + { + if (Main.netMode != NetmodeID.MultiplayerClient && npc.life <= 0) + { + for (int i = 0; i < Main.rand.Next(1, 3 + 1); i++) + { + if (!Main.rand.NextBool(3)) + continue; + + Vector2 soulVelocity = -Vector2.UnitY.RotatedByRandom(0.53f) * Main.rand.NextFloat(2.5f, 4f); + Projectile.NewProjectile(npc.Center, soulVelocity, ModContent.ProjectileType(), 0, 0f); + } + } + } + public override bool CheckActive() { return false; diff --git a/NPCs/SupremeCalamitas/SCalWormForeArm.png b/NPCs/SupremeCalamitas/SCalWormForeArm.png index f63e3c4021..da24ee8a4f 100644 Binary files a/NPCs/SupremeCalamitas/SCalWormForeArm.png and b/NPCs/SupremeCalamitas/SCalWormForeArm.png differ diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index d059e198c1..f50cc354a9 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -45,9 +45,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.netAlways = true; + npc.netAlways = true; } public override void SendExtraAI(BinaryWriter writer) @@ -145,30 +143,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (Main.player[npc.target].dead || !NPC.AnyNPCs(ModContent.NPCType()) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) - { - npc.TargetClosest(false); - npc.alpha += 5; - if (npc.alpha >= 255) - { - npc.alpha = 255; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].type == npc.type || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType()) - { - Main.npc[i].active = false; - } - } - } - } - else - { - npc.alpha -= 42; - if (npc.alpha < 0) - { - npc.alpha = 0; - } - } + if (Main.player[npc.target].dead || !NPC.AnyNPCs(ModContent.NPCType()) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) + { + npc.TargetClosest(false); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/SepulcherDeath"), Main.player[npc.target].Center); + npc.life = 0; + npc.HitEffect(); + npc.active = false; + npc.netUpdate = true; + } + else + npc.Opacity = MathHelper.Clamp(npc.Opacity + 0.165f, 0f, 1f); Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); @@ -341,33 +326,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void HitEffect(int hitDirection, double damage) { - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) + if (npc.life <= 0) + { + for (int i = 1; i <= 3; i++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } + Vector2 goreSpawnPosition = npc.Center; + + // Spawn at a slight offset when spawning mandibles. + if (i == 2) + goreSpawnPosition += npc.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver4) * 16f; + if (i == 3) + goreSpawnPosition += npc.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-MathHelper.PiOver4) * 16f; + Gore.NewGorePerfect(goreSpawnPosition, npc.velocity, mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherHead_Gore{i}"), npc.scale); } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } + } } } } diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index 96ba6ba4a9..a87c752b70 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -42,8 +42,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.dontCountMe = true; } @@ -185,32 +183,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } + { + for (int i = 1; i <= 2; i++) + { + Vector2 goreSpawnPosition = npc.Center; + if (i == 2) + goreSpawnPosition -= (npc.rotation - MathHelper.PiOver2).ToRotationVector2() * 20f; + Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherTail_Gore{i}"), npc.scale); + } + } } public override bool CheckActive() diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 3be7354009..5d2c1e4c29 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -16,11 +16,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { private int timer = 0; private bool start = true; + public NPC SCal => Main.npc[CalamityGlobalNPC.SCal]; + public Player Target => Main.player[npc.target]; + public Vector2 EyePosition => npc.Center + new Vector2(npc.spriteDirection == -1 ? 40f : -36f, 16f); + public ref float RotationalDegreeOffset => ref npc.ai[1]; public override void SetStaticDefaults() { DisplayName.SetDefault("Soul Seeker"); - Main.npcFrameCount[npc.type] = 8; + Main.npcFrameCount[npc.type] = 1; NPCID.Sets.TrailingMode[npc.type] = 1; } @@ -37,8 +41,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.defense = 60; npc.DR_NERD(0.25f); npc.LifeMaxNERB(Main.expertMode ? 24000 : 15000, 28000); - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath52; } public override void SendExtraAI(BinaryWriter writer) @@ -62,33 +66,36 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override bool PreAI() { - NPC parent = Main.npc[CalamityGlobalNPC.SCal]; + // Die if SCal is no longer present. + if (CalamityGlobalNPC.SCal < 0 || !SCal.active) + { + npc.active = false; + npc.netUpdate = true; + return false; + } + bool expertMode = Main.expertMode; if (start) { - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - } - npc.ai[1] = npc.ai[0]; + for (int i = 0; i < 10; i++) + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + RotationalDegreeOffset = npc.ai[0]; start = false; } // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + if (npc.target < 0 || npc.target == Main.maxPlayers || Target.dead || !Target.active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + // Target another player if the current player target is too far away + if (!npc.WithinRange(Target.Center, CalamityGlobalNPC.CatchUpDistance200Tiles)) npc.TargetClosest(); - Vector2 direction = Main.player[npc.target].Center - npc.Center; - direction.Normalize(); - direction *= 9f; - npc.rotation = direction.ToRotation(); + npc.spriteDirection = (Target.Center.X < npc.Center.X).ToDirectionInt(); + timer++; - int timerLimit = CalamityWorld.malice ? 120 : 180; - if (timer > timerLimit) + int shootRate = CalamityWorld.malice ? 120 : 180; + if (timer > shootRate) { for (int i = 0; i < Main.maxNPCs; i++) { @@ -96,7 +103,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (seeker.type == npc.type) { if (seeker == npc) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), parent.Center); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), SCal.Center); break; } } @@ -104,24 +111,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, direction, type, damage, 1f, Main.myPlayer); + Vector2 shootVelocity = (Target.Center - EyePosition).SafeNormalize(Vector2.UnitY) * 9f; + Projectile.NewProjectile(EyePosition, shootVelocity, type, damage, 1f, Main.myPlayer); } timer = 0; npc.netUpdate = true; } - if (CalamityGlobalNPC.SCal < 0 || !parent.active) - { - npc.active = false; - npc.netUpdate = true; - return false; - } - Player player = Main.player[npc.target]; - double deg = npc.ai[1]; - double rad = deg * (Math.PI / 180); - double dist = 300; - npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; - npc.ai[1] += 0.5f; //2 + + npc.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * 300f - npc.Size * 0.5f; + RotationalDegreeOffset += 0.5f; return false; } @@ -180,7 +178,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Color color36 = Color.White; float amount9 = 0.5f; - int num153 = 5; + int num153 = 2; if (CalamityConfig.Instance.Afterimages) { diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.png b/NPCs/SupremeCalamitas/SoulSeekerSupreme.png index d0ae0b4980..087ce4d987 100644 Binary files a/NPCs/SupremeCalamitas/SoulSeekerSupreme.png and b/NPCs/SupremeCalamitas/SoulSeekerSupreme.png differ diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow.png b/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow.png index 27c809cbac..03a76af15a 100644 Binary files a/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow.png and b/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow.png differ diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index f164b1deae..b1c0ec06a8 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2530,11 +2530,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // And play a fire-like sound effect. - Main.PlaySound(SoundID.DD2_BetsyWindAttack, target.Center); hasSummonedSepulcher1 = true; hasSummonedSepulcher2 = npc.life <= npc.lifeMax * 0.08; - // TODO: Resprite brimstone hearts a bit. if (Main.netMode != NetmodeID.MultiplayerClient) { List hearts = new List(); @@ -2556,6 +2554,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); npc.netUpdate = true; } + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/SepulcherSpawn"), target.Center); } } diff --git a/Projectiles/Typeless/SepulcherSoul.cs b/Projectiles/Typeless/SepulcherSoul.cs new file mode 100644 index 0000000000..38e6ccace4 --- /dev/null +++ b/Projectiles/Typeless/SepulcherSoul.cs @@ -0,0 +1,42 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class SepulcherSoul : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tormented Soul"); + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.Opacity = 0f; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 120; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + projectile.frame = Main.rand.Next(Main.projFrames[projectile.type]); + projectile.localAI[0] = 1f; + } + Vector2 idealVelocity = Vector2.Zero; + idealVelocity.X = (float)(Math.Sin(Time / 27f + projectile.identity * 1.1f) + (float)Math.Cos(Math.E * (Time / 27f + projectile.identity * 1.1f))) * 4f; + idealVelocity.Y = MathHelper.SmoothStep(-3f, -9f, (float)Math.Sin(Time / 23f + projectile.identity * 1.1f) * 0.5f + 0.5f); + projectile.velocity = Vector2.Lerp(projectile.velocity, idealVelocity, 0.075f); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true) * Utils.InverseLerp(0f, 25f, projectile.timeLeft, true); + Time++; + } + } +} diff --git a/Projectiles/Typeless/SepulcherSoul.png b/Projectiles/Typeless/SepulcherSoul.png new file mode 100644 index 0000000000..a59212a6b7 Binary files /dev/null and b/Projectiles/Typeless/SepulcherSoul.png differ diff --git a/Sounds/Custom/SCalSounds/SepulcherSpawn.cs b/Sounds/Custom/SCalSounds/SepulcherSpawn.cs new file mode 100644 index 0000000000..45ffb992dd --- /dev/null +++ b/Sounds/Custom/SCalSounds/SepulcherSpawn.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom.SCalSounds +{ + public class SepulcherSpawn : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/SCalSounds/SepulcherSpawn.ogg b/Sounds/Custom/SCalSounds/SepulcherSpawn.ogg new file mode 100644 index 0000000000..b0b6e2ccf8 Binary files /dev/null and b/Sounds/Custom/SCalSounds/SepulcherSpawn.ogg differ diff --git a/Sounds/NPCKilled/SepulcherDeath.cs b/Sounds/NPCKilled/SepulcherDeath.cs new file mode 100644 index 0000000000..d4e74ea577 --- /dev/null +++ b/Sounds/NPCKilled/SepulcherDeath.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.NPCKilled +{ + public class SepulcherDeath : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/NPCKilled/SepulcherDeath.ogg b/Sounds/NPCKilled/SepulcherDeath.ogg new file mode 100644 index 0000000000..8da5bc6466 Binary files /dev/null and b/Sounds/NPCKilled/SepulcherDeath.ogg differ