Added basement variant
Fixed knight ghost to sprint when you ain't looking Fixed Gohei to detect enemies
This commit is contained in:
parent
83d0d8a737
commit
e28f3ca2db
21 changed files with 466 additions and 96 deletions
|
@ -208,8 +208,12 @@ namespace ScarletMansion {
|
|||
|
||||
}
|
||||
|
||||
Plugin.ConfigFoyer.dungeon = Load<DungeonFlow>("SDMLevel");
|
||||
Plugin.ConfigFoyer.dunGenExtender = Load<DunGenExtender>("DunGenExtender");
|
||||
Plugin.ConfigFoyer.dungeon = Load<DungeonFlow>("sdmFoyer");
|
||||
Plugin.ConfigFoyer.dunGenExtender = Load<DunGenExtender>("foyerExtender");
|
||||
|
||||
Plugin.ConfigBasement.dungeon = Load<DungeonFlow>("sdmBasement");
|
||||
Plugin.ConfigBasement.dunGenExtender = Load<DunGenExtender>("basementExtender");
|
||||
|
||||
networkObjectList = Load<NetworkObjectListScriptableObject>("SDMList");
|
||||
entranceAudioClip = Load<AudioClip>("entrance_ogg");
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace ScarletMansion.Configs {
|
|||
);
|
||||
|
||||
public static ConfigEntryBundle<float> mapHazardsMultiplier = new ConfigEntryBundle<float>(
|
||||
dungeonEnemiesPrefix,
|
||||
dungeonBalancePrefix,
|
||||
"Map Hazards Multiplier",
|
||||
1.6f,
|
||||
"Multiplies the total amount of map hazards (landmines, turrets) for the dungeon.",
|
||||
|
@ -245,7 +245,7 @@ namespace ScarletMansion.Configs {
|
|||
);
|
||||
|
||||
public static ConfigEntryBundle<int> minIndoorEnemySpawnCount = new ConfigEntryBundle<int>(
|
||||
dungeonEnemiesPrefix,
|
||||
dungeonBalancePrefix,
|
||||
"Minimum Indoor Enemy Spawn Count",
|
||||
1,
|
||||
"Increases the minimum amount of indoor enemies that spawn with each spawn wave. For reference, Eclipse is +3.",
|
||||
|
@ -254,7 +254,7 @@ namespace ScarletMansion.Configs {
|
|||
);
|
||||
|
||||
public static ConfigEntryBundle<int> paintingCount = new ConfigEntryBundle<int>(
|
||||
dungeonPaintingEventPrefix,
|
||||
dungeonBalancePrefix,
|
||||
"Painting Count",
|
||||
2,
|
||||
"The maximum amount of demonic paintings that spawn in the dungeon.",
|
||||
|
@ -263,7 +263,7 @@ namespace ScarletMansion.Configs {
|
|||
);
|
||||
|
||||
public static ConfigEntryBundleMinMax<int> paintingExtraLoot = new ConfigEntryBundleMinMax<int>(
|
||||
dungeonPaintingEventPrefix,
|
||||
dungeonBalancePrefix,
|
||||
"Painting Extra Loot Min",
|
||||
"Painting Extra Loot Max",
|
||||
0,
|
||||
|
@ -338,6 +338,22 @@ namespace ScarletMansion.Configs {
|
|||
public static List<ChangeList> dungeonGenerationChangeList = new List<ChangeList>();
|
||||
public static List<ChangeList> dungeonLightingChangeList = new List<ChangeList>();
|
||||
|
||||
public static List<string> CreateDungeonGenerationPresetDescriptions(){
|
||||
var list = new List<string>();
|
||||
foreach(var c in dungeonGenerationChangeList) {
|
||||
list.Add($"<b>{c.name}</b>\n{c.description}");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<string> CreateDungeonLightingPresetDescriptions(){
|
||||
var list = new List<string>();
|
||||
foreach(var c in dungeonLightingChangeList) {
|
||||
list.Add($"<b>{c.name}</b>\n{c.description}");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static string GetEnumNames<T>() where T: Enum {
|
||||
var str = string.Empty;
|
||||
var enums = Enum.GetNames(typeof(T)).Select(e => $"\"{e}\"");
|
||||
|
|
171
ScarletMansion/ScarletMansion/Configs/ConfigDungeonBasement.cs
Normal file
171
ScarletMansion/ScarletMansion/Configs/ConfigDungeonBasement.cs
Normal file
|
@ -0,0 +1,171 @@
|
|||
using BepInEx.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ScarletMansion.Configs
|
||||
{
|
||||
public class ConfigDungeonBasement : ConfigDungeon<ConfigDungeonBasement> {
|
||||
|
||||
public ConfigDungeonBasement(ConfigFile cfg) : base(cfg) {
|
||||
|
||||
AutoGenerateOnChangeConfig(cfg, dungeonGenerationPreset, dungeonLightingPreset);
|
||||
|
||||
CreateDungeonGenerationChangeList();
|
||||
CreateDungeonLightingChangeList();
|
||||
|
||||
dungeonGenerationPreset.Bind(cfg, this);
|
||||
dungeonLightingPreset.Bind(cfg, this);
|
||||
}
|
||||
|
||||
public static void CreateDungeonGenerationChangeList(){
|
||||
var customChangeList = new ChangeList("Custom", "Disables auto loading of preset config values.");
|
||||
|
||||
var defaultGeneration = new ChangeList(
|
||||
"Default",
|
||||
"The default generation values. Intended for lobbies with 3+ players.",
|
||||
|
||||
new ChangeInt ( dunGenWidthBase, 120 ),
|
||||
new ChangeInt ( dunGenLengthBase, 80 ),
|
||||
new ChangeFloat ( dunGenWidthMultiFactor, 0.5f ),
|
||||
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
||||
|
||||
new ChangeInt ( mainPathCount, 3 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 4, 5 ),
|
||||
|
||||
new ChangeBranchingPath( branchPathSectionOne, 2, 4, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionTwo, 1, 2, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionThree, 0, 1, 0, 1 ),
|
||||
|
||||
new ChangeFloat ( lootMultiplier, 1.2f ),
|
||||
new ChangeFloat( mapHazardsMultiplier, 1.6f ),
|
||||
new ChangeInt( minIndoorEnemySpawnCount, 1 ),
|
||||
new ChangeInt ( paintingCount, 2 ),
|
||||
new ChangeMinMaxInt( paintingExtraLoot, 0, 2 ),
|
||||
|
||||
new ChangeInt( treasureRoomCount, 2 ),
|
||||
new ChangeMinMaxInt( treasureRoomLoot, 2, 3 )
|
||||
|
||||
);
|
||||
|
||||
var smallGeneration = new ChangeList(
|
||||
"Small",
|
||||
"A smaller variation of the default generation values. Intended for lobbies with 1-3 players.",
|
||||
defaultGeneration,
|
||||
|
||||
new ChangeInt ( mainPathCount, 2 ),
|
||||
|
||||
new ChangeFloat ( lootMultiplier, 1.1f ),
|
||||
new ChangeFloat ( mapHazardsMultiplier, 1.3f )
|
||||
|
||||
);
|
||||
|
||||
var moreLootGeneration = new ChangeList(
|
||||
"More Loot, More Danger",
|
||||
"Increases the amount of loot, map hazards, and starting enemies in the mansion. Intended for lobbies with 3+ players.",
|
||||
defaultGeneration,
|
||||
|
||||
new ChangeFloat ( lootMultiplier, 1.4f ),
|
||||
new ChangeFloat ( mapHazardsMultiplier, 2.2f ),
|
||||
new ChangeInt ( minIndoorEnemySpawnCount, 2 ),
|
||||
new ChangeInt ( paintingCount, 3 ),
|
||||
new ChangeMinMaxInt( paintingExtraLoot, 1 , 3 ),
|
||||
|
||||
new ChangeInt( treasureRoomCount, 3 ),
|
||||
new ChangeMinMaxInt( treasureRoomLoot, 3, 4 )
|
||||
|
||||
);
|
||||
|
||||
var bitMoreLootGeneration = new ChangeList(
|
||||
"Bit More Loot, Bit More Danger",
|
||||
"Increases the amount of loot, map hazards, and starting enemies in the mansion a bit. Intended for lobbies with 1-3 players.",
|
||||
smallGeneration,
|
||||
|
||||
new ChangeFloat ( lootMultiplier, 1.3f ),
|
||||
new ChangeFloat ( mapHazardsMultiplier, 1.9f ),
|
||||
new ChangeInt ( minIndoorEnemySpawnCount, 2 ),
|
||||
new ChangeInt ( paintingCount, 3 ),
|
||||
|
||||
new ChangeInt( treasureRoomCount, 3 )
|
||||
|
||||
);
|
||||
|
||||
var vanillaGeneration = new ChangeList(
|
||||
"Vanilla",
|
||||
"Changes the dungeon generation to match closer to a vanilla dungeon.",
|
||||
defaultGeneration,
|
||||
|
||||
//new ChangeMinMaxFloat ( PluginConfig.dunGenMultiplier, float.MaxValue, 10f ),
|
||||
new ChangeInt ( dunGenWidthBase, 200 ),
|
||||
new ChangeInt ( dunGenLengthBase, 200 ),
|
||||
new ChangeFloat ( dunGenWidthMultiFactor, 4f ),
|
||||
new ChangeFloat ( dunGenLengthMultiFactor, 4f ),
|
||||
|
||||
new ChangeInt ( mainPathCount, 1 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 6, 8 ),
|
||||
|
||||
new ChangeBranchingPath( branchPathSectionOne, 3, 5, 2, 3 ),
|
||||
new ChangeBranchingPath( branchPathSectionTwo, 2, 3, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionThree, 1, 2, 0, 1 ),
|
||||
|
||||
new ChangeFloat ( lootMultiplier, 1f ),
|
||||
new ChangeFloat ( mapHazardsMultiplier, 1f ),
|
||||
new ChangeInt ( minIndoorEnemySpawnCount, 0 )
|
||||
|
||||
);
|
||||
|
||||
dungeonGenerationChangeList = new List<ChangeList>() {
|
||||
customChangeList,
|
||||
defaultGeneration,
|
||||
smallGeneration,
|
||||
moreLootGeneration,
|
||||
bitMoreLootGeneration,
|
||||
vanillaGeneration
|
||||
};
|
||||
}
|
||||
|
||||
public static void CreateDungeonLightingChangeList(){
|
||||
var customChangeList = new ChangeList("Custom", "Disables auto loading of preset config values.");
|
||||
|
||||
var defaultLighting = new ChangeList(
|
||||
"Default",
|
||||
"The default lighting values.",
|
||||
new ChangeInt ( hallwayLightsWeight, 150 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 150 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 1 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 2 )
|
||||
);
|
||||
|
||||
var brightLighting = new ChangeList(
|
||||
"Bright",
|
||||
"Makes light sources much more common.",
|
||||
new ChangeInt ( hallwayLightsWeight, 450 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 450 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 0 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 7 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 3 )
|
||||
);
|
||||
|
||||
var darkLighting = new ChangeList(
|
||||
"Dark",
|
||||
"Makes light sources much less common.",
|
||||
new ChangeInt ( hallwayLightsWeight, 50 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 50 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 2 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 0 )
|
||||
);
|
||||
|
||||
dungeonLightingChangeList = new List<ChangeList>() {
|
||||
customChangeList,
|
||||
defaultLighting,
|
||||
brightLighting,
|
||||
darkLighting
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -20,7 +20,6 @@ namespace ScarletMansion.DunGenPatch {
|
|||
public static class Patch {
|
||||
|
||||
public static bool active;
|
||||
public static bool callAlternative;
|
||||
public static DungeonGenerator generatorInstance;
|
||||
|
||||
public static RandomStream GetRandomStream(){
|
||||
|
@ -37,13 +36,7 @@ namespace ScarletMansion.DunGenPatch {
|
|||
|
||||
public static void Activate(DungeonGenerator generator){
|
||||
active = true;
|
||||
callAlternative = true;
|
||||
generatorInstance = generator;
|
||||
|
||||
var scale = generator.LengthMultiplier;
|
||||
|
||||
var mainPathLength = generator.DungeonFlow.Length;
|
||||
Plugin.logger.LogDebug($"Length of main path be: {GetLength(mainPathLength, scale)}");
|
||||
}
|
||||
|
||||
public static string GetLength(IntRange range, float multi){
|
||||
|
@ -52,7 +45,6 @@ namespace ScarletMansion.DunGenPatch {
|
|||
|
||||
public static void Deactivate(bool ignoreScarletPlayer = false){
|
||||
active = false;
|
||||
callAlternative = false;
|
||||
generatorInstance = null;
|
||||
|
||||
GamePatch.JesterAIPatch.active = false;
|
||||
|
@ -68,6 +60,8 @@ namespace ScarletMansion.DunGenPatch {
|
|||
}
|
||||
|
||||
public static void UpdateDunGenExtenderProperties<T>(ConfigDungeon<T> dungeonConfig, DunGenExtenderProperties props, EventCallbackScenario callback) where T: ConfigDungeon<T> {
|
||||
Plugin.CurrentConfigDungeon = dungeonConfig;
|
||||
|
||||
if (callback.IsDevDebug) return;
|
||||
|
||||
props.MainPathProperties.MainPathCount = dungeonConfig.mainPathCountValue;
|
||||
|
|
|
@ -223,7 +223,7 @@ namespace ScarletMansion.GamePatch.Components {
|
|||
var sysRandom = DunGenPatch.Patch.CreateSystemRandom();
|
||||
|
||||
Utility.Shuffle(sysRandom, itemSpawns);
|
||||
var count = sysRandom.Next(Plugin.GetConfigDungeon.GetPaintingExtraLoot.min, Plugin.GetConfigDungeon.GetPaintingExtraLoot.max + 1);
|
||||
var count = sysRandom.Next(Plugin.CurrentConfigDungeon.GetPaintingExtraLoot.min, Plugin.CurrentConfigDungeon.GetPaintingExtraLoot.max + 1);
|
||||
|
||||
bonusItems = AngerManager.CreateAngerLoot(count, sysRandom);
|
||||
bonusEnemy = GetRandomEnemy(sysRandom);
|
||||
|
|
|
@ -51,7 +51,8 @@ namespace ScarletMansion {
|
|||
return;
|
||||
}
|
||||
|
||||
var targetLookingAtMe = !Physics.Linecast(transform.position + Vector3.up * 0.5f, targetPlayer.gameplayCamera.transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && Vector3.Distance(base.transform.position, targetPlayer.transform.position) < 30f;
|
||||
// whoops i didn't copy from knight code properly lmaoz
|
||||
var targetLookingAtMe = targetPlayer.HasLineOfSightToPosition(transform.position + Vector3.up * 1.6f, 68f, 60);
|
||||
var newBehaviourState = targetLookingAtMe ? 1 : 0;
|
||||
if (targetLookingAtMe) {
|
||||
targetPlayer.JumpToFearLevel(0.75f, true);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace ScarletMansion.GamePatch.FixValues {
|
|||
|
||||
public void Awake(){
|
||||
var weight = target.Props.Weights[1];
|
||||
var value = Plugin.GetConfigDungeon.GetCeilingLightsWeight;
|
||||
var value = Plugin.CurrentConfigDungeon.GetCeilingLightsWeight;
|
||||
weight.MainPathWeight = value;
|
||||
weight.BranchPathWeight = value;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace ScarletMansion.GamePatch.FixValues {
|
|||
|
||||
public void Awake(){
|
||||
var weight = target.Props.Weights[1];
|
||||
var value = Plugin.GetConfigDungeon.GetHallwayLightsWeight;
|
||||
var value = Plugin.CurrentConfigDungeon.GetHallwayLightsWeight;
|
||||
weight.MainPathWeight = value;
|
||||
weight.BranchPathWeight = value;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace ScarletMansion.GamePatch.FixValues
|
|||
{
|
||||
public class FixTreasureRoom : FixBaseClass<LocalPropSetBasic> {
|
||||
public void Awake(){
|
||||
var loot = Plugin.GetConfigDungeon.GetTreasureRoomLoot;
|
||||
var loot = Plugin.CurrentConfigDungeon.GetTreasureRoomLoot;
|
||||
target.propCount = new IntRange(loot.min, loot.max);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,15 @@ namespace ScarletMansion.GamePatch.Items {
|
|||
// check enemies
|
||||
//var enemies = RoundManager.Instance.SpawnedEnemies;
|
||||
var enemies = Physics.OverlapSphere(transform.position, enemyCheckRange, enemyLayerMask);
|
||||
var foundEnemy = enemies.Select(e => e.GetComponent<EnemyAI>()).Any(e => e && !e.isEnemyDead);
|
||||
var enemyScripts = enemies.Select(e => {
|
||||
var script = e.GetComponent<EnemyAI>();
|
||||
if (script != null) return script;
|
||||
|
||||
var collisionScript = e.GetComponent<EnemyAICollisionDetect>();
|
||||
if (collisionScript != null) return collisionScript.mainScript;
|
||||
return null;
|
||||
});
|
||||
var foundEnemy = enemyScripts.Any(e => e && !e.isEnemyDead);
|
||||
|
||||
// found enemy
|
||||
if (foundEnemy){
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace ScarletMansion.GamePatch.Managers {
|
|||
}
|
||||
|
||||
public void OnDungeonComplete(Dungeon dungeon) {
|
||||
Anger(Plugin.GetConfigDungeon.GetMinIndoorEnemySpawnCount);
|
||||
Anger(Plugin.CurrentConfigDungeon.GetMinIndoorEnemySpawnCount);
|
||||
}
|
||||
|
||||
public void TriggerAngerLightBrief(float duration){
|
||||
|
|
|
@ -40,14 +40,14 @@ namespace ScarletMansion.GamePatch {
|
|||
|
||||
public static float ModifyScrapCount(float count){
|
||||
if (DunGenPatch.Patch.active == false) return count;
|
||||
Plugin.logger.LogDebug($"Scrap: {count} -> {count * Plugin.GetConfigDungeon.GetLootMultiplier}");
|
||||
return count * Plugin.GetConfigDungeon.GetLootMultiplier;
|
||||
Plugin.logger.LogDebug($"Scrap: {count} -> {count * Plugin.CurrentConfigDungeon.GetLootMultiplier}");
|
||||
return count * Plugin.CurrentConfigDungeon.GetLootMultiplier;
|
||||
}
|
||||
|
||||
public static float ModifyMapCount(float count){
|
||||
if (DunGenPatch.Patch.active == false) return count;
|
||||
Plugin.logger.LogDebug($"Map Hazards: {count} -> {count * Plugin.GetConfigDungeon.GetMapHazardsMultiplier}");
|
||||
return count * Plugin.GetConfigDungeon.GetMapHazardsMultiplier;
|
||||
Plugin.logger.LogDebug($"Map Hazards: {count} -> {count * Plugin.CurrentConfigDungeon.GetMapHazardsMultiplier}");
|
||||
return count * Plugin.CurrentConfigDungeon.GetMapHazardsMultiplier;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,11 +25,6 @@ namespace ScarletMansion {
|
|||
public List<Item> scrapItems;
|
||||
public List<EnemyType> enemies;
|
||||
|
||||
[Header("DunGen")]
|
||||
public TileSet mayorRegularTileset;
|
||||
public TileSet mayorVanillaTileset;
|
||||
public GraphNode gardenEntranceGraphNode;
|
||||
|
||||
[Header("Main Prefabs")]
|
||||
public GameObject scarletNetworkManager;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -17,6 +17,7 @@ using ScarletMansion.ModPatch;
|
|||
using ScarletMansion.DunGenPatch;
|
||||
using ScarletMansion.GamePatch.Managers;
|
||||
using ScarletMansion.Configs;
|
||||
using DunGen.Graph;
|
||||
|
||||
namespace ScarletMansion {
|
||||
|
||||
|
@ -26,7 +27,7 @@ namespace ScarletMansion {
|
|||
[BepInDependency("evaisa.lethallib", "0.13.2")]
|
||||
[BepInDependency("dev.ladyalice.dungenplus", "1.3.3")]
|
||||
[BepInDependency("dev.ladyalice.scarletmansion.foyer")]
|
||||
|
||||
[BepInDependency("dev.ladyalice.scarletmansion.basement")]
|
||||
//[BepInDependency(ModCompability.advancedCompanyGuid, BepInDependency.DependencyFlags.SoftDependency)]
|
||||
[BepInDependency(ModCompability.lethalConfigGuid, BepInDependency.DependencyFlags.SoftDependency)]
|
||||
[BepInDependency(ModCompability.facilityMeldownGuid, BepInDependency.DependencyFlags.SoftDependency)]
|
||||
|
@ -44,12 +45,9 @@ namespace ScarletMansion {
|
|||
|
||||
public static ConfigMain ConfigMain { get; internal set; }
|
||||
public static ConfigDungeonFoyer ConfigFoyer { get; internal set; }
|
||||
public static ConfigDungeonBasement ConfigBasement { get; internal set; }
|
||||
|
||||
public static IConfigDungeon GetConfigDungeon {
|
||||
get {
|
||||
return ConfigFoyer;
|
||||
}
|
||||
}
|
||||
public static IConfigDungeon CurrentConfigDungeon { get; internal set; }
|
||||
|
||||
public static ManualLogSource logger { get; internal set; }
|
||||
|
||||
|
@ -64,7 +62,8 @@ namespace ScarletMansion {
|
|||
var foyerFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{modGUID}.foyer.cfg"), true);
|
||||
ConfigFoyer = new ConfigDungeonFoyer(foyerFile);
|
||||
|
||||
//MyConfig.SerializerTest();
|
||||
var basementFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{modGUID}.basement.cfg"), true);
|
||||
ConfigBasement = new ConfigDungeonBasement(basementFile);
|
||||
|
||||
ModCompability.GetActiveMods();
|
||||
ModCompability.ActivateActiveMods();
|
||||
|
@ -85,6 +84,7 @@ namespace ScarletMansion {
|
|||
|
||||
harmony.PatchAll(typeof(ConfigMain));
|
||||
harmony.PatchAll(typeof(ConfigDungeonFoyer));
|
||||
harmony.PatchAll(typeof(ConfigDungeonBasement));
|
||||
|
||||
SetupForNetcodePatcher();
|
||||
|
||||
|
@ -93,67 +93,50 @@ namespace ScarletMansion {
|
|||
var dungeonMatchPropeties = ScriptableObject.CreateInstance<DungeonMatchingProperties>();
|
||||
dungeonMatchPropeties.authorNames.Add(new StringWithRarity("Alice", 10));
|
||||
|
||||
/*
|
||||
var itemLevelMatchProperties = ScriptableObject.CreateInstance<LevelMatchingProperties>();
|
||||
foreach(var item in Assets.items){
|
||||
item.stringWithRarity = new StringWithRarity("Alice", 0);
|
||||
itemLevelMatchProperties.authorNames.Add(item.stringWithRarity);
|
||||
}
|
||||
*/
|
||||
|
||||
var sdmLevelMatchProperties = ScriptableObject.CreateInstance<LevelMatchingProperties>();
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Dine", 300));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Rend", 300));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Titan", 69));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Sanguine", 900));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Scarlet Devil Mansion", 900));
|
||||
|
||||
var extendedContent = new List<ExtendedContent>();
|
||||
|
||||
var extendedDungeon = ScriptableObject.CreateInstance<ExtendedDungeonFlow>();
|
||||
extendedDungeon.name = "Scarlet Devil Mansion";
|
||||
extendedDungeon.DungeonName = "Scarlet Devil Mansion";
|
||||
extendedDungeon.DungeonFlow = ConfigFoyer.dungeon;
|
||||
extendedDungeon.FirstTimeDungeonAudio = Assets.entranceAudioClip;
|
||||
extendedDungeon.LevelMatchingProperties = sdmLevelMatchProperties;
|
||||
ExtendedDungeonFlow CreateExtendedDungeonFlow<T>(T configDungeon, string dungeonName, int dineWeight, int rendWeight, int titanWeight) where T: ConfigDungeon<T> {
|
||||
var extendedDungeon = ScriptableObject.CreateInstance<ExtendedDungeonFlow>();
|
||||
extendedDungeon.name = dungeonName;
|
||||
extendedDungeon.DungeonName = dungeonName;
|
||||
extendedDungeon.DungeonFlow = configDungeon.dungeon;
|
||||
extendedDungeon.FirstTimeDungeonAudio = Assets.entranceAudioClip;
|
||||
|
||||
extendedDungeon.DynamicDungeonSizeMinMax = new Vector2(1f, 2f);
|
||||
extendedDungeon.DynamicDungeonSizeLerpRate = 0f;
|
||||
var sdmLevelMatchProperties = ScriptableObject.CreateInstance<LevelMatchingProperties>();
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Dine", dineWeight));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Rend", rendWeight));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Titan", titanWeight));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Sanguine", 900));
|
||||
sdmLevelMatchProperties.planetNames.Add(new StringWithRarity("Scarlet Devil Mansion", 900));
|
||||
extendedDungeon.LevelMatchingProperties = sdmLevelMatchProperties;
|
||||
|
||||
extendedDungeon.GenerateAutomaticConfigurationOptions = true;
|
||||
extendedDungeon.DynamicDungeonSizeMinMax = new Vector2(1f, 2f);
|
||||
extendedDungeon.DynamicDungeonSizeLerpRate = 0f;
|
||||
|
||||
extendedContent.Add(extendedDungeon);
|
||||
extendedDungeon.GenerateAutomaticConfigurationOptions = true;
|
||||
|
||||
// items
|
||||
/*
|
||||
foreach(var item in Assets.items){
|
||||
var extendedItem = ScriptableObject.CreateInstance<ExtendedItem>();
|
||||
extendedItem.Item = item.item;
|
||||
extendedItem.DungeonMatchingProperties = dungeonMatchPropeties;
|
||||
//extendedItem.LevelMatchingProperties = itemLevelMatchProperties;
|
||||
configDungeon.dungeonExtended = extendedDungeon;
|
||||
|
||||
extendedContent.Add(extendedItem);
|
||||
extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(GeneratePathPatch.GeneratePatch);
|
||||
extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(LoadAssetsIntoLevelPatch.AddItemsLocal);
|
||||
extendedDungeon.DungeonEvents.onBeforeDungeonGenerate.AddListener(LoadAssetsIntoLevelPatch.AddEnemiesLocal);
|
||||
|
||||
DunGenPlus.API.AddDunGenExtender(configDungeon.dungeon, configDungeon.dunGenExtender);
|
||||
configDungeon.dunGenExtender.Events.OnModifyDunGenExtenderProperties.AddListener((props, callback) => DunGenPatch.Patch.UpdateDunGenExtenderProperties(configDungeon, props, callback));
|
||||
|
||||
return extendedDungeon;
|
||||
}
|
||||
*/
|
||||
|
||||
extendedContent.Add(CreateExtendedDungeonFlow(ConfigFoyer, "Scarlet Foyer", 200, 100, 30));
|
||||
extendedContent.Add(CreateExtendedDungeonFlow(ConfigBasement, "Scarlet Basement", 100, 200, 30));
|
||||
|
||||
var extendedMod = ExtendedMod.Create("Scarlet Devil Mansion", "Alice", extendedContent.ToArray());
|
||||
|
||||
PatchedContent.RegisterExtendedMod(extendedMod);
|
||||
|
||||
Assets.extendedMod = extendedMod;
|
||||
ConfigFoyer.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(ConfigFoyer.dungeon, ConfigFoyer.dunGenExtender);
|
||||
ConfigFoyer.dunGenExtender.Events.OnModifyDunGenExtenderProperties.AddListener((props, callback) => DunGenPatch.Patch.UpdateDunGenExtenderProperties(ConfigFoyer, props, callback));
|
||||
}
|
||||
|
||||
void SetupForNetcodePatcher(){
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
<Reference Include="DunGenPlus">
|
||||
<HintPath>..\..\..\Libraries\DunGenPlus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DungeonBasement">
|
||||
<HintPath>..\..\..\Libraries\DungeonBasement.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DungeonFoyer">
|
||||
<HintPath>..\..\..\Libraries\DungeonFoyer.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -154,6 +157,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets.cs" />
|
||||
<Compile Include="Configs\ConfigDungeonBasement.cs" />
|
||||
<Compile Include="Configs\ConfigMain.cs" />
|
||||
<Compile Include="Configs\ConfigManager.cs" />
|
||||
<Compile Include="Configs\ConfigDungeonFoyer.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue