From fd731baf2febfbfa7bbcc9fe536eade672f6c7bf Mon Sep 17 00:00:00 2001 From: LadyAliceMargatroid Date: Sun, 15 Dec 2024 09:23:53 -0800 Subject: [PATCH] Added configs for items and enemies Critical damage renamed to marked for death and all share the same mechanic now Revelant now slows down to speed over a fixed short amount instead the nonworking jank before Moved item/enemy injection to DunGenPlus --- .../ScarletMansionCoronerPatch.sln | 0 .../ScarletMansionCoronerPatch/Patch.cs | 0 .../ScarletMansionCoronerPatch/Plugin.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../ScarletMansionCoronerPatch.csproj | 0 .../ScarletMansionMimicsPatch.sln | 0 .../ScarletMansionMimicsPatch/Patch.cs | 0 .../ScarletMansionMimicsPatch/Plugin.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../ScarletMansionMimicsPatch.csproj | 0 ScarletMansion/ScarletMansion/Assets.cs | 91 ++-- .../DunGenPatch/GeneratePathPatch.cs | 16 +- .../ScarletMansion/DunGenPatch/Patch.cs | 9 +- .../Components/ScarletPlayerControllerB.cs | 9 +- .../Components/ScarletYukariTrigger.cs | 8 +- .../GamePatch/Enemies/KnightGhostVariant.cs | 8 +- .../GamePatch/Enemies/KnightV2Variant.cs | 4 +- .../GamePatch/Enemies/MaidVariant.cs | 15 +- .../ScarletMansion/GamePatch/InitPatch.cs | 9 +- .../GamePatch/Items/FlandreCrystal.cs | 2 +- .../GamePatch/Items/ScarletKnife.cs | 9 +- .../GamePatch/LoadAssetsIntoLevelPatch.cs | 168 ++----- .../Managers/ScarletNetworkManager.cs | 17 +- ScarletMansion/ScarletMansion/Plugin.cs | 10 +- ScarletMansion/ScarletMansion/PluginConfig.cs | 436 ++++++++---------- .../ScarletMansion/PluginConfigClasses.cs | 198 +++++++- ScarletMansion/ScarletMansion/PresetConfig.cs | 10 +- ScarletMansion/ScarletMansion/Utility.cs | 2 +- .../ScarletMansionSeichiPatch.sln | 0 .../ScarletMansionSeichiPatch/Patch.cs | 0 .../ScarletMansionSeichiPatch/Plugin.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../ScarletMansionSeichiPatch.csproj | 0 33 files changed, 551 insertions(+), 470 deletions(-) rename {ScarletMansionCoronerPatch => CoronerPatch}/ScarletMansionCoronerPatch.sln (100%) rename {ScarletMansionCoronerPatch => CoronerPatch}/ScarletMansionCoronerPatch/Patch.cs (100%) rename {ScarletMansionCoronerPatch => CoronerPatch}/ScarletMansionCoronerPatch/Plugin.cs (100%) rename {ScarletMansionCoronerPatch => CoronerPatch}/ScarletMansionCoronerPatch/Properties/AssemblyInfo.cs (100%) rename {ScarletMansionCoronerPatch => CoronerPatch}/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.csproj (100%) rename {ScarletMansionMimicsPatch => MimicsPatch}/ScarletMansionMimicsPatch.sln (100%) rename {ScarletMansionMimicsPatch => MimicsPatch}/ScarletMansionMimicsPatch/Patch.cs (100%) rename {ScarletMansionMimicsPatch => MimicsPatch}/ScarletMansionMimicsPatch/Plugin.cs (100%) rename {ScarletMansionMimicsPatch => MimicsPatch}/ScarletMansionMimicsPatch/Properties/AssemblyInfo.cs (100%) rename {ScarletMansionMimicsPatch => MimicsPatch}/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.csproj (100%) rename {ScarletMansionSeichiPatch => SeichiPatch}/ScarletMansionSeichiPatch.sln (100%) rename {ScarletMansionSeichiPatch => SeichiPatch}/ScarletMansionSeichiPatch/Patch.cs (100%) rename {ScarletMansionSeichiPatch => SeichiPatch}/ScarletMansionSeichiPatch/Plugin.cs (100%) rename {ScarletMansionSeichiPatch => SeichiPatch}/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs (100%) rename {ScarletMansionSeichiPatch => SeichiPatch}/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj (100%) diff --git a/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.sln b/CoronerPatch/ScarletMansionCoronerPatch.sln similarity index 100% rename from ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.sln rename to CoronerPatch/ScarletMansionCoronerPatch.sln diff --git a/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Patch.cs b/CoronerPatch/ScarletMansionCoronerPatch/Patch.cs similarity index 100% rename from ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Patch.cs rename to CoronerPatch/ScarletMansionCoronerPatch/Patch.cs diff --git a/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Plugin.cs b/CoronerPatch/ScarletMansionCoronerPatch/Plugin.cs similarity index 100% rename from ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Plugin.cs rename to CoronerPatch/ScarletMansionCoronerPatch/Plugin.cs diff --git a/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Properties/AssemblyInfo.cs b/CoronerPatch/ScarletMansionCoronerPatch/Properties/AssemblyInfo.cs similarity index 100% rename from ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/Properties/AssemblyInfo.cs rename to CoronerPatch/ScarletMansionCoronerPatch/Properties/AssemblyInfo.cs diff --git a/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.csproj b/CoronerPatch/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.csproj similarity index 100% rename from ScarletMansionCoronerPatch/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.csproj rename to CoronerPatch/ScarletMansionCoronerPatch/ScarletMansionCoronerPatch.csproj diff --git a/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.sln b/MimicsPatch/ScarletMansionMimicsPatch.sln similarity index 100% rename from ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.sln rename to MimicsPatch/ScarletMansionMimicsPatch.sln diff --git a/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Patch.cs b/MimicsPatch/ScarletMansionMimicsPatch/Patch.cs similarity index 100% rename from ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Patch.cs rename to MimicsPatch/ScarletMansionMimicsPatch/Patch.cs diff --git a/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Plugin.cs b/MimicsPatch/ScarletMansionMimicsPatch/Plugin.cs similarity index 100% rename from ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Plugin.cs rename to MimicsPatch/ScarletMansionMimicsPatch/Plugin.cs diff --git a/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Properties/AssemblyInfo.cs b/MimicsPatch/ScarletMansionMimicsPatch/Properties/AssemblyInfo.cs similarity index 100% rename from ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/Properties/AssemblyInfo.cs rename to MimicsPatch/ScarletMansionMimicsPatch/Properties/AssemblyInfo.cs diff --git a/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.csproj b/MimicsPatch/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.csproj similarity index 100% rename from ScarletMansionMimicsPatch/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.csproj rename to MimicsPatch/ScarletMansionMimicsPatch/ScarletMansionMimicsPatch.csproj diff --git a/ScarletMansion/ScarletMansion/Assets.cs b/ScarletMansion/ScarletMansion/Assets.cs index b2174be..6a9c206 100644 --- a/ScarletMansion/ScarletMansion/Assets.cs +++ b/ScarletMansion/ScarletMansion/Assets.cs @@ -62,17 +62,18 @@ namespace ScarletMansion { public static Enemy maid; // item values - public class GlobalItem { public Item item; private int _itemId; - public GlobalItem(Item item) { + public Func configItemEntryFunc; + + public GlobalItem(Item item, Func configItemEntryFunc) { this.item = item; _itemId = -1; + this.configItemEntryFunc = configItemEntryFunc; } - public int itemId { get { // cache time @@ -92,22 +93,41 @@ namespace ScarletMansion { _itemId = value; } } + + public PluginConfig.Item GetConfigItemEntry(){ + return configItemEntryFunc(); + } } public class ScrapItem : GlobalItem { - public Func rarityFunc; + public bool SpawnsOnMap => configScrapItemEntryFunc != null; + + public Func configScrapItemEntryFunc; - public ScrapItem(Item item, Func func) : base (item){ - rarityFunc = func; + public ScrapItem(Item item, Func configScrapItemEntryFunc) : base (item, configScrapItemEntryFunc){ + this.configScrapItemEntryFunc = configScrapItemEntryFunc; + } + + public void UpdateItemValue(){ + if (SpawnsOnMap) { + var config = GetConfigScrapItemEntry(); + item.minValue = config.valueRange.min; + item.maxValue = config.valueRange.max; + } } public SpawnableItemWithRarity GetItemRarity(){ + var configEntry = GetConfigScrapItemEntry(); var item = new SpawnableItemWithRarity(); item.spawnableItem = this.item; - item.rarity = rarityFunc(); + item.rarity = configEntry != null ? configEntry.spawnWeight : 0; return item; } + public PluginConfig.ScrapItem GetConfigScrapItemEntry(){ + return configScrapItemEntryFunc(); + } + } public class Flashlight : GlobalItem { @@ -118,12 +138,17 @@ namespace ScarletMansion { public int lethalHelmetIndex = -1; public int scarletHelmetIndex = -1; - public Flashlight(string baseName, int lethalHelmetIndex) : base(null) { + public Flashlight(string baseName, int lethalHelmetIndex, Func configEntryFunc) : base(null, configEntryFunc) { assetName = $"Scarlet{baseName}"; displayName = $"D. {baseName}"; this.lethalHelmetIndex = lethalHelmetIndex; } + public bool ContainsItemCheckConfig(Item compareItem){ + if (!GetConfigItemEntry().enabled) return false; + return ContainsItem(compareItem); + } + public bool ContainsItem(Item compareItem) { return compareItem == item || compareItem == lethalVanillaItem; } @@ -132,19 +157,17 @@ namespace ScarletMansion { public static List globalItems; public static List scrapItems; - public static Dictionary> itemRarityTable = new Dictionary>(){ - { "Deco. crystal", () => PluginConfig.Instance.crystalWeightValue }, - { "Shattered deco. crystal", () => PluginConfig.Instance.crystalBrokenWeightValue }, - { "Demonic painting", () => 0 }, - { "Maid's knife", () => 0 }, - { "Doll Snow Globe", () => PluginConfig.Instance.snowGlobeWeightValue } + public static Dictionary> itemConfigTable = new Dictionary>(){ + { "Deco. crystal", () => PluginConfig.Instance.crystalValue }, + { "Shattered deco. crystal", () => PluginConfig.Instance.crystalBrokenValue }, + { "Doll Snow Globe", () => PluginConfig.Instance.snowGlobeValue } }; + public static GlobalItem key; public static Flashlight flashlight; public static Flashlight flashlightBB; - public static GlobalItem key; - + public static GlobalItem GetGlobalItem(Item item){ return globalItems.FirstOrDefault(x => x.item == item); } @@ -155,6 +178,12 @@ namespace ScarletMansion { return null; } + public static Flashlight GetFlashlightCheckConfig(Item item){ + if (flashlight.ContainsItemCheckConfig(item)) return flashlight; + if (flashlightBB.ContainsItemCheckConfig(item)) return flashlightBB; + return null; + } + // game references public static ItemGroup genericItemGroup; @@ -207,16 +236,10 @@ namespace ScarletMansion { globalItems = new List(); scrapItems = new List(); - foreach(var i in networkObjectList.items){ - var entry = new GlobalItem(i); - globalItems.Add(entry); - - Items.RegisterItem(i); - Plugin.logger.LogDebug($"Global Item {i.itemName} registered"); - } foreach(var i in networkObjectList.scrapItems) { - var entry = new ScrapItem(i, GetItemRarityFunction(i)); + var function = GetItemConfigFunction(i); + var entry = new ScrapItem(i, function); scrapItems.Add(entry); globalItems.Add(entry); @@ -225,9 +248,12 @@ namespace ScarletMansion { Plugin.logger.LogDebug($"Scrap Item {i.itemName} registered"); } - flashlight = new Flashlight("Pro Flashlight", 0); - flashlightBB = new Flashlight("Flashlight", 1); - key = new GlobalItem(networkObjectList.items[0]); + key = new GlobalItem(networkObjectList.items[0], () => PluginConfig.Instance.scarletKeyValue); + globalItems.Add(key); + Items.RegisterItem(key.item); + + flashlight = new Flashlight("Pro Flashlight", 0, () => PluginConfig.Instance.decoProFlashlightValue); + flashlightBB = new Flashlight("Flashlight", 1, () => PluginConfig.Instance.decoFlashlightValue); globalItems.Add(flashlight); globalItems.Add(flashlightBB); @@ -239,15 +265,12 @@ namespace ScarletMansion { onAssetsLoadEvent.Call(); } - public static Func GetItemRarityFunction(Item item){ + public static Func GetItemConfigFunction(Item item){ var name = item.itemName; - - if (itemRarityTable.ContainsKey(name)){ - return itemRarityTable[name]; + if (itemConfigTable.TryGetValue(name, out var result)){ + return result; } - - Plugin.logger.LogError($"Could not find rarity function for {name}. Setting to default value 10"); - return () => 10; + return null; } diff --git a/ScarletMansion/ScarletMansion/DunGenPatch/GeneratePathPatch.cs b/ScarletMansion/ScarletMansion/DunGenPatch/GeneratePathPatch.cs index bf6188a..3f672fc 100644 --- a/ScarletMansion/ScarletMansion/DunGenPatch/GeneratePathPatch.cs +++ b/ScarletMansion/ScarletMansion/DunGenPatch/GeneratePathPatch.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using HarmonyLib; -using GameNetcodeStuff; -using System.Reflection; -using System.Reflection.Emit; -using BepInEx.Logging; -using UnityEngine; -using System.Collections; -using DunGen; -using LethalLevelLoader; -using DunGen.Graph; +using HarmonyLib; namespace ScarletMansion.DunGenPatch { diff --git a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs index 176e350..0144e34 100644 --- a/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs +++ b/ScarletMansion/ScarletMansion/DunGenPatch/Patch.cs @@ -42,8 +42,6 @@ namespace ScarletMansion.DunGenPatch { var mainPathLength = generator.DungeonFlow.Length; Plugin.logger.LogDebug($"Length of main path be: {GetLength(mainPathLength, scale)}"); - - GamePatch.LoadAssetsIntoLevelPatch.ModifyLevel(StartOfRound.Instance.currentLevel); } public static string GetLength(IntRange range, float multi){ @@ -62,12 +60,9 @@ namespace ScarletMansion.DunGenPatch { var localPlayer = StartOfRound.Instance.localPlayerController; var scarletPlayer = ScarletPlayerControllerB.GetScarletPlayerScript(localPlayer); if (scarletPlayer != null){ - scarletPlayer.stabbedSelf = false; - scarletPlayer.fellInPit = false; + scarletPlayer.markedForDeath = false; } - - - + } public static void UpdateDunGenExtenderProperties(DunGenExtenderProperties props, EventCallbackScenario callback) { diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletPlayerControllerB.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletPlayerControllerB.cs index f418497..e08eadd 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletPlayerControllerB.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletPlayerControllerB.cs @@ -11,15 +11,8 @@ namespace ScarletMansion.GamePatch.Components { public static Dictionary playerControllers; - // self public PlayerControllerB player; - - // animation - //public AnimatorOverrideController playerOverrideController; - - // second-chance states - public bool stabbedSelf; - public bool fellInPit; + public bool markedForDeath; public static ScarletPlayerControllerB GetScarletPlayerScript(PlayerControllerB player) { if (!playerControllers.TryGetValue(player, out var scarlet)) { diff --git a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletYukariTrigger.cs b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletYukariTrigger.cs index 3a65292..1d3c31a 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletYukariTrigger.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Components/ScarletYukariTrigger.cs @@ -37,14 +37,14 @@ namespace ScarletMansion.GamePatch.Components // teleporting them out for a second time in life // won't be easy though kek var scarletPlayer = ScarletPlayerControllerB.GetScarletPlayerScript(playerControllerB); - if (scarletPlayer != null && !scarletPlayer.fellInPit && !playerControllerB.criticallyInjured) { + if (scarletPlayer != null && !scarletPlayer.markedForDeath && !playerControllerB.criticallyInjured) { var selfPos = scarletPlayer.transform.position; var farthestAINode = RoundManager.Instance.insideAINodes .Select(n => n.transform.position) .OrderByDescending(n => (selfPos - n).magnitude).FirstOrDefault(); playerControllerB.TeleportPlayer(farthestAINode); - var damage = ScarletNetworkManagerUtility.GetCriticalDamageToPlayer(playerControllerB, false); + var damage = ScarletNetworkManagerUtility.GetMarkedDamageToPlayer(playerControllerB); playerControllerB.DamagePlayer(damage, false, true, CauseOfDeath.Suffocation); if (playerControllerB.isPlayerDead) { @@ -54,7 +54,9 @@ namespace ScarletMansion.GamePatch.Components StopSinkingLocalPlayer(playerControllerB); ScarletNetworkManager.Instance.CreateSpawnAudioPrefab(farthestAINode, playerControllerB.actualClientId); - scarletPlayer.fellInPit = true; + ScarletNetworkManagerUtility.MarkPlayerForDeath(playerControllerB); + + scarletPlayer.markedForDeath = true; } // just straight up murder else { diff --git a/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightGhostVariant.cs b/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightGhostVariant.cs index 797ce72..c536f6b 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightGhostVariant.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightGhostVariant.cs @@ -26,6 +26,8 @@ namespace ScarletMansion { public override void Start(){ base.Start(); + maxChaseSpeed = PluginConfig.Instance.revEnemyValue.speed; + if (IsOwner && KnightSpawnManager.Instance) { var index = KnightSpawnManager.Instance.GetSpawnPointIndex(); if (index == -1) return; @@ -66,7 +68,7 @@ namespace ScarletMansion { var trueSpeed = currentBehaviourStateIndex == 0 ? maxChaseSpeed : slowChaseSpeed; if (IsOwner) { - agent.speed = Mathf.MoveTowards(agent.speed, trueSpeed, 4.5f * Time.deltaTime); + agent.speed = Mathf.MoveTowards(agent.speed, trueSpeed, (maxChaseSpeed - slowChaseSpeed) * 4f * Time.deltaTime); } currentAnimSpeed = Mathf.Lerp(currentAnimSpeed, trueSpeed * 0.4597f, 4f * Time.deltaTime); @@ -78,10 +80,12 @@ namespace ScarletMansion { var playerControllerB = MeetsStandardPlayerCollisionConditions(other, false, false); if (playerControllerB != null && playerControllerB.IsOwner && playerControllerB == targetPlayer) { - var damage = ScarletNetworkManagerUtility.GetCriticalDamageToPlayer(playerControllerB, false); + var damage = ScarletNetworkManagerUtility.GetMarkedDamageToPlayer(playerControllerB); playerControllerB.DamagePlayer(damage, true, true, CauseOfDeath.Mauling, 1, false, default(Vector3)); playerControllerB.JumpToFearLevel(1f, true); + ScarletNetworkManagerUtility.MarkPlayerForDeath(playerControllerB); + if (playerControllerB.isPlayerDead) { Assets.onPlayerDeath.Call(new ModPatch.CoronerParameters(playerControllerB, ModPatch.CoronerDeathEnum.GhostKnight)); } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightV2Variant.cs b/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightV2Variant.cs index 3c95243..90e5269 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightV2Variant.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Enemies/KnightV2Variant.cs @@ -20,7 +20,7 @@ namespace ScarletMansion.GamePatch.Enemies { private bool hasStopped; public AnimationStopPoints animStopPoints; - private float currentChaseSpeed = 14.5f * 0.9f; + private float currentChaseSpeed = 13f; private float currentAnimSpeed = 1f; private PlayerControllerB previousTarget; private bool wasOwnerLastFrame; @@ -51,6 +51,8 @@ namespace ScarletMansion.GamePatch.Enemies { public override void Start(){ base.Start(); + currentChaseSpeed = PluginConfig.Instance.knightEnemyValue.speed; + if (IsOwner && KnightSpawnManager.Instance) { var index = KnightSpawnManager.Instance.GetSpawnPointIndex(); if (index == -1) return; diff --git a/ScarletMansion/ScarletMansion/GamePatch/Enemies/MaidVariant.cs b/ScarletMansion/ScarletMansion/GamePatch/Enemies/MaidVariant.cs index 8b15a7e..7c32737 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Enemies/MaidVariant.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Enemies/MaidVariant.cs @@ -92,6 +92,8 @@ namespace ScarletMansion.GamePatch.Enemies { // Token: 0x040000EA RID: 234 public float idleMovementSpeedBase = 3.5f; + public float chaseMovementSpeedBase = 5.5f; + // Token: 0x040000EB RID: 235 public float timeSinceChangingItem; @@ -244,6 +246,9 @@ namespace ScarletMansion.GamePatch.Enemies { MaidVariant.murderMusicAudio = chaseMusic; } + enemyHP = PluginConfig.Instance.maidEnemyValue.health; + chaseMovementSpeedBase = PluginConfig.Instance.maidEnemyValue.speed; + if (StartOfRound.Instance.connectedPlayersAmount == 0){ enemyHP = 2; idleMovementSpeedBase *= 0.75f; @@ -267,9 +272,11 @@ namespace ScarletMansion.GamePatch.Enemies { knifeRender.SetActive(false); if (IsServer) { - var enemy = ScarletNetworkManagerUtility.CreateEnemyWithType(knightGhostEnemy, transform.position, 0f); - enemy.FindAndTunnelPlayer(transform.position); - + if (PluginConfig.Instance.revEnemyValue.enabled){ + var enemy = ScarletNetworkManagerUtility.CreateEnemyWithType(knightGhostEnemy, transform.position, 0f); + enemy.FindAndTunnelPlayer(transform.position); + } + var newKnife = Object.Instantiate(knifePrefab, base.transform.position + Vector3.up * 0.5f, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); newKnife.GetComponent().Spawn(); newKnife.GetComponent().LinkKnifeToMaidServerRpc(this); @@ -367,7 +374,7 @@ namespace ScarletMansion.GamePatch.Enemies { return; } - agent.speed = 5.5f; + agent.speed = chaseMovementSpeedBase; isRunning = true; // lost player in chase diff --git a/ScarletMansion/ScarletMansion/GamePatch/InitPatch.cs b/ScarletMansion/ScarletMansion/GamePatch/InitPatch.cs index 5113d39..d13a5d5 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/InitPatch.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/InitPatch.cs @@ -289,9 +289,6 @@ namespace ScarletMansion.GamePatch { return n; }).ToArray(); scarletPrefab.GetComponent().sharedMaterials = mats; - - - Assets.dungeonExtended.OverrideKeyPrefab = scarletPrefab; } } catch (Exception e) { @@ -384,6 +381,12 @@ namespace ScarletMansion.GamePatch { PluginConfig.Instance.paintingCountValue ); + foreach(var scrap in Assets.scrapItems){ + scrap.UpdateItemValue(); + } + + Assets.dungeonExtended.OverrideKeyPrefab = Assets.key.GetConfigItemEntry().enabled ? Assets.key.item.spawnPrefab : typeof(DungeonLoader).GetField("defaultKeyPrefab", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null) as GameObject; + Plugin.logger.LogDebug("Set networked config values"); } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Items/FlandreCrystal.cs b/ScarletMansion/ScarletMansion/GamePatch/Items/FlandreCrystal.cs index 20828c3..f917cc8 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Items/FlandreCrystal.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Items/FlandreCrystal.cs @@ -97,7 +97,7 @@ namespace ScarletMansion.GamePatch.Items { var items = playerHeldBy.ItemSlots; for(var i = 0; i < items.Length; ++i){ var item = items[i] as FlashlightItem; - if (item != null && Assets.GetFlashlight(item.itemProperties) != null) { + if (item != null && Assets.GetFlashlightCheckConfig(item.itemProperties) != null) { Plugin.logger.LogDebug($"Flashlight slot {i}"); return (item, i); } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletKnife.cs b/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletKnife.cs index c9407c5..1d21451 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletKnife.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Items/ScarletKnife.cs @@ -176,12 +176,9 @@ namespace ScarletMansion.GamePatch.Items } public int GetDamageToPlayer(PlayerControllerB player) { - var scarletPlayer = ScarletPlayerControllerB.GetScarletPlayerScript(player); - if (scarletPlayer == null) return 95; - - var forceKill = scarletPlayer.stabbedSelf; - scarletPlayer.stabbedSelf = true; - return ScarletNetworkManagerUtility.GetCriticalDamageToPlayer(player, forceKill); + var damage = ScarletNetworkManagerUtility.GetMarkedDamageToPlayer(player); + ScarletNetworkManagerUtility.MarkPlayerForDeath(player); + return damage; } [ServerRpc] diff --git a/ScarletMansion/ScarletMansion/GamePatch/LoadAssetsIntoLevelPatch.cs b/ScarletMansion/ScarletMansion/GamePatch/LoadAssetsIntoLevelPatch.cs index 4cca40e..53ffe48 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/LoadAssetsIntoLevelPatch.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/LoadAssetsIntoLevelPatch.cs @@ -4,169 +4,83 @@ using System.Linq; using UnityEngine; using System.Reflection.Emit; using System.Reflection; +using DunGenPlus.Managers; +using ScarletMansion.GamePatch.Components; namespace ScarletMansion.GamePatch { public class LoadAssetsIntoLevelPatch { - // alright new strat - // at the start, we create an alternate enemy (and item) list - // we highjack the enemy (and item) list variable where ever it is called (base game or advanced company) - // if the highjacked list matches the one we created, which it should (and we grab from advanced company too if needed) - // then we replace - - public static InjectionDictionary enemiesInjection = new InjectionDictionary( - "Enemies", - typeof(LoadAssetsIntoLevelPatch).GetMethod("GetEnemies", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public), - new CodeInstruction(OpCodes.Ldfld, typeof(SelectableLevel).GetField("Enemies")) - ); - - - public static InjectionDictionary itemsInjection = new InjectionDictionary( - "Items", - typeof(LoadAssetsIntoLevelPatch).GetMethod("GetItems", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public), - new CodeInstruction(OpCodes.Ldfld, typeof(SelectableLevel).GetField("spawnableScrap")) - ); - - - [HarmonyTranspiler] - [HarmonyPatch(typeof(EnemyVent), "SyncVentSpawnTimeClientRpc")] - public static IEnumerable SyncVentSpawnTimeClientRpcPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "SyncVentSpawnTimeClientRpc", 1); + public static void AddItemsLocal(RoundManager roundManager){ + foreach(var item in Assets.scrapItems){ + if (item.SpawnsOnMap) { + var config = item.GetConfigScrapItemEntry(); + if (config.enabled && config.spawnWeight > 0 && !config.spawnOnAllMoons) { + var entry = item.GetItemRarity(); + ScrapItemManager.AddItem(entry); + } + } + } } - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "AssignRandomEnemyToVent")] - public static IEnumerable AssignRandomEnemyToVentPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "AssignRandomEnemyToVent", 10); + public static void AddItemsGlobal(RoundManager roundManager){ + foreach(var item in Assets.scrapItems){ + if (item.SpawnsOnMap) { + var config = item.GetConfigScrapItemEntry(); + if (config.enabled && config.spawnWeight > 0 && config.spawnOnAllMoons) { + var entry = item.GetItemRarity(); + ScrapItemManager.AddItem(entry); + } + } + } } - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "EnemyCannotBeSpawned")] - public static IEnumerable EnemyCannotBeSpawnedPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "EnemyCannotBeSpawned", 4); - } + public static void AddEnemiesLocal(RoundManager roundManager) { - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "ResetEnemyTypesSpawnedCounts")] - public static IEnumerable ResetEnemyTypesSpawnedCountsPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "ResetEnemyTypesSpawnedCounts", 4); - } + var currentEnemies = roundManager.currentLevel.Enemies; - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "SetChallengeFileRandomModifiers")] - public static IEnumerable SetChallengeFileRandomModifiersPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "SetChallengeFileRandomModifiersEnemy", 3); - } + void AddEnemy(Assets.Enemy enemy, string sourceEnemyName, string targetEnemyName, PluginConfig.SpawnableEnemy enemyConfig) { + const int minBaseWeight = 10; - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "SpawnEnemyGameObject")] - public static IEnumerable SpawnEnemyGameObjectPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, enemiesInjection, "SpawnEnemyGameObject", 3); - } + if (!enemyConfig.enabled) { + Plugin.logger.LogDebug($"{sourceEnemyName} is disblaed. Not loading onto moon."); + return; + } - - - [HarmonyTranspiler] - [HarmonyPatch(typeof(GiftBoxItem), "Start")] - public static IEnumerable GiftBoxItemStartPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, itemsInjection, "GiftBoxItem", 5); - } - - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "SetChallengeFileRandomModifiers")] - public static IEnumerable SetChallengeFileRandomModifiersItemPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, itemsInjection, "SetChallengeFileRandomModifiersItem", 1); - } - - [HarmonyTranspiler] - [HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")] - public static IEnumerable SpawnScrapInLevelPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, itemsInjection, "SpawnScrapInLevel", 4); - } - - [HarmonyTranspiler] - [HarmonyPatch(typeof(DunGenPlus.Patches.RoundManagerPatch), "waitForScrapToSpawnToSyncPatch")] - public static IEnumerable waitForScrapToSpawnToSyncPatch(IEnumerable instructions){ - return TranspilerUtilities.InjectMethod(instructions, itemsInjection, "waitForScrapToSpawnToSyncPatch", 1); - } - - - public static List lastEnemiesRarity; - public static List currentEnemiesRarity; - - public static List lastItemsRarity; - public static List currentItemsRarity; - - public static void ModifyLevel(SelectableLevel level){ - - lastEnemiesRarity = level.Enemies; - lastItemsRarity = level.spawnableScrap; - - currentEnemiesRarity = lastEnemiesRarity.ToList(); - currentItemsRarity = lastItemsRarity.ToList(); - - void AddEnemy(Assets.Enemy enemy, string sourceEnemyName, string targetEnemyName, int baseWeight, int minBaseWeight, float weightStealPercentage) { if (enemy != null) { - var target = currentEnemiesRarity + var target = currentEnemies .Where(c => c.enemyType.name.ToLowerInvariant() == targetEnemyName) .FirstOrDefault(); if (target == null){ Plugin.logger.LogDebug($"No enemy {targetEnemyName} in level, using default rarity of {minBaseWeight}."); - var entry = enemy.GetItemEntry(baseWeight + minBaseWeight); - Plugin.logger.LogDebug($"Adding enemy {sourceEnemyName} with weight {entry.rarity}"); - currentEnemiesRarity.Add(entry); + var entry = enemy.GetItemEntry(enemyConfig.spawnWeightBase + minBaseWeight); + EnemyManager.AddEnemy(entry); } else { - currentEnemiesRarity.Remove(target); - var entryRarity = Mathf.RoundToInt(target.rarity * weightStealPercentage); + Plugin.logger.LogError($"{sourceEnemyName}: {enemyConfig.spawnWeightStealPercentage}"); + var entryRarity = Mathf.RoundToInt(target.rarity * enemyConfig.spawnWeightStealPercentage); var prevEntry = new SpawnableEnemyWithRarity(); prevEntry.enemyType = target.enemyType; prevEntry.rarity = target.rarity - entryRarity; - var newEntry = enemy.GetItemEntry(baseWeight + entryRarity); + var newEntry = enemy.GetItemEntry(enemyConfig.spawnWeightBase + entryRarity); - Plugin.logger.LogDebug($"Adding enemy {sourceEnemyName} with weight {newEntry.rarity}"); - Plugin.logger.LogDebug($"Setting enemy {targetEnemyName} with weight {prevEntry.rarity}"); - currentEnemiesRarity.Add(newEntry); - currentEnemiesRarity.Add(prevEntry); + EnemyManager.AddEnemy(newEntry); + EnemyManager.AddEnemy(prevEntry); } } else { Plugin.logger.LogError($"Failed to load custom enemy {sourceEnemyName} as their reference is missing"); } } - AddEnemy(Assets.knight, "knight", "springman", PluginConfig.Instance.knightWeightBaseValue, 10, PluginConfig.Instance.knightWeightStealPercentageValue); - AddEnemy(Assets.maid, "maid", "butler", PluginConfig.Instance.maidWeightBaseValue, 10, PluginConfig.Instance.maidWeightStealPercentageValue); - - foreach(var i in Assets.scrapItems){ - var entry = i.GetItemRarity(); - - if (entry.rarity > 0) { - Plugin.logger.LogDebug($"Adding item {entry.spawnableItem.itemName} with weight {entry.rarity}"); - currentItemsRarity.Add(entry); - } - } - + AddEnemy(Assets.knight, "knight", "springman", PluginConfig.Instance.knightEnemyValue); + AddEnemy(Assets.maid, "maid", "butler", PluginConfig.Instance.maidEnemyValue); - Plugin.logger.LogDebug($"Loaded custom enemies and items for {level.sceneName}"); - Components.ScarletBedroom.CreateRandomEnemyList(currentEnemiesRarity); + ScarletBedroom.CreateRandomEnemyList(currentEnemies); } - public static List GetEnemies(List target){ - if (DunGenPatch.Patch.active && target == lastEnemiesRarity) return currentEnemiesRarity; - return target; - } - - - public static List GetItems(List target){ - if (DunGenPatch.Patch.active && target == lastItemsRarity) return currentItemsRarity; - return target; - } - - } } diff --git a/ScarletMansion/ScarletMansion/GamePatch/Managers/ScarletNetworkManager.cs b/ScarletMansion/ScarletMansion/GamePatch/Managers/ScarletNetworkManager.cs index d088ef0..188dabe 100644 --- a/ScarletMansion/ScarletMansion/GamePatch/Managers/ScarletNetworkManager.cs +++ b/ScarletMansion/ScarletMansion/GamePatch/Managers/ScarletNetworkManager.cs @@ -347,13 +347,26 @@ namespace ScarletMansion { public static class ScarletNetworkManagerUtility { - public static int GetCriticalDamageToPlayer(PlayerControllerB player, bool forceKill) { - if (!player.criticallyInjured && !forceKill) { + public static int GetMarkedDamageToPlayer(PlayerControllerB player) { + if (IsPlayerMarkedForDeath(player)) return player.health; + + if (!player.criticallyInjured) { return player.health - 5; } return player.health; } + public static bool IsPlayerMarkedForDeath(PlayerControllerB player){ + var scarletPlayer = ScarletPlayerControllerB.GetScarletPlayerScript(player); + if (scarletPlayer) return scarletPlayer.markedForDeath; + return false; + } + + public static void MarkPlayerForDeath(PlayerControllerB player){ + var scarletPlayer = ScarletPlayerControllerB.GetScarletPlayerScript(player); + if (scarletPlayer) scarletPlayer.markedForDeath = true; + } + public static int GetFlashlightId(FlashlightItem flashlightItem){ var flashlight = Assets.GetFlashlight(flashlightItem.itemProperties); diff --git a/ScarletMansion/ScarletMansion/Plugin.cs b/ScarletMansion/ScarletMansion/Plugin.cs index f3e1d3e..2b12c70 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.2.0")] + [BepInDependency("dev.ladyalice.dungenplus", "1.3.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 = "2.0.0"; + private const string modVersion = "2.1.0"; public readonly Harmony harmony = new Harmony(modGUID); @@ -130,6 +130,12 @@ namespace ScarletMansion { Assets.dungeonExtended = extendedDungeon; extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(GeneratePathPatch.GeneratePatch); + + extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(LoadAssetsIntoLevelPatch.AddItemsLocal); + DungeonManager.GlobalDungeonEvents.onBeforeDungeonGenerate.AddListener(LoadAssetsIntoLevelPatch.AddItemsGlobal); + + extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(LoadAssetsIntoLevelPatch.AddEnemiesLocal); + //DoorwayManager.onMainEntranceTeleportSpawnedEvent.AddEvent("DoorwayCleanup", DoorwayManager.onMainEntranceTeleportSpawnedFunction); DunGenPlus.API.AddDunGenExtender(Assets.dungeon, Assets.dunGenExtender); diff --git a/ScarletMansion/ScarletMansion/PluginConfig.cs b/ScarletMansion/ScarletMansion/PluginConfig.cs index 174a1dd..13d18da 100644 --- a/ScarletMansion/ScarletMansion/PluginConfig.cs +++ b/ScarletMansion/ScarletMansion/PluginConfig.cs @@ -33,7 +33,7 @@ namespace ScarletMansion { public const string dungeonGenerationBPathTwoPrefix = "DunGen Branching Path 2"; public const string dungeonGenerationBPathThreePrefix = "DunGen Branching Path 3"; - public const string dungeonLootPrefix = "Dungeon Loot"; + public const string dungeonItemPrefix = "Dungeon Items"; public const string dungeonEnemiesPrefix = "Dungeon Enemies"; public const string dungeonFeaturesPrefix = "Dungeon Features"; @@ -186,7 +186,7 @@ namespace ScarletMansion { dungeonGenerationBPathPrefix, "Use Branch Path Multi Sim", true, - "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.", + "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.\n\nOnly works when MainPathCount is more than 1.", null ); public static ConfigEntryBundle branchSimCount = new ConfigEntryBundle( @@ -229,246 +229,6 @@ namespace ScarletMansion { public BranchingPathRange branchPathSectionTwoValue = new BranchingPathRange("section two"); public BranchingPathRange branchPathSectionThreeValue = new BranchingPathRange("section three"); - // loot - public static ConfigEntryBundle lootMultiplier = new ConfigEntryBundle( - dungeonLootPrefix, - "Loot Multiplier", - 1.4f, - "Multiplies the total amount of loot for the dungeon.", - null, - new AcceptableValueRange(0.25f, 4f) - ); - - public static ConfigEntryBundle crystalWeight = new ConfigEntryBundle( - dungeonLootPrefix, - "Decorative Crystal Weight", - 50, - "The decorative crystal's spawn weight. Calculating spawn chance (%) is difficult as the total scrap weight for each moon varies from ~600 to ~850.", - null, - new AcceptableValueRange(0, 999) - ); - - public static ConfigEntryBundle crystalBrokenWeight = new ConfigEntryBundle( - dungeonLootPrefix, - "Shattered Decorative Crystal Weight", - 5, - "The shattered decorative crystal's spawn weight. Calculating spawn chance (%) is difficult as the total scrap weight for each moon varies from ~600 to ~850.", - null, - new AcceptableValueRange(0, 999) - ); - - public static ConfigEntryBundle snowGlobeWeight = new ConfigEntryBundle( - dungeonLootPrefix, - "Doll Snow Globe Weight", - 40, - "The doll snow globe's spawn weight. Calculating spawn chance (%) is difficult as the total scrap weight for each moon varies from ~600 to ~850.", - null, - new AcceptableValueRange(0, 999) - ); - - public float lootMultiplierValue; - public int crystalWeightValue; - public int crystalBrokenWeightValue; - public int snowGlobeWeightValue; - - // enemies - public static ConfigEntryBundle mapHazardsMultiplier = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Map Hazards Multiplier", - 1.6f, - "Multiplies the total amount of map hazards (landmines, turrets) for the dungeon.", - null, - new AcceptableValueRange(0.25f, 4f) - ); - - public static ConfigEntryBundle minIndoorEnemySpawnCount = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Minimum Indoor Enemy Spawn Count", - 1, - "Increases the minimum amount of indoor enemies that spawn with each spawn wave. For reference, Eclipse is +3.", - null, - new AcceptableValueRange(0, 3) - ); - - public static ConfigEntryBundle knightWeightStealPercentage = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Knight Weight Steal Percentage", - 0.75f, - "The percentage of spawn weight that the knight steals from the coil-head for that moon.\nSetting this 0 means that the coil-head's weight is unaffected and the knight's weight is based entirely by Knight Weight Base.\nSetting this 1 means the knight effectively replaces the coil-head.\nIf the moon doesn't spawn the coil-head, the knight's base weight is set to 10.", - null, - new AcceptableValueRange(0f, 1f) - ); - - public static ConfigEntryBundle knightWeightBase = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Knight Weight Base", - 0, - "The base spawn weight of the knight. This is added onto the spawn weight stolen from the coil-head, or the base weight of 10 if the moon doesn't spawn the coil-head.", - null, - new AcceptableValueRange(0, 999) - ); - - public static ConfigEntryBundle maidWeightStealPercentage = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Maid Weight Steal Percentage", - 0.75f, - "The percentage of spawn weight that the maid steals from the butler for that moon.\nSetting this 0 means that the butler's weight is unaffected and the maid's weight is based entirely by Maid Weight Base.\nSetting this 1 means the maid effectively replaces the butler.\nIf the moon doesn't spawn the bulter, the maid's base weight is set to 10.", - null, - new AcceptableValueRange(0f, 1f) - ); - - public static ConfigEntryBundle maidWeightBase = new ConfigEntryBundle( - dungeonEnemiesPrefix, - "Maid Weight Base", - 0, - "The base spawn weight of the maid. This is added onto the spawn weight stolen from the butler, or the base weight of 10 if the moon doesn't spawn the butler.", - null, - new AcceptableValueRange(0, 999) - ); - - public float mapHazardsMultiplierValue; - - public int minIndoorEnemySpawnCountValue; - public float knightWeightStealPercentageValue; - public int knightWeightBaseValue; - - public float maidWeightStealPercentageValue; - public int maidWeightBaseValue; - - // features - - public static ConfigEntryBundle shovelDamage = new ConfigEntryBundle( - dungeonFeaturesPrefix, - "Door Shovel Damage", - 45, - "The amount of damage done by swinging your shovel at a SDM door. Door health equals to 100.", - null, - new AcceptableValueRange(0, 100) - ); - - public static ConfigEntryBundle shotgunDamage = new ConfigEntryBundle( - dungeonFeaturesPrefix, - "Door Shotgun Damage", - 100, - "The amount of damage done by shotgun blasting at a SDM door. Door health equals to 100.", - null, - new AcceptableValueRange(0, 100) - ); - - public static ConfigEntryBundle lockedDoorEnemyDamageMultiplier = new ConfigEntryBundle( - dungeonFeaturesPrefix, - "Locked Door Enemy Damage Multiplier", - 0.5f, - "The damage multiplier applied to an enemy's attacks against a locked SDM door.\nSetting the value to 0 means that enemies can't break through a locked SDM door like in vanilla.", - null, - new AcceptableValueRange(0f, 1f) - ); - - public static ConfigEntryBundle useSDMFireExits = new ConfigEntryBundle( - dungeonFeaturesPrefix, - "Use SDM Fire Exits", - true, - "If enabled, the dungeon will spawn its custom fire exits. If disabled, the dungeon will instead spawn the vanilla fire exits." - ); - - public int shovelDamageValue; - public int shotgunDamageValue; - public float lockedDoorEnemyDamageMultiplierValue; - public bool useSDMFireExitsValue; - - // painting - - public static ConfigEntryBundle paintingValue = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Painting Value", - 100, - "The scrap value of demonic paintings.", - null, - new AcceptableValueRange(0, 400) - ); - - public static ConfigEntryBundle paintingCount = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Painting Count", - 2, - "The maximum amount of demonic paintings that spawn in the dungeon.", - null, - new AcceptableValueRange(0, 10) - ); - - public static ConfigEntryBundleMinMax paintingExtraLoot = new ConfigEntryBundleMinMax( - dungeonPaintingEventPrefix, - "Painting Extra Loot Min", - "Painting Extra Loot Max", - 0, - 2, - "The minimum allowed amount of extra loot that spawns after grabbing the demonic painting.", - "The maximum allowed amount of extra loot that spawns after grabbing the demonic painting.", - null, - new AcceptableValueRange(0, 3) - ); - - public static ConfigEntryBundle paintingSpawnEnemy = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Spawn Enemy", - true, - "If enabled, an enemy will spawn when the bedroom's painting event ends." - ); - - public static ConfigEntryBundle paintingEnemyList = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Enemy List", - "default", - $"The enemies that can spawn when the bedroom's painting event ends, in the form of a comma separated list of enemy names along with optional parameters separated or '@'.It can accept either the enemy's internal or display name.\n\nThe available parameters are:\nSpawn Logic: 's#' where '#' is either '0' for normal spawn logic or '1' for special spawn logic. Only the knight and jester have special spawn logic. When their special spawn logic is enabled, the knight will spawn properly in the bedroom and the jester will spawn already cranking.\n\nThe following string \"default\" is a preset that uses the following string \"{ScarletBedroom.ENEMY_SPAWN_LIST_DEFAULT}\"." - ); - - public static ConfigEntryBundle paintingEnemyEvilSkin = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Invader Apperance", - true, - "Enemies spawned from the bedroom's painting event has a pitch black and red appearance. Only valid for the default enemy list." - ); - - public static ConfigEntryBundle facilityMeltdownActive = new ConfigEntryBundle( - dungeonPaintingEventPrefix, - "Activate Facility Meltdown", - false, - "If enabled, facility meltdown will activate when the bedroom's painting event ends. Requires FacilityMeltdown v2.4.7 or higher." - ); - - public int paintingValueValue; - public int paintingCountValue; - public IntRange paintingExtraLootValue = new IntRange("painting extra loot"); - public bool paintingSpawnEnemyValue; - public string paintingEnemyListValue; - public bool paintingEnemyEvilSkinValue; - public bool facilityMeltdownActiveValue; - - // treasure room - public static ConfigEntryBundle treasureRoomCount = new ConfigEntryBundle( - dungeonTreasureRoomPrefix, - "Treasure Room Count", - 2, - "The maximum amount of treasure rooms that spawn in the dungeon.", - null, - new AcceptableValueRange(0, 10) - ); - - public static ConfigEntryBundleMinMax treasureRoomLoot = new ConfigEntryBundleMinMax( - dungeonTreasureRoomPrefix, - "Treasure Room Loot Min", - "Treasure Room Loot Max", - 2, - 3, - "The minimum allowed amount of loot that spawns in the treasure room.", - "The maximum allowed amount of loot that spawns in the treasure room.", - null, - new AcceptableValueRange(0, 6) - ); - - public int treasureRoomCountValue; - public IntRange treasureRoomLootValue = new IntRange("treasure room loot"); - // lighting public static ConfigEntryBundle hallwayLightsWeight = new ConfigEntryBundle( dungeonLightingPrefix, @@ -532,6 +292,198 @@ namespace ScarletMansion { public int lightsSpawnTwoWeightValue; //public int lightsSpawnThreeWeightValue; + // loot + public static ConfigEntryBundle lootMultiplier = new ConfigEntryBundle( + dungeonItemPrefix, + "Loot Multiplier", + 1.4f, + "Multiplies the total amount of loot for the dungeon.", + null, + new AcceptableValueRange(0.25f, 4f) + ); + + public static ConfigEntryBundleItem decoFlashlight = new ConfigEntryBundleItem(dungeonItemPrefix, "Deco Pro Flashlight ", "Deco Pro Flashlight", 0, 0); + public static ConfigEntryBundleItem decoProFlashlight = new ConfigEntryBundleItem(dungeonItemPrefix, "Deco Flashlight ", "Deco Flashlight", 0, 0); + public static ConfigEntryBundleItem scarletKey = new ConfigEntryBundleItem(dungeonItemPrefix, "Scarlet Key ", "Scarlet Key", 0, 0); + + public float lootMultiplierValue; + public Item decoFlashlightValue = new Item("Deco Flashlight"); + public Item decoProFlashlightValue = new Item("Deco Pro Flashlight"); + public Item scarletKeyValue = new Item("Scarlet Key"); + + public static ConfigEntryBundleScrapItem crystal = new ConfigEntryBundleScrapItem("Dungeon Item Deco Crystal", "Decorative Crystal", 110, 150, 50); + public static ConfigEntryBundleScrapItem crystalBroken = new ConfigEntryBundleScrapItem("Dungeon Item Shattered Deco Crystal", "Shattered Decorative Crystal", 60, 80, 5); + public static ConfigEntryBundleScrapItem snowGlobe = new ConfigEntryBundleScrapItem("Dungeon Item Snow Globe", "Snow Globe", 150, 320, 40); + + + public ScrapItem crystalValue = new ScrapItem("Crystal"); + public ScrapItem crystalBrokenValue = new ScrapItem("Shattered Crystal"); + public ScrapItem snowGlobeValue = new ScrapItem("Snow Globe"); + + // enemies + public static ConfigEntryBundle mapHazardsMultiplier = new ConfigEntryBundle( + dungeonEnemiesPrefix, + "Map Hazards Multiplier", + 1.6f, + "Multiplies the total amount of map hazards (landmines, turrets) for the dungeon.", + null, + new AcceptableValueRange(0.25f, 4f) + ); + + public static ConfigEntryBundle minIndoorEnemySpawnCount = new ConfigEntryBundle( + dungeonEnemiesPrefix, + "Minimum Indoor Enemy Spawn Count", + 1, + "Increases the minimum amount of indoor enemies that spawn with each spawn wave. For reference, Eclipse is +3.", + null, + new AcceptableValueRange(0, 3) + ); + + public float mapHazardsMultiplierValue; + public int minIndoorEnemySpawnCountValue; + + public static ConfigEntryBundleSpawnableEnemy knightEnemy = new ConfigEntryBundleSpawnableEnemy("Dungeon Enemy Knight", "Knight", "Coil-head", 0, 13f); + public static ConfigEntryBundleSpawnableEnemy maidEnemy = new ConfigEntryBundleSpawnableEnemy("Dungeon Enemy Maid", "Maid", "Butler", 6, 5.5f); + public static ConfigEntryBundleEnemy revEnemy = new ConfigEntryBundleEnemy("Dungeon Enemy Revenant", "Revenant", 0, 14.5f); + + public SpawnableEnemy knightEnemyValue = new SpawnableEnemy(); + public SpawnableEnemy maidEnemyValue = new SpawnableEnemy(); + public Enemy revEnemyValue = new Enemy(); + + // features + + public static ConfigEntryBundle shovelDamage = new ConfigEntryBundle( + dungeonFeaturesPrefix, + "Door Shovel Damage", + 45, + "The amount of damage done by swinging your shovel at a SDM door. Door health equals to 100.", + null, + new AcceptableValueRange(0, 100) + ); + + public static ConfigEntryBundle shotgunDamage = new ConfigEntryBundle( + dungeonFeaturesPrefix, + "Door Shotgun Damage", + 100, + "The amount of damage done by shotgun blasting at a SDM door. Door health equals to 100.", + null, + new AcceptableValueRange(0, 100) + ); + + public static ConfigEntryBundle lockedDoorEnemyDamageMultiplier = new ConfigEntryBundle( + dungeonFeaturesPrefix, + "Locked Door Enemy Damage Multiplier", + 0.5f, + "The damage multiplier applied to an enemy's attacks against a locked SDM door.\nSetting the value to 0 means that enemies can't break through a locked SDM door like in vanilla.", + null, + new AcceptableValueRange(0f, 1f) + ); + + public static ConfigEntryBundle useSDMFireExits = new ConfigEntryBundle( + dungeonFeaturesPrefix, + "Use SDM Fire Exits", + true, + "If enabled, the dungeon will spawn its custom fire exits. If disabled, the dungeon will instead spawn the vanilla fire exits." + ); + + public int shovelDamageValue; + public int shotgunDamageValue; + public float lockedDoorEnemyDamageMultiplierValue; + public bool useSDMFireExitsValue; + + // painting + + public static ConfigEntryBundle paintingCount = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Painting Count", + 2, + "The maximum amount of demonic paintings that spawn in the dungeon.", + null, + new AcceptableValueRange(0, 10) + ); + + public static ConfigEntryBundle paintingValue = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Painting Value", + 100, + "The scrap value of demonic paintings.", + null, + new AcceptableValueRange(0, 400) + ); + + public static ConfigEntryBundleMinMax paintingExtraLoot = new ConfigEntryBundleMinMax( + dungeonPaintingEventPrefix, + "Painting Extra Loot Min", + "Painting Extra Loot Max", + 0, + 2, + "The minimum allowed amount of extra loot that spawns after grabbing the demonic painting.", + "The maximum allowed amount of extra loot that spawns after grabbing the demonic painting.", + null, + new AcceptableValueRange(0, 3) + ); + + public static ConfigEntryBundle paintingSpawnEnemy = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Spawn Enemy", + true, + "If enabled, an enemy will spawn when the bedroom's painting event ends." + ); + + public static ConfigEntryBundle paintingEnemyList = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Enemy List", + "default", + $"The enemies that can spawn when the bedroom's painting event ends, in the form of a comma separated list of enemy names along with optional parameters separated or '@'.It can accept either the enemy's internal or display name.\n\nThe available parameters are:\nSpawn Logic: 's#' where '#' is either '0' for normal spawn logic or '1' for special spawn logic. Only the knight and jester have special spawn logic. When their special spawn logic is enabled, the knight will spawn properly in the bedroom and the jester will spawn already cranking.\n\nThe following string \"default\" is a preset that uses the following string \"{ScarletBedroom.ENEMY_SPAWN_LIST_DEFAULT}\"." + ); + + public static ConfigEntryBundle paintingEnemyEvilSkin = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Invader Apperance", + true, + "Enemies spawned from the bedroom's painting event has a pitch black and red appearance. Only valid for the default enemy list." + ); + + public static ConfigEntryBundle facilityMeltdownActive = new ConfigEntryBundle( + dungeonPaintingEventPrefix, + "Activate Facility Meltdown", + false, + "If enabled, facility meltdown will activate when the bedroom's painting event ends. Requires FacilityMeltdown v2.4.7 or higher." + ); + + public int paintingCountValue; + public int paintingValueValue; + public IntRange paintingExtraLootValue = new IntRange("painting extra loot"); + public bool paintingSpawnEnemyValue; + public string paintingEnemyListValue; + public bool paintingEnemyEvilSkinValue; + public bool facilityMeltdownActiveValue; + + // treasure room + public static ConfigEntryBundle treasureRoomCount = new ConfigEntryBundle( + dungeonTreasureRoomPrefix, + "Treasure Room Count", + 2, + "The maximum amount of treasure rooms that spawn in the dungeon.", + null, + new AcceptableValueRange(0, 10) + ); + + public static ConfigEntryBundleMinMax treasureRoomLoot = new ConfigEntryBundleMinMax( + dungeonTreasureRoomPrefix, + "Treasure Room Loot Min", + "Treasure Room Loot Max", + 2, + 3, + "The minimum allowed amount of loot that spawns in the treasure room.", + "The maximum allowed amount of loot that spawns in the treasure room.", + null, + new AcceptableValueRange(0, 6) + ); + + public int treasureRoomCountValue; + public IntRange treasureRoomLootValue = new IntRange("treasure room loot"); + public static string GetEnumNames() where T: Enum { var str = string.Empty; var enums = Enum.GetNames(typeof(T)).Select(e => $"\"{e}\""); diff --git a/ScarletMansion/ScarletMansion/PluginConfigClasses.cs b/ScarletMansion/ScarletMansion/PluginConfigClasses.cs index 759cf8a..c3341b3 100644 --- a/ScarletMansion/ScarletMansion/PluginConfigClasses.cs +++ b/ScarletMansion/ScarletMansion/PluginConfigClasses.cs @@ -12,6 +12,7 @@ using BepInEx.Configuration; using BepInEx.Logging; using UnityEngine; using System.Reflection; +using static ScarletMansion.PluginConfig; namespace ScarletMansion { public partial class PluginConfig : SyncedInstance { @@ -52,6 +53,7 @@ namespace ScarletMansion { public override string ToString() { return $"({min}, {max})"; } + } [System.Serializable] @@ -67,6 +69,7 @@ namespace ScarletMansion { public DunGen.IntRange GetDungenIntRange(){ return new DunGen.IntRange(min, max); } + } [System.Serializable] @@ -106,6 +109,37 @@ namespace ScarletMansion { } } + [System.Serializable] + public class Enemy { + public bool enabled; + public int health; + public float speed; + } + + [System.Serializable] + public class SpawnableEnemy : Enemy { + public int spawnWeightBase; + public float spawnWeightStealPercentage; + } + + [System.Serializable] + public class Item { + public bool enabled; + public IntRange valueRange; + + public Item(string name) { + valueRange = new IntRange($"{name} value range"); + } + } + + [System.Serializable] + public class ScrapItem : Item { + public int spawnWeight; + public bool spawnOnAllMoons; + + public ScrapItem(string name) : base(name) { } + } + public abstract class ConfigEntryBundleBase { public class FieldPropertyInfo { @@ -138,7 +172,7 @@ namespace ScarletMansion { } } - public abstract ConfigEntryBase[] GetConfigs(); + public abstract IEnumerable GetConfigs(); public abstract void Bind(ConfigFile cfg, PluginConfig instance, FieldPropertyInfo memberInfo, object memberTarget); } @@ -196,8 +230,8 @@ namespace ScarletMansion { extra.CallAction(instance, true); } - public override ConfigEntryBase[] GetConfigs() { - return new ConfigEntryBase[] { config }; + public override IEnumerable GetConfigs() { + yield return config; } } @@ -219,8 +253,9 @@ namespace ScarletMansion { max.Bind(cfg, instance, new FieldPropertyInfo(maxProp), memberInfo.GetValue(memberTarget)); } - public override ConfigEntryBase[] GetConfigs() { - return new ConfigEntryBase[] { min.config, max.config }; + public override IEnumerable GetConfigs() { + yield return min.config; + yield return max.config; } } @@ -262,8 +297,157 @@ namespace ScarletMansion { depth.Bind(cfg, instance, new FieldPropertyInfo(depthField), memberInfo.GetValue(memberTarget)); } - public override ConfigEntryBase[] GetConfigs() { - return new ConfigEntryBase[] { count.min.config, count.max.config, depth.min.config, depth.max.config }; + public override IEnumerable GetConfigs() { + foreach(var a in count.GetConfigs()) { + yield return a; + } + + foreach(var a in depth.GetConfigs()) { + yield return a; + } + } + } + + public class ConfigEntryBundleEnemy : ConfigEntryBundleBase { + public ConfigEntryBundle enabled; + public ConfigEntryBundle health; + public ConfigEntryBundle speed; + + public ConfigEntryBundleEnemy(string section, string enemyName, int baseHealth, float baseSpeed, ConfigEntryBundleExtraParameters extra = null){ + var enabledDesc = $"If disabled, {enemyName} is disabled from spawning."; + var healthDesc = $"The health of the {enemyName}. A shovel is 1 damage."; + var speedDesc = $"The speed of the {enemyName} during their killing/aggressive stance. The player's default speed is 4.6."; + + enabled = new ConfigEntryBundle(section, "Enabled", true, enabledDesc, extra); + health = new ConfigEntryBundle(section, "Health", baseHealth, healthDesc, extra, new AcceptableValueRange(1, 20)); + speed = new ConfigEntryBundle(section, "Speed", baseSpeed, speedDesc, extra, new AcceptableValueRange(1f, 20f)); + } + + public override void Bind(ConfigFile cfg, PluginConfig instance, FieldPropertyInfo memberInfo, object memberTarget) { + var type = memberInfo.GetFieldPropertyType(); + var enabledProp = type.GetField("enabled", BindingFlags.Public | BindingFlags.Instance); + var healthProp = type.GetField("health", BindingFlags.Public | BindingFlags.Instance); + var speedProp = type.GetField("speed", BindingFlags.Public | BindingFlags.Instance); + + enabled.Bind(cfg, instance, new FieldPropertyInfo(enabledProp), memberInfo.GetValue(memberTarget)); + if (health.defaultValue > 0) health.Bind(cfg, instance, new FieldPropertyInfo(healthProp), memberInfo.GetValue(memberTarget)); + speed.Bind(cfg, instance, new FieldPropertyInfo(speedProp), memberInfo.GetValue(memberTarget)); + + } + + public override IEnumerable GetConfigs() { + yield return enabled.config; + if (health.defaultValue > 0) yield return health.config; + yield return speed.config; + } + } + + public class ConfigEntryBundleSpawnableEnemy : ConfigEntryBundleEnemy { + public ConfigEntryBundle spawnWeightBase; + public ConfigEntryBundle spawnWeightStealPercentage; + + public ConfigEntryBundleSpawnableEnemy(string section, string enemyName, string replacementEnemyName, int baseHealth, float baseSpeed, ConfigEntryBundleExtraParameters extra = null) : base(section, enemyName, baseHealth, baseSpeed, extra) { + + var weightBaseDesc = $"The base spawn weight of the {enemyName}. This is added onto the spawn weight stolen from the {replacementEnemyName}, or the base weight of 10 if the moon doesn't spawn the {replacementEnemyName}."; + var weightStealPercentageDesc = $"The percentage of spawn weight that the {enemyName} steals from the {replacementEnemyName} for that moon.\nSetting this 0 means that the {replacementEnemyName}'s weight is unaffected and the {enemyName}'s weight is based entirely by Spawn Weight Base.\nSetting this 1 means the {enemyName} effectively replaces the {replacementEnemyName}."; + + spawnWeightBase = new ConfigEntryBundle(section, "Spawn Weight Base", 0, weightBaseDesc, extra, new AcceptableValueRange(0, 999)); + spawnWeightStealPercentage = new ConfigEntryBundle(section, "Spawn Weight Steal Percentage", 0.75f, weightStealPercentageDesc, extra, new AcceptableValueRange(0f, 1f)); + } + + public override void Bind(ConfigFile cfg, PluginConfig instance, FieldPropertyInfo memberInfo, object memberTarget) { + base.Bind(cfg, instance, memberInfo, memberTarget); + + var type = memberInfo.GetFieldPropertyType(); + var weightBaseProp = type.GetField("spawnWeightBase", BindingFlags.Public | BindingFlags.Instance); + var weightStealPercentageProp = type.GetField("spawnWeightStealPercentage", BindingFlags.Public | BindingFlags.Instance); + + spawnWeightBase.Bind(cfg, instance, new FieldPropertyInfo(weightBaseProp), memberInfo.GetValue(memberTarget)); + spawnWeightStealPercentage.Bind(cfg, instance, new FieldPropertyInfo(weightStealPercentageProp), memberInfo.GetValue(memberTarget)); + } + + public override IEnumerable GetConfigs() { + foreach(var a in base.GetConfigs()) { + yield return a; + } + yield return spawnWeightBase.config; + yield return spawnWeightStealPercentage.config; + } + } + + public class ConfigEntryBundleItem : ConfigEntryBundleBase { + public ConfigEntryBundle enabled; + public ConfigEntryBundleMinMax valueRange; + + private static string _valueMessage(string itemName, string minmax) => $"The {minmax} scrap value of {itemName}. Lethal Company multiplies all scrap values by 0.4."; + + public ConfigEntryBundleItem(string section, string keyPrefix, string itemName, int baseValueMin, int baseValueMax, ConfigEntryBundleExtraParameters extra = null){ + var enabledDesc = $"If disabled, {itemName} is disabled from spawning."; + + enabled = new ConfigEntryBundle(section, $"{keyPrefix}Enabled", true, enabledDesc, extra); + valueRange = new ConfigEntryBundleMinMax( + section, + $"Value Min", + $"Value Max", + baseValueMin, + baseValueMax, + _valueMessage(itemName, "minimum"), + _valueMessage(itemName, "maximum"), + extra, + new AcceptableValueRange(1, 400) + ); + } + + public override void Bind(ConfigFile cfg, PluginConfig instance, FieldPropertyInfo memberInfo, object memberTarget) { + var type = memberInfo.GetFieldPropertyType(); + var enabledProp = type.GetField("enabled", BindingFlags.Public | BindingFlags.Instance); + var valueRangeProp = type.GetField("valueRange", BindingFlags.Public | BindingFlags.Instance); + + enabled.Bind(cfg, instance, new FieldPropertyInfo(enabledProp), memberInfo.GetValue(memberTarget)); + if (valueRange.min.defaultValue > 0) valueRange.Bind(cfg, instance, new FieldPropertyInfo(valueRangeProp), memberInfo.GetValue(memberTarget)); + + } + + public override IEnumerable GetConfigs() { + yield return enabled.config; + if (valueRange.min.defaultValue > 0) { + foreach(var a in valueRange.GetConfigs()) { + yield return a; + } + } + } + } + + public class ConfigEntryBundleScrapItem : ConfigEntryBundleItem { + public ConfigEntryBundle spawnWeight; + public ConfigEntryBundle spawnOnAllMoons; + + public ConfigEntryBundleScrapItem(string section, string itemName, int baseValueMin, int baseValueMax, int baseSpawnWeight, ConfigEntryBundleExtraParameters extra = null) : base(section, string.Empty, itemName, baseValueMin, baseValueMax, extra) { + + var weightDesc = $"The {itemName}'s spawn weight. Calculating spawn chance (%) is difficult as the total scrap weight for each moon varies from ~600 to ~850."; + var spawnDesc = $"If enabled, the {itemName} scrap item will spawn on all moons regardless if SDM loaded."; + + spawnWeight = new ConfigEntryBundle(section, "Spawn Weight Base", baseSpawnWeight, weightDesc, extra, new AcceptableValueRange(0, 999)); + spawnOnAllMoons = new ConfigEntryBundle(section, "Spawn On All Moons", false, spawnDesc, extra); + } + + public override void Bind(ConfigFile cfg, PluginConfig instance, FieldPropertyInfo memberInfo, object memberTarget) { + base.Bind(cfg, instance, memberInfo, memberTarget); + + var type = memberInfo.GetFieldPropertyType(); + var weightDescProp = type.GetField("spawnWeight", BindingFlags.Public | BindingFlags.Instance); + var spawnDescProp = type.GetField("spawnOnAllMoons", BindingFlags.Public | BindingFlags.Instance); + + spawnWeight.Bind(cfg, instance, new FieldPropertyInfo(weightDescProp), memberInfo.GetValue(memberTarget)); + spawnOnAllMoons.Bind(cfg, instance, new FieldPropertyInfo(spawnDescProp), memberInfo.GetValue(memberTarget)); + } + + public override IEnumerable GetConfigs() { + foreach(var a in base.GetConfigs()) { + yield return a; + } + yield return spawnWeight.config; + yield return spawnOnAllMoons.config; } } diff --git a/ScarletMansion/ScarletMansion/PresetConfig.cs b/ScarletMansion/ScarletMansion/PresetConfig.cs index f2c09aa..d70c3bf 100644 --- a/ScarletMansion/ScarletMansion/PresetConfig.cs +++ b/ScarletMansion/ScarletMansion/PresetConfig.cs @@ -31,7 +31,7 @@ namespace ScarletMansion { new ChangeFloat ( PluginConfig.dunGenLengthMultiFactor ), new ChangeInt ( PluginConfig.mainPathCount ), - new ChangeMinMaxInt ( PluginConfig.mainPathLength ), + new ChangeMinMaxInt ( PluginConfig.mainPathLength), new ChangeBranchingPath( PluginConfig.branchPathSectionOne ), new ChangeBranchingPath( PluginConfig.branchPathSectionTwo ), @@ -110,11 +110,11 @@ namespace ScarletMansion { new ChangeFloat ( PluginConfig.dunGenLengthMultiFactor, 4f ), new ChangeInt ( PluginConfig.mainPathCount, 1 ), - new ChangeMinMaxInt ( PluginConfig.mainPathLength, 6, 9 ), + new ChangeMinMaxInt ( PluginConfig.mainPathLength, 6, 8 ), - new ChangeBranchingPath( PluginConfig.branchPathSectionOne, 4, 6, 3, 4 ), - new ChangeBranchingPath( PluginConfig.branchPathSectionTwo, 2, 3, 2, 3 ), - new ChangeBranchingPath( PluginConfig.branchPathSectionThree, 1, 2, 1, 2 ), + new ChangeBranchingPath( PluginConfig.branchPathSectionOne, 3, 5, 2, 3 ), + new ChangeBranchingPath( PluginConfig.branchPathSectionTwo, 2, 3, 1, 2 ), + new ChangeBranchingPath( PluginConfig.branchPathSectionThree, 1, 2, 0, 1 ), new ChangeFloat ( PluginConfig.lootMultiplier, 1f ), diff --git a/ScarletMansion/ScarletMansion/Utility.cs b/ScarletMansion/ScarletMansion/Utility.cs index a04af9b..ce1d409 100644 --- a/ScarletMansion/ScarletMansion/Utility.cs +++ b/ScarletMansion/ScarletMansion/Utility.cs @@ -251,7 +251,7 @@ namespace ScarletMansion { } public static List GetDungeonItems(){ - return LoadAssetsIntoLevelPatch.GetItems(RoundManager.Instance.currentLevel.spawnableScrap); + return RoundManager.Instance.currentLevel.spawnableScrap; } public static int GetDungeonItemId(Item item, bool debug = false){ diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln b/SeichiPatch/ScarletMansionSeichiPatch.sln similarity index 100% rename from ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.sln rename to SeichiPatch/ScarletMansionSeichiPatch.sln diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs b/SeichiPatch/ScarletMansionSeichiPatch/Patch.cs similarity index 100% rename from ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Patch.cs rename to SeichiPatch/ScarletMansionSeichiPatch/Patch.cs diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs b/SeichiPatch/ScarletMansionSeichiPatch/Plugin.cs similarity index 100% rename from ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Plugin.cs rename to SeichiPatch/ScarletMansionSeichiPatch/Plugin.cs diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs b/SeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs similarity index 100% rename from ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs rename to SeichiPatch/ScarletMansionSeichiPatch/Properties/AssemblyInfo.cs diff --git a/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj b/SeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj similarity index 100% rename from ScarletMansionSeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj rename to SeichiPatch/ScarletMansionSeichiPatch/ScarletMansionSeichiPatch.csproj