diff --git a/.gitignore b/.gitignore index 516f1ca..58da89e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ ## files generated by popular Visual Studio add-ons. *.csproj *.sln -Properties/ # User-specific files *.suo diff --git a/Assets/Music/Biomes/Corruption.ogg b/Assets/Music/Biomes/Corruption.ogg index 47e7524..8652367 100644 Binary files a/Assets/Music/Biomes/Corruption.ogg and b/Assets/Music/Biomes/Corruption.ogg differ diff --git a/Assets/Music/Biomes/CrimsonUnderground.ogg b/Assets/Music/Biomes/CrimsonUnderground.ogg index 1a2ca77..087d6a7 100644 Binary files a/Assets/Music/Biomes/CrimsonUnderground.ogg and b/Assets/Music/Biomes/CrimsonUnderground.ogg differ diff --git a/Assets/Music/Biomes/ForestDayAfternoon.ogg b/Assets/Music/Biomes/ForestDayAfternoon.ogg index b90dc0f..14292d0 100644 Binary files a/Assets/Music/Biomes/ForestDayAfternoon.ogg and b/Assets/Music/Biomes/ForestDayAfternoon.ogg differ diff --git a/Assets/Music/Biomes/ForestDayMorning.ogg b/Assets/Music/Biomes/ForestDayMorning.ogg index c6210a3..0ae3567 100644 Binary files a/Assets/Music/Biomes/ForestDayMorning.ogg and b/Assets/Music/Biomes/ForestDayMorning.ogg differ diff --git a/Assets/Music/Bosses/BrainofCthulhu.ogg b/Assets/Music/Bosses/BrainofCthulhu.ogg index 1895184..1542173 100644 Binary files a/Assets/Music/Bosses/BrainofCthulhu.ogg and b/Assets/Music/Bosses/BrainofCthulhu.ogg differ diff --git a/Assets/Music/Bosses/EaterofWorlds.ogg b/Assets/Music/Bosses/EaterofWorlds.ogg index 005d243..fffa385 100644 Binary files a/Assets/Music/Bosses/EaterofWorlds.ogg and b/Assets/Music/Bosses/EaterofWorlds.ogg differ diff --git a/Assets/Music/Events/BloodMoon.ogg b/Assets/Music/Events/BloodMoon.ogg index 9899277..5c46113 100644 Binary files a/Assets/Music/Events/BloodMoon.ogg and b/Assets/Music/Events/BloodMoon.ogg differ diff --git a/Assets/Music/Events/BloodMoonDeath.ogg b/Assets/Music/Events/BloodMoonDeath.ogg index 48a3ecc..6a3d1e5 100644 Binary files a/Assets/Music/Events/BloodMoonDeath.ogg and b/Assets/Music/Events/BloodMoonDeath.ogg differ diff --git a/Assets/Music/Events/LanternFestival.ogg b/Assets/Music/Events/LanternFestival.ogg index 10c0280..caf1bcc 100644 Binary files a/Assets/Music/Events/LanternFestival.ogg and b/Assets/Music/Events/LanternFestival.ogg differ diff --git a/Assets/Music/Events/OceanRain.ogg b/Assets/Music/Events/OceanRain.ogg new file mode 100644 index 0000000..95408ca Binary files /dev/null and b/Assets/Music/Events/OceanRain.ogg differ diff --git a/Assets/Music/Events/Rain.ogg b/Assets/Music/Events/Rain.ogg index e067ddf..ac4dd6d 100644 Binary files a/Assets/Music/Events/Rain.ogg and b/Assets/Music/Events/Rain.ogg differ diff --git a/Assets/Music/Events/TorchGod.ogg b/Assets/Music/Events/TorchGod.ogg new file mode 100644 index 0000000..39eb2f7 Binary files /dev/null and b/Assets/Music/Events/TorchGod.ogg differ diff --git a/Assets/Music/Events/TorchGodRevengeance.ogg b/Assets/Music/Events/TorchGodRevengeance.ogg new file mode 100644 index 0000000..4703160 Binary files /dev/null and b/Assets/Music/Events/TorchGodRevengeance.ogg differ diff --git a/Assets/Music/Events/TownParty.ogg b/Assets/Music/Events/TownParty.ogg new file mode 100644 index 0000000..572016b Binary files /dev/null and b/Assets/Music/Events/TownParty.ogg differ diff --git a/Assets/Music/Events/TownRain.ogg b/Assets/Music/Events/TownRain.ogg new file mode 100644 index 0000000..3ec48f5 Binary files /dev/null and b/Assets/Music/Events/TownRain.ogg differ diff --git a/Assets/Music/Misc/FalseEpilogue.ogg b/Assets/Music/Misc/FalseEpilogue.ogg index 8143fd7..cb49539 100644 Binary files a/Assets/Music/Misc/FalseEpilogue.ogg and b/Assets/Music/Misc/FalseEpilogue.ogg differ diff --git a/Assets/Music/Misc/HardmodeInterlude.ogg b/Assets/Music/Misc/HardmodeInterlude.ogg index 364fb41..8eed13d 100644 Binary files a/Assets/Music/Misc/HardmodeInterlude.ogg and b/Assets/Music/Misc/HardmodeInterlude.ogg differ diff --git a/Assets/Sounds/Silence.ogg b/Assets/Sounds/Silence.ogg new file mode 100644 index 0000000..1fc2e1e Binary files /dev/null and b/Assets/Sounds/Silence.ogg differ diff --git a/Common/Configs/MusicConfig.cs b/Common/Configs/MusicConfig.cs index 4f04cef..4808ad6 100644 --- a/Common/Configs/MusicConfig.cs +++ b/Common/Configs/MusicConfig.cs @@ -8,15 +8,19 @@ namespace UnCalamityModMusic.Common.Configs { public override ConfigScope Mode => ConfigScope.ClientSide; - [Header("$Mods.UnCalamityModMusic.Configs.MusicConfig.MusicChangesHeader")] + [Header("$Mods.UnCalamityModMusic.Configs.MusicConfig.MusicTogglesHeader")] - [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool WorkshopThemes { get; set; } + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool WorkshopThemes { get; set; } - [BackgroundColor(192, 54, 64, 192)] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool HardmodeInterlude { get; set; } + + [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] - public bool DeepAbyssAltTheme { get; set; } + public bool AbyssLayer3Alt { get; set; } [Header("$Mods.UnCalamityModMusic.Configs.MusicConfig.ConditionChangesHeader")] @@ -26,6 +30,6 @@ namespace UnCalamityModMusic.Common.Configs [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] - public bool OverrideAnahitasLureTheme { get; set; } + public bool OverrideAnahitasLure { get; set; } } } \ No newline at end of file diff --git a/Common/Configs/OtherConfig.cs b/Common/Configs/OtherConfig.cs index d5154f4..0def5b4 100644 --- a/Common/Configs/OtherConfig.cs +++ b/Common/Configs/OtherConfig.cs @@ -27,9 +27,14 @@ namespace UnCalamityModMusic.Common.Configs [Header("$Mods.UnCalamityModMusic.Configs.OtherConfig.OtherChangesHeader")] - [ReloadRequired] + [ReloadRequired] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + public bool MusicBoxRecipes { get; set; } + + [ReloadRequired] [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool MusicBoxResprite { get; set; } - } + } } \ No newline at end of file diff --git a/Common/ModCompatibility/MusicDisplayCompatibility.cs b/Common/ModCompatibility/MusicDisplayCompatibility.cs index fb92623..58f3004 100644 --- a/Common/ModCompatibility/MusicDisplayCompatibility.cs +++ b/Common/ModCompatibility/MusicDisplayCompatibility.cs @@ -38,6 +38,7 @@ namespace UnCalamityModMusic.Common.ModCompatibility AddMusic("WorkshopTier2", "HeartPlusUp", "Biomes"); AddMusic("WorkshopTier1", "HeartPlusUp", "Biomes"); AddMusic("TownNight", "HeartPlusUp", "Biomes"); + AddMusic("TownNight_Noiseless", "HeartPlusUp", "Biomes"); AddMusic("TownDay", "HeartPlusUp", "Biomes"); //AddMusic("JungleTemple", "Universe", "Biomes"); AddMusic("Dungeon", "HeartPlusUp", "Biomes"); @@ -87,7 +88,8 @@ namespace UnCalamityModMusic.Common.ModCompatibility AddMusic("KingSlime", "HeartPlusUp", "Bosses"); //AddMusic("FrostMoon", "HeartPlusUp", "Events"); //AddMusic("PumpkinMoon", "HeartPlusUp", "Events"); - //AddMusic("TorchGod", "HeartPlusUp", "Events"); + AddMusic("TorchGod", "HeartPlusUp", "Events"); + AddMusic("TorchGodRevengeance", "HeartPlusUp", "Events"); //AddMusic("LunarTowersSolar", "HeartPlusUp", "Events"); //AddMusic("LunarTowersNebula", "HeartPlusUp", "Events"); //AddMusic("LunarTowersVortex", "HeartPlusUp", "Events"); @@ -97,13 +99,16 @@ namespace UnCalamityModMusic.Common.ModCompatibility //AddMusic("FrostLegion", "HeartPlusUp", "Events"); //AddMusic("GoblinArmy", "HeartPlusUp", "Events"); //AddMusic("SolarEclipse", "HeartPlusUp", "Events"); - AddMusic("BloodMoonDeath", "Thriplerex", "Events"); AddMusic("BloodMoon", "Thriplerex", "Events"); + AddMusic("BloodMoonDeath", "Thriplerex", "Events"); AddMusic("SlimeRain", "HeartPlusUp", "Events"); //AddMusic("Blizzard", "Universe", "Events"); //AddMusic("Sandstorm", "Universe", "Events"); + AddMusic("OceanRain", "HeartPlusUp", "Events"); //AddMusic("Thunderstorm", "Universe", "Events"); + AddMusic("TownRain", "HeartPlusUp", "Events"); AddMusic("Rain", "HeartPlusUp", "Events"); + AddMusic("TownParty", "HeartPlusUp", "Events"); //AddMusic("WindyDay", "HeartPlusUp", "Events"); AddMusic("LanternFestival", "HeartPlusUp", "Events"); AddMusic("HardmodeInterlude", "Salvati", "Misc"); diff --git a/Common/Music/AmbienceScenes.cs b/Common/Music/AmbienceScenes.cs index a464196..2b6baf0 100644 --- a/Common/Music/AmbienceScenes.cs +++ b/Common/Music/AmbienceScenes.cs @@ -37,7 +37,7 @@ namespace UnCalamityModMusic.Common.Music public override int Music => MusicPathing.GetAmbienceSlot(Path); - public override SceneEffectPriority Priority => (Main.LocalPlayer.townNPCs > 2f || ModContent.GetInstance().IsSceneEffectActive(Main.LocalPlayer)) ? SceneEffectPriority.Environment : ScenePriority; + public override SceneEffectPriority Priority => (Main.LocalPlayer.townNPCs > 2f || ModContent.GetInstance().IsSceneEffectActive(Main.LocalPlayer)) ? SceneEffectPriority.Environment + 1 : ScenePriority; public override float GetWeight(Player player) { diff --git a/Common/Music/BiomeMusicScenes.cs b/Common/Music/BiomeMusicScenes.cs index f4dfe2b..c87e70b 100644 --- a/Common/Music/BiomeMusicScenes.cs +++ b/Common/Music/BiomeMusicScenes.cs @@ -252,7 +252,7 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - return PlayerFlags.ZoneDeepAbyss && !(PlayerFlags.TownSceneActive || PlayerFlags.WorkshopSceneActive) && ModContent.GetInstance().DeepAbyssAltTheme; + return PlayerFlags.ZoneDeepAbyss && !(PlayerFlags.TownSceneActive || PlayerFlags.WorkshopSceneActive) && ModContent.GetInstance().AbyssLayer3Alt; } } public class GlowingMushroomFields : ModSceneEffect diff --git a/Common/Music/BossMusicScenes.cs b/Common/Music/BossMusicScenes.cs index c365144..8d2117c 100644 --- a/Common/Music/BossMusicScenes.cs +++ b/Common/Music/BossMusicScenes.cs @@ -1,13 +1,34 @@ -using System; +using Microsoft.Xna.Framework; +using System; using Terraria; +using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; -using UnCalamityModMusic.Common.Configs; using UnCalamityModMusic.Common.ModCompatibility; namespace UnCalamityModMusic.Common.Music { - public class MoonLord : ModSceneEffect + public class FalseEpilogue : ModSystem + { + public int FalseEpilogueMusicSlot = 0; + + public override void OnWorldLoad() + { + FalseEpilogueMusicSlot = MusicPathing.GetMusicSlot("FalseEpilogue"); + } + + public override void UpdateUI(GameTime gameTime) + { + Player player = Main.player[Main.myPlayer]; + + if (CreditsRollEvent.IsEventOngoing && !player.hasCreditsSceneMusicBox && PlayerFlags.CalamityMusicEventInactive) + { + Main.musicBox2 = FalseEpilogueMusicSlot; + return; + } + } + } + public class MoonLord : ModSceneEffect { public override int Music => InfernumCompatibility.DecideOnMusicPath("MoonLord", "MoonLord"); @@ -26,7 +47,7 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - return WorldFlags.CustomImpendingDoom > 0 || NPC.MoonLordCountdown > 0; + return ImpendingDoomSystem.ImpendingDoomCountdown > 0 || NPC.MoonLordCountdown > 0; } public override void SpecialVisuals(Player player, bool isActive) @@ -197,7 +218,7 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - return WorldFlags.ImminentDestruction > 0; + return ImminentDestructionSystem.ImminentDestructionCountdown > 0; }*/ } public class QueenSlime : ModSceneEffect diff --git a/Common/Music/EventMusicScenes.cs b/Common/Music/EventMusicScenes.cs index 1f2fd62..9538125 100644 --- a/Common/Music/EventMusicScenes.cs +++ b/Common/Music/EventMusicScenes.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; @@ -6,16 +7,56 @@ using UnCalamityModMusic.Common.Configs; namespace UnCalamityModMusic.Common.Music { - public class TorchGod : ModSceneEffect + public class FrostMoon : ModSystem { - /*public override int Music => MusicPathing.GetMusicSlot("TorchGod"); + /*public int FrostMoonMusicSlot = 0; - public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + public override void OnWorldLoad() + { + FrostMoonMusicSlot = MusicPathing.GetMusicSlot("FrostMoon"); + } + + public override void UpdateUI(GameTime gameTime) + { + Player player = Main.player[Main.myPlayer]; + + if (Main.snowMoon && Main.musicBox2 == -1 && (PlayerFlags.onSurface || Main.remixWorld) && PlayerFlags.CalamityMusicEventInactive) + { + Main.musicBox2 = FrostMoonMusicSlot; + return; + } + }*/ + } + public class PumpkinMoon : ModSystem + { + /*public int PumpkinMoonMusicSlot = 0; + + public override void OnWorldLoad() + { + PumpkinMoonMusicSlot = MusicPathing.GetMusicSlot("PumpkinMoon"); + } + + public override void UpdateUI(GameTime gameTime) + { + Player player = Main.player[Main.myPlayer]; + + if (Main.pumpkinMoon && Main.musicBox2 == -1 && (PlayerFlags.onSurface || Main.remixWorld) && PlayerFlags.CalamityMusicEventInactive) + { + Main.musicBox2 = PumpkinMoonMusicSlot; + return; + } + }*/ + } + public class TorchGod : ModSceneEffect + { + public override int Music => PlayerFlags.revengeanceMode ? MusicPathing.GetMusicSlot("TorchGodRevengeance") : MusicPathing.GetMusicSlot("TorchGod"); + + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; public override bool IsSceneEffectActive(Player player) { return player.happyFunTorchTime || (NPC.AnyNPCs(NPCID.TorchGod) && Main.npc[NPC.FindFirstNPC(NPCID.TorchGod)].Distance(player.Center) <= PlayerFlags.MusicTileRange); - }*/ + } } public class LunarTowersSolar : ModSceneEffect { @@ -229,8 +270,8 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - bool condition1 = !Main.remixWorld && PlayerFlags.isRaining && player.ZoneSnow && PlayerFlags.onSurface && !PlayerFlags.ZoneAstralInfection && !(Main.bloodMoon || Main.eclipse); - bool condition2 = Main.remixWorld && PlayerFlags.isRaining && player.ZoneSnow && PlayerFlags.onRemixedSurface && !PlayerFlags.ZoneAstralInfection && !(Main.bloodMoon || Main.eclipse); + bool condition1 = !Main.remixWorld && PlayerFlags.isRaining && player.ZoneSnow && PlayerFlags.onSurface && !(PlayerFlags.inSpace || PlayerFlags.ZoneAstralInfection) && !(Main.bloodMoon || Main.eclipse); + bool condition2 = Main.remixWorld && PlayerFlags.isRaining && player.ZoneSnow && PlayerFlags.onRemixedSurface && !(PlayerFlags.inSpace || PlayerFlags.ZoneAstralInfection) && !(Main.bloodMoon || Main.eclipse); return condition1 || condition2; }*/ @@ -251,8 +292,8 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - bool condition1 = !Main.remixWorld && PlayerFlags.ZoneSandstorm && !PlayerFlags.ugDesertOriginalHeight && !PlayerFlags.ZoneAstralInfection && !(Main.bloodMoon || Main.eclipse); - bool condition2 = Main.remixWorld && PlayerFlags.ZoneSandstorm && PlayerFlags.onRemixedSurface && !PlayerFlags.ZoneAstralInfection && !(Main.bloodMoon || Main.eclipse); + bool condition1 = !Main.remixWorld && PlayerFlags.ZoneSandstorm && !PlayerFlags.ugDesertOriginalHeight && !(PlayerFlags.inSpace || PlayerFlags.ZoneAstralInfection) && !(Main.bloodMoon || Main.eclipse); + bool condition2 = Main.remixWorld && PlayerFlags.ZoneSandstorm && PlayerFlags.onRemixedSurface && !(PlayerFlags.inSpace || PlayerFlags.ZoneAstralInfection) && !(Main.bloodMoon || Main.eclipse); return condition1 || condition2; } @@ -268,7 +309,21 @@ namespace UnCalamityModMusic.Common.Music return Main.slimeRain && PlayerFlags.onSurface && !(player.ZoneGraveyard || PlayerFlags.inSpace) && !(Main.bloodMoon || Main.eclipse); } } - public class Thunderstorm : ModSceneEffect + public class OceanRain : ModSceneEffect + { + public override int Music => MusicPathing.GetMusicSlot("OceanRain"); + + public override SceneEffectPriority Priority => SceneEffectPriority.BiomeMedium; + + public override bool IsSceneEffectActive(Player player) + { + bool condition1 = !Main.remixWorld && PlayerFlags.isRaining && player.ZoneBeach && PlayerFlags.ZoneOverworldHeightExtra && !(player.ZoneSnow || player.ZoneGraveyard || player.ZoneMeteor); + bool condition2 = Main.remixWorld && PlayerFlags.isRaining && player.ZoneBeach && (double)(player.position.Y / 16f) > Main.rockLayer && player.position.Y / 16f < (float)(Main.maxTilesY - 350) && !(player.ZoneSnow || player.ZoneGraveyard || player.ZoneMeteor); + + return condition1 || condition2; + } + } + public class Thunderstorm : ModSceneEffect { /*public override int Music => MusicPathing.GetMusicSlot("Thunderstorm"); @@ -282,7 +337,18 @@ namespace UnCalamityModMusic.Common.Music return condition1 || condition2; }*/ } - public class Rain : ModSceneEffect + public class TownRain : ModSceneEffect + { + public override int Music => MusicPathing.GetMusicSlot("TownRain"); + + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + + public override bool IsSceneEffectActive(Player player) + { + return PlayerFlags.inTownWithRain && PlayerFlags.notInExcludedTownBiome && !(/*Main._shouldUseStormMusic || */player.ZoneBeach || player.ZoneSnow || player.ZoneGraveyard || player.ZoneMeteor); + } + } + public class Rain : ModSceneEffect { public override int Music => MusicPathing.GetMusicSlot("Rain"); @@ -296,7 +362,21 @@ namespace UnCalamityModMusic.Common.Music return condition1 || condition2; } } - public class WindyDay : ModSceneEffect + public class TownParty : ModSceneEffect + { + public override int Music => MusicPathing.GetMusicSlot("TownParty"); + + public override SceneEffectPriority Priority => SceneEffectPriority.Environment + 1; + + public override bool IsSceneEffectActive(Player player) + { + bool condition1 = BirthdayParty.PartyIsUp && PlayerFlags.inTown && PlayerFlags.notInExcludedTownBiome && PlayerFlags.notRaining; + bool condition2 = BirthdayParty.PartyIsUp && PlayerFlags.inUgTown && PlayerFlags.notInExcludedTownBiome; + + return condition1 || condition2; + } + } + public class WindyDay : ModSceneEffect { /*public override int Music => MusicPathing.GetMusicSlot("WindyDay"); diff --git a/Common/Music/LureOverrideMusicScenes.cs b/Common/Music/LureOverrideMusicScenes.cs index f9a3643..53bcf8e 100644 --- a/Common/Music/LureOverrideMusicScenes.cs +++ b/Common/Music/LureOverrideMusicScenes.cs @@ -16,7 +16,7 @@ namespace UnCalamityModMusic.Common.Music public override bool IsSceneEffectActive(Player player) { - return IsAnahitaLureActive() && ModContent.GetInstance().OverrideAnahitasLureTheme; + return IsAnahitaLureActive() && ModContent.GetInstance().OverrideAnahitasLure; } public static bool IsAnahitaLureActive() diff --git a/Common/MusicBoxBase.cs b/Common/MusicBoxBase.cs index d6bc81f..9676be4 100644 --- a/Common/MusicBoxBase.cs +++ b/Common/MusicBoxBase.cs @@ -1,11 +1,16 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; +using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; +using Terraria.Utilities; +using UnCalamityModMusic.Common.Configs; namespace UnCalamityModMusic.Common { @@ -13,30 +18,58 @@ namespace UnCalamityModMusic.Common { public abstract int MusicBoxTile { get; } + public virtual int? MusicBoxTileAlt { get; } = null; + + public abstract string MusicFilePath { get; } + + public virtual void MusicBoxRecipe() { return; } + public override void SetStaticDefaults() { ItemID.Sets.CanGetPrefixes[Type] = false; ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.MusicBox; + + if (!String.IsNullOrEmpty(MusicFilePath) && MusicPathing.GetMusicSlot(MusicFilePath) > 0) + { + if (MusicBoxTileAlt == null) + { + MusicLoader.AddMusicBox(Mod, MusicPathing.GetMusicSlot(MusicFilePath), Type, MusicBoxTile); + } + else + { + MusicLoader.AddMusicBox(Mod, MusicPathing.GetMusicSlot(MusicFilePath), Type, MusicBoxTileAlt.Value); + } + } } public override void SetDefaults() { Item.DefaultToMusicBox(MusicBoxTile); } + + public override void AddRecipes() + { + if (ModContent.GetInstance().MusicBoxRecipes) + { + MusicBoxRecipe(); + } + } } + public abstract class MusicBoxTile : ModTile { public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + TileID.Sets.DisableSmartCursor[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(Type); - TileID.Sets.DisableSmartCursor[Type] = true; AddMapEntry(new Color(191, 142, 111), Language.GetText("ItemName.MusicBox")); } @@ -49,31 +82,32 @@ namespace UnCalamityModMusic.Common player.cursorItemIconID = TileLoader.GetItemDropFromTypeAndStyle(Type); } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override bool CreateDust(int i, int j, ref int type) => false; public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; - if (Main.gamePaused || !Main.instance.IsActive || Lighting.UpdateEveryFrame && !Main.rand.NextBool(4)) + if (Lighting.UpdateEveryFrame && new FastRandom(Main.TileFrameSeed).WithModifier(i, j).Next(4) != 0) { return; } - if (tile.TileFrameX == 36 && tile.TileFrameY % 36 == 0 && (int)Main.timeForVisualEffects % 7 == 0 && Main.rand.NextBool(3)) + if (TileDrawing.IsVisible(tile) && tile.TileFrameX == 36 && tile.TileFrameY % 36 == 0 && (int)Main.timeForVisualEffects % 7 == 0 && Main.rand.NextBool(3)) { int goreType = Main.rand.Next(570, 573); Vector2 position = new Vector2(i * 16 + 8, j * 16 - 8); Vector2 velocity = new Vector2(Main.WindForVisuals * 2f, -0.5f); - velocity.X *= 1f + Main.rand.NextFloat(-0.5f, 0.5f); - velocity.Y *= 1f + Main.rand.NextFloat(-0.5f, 0.5f); + velocity.X *= Main.rand.NextFloat(0.5f, 1.5f); + velocity.Y *= Main.rand.NextFloat(0.5f, 1.5f); if (goreType == 572) { position.X -= 8f; } - - if (goreType == 571) + else if (goreType == 571) { position.X -= 4f; } diff --git a/Common/MusicBoxConnecting.cs b/Common/MusicBoxConnecting.cs new file mode 100644 index 0000000..693f9a2 --- /dev/null +++ b/Common/MusicBoxConnecting.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.Reflection; +using Terraria; +using Terraria.ModLoader; + +namespace UnCalamityModMusic.Common +{ + public class MusicBoxConnecting : ModSystem + { + private static void ConnectMusicBox(string musicKey, int musicBoxItem) + { + int musicPath = MusicPathing.GetMusicSlot(musicKey); + + if (musicPath > 0) + { + FieldInfo info = typeof(MusicLoader).GetField("musicToItem", BindingFlags.NonPublic | BindingFlags.Static); + var musicToItem = (Dictionary)info.GetValue(null); + + musicToItem[musicPath] = musicBoxItem; + } + } + + public override void PostSetupContent() + { + if (!Main.dedServ) + { + ConnectMusicBox("TownNight_Noiseless", ModContent.ItemType()); + } + } + } +} diff --git a/Common/MusicBoxRegistry.cs b/Common/MusicBoxRegistry.cs deleted file mode 100644 index 244b55e..0000000 --- a/Common/MusicBoxRegistry.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace UnCalamityModMusic.Common -{ - public class MusicBoxRegistry : ModSystem - { - private static void AddMusicBox(string musicKey, int musicBoxItem, int musicBoxTile) - { - int musicPath = MusicPathing.GetMusicSlot(musicKey); - - if (musicPath > 0) - { - MusicLoader.AddMusicBox(UnCalamityModMusic.Instance, musicPath, musicBoxItem, musicBoxTile); - } - } - - public override void PostSetupContent() - { - if (!Main.dedServ) - { - //Alternates - AddMusicBox("AbyssLayer3Alt", ModContent.ItemType(), ModContent.TileType()); - - //Biomes - AddMusicBox("Space", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Underworld", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Aether", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Graveyard", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Meteorite", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier6", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier5", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier4", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier3", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier2", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WorkshopTier1", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("TownNight", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("TownDay", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("JungleTemple", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Dungeon", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("GlowingMushroomFields", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Corruption", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("CorruptionUnderground", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Crimson", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("CrimsonUnderground", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Geodes", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Tundra", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("TundraUnderground", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("JungleNight", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("JungleDay", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("JungleUndergroundHardmode", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("JungleUnderground", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Hallow", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("HallowUnderground", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("DesertUnderground", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("UndergroundHardmode", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Caverns", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Underground", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("OceanNight", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("OceanDay", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Desert", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("ForestNight", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("ForestDayEvening", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("ForestDayAfternoon", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("ForestDayMorning", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("ForestDayDawn", ModContent.ItemType(), ModContent.TileType()); - - //Bosses - AddMusicBox("MoonLord", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("LunaticCultist", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("EmpressofLight", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("DukeFishron", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Golem", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Plantera", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("MechanicalTrio", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("SkeletronPrime", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Twins", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Destroyer", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("QueenSlime", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("WallofFlesh", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Skeletron", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("QueenBee", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("BrainofCthulhu", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("EaterofWorlds", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("EyeofCthulhu", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("KingSlime", ModContent.ItemType(), ModContent.TileType()); - - //Events - //AddMusicBox("FrostMoon", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("PumpkinMoon", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("TorchGod", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("LunarTowersSolar", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("LunarTowersNebula", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("LunarTowersVortex", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("LunarTowersStardust", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("MartianMadness", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("PirateInvasion", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("GoblinArmy", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("SolarEclipse", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("BloodMoonDeath", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("BloodMoon", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("SlimeRain", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Blizzard", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Sandstorm", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("Thunderstorm", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("Rain", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("WindyDay", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("LanternFestival", ModContent.ItemType(), ModContent.TileType()); - - //Misc - AddMusicBox("HardmodeInterlude", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("FalseEpilogue", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("DragonsLull", ModContent.ItemType(), ModContent.TileType()); - AddMusicBox("RainLegacy", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("ImpendingDoom", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("CultistRitual", ModContent.ItemType(), ModContent.TileType()); - //AddMusicBox("ImminentDestruction", ModContent.ItemType(), ModContent.TileType()); - } - } - } -} diff --git a/Common/MusicEvents.cs b/Common/MusicEvents.cs new file mode 100644 index 0000000..770e444 --- /dev/null +++ b/Common/MusicEvents.cs @@ -0,0 +1,321 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.IO; +using UnCalamityModMusic.Common.Configs; + +namespace UnCalamityModMusic.Common +{ + //This system was created by Nycro for the main Calamity Mod + //An altered form of it is here so VCMM doesn't have to rely on external code + public record class MusicEventEntry(string Id, int Song, TimeSpan Length, TimeSpan IntroSilence, TimeSpan OutroSilence, Func ShouldPlay, Func Enabled); + + public class MusicEvents : ModSystem + { + #region Statics + + public static MusicEventEntry CurrentEvent { get; set; } = null; + + public static DateTime? TrackStart { get; set; } = null; + + public static DateTime? TrackEnd { get; set; } = null; + + public static int LastPlayedEvent { get; set; } = -1; + + public static TimeSpan? OutroSilence { get; set; } = null; + + public static bool NoFade { get; set; } = false; + + public static Thread EventTrackerThread { get; set; } = null; + + public static List PlayedEvents { get; set; } = []; + + public static List EventCollection { get; set; } = []; + + private static bool oldWorld { get; set; } = true; + + #endregion + + #region Events List + + public override void OnModLoad() + { + static void AddEntry(string eventId, string songName, TimeSpan length, Func shouldPlay, Func enabled, TimeSpan? introSilence = null, TimeSpan? outroSilence = null) + { + MusicEventEntry entry = new(eventId, MusicPathing.GetMusicSlot(songName), length, introSilence ?? TimeSpan.Zero, outroSilence ?? TimeSpan.Zero, shouldPlay, enabled); + EventCollection.Add(entry); + } + + // Hardmode Interlude + AddEntry("HardmodeStarted", "HardmodeInterlude", TimeSpan.FromSeconds(206.400d), () => Main.hardMode, () => ModContent.GetInstance().HardmodeInterlude); + } + + public override void Unload() => EventCollection.Clear(); + + #endregion + + #region Event Handling + + public override void PostUpdateTime() + { + // If the Boss Rush is active, any would-be music events should be cancelled out and marked as played + if (PlayerFlags.bossRushActive) + { + foreach (MusicEventEntry entry in EventCollection) + { + if (entry.ShouldPlay()) + PlayedEvents.Add(entry.Id); + } + + TrackStart = null; + LastPlayedEvent = -1; + OutroSilence = null; + + TrackEnd = null; + CurrentEvent = null; + + return; + } + + // If the player has already completed conditions to trigger certain music events, we don't + // want to queue a bunch of tracks to play as soon as they enter the world, so instead just mark them as played + if (oldWorld) + { + foreach (MusicEventEntry entry in EventCollection) + { + if (entry.ShouldPlay()) + PlayedEvents.Add(entry.Id); + } + + oldWorld = false; + } + + // If the event has just finished, we want a little silence before fading back to normal + if (TrackEnd is not null) + { + // `silence` is the time after a track ends before music goes back to normal + TimeSpan silence = OutroSilence.Value; + TimeSpan postTrack = DateTime.Now - TrackEnd.Value; + + // Play silence for the time specified + if (postTrack < silence) + { + int silenceSlot = MusicLoader.GetMusicSlot(Mod, "Assets/Sounds/Silence"); + Main.musicBox2 = silenceSlot; + } + + else + { + LastPlayedEvent = -1; + TrackEnd = null; + OutroSilence = null; + } + + return; + } + + // Only check for new events to play if none is currently playing + // This makes sure events always finish before a new one starts + if (CurrentEvent is null) + { + foreach (MusicEventEntry musicEvent in EventCollection) + { + // Make sure the event hasn't already played and SHOULD play + if (!PlayedEvents.Contains(musicEvent.Id) && musicEvent.ShouldPlay()) + { + // Even if an event isn't marked as enabled, it should be counted + // as "played" so it isn't played when the player doesn't expect it + PlayedEvents.Add(musicEvent.Id); + + // Events are always enabled on the server + if (Main.dedServ || musicEvent.Enabled()) + { + // Assign the current event and start time + CurrentEvent = musicEvent; + TrackStart = DateTime.Now + musicEvent.IntroSilence; + + // On clients, use a background thread to make sure the track always plays for exactly + // the specified length, regardless of if the game gets minimized, lags, or time becomes + // detangled from a consistent 60fps in any other way + if (!Main.dedServ) + { + EventTrackerThread = new(WatchMusicEvent); + EventTrackerThread.Start(); + } + + break; + } + } + } + } + + if (TrackStart is not null) + { + if (TrackStart > DateTime.Now) + { + int silenceSlot = MusicLoader.GetMusicSlot(Mod, "Assets/Sounds/Silence"); + Main.musicBox2 = silenceSlot; + NoFade = true; + } + + else + { + Main.musicBox2 = CurrentEvent.Song; + + if (NoFade) + { + Main.musicFade[CurrentEvent.Song] = 1f; + NoFade = false; + } + + // If the event has finished playing, mark the end as now and clear the current event + if (DateTime.Now - TrackStart >= CurrentEvent.Length) + { + int silenceSlot = MusicLoader.GetMusicSlot(Mod, "Assets/Sounds/Silence"); + Main.musicBox2 = silenceSlot; + Main.musicFade[CurrentEvent.Song] = 0f; + + TrackEnd = DateTime.Now; + LastPlayedEvent = CurrentEvent.Song; + OutroSilence = CurrentEvent.OutroSilence; + + TrackStart = null; + CurrentEvent = null; + } + } + } + } + + /// + /// Watches for the game minimizing at any point, and adjusts the amount of time to play the song for accordingly + /// + public static void WatchMusicEvent() + { + DateTime? minimized = null; + + while (CurrentEvent is not null) + { + bool musicPaused = !Main.instance.IsActive; + + if (musicPaused && !minimized.HasValue) + minimized = DateTime.Now; + + else if (!musicPaused && minimized.HasValue) + { + TrackStart += DateTime.Now - minimized.Value; + minimized = null; + } + } + + EventTrackerThread = null; + } + + #endregion + + #region Event Saving + + public override void SaveWorldData(TagCompound tag) + { + tag["VCMM:PlayedMusicEventCount"] = PlayedEvents.Count; + + for (int i = 0; i < PlayedEvents.Count; i++) + { + tag[$"VCMM:PlayedMusicEvent{i}"] = PlayedEvents[i]; + } + } + + public override void LoadWorldData(TagCompound tag) + { + PlayedEvents.Clear(); + + if (tag.TryGet("VCMM:PlayedMusicEventCount", out int playedMusicEventCount)) + { + for (int i = 0; i < playedMusicEventCount; i++) + { + if (tag.TryGet($"VCMM:PlayedMusicEvent{i}", out string playedEvent)) + PlayedEvents.Add(playedEvent); + } + } + + oldWorld = false; + } + + public override void OnWorldUnload() + { + oldWorld = true; + TrackStart = null; + TrackEnd = null; + CurrentEvent = null; + PlayedEvents.Clear(); + NoFade = false; + LastPlayedEvent = -1; + } + + #endregion + + #region Event Syncing + + public static void SendSyncRequest() + { + ModPacket packet = UnCalamityModMusic.Instance.GetPacket(); + packet.Write((byte)Netcode.VanillaCalamityModMusicMessageType.MusicEventSyncRequest); + packet.Send(); + } + + public static void FulfillSyncRequest(int requester) + { + // Only fulfill requests as the server host + if (!Main.dedServ) + { + return; + } + + ModPacket packet = UnCalamityModMusic.Instance.GetPacket(); + packet.Write((byte)Netcode.VanillaCalamityModMusicMessageType.MusicEventSyncResponse); + + int trackCount = PlayedEvents.Count; + packet.Write(trackCount); + + for (int i = 0; i < trackCount; i++) + { + packet.Write(PlayedEvents[i]); + } + + packet.Send(toClient: requester); + } + + public static void ReceiveSyncResponse(BinaryReader reader) + { + // Only receive info on clients + if (Main.dedServ) + { + return; + } + + PlayedEvents.Clear(); + int trackCount = reader.ReadInt32(); + + for (int i = 0; i < trackCount; i++) + { + PlayedEvents.Add(reader.ReadString()); + } + } + + #endregion + } + + public class MusicEventsPlayer : ModPlayer + { + public override void OnEnterWorld() + { + if (Main.netMode == NetmodeID.MultiplayerClient && Player.whoAmI != Main.myPlayer) + { + MusicEvents.SendSyncRequest(); + } + } + } +} diff --git a/Common/MusicPathing.cs b/Common/MusicPathing.cs index bb1f4c1..637fb0f 100644 --- a/Common/MusicPathing.cs +++ b/Common/MusicPathing.cs @@ -85,6 +85,7 @@ namespace UnCalamityModMusic.Common {"FrostMoon", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/FrostMoon")}, {"PumpkinMoon", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/PumpkinMoon")}, {"TorchGod", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/TorchGod")}, + {"TorchGodRevengeance", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/TorchGodRevengeance")}, {"LunarTowersSolar", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/LunarTowersSolar")}, {"LunarTowersNebula", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/LunarTowersNebula")}, {"LunarTowersVortex", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/LunarTowersVortex")}, @@ -95,13 +96,16 @@ namespace UnCalamityModMusic.Common {"FrostLegion", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/FrostLegion")}, {"GoblinArmy", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/GoblinArmy")}, {"SolarEclipse", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/SolarEclipse")}, - {"BloodMoonDeath", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/BloodMoonDeath")}, {"BloodMoon", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/BloodMoon")}, + {"BloodMoonDeath", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/BloodMoonDeath")}, {"SlimeRain", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/SlimeRain")}, {"Blizzard", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/Blizzard")}, {"Sandstorm", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/Sandstorm")}, + {"OceanRain", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/OceanRain")}, {"Thunderstorm", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/Thunderstorm")}, + {"TownRain", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/TownRain")}, {"Rain", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/Rain")}, + {"TownParty", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/TownParty")}, {"WindyDay", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/WindyDay")}, {"LanternFestival", MusicLoader.GetMusicSlot(mod, "Assets/Music/Events/LanternFestival")}, diff --git a/Common/NPCShops.cs b/Common/NPCShops.cs new file mode 100644 index 0000000..66fe99d --- /dev/null +++ b/Common/NPCShops.cs @@ -0,0 +1,26 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace UnCalamityModMusic.Common +{ + public class NPCShops : GlobalNPC + { + public override void ModifyShop(NPCShop shop) + { + var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); + + if (calamityMod && shop.NpcType == calamity.Find("FAP").Type) + { + shop.Add(ModContent.ItemType(), Condition.Hardmode); + shop.Add(ModContent.ItemType(), Condition.DownedMoonLord); + } + + if (!calamityMod && shop.NpcType == NPCID.Princess) + { + shop.Add(ModContent.ItemType(), Condition.Hardmode); + shop.Add(ModContent.ItemType(), Condition.DownedMoonLord); + } + } + } +} diff --git a/Common/Netcode.cs b/Common/Netcode.cs new file mode 100644 index 0000000..af1fe0e --- /dev/null +++ b/Common/Netcode.cs @@ -0,0 +1,62 @@ +using System.IO; +using System; +using Terraria.ModLoader; + +namespace UnCalamityModMusic.Common +{ + public class Netcode + { + public enum VanillaCalamityModMusicMessageType : byte + { + MusicEventSyncRequest, + MusicEventSyncResponse + } + + public static void HandlePacket(Mod mod, BinaryReader reader, int whoAmI) + { + try + { + VanillaCalamityModMusicMessageType msgType = (VanillaCalamityModMusicMessageType)reader.ReadByte(); + switch (msgType) + { + case VanillaCalamityModMusicMessageType.MusicEventSyncRequest: + { + MusicEvents.FulfillSyncRequest(whoAmI); + break; + } + + case VanillaCalamityModMusicMessageType.MusicEventSyncResponse: + { + MusicEvents.ReceiveSyncResponse(reader); + break; + } + + default: + { + UnCalamityModMusic.Instance.Logger.Error($"Failed to parse VCMM packet: No VCMM packet exists with ID {msgType}."); + throw new Exception("Failed to parse VCMM packet: Invalid VCMM packet ID."); + } + } + } + catch (Exception e) + { + if (e is EndOfStreamException eose) + { + UnCalamityModMusic.Instance.Logger.Error("Failed to parse VCMM packet: Packet was too short, missing data, or otherwise corrupt.", eose); + } + else if (e is ObjectDisposedException ode) + { + UnCalamityModMusic.Instance.Logger.Error("Failed to parse VCMM packet: Packet reader disposed or destroyed.", ode); + } + else if (e is IOException ioe) + { + UnCalamityModMusic.Instance.Logger.Error("Failed to parse VCMM packet: An unknown I/O error occurred.", ioe); + } + else + { + throw; + } + } + } + } +} diff --git a/Common/PlayerFlags.cs b/Common/PlayerFlags.cs index f028c2c..fe7beff 100644 --- a/Common/PlayerFlags.cs +++ b/Common/PlayerFlags.cs @@ -1,6 +1,8 @@ -using System.Reflection; +using System; +using System.Reflection; using Terraria; using Terraria.GameContent.Events; +using Terraria.ID; using Terraria.ModLoader; namespace UnCalamityModMusic.Common @@ -11,7 +13,8 @@ namespace UnCalamityModMusic.Common public static bool onRemixedSurface; public static bool inSpace; public static bool inTown; - public static bool inUgTown; + public static bool inTownWithRain; + public static bool inUgTown; public static bool isRaining; public static bool notRaining; public static bool largeWorld; @@ -25,12 +28,12 @@ namespace UnCalamityModMusic.Common public static bool TownSceneActive; public static bool WorkshopSceneActive; - public static bool infernumMode; + public static bool infernumMode; public static bool deathMode; public static bool revengeanceMode; public static bool bossRushActive; - public static bool ZoneBrimstoneCrags; + public static bool ZoneBrimstoneCrags; public static bool ZoneProfanedTemple; public static bool ZoneAstralInfection; public static bool ZoneSulfurSea; @@ -77,7 +80,9 @@ namespace UnCalamityModMusic.Common public static bool ZoneMarbleCave; public static bool ZoneHive; - public static float MusicTileRange = 525f * 16f; + public static bool CalamityMusicEventInactive = true; + + public static float MusicTileRange = 525f * 16f; public override void PreUpdate() { @@ -105,8 +110,8 @@ namespace UnCalamityModMusic.Common ugDesertOriginalHeight = (double)player.position.Y >= Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2); ZoneSandstorm = Sandstorm.Happening && player.ZoneDesert && !player.ZoneBeach; ZoneOverworldHeightExtra = (!player.ZoneDesert && player.ZoneOverworldHeight) || (player.ZoneDesert && !ugDesertOriginalHeight); - TownSceneActive = ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player); - WorkshopSceneActive = ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player); + TownSceneActive = ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player); + WorkshopSceneActive = ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player) || ModContent.GetInstance().IsSceneEffectActive(player); WorkshopTier6Bosses = downedExoMechs || downedSupremeCalamitas; WorkshopTier5Bosses = NPC.downedMoonlord || downedProfanedGuardians || downedDragonfolly || downedProvidence || downedCeaselessVoid || downedStormWeaver || downedSignus || downedPolterghast || downedOldDuke || downedDevourerofGods || downedYharon; @@ -117,12 +122,23 @@ namespace UnCalamityModMusic.Common if (noTownMusic) { inTown = false; + inTownWithRain = false; inUgTown = false; } else { - inTown = player.townNPCs > 2f && (((notRaining && player.ZoneOverworldHeight) && (notInExcludedTownEvent && player.ZoneOverworldHeight)) || inSpace); - inUgTown = player.townNPCs > 2f && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight); + if (player.ZoneShadowCandle || player.inventory[player.selectedItem].type == ItemID.ShadowCandle) + { + inTown = false; + inTownWithRain = false; + inUgTown = false; + } + else + { + inTown = player.townNPCs > 2f && ((notRaining && notInExcludedTownEvent && player.ZoneOverworldHeight) || inSpace); + inTownWithRain = player.townNPCs > 2f && isRaining && notInExcludedTownEvent && ZoneOverworldHeightExtra; + inUgTown = player.townNPCs > 2f && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight); + } } if (calamityMod) @@ -153,7 +169,7 @@ namespace UnCalamityModMusic.Common downedPlaguebringerGoliath = (bool)calamity.Call("GetBossDowned", "plaguebringergoliath"); downedAstrumAureus = (bool)calamity.Call("GetBossDowned", "astrumaureus"); downedLeviathan = (bool)calamity.Call("GetBossDowned", "anahitaleviathan"); - downedCalamitasClone = (bool)calamity.Call("GetBossDowned", "calamitas"); + downedCalamitasClone = (bool)calamity.Call("GetBossDowned", "calamitasclone"); downedBrimstoneElemental = (bool)calamity.Call("GetBossDowned", "brimstoneelemental"); downedAquaticScourge = (bool)calamity.Call("GetBossDowned", "aquaticscourge"); downedCryogen = (bool)calamity.Call("GetBossDowned", "cryogen"); @@ -164,7 +180,9 @@ namespace UnCalamityModMusic.Common deathMode = (bool)calamity.Call("DifficultyActive", "death"); revengeanceMode = (bool)calamity.Call("DifficultyActive", "revengeance"); bossRushActive = (bool)calamity.Call("DifficultyActive", "bossrush"); - } + + CalamityMusicEventInactive = CalamityMusicEvent() == null; + } if (infernumMod) { @@ -193,5 +211,23 @@ namespace UnCalamityModMusic.Common return false; } + + public static DateTime? CalamityMusicEvent() + { + if (ModLoader.TryGetMod("CalamityMod", out Mod calamity)) + { + Type musicEventType = calamity.GetType().Assembly.GetType("CalamityMod.Systems.MusicEventSystem"); + + if (musicEventType != null) + { + PropertyInfo trackStartProperty = musicEventType.GetProperty("TrackStart", BindingFlags.Static | BindingFlags.Public); + DateTime? trackStartValue = trackStartProperty.GetValue(null) as DateTime?; + + return trackStartValue; + } + } + + return null; + } } } \ No newline at end of file diff --git a/Common/WorldFlags.cs b/Common/WorldFlags.cs deleted file mode 100644 index 57b7940..0000000 --- a/Common/WorldFlags.cs +++ /dev/null @@ -1,156 +0,0 @@ -using Microsoft.Xna.Framework; -using System; -using System.IO; -using System.Threading; -using Terraria; -using Terraria.GameContent.Events; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ModLoader.IO; - -namespace UnCalamityModMusic.Common -{ - public class WorldFlags : ModSystem - { - public static bool passedResurrection = false; - public static bool passedMemory = false; - public static bool musicPlaying = false; - - public static int resMusicSlot = 0; - public static int memoryMusicSlot = 0; - - public static readonly TimeSpan resTiming = new TimeSpan(0, 0, 3, 21); - public static DateTime? resStarted = null; - public static Thread isMusicTiming = null; - - public static Thread musicTiming => new Thread((ThreadStart)delegate - { - DateTime? dateTime = null; - while (musicPlaying) - { - if (!Main.instance.IsActive && !dateTime.HasValue) - { - dateTime = DateTime.Now; - } - else if (Main.instance.IsActive && dateTime.HasValue) - { - if (musicPlaying) - { - resStarted += DateTime.Now - dateTime.Value; - break; - } - dateTime = null; - } - } - dateTime = null; - isMusicTiming = null; - }); - - public override void OnWorldLoad() - { - if (Main.hardMode) - { - passedResurrection = true; - } - else - { - passedResurrection = false; - } - if (NPC.downedMoonlord) - { - passedMemory = true; - } - else - { - passedMemory = false; - } - resMusicSlot = MusicPathing.GetMusicSlot("HardmodeInterlude"); - memoryMusicSlot = MusicPathing.GetMusicSlot("FalseEpilogue"); - } - - public override void OnWorldUnload() - { - passedResurrection = false; - passedMemory = false; - resStarted = null; - musicPlaying = false; - } - - public override void LoadWorldData(TagCompound tag) - { - passedResurrection = tag.ContainsKey("passedResurrection"); - passedMemory = tag.ContainsKey("passedMemory"); - } - - public override void SaveWorldData(TagCompound tag) - { - if (passedResurrection) - { - tag["passedResurrection"] = true; - } - if (passedMemory) - { - tag["passedMemory"] = true; - } - } - - public override void NetSend(BinaryWriter writer) - { - var flags = new BitsByte(); - flags[0] = passedResurrection; - flags[1] = passedMemory; - writer.Write(flags); - } - - public override void NetReceive(BinaryReader reader) - { - BitsByte flags = reader.ReadByte(); - passedResurrection = flags[0]; - passedMemory = flags[1]; - } - - public override void UpdateUI(GameTime gameTime) - { - Player player = Main.player[Main.myPlayer]; - - if (isMusicTiming == null) - { - if (!passedResurrection && Main.hardMode) - { - passedResurrection = true; - musicPlaying = true; - resStarted = DateTime.Now; - isMusicTiming = musicTiming; - isMusicTiming.Start(); - } - } - - if (resStarted.HasValue) - { - if (Main.musicVolume == 0) - { - resStarted = null; - musicPlaying = false; - return; - } - } - - if (CreditsRollEvent.IsEventOngoing && !player.hasCreditsSceneMusicBox) - { - Main.musicBox2 = memoryMusicSlot; - return; - } - - if (resStarted.HasValue && !PlayerFlags.bossRushActive && Main.netMode != NetmodeID.MultiplayerClient) - { - DateTime now = DateTime.Now; - DateTime? date = resStarted; - if (now - date < resTiming) - { - Main.musicBox2 = resMusicSlot; - return; - } - } - } - } -} \ No newline at end of file diff --git a/Content/Items/AbyssLayer3AltMusicBox.cs b/Content/Items/AbyssLayer3AltMusicBox.cs index 834bc7b..d56e797 100644 --- a/Content/Items/AbyssLayer3AltMusicBox.cs +++ b/Content/Items/AbyssLayer3AltMusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "AbyssLayer3Alt"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); diff --git a/Content/Items/BloodMoonDeathMusicBox.cs b/Content/Items/BloodMoonDeathMusicBox.cs index 02d8b9d..e27b068 100644 --- a/Content/Items/BloodMoonDeathMusicBox.cs +++ b/Content/Items/BloodMoonDeathMusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "BloodMoonDeath"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); @@ -37,7 +39,8 @@ namespace UnCalamityModMusic.Content.Items Recipe.Create(Type, 1) .AddRecipeGroup("VCMM:EvilPowderGroup", 10) .AddIngredient(ItemID.Deathweed, 3) - .AddIngredient(ItemID.MusicBox, 1) + .AddIngredient(ItemID.BloodMoonStarter, 1) + .AddIngredient(ItemID.MusicBox, 1) .AddTile(Recipes.musicBoxCraftingStation) .Register(); } diff --git a/Content/Items/BloodMoonDeathMusicBox.png b/Content/Items/BloodMoonDeathMusicBox.png index 640c3ad..f6e4c74 100644 Binary files a/Content/Items/BloodMoonDeathMusicBox.png and b/Content/Items/BloodMoonDeathMusicBox.png differ diff --git a/Content/Items/BloodMoonMusicBox.cs b/Content/Items/BloodMoonMusicBox.cs index 521cd03..a2d64ec 100644 --- a/Content/Items/BloodMoonMusicBox.cs +++ b/Content/Items/BloodMoonMusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "BloodMoon"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); @@ -37,7 +39,8 @@ namespace UnCalamityModMusic.Content.Items Recipe.Create(Type, 1) .AddRecipeGroup("VCMM:EvilPowderGroup", 10) .AddIngredient(ItemID.FallenStar, 3) - .AddIngredient(ItemID.MusicBox, 1) + .AddIngredient(ItemID.BloodMoonStarter, 1) + .AddIngredient(ItemID.MusicBox, 1) .AddTile(Recipes.musicBoxCraftingStation) .Register(); } diff --git a/Content/Items/BloodMoonMusicBox.png b/Content/Items/BloodMoonMusicBox.png index 97ed332..1875bdc 100644 Binary files a/Content/Items/BloodMoonMusicBox.png and b/Content/Items/BloodMoonMusicBox.png differ diff --git a/Content/Items/BrainofCthulhuMusicBox.cs b/Content/Items/BrainofCthulhuMusicBox.cs index 2bc9e8c..844faa6 100644 --- a/Content/Items/BrainofCthulhuMusicBox.cs +++ b/Content/Items/BrainofCthulhuMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "BrainofCthulhu"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.BrainofCthulhuTrophy, 1) diff --git a/Content/Items/CavernsMusicBox.cs b/Content/Items/CavernsMusicBox.cs index a1abdea..5ba370b 100644 --- a/Content/Items/CavernsMusicBox.cs +++ b/Content/Items/CavernsMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Caverns"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.StoneBlock, 10) diff --git a/Content/Items/CavernsMusicBox.png b/Content/Items/CavernsMusicBox.png index b8f6255..752dc48 100644 Binary files a/Content/Items/CavernsMusicBox.png and b/Content/Items/CavernsMusicBox.png differ diff --git a/Content/Items/CorruptionMusicBox.cs b/Content/Items/CorruptionMusicBox.cs index d19cba2..b950aad 100644 --- a/Content/Items/CorruptionMusicBox.cs +++ b/Content/Items/CorruptionMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Corruption"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Ebonwood, 10) diff --git a/Content/Items/CorruptionUndergroundMusicBox.cs b/Content/Items/CorruptionUndergroundMusicBox.cs index 82ea297..0cdc287 100644 --- a/Content/Items/CorruptionUndergroundMusicBox.cs +++ b/Content/Items/CorruptionUndergroundMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "CorruptionUnderground"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.EbonstoneBlock, 10) diff --git a/Content/Items/CrimsonMusicBox.cs b/Content/Items/CrimsonMusicBox.cs index db2fbc9..2b854b9 100644 --- a/Content/Items/CrimsonMusicBox.cs +++ b/Content/Items/CrimsonMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Crimson"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Shadewood, 10) diff --git a/Content/Items/CrimsonUndergroundMusicBox.cs b/Content/Items/CrimsonUndergroundMusicBox.cs index 715f921..9f0753c 100644 --- a/Content/Items/CrimsonUndergroundMusicBox.cs +++ b/Content/Items/CrimsonUndergroundMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "CrimsonUnderground"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.CrimstoneBlock, 10) diff --git a/Content/Items/DesertMusicBox.cs b/Content/Items/DesertMusicBox.cs index b870d14..c929a6c 100644 --- a/Content/Items/DesertMusicBox.cs +++ b/Content/Items/DesertMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Desert"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Cactus, 10) diff --git a/Content/Items/DungeonMusicBox.cs b/Content/Items/DungeonMusicBox.cs index 2775671..aa611e4 100644 --- a/Content/Items/DungeonMusicBox.cs +++ b/Content/Items/DungeonMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Dungeon"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.BlueBrick, 10) diff --git a/Content/Items/EaterofWorldsMusicBox.cs b/Content/Items/EaterofWorldsMusicBox.cs index 15a4423..bb78de3 100644 --- a/Content/Items/EaterofWorldsMusicBox.cs +++ b/Content/Items/EaterofWorldsMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "EaterofWorlds"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.EaterofWorldsTrophy, 1) diff --git a/Content/Items/EyeofCthulhuMusicBox.cs b/Content/Items/EyeofCthulhuMusicBox.cs index 8914d43..ceeab3d 100644 --- a/Content/Items/EyeofCthulhuMusicBox.cs +++ b/Content/Items/EyeofCthulhuMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "EyeofCthulhu"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.EyeofCthulhuTrophy, 1) diff --git a/Content/Items/FalseEpilogueMusicBox.cs b/Content/Items/FalseEpilogueMusicBox.cs index 6ea024e..4d7bf0b 100644 --- a/Content/Items/FalseEpilogueMusicBox.cs +++ b/Content/Items/FalseEpilogueMusicBox.cs @@ -1,6 +1,3 @@ -using Terraria; -using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using UnCalamityModMusic.Common; @@ -11,37 +8,6 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() - { - var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); - - if (calamityMod) - { - try - { - Recipe.Create(Type, 1) - .AddIngredient(calamity, "ExodiumClusterOre", 10) - .AddIngredient(calamity, "Phantoplasm", 10) - .AddIngredient(ItemID.LunarBar, 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(Recipes.musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - } - else - { - Recipe.Create(Type, 1) - .AddIngredient(ItemID.FragmentStardust, 10) - .AddIngredient(ItemID.Ectoplasm, 10) - .AddIngredient(ItemID.LunarBar, 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(Recipes.musicBoxCraftingStation) - .Register(); - } - } - } + public override string MusicFilePath => "FalseEpilogue"; + } } diff --git a/Content/Items/FalseEpilogueMusicBox.png b/Content/Items/FalseEpilogueMusicBox.png index 1490d40..9939332 100644 Binary files a/Content/Items/FalseEpilogueMusicBox.png and b/Content/Items/FalseEpilogueMusicBox.png differ diff --git a/Content/Items/ForestDayAfternoonMusicBox.cs b/Content/Items/ForestDayAfternoonMusicBox.cs index c8ce418..6fd944e 100644 --- a/Content/Items/ForestDayAfternoonMusicBox.cs +++ b/Content/Items/ForestDayAfternoonMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "ForestDayAfternoon"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Wood, 10) diff --git a/Content/Items/ForestDayDawnMusicBox.cs b/Content/Items/ForestDayDawnMusicBox.cs index dd68c46..0fbd502 100644 --- a/Content/Items/ForestDayDawnMusicBox.cs +++ b/Content/Items/ForestDayDawnMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "ForestDayDawn"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Wood, 10) diff --git a/Content/Items/ForestDayEveningMusicBox.cs b/Content/Items/ForestDayEveningMusicBox.cs index f641ec4..397ab96 100644 --- a/Content/Items/ForestDayEveningMusicBox.cs +++ b/Content/Items/ForestDayEveningMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "ForestDayEvening"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Wood, 10) diff --git a/Content/Items/ForestDayMorningMusicBox.cs b/Content/Items/ForestDayMorningMusicBox.cs index e720213..1c7eae4 100644 --- a/Content/Items/ForestDayMorningMusicBox.cs +++ b/Content/Items/ForestDayMorningMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "ForestDayMorning"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Wood, 10) diff --git a/Content/Items/ForestNightMusicBox.cs b/Content/Items/ForestNightMusicBox.cs index a70e4b3..310d00b 100644 --- a/Content/Items/ForestNightMusicBox.cs +++ b/Content/Items/ForestNightMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "ForestNight"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Wood, 10) diff --git a/Content/Items/GeodesMusicBox.cs b/Content/Items/GeodesMusicBox.cs index 87ebb61..a1583a3 100644 --- a/Content/Items/GeodesMusicBox.cs +++ b/Content/Items/GeodesMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Geodes"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Granite, 10) diff --git a/Content/Items/GeodesMusicBox.png b/Content/Items/GeodesMusicBox.png index 6ab86d2..563fca4 100644 Binary files a/Content/Items/GeodesMusicBox.png and b/Content/Items/GeodesMusicBox.png differ diff --git a/Content/Items/GlowingMushroomFieldsMusicBox.cs b/Content/Items/GlowingMushroomFieldsMusicBox.cs index 0d4c597..d90712b 100644 --- a/Content/Items/GlowingMushroomFieldsMusicBox.cs +++ b/Content/Items/GlowingMushroomFieldsMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "GlowingMushroomFields"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.GlowingMushroom, 10) diff --git a/Content/Items/GlowingMushroomFieldsMusicBox.png b/Content/Items/GlowingMushroomFieldsMusicBox.png index cb7edad..a58f989 100644 Binary files a/Content/Items/GlowingMushroomFieldsMusicBox.png and b/Content/Items/GlowingMushroomFieldsMusicBox.png differ diff --git a/Content/Items/HardmodeInterludeMusicBox.cs b/Content/Items/HardmodeInterludeMusicBox.cs index 5d17d42..cc1ba79 100644 --- a/Content/Items/HardmodeInterludeMusicBox.cs +++ b/Content/Items/HardmodeInterludeMusicBox.cs @@ -1,5 +1,3 @@ -using Terraria; -using Terraria.ID; using Terraria.ModLoader; using UnCalamityModMusic.Common; @@ -10,15 +8,6 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() - { - Recipe.Create(Type, 1) - .AddIngredient(ItemID.SoulofFlight, 3) - .AddIngredient(ItemID.SoulofLight, 3) - .AddIngredient(ItemID.SoulofNight, 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(Recipes.musicBoxCraftingStation) - .Register(); - } - } + public override string MusicFilePath => "HardmodeInterlude"; + } } diff --git a/Content/Items/HardmodeInterludeMusicBox.png b/Content/Items/HardmodeInterludeMusicBox.png index ec5fa7e..175fb34 100644 Binary files a/Content/Items/HardmodeInterludeMusicBox.png and b/Content/Items/HardmodeInterludeMusicBox.png differ diff --git a/Content/Items/KingSlimeMusicBox.cs b/Content/Items/KingSlimeMusicBox.cs index fab698c..cabf2f1 100644 --- a/Content/Items/KingSlimeMusicBox.cs +++ b/Content/Items/KingSlimeMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "KingSlime"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.KingSlimeTrophy, 1) diff --git a/Content/Items/LanternFestivalMusicBox.cs b/Content/Items/LanternFestivalMusicBox.cs index 7be9a9f..2770ec6 100644 --- a/Content/Items/LanternFestivalMusicBox.cs +++ b/Content/Items/LanternFestivalMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "LanternFestival"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddRecipeGroup(RecipeGroupID.Wood, 10) diff --git a/Content/Items/MeteoriteMusicBox.cs b/Content/Items/MeteoriteMusicBox.cs index 5d01a83..c778353 100644 --- a/Content/Items/MeteoriteMusicBox.cs +++ b/Content/Items/MeteoriteMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Meteorite"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Meteorite, 10) diff --git a/Content/Items/MoonLordMusicBox.cs b/Content/Items/MoonLordMusicBox.cs index ffde30d..1c1b1f5 100644 --- a/Content/Items/MoonLordMusicBox.cs +++ b/Content/Items/MoonLordMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "MoonLord"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.MoonLordTrophy, 1) diff --git a/Content/Items/OceanDayMusicBox.cs b/Content/Items/OceanDayMusicBox.cs index b030a7d..ae90226 100644 --- a/Content/Items/OceanDayMusicBox.cs +++ b/Content/Items/OceanDayMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "OceanDay"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.PalmWood, 10) diff --git a/Content/Items/OceanDayMusicBox.png b/Content/Items/OceanDayMusicBox.png index d62170a..d5b2c1c 100644 Binary files a/Content/Items/OceanDayMusicBox.png and b/Content/Items/OceanDayMusicBox.png differ diff --git a/Content/Items/OceanNightMusicBox.cs b/Content/Items/OceanNightMusicBox.cs index 5f9b022..73f0168 100644 --- a/Content/Items/OceanNightMusicBox.cs +++ b/Content/Items/OceanNightMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "OceanNight"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.PalmWood, 10) diff --git a/Content/Items/OceanNightMusicBox.png b/Content/Items/OceanNightMusicBox.png index 7f97cb9..eff17b7 100644 Binary files a/Content/Items/OceanNightMusicBox.png and b/Content/Items/OceanNightMusicBox.png differ diff --git a/Content/Items/OceanRainMusicBox.cs b/Content/Items/OceanRainMusicBox.cs new file mode 100644 index 0000000..234e99d --- /dev/null +++ b/Content/Items/OceanRainMusicBox.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Items +{ + public class OceanRainMusicBox : MusicBoxItem + { + public override int MusicBoxTile => ModContent.TileType(); + + public override string MusicFilePath => "OceanRain"; + + public override void MusicBoxRecipe() + { + Recipe.Create(Type, 1) + .AddIngredient(ItemID.ShellPileBlock, 10) + .AddIngredient(ItemID.RainCloud, 10) + .AddIngredient(ItemID.Coral, 3) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(Recipes.musicBoxCraftingStation) + .Register(); + } + } +} diff --git a/Content/Items/OceanRainMusicBox.png b/Content/Items/OceanRainMusicBox.png new file mode 100644 index 0000000..b4de9d5 Binary files /dev/null and b/Content/Items/OceanRainMusicBox.png differ diff --git a/Content/Items/RainLegacyMusicBox.cs b/Content/Items/RainLegacyMusicBox.cs index 7dc8c9b..869dbbc 100644 --- a/Content/Items/RainLegacyMusicBox.cs +++ b/Content/Items/RainLegacyMusicBox.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -11,37 +12,15 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "RainLegacy"; + + public override void AddRecipes() { - var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); - - if (calamityMod) - { - try - { - Recipe.Create(Type, 1) - .AddIngredient(calamity, "ExodiumClusterOre", 10) - .AddIngredient(ItemID.RainCloud, 10) - .AddIngredient(ItemID.LunarBar, 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(Recipes.musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - } - else - { - Recipe.Create(Type, 1) - .AddIngredient(ItemID.FragmentVortex, 10) - .AddIngredient(ItemID.RainCloud, 10) - .AddIngredient(ItemID.LunarBar, 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(Recipes.musicBoxCraftingStation) - .Register(); - } - } - } + Recipe.Create(Type, 1) + .AddIngredient(ModContent.ItemType(), 1) + .AddIngredient(ModContent.ItemType(), 1) + .AddTile(Recipes.musicBoxCraftingStationVanilla) + .Register(); + } + } } diff --git a/Content/Items/RainMusicBox.cs b/Content/Items/RainMusicBox.cs index b8abd20..973ad5c 100644 --- a/Content/Items/RainMusicBox.cs +++ b/Content/Items/RainMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Rain"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Glowstick, 10) diff --git a/Content/Items/SkeletronMusicBox.cs b/Content/Items/SkeletronMusicBox.cs index 2d544a2..ca2b9dd 100644 --- a/Content/Items/SkeletronMusicBox.cs +++ b/Content/Items/SkeletronMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Skeletron"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.SkeletronTrophy, 1) diff --git a/Content/Items/SkeletronMusicBox.png b/Content/Items/SkeletronMusicBox.png index 949ef81..cbc5e26 100644 Binary files a/Content/Items/SkeletronMusicBox.png and b/Content/Items/SkeletronMusicBox.png differ diff --git a/Content/Items/SlimeRainMusicBox.cs b/Content/Items/SlimeRainMusicBox.cs index 21cc9dd..9123f6d 100644 --- a/Content/Items/SlimeRainMusicBox.cs +++ b/Content/Items/SlimeRainMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "SlimeRain"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Gel, 10) diff --git a/Content/Items/SlimeRainMusicBox.png b/Content/Items/SlimeRainMusicBox.png index 3007900..867e081 100644 Binary files a/Content/Items/SlimeRainMusicBox.png and b/Content/Items/SlimeRainMusicBox.png differ diff --git a/Content/Items/SpaceMusicBox.cs b/Content/Items/SpaceMusicBox.cs index d3d774d..d5d92b6 100644 --- a/Content/Items/SpaceMusicBox.cs +++ b/Content/Items/SpaceMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Space"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.Cloud, 10) diff --git a/Content/Items/SpaceMusicBox.png b/Content/Items/SpaceMusicBox.png index d022274..0465996 100644 Binary files a/Content/Items/SpaceMusicBox.png and b/Content/Items/SpaceMusicBox.png differ diff --git a/Content/Items/TorchGodMusicBox.cs b/Content/Items/TorchGodMusicBox.cs new file mode 100644 index 0000000..ff9c5bf --- /dev/null +++ b/Content/Items/TorchGodMusicBox.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Items +{ + public class TorchGodMusicBox : MusicBoxItem + { + public override int MusicBoxTile => ModContent.TileType(); + + public override string MusicFilePath => "TorchGod"; + + public override void MusicBoxRecipe() + { + Recipe.Create(Type, 1) + .AddIngredient(ItemID.StoneBlock, 10) + .AddIngredient(ItemID.Torch, 10) + .AddIngredient(ItemID.UltrabrightTorch, 10) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(Recipes.musicBoxCraftingStation) + .Register(); + } + } +} diff --git a/Content/Items/TorchGodMusicBox.png b/Content/Items/TorchGodMusicBox.png new file mode 100644 index 0000000..01164ac Binary files /dev/null and b/Content/Items/TorchGodMusicBox.png differ diff --git a/Content/Items/TorchGodRevengeanceMusicBox.cs b/Content/Items/TorchGodRevengeanceMusicBox.cs new file mode 100644 index 0000000..d8130e7 --- /dev/null +++ b/Content/Items/TorchGodRevengeanceMusicBox.cs @@ -0,0 +1,38 @@ +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Items +{ + public class TorchGodRevengeanceMusicBox : MusicBoxItem + { + public override int MusicBoxTile => ModContent.TileType(); + + public override string MusicFilePath => "TorchGodRevengeance"; + + public override void MusicBoxRecipe() + { + var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); + + if (calamityMod) + { + try + { + Recipe.Create(Type, 1) + .AddIngredient(ItemID.StoneBlock, 10) + .AddIngredient(calamity, "GloomTorch", 10) + .AddIngredient(calamity, "RefractivePrismTorch", 10) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(Recipes.musicBoxCraftingStation) + .Register(); + } + catch + { + UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); + } + } + } + } +} diff --git a/Content/Items/TorchGodRevengeanceMusicBox.png b/Content/Items/TorchGodRevengeanceMusicBox.png new file mode 100644 index 0000000..84119e6 Binary files /dev/null and b/Content/Items/TorchGodRevengeanceMusicBox.png differ diff --git a/Content/Items/TownDayMusicBox.cs b/Content/Items/TownDayMusicBox.cs index 73f4700..1b3e8af 100644 --- a/Content/Items/TownDayMusicBox.cs +++ b/Content/Items/TownDayMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "TownDay"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddRecipeGroup(RecipeGroupID.Wood, 10) diff --git a/Content/Items/TownNightMusicBox.cs b/Content/Items/TownNightMusicBox.cs index c5fdd03..d83ddb9 100644 --- a/Content/Items/TownNightMusicBox.cs +++ b/Content/Items/TownNightMusicBox.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using UnCalamityModMusic.Common; @@ -10,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "TownNight"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddRecipeGroup(RecipeGroupID.Wood, 10) @@ -20,20 +21,5 @@ namespace UnCalamityModMusic.Content.Items .AddTile(Recipes.musicBoxCraftingStation) .Register(); } - - public class TownNightNoiselessRecording : GlobalItem - { - public override void UpdateAccessory(Item item, Player player, bool hideVisual) - { - if (item.type == ItemID.MusicBox && Main.curMusic == MusicPathing.GetMusicSlot("TownNight_Noiseless")) - { - if (Main.rand.NextBool(150)) - { - SoundEngine.PlaySound(SoundID.Item166); - item.SetDefaults(ModContent.ItemType()); - } - } - } - } } } diff --git a/Content/Items/TownPartyMusicBox.cs b/Content/Items/TownPartyMusicBox.cs new file mode 100644 index 0000000..df65c82 --- /dev/null +++ b/Content/Items/TownPartyMusicBox.cs @@ -0,0 +1,26 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Items +{ + public class TownPartyMusicBox : MusicBoxItem + { + public override int MusicBoxTile => ModContent.TileType(); + + public override string MusicFilePath => "TownParty"; + + public override void MusicBoxRecipe() + { + //Canonically, a party requires at least 10 balloons + Recipe.Create(Type, 1) + .AddRecipeGroup("VCMM:SillyTiedBalloonGroup", 10) + .AddIngredient(ItemID.SilverCoin, 10) + .AddIngredient(ItemID.Sunflower, 3) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(Recipes.musicBoxCraftingStation) + .Register(); + } + } +} diff --git a/Content/Items/TownPartyMusicBox.png b/Content/Items/TownPartyMusicBox.png new file mode 100644 index 0000000..9a78174 Binary files /dev/null and b/Content/Items/TownPartyMusicBox.png differ diff --git a/Content/Items/TownRainMusicBox.cs b/Content/Items/TownRainMusicBox.cs new file mode 100644 index 0000000..92acb2f --- /dev/null +++ b/Content/Items/TownRainMusicBox.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Items +{ + public class TownRainMusicBox : MusicBoxItem + { + public override int MusicBoxTile => ModContent.TileType(); + + public override string MusicFilePath => "TownRain"; + + public override void MusicBoxRecipe() + { + Recipe.Create(Type, 1) + .AddIngredient(ItemID.Glowstick, 10) + .AddIngredient(ItemID.SilverCoin, 10) + .AddIngredient(ItemID.WaterBucket, 3) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(Recipes.musicBoxCraftingStation) + .Register(); + } + } +} diff --git a/Content/Items/TownRainMusicBox.png b/Content/Items/TownRainMusicBox.png new file mode 100644 index 0000000..02c9356 Binary files /dev/null and b/Content/Items/TownRainMusicBox.png differ diff --git a/Content/Items/TundraMusicBox.cs b/Content/Items/TundraMusicBox.cs index e7cbba5..06700cc 100644 --- a/Content/Items/TundraMusicBox.cs +++ b/Content/Items/TundraMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Tundra"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.BorealWood, 10) diff --git a/Content/Items/TundraMusicBox.png b/Content/Items/TundraMusicBox.png index a0406e6..192c58c 100644 Binary files a/Content/Items/TundraMusicBox.png and b/Content/Items/TundraMusicBox.png differ diff --git a/Content/Items/TundraUndergroundMusicBox.cs b/Content/Items/TundraUndergroundMusicBox.cs index 2c9b397..b284984 100644 --- a/Content/Items/TundraUndergroundMusicBox.cs +++ b/Content/Items/TundraUndergroundMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "TundraUnderground"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.IceBlock, 10) diff --git a/Content/Items/UndergroundMusicBox.cs b/Content/Items/UndergroundMusicBox.cs index 0a4aa87..0452ec9 100644 --- a/Content/Items/UndergroundMusicBox.cs +++ b/Content/Items/UndergroundMusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Underground"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.StoneBlock, 10) diff --git a/Content/Items/UndergroundMusicBox.png b/Content/Items/UndergroundMusicBox.png index cc56e6a..10a235c 100644 Binary files a/Content/Items/UndergroundMusicBox.png and b/Content/Items/UndergroundMusicBox.png differ diff --git a/Content/Items/UnderworldMusicBox.cs b/Content/Items/UnderworldMusicBox.cs index a1c896c..b7fb451 100644 --- a/Content/Items/UnderworldMusicBox.cs +++ b/Content/Items/UnderworldMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "Underworld"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.AshWood, 10) diff --git a/Content/Items/WallofFleshMusicBox.cs b/Content/Items/WallofFleshMusicBox.cs index 5164e5d..6bf5226 100644 --- a/Content/Items/WallofFleshMusicBox.cs +++ b/Content/Items/WallofFleshMusicBox.cs @@ -9,7 +9,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WallofFlesh"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddIngredient(ItemID.WallofFleshTrophy, 1) diff --git a/Content/Items/WorkshopTier1MusicBox.cs b/Content/Items/WorkshopTier1MusicBox.cs index d3ff61f..06ef13b 100644 --- a/Content/Items/WorkshopTier1MusicBox.cs +++ b/Content/Items/WorkshopTier1MusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier1"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddRecipeGroup(RecipeGroupID.Wood, 10) diff --git a/Content/Items/WorkshopTier1MusicBox.png b/Content/Items/WorkshopTier1MusicBox.png index 0e73504..38402a4 100644 Binary files a/Content/Items/WorkshopTier1MusicBox.png and b/Content/Items/WorkshopTier1MusicBox.png differ diff --git a/Content/Items/WorkshopTier2MusicBox.cs b/Content/Items/WorkshopTier2MusicBox.cs index a5bb624..ea0eeeb 100644 --- a/Content/Items/WorkshopTier2MusicBox.cs +++ b/Content/Items/WorkshopTier2MusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier2"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); diff --git a/Content/Items/WorkshopTier2MusicBox.png b/Content/Items/WorkshopTier2MusicBox.png index e78fa43..98b8b4d 100644 Binary files a/Content/Items/WorkshopTier2MusicBox.png and b/Content/Items/WorkshopTier2MusicBox.png differ diff --git a/Content/Items/WorkshopTier3MusicBox.cs b/Content/Items/WorkshopTier3MusicBox.cs index edf707c..6828503 100644 --- a/Content/Items/WorkshopTier3MusicBox.cs +++ b/Content/Items/WorkshopTier3MusicBox.cs @@ -10,7 +10,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier3"; + + public override void MusicBoxRecipe() { Recipe.Create(Type, 1) .AddRecipeGroup("VCMM:MythrilBarGroup", 3) diff --git a/Content/Items/WorkshopTier3MusicBox.png b/Content/Items/WorkshopTier3MusicBox.png index 513946f..e48546d 100644 Binary files a/Content/Items/WorkshopTier3MusicBox.png and b/Content/Items/WorkshopTier3MusicBox.png differ diff --git a/Content/Items/WorkshopTier4MusicBox.cs b/Content/Items/WorkshopTier4MusicBox.cs index 79a5222..8a9a919 100644 --- a/Content/Items/WorkshopTier4MusicBox.cs +++ b/Content/Items/WorkshopTier4MusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier4"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); diff --git a/Content/Items/WorkshopTier4MusicBox.png b/Content/Items/WorkshopTier4MusicBox.png index 35cd1b7..521a404 100644 Binary files a/Content/Items/WorkshopTier4MusicBox.png and b/Content/Items/WorkshopTier4MusicBox.png differ diff --git a/Content/Items/WorkshopTier5MusicBox.cs b/Content/Items/WorkshopTier5MusicBox.cs index cf15b29..6979d64 100644 --- a/Content/Items/WorkshopTier5MusicBox.cs +++ b/Content/Items/WorkshopTier5MusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier5"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); diff --git a/Content/Items/WorkshopTier5MusicBox.png b/Content/Items/WorkshopTier5MusicBox.png index 92d08d7..35ef776 100644 Binary files a/Content/Items/WorkshopTier5MusicBox.png and b/Content/Items/WorkshopTier5MusicBox.png differ diff --git a/Content/Items/WorkshopTier6MusicBox.cs b/Content/Items/WorkshopTier6MusicBox.cs index 794c34c..6aa55f7 100644 --- a/Content/Items/WorkshopTier6MusicBox.cs +++ b/Content/Items/WorkshopTier6MusicBox.cs @@ -11,7 +11,9 @@ namespace UnCalamityModMusic.Content.Items { public override int MusicBoxTile => ModContent.TileType(); - public override void AddRecipes() + public override string MusicFilePath => "WorkshopTier6"; + + public override void MusicBoxRecipe() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); diff --git a/Content/Items/WorkshopTier6MusicBox.png b/Content/Items/WorkshopTier6MusicBox.png index 5903e1e..a18b31a 100644 Binary files a/Content/Items/WorkshopTier6MusicBox.png and b/Content/Items/WorkshopTier6MusicBox.png differ diff --git a/Content/Loot.cs b/Content/Loot.cs deleted file mode 100644 index 1cb2302..0000000 --- a/Content/Loot.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Terraria; -using Terraria.GameContent.ItemDropRules; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; -using UnCalamityModMusic.Common; - -namespace UnCalamityModMusic.Content -{ - public class Loot : GlobalNPC - { - public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) - { - if (npc.type == NPCID.WallofFlesh) - { - DropResurrection(1, npcLoot); - } - - if (npc.type == NPCID.MoonLordCore) - { - DropMemory(1, npcLoot); - } - } - - public override void OnKill(NPC npc) - { - if (npc.type == NPCID.MoonLordCore) - { - NPC.SetEventFlagCleared(ref WorldFlags.passedMemory, -1); - } - } - - private static void DropResurrection(int stack, NPCLoot npcLoot) - { - LeadingConditionRule rule = new(new ResurrectionCondition()); - - rule.OnSuccess(ItemDropRule.Common(ModContent.ItemType(), 1)); - - npcLoot.Add(rule); - } - private static void DropMemory(int stack, NPCLoot npcLoot) - { - LeadingConditionRule rule = new(new MemoryCondition()); - - rule.OnSuccess(ItemDropRule.Common(ModContent.ItemType(), 1)); - - npcLoot.Add(rule); - } - } - - internal class ResurrectionCondition : IItemDropRuleCondition - { - public bool CanDrop(DropAttemptInfo info) => !info.IsInSimulation && info.npc.type == NPCID.WallofFlesh && !WorldFlags.passedResurrection; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Mods.UnCalamityModMusic.Loot.FirstKillCondition"); - } - - internal class MemoryCondition : IItemDropRuleCondition - { - public bool CanDrop(DropAttemptInfo info) => !info.IsInSimulation && info.npc.type == NPCID.MoonLordCore && !WorldFlags.passedMemory; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Mods.UnCalamityModMusic.Loot.FirstKillCondition"); - } -} diff --git a/Content/Menus/ResurrectionBackground.png b/Content/Menus/ResurrectionBackground.png index 2ea9ee7..8d7cc6a 100644 Binary files a/Content/Menus/ResurrectionBackground.png and b/Content/Menus/ResurrectionBackground.png differ diff --git a/Content/Recipes.cs b/Content/Recipes.cs index 8ffe248..b91a010 100644 --- a/Content/Recipes.cs +++ b/Content/Recipes.cs @@ -2,14 +2,16 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using UnCalamityModMusic.Common.Configs; namespace UnCalamityModMusic.Content { public class Recipes : ModSystem { public static int musicBoxCraftingStation = TileID.HeavyWorkBench; + public static int musicBoxCraftingStationVanilla = TileID.TinkerersWorkbench; - public static RecipeGroup CopperOreGroup; + public static RecipeGroup CopperOreGroup; public static RecipeGroup GoldOreGroup; public static RecipeGroup CobaltOreGroup; public static RecipeGroup CopperBarGroup; @@ -18,8 +20,9 @@ namespace UnCalamityModMusic.Content public static RecipeGroup AdamantiteBarGroup; public static RecipeGroup EvilPowderGroup; public static RecipeGroup TombstoneGroup; + public static RecipeGroup SillyTiedBalloonGroup; - public override void Unload() + public override void Unload() { CopperOreGroup = null; GoldOreGroup = null; @@ -30,6 +33,7 @@ namespace UnCalamityModMusic.Content AdamantiteBarGroup = null; EvilPowderGroup = null; TombstoneGroup = null; + SillyTiedBalloonGroup = null; } public override void AddRecipeGroups() @@ -96,16 +100,27 @@ namespace UnCalamityModMusic.Content ItemID.Tombstone, ItemID.GraveMarker, ItemID.CrossGraveMarker, ItemID.Headstone, ItemID.Gravestone, ItemID.Obelisk, ItemID.RichGravestone1, ItemID.RichGravestone2, ItemID.RichGravestone3, ItemID.RichGravestone4, ItemID.RichGravestone5 ); RecipeGroup.RegisterGroup("VCMM:TombstoneGroup", TombstoneGroup); - } + + SillyTiedBalloonGroup = new RecipeGroup + ( + () => $"{Language.GetTextValue("LegacyMisc.37")} {Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.SillyTiedBalloon")}", + ItemID.SillyBalloonTiedPink, ItemID.SillyBalloonTiedPurple, ItemID.SillyBalloonTiedGreen + ); + RecipeGroup.RegisterGroup("VCMM:SillyTiedBalloonGroup", SillyTiedBalloonGroup); + } public override void AddRecipes() { var calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); var calamityModMusic = ModLoader.TryGetMod("CalamityModMusic", out Mod cmusic); - var otherCalamityModMusic = ModLoader.TryGetMod("OtherCalamityModMusic", out Mod othermusic); var calamityVanities = ModLoader.TryGetMod("CalValEX", out Mod calval); var catalystMod = ModLoader.TryGetMod("CatalystMod", out Mod catalyst); + if (!ModContent.GetInstance().MusicBoxRecipes) + { + return; + } + //Empty Music Box Recipe.Create(ItemID.MusicBox, 1) .AddRecipeGroup(RecipeGroupID.Wood, 6) @@ -161,23 +176,11 @@ namespace UnCalamityModMusic.Content { recipeFinder.DisableRecipe(); } - if (recipeFinder.HasResult(cmusic.Find("AdultEidolonWyrmMusicBox"))) - { - recipeFinder.DisableRecipe(); - } if (recipeFinder.HasResult(cmusic.Find("CalamitasDefeatMusicBox"))) { recipeFinder.DisableRecipe(); } - if (recipeFinder.HasResult(cmusic.Find("CalamityTitleMusicBox"))) - { - recipeFinder.DisableRecipe(); - } - if (recipeFinder.HasResult(cmusic.Find("YharonLegacyMusicBox"))) - { - recipeFinder.DisableRecipe(); - } - } + } } if (calamityModMusic && calamityMod) @@ -292,20 +295,6 @@ namespace UnCalamityModMusic.Content UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); } - //Adult Eidolon Wyrm - try - { - Recipe.Create(cmusic.Find("AdultEidolonWyrmMusicBox").Type, 1) - .AddIngredient(calamity, "HalibutCannon", 1) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - //Anahita try { @@ -558,7 +547,7 @@ namespace UnCalamityModMusic.Content try { Recipe.Create(cmusic.Find("BossRushTier5MusicBox").Type, 1) - .AddIngredient(calamity, "Rock", 1) + .AddIngredient(calamity, "SupremeCalamitasTrophy", 1) .AddIngredient(calamity, "ShadowspecBar", 3) .AddIngredient(ItemID.MusicBox, 1) .AddTile(musicBoxCraftingStation) @@ -789,22 +778,6 @@ namespace UnCalamityModMusic.Content UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); } - //Calamity Title - try - { - Recipe.Create(cmusic.Find("CalamityTitleMusicBox").Type, 1) - .AddIngredient(calamity, "EssenceofHavoc", 10) - .AddIngredient(calamity, "BrimstoneSlag", 10) - .AddIngredient(calamity, "CalamityDust", 10) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - //Ceaseless Void try { @@ -1037,8 +1010,22 @@ namespace UnCalamityModMusic.Content UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); } - //Profaned Guardians - try + //Primordial Wyrm + try + { + Recipe.Create(cmusic.Find("PrimordialWyrmMusicBox").Type, 1) + .AddIngredient(calamity, "HalibutCannon", 1) + .AddIngredient(ItemID.MusicBox, 1) + .AddTile(musicBoxCraftingStation) + .Register(); + } + catch + { + UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); + } + + //Profaned Guardians + try { Recipe.Create(cmusic.Find("ProfanedGuardiansMusicBox").Type, 1) .AddIngredient(calamity, "ProfanedGuardianTrophy", 1) @@ -1169,20 +1156,6 @@ namespace UnCalamityModMusic.Content UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); } - //Yharon Legacy - try - { - Recipe.Create(cmusic.Find("YharonLegacyMusicBox").Type, 1) - .AddIngredient(calamity, "ForgottenDragonEgg", 1) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - //Yharon Phase 1 try { @@ -1214,26 +1187,7 @@ namespace UnCalamityModMusic.Content #endregion #region Calamity Addon Music Boxes - /*if (otherCalamityModMusic) - { - //Planetoids - try - { - Recipe.Create(othermusic.Find("PlanetoidsMusicBox").Type, 1) - .AddIngredient(ItemID.Cloud, 10) - .AddIngredient(ItemID.DirtBlock, 10) - .AddIngredient(calamity, "Cinderplate", 10) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } - }*/ - - if (calamityVanities) + if (calamityVanities) { //Astral Blight try @@ -1281,24 +1235,8 @@ namespace UnCalamityModMusic.Content { UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); } - - //Astrageldon Title - try - { - Recipe.Create(catalyst.Find("AstrageldonTitleMusicBox").Type, 1) - .AddIngredient(calamity, "AstralOre", 10) - .AddIngredient(catalyst, "AstraJelly", 10) - .AddIngredient(catalyst, "MetanovaBar", 3) - .AddIngredient(ItemID.MusicBox, 1) - .AddTile(musicBoxCraftingStation) - .Register(); - } - catch - { - UnCalamityModMusic.Instance.Logger.Debug(Language.GetTextValue("Mods.UnCalamityModMusic.Recipes.NameMismatchError")); - } } #endregion - } - } + } + } } \ No newline at end of file diff --git a/Content/Tiles/AbyssLayer3AltMusicBox_Highlight.png b/Content/Tiles/AbyssLayer3AltMusicBox_Highlight.png new file mode 100644 index 0000000..42c806e Binary files /dev/null and b/Content/Tiles/AbyssLayer3AltMusicBox_Highlight.png differ diff --git a/Content/Tiles/BloodMoonDeathMusicBox.png b/Content/Tiles/BloodMoonDeathMusicBox.png index 4267561..0d100f6 100644 Binary files a/Content/Tiles/BloodMoonDeathMusicBox.png and b/Content/Tiles/BloodMoonDeathMusicBox.png differ diff --git a/Content/Tiles/BloodMoonDeathMusicBox_Highlight.png b/Content/Tiles/BloodMoonDeathMusicBox_Highlight.png new file mode 100644 index 0000000..83602bd Binary files /dev/null and b/Content/Tiles/BloodMoonDeathMusicBox_Highlight.png differ diff --git a/Content/Tiles/BloodMoonMusicBox.png b/Content/Tiles/BloodMoonMusicBox.png index 4cb0425..843b084 100644 Binary files a/Content/Tiles/BloodMoonMusicBox.png and b/Content/Tiles/BloodMoonMusicBox.png differ diff --git a/Content/Tiles/BloodMoonMusicBox_Highlight.png b/Content/Tiles/BloodMoonMusicBox_Highlight.png new file mode 100644 index 0000000..6a36968 Binary files /dev/null and b/Content/Tiles/BloodMoonMusicBox_Highlight.png differ diff --git a/Content/Tiles/BrainofCthulhuMusicBox_Highlight.png b/Content/Tiles/BrainofCthulhuMusicBox_Highlight.png new file mode 100644 index 0000000..049f456 Binary files /dev/null and b/Content/Tiles/BrainofCthulhuMusicBox_Highlight.png differ diff --git a/Content/Tiles/CavernsMusicBox.png b/Content/Tiles/CavernsMusicBox.png index 272419a..61d5276 100644 Binary files a/Content/Tiles/CavernsMusicBox.png and b/Content/Tiles/CavernsMusicBox.png differ diff --git a/Content/Tiles/CavernsMusicBox_Highlight.png b/Content/Tiles/CavernsMusicBox_Highlight.png new file mode 100644 index 0000000..ceae10e Binary files /dev/null and b/Content/Tiles/CavernsMusicBox_Highlight.png differ diff --git a/Content/Tiles/CorruptionMusicBox_Highlight.png b/Content/Tiles/CorruptionMusicBox_Highlight.png new file mode 100644 index 0000000..f2a01d8 Binary files /dev/null and b/Content/Tiles/CorruptionMusicBox_Highlight.png differ diff --git a/Content/Tiles/CorruptionUndergroundMusicBox_Highlight.png b/Content/Tiles/CorruptionUndergroundMusicBox_Highlight.png new file mode 100644 index 0000000..11ce95b Binary files /dev/null and b/Content/Tiles/CorruptionUndergroundMusicBox_Highlight.png differ diff --git a/Content/Tiles/CrimsonMusicBox_Highlight.png b/Content/Tiles/CrimsonMusicBox_Highlight.png new file mode 100644 index 0000000..107633d Binary files /dev/null and b/Content/Tiles/CrimsonMusicBox_Highlight.png differ diff --git a/Content/Tiles/CrimsonUndergroundMusicBox_Highlight.png b/Content/Tiles/CrimsonUndergroundMusicBox_Highlight.png new file mode 100644 index 0000000..65d21df Binary files /dev/null and b/Content/Tiles/CrimsonUndergroundMusicBox_Highlight.png differ diff --git a/Content/Tiles/DesertMusicBox_Highlight.png b/Content/Tiles/DesertMusicBox_Highlight.png new file mode 100644 index 0000000..4af38d4 Binary files /dev/null and b/Content/Tiles/DesertMusicBox_Highlight.png differ diff --git a/Content/Tiles/DungeonMusicBox_Highlight.png b/Content/Tiles/DungeonMusicBox_Highlight.png new file mode 100644 index 0000000..e668180 Binary files /dev/null and b/Content/Tiles/DungeonMusicBox_Highlight.png differ diff --git a/Content/Tiles/EaterofWorldsMusicBox_Highlight.png b/Content/Tiles/EaterofWorldsMusicBox_Highlight.png new file mode 100644 index 0000000..7bc690f Binary files /dev/null and b/Content/Tiles/EaterofWorldsMusicBox_Highlight.png differ diff --git a/Content/Tiles/External/MusicBox.cs b/Content/Tiles/External/MusicBox.cs index 23e9e78..aa51b38 100644 --- a/Content/Tiles/External/MusicBox.cs +++ b/Content/Tiles/External/MusicBox.cs @@ -5,6 +5,8 @@ namespace UnCalamityModMusic.Content.Tiles.External { public class MusicBox : MusicBoxTile { + public override string HighlightTexture => "UnCalamityModMusic/Content/Menus/Blank"; + public override void MouseOver(int i, int j) { Main.LocalPlayer.cursorItemIconEnabled = false; diff --git a/Content/Tiles/EyeofCthulhuMusicBox_Highlight.png b/Content/Tiles/EyeofCthulhuMusicBox_Highlight.png new file mode 100644 index 0000000..ac93223 Binary files /dev/null and b/Content/Tiles/EyeofCthulhuMusicBox_Highlight.png differ diff --git a/Content/Tiles/FalseEpilogueMusicBox.png b/Content/Tiles/FalseEpilogueMusicBox.png index f49ea95..15788f7 100644 Binary files a/Content/Tiles/FalseEpilogueMusicBox.png and b/Content/Tiles/FalseEpilogueMusicBox.png differ diff --git a/Content/Tiles/FalseEpilogueMusicBox_Highlight.png b/Content/Tiles/FalseEpilogueMusicBox_Highlight.png new file mode 100644 index 0000000..681bec2 Binary files /dev/null and b/Content/Tiles/FalseEpilogueMusicBox_Highlight.png differ diff --git a/Content/Tiles/ForestDayAfternoonMusicBox_Highlight.png b/Content/Tiles/ForestDayAfternoonMusicBox_Highlight.png new file mode 100644 index 0000000..ecb15cd Binary files /dev/null and b/Content/Tiles/ForestDayAfternoonMusicBox_Highlight.png differ diff --git a/Content/Tiles/ForestDayDawnMusicBox_Highlight.png b/Content/Tiles/ForestDayDawnMusicBox_Highlight.png new file mode 100644 index 0000000..212f08b Binary files /dev/null and b/Content/Tiles/ForestDayDawnMusicBox_Highlight.png differ diff --git a/Content/Tiles/ForestDayEveningMusicBox_Highlight.png b/Content/Tiles/ForestDayEveningMusicBox_Highlight.png new file mode 100644 index 0000000..eefc3e0 Binary files /dev/null and b/Content/Tiles/ForestDayEveningMusicBox_Highlight.png differ diff --git a/Content/Tiles/ForestDayMorningMusicBox_Highlight.png b/Content/Tiles/ForestDayMorningMusicBox_Highlight.png new file mode 100644 index 0000000..30ffe61 Binary files /dev/null and b/Content/Tiles/ForestDayMorningMusicBox_Highlight.png differ diff --git a/Content/Tiles/ForestNightMusicBox_Highlight.png b/Content/Tiles/ForestNightMusicBox_Highlight.png new file mode 100644 index 0000000..ecb15cd Binary files /dev/null and b/Content/Tiles/ForestNightMusicBox_Highlight.png differ diff --git a/Content/Tiles/GeodesMusicBox.png b/Content/Tiles/GeodesMusicBox.png index 2ee8859..5ea1d88 100644 Binary files a/Content/Tiles/GeodesMusicBox.png and b/Content/Tiles/GeodesMusicBox.png differ diff --git a/Content/Tiles/GeodesMusicBox_Highlight.png b/Content/Tiles/GeodesMusicBox_Highlight.png new file mode 100644 index 0000000..1b48a86 Binary files /dev/null and b/Content/Tiles/GeodesMusicBox_Highlight.png differ diff --git a/Content/Tiles/GlowingMushroomFieldsMusicBox.png b/Content/Tiles/GlowingMushroomFieldsMusicBox.png index 6eeeae6..770db82 100644 Binary files a/Content/Tiles/GlowingMushroomFieldsMusicBox.png and b/Content/Tiles/GlowingMushroomFieldsMusicBox.png differ diff --git a/Content/Tiles/GlowingMushroomFieldsMusicBox_Highlight.png b/Content/Tiles/GlowingMushroomFieldsMusicBox_Highlight.png new file mode 100644 index 0000000..d8fece4 Binary files /dev/null and b/Content/Tiles/GlowingMushroomFieldsMusicBox_Highlight.png differ diff --git a/Content/Tiles/HardmodeInterludeMusicBox.png b/Content/Tiles/HardmodeInterludeMusicBox.png index cfbd138..debe559 100644 Binary files a/Content/Tiles/HardmodeInterludeMusicBox.png and b/Content/Tiles/HardmodeInterludeMusicBox.png differ diff --git a/Content/Tiles/HardmodeInterludeMusicBox_Highlight.png b/Content/Tiles/HardmodeInterludeMusicBox_Highlight.png new file mode 100644 index 0000000..2d8986c Binary files /dev/null and b/Content/Tiles/HardmodeInterludeMusicBox_Highlight.png differ diff --git a/Content/Tiles/KingSlimeMusicBox_Highlight.png b/Content/Tiles/KingSlimeMusicBox_Highlight.png new file mode 100644 index 0000000..a90003a Binary files /dev/null and b/Content/Tiles/KingSlimeMusicBox_Highlight.png differ diff --git a/Content/Tiles/LanternFestivalMusicBox_Highlight.png b/Content/Tiles/LanternFestivalMusicBox_Highlight.png new file mode 100644 index 0000000..ace287f Binary files /dev/null and b/Content/Tiles/LanternFestivalMusicBox_Highlight.png differ diff --git a/Content/Tiles/MeteoriteMusicBox_Highlight.png b/Content/Tiles/MeteoriteMusicBox_Highlight.png new file mode 100644 index 0000000..e6f961d Binary files /dev/null and b/Content/Tiles/MeteoriteMusicBox_Highlight.png differ diff --git a/Content/Tiles/MoonLordMusicBox_Highlight.png b/Content/Tiles/MoonLordMusicBox_Highlight.png new file mode 100644 index 0000000..c7bea23 Binary files /dev/null and b/Content/Tiles/MoonLordMusicBox_Highlight.png differ diff --git a/Content/Tiles/OceanDayMusicBox.png b/Content/Tiles/OceanDayMusicBox.png index 2f51115..8567f19 100644 Binary files a/Content/Tiles/OceanDayMusicBox.png and b/Content/Tiles/OceanDayMusicBox.png differ diff --git a/Content/Tiles/OceanDayMusicBox_Highlight.png b/Content/Tiles/OceanDayMusicBox_Highlight.png new file mode 100644 index 0000000..5076d5b Binary files /dev/null and b/Content/Tiles/OceanDayMusicBox_Highlight.png differ diff --git a/Content/Tiles/OceanNightMusicBox.png b/Content/Tiles/OceanNightMusicBox.png index d817c62..0188194 100644 Binary files a/Content/Tiles/OceanNightMusicBox.png and b/Content/Tiles/OceanNightMusicBox.png differ diff --git a/Content/Tiles/OceanNightMusicBox_Highlight.png b/Content/Tiles/OceanNightMusicBox_Highlight.png new file mode 100644 index 0000000..9928a9e Binary files /dev/null and b/Content/Tiles/OceanNightMusicBox_Highlight.png differ diff --git a/Content/Tiles/OceanRainMusicBox.cs b/Content/Tiles/OceanRainMusicBox.cs new file mode 100644 index 0000000..5207d9d --- /dev/null +++ b/Content/Tiles/OceanRainMusicBox.cs @@ -0,0 +1,8 @@ +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Tiles +{ + public class OceanRainMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Content/Tiles/OceanRainMusicBox.png b/Content/Tiles/OceanRainMusicBox.png new file mode 100644 index 0000000..8068fda Binary files /dev/null and b/Content/Tiles/OceanRainMusicBox.png differ diff --git a/Content/Tiles/OceanRainMusicBox_Highlight.png b/Content/Tiles/OceanRainMusicBox_Highlight.png new file mode 100644 index 0000000..0531ece Binary files /dev/null and b/Content/Tiles/OceanRainMusicBox_Highlight.png differ diff --git a/Content/Tiles/RainLegacyMusicBox_Highlight.png b/Content/Tiles/RainLegacyMusicBox_Highlight.png new file mode 100644 index 0000000..e83ab6f Binary files /dev/null and b/Content/Tiles/RainLegacyMusicBox_Highlight.png differ diff --git a/Content/Tiles/RainMusicBox_Highlight.png b/Content/Tiles/RainMusicBox_Highlight.png new file mode 100644 index 0000000..cea0820 Binary files /dev/null and b/Content/Tiles/RainMusicBox_Highlight.png differ diff --git a/Content/Tiles/SkeletronMusicBox.png b/Content/Tiles/SkeletronMusicBox.png index d1e8989..9937908 100644 Binary files a/Content/Tiles/SkeletronMusicBox.png and b/Content/Tiles/SkeletronMusicBox.png differ diff --git a/Content/Tiles/SkeletronMusicBox_Highlight.png b/Content/Tiles/SkeletronMusicBox_Highlight.png new file mode 100644 index 0000000..d002c6c Binary files /dev/null and b/Content/Tiles/SkeletronMusicBox_Highlight.png differ diff --git a/Content/Tiles/SlimeRainMusicBox.png b/Content/Tiles/SlimeRainMusicBox.png index 4655e37..0c39815 100644 Binary files a/Content/Tiles/SlimeRainMusicBox.png and b/Content/Tiles/SlimeRainMusicBox.png differ diff --git a/Content/Tiles/SlimeRainMusicBox_Highlight.png b/Content/Tiles/SlimeRainMusicBox_Highlight.png new file mode 100644 index 0000000..fd8677f Binary files /dev/null and b/Content/Tiles/SlimeRainMusicBox_Highlight.png differ diff --git a/Content/Tiles/SpaceMusicBox.png b/Content/Tiles/SpaceMusicBox.png index c6671e4..5b5525b 100644 Binary files a/Content/Tiles/SpaceMusicBox.png and b/Content/Tiles/SpaceMusicBox.png differ diff --git a/Content/Tiles/SpaceMusicBox_Highlight.png b/Content/Tiles/SpaceMusicBox_Highlight.png new file mode 100644 index 0000000..1517298 Binary files /dev/null and b/Content/Tiles/SpaceMusicBox_Highlight.png differ diff --git a/Content/Tiles/TorchGodMusicBox.cs b/Content/Tiles/TorchGodMusicBox.cs new file mode 100644 index 0000000..da9bee1 --- /dev/null +++ b/Content/Tiles/TorchGodMusicBox.cs @@ -0,0 +1,8 @@ +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Tiles +{ + public class TorchGodMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Content/Tiles/TorchGodMusicBox.png b/Content/Tiles/TorchGodMusicBox.png new file mode 100644 index 0000000..a30437e Binary files /dev/null and b/Content/Tiles/TorchGodMusicBox.png differ diff --git a/Content/Tiles/TorchGodMusicBox_Highlight.png b/Content/Tiles/TorchGodMusicBox_Highlight.png new file mode 100644 index 0000000..8513c66 Binary files /dev/null and b/Content/Tiles/TorchGodMusicBox_Highlight.png differ diff --git a/Content/Tiles/TorchGodRevengeanceMusicBox.cs b/Content/Tiles/TorchGodRevengeanceMusicBox.cs new file mode 100644 index 0000000..6237c19 --- /dev/null +++ b/Content/Tiles/TorchGodRevengeanceMusicBox.cs @@ -0,0 +1,8 @@ +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Tiles +{ + public class TorchGodRevengeanceMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Content/Tiles/TorchGodRevengeanceMusicBox.png b/Content/Tiles/TorchGodRevengeanceMusicBox.png new file mode 100644 index 0000000..3b909ea Binary files /dev/null and b/Content/Tiles/TorchGodRevengeanceMusicBox.png differ diff --git a/Content/Tiles/TorchGodRevengeanceMusicBox_Highlight.png b/Content/Tiles/TorchGodRevengeanceMusicBox_Highlight.png new file mode 100644 index 0000000..8513c66 Binary files /dev/null and b/Content/Tiles/TorchGodRevengeanceMusicBox_Highlight.png differ diff --git a/Content/Tiles/TownDayMusicBox_Highlight.png b/Content/Tiles/TownDayMusicBox_Highlight.png new file mode 100644 index 0000000..906de86 Binary files /dev/null and b/Content/Tiles/TownDayMusicBox_Highlight.png differ diff --git a/Content/Tiles/TownNightMusicBox_Highlight.png b/Content/Tiles/TownNightMusicBox_Highlight.png new file mode 100644 index 0000000..96a85f8 Binary files /dev/null and b/Content/Tiles/TownNightMusicBox_Highlight.png differ diff --git a/Content/Tiles/TownPartyMusicBox.cs b/Content/Tiles/TownPartyMusicBox.cs new file mode 100644 index 0000000..82c5e1b --- /dev/null +++ b/Content/Tiles/TownPartyMusicBox.cs @@ -0,0 +1,8 @@ +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Tiles +{ + public class TownPartyMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Content/Tiles/TownPartyMusicBox.png b/Content/Tiles/TownPartyMusicBox.png new file mode 100644 index 0000000..67208c0 Binary files /dev/null and b/Content/Tiles/TownPartyMusicBox.png differ diff --git a/Content/Tiles/TownPartyMusicBox_Highlight.png b/Content/Tiles/TownPartyMusicBox_Highlight.png new file mode 100644 index 0000000..deded68 Binary files /dev/null and b/Content/Tiles/TownPartyMusicBox_Highlight.png differ diff --git a/Content/Tiles/TownRainMusicBox.cs b/Content/Tiles/TownRainMusicBox.cs new file mode 100644 index 0000000..4f76934 --- /dev/null +++ b/Content/Tiles/TownRainMusicBox.cs @@ -0,0 +1,8 @@ +using UnCalamityModMusic.Common; + +namespace UnCalamityModMusic.Content.Tiles +{ + public class TownRainMusicBox : MusicBoxTile + { + } +} \ No newline at end of file diff --git a/Content/Tiles/TownRainMusicBox.png b/Content/Tiles/TownRainMusicBox.png new file mode 100644 index 0000000..d0c9eef Binary files /dev/null and b/Content/Tiles/TownRainMusicBox.png differ diff --git a/Content/Tiles/TownRainMusicBox_Highlight.png b/Content/Tiles/TownRainMusicBox_Highlight.png new file mode 100644 index 0000000..906de86 Binary files /dev/null and b/Content/Tiles/TownRainMusicBox_Highlight.png differ diff --git a/Content/Tiles/TundraMusicBox.png b/Content/Tiles/TundraMusicBox.png index ba78e18..d5c531e 100644 Binary files a/Content/Tiles/TundraMusicBox.png and b/Content/Tiles/TundraMusicBox.png differ diff --git a/Content/Tiles/TundraMusicBox_Highlight.png b/Content/Tiles/TundraMusicBox_Highlight.png new file mode 100644 index 0000000..baa703d Binary files /dev/null and b/Content/Tiles/TundraMusicBox_Highlight.png differ diff --git a/Content/Tiles/TundraUndergroundMusicBox_Highlight.png b/Content/Tiles/TundraUndergroundMusicBox_Highlight.png new file mode 100644 index 0000000..7910b6c Binary files /dev/null and b/Content/Tiles/TundraUndergroundMusicBox_Highlight.png differ diff --git a/Content/Tiles/UndergroundMusicBox.png b/Content/Tiles/UndergroundMusicBox.png index 006d1c2..4f67ba5 100644 Binary files a/Content/Tiles/UndergroundMusicBox.png and b/Content/Tiles/UndergroundMusicBox.png differ diff --git a/Content/Tiles/UndergroundMusicBox_Highlight.png b/Content/Tiles/UndergroundMusicBox_Highlight.png new file mode 100644 index 0000000..4f71910 Binary files /dev/null and b/Content/Tiles/UndergroundMusicBox_Highlight.png differ diff --git a/Content/Tiles/UnderworldMusicBox_Highlight.png b/Content/Tiles/UnderworldMusicBox_Highlight.png new file mode 100644 index 0000000..9c0c05b Binary files /dev/null and b/Content/Tiles/UnderworldMusicBox_Highlight.png differ diff --git a/Content/Tiles/WallofFleshMusicBox_Highlight.png b/Content/Tiles/WallofFleshMusicBox_Highlight.png new file mode 100644 index 0000000..6702126 Binary files /dev/null and b/Content/Tiles/WallofFleshMusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier1MusicBox.png b/Content/Tiles/WorkshopTier1MusicBox.png index 9836296..e2faba4 100644 Binary files a/Content/Tiles/WorkshopTier1MusicBox.png and b/Content/Tiles/WorkshopTier1MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier1MusicBox_Highlight.png b/Content/Tiles/WorkshopTier1MusicBox_Highlight.png new file mode 100644 index 0000000..bde1b6d Binary files /dev/null and b/Content/Tiles/WorkshopTier1MusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier2MusicBox.png b/Content/Tiles/WorkshopTier2MusicBox.png index 5640f7a..3aa0091 100644 Binary files a/Content/Tiles/WorkshopTier2MusicBox.png and b/Content/Tiles/WorkshopTier2MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier2MusicBox_Highlight.png b/Content/Tiles/WorkshopTier2MusicBox_Highlight.png new file mode 100644 index 0000000..0c4de29 Binary files /dev/null and b/Content/Tiles/WorkshopTier2MusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier3MusicBox.png b/Content/Tiles/WorkshopTier3MusicBox.png index 3fce3c5..654d49c 100644 Binary files a/Content/Tiles/WorkshopTier3MusicBox.png and b/Content/Tiles/WorkshopTier3MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier3MusicBox_Highlight.png b/Content/Tiles/WorkshopTier3MusicBox_Highlight.png new file mode 100644 index 0000000..5c4e5fc Binary files /dev/null and b/Content/Tiles/WorkshopTier3MusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier4MusicBox.png b/Content/Tiles/WorkshopTier4MusicBox.png index 511ccc7..0e2fbaf 100644 Binary files a/Content/Tiles/WorkshopTier4MusicBox.png and b/Content/Tiles/WorkshopTier4MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier4MusicBox_Highlight.png b/Content/Tiles/WorkshopTier4MusicBox_Highlight.png new file mode 100644 index 0000000..aefab66 Binary files /dev/null and b/Content/Tiles/WorkshopTier4MusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier5MusicBox.png b/Content/Tiles/WorkshopTier5MusicBox.png index 744066d..51b28f5 100644 Binary files a/Content/Tiles/WorkshopTier5MusicBox.png and b/Content/Tiles/WorkshopTier5MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier5MusicBox_Highlight.png b/Content/Tiles/WorkshopTier5MusicBox_Highlight.png new file mode 100644 index 0000000..5823608 Binary files /dev/null and b/Content/Tiles/WorkshopTier5MusicBox_Highlight.png differ diff --git a/Content/Tiles/WorkshopTier6MusicBox.png b/Content/Tiles/WorkshopTier6MusicBox.png index 2c3d5c8..38865d2 100644 Binary files a/Content/Tiles/WorkshopTier6MusicBox.png and b/Content/Tiles/WorkshopTier6MusicBox.png differ diff --git a/Content/Tiles/WorkshopTier6MusicBox_Highlight.png b/Content/Tiles/WorkshopTier6MusicBox_Highlight.png new file mode 100644 index 0000000..86db260 Binary files /dev/null and b/Content/Tiles/WorkshopTier6MusicBox_Highlight.png differ diff --git a/Localization/en-US.hjson b/Localization/en-US.hjson index 5f4db40..7907cc3 100644 --- a/Localization/en-US.hjson +++ b/Localization/en-US.hjson @@ -3,40 +3,45 @@ Mods: { Configs: { MusicConfig: { DisplayName: Music Config - MusicChangesHeader: Music Changes + MusicTogglesHeader: Music Toggles ConditionChangesHeader: Condition Changes WorkshopThemes: { - Label: Workshop Themes + Label: "[i:UnCalamityModMusic/WorkshopTier1MusicBox] Workshop Themes" Tooltip: ''' - Enables the Workshop themes that play when near certain crafting stations. - If you're looking to disable the Town themes, use the separate No Town Music mod. + Toggles the Workshop themes that play when near certain crafting stations. + If you're looking to disable the Town themes, use the separate No Town Music mod or use Shadow Candles. ''' } - DeepAbyssAltTheme: { - Label: Deep Abyss Alt Theme - Tooltip: Enables an alternate theme for the 3rd layer of the Abyss. + HardmodeInterlude: { + Label: "[i:UnCalamityModMusic/HardmodeInterludeMusicBox] Hardmode Interlude" + Tooltip: + ''' + Toggles a music event that plays when entering Hardmode. + If you're looking to disable the Credits, use the separate No In-game Credits mod. + ''' + } + + AbyssLayer3Alt: { + Label: "[i:UnCalamityModMusic/AbyssLayer3AltMusicBox] Abyss Layer 3 Alt" + Tooltip: Toggles an alternate theme for the 3rd layer of the Abyss. } PrioritizeInfernumMusic: { - Label: Prioritize Infernum Mod Music + Label: "[i:WallOfFleshGoatMountItem] Prioritize Infernum Music" Tooltip: ''' - Enables Infernum music to take priority over VCMM music. + Toggles whether Infernum music will take priority over VCMM music. This option does nothing if the Infernum Mode Music mod is disabled. - This option does not affect Calamity bosses or any alternate themes. + This option does not affect Calamity bosses. ''' } - OverrideAnahitasLureTheme: { - Label: Ocean Themes Override Anahita's Lure Theme - Tooltip: - ''' - Overrides the ??? theme with the Ocean themes. - This also applies to Ocean ambience. - ''' + OverrideAnahitasLure: { + Label: "[i:UnCalamityModMusic/OceanDayMusicBox] Override Anahita's Lure" + Tooltip: Toggles whether the Anahita's Lure theme will override the Ocean themes. } } @@ -46,7 +51,7 @@ Mods: { OtherChangesHeader: Other Changes AmbienceFrequency: { - Label: Ambience Frequency + Label: "[i:Bunny] Ambience Frequency" Tooltip: ''' Adjusts the frequency at which ambience will replace normal music, from 0% to 100%. @@ -55,18 +60,23 @@ Mods: { } DisableBeeHiveAmbience: { - Label: Disable Bee Hive Ambience - Tooltip: Disables ambience in Bee Hives if ambience is enabled. + Label: "[i:BeeWax] Disable Bee Hive Ambience" + Tooltip: Toggles ambience in Bee Hives if ambience is enabled. } DisableSpiderCaveAmbience: { - Label: Disable Spider Cave Ambience - Tooltip: Disables ambience in Spider Caves if ambience is enabled. + Label: "[i:SpiderFang] Disable Spider Cave Ambience" + Tooltip: Toggles ambience in Spider Caves if ambience is enabled. + } + + MusicBoxRecipes: { + Label: "[i:HeavyWorkBench] Music Box Recipes" + Tooltip: Toggles all music boxes recipes that require a Heavy Work Bench. } MusicBoxResprite: { - Label: Empty Music Box Resprite - Tooltip: Enables a resprite of the empty, unrecorded music box. + Label: "[i:MusicBox] Empty Music Box Resprite" + Tooltip: Toggles a resprite of the empty, unrecorded music box. } } } @@ -114,7 +124,7 @@ Mods: { CrimsonUndergroundMusicBox: { DisplayName: Music Box (Underground Crimson) - Tooltip: Plays 'Bloodstained Terror' by SkippyZii + Tooltip: Plays 'Inside the Beast' by SkippyZii } DesertMusicBox: { @@ -216,6 +226,11 @@ Mods: { Tooltip: Plays 'serene tides' by Heart Plus Up! } + OceanRainMusicBox: { + DisplayName: Music Box (Ocean Rain) + Tooltip: Plays 'waves' by Heart Plus Up! + } + RainLegacyMusicBox: { DisplayName: Music Box (Rain - Legacy) Tooltip: Plays 'Grey Sky' by Heart Plus Up! @@ -241,6 +256,16 @@ Mods: { Tooltip: Plays 'Starry Ascent' by Heart Plus Up! } + TorchGodMusicBox: { + DisplayName: Music Box (Torch God) + Tooltip: Plays 'Trial by Fire' by Heart Plus Up! + } + + TorchGodRevengeanceMusicBox: { + DisplayName: Music Box (Torch God - Revengeance) + Tooltip: Plays a variant of 'Trial by Fire' by Heart Plus Up! + } + TownDayMusicBox: { DisplayName: Music Box (Town Day) Tooltip: Plays 'Haven in the Sunlight' by Heart Plus Up! @@ -251,6 +276,16 @@ Mods: { Tooltip: Plays 'Moonlit Haven' by Heart Plus Up! } + TownPartyMusicBox: { + DisplayName: Music Box (Town Party) + Tooltip: Plays 'Celebration Haven' by Heart Plus Up! + } + + TownRainMusicBox: { + DisplayName: Music Box (Town Rain) + Tooltip: Plays 'Haven in Overcast' by Heart Plus Up! + } + TundraMusicBox: { DisplayName: Music Box (Tundra) Tooltip: Plays 'Frozen Over' by Heart Plus Up! @@ -326,13 +361,14 @@ Mods: { WorkshopTier2: The Sky and the Depths WorkshopTier1: Metal, Wood, and Fire TownNight: Moonlit Haven + TownNight_Noiseless: Moonlit Haven TownDay: Haven in the Sunlight Dungeon: Chambers of the Tyrant GlowingMushroomFields: Psychedelic Depths Corruption: Writhing Shadows CorruptionUnderground: Between the Shadows Crimson: Clotted Lands - CrimsonUnderground: Bloodstained Terror + CrimsonUnderground: Inside the Beast Geodes: Amidst the Minerals Tundra: Frozen Over TundraUnderground: Inside the Glaciers @@ -353,10 +389,15 @@ Mods: { EaterofWorlds: Menace of the Chasms EyeofCthulhu: Bloodshot Barrage KingSlime: Gelatinous Monarch - BloodMoonDeath: Sanguine Eclipse + TorchGod: Trial by Fire + TorchGodRevengeance: Trial by Fire BloodMoon: Congealing Shadows + BloodMoonDeath: Sanguine Eclipse SlimeRain: Gelatin Showers + OceanRain: waves + TownRain: Haven in Overcast Rain: downpour + TownParty: Celebration Haven LanternFestival: Serenity HardmodeInterlude: The Resurrection of a Cruel World FalseEpilogue: The Memory of a Cruel World @@ -377,10 +418,9 @@ Mods: { } } - Loot.FirstKillCondition: Drops only on the first kill - Recipes: { EvilPowder: Evil Powder + SillyTiedBalloon: Silly Tied Balloon NameMismatchError: There is an internal name mismatch between the items in this recipe and the items in another mod. The recipe for this item has been disabled. } } diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..8da89ff --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,16 @@ +{ + "profiles": { + "Terraria": { + "commandName": "Executable", + "executablePath": "dotnet", + "commandLineArgs": "$(tMLPath)", + "workingDirectory": "$(tMLSteamPath)" + }, + "TerrariaServer": { + "commandName": "Executable", + "executablePath": "dotnet", + "commandLineArgs": "$(tMLServerPath)", + "workingDirectory": "$(tMLSteamPath)" + } + } +} \ No newline at end of file diff --git a/UnCalamityModMusic.cs b/UnCalamityModMusic.cs index b17c977..c0ea237 100644 --- a/UnCalamityModMusic.cs +++ b/UnCalamityModMusic.cs @@ -12,7 +12,9 @@ namespace UnCalamityModMusic { public static UnCalamityModMusic Instance; - internal static bool calamityMod; + public const string CalamityWikiURL = "https://calamitymod.wiki.gg/wiki/{}"; + + internal static bool calamityMod; internal static bool calamityModMusic; internal static bool catalystMod; internal static bool calamityVanities; @@ -22,10 +24,10 @@ namespace UnCalamityModMusic internal static bool magicStorage; internal static bool wikiThis; - public override void Load() - { - Instance = this; + public UnCalamityModMusic() => Instance = this; + public override void Load() + { MusicPathing.InitalizeMusicPaths(Instance); calamityMod = ModLoader.TryGetMod("CalamityMod", out Mod calamity); @@ -57,7 +59,8 @@ namespace UnCalamityModMusic if (wikiThis) { - wiki.Call("AddModURL", this, "https://terrariamods.wiki.gg/wiki/Vanilla_Calamity_Mod_Music/{}"); + wiki.Call("AddModURL", this, CalamityWikiURL); + wiki.Call("AddWikiTexture", this, ModContent.Request("UnCalamityModMusic/WikiThisIcon")); } } } diff --git a/WikiThisIcon.png b/WikiThisIcon.png new file mode 100644 index 0000000..a136c7c Binary files /dev/null and b/WikiThisIcon.png differ diff --git a/build.txt b/build.txt index 1cda786..88cc2b0 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = apotofkoolaid and Heart Plus Up! -version = 1.11.4 +version = 2.0.0.001 displayName = Vanilla Calamity Mod Music weakReferences = CalamityMod, InfernumMode homepage = https://discord.gg/2jaEwNJm9e diff --git a/description_workshop.txt b/description_workshop.txt index 2fff9cf..c8fd355 100644 --- a/description_workshop.txt +++ b/description_workshop.txt @@ -1,12 +1,12 @@ [h1]Vanilla Calamity Mod Music[/h1] -[url=https://discord.gg/2jaEwNJm9e]Discord[/url] [url=https://terrariamods.wiki.gg/wiki/Vanilla_Calamity_Mod_Music]Official Wiki[/url] +[url=https://discord.gg/2jaEwNJm9e]Discord[/url] [url=https://calamitymod.wiki.gg]Official Wiki[/url] [b]Vanilla Calamity Music Mod (aka VCMM) is an in-progress music expansion for Calamity.[/b] It aims to replace the entire vanilla Terraria soundtrack with new songs made in the context of the Calamity soundtrack. It is intended to be used alongside the Calamity Mod, but can be used alone. -For Calamity game content, e.g. items and bosses, subscribe to the main mod: +[i]For Calamity game content, e.g. items and bosses, subscribe to the main mod:[/i] https://steamcommunity.com/sharedfiles/filedetails/?id=2824688072 -For the main Calamity soundtrack used for Calamity bosses, biomes and events, subscribe to the primary music mod: +[i]For the main Calamity soundtrack used for Calamity bosses, biomes and events, subscribe to the primary music mod:[/i] https://steamcommunity.com/sharedfiles/filedetails/?id=2824688266 [b]Be sure to join our music Discord server linked above to keep up with the latest news about upcoming updates and songs.[/b] @@ -24,6 +24,7 @@ Full list of tracks: [*] Heart Plus Up! - ~Metal, Wood, and Fire~ [*] Heart Plus Up! - Haven in the Sunlight [*] Heart Plus Up! - Moonlit Haven +[*] Heart Plus Up! - Haven in Overcast [*] Heart Plus Up! - Gelatin Showers [*] Heart Plus Up! - Gelatinous Monarch [*] Heart Plus Up! - Serenity @@ -35,7 +36,9 @@ Full list of tracks: [*] Heart Plus Up! ft. novaGnomes - Bloodshot Barrage [*] Heart Plus Up! - shoreline [*] Heart Plus Up! - serene tides +[*] Heart Plus Up! - waves [*] Heart Plus Up! - Psychedelic Depths +[*] Heart Plus Up! - Trial by Fire (split into two songs) [*] Heart Plus Up! - Starry Ascent [*] Heart Plus Up! - Descent Into Hell's Fury [*] Heart Plus Up! - ~The Sky and the Depths~ @@ -48,6 +51,7 @@ Full list of tracks: [*] Heart Plus Up! - The Abomination's Omen [*] Heart Plus Up! - Wrath From the Crypt [*] Heart Plus Up! - Chambers of the Tyrant +[*] Heart Plus Up! - Celebration Haven [*] Heart Plus Up! - Fated Insurrection [*] Salvati - The Resurrection of a Cruel World [*] Heart Plus Up! - ~Mythic Metals and Enchanted Fires~