diff --git a/BreakableWallRandomizer.cs b/BreakableWallRandomizer.cs index d5b7eac..e5f99bb 100644 --- a/BreakableWallRandomizer.cs +++ b/BreakableWallRandomizer.cs @@ -9,7 +9,7 @@ namespace BreakableWallRandomizer public class BreakableWallRandomizer : Mod, IGlobalSettings { new public string GetName() => "Breakable Wall Randomizer"; - public override string GetVersion() => "3.0.3.1"; + public override string GetVersion() => "3.0.4.0"; public BWR_Settings GS { get; set; } = new(); private static BreakableWallRandomizer _instance; public BreakableWallRandomizer() : base() @@ -33,7 +33,7 @@ public override void Initialize() BWR_Manager.Hook(); if (ModHooks.GetMod("FStatsMod") is Mod) - FStats_Interop.Hook(); + FStats_Interop.Hook(); if (ModHooks.GetMod("Randomizer 4") is Mod) { @@ -43,6 +43,37 @@ public override void Initialize() if (ModHooks.GetMod("RandoSettingsManager") is Mod) RSM_Interop.Hook(); } + + CondensedSpoilerLogger.AddCategory("Grub Walls", () => BWR_Manager.Settings.Enabled, + [ + "Dive_Floor-Basin_Grub", + "Wall-Catacombs_Grub", + "Wall-Crossroads_Grub", + "Wall-Deepnest_Mimics", + "Wall-Deepnest_Springs_Grub", + "Wall-Edge_Camp_Grub", + "Wall-Peak_Mimic", + "Wall-Waterways_Grub" + ] + ); + + CondensedSpoilerLogger.AddCategory("Access Walls", () => BWR_Manager.Settings.Enabled, + [ + "Dive_Floor-Flukemarm", + "Dive_Floor-Peak_Entrance", + "Plank-Colo_Shortcut", + "Plank-Edge_Tram_Exit", + "Plank-Hive_Exit", + "Plank-Nailsmith", + "Wall-Hidden_Station", + "Wall-Junk_Pit_Entrance", + "Wall-Lower_Hive_Entrance", + "Wall-Path_of_Pain_Entrance", + "Wall-Pleasure_House", + "Wall-Shade_Soul_Shortcut", + "Wall-Weaver's_Den_Entrance" + ] + ); Log("Initialized."); } public void OnLoadGlobal(BWR_Settings s) => GS = s; diff --git a/BreakableWallRandomizer.csproj b/BreakableWallRandomizer.csproj index 4c813b4..0faecbb 100644 --- a/BreakableWallRandomizer.csproj +++ b/BreakableWallRandomizer.csproj @@ -8,8 +8,8 @@ BreakableWallRandomizer A Randomizer add-on for wall and floor objects. Copyright ©2023 - 3.0.3.1 - 3.0.3.1 + 3.0.4.0 + 3.0.4.0 bin\$(Configuration)\ latest diff --git a/Interop/CondensedSpoilerLogger.cs b/Interop/CondensedSpoilerLogger.cs new file mode 100644 index 0000000..b3390f8 --- /dev/null +++ b/Interop/CondensedSpoilerLogger.cs @@ -0,0 +1,28 @@ +using MonoMod.ModInterop; +using System; +using System.Collections.Generic; + +namespace BreakableWallRandomizer.Interop; +internal static class CondensedSpoilerLogger +{ + [ModImportName("CondensedSpoilerLogger")] + private static class CondensedSpoilerLoggerImport + { + public static Action, List> AddCategorySafe = null; + } + + static CondensedSpoilerLogger() + { + typeof(CondensedSpoilerLoggerImport).ModInterop(); + } + + /// + /// Add a category to the condensed spoiler log. + /// + /// The title to give the category. + /// Return false to skip adding this category to the log. The category will automatically + /// be skipped if no items in the list are randomized. + /// A list of items to log in the category. + public static void AddCategory(string categoryName, Func test, List entries) + => CondensedSpoilerLoggerImport.AddCategorySafe?.Invoke(categoryName, test, entries); +} \ No newline at end of file diff --git a/Interop/FStats.cs b/Interop/FStats.cs index 655c799..2560d6d 100644 --- a/Interop/FStats.cs +++ b/Interop/FStats.cs @@ -4,6 +4,7 @@ using FStats; using FStats.StatControllers; using FStats.Util; +using ItemChanger; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -25,6 +26,7 @@ private static void GenerateStats(Action generateStats) if (!BWR_Manager.Settings.Enabled) return; + ItemChangerMod.Modules.GetOrAdd(); generateStats(new BreakableWallStats()); Assembly assembly = Assembly.GetExecutingAssembly(); @@ -46,6 +48,11 @@ public override void Initialize() BreakableWallModule.Instance.OnAchievedBreakableWall += AddMarks; } + public override void Unload() + { + BreakableWallModule.Instance.OnAchievedBreakableWall -= AddMarks; + } + private void AddMarks(List marks) { foreach (string mark in marks) diff --git a/Manager/ItemHandler.cs b/Manager/ItemHandler.cs index 925f050..d1ae77c 100644 --- a/Manager/ItemHandler.cs +++ b/Manager/ItemHandler.cs @@ -253,7 +253,7 @@ private static void AddWalls(RequestBuilder rb) if (wall.name.Contains("King's_Pass")) include = BWR_Manager.Settings.KingsPass; include = include && !(wall.exit && BWR_Manager.Settings.ExcludeWallsWhichMaySoftlockYou); - include = include && (!wall.name.Contains("Godhome") || !wall.name.Contains("Eternal_Ordeal") || BWR_Manager.Settings.GodhomeWalls); + include = include && (!(wall.name.Contains("Godhome") || wall.name.Contains("Eternal_Ordeal")) || BWR_Manager.Settings.GodhomeWalls); if (include) { diff --git a/Modules/BreakableWallModule.cs b/Modules/BreakableWallModule.cs index 7dbfcaa..5bab8df 100644 --- a/Modules/BreakableWallModule.cs +++ b/Modules/BreakableWallModule.cs @@ -21,6 +21,7 @@ public class BreakableWallModule : Module public List UnlockedDives = []; public override void Initialize() { + BreakableWallRandomizer.Instance.Log("BWR Module Init"); On.HutongGames.PlayMaker.Actions.ActivateGameObject.OnEnter += VanillaTracker; if (ItemChangerMod.Modules?.Get() is InventoryTracker it) it.OnGenerateFocusDesc += AddWallProgress; diff --git a/Resources/Data/BreakableWallObjects.json b/Resources/Data/BreakableWallObjects.json index 41ecf20..9c90a5f 100644 --- a/Resources/Data/BreakableWallObjects.json +++ b/Resources/Data/BreakableWallObjects.json @@ -705,7 +705,7 @@ "group": "", "logic": "Deepnest_39[door1] | (Deepnest_39[left1] | Deepnest_39[top1] | Deepnest_39[right1] + (FULLCLAW | WINGS + ANYCLAW | ENEMYPOGOS + (ANYCLAW | WINGS))) + ((LANTERN | (NOLANTERN ? FALSE)) | DARKROOMS) + (RIGHTDASH | WINGS | RIGHTCLAW + (RIGHTSUPERDASH | SPELLAIRSTALL + $CASTSPELL[1,1,before:ROOMSOUL,after:ROOMSOUL]))", "logicOverrides": { - "Deepnest_39[door1]": "(ORIG) + Wall-Weaver's_Den_Entrance" + "Deepnest_39[door1]": "Deepnest_39[door1] | (ORIG) + Wall-Weaver's_Den_Entrance" }, "logicSubstitutions": { "Deepnest_39": { @@ -1030,6 +1030,9 @@ }, "Deepnest_East_02": { "Deepnest_East_02[right1]": "Deepnest_East_02[right1] + Plank-Edge_Tram_Exit" + }, + "Soul_Totem-Lower_Kingdom's_Edge_2": { + "Deepnest_East_02[right1]": "Deepnest_East_02[right1] + Plank-Edge_Tram_Exit" } } }, diff --git a/Resources/Logic/ConnectionOverrides.json b/Resources/Logic/ConnectionOverrides.json index 11aa4e9..00e5863 100644 --- a/Resources/Logic/ConnectionOverrides.json +++ b/Resources/Logic/ConnectionOverrides.json @@ -1,4 +1,11 @@ [ + { + "name": "Bathhouse-Hot_Spring", + "logicOverride": "", + "logicSubstitutions": { + "Ruins_Bathhouse[right1]": "Ruins_Bathhouse[right1] + Wall-Pleasure_House" + } + }, { "name": "Chandelier-Watcher_Knights", "logicOverride": "ORIG + Wall-Chandelier", @@ -11,6 +18,13 @@ "RestingGrounds_10": "(RestingGrounds_10 | RestingGrounds_10[left1] + Plank-Catacombs_Elevator | RestingGrounds_10[top1] | RestingGrounds_10[top2] + Wall-Catacombs_Grey_Mourner)" } }, + { + "name": "Ghost_Essence-Marissa", + "logicOverride": "", + "logicSubstitutions": { + "Ruins_Bathhouse[right1]": "Ruins_Bathhouse[right1] + Wall-Pleasure_House" + } + }, { "name": "Gorb_Grave", "logicOverride": "", @@ -49,6 +63,13 @@ "logicOverride": "Ruins1_32[right2] | (ORIG) + Dive_Floor-Inner_Sanctum_2 + (Dive_Floor-Inner_Sanctum_Grub + Dive_Floor-Inner_Sanctum_Bottom | Dive_Floor-Inner_Sanctum_Seal + Dive_Floor-Inner_Sanctum_Lever + Lever-Sanctum_West_Lower)", "logicSubstitutions": {} }, + { + "name": "Marissa", + "logicOverride": "", + "logicSubstitutions": { + "Ruins_Bathhouse[right1]": "Ruins_Bathhouse[right1] + Wall-Pleasure_House" + } + }, { "name": "Mr_Mushroom-Kingdom's_Edge", "logicOverride": "",