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:
LadyAliceMargatroid 2024-12-15 09:23:53 -08:00
parent e38be14578
commit fd731baf2f
33 changed files with 551 additions and 470 deletions

View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScarletMansionSeichiPatch", "ScarletMansionSeichiPatch\ScarletMansionSeichiPatch.csproj", "{3FB44756-2543-4EE4-ACE4-DA3FDB995192}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FB44756-2543-4EE4-ACE4-DA3FDB995192}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D2692B6E-5996-41ED-BF25-925DB4BF340C}
EndGlobalSection
EndGlobal

View 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;
}
}
}

View file

@ -0,0 +1,54 @@
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ScarletMansionSeichiPatch {
[BepInPlugin(modGUID, modName, modVersion)]
[BepInDependency(targetModGUID, BepInDependency.DependencyFlags.SoftDependency)]
public class Plugin : BaseUnityPlugin {
public const string modGUID = "dev.ladyalice.scarletmansion.seichipatch";
private const string modName = "Scarlet Mansion Seichi Patch";
private const string modVersion = "1.0.0";
public const string targetModGUID = "dev.ladyalice.scarletmansion";
public const string targetModVersion = "1.3.27";
public readonly Harmony harmony = new Harmony(modGUID);
public static Plugin Instance {get; private set;}
public static ManualLogSource logger { get; internal set; }
void Awake(){
if (Instance == null) Instance = this;
logger = BepInEx.Logging.Logger.CreateLogSource(modGUID);
var modLoaded = Chainloader.PluginInfos.ContainsKey(targetModGUID);
if (!modLoaded) return;
bool validVersion;
var pluginInfo = Chainloader.PluginInfos[targetModGUID];
var loadedVersion = pluginInfo.Metadata.Version;
if (string.IsNullOrWhiteSpace(targetModVersion)){
validVersion = true;
} else {
var requiredVersion = new Version(targetModVersion);
validVersion = loadedVersion >= requiredVersion;
}
if (validVersion){
logger.LogInfo($"Plugin {modName} has been added!");
Patch.Activate();
}
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下を通して制御されます
// 制御されます。アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("ScarletMansionSeichiPatch")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ScarletMansionSeichiPatch")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("3fb44756-2543-4ee4-ace4-da3fdb995192")]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// リビジョン
//
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3FB44756-2543-4EE4-ACE4-DA3FDB995192}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ScarletMansionSeichiPatch</RootNamespace>
<AssemblyName>ScarletMansionSeichiPatch</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\..\Libraries\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\Libraries\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-publicized">
<HintPath>..\..\..\Libraries\Assembly-CSharp-publicized.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\..\Libraries\BepInEx.dll</HintPath>
</Reference>
<Reference Include="BepInEx.Harmony">
<HintPath>..\..\..\Libraries\BepInEx.Harmony.dll</HintPath>
</Reference>
<Reference Include="ScarletMansion">
<HintPath>..\..\..\Libraries\ScarletMansion.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Unity.Collections">
<HintPath>..\..\..\Libraries\Unity.Collections.dll</HintPath>
</Reference>
<Reference Include="Unity.Netcode.Components, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Libraries\Unity.Netcode.Components.dll</HintPath>
</Reference>
<Reference Include="Unity.Netcode.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Libraries\Unity.Netcode.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Runtime">
<HintPath>..\..\..\Libraries\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.HighDefinition.Config.Runtime">
<HintPath>..\..\..\Libraries\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.HighDefinition.Runtime">
<HintPath>..\..\..\Libraries\Unity.RenderPipelines.HighDefinition.Runtime.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\Libraries\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\Libraries\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Patch.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>