Decompiled source of UnlimitedHarem v1.0.0

BepInEx/plugins/UnlimitedHarem.dll

Decompiled 5 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("UnlimitedHarem")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnlimitedHarem")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9df70249-fc5b-4c89-977d-d9f676d0efd1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace UnlimitedHarem;

[BepInPlugin("cc.lymone.HoL.UnlimitedHarem", "UnlimitedHarem", "1.0.0")]
public class UnlimitedHarem : BaseUnityPlugin
{
	private static ConfigEntry<bool> OtherFamilyLimit;

	private void Start()
	{
		OtherFamilyLimit = ((BaseUnityPlugin)this).Config.Bind<bool>("配置 Config", "其他家族也无限结婚 Is remove other clans marry limit", false, "启用后其他家族成员也能无限结婚。Once it's enabled, other clans members can also get married as many times as they want.");
		Harmony.CreateAndPatchAll(typeof(UnlimitedHarem), (string)null);
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(FormulaData), "isCanNaQie")]
	public static bool unlimited_NaQie_Prefix(ref int ShijiaIndex)
	{
		if (ShijiaIndex == -1)
		{
			ShijiaIndex = -2;
		}
		if (OtherFamilyLimit.Value && ShijiaIndex >= 0)
		{
			ShijiaIndex = -2;
		}
		return true;
	}
}