diff --git a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs index 9273f72..9833fca 100644 --- a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs +++ b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs @@ -58,37 +58,40 @@ namespace ScarletMansion.DunGenPatch { } - public static void UpdateDunGenExtenderProperties(DunGenExtenderProperties props) { - props.MainPathCount = PluginConfig.Instance.mainPathCountValue; + public static void UpdateDunGenExtenderProperties(DunGenExtenderProperties props, EventCallbackScenario callback) { + if (callback.IsDevDebug) return; - props.DungeonSizeBase = new Vector3(PluginConfig.Instance.dunGenWidthBaseValue, props.DungeonSizeBase.y, PluginConfig.Instance.dunGenLengthBaseValue); - props.DungeonSizeFactor = new Vector3(PluginConfig.Instance.dunGenWidthMultiFactorValue, props.DungeonSizeFactor.y, PluginConfig.Instance.dunGenLengthMultiFactorValue); + props.MainPathProperties.MainPathCount = PluginConfig.Instance.mainPathCountValue; - props.UseBranchLoopBoost = PluginConfig.Instance.branchLoopBoostValue; - props.BranchLoopBoostTileSearch = PluginConfig.Instance.branchLoopBoostTileSearchValue; + props.DungeonBoundsProperties.SizeBase = new Vector3(PluginConfig.Instance.dunGenWidthBaseValue, props.DungeonBoundsProperties.SizeBase.y, PluginConfig.Instance.dunGenLengthBaseValue); + props.DungeonBoundsProperties.SizeFactor = new Vector3(PluginConfig.Instance.dunGenWidthMultiFactorValue, props.DungeonBoundsProperties.SizeFactor.y, PluginConfig.Instance.dunGenLengthMultiFactorValue); + + props.BranchPathMultiSimulationProperties.UseBranchPathMultiSim = PluginConfig.Instance.branchMultiSimValue; + props.BranchPathMultiSimulationProperties.SimulationCount = PluginConfig.Instance.branchSimCountValue; var i = 0; while(i < 3) { - PluginConfig.Instance.branchPathSectionOneValue.UpdateValues(props.LineRandomizerArchetypes[i]); + PluginConfig.Instance.branchPathSectionOneValue.UpdateValues(props.LineRandomizerProperties.Archetypes[i]); ++i; } while(i < 7) { - PluginConfig.Instance.branchPathSectionTwoValue.UpdateValues(props.LineRandomizerArchetypes[i]); + PluginConfig.Instance.branchPathSectionTwoValue.UpdateValues(props.LineRandomizerProperties.Archetypes[i]); ++i; } while(i < 10) { - PluginConfig.Instance.branchPathSectionThreeValue.UpdateValues(props.LineRandomizerArchetypes[i]); + PluginConfig.Instance.branchPathSectionThreeValue.UpdateValues(props.LineRandomizerProperties.Archetypes[i]); ++i; } var count = PluginConfig.Instance.treasureRoomCountValue; - props.UseForcedTiles = count > 0; + props.ForcedTilesProperties.UseForcedTiles = count > 0; - var copyTarget = props.ForcedTileSets[0]; - props.ForcedTileSets = new List(); - for(var j = 0; j < count; ++j) props.ForcedTileSets.Add(copyTarget); + var forcedTilesProperties = props.ForcedTilesProperties; + var copyTarget = forcedTilesProperties.ForcedTileSets[0]; + forcedTilesProperties.ForcedTileSets = new List(); + for(var j = 0; j < count; ++j) forcedTilesProperties.ForcedTileSets.Add(copyTarget); } } diff --git a/ScarletMansion/ScarletMansion/Plugin.cs b/ScarletMansion/ScarletMansion/Plugin.cs index 1bd62d0..7350507 100644 --- a/ScarletMansion/ScarletMansion/Plugin.cs +++ b/ScarletMansion/ScarletMansion/Plugin.cs @@ -23,7 +23,7 @@ namespace ScarletMansion { [BepInDependency("imabatby.lethallevelloader", "1.2.0.3")] [BepInDependency("evaisa.lethallib", "0.13.2")] - [BepInDependency("dev.ladyalice.dungenplus", "1.0.5")] + [BepInDependency("dev.ladyalice.dungenplus", "1.1.0")] //[BepInDependency(ModCompability.advancedCompanyGuid, BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency(ModCompability.lethalConfigGuid, BepInDependency.DependencyFlags.SoftDependency)] @@ -34,7 +34,7 @@ namespace ScarletMansion { public class Plugin : BaseUnityPlugin { public const string modGUID = "dev.ladyalice.scarletmansion"; private const string modName = "Scarlet Mansion"; - private const string modVersion = "1.3.25"; + private const string modVersion = "1.3.26"; public readonly Harmony harmony = new Harmony(modGUID); diff --git a/ScarletMansion/ScarletMansion/PluginConfig.cs b/ScarletMansion/ScarletMansion/PluginConfig.cs index 81da950..b88e66a 100644 --- a/ScarletMansion/ScarletMansion/PluginConfig.cs +++ b/ScarletMansion/ScarletMansion/PluginConfig.cs @@ -182,24 +182,24 @@ namespace ScarletMansion { public IntRange mainPathLengthValue = new IntRange("main path length"); // branching path - public static ConfigEntryBundle branchLoopBoost = new ConfigEntryBundle( + public static ConfigEntryBundle branchMultiSim = new ConfigEntryBundle( dungeonGenerationBPathPrefix, - "Use Branch Loop Prioritization", + "Use Branch Path Multi Sim", true, - "If enabled, the dungeon generation will prioritize branch tiles that connect to already generated tiles.\nThis increases the chance of circular/looping paths. Slows dungeon generation times a bit at the end.", + "If enabled, the dungeon generation will prioritize branch paths that connect to already generated tiles.\nThis increases the chance of circular/looping paths. Slows dungeon generation times a bit at the end.", null ); - public static ConfigEntryBundle branchLoopBoostTileSearch = new ConfigEntryBundle( + public static ConfigEntryBundle branchSimCount = new ConfigEntryBundle( dungeonGenerationBPathPrefix, - "Tile Search Count", - 10, - "The maximum number of valid branch tiles that the dungeon generation will consider before choosing the best tile.\nIncreasing this value gives the dungeon generation a higher chance of finding a good tile but impacts dungeon generation times. Decreasing this value gives the dungeon generation a lower chance of finding a good tile but also lessens the impact to dungeon generation times.", + "Branch Path Simlation Count", + 5, + "The maximum number of valid branch paths that the dungeon generation will simulate before choosing the best path.\nIncreasing this value gives the dungeon generation a higher chance of finding a good path but impacts dungeon generation times and vice versa.", null, - new AcceptableValueRange(1, 20) + new AcceptableValueRange(1, 10) ); - public bool branchLoopBoostValue; - public int branchLoopBoostTileSearchValue; + public bool branchMultiSimValue; + public int branchSimCountValue; // branching path mini sections private static string _branchPathBranchCountMessage(int section, string minmax, string middleSection) => $"The {minmax} amount of branching paths in Section {section} of the dungeon generation process.\n{middleSection}\n\n{_branchPathPostCountMessage}";