Updated for v81
This commit is contained in:
parent
f0ef413d2f
commit
d89b6bcec5
24 changed files with 214 additions and 90 deletions
|
|
@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||||
namespace ScarletMansionCoronerPatch {
|
namespace ScarletMansionCoronerPatch {
|
||||||
[BepInPlugin(modGUID, modName, modVersion)]
|
[BepInPlugin(modGUID, modName, modVersion)]
|
||||||
|
|
||||||
[BepInDependency("dev.ladyalice.scarletmansion", "1.3.27")]
|
[BepInDependency("dev.ladyalice.scarletmansion", "2.4.0")]
|
||||||
[BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)]
|
[BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)]
|
||||||
|
|
||||||
public class Plugin : BaseUnityPlugin {
|
public class Plugin : BaseUnityPlugin {
|
||||||
|
|
@ -21,7 +21,7 @@ namespace ScarletMansionCoronerPatch {
|
||||||
private const string modVersion = "1.0.0";
|
private const string modVersion = "1.0.0";
|
||||||
|
|
||||||
public const string targetModGUID = "com.elitemastereric.coroner";
|
public const string targetModGUID = "com.elitemastereric.coroner";
|
||||||
public const string targetModVersion = "2.1.0";
|
public const string targetModVersion = "2.4.0";
|
||||||
|
|
||||||
public readonly Harmony harmony = new Harmony(modGUID);
|
public readonly Harmony harmony = new Harmony(modGUID);
|
||||||
public static Plugin Instance {get; private set;}
|
public static Plugin Instance {get; private set;}
|
||||||
|
|
|
||||||
|
|
@ -46,20 +46,20 @@ namespace ScarletMansionMimicsPatch {
|
||||||
public override bool IsMyInteriorLoaded => ScarletMansion.DunGenPatch.Patch.active;
|
public override bool IsMyInteriorLoaded => ScarletMansion.DunGenPatch.Patch.active;
|
||||||
|
|
||||||
public override void OnMimicCreated(MimicDoor mimicDoor, Doorway doorway) {
|
public override void OnMimicCreated(MimicDoor mimicDoor, Doorway doorway) {
|
||||||
var fixfireexit = doorway.GetComponentInChildren<FixFireExit>(true);
|
var fixfireexit = doorway.GetComponentInChildren<FixFireExit>(true);
|
||||||
fixfireexit.ForcefullyEnableDoorway();
|
fixfireexit.ForcefullyEnableDoorway();
|
||||||
|
|
||||||
var mimicDoorMesh = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "DoorMesh");
|
var mimicDoorMesh = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "DoorMesh");
|
||||||
var mimicFrame = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "Frame");
|
var mimicFrame = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "Frame");
|
||||||
var mimicLight = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "Light");
|
var mimicLight = ScarletMansion.Utility.FindChildRecurvisely(mimicDoor.transform, "Light");
|
||||||
|
|
||||||
if (fixfireexit.EnableVanillaFireExit){
|
if (fixfireexit.EnableVanillaFireExit){
|
||||||
FixDoorwayForVanillaFireExit(fixfireexit, mimicDoorMesh, mimicFrame, mimicLight);
|
FixDoorwayForVanillaFireExit(fixfireexit, mimicDoorMesh, mimicFrame, mimicLight);
|
||||||
} else {
|
} else {
|
||||||
FixDoorwayForSDMFireExit(fixfireexit, mimicDoorMesh, mimicFrame, mimicLight);
|
FixDoorwayForSDMFireExit(fixfireexit, mimicDoorMesh, mimicFrame, mimicLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin.logger.LogDebug("Fixed a doorway for a mimic");
|
Plugin.logger.LogDebug("Fixed a doorway for a mimic");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnMimicAttackStart(MimicDoor mimicDoor, PlayerControllerB playerToAttack) {
|
public override void OnMimicAttackStart(MimicDoor mimicDoor, PlayerControllerB playerToAttack) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace ScarletMansionMimicsPatch {
|
||||||
|
|
||||||
[BepInPlugin(modGUID, modName, modVersion)]
|
[BepInPlugin(modGUID, modName, modVersion)]
|
||||||
|
|
||||||
[BepInDependency("dev.ladyalice.scarletmansion", "1.3.22")]
|
[BepInDependency("dev.ladyalice.scarletmansion", "2.4.0")]
|
||||||
[BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)]
|
[BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)]
|
||||||
|
|
||||||
public class Plugin : BaseUnityPlugin {
|
public class Plugin : BaseUnityPlugin {
|
||||||
|
|
@ -29,7 +29,7 @@ namespace ScarletMansionMimicsPatch {
|
||||||
private const string modVersion = "1.0.0";
|
private const string modVersion = "1.0.0";
|
||||||
|
|
||||||
public const string targetModGUID = "x753.Mimics";
|
public const string targetModGUID = "x753.Mimics";
|
||||||
public const string targetModVersion = "2.6.0";
|
public const string targetModVersion = "2.7.4";
|
||||||
|
|
||||||
public readonly Harmony harmony = new Harmony(modGUID);
|
public readonly Harmony harmony = new Harmony(modGUID);
|
||||||
public static Plugin Instance {get; private set;}
|
public static Plugin Instance {get; private set;}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@
|
||||||
<Reference Include="BepInEx">
|
<Reference Include="BepInEx">
|
||||||
<HintPath>..\..\..\Libraries\BepInEx.dll</HintPath>
|
<HintPath>..\..\..\Libraries\BepInEx.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DunGen-publicized">
|
||||||
|
<HintPath>..\..\..\Libraries\DunGen-publicized.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DunGenPlus">
|
<Reference Include="DunGenPlus">
|
||||||
<HintPath>..\..\..\Libraries\DunGenPlus.dll</HintPath>
|
<HintPath>..\..\..\Libraries\DunGenPlus.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
|
||||||
7
Retrospective
Normal file
7
Retrospective
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
Let me explain quickly how this mod came to be.
|
||||||
|
|
||||||
|
Lethal Company becomes popular. Me and all my boys play LC a lot. I start dabbling on LC mods for things our group wanted. It was my first time ever modding but I have used Unity for a long while so the progress was mostly smooth. Near the completion of the boombox mod, I start thinking of what to do next.
|
||||||
|
|
||||||
|
By that point, me and our group was starting to find our personal issues with LC. In particular, the mansion interior. We expected the mansion to feel like... well... a mansion. We expected many short paths and interconnecting paths. You know, what you expect a mansion to be. But instead the mansion interior is just a regular dungeon with only one super duper long path and barely any interconnecting paths.
|
||||||
|
|
||||||
|
It was then when my friend suggested to make a mansion interior but better. I almost said lmao no shot, but I realized that I already had mansion assets from previous game projects. So I figured why not, let's try reusing the assets into making this interior. And from there, the rest is histoy.
|
||||||
|
|
@ -1,18 +1,19 @@
|
||||||
using System;
|
using DunGen.Graph;
|
||||||
|
using DunGenPlus;
|
||||||
|
using LethalLevelLoader;
|
||||||
|
using LethalLib.Modules;
|
||||||
|
using ScarletMansion.Configs;
|
||||||
|
using ScarletMansion.ModPatch;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Reflection;
|
using static UnityEngine.GraphicsBuffer;
|
||||||
using System.IO;
|
|
||||||
using DunGen.Graph;
|
|
||||||
using LethalLib.Modules;
|
|
||||||
using LethalLevelLoader;
|
|
||||||
using DunGenPlus;
|
|
||||||
using ScarletMansion.ModPatch;
|
|
||||||
using ScarletMansion.Configs;
|
|
||||||
|
|
||||||
namespace ScarletMansion {
|
namespace ScarletMansion {
|
||||||
public static class Assets {
|
public static class Assets {
|
||||||
|
|
@ -33,6 +34,8 @@ namespace ScarletMansion {
|
||||||
// enemy values
|
// enemy values
|
||||||
|
|
||||||
public class Enemy {
|
public class Enemy {
|
||||||
|
public bool initialized;
|
||||||
|
|
||||||
public GameObject enemy;
|
public GameObject enemy;
|
||||||
public EnemyType enemyType;
|
public EnemyType enemyType;
|
||||||
public Func<int> rarityFunc;
|
public Func<int> rarityFunc;
|
||||||
|
|
@ -42,14 +45,15 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
public Enemy(GameObject enemy, TerminalNode node, TerminalKeyword keyword) {
|
public Enemy(GameObject enemy, TerminalNode node, TerminalKeyword keyword) {
|
||||||
this.enemy = enemy;
|
this.enemy = enemy;
|
||||||
|
this.enemyType = enemy.GetComponentInChildren<EnemyAI>().enemyType;
|
||||||
this.terminalNode = node;
|
this.terminalNode = node;
|
||||||
this.terminalKeyword = keyword;
|
this.terminalKeyword = keyword;
|
||||||
|
|
||||||
|
LethalLib.Modules.Enemies.RegisterEnemy(enemyType, 0, Levels.LevelTypes.None, terminalNode, terminalKeyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpawnableEnemyWithRarity GetItemEntry(int rarity){
|
public SpawnableEnemyWithRarity GetItemEntry(int rarity){
|
||||||
var entry = new SpawnableEnemyWithRarity();
|
var entry = new SpawnableEnemyWithRarity(enemyType, rarity);
|
||||||
entry.enemyType = enemyType;
|
|
||||||
entry.rarity = rarity;
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -114,9 +118,8 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
public SpawnableItemWithRarity GetItemRarity(){
|
public SpawnableItemWithRarity GetItemRarity(){
|
||||||
var configEntry = GetConfigScrapItemEntry();
|
var configEntry = GetConfigScrapItemEntry();
|
||||||
var item = new SpawnableItemWithRarity();
|
var rarity = configEntry != null ? configEntry.spawnWeight : 0;
|
||||||
item.spawnableItem = this.item;
|
var item = new SpawnableItemWithRarity(this.item, rarity);
|
||||||
item.rarity = configEntry != null ? configEntry.spawnWeight : 0;
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,7 +208,6 @@ namespace ScarletMansion {
|
||||||
MainAssetBundle = AssetBundle.LoadFromStream(assetStream);
|
MainAssetBundle = AssetBundle.LoadFromStream(assetStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin.ConfigFoyer.dungeon = Load<DungeonFlow>("sdmFoyer");
|
Plugin.ConfigFoyer.dungeon = Load<DungeonFlow>("sdmFoyer");
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,10 @@ namespace ScarletMansion.Configs
|
||||||
"Default",
|
"Default",
|
||||||
"The default generation values. Intended for lobbies with 3+ players.",
|
"The default generation values. Intended for lobbies with 3+ players.",
|
||||||
|
|
||||||
new ChangeInt ( dunGenWidthBase, 120 ),
|
new ChangeInt ( dunGenWidthBase, 140 ),
|
||||||
new ChangeInt ( dunGenLengthBase, 80 ),
|
new ChangeInt ( dunGenLengthBase, 90 ),
|
||||||
new ChangeFloat ( dunGenWidthMultiFactor, 0.5f ),
|
new ChangeFloat ( dunGenWidthMultiFactor, 0.75f ),
|
||||||
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
new ChangeFloat ( dunGenLengthMultiFactor, 0.1428f ),
|
||||||
|
|
||||||
new ChangeInt ( mainPathCount, 3 ),
|
new ChangeInt ( mainPathCount, 3 ),
|
||||||
new ChangeMinMaxInt ( mainPathLength, 6, 7 ),
|
new ChangeMinMaxInt ( mainPathLength, 6, 7 ),
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ namespace ScarletMansion.Configs {
|
||||||
"Default",
|
"Default",
|
||||||
"The default generation values. Intended for lobbies with 3+ players.",
|
"The default generation values. Intended for lobbies with 3+ players.",
|
||||||
|
|
||||||
new ChangeInt ( dunGenWidthBase, 120 ),
|
new ChangeInt ( dunGenWidthBase, 140 ),
|
||||||
new ChangeInt ( dunGenLengthBase, 80 ),
|
new ChangeInt ( dunGenLengthBase, 100 ),
|
||||||
new ChangeFloat ( dunGenWidthMultiFactor, 0.5f ),
|
new ChangeFloat ( dunGenWidthMultiFactor, 0.5f ),
|
||||||
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,5 +133,12 @@ namespace ScarletMansion.DunGenPatch {
|
||||||
return ConnectionResult.Passthrough;
|
return ConnectionResult.Passthrough;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void PriotizeDoorwaysGoingDownward(ref float weight, DoorwayPairCollection param, EventCallbackScenario callback){
|
||||||
|
var diff = param.nextDoor.Position.y - param.previousDoor.Position.y;
|
||||||
|
if (diff < -0.01f){
|
||||||
|
weight *= 1.25f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,11 +62,12 @@ namespace ScarletMansion.GamePatch.Components.TreasureRoom {
|
||||||
prop.ProcessSkipCount(randomStream, 1);
|
prop.ProcessSkipCount(randomStream, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
prop.Process(randomStream, null);
|
var spawned = new List<GameObject>();
|
||||||
|
prop.Process(randomStream, null, ref spawned);
|
||||||
}
|
}
|
||||||
|
|
||||||
// so the children get the process prop cycling as well
|
// so the children get the process prop cycling as well
|
||||||
DunGenPatch.Patch.generatorInstance.ProcessProps(null, prop.transform.GetChild(0).gameObject);
|
Utility.ProcessLocalProps(DunGenPatch.Patch.generatorInstance, prop.transform.GetChild(0).gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack so i can set up the SpawnSycnedObject myself
|
// hack so i can set up the SpawnSycnedObject myself
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ namespace ScarletMansion.GamePatch {
|
||||||
[HarmonyPatch(typeof(StartOfRound), "Awake")]
|
[HarmonyPatch(typeof(StartOfRound), "Awake")]
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
public static void StartOfRound_Start(ref StartOfRound __instance) {
|
public static void StartOfRound_Start(ref StartOfRound __instance) {
|
||||||
|
|
||||||
ScarletYukariTrigger.audioClipIndex = -1;
|
ScarletYukariTrigger.audioClipIndex = -1;
|
||||||
ScarletPlayerControllerB.InitializeScarletScripts();
|
ScarletPlayerControllerB.InitializeScarletScripts();
|
||||||
DoorwayManager.onMainEntranceTeleportSpawnedEvent.ClearTemporaryActionList();
|
DoorwayManager.onMainEntranceTeleportSpawnedEvent.ClearTemporaryActionList();
|
||||||
|
|
@ -118,41 +119,37 @@ namespace ScarletMansion.GamePatch {
|
||||||
.SelectMany(lev => lev.Enemies);
|
.SelectMany(lev => lev.Enemies);
|
||||||
|
|
||||||
var knight = Assets.knight;
|
var knight = Assets.knight;
|
||||||
if (knight.enemyType == null){
|
if (!knight.initialized){
|
||||||
var springItem = allEnemies.FirstOrDefault(e => e.enemyType.name.ToLowerInvariant() == "springman");
|
var springItem = allEnemies.FirstOrDefault(e => e.enemyType.name.ToLowerInvariant() == "springman");
|
||||||
|
|
||||||
if (GameReadNullCheck(springItem, "springman", "Knight enemy will not spawn")) {
|
if (GameReadNullCheck(springItem, "springman", "Knight enemy will not have correct assets")) {
|
||||||
var type = ScriptableObject.Instantiate(springItem.enemyType);
|
var source = springItem.enemyType;
|
||||||
type.name = "Knight";
|
var target = knight.enemy.GetComponent<KnightV2Variant>().enemyType;
|
||||||
type.enemyPrefab = knight.enemy;
|
|
||||||
type.enemyName = "Knight";
|
|
||||||
|
|
||||||
knight.enemyType = type;
|
target.hitBodySFX = source.hitBodySFX;
|
||||||
knight.enemy.GetComponentInChildren<EnemyAI>().enemyType = type;
|
|
||||||
LethalLib.Modules.Enemies.RegisterEnemy(type, 0, Levels.LevelTypes.None, knight.terminalNode, knight.terminalKeyword);
|
knight.initialized = true;
|
||||||
|
Plugin.logger.LogDebug("Initialized knight");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var maid = Assets.maid;
|
var maid = Assets.maid;
|
||||||
if (maid.enemyType == null){
|
if (!maid.initialized){
|
||||||
var butlerItem = allEnemies.FirstOrDefault(e => e.enemyType.name.ToLowerInvariant() == "butler");
|
var butlerItem = allEnemies.FirstOrDefault(e => e.enemyType.name.ToLowerInvariant() == "butler");
|
||||||
|
|
||||||
if (GameReadNullCheck(butlerItem, "butler", "Maid enemy will not spawn")) {
|
if (GameReadNullCheck(butlerItem, "butler", "Maid enemy will not have correct assets")) {
|
||||||
var type = ScriptableObject.Instantiate(butlerItem.enemyType);
|
var source = butlerItem.enemyType;
|
||||||
type.name = "Maid";
|
var target = maid.enemy.GetComponent<MaidVariant>().enemyType;
|
||||||
type.enemyPrefab = maid.enemy;
|
|
||||||
type.enemyName = "Maid";
|
|
||||||
type.pushPlayerForce *= 0.25f;
|
|
||||||
|
|
||||||
maid.enemyType = type;
|
target.hitBodySFX = source.hitBodySFX;
|
||||||
var maidScript = maid.enemy.GetComponentInChildren<MaidVariant>();
|
target.audioClips = source.audioClips;
|
||||||
maidScript.enemyType = type;
|
|
||||||
|
|
||||||
var butlerPrefab = butlerItem.enemyType.enemyPrefab;
|
var butlerScript = source.enemyPrefab.GetComponent<ButlerEnemyAI>();
|
||||||
var butlerScript = butlerPrefab.GetComponent<ButlerEnemyAI>();
|
var maidScript = target.enemyPrefab.GetComponent<MaidVariant>();
|
||||||
Utility.FixParticleSystemMaterialAndChildren(maidScript.stabBloodParticle, butlerScript.stabBloodParticle);
|
Utility.FixParticleSystemMaterialAndChildren(maidScript.stabBloodParticle, butlerScript.stabBloodParticle);
|
||||||
|
|
||||||
LethalLib.Modules.Enemies.RegisterEnemy(type, 0, Levels.LevelTypes.None, maid.terminalNode, maid.terminalKeyword);
|
maid.initialized = true;
|
||||||
|
Plugin.logger.LogDebug("Initialized maid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,23 +316,30 @@ namespace ScarletMansion.GamePatch {
|
||||||
|
|
||||||
var steeldoor = prefabs.FirstOrDefault(p => p.Prefab.name.ToLowerInvariant() == "fancydoormapmodel");
|
var steeldoor = prefabs.FirstOrDefault(p => p.Prefab.name.ToLowerInvariant() == "fancydoormapmodel");
|
||||||
if (GameReadNullCheck(steeldoor, "FancyDoorMapModel", "SDM doors will have missing icons and sounds")){
|
if (GameReadNullCheck(steeldoor, "FancyDoorMapModel", "SDM doors will have missing icons and sounds")){
|
||||||
var interact = steeldoor.Prefab.GetComponentInChildren<InteractTrigger>();
|
var sourceInteract = steeldoor.Prefab.GetComponentInChildren<InteractTrigger>();
|
||||||
var animateTrigger = steeldoor.Prefab.GetComponentInChildren<AnimatedObjectTrigger>();
|
var sourceAnimate = steeldoor.Prefab.GetComponentInChildren<AnimatedObjectTrigger>();
|
||||||
Assets.hoverIcon = interact.hoverIcon;
|
var sourceDoor = steeldoor.Prefab.GetComponentInChildren<DoorLock>();
|
||||||
|
Assets.hoverIcon = sourceInteract.hoverIcon;
|
||||||
|
|
||||||
var boolFalse = animateTrigger.boolFalseAudios;
|
var boolFalse = sourceAnimate.boolFalseAudios;
|
||||||
var boolTrue = animateTrigger.boolTrueAudios;
|
var boolTrue = sourceAnimate.boolTrueAudios;
|
||||||
var secondary = animateTrigger.secondaryAudios;
|
var secondary = sourceAnimate.secondaryAudios;
|
||||||
|
|
||||||
|
var pickingSFX = sourceDoor.pickingLockSFX;
|
||||||
|
var unlockSFX = sourceDoor.unlockSFX;
|
||||||
|
|
||||||
FixDoorway(prefabFixList[0]);
|
FixDoorway(prefabFixList[0]);
|
||||||
FixDoorway(prefabFixList[1]);
|
FixDoorway(prefabFixList[1]);
|
||||||
|
|
||||||
void FixDoorway(GameObject g){
|
void FixDoorway(GameObject g){
|
||||||
var animate = g.GetComponentInChildren<AnimatedObjectTrigger>();
|
var animate = g.GetComponentInChildren<AnimatedObjectTrigger>();
|
||||||
|
|
||||||
animate.boolFalseAudios = boolFalse;
|
animate.boolFalseAudios = boolFalse;
|
||||||
animate.boolTrueAudios = boolTrue;
|
animate.boolTrueAudios = boolTrue;
|
||||||
animate.secondaryAudios = secondary;
|
animate.secondaryAudios = secondary;
|
||||||
|
|
||||||
|
var doorlock = g.GetComponentInChildren<DoorLock>();
|
||||||
|
doorlock.pickingLockSFX = pickingSFX;
|
||||||
|
doorlock.unlockSFX = unlockSFX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,7 @@ namespace ScarletMansion.GamePatch {
|
||||||
} else {
|
} else {
|
||||||
var entryRarity = Mathf.RoundToInt(target.rarity * enemyConfig.spawnWeightStealPercentage);
|
var entryRarity = Mathf.RoundToInt(target.rarity * enemyConfig.spawnWeightStealPercentage);
|
||||||
|
|
||||||
var prevEntry = new SpawnableEnemyWithRarity();
|
var prevEntry = new SpawnableEnemyWithRarity(target.enemyType, target.rarity - entryRarity);
|
||||||
prevEntry.enemyType = target.enemyType;
|
|
||||||
prevEntry.rarity = target.rarity - entryRarity;
|
|
||||||
|
|
||||||
var newEntry = enemy.GetItemEntry(enemyConfig.spawnWeightBase + entryRarity);
|
var newEntry = enemy.GetItemEntry(enemyConfig.spawnWeightBase + entryRarity);
|
||||||
|
|
||||||
EnemyManager.AddEnemy(newEntry);
|
EnemyManager.AddEnemy(newEntry);
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,6 @@ namespace ScarletMansion {
|
||||||
var gameObject = GameObject.Instantiate(enemy.enemyPrefab, position, Quaternion.Euler(0f, yRotation, 0f));
|
var gameObject = GameObject.Instantiate(enemy.enemyPrefab, position, Quaternion.Euler(0f, yRotation, 0f));
|
||||||
var networkScript = gameObject.GetComponentInChildren<NetworkObject>();
|
var networkScript = gameObject.GetComponentInChildren<NetworkObject>();
|
||||||
networkScript.SpawnWithOwnership(ownerID, true);
|
networkScript.SpawnWithOwnership(ownerID, true);
|
||||||
Plugin.logger.LogFatal(ownerID);
|
|
||||||
|
|
||||||
var enemyScript = gameObject.GetComponent<T>();
|
var enemyScript = gameObject.GetComponent<T>();
|
||||||
RoundManager.Instance.SpawnedEnemies.Add(enemyScript);
|
RoundManager.Instance.SpawnedEnemies.Add(enemyScript);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace ScarletMansion.GamePatch.Props {
|
||||||
public GameObject target;
|
public GameObject target;
|
||||||
public Bounds bounds;
|
public Bounds bounds;
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
var b = GetBounds();
|
var b = GetBounds();
|
||||||
var layerMask = LayerMask.GetMask(new string[3] { "Room", "Railing", "MapHazards" });
|
var layerMask = LayerMask.GetMask(new string[3] { "Room", "Railing", "MapHazards" });
|
||||||
if (Physics.CheckBox(b.center, b.extents, transform.rotation, layerMask)){
|
if (Physics.CheckBox(b.center, b.extents, transform.rotation, layerMask)){
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace ScarletMansion.GamePatch.Props {
|
||||||
public List<GameObject> basementFloorPrefabs;
|
public List<GameObject> basementFloorPrefabs;
|
||||||
public GameObject bottomFloorPrefab;
|
public GameObject bottomFloorPrefab;
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
var baseY = KnightSpawnManager.Instance.transform.position.y;
|
var baseY = KnightSpawnManager.Instance.transform.position.y;
|
||||||
var currentY = tile.transform.position.y;
|
var currentY = tile.transform.position.y;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using DunGen;
|
||||||
namespace ScarletMansion.GamePatch.Props {
|
namespace ScarletMansion.GamePatch.Props {
|
||||||
public class LocalPropSetBasic : RandomProp {
|
public class LocalPropSetBasic : RandomProp {
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
var transformCount = transform.childCount;
|
var transformCount = transform.childCount;
|
||||||
var count = Mathf.Clamp(propCount.GetRandom(randomStream), 0, transformCount);
|
var count = Mathf.Clamp(propCount.GetRandom(randomStream), 0, transformCount);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using DunGen;
|
||||||
namespace ScarletMansion.GamePatch.Props {
|
namespace ScarletMansion.GamePatch.Props {
|
||||||
public class LocalPropSingle : RandomProp {
|
public class LocalPropSingle : RandomProp {
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
|
|
||||||
if (randomizePosition){
|
if (randomizePosition){
|
||||||
var x = (float)randomStream.NextDouble() * randomPositionRange;
|
var x = (float)randomStream.NextDouble() * randomPositionRange;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using DunGen;
|
||||||
namespace ScarletMansion.GamePatch.Props {
|
namespace ScarletMansion.GamePatch.Props {
|
||||||
public class RandomPrefabBasic : RandomPrefabBase {
|
public class RandomPrefabBasic : RandomPrefabBase {
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
if (props.Count <= 0) return;
|
if (props.Count <= 0) return;
|
||||||
|
|
||||||
var value = randomStream.Next(props.Count);
|
var value = randomStream.Next(props.Count);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace ScarletMansion.GamePatch.Props {
|
||||||
cycle = value;
|
cycle = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
if (props.Count <= 0) return;
|
if (props.Count <= 0) return;
|
||||||
|
|
||||||
Plugin.logger.LogDebug($"Cycle {cycle}");
|
Plugin.logger.LogDebug($"Cycle {cycle}");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
using DunGen;
|
using DunGen;
|
||||||
|
|
||||||
namespace ScarletMansion {
|
namespace ScarletMansion {
|
||||||
|
|
@ -7,7 +9,7 @@ namespace ScarletMansion {
|
||||||
[AddComponentMenu("DunGen/Random Props/Random Prefab with Scale")]
|
[AddComponentMenu("DunGen/Random Props/Random Prefab with Scale")]
|
||||||
public class RandomPrefabWithScale : RandomProp {
|
public class RandomPrefabWithScale : RandomProp {
|
||||||
|
|
||||||
public override void Process(RandomStream randomStream, Tile tile) {
|
public override void Process(RandomStream randomStream, Tile tile, ref List<GameObject> spawnedObjects) {
|
||||||
|
|
||||||
if (Props.Weights.Count <= 0) return;
|
if (Props.Weights.Count <= 0) return;
|
||||||
var value = this.Props.GetRandom(randomStream, tile.Placement.IsOnMainPath, tile.Placement.NormalizedDepth, null, true, true).Value;
|
var value = this.Props.GetRandom(randomStream, tile.Placement.IsOnMainPath, tile.Placement.NormalizedDepth, null, true, true).Value;
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
[BepInPlugin(modGUID, modName, modVersion)]
|
[BepInPlugin(modGUID, modName, modVersion)]
|
||||||
|
|
||||||
[BepInDependency("imabatby.lethallevelloader", "1.4.5")]
|
[BepInDependency("imabatby.lethallevelloader", "1.6.9")]
|
||||||
[BepInDependency("evaisa.lethallib", "0.13.2")]
|
[BepInDependency("evaisa.lethallib", "1.2.0")]
|
||||||
[BepInDependency("dev.ladyalice.dungenplus", "1.4.0")]
|
[BepInDependency("dev.ladyalice.dungenplus", "1.5.0")]
|
||||||
[BepInDependency("dev.ladyalice.scarletmansion.foyer")]
|
[BepInDependency("dev.ladyalice.scarletmansion.foyer")]
|
||||||
[BepInDependency("dev.ladyalice.scarletmansion.basement")]
|
[BepInDependency("dev.ladyalice.scarletmansion.basement")]
|
||||||
//[BepInDependency(ModCompability.advancedCompanyGuid, BepInDependency.DependencyFlags.SoftDependency)]
|
//[BepInDependency(ModCompability.advancedCompanyGuid, BepInDependency.DependencyFlags.SoftDependency)]
|
||||||
|
|
@ -37,7 +37,7 @@ namespace ScarletMansion {
|
||||||
public class Plugin : BaseUnityPlugin {
|
public class Plugin : BaseUnityPlugin {
|
||||||
public const string modGUID = "dev.ladyalice.scarletmansion";
|
public const string modGUID = "dev.ladyalice.scarletmansion";
|
||||||
private const string modName = "Scarlet Devil Mansion";
|
private const string modName = "Scarlet Devil Mansion";
|
||||||
private const string modVersion = "2.3.0";
|
private const string modVersion = "2.4.0";
|
||||||
|
|
||||||
public readonly Harmony harmony = new Harmony(modGUID);
|
public readonly Harmony harmony = new Harmony(modGUID);
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
harmony.PatchAll(typeof(ConfigPatch));
|
harmony.PatchAll(typeof(ConfigPatch));
|
||||||
|
|
||||||
SetupForNetcodePatcher();
|
//SetupForNetcodePatcher();
|
||||||
|
|
||||||
Assets.LoadAssetBundle();
|
Assets.LoadAssetBundle();
|
||||||
|
|
||||||
|
|
@ -127,6 +127,7 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
extendedContent.Add(CreateExtendedDungeonFlow(ConfigFoyer, "Scarlet Foyer", 100, 200, 30));
|
extendedContent.Add(CreateExtendedDungeonFlow(ConfigFoyer, "Scarlet Foyer", 100, 200, 30));
|
||||||
extendedContent.Add(CreateExtendedDungeonFlow(ConfigBasement, "Scarlet Basement", 200, 100, 30));
|
extendedContent.Add(CreateExtendedDungeonFlow(ConfigBasement, "Scarlet Basement", 200, 100, 30));
|
||||||
|
ConfigBasement.dunGenExtender.Events.OnModifyDoorwayPairWeight.AddListener(DunGenPatch.Patch.PriotizeDoorwaysGoingDownward);
|
||||||
|
|
||||||
var extendedMod = ExtendedMod.Create("Scarlet Devil Mansion", "Alice", extendedContent.ToArray());
|
var extendedMod = ExtendedMod.Create("Scarlet Devil Mansion", "Alice", extendedContent.ToArray());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@
|
||||||
<Reference Include="BepInEx.Harmony">
|
<Reference Include="BepInEx.Harmony">
|
||||||
<HintPath>..\..\..\Libraries\BepInEx.Harmony.dll</HintPath>
|
<HintPath>..\..\..\Libraries\BepInEx.Harmony.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DunGen-publicized">
|
||||||
|
<HintPath>..\..\..\Libraries\DunGen-publicized.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DunGenPlus">
|
<Reference Include="DunGenPlus">
|
||||||
<HintPath>..\..\..\Libraries\DunGenPlus.dll</HintPath>
|
<HintPath>..\..\..\Libraries\DunGenPlus.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
@ -277,10 +280,10 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>copy "D:\Previous Computer\Desktop\LethalCompany Modding\Unity Template\Assets\AssetBundles\scarletmansion" "$(SolutionDir)\scarletmansion"</PreBuildEvent>
|
<PreBuildEvent>copy "D:\Unity Projects\Lethal Company Project\Assets\AssetBundles\scarletmansion" "$(SolutionDir)\scarletmansion"</PreBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>copy "$(TargetPath)" "C:\Users\Jose Garcia\AppData\Roaming\r2modmanPlus-local\LethalCompany\profiles\SDM Debug\BepInEx\plugins\Alice-ScarletDevilMansion\$(TargetName).dll"
|
<PostBuildEvent>copy "$(TargetPath)" "C:\Users\Jose Garcia\AppData\Roaming\r2modmanPlus-local\LethalCompany\profiles\DunGenPlus\BepInEx\plugins\Alice-ScarletDevilMansion\$(TargetName).dll"
|
||||||
copy "$(TargetPath)" "D:\Previous Computer\Desktop\LethalCompany Modding\NetcodePatcher\plugins\$(TargetName).dll"</PostBuildEvent>
|
copy "$(TargetPath)" "D:\Previous Computer\Desktop\LethalCompany Modding\NetcodePatcher\plugins\$(TargetName).dll"</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -142,6 +142,59 @@ namespace ScarletMansion {
|
||||||
|
|
||||||
public static class Utility {
|
public static class Utility {
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/930433/apply-properties-values-from-one-object-to-another-of-the-same-type-automaticall
|
||||||
|
/// <summary>
|
||||||
|
/// Extension for 'Object' that copies the properties to a destination object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source">The source.</param>
|
||||||
|
/// <param name="destination">The destination.</param>
|
||||||
|
public static void CopyProperties(this object source, object destination, params string[] variableDenies)
|
||||||
|
{
|
||||||
|
// If any this null throw an exception
|
||||||
|
if (source == null || destination == null)
|
||||||
|
throw new Exception("Source or/and Destination Objects are null");
|
||||||
|
// Getting the Types of the objects
|
||||||
|
Type typeDest = destination.GetType();
|
||||||
|
Type typeSrc = source.GetType();
|
||||||
|
|
||||||
|
// Iterate the Properties of the source instance and
|
||||||
|
// populate them from their desination counterparts
|
||||||
|
PropertyInfo[] srcProps = typeSrc.GetProperties();
|
||||||
|
foreach (PropertyInfo srcProp in srcProps)
|
||||||
|
{
|
||||||
|
if (!srcProp.CanRead)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PropertyInfo targetProperty = typeDest.GetProperty(srcProp.Name);
|
||||||
|
if (targetProperty == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!targetProperty.CanWrite)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (variableDenies.Contains(targetProperty.Name)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (targetProperty.GetSetMethod(true) != null && targetProperty.GetSetMethod(true).IsPrivate)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ((targetProperty.GetSetMethod().Attributes & MethodAttributes.Static) != 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!targetProperty.PropertyType.IsAssignableFrom(srcProp.PropertyType))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Passed all tests, lets set the value
|
||||||
|
targetProperty.SetValue(destination, srcProp.GetValue(source, null), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static float GetRandomNumber(this System.Random random, double minimum, double maximum) {
|
public static float GetRandomNumber(this System.Random random, double minimum, double maximum) {
|
||||||
return (float)(random.NextDouble() * (maximum - minimum) + minimum);
|
return (float)(random.NextDouble() * (maximum - minimum) + minimum);
|
||||||
}
|
}
|
||||||
|
|
@ -381,6 +434,51 @@ namespace ScarletMansion {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ProcessLocalProps(DungeonGenerator dungeonGenerator, GameObject target){
|
||||||
|
void g__GetHierarchyDepth(Transform transform, ref int depth) {
|
||||||
|
if (transform.parent != null) {
|
||||||
|
depth++;
|
||||||
|
g__GetHierarchyDepth(transform.parent, ref depth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RandomProp[] componentsInChildren = target.GetComponentsInChildren<RandomProp>();
|
||||||
|
List<DungeonGenerator.PropProcessingData> list = new List<DungeonGenerator.PropProcessingData>();
|
||||||
|
foreach (RandomProp randomProp in componentsInChildren)
|
||||||
|
{
|
||||||
|
int hierarchyDepth = 0;
|
||||||
|
g__GetHierarchyDepth(randomProp.transform, ref hierarchyDepth);
|
||||||
|
list.Add(new DungeonGenerator.PropProcessingData
|
||||||
|
{
|
||||||
|
PropComponent = randomProp,
|
||||||
|
HierarchyDepth = hierarchyDepth,
|
||||||
|
OwningTile = randomProp.GetComponentInParent<Tile>()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
list = (from x in list
|
||||||
|
orderby x.HierarchyDepth
|
||||||
|
select x).ToList<DungeonGenerator.PropProcessingData>();
|
||||||
|
List<GameObject> list2 = new List<GameObject>();
|
||||||
|
for (int j = 0; j < list.Count; j++)
|
||||||
|
{
|
||||||
|
DungeonGenerator.PropProcessingData propProcessingData = list[j];
|
||||||
|
if (!(propProcessingData.PropComponent == null))
|
||||||
|
{
|
||||||
|
list2.Clear();
|
||||||
|
propProcessingData.PropComponent.Process(dungeonGenerator.RandomStream, propProcessingData.OwningTile, ref list2);
|
||||||
|
foreach (RandomProp propComponent in list2.SelectMany((GameObject x) => x.GetComponentsInChildren<RandomProp>()).Distinct<RandomProp>())
|
||||||
|
{
|
||||||
|
list.Insert(j + 1, new DungeonGenerator.PropProcessingData
|
||||||
|
{
|
||||||
|
PropComponent = propComponent,
|
||||||
|
HierarchyDepth = propProcessingData.HierarchyDepth + 1,
|
||||||
|
OwningTile = propProcessingData.OwningTile
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
public static GameObject GetParentWithNetworkObject(GameObject g){
|
public static GameObject GetParentWithNetworkObject(GameObject g){
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace ScarletMansionSeichiPatch {
|
||||||
private const string modVersion = "1.0.0";
|
private const string modVersion = "1.0.0";
|
||||||
|
|
||||||
public const string targetModGUID = "dev.ladyalice.scarletmansion";
|
public const string targetModGUID = "dev.ladyalice.scarletmansion";
|
||||||
public const string targetModVersion = "1.3.27";
|
public const string targetModVersion = "2.3.3";
|
||||||
|
|
||||||
public readonly Harmony harmony = new Harmony(modGUID);
|
public readonly Harmony harmony = new Harmony(modGUID);
|
||||||
public static Plugin Instance {get; private set;}
|
public static Plugin Instance {get; private set;}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue