diff --git a/CalamityModMusic.cs b/CalamityModMusic.cs index f8446f8..cabeb53 100644 --- a/CalamityModMusic.cs +++ b/CalamityModMusic.cs @@ -28,11 +28,7 @@ namespace CalamityModMusic ModLoader.TryGetMod("MusicDisplay", out musicDisplay); if (!Main.dedServ) - { - if (wikithis is not null) - wikithis.Call("AddModURL", this, CalamityWikiURL); - } - + wikithis?.Call("AddModURL", this, CalamityWikiURL); } public override void Unload() diff --git a/ExternalModSupport.cs b/ExternalModSupport.cs index a35ac80..9c093de 100644 --- a/ExternalModSupport.cs +++ b/ExternalModSupport.cs @@ -91,6 +91,7 @@ namespace CalamityModMusic AddMusic("BrimstoneElemental", "DMDOKURO"); AddMusic("CalamitasClone", "DMDOKURO"); AddMusic("CalamitasDefeat", "DMDOKURO"); + AddMusic("CalamitasDefeat_LongFade", "DMDOKURO"); AddMusic("CalamitasPhase1", "DMDOKURO"); AddMusic("CalamitasPhase2", "DMDOKURO"); AddMusic("CalamitasPhase3", "DMDOKURO"); @@ -99,11 +100,15 @@ namespace CalamityModMusic AddMusic("Crabulon", "DMDOKURO"); AddMusic("Cryogen", "DMDOKURO"); AddMusic("DesertScourge", "DMDOKURO"); + AddMusic("DevourerofGodsEulogy", "DMDOKURO"); AddMusic("DevourerofGodsPhase1", "DMDOKURO"); AddMusic("DevourerofGodsPhase2", "DMDOKURO"); AddMusic("Dragonfolly", "DMDOKURO"); AddMusic("ExoMechs", "PinpinNeon"); AddMusic("HiveMind", "DMDOKUROFeature"); + AddMusic("Interlude1", "DMDOKURO"); + AddMusic("Interlude2", "DMDOKURO"); + AddMusic("Interlude3", "DMDOKURO"); AddMusic("Leviathan", "DMDOKURO"); AddMusic("OldDuke", "DMDOKURO"); AddMusic("Perforators", "DMDOKUROFeature"); diff --git a/Items/Placeables/DevourerofGodsEulogyMusicBox.cs b/Items/Placeables/DevourerofGodsEulogyMusicBox.cs new file mode 100644 index 0000000..9e6b30f --- /dev/null +++ b/Items/Placeables/DevourerofGodsEulogyMusicBox.cs @@ -0,0 +1,9 @@ +using Terraria.ModLoader; + +namespace CalamityModMusic.Items.Placeables +{ + public class DevourerofGodsEulogyMusicBox : MusicBox + { + public override int MusicBoxTile => ModContent.TileType(); + } +} diff --git a/Items/Placeables/DevourerofGodsEulogyMusicBox.png b/Items/Placeables/DevourerofGodsEulogyMusicBox.png new file mode 100644 index 0000000..f983942 Binary files /dev/null and b/Items/Placeables/DevourerofGodsEulogyMusicBox.png differ diff --git a/Items/Placeables/Interlude1MusicBox.cs b/Items/Placeables/Interlude1MusicBox.cs new file mode 100644 index 0000000..e6f7402 --- /dev/null +++ b/Items/Placeables/Interlude1MusicBox.cs @@ -0,0 +1,9 @@ +using Terraria.ModLoader; + +namespace CalamityModMusic.Items.Placeables +{ + public class Interlude1MusicBox : MusicBox + { + public override int MusicBoxTile => ModContent.TileType(); + } +} \ No newline at end of file diff --git a/Items/Placeables/Interlude1MusicBox.png b/Items/Placeables/Interlude1MusicBox.png new file mode 100644 index 0000000..bd670c2 Binary files /dev/null and b/Items/Placeables/Interlude1MusicBox.png differ diff --git a/Items/Placeables/Interlude2MusicBox.cs b/Items/Placeables/Interlude2MusicBox.cs new file mode 100644 index 0000000..01d1ff4 --- /dev/null +++ b/Items/Placeables/Interlude2MusicBox.cs @@ -0,0 +1,9 @@ +using Terraria.ModLoader; + +namespace CalamityModMusic.Items.Placeables +{ + public class Interlude2MusicBox : MusicBox + { + public override int MusicBoxTile => ModContent.TileType(); + } +} \ No newline at end of file diff --git a/Items/Placeables/Interlude2MusicBox.png b/Items/Placeables/Interlude2MusicBox.png new file mode 100644 index 0000000..6dd32b8 Binary files /dev/null and b/Items/Placeables/Interlude2MusicBox.png differ diff --git a/Items/Placeables/Interlude3MusicBox.cs b/Items/Placeables/Interlude3MusicBox.cs new file mode 100644 index 0000000..8c7311f --- /dev/null +++ b/Items/Placeables/Interlude3MusicBox.cs @@ -0,0 +1,9 @@ +using Terraria.ModLoader; + +namespace CalamityModMusic.Items.Placeables +{ + public class Interlude3MusicBox : MusicBox + { + public override int MusicBoxTile => ModContent.TileType(); + } +} \ No newline at end of file diff --git a/Items/Placeables/Interlude3MusicBox.png b/Items/Placeables/Interlude3MusicBox.png new file mode 100644 index 0000000..61d1534 Binary files /dev/null and b/Items/Placeables/Interlude3MusicBox.png differ diff --git a/Localization/en-US.hjson b/Localization/en-US.hjson index deb5217..95fce1f 100644 --- a/Localization/en-US.hjson +++ b/Localization/en-US.hjson @@ -164,6 +164,11 @@ Mods: { Tooltip: Plays 'Guardian of the Former Seas' by DM DOKURO } + DevourerofGodsEulogyMusicBox: { + DisplayName: Music Box (Devourer of Gods - Eulogy) + Tooltip: Plays 'Scourge of the Universe (Eulogy for the Ego)' by DM DOKURO + } + DevourerofGodsPhase1MusicBox: { DisplayName: Music Box (Devourer of Gods - Phase 1) Tooltip: Plays 'Scourge of the Universe' by DM DOKURO @@ -193,6 +198,21 @@ Mods: { Tooltip: Plays 'The Filthy Mind' by DM DOKURO and SixteenInMono } + Interlude1MusicBox: { + DisplayName: Music Box (Interlude 1) + Tooltip: Plays 'Silence before the storms' by DM DOKURO + } + + Interlude2MusicBox: { + DisplayName: Music Box (Interlude 2) + Tooltip: Plays 'Storms before the catastrophes' by DM DOKURO + } + + Interlude3MusicBox: { + DisplayName: Music Box (Interlude 3) + Tooltip: Plays 'Catastrophes before the calamity' by DM DOKURO + } + LeviathanMusicBox: { DisplayName: Music Box (Leviathan) Tooltip: Plays 'Forbidden Lullaby' by DM DOKURO @@ -309,6 +329,7 @@ Mods: { BrimstoneElemental: Left Alone CalamitasClone: Raw, Unfiltered Calamity CalamitasDefeat: Stained, Brutal Calamity (Acceptance) + CalamitasDefeat_LongFade: Stained, Brutal Calamity (Acceptance) CalamitasPhase1: Stained, Brutal Calamity (Grief) CalamitasPhase2: Stained, Brutal Calamity (Lament) CalamitasPhase3: Stained, Brutal Calamity (Epiphany) @@ -317,11 +338,15 @@ Mods: { Crabulon: Infestation Cryogen: Antarctic Reinforcement DesertScourge: Guardian of the Former Seas + DevourerofGodsEulogy: Eulogy for the Ego DevourerofGodsPhase1: Scourge of the Universe DevourerofGodsPhase2: Universal Collapse Dragonfolly: Murderswarm ExoMechs: Inferior Fabrications HiveMind: The Filthy Mind + Interlude1: Silence Before the Storms + Interlude2: Storms Before the Catastrophes + Interlude3: Catastrophes Before the Calamity Leviathan: Forbidden Lullaby OldDuke: Toxic Wisdom Perforators: Blood Coagulant diff --git a/MusicBoxRegistry.cs b/MusicBoxRegistry.cs index a3b1a96..4b5a9f7 100644 --- a/MusicBoxRegistry.cs +++ b/MusicBoxRegistry.cs @@ -1,4 +1,7 @@ -using Terraria; +using System.Collections.Generic; +using System.Reflection; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; using AbyssLayer1MusicBox = CalamityModMusic.Items.Placeables.AbyssLayer1MusicBox; using AbyssLayer2MusicBox = CalamityModMusic.Items.Placeables.AbyssLayer2MusicBox; @@ -32,11 +35,15 @@ using CeaselessVoidMusicBox = CalamityModMusic.Items.Placeables.CeaselessVoidMus using CrabulonMusicBox = CalamityModMusic.Items.Placeables.CrabulonMusicBox; using CryogenMusicBox = CalamityModMusic.Items.Placeables.CryogenMusicBox; using DesertScourgeMusicBox = CalamityModMusic.Items.Placeables.DesertScourgeMusicBox; +using DevourerofGodsEulogyMusicBox = CalamityModMusic.Items.Placeables.DevourerofGodsEulogyMusicBox; using DevourerofGodsPhase1MusicBox = CalamityModMusic.Items.Placeables.DevourerofGodsPhase1MusicBox; using DevourerofGodsPhase2MusicBox = CalamityModMusic.Items.Placeables.DevourerofGodsPhase2MusicBox; using DragonfollyMusicBox = CalamityModMusic.Items.Placeables.DragonfollyMusicBox; using ExoMechsMusicBox = CalamityModMusic.Items.Placeables.ExoMechsMusicBox; using HiveMindMusicBox = CalamityModMusic.Items.Placeables.HiveMindMusicBox; +using Interlude1MusicBox = CalamityModMusic.Items.Placeables.Interlude1MusicBox; +using Interlude2MusicBox = CalamityModMusic.Items.Placeables.Interlude2MusicBox; +using Interlude3MusicBox = CalamityModMusic.Items.Placeables.Interlude3MusicBox; using LeviathanMusicBox = CalamityModMusic.Items.Placeables.LeviathanMusicBox; using OldDukeMusicBox = CalamityModMusic.Items.Placeables.OldDukeMusicBox; using PerforatorsMusicBox = CalamityModMusic.Items.Placeables.PerforatorsMusicBox; @@ -133,6 +140,30 @@ namespace CalamityModMusic // Other Music. AddMusicBox("Sounds/Music/CalamityTitle", ModContent.ItemType(), ModContent.TileType()); //Seamless + AddMusicBox("Sounds/Music/Interlude1", ModContent.ItemType(), ModContent.TileType()); + AddMusicBox("Sounds/Music/Interlude2", ModContent.ItemType(), ModContent.TileType()); + AddMusicBox("Sounds/Music/Interlude3", ModContent.ItemType(), ModContent.TileType()); + AddMusicBox("Sounds/Music/DevourerofGodsEulogy", ModContent.ItemType(), ModContent.TileType()); + + // This makes it so that the SCal "Acceptance" event records a regular acceptance music box, despite them + // technically being 2 separate tracks + if (!Main.dedServ) + { + // `musicToItem` is a Dictionary of music slots to item types that is used to + // convert music boxes while music is playing + // + // It is marked as internal, so we need to use reflection to modify it directly, but + // by doing so we can make it so that 2 different tracks point to the same music box + FieldInfo info = typeof(MusicLoader).GetField("musicToItem", BindingFlags.NonPublic | BindingFlags.Static); + var musicToItem = (Dictionary)info.GetValue(null); + + int musicSlot = MusicLoader.GetMusicSlot(CalamityModMusic.Instance, "Sounds/Music/CalamitasDefeat_LongFade"); + int itemType = ModContent.ItemType(); + + // The FieldInfo returns the same Dictionary instance as the one in the music loader, + // so the field does not need to have its value re-set so long as the Dictionary is modified + musicToItem[musicSlot] = itemType; + } } } } diff --git a/NPCShops.cs b/NPCShops.cs new file mode 100644 index 0000000..d516684 --- /dev/null +++ b/NPCShops.cs @@ -0,0 +1,26 @@ +using CalamityModMusic.Items.Placeables; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityModMusic +{ + public class NPCShops : GlobalNPC + { + public override void ModifyShop(NPCShop shop) + { + var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); + + Condition DownedCalamitasClone = new("", () => (bool)calamity.Call("GetBossDowned", "calamitasclone")); + Condition DownedYharon = new("", () => (bool)calamity.Call("GetBossDowned", "yharon")); + Condition DownedDevourerofGods = new("", () => (bool)calamity.Call("GetBossDowned", "devourerofgods")); + + if (calamityMod && shop.NpcType == calamity.Find("FAP").Type) + { + shop.Add(ModContent.ItemType(), DownedCalamitasClone); + shop.Add(ModContent.ItemType(), Condition.DownedMoonLord); + shop.Add(ModContent.ItemType(), DownedYharon); + shop.Add(ModContent.ItemType(), DownedDevourerofGods); + } + } + } +} diff --git a/Sounds/Music/CalamitasDefeat_LongFade.ogg b/Sounds/Music/CalamitasDefeat_LongFade.ogg new file mode 100644 index 0000000..ef2242a Binary files /dev/null and b/Sounds/Music/CalamitasDefeat_LongFade.ogg differ diff --git a/Sounds/Music/DevourerofGodsEulogy.ogg b/Sounds/Music/DevourerofGodsEulogy.ogg new file mode 100644 index 0000000..7717e45 Binary files /dev/null and b/Sounds/Music/DevourerofGodsEulogy.ogg differ diff --git a/Sounds/Music/Interlude1.ogg b/Sounds/Music/Interlude1.ogg new file mode 100644 index 0000000..469d888 Binary files /dev/null and b/Sounds/Music/Interlude1.ogg differ diff --git a/Sounds/Music/Interlude2.ogg b/Sounds/Music/Interlude2.ogg new file mode 100644 index 0000000..ed17e72 Binary files /dev/null and b/Sounds/Music/Interlude2.ogg differ diff --git a/Sounds/Music/Interlude2_CutIntro.ogg b/Sounds/Music/Interlude2_CutIntro.ogg new file mode 100644 index 0000000..0921a14 Binary files /dev/null and b/Sounds/Music/Interlude2_CutIntro.ogg differ diff --git a/Sounds/Music/Interlude3.ogg b/Sounds/Music/Interlude3.ogg new file mode 100644 index 0000000..e773bfc Binary files /dev/null and b/Sounds/Music/Interlude3.ogg differ diff --git a/Tiles/DevourerofGodsEulogyMusicBox.cs b/Tiles/DevourerofGodsEulogyMusicBox.cs new file mode 100644 index 0000000..2c9b778 --- /dev/null +++ b/Tiles/DevourerofGodsEulogyMusicBox.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; + +namespace CalamityModMusic.Tiles +{ + public class DevourerofGodsEulogyMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Tiles/DevourerofGodsEulogyMusicBox.png b/Tiles/DevourerofGodsEulogyMusicBox.png new file mode 100644 index 0000000..26129ae Binary files /dev/null and b/Tiles/DevourerofGodsEulogyMusicBox.png differ diff --git a/Tiles/Interlude1MusicBox.cs b/Tiles/Interlude1MusicBox.cs new file mode 100644 index 0000000..7673e2d --- /dev/null +++ b/Tiles/Interlude1MusicBox.cs @@ -0,0 +1,6 @@ +namespace CalamityModMusic.Tiles +{ + public class Interlude1MusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Tiles/Interlude1MusicBox.png b/Tiles/Interlude1MusicBox.png new file mode 100644 index 0000000..267b314 Binary files /dev/null and b/Tiles/Interlude1MusicBox.png differ diff --git a/Tiles/Interlude2MusicBox.cs b/Tiles/Interlude2MusicBox.cs new file mode 100644 index 0000000..b1dba58 --- /dev/null +++ b/Tiles/Interlude2MusicBox.cs @@ -0,0 +1,6 @@ +namespace CalamityModMusic.Tiles +{ + public class Interlude2MusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Tiles/Interlude2MusicBox.png b/Tiles/Interlude2MusicBox.png new file mode 100644 index 0000000..0e48843 Binary files /dev/null and b/Tiles/Interlude2MusicBox.png differ diff --git a/Tiles/Interlude3MusicBox.cs b/Tiles/Interlude3MusicBox.cs new file mode 100644 index 0000000..e6b37fc --- /dev/null +++ b/Tiles/Interlude3MusicBox.cs @@ -0,0 +1,6 @@ +namespace CalamityModMusic.Tiles +{ + public class Interlude3MusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Tiles/Interlude3MusicBox.png b/Tiles/Interlude3MusicBox.png new file mode 100644 index 0000000..c2d8969 Binary files /dev/null and b/Tiles/Interlude3MusicBox.png differ diff --git a/description_workshop.txt b/description_workshop.txt index fb5e7f7..efa2869 100644 --- a/description_workshop.txt +++ b/description_workshop.txt @@ -29,12 +29,14 @@ Full list of tracks: [*] DM DOKURO - Outcast of the Sulphurous Seas [*] DM DOKURO - Left Alone [*] DM DOKURO - Raw, Unfiltered Calamity +[*] DM DOKURO - Silence Before the Storms [*] RoverdriveX - R'LYEH [*] DM DOKURO - The Leviathan Trilogy (split into three songs) [*] DM DOKURO - Interstellar Stomper [*] DM DOKURO - Fly of Beelzebub [*] DM DOKURO - Open Frenzy [*] DM DOKURO - Pest of the Cosmos +[*] DM DOKURO - Storms Before the Catastrophes [*] DM DOKURO - Unholy Ambush [*] DM DOKURO - Murderswarm [*] DM DOKURO - Unholy Insurgency @@ -45,9 +47,11 @@ Full list of tracks: [*] DM DOKURO - Toxic Wisdom [*] DM DOKURO - Scourge of the Universe [*] DM DOKURO - Universal Collapse +[*] DM DOKURO - Eulogy for the Ego [*] DM DOKURO - Infernal Catharsis [*] DM DOKURO - Infernal Catharsis (Rebirth) [*] DM DOKURO - Roar of the Jungle Dragon +[*] DM DOKURO - Catastrophes Before the Calamity [*] PinpinNeon - Inferior Fabrications [*] DM DOKURO - Stained, Brutal Calamity (split into four songs) [*] DM DOKURO - Threats of the Ocean Floor