Added basement variant

Fixed knight ghost to sprint when you ain't looking
Fixed Gohei to detect enemies
This commit is contained in:
LadyAliceMargatroid 2025-01-11 03:45:12 -08:00
parent 83d0d8a737
commit e28f3ca2db
21 changed files with 466 additions and 96 deletions

View file

@ -19,7 +19,7 @@ using Microsoft.CSharp;
using System.CodeDom.Compiler;
namespace ScarletMansion.ModPatch {
public class LethalConfigPatch<T> : ModPatch where T: ConfigDungeon<T> {
public class LethalConfigPatch<T> : ModPatch where T: ConfigManager<T> {
public const string section = "_Presets";
public const string descriptionPrefix = "These are a set of preset config values for your convience. Your config values will automatically update to these preset values every time SDM is loaded. These config values are a brighter shade of red. To disable this feature, set this value to Custom.";
@ -109,12 +109,12 @@ namespace ScarletMansion.ModPatch {
LethalConfigManager.AddConfigItem(entry, assembly);
}
public static void CreatePresetConfig<U>(Assembly assembly, ConfigEntry<U> configEntry, List<ConfigManager<T>.ChangeList> changeList) where U: Enum {
public static void CreatePresetConfig<U>(Assembly assembly, ConfigEntry<U> configEntry, List<string> changeDescriptions) where U: Enum {
configEntry.SettingChanged += (obj, args) => ForceUIUpdate();
var description = $"{requiresNewLobby}\n\n{descriptionPrefix}\n\n";
foreach(var c in changeList) {
description += $"<b>{c.name}</b>\n{c.description}\n\n";
foreach(var c in changeDescriptions) {
description += $"{c}\n\n";
}
var options = new LethalConfig.ConfigItems.Options.EnumDropDownOptions{
@ -145,19 +145,26 @@ namespace ScarletMansion.ModPatch {
}
public override void AddPatch() {
LethalConfigManager.SkipAutoGen();
var genericType = typeof(T);
if (genericType == typeof(ConfigMain)) {
LethalConfigManager.SkipAutoGen();
LethalConfigManager.SetModDescription("Adds the Scarlet Devil Mansion from Touhou as a possible dungeon to the snow maps.\n\nThis is the master config for the entire mod.");
LethalConfigManager.SetModDescription("Adds the Scarlet Devil Mansion from Touhou as a possible dungeon to the snow maps.\n\nThis is the master config for the entire mod.");
var mainAssembly = typeof(Plugin).Assembly;
AutoGenerateConfigs<ConfigMain>(mainAssembly);
} else if (genericType == typeof(ConfigDungeonFoyer)) {
var foyerAssembly = typeof(DungeonFoyer.Plugin).Assembly;
var mainAssembly = typeof(Plugin).Assembly;
var dungeonAssembly = typeof(DungeonFoyer.Plugin).Assembly;
CreatePresetConfig(dungeonAssembly, ConfigDungeon<T>.dungeonGenerationPreset.config, ConfigDungeon<T>.dungeonGenerationChangeList);
CreatePresetConfig(dungeonAssembly, ConfigDungeon<T>.dungeonLightingPreset.config, ConfigDungeon<T>.dungeonLightingChangeList);
AutoGenerateConfigs<ConfigMain>(mainAssembly);
AutoGenerateConfigs<T>(dungeonAssembly, ConfigDungeon<T>.dungeonGenerationPreset, ConfigDungeon<T>.dungeonLightingPreset);
CreatePresetConfig(foyerAssembly, ConfigDungeon<ConfigDungeonFoyer>.dungeonGenerationPreset.config, ConfigDungeon<ConfigDungeonFoyer>.CreateDungeonGenerationPresetDescriptions());
CreatePresetConfig(foyerAssembly, ConfigDungeon<ConfigDungeonFoyer>.dungeonLightingPreset.config, ConfigDungeon<ConfigDungeonFoyer>.CreateDungeonLightingPresetDescriptions());
AutoGenerateConfigs<T>(foyerAssembly, ConfigDungeon<ConfigDungeonFoyer>.dungeonGenerationPreset, ConfigDungeon<ConfigDungeonFoyer>.dungeonLightingPreset);
} else if (genericType == typeof(ConfigDungeonBasement)){
var basementAssembly = typeof(DungeonBasement.Plugin).Assembly;
CreatePresetConfig(basementAssembly, ConfigDungeon<ConfigDungeonBasement>.dungeonGenerationPreset.config, ConfigDungeon<ConfigDungeonBasement>.CreateDungeonGenerationPresetDescriptions());
CreatePresetConfig(basementAssembly, ConfigDungeon<ConfigDungeonBasement>.dungeonLightingPreset.config, ConfigDungeon<ConfigDungeonBasement>.CreateDungeonLightingPresetDescriptions());
AutoGenerateConfigs<T>(basementAssembly, ConfigDungeon<ConfigDungeonBasement>.dungeonGenerationPreset, ConfigDungeon<ConfigDungeonBasement>.dungeonLightingPreset);
}
try {
//Plugin.Instance.harmony.PatchAll(typeof(LethalConfigPatch));
} catch (Exception e) {

View file

@ -18,7 +18,10 @@ namespace ScarletMansion.ModPatch {
public static readonly ModPatch[] modPatches = new ModPatch[] {
//new AdvancedCompanyPatch(advancedCompanyGuid),
new LethalConfigPatch<ConfigMain>(lethalConfigGuid),
new LethalConfigPatch<ConfigDungeonFoyer>(lethalConfigGuid),
new LethalConfigPatch<ConfigDungeonBasement>(lethalConfigGuid),
new FacilityMeltdownPatch(facilityMeldownGuid),
new ReservedFlashlightPatch(reserveFlashlightGuid),
new ReservedKeyPatch(reserveKeyGuid)