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
This commit is contained in:
parent
e38be14578
commit
fd731baf2f
33 changed files with 551 additions and 470 deletions
63
SeichiPatch/ScarletMansionSeichiPatch/Patch.cs
Normal file
63
SeichiPatch/ScarletMansionSeichiPatch/Patch.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace ScarletMansionSeichiPatch {
|
||||
public class Patch {
|
||||
|
||||
public static void Activate() {
|
||||
Plugin.Instance.harmony.PatchAll(typeof(Patch));
|
||||
}
|
||||
|
||||
public static Volume GetVolume(){
|
||||
|
||||
GameObject[] rootGameObjects = null;
|
||||
|
||||
for(var i = 0; i < SceneManager.sceneCount; i++){
|
||||
var scene = SceneManager.GetSceneAt(i);
|
||||
if (scene.name.ToLowerInvariant() == "seichi") {
|
||||
rootGameObjects = scene.GetRootGameObjects();
|
||||
Plugin.logger.LogInfo("Found Seichi scene");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rootGameObjects == null) return null;
|
||||
|
||||
foreach(var root in rootGameObjects){
|
||||
if (root.name.ToLowerInvariant() == "environment") {
|
||||
var item = root.transform.Find("RaphtaliaVolume");
|
||||
if (item != null) {
|
||||
return item.GetComponentInChildren<Volume>(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(RoundManager), "SetPowerOffAtStart")]
|
||||
[HarmonyPostfix]
|
||||
public static void ShipLandedPatch(ref RoundManager __instance){
|
||||
if (!ScarletMansion.DunGenPatch.Patch.active) return;
|
||||
|
||||
var volume = GetVolume();
|
||||
if (volume == null) {
|
||||
Plugin.logger.LogWarning($"Couldn't setup SDM/Seichi compatibility feature");
|
||||
return;
|
||||
}
|
||||
|
||||
volume.enabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue