Decompiled source of Always Unstoppable Conviction v1.0.0

plugins/AlwaysUnstoppableConviction.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("AlwaysUnstoppableConviction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AlwaysUnstoppableConviction")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b74efcfb-97a5-44a2-88f0-c57d2bb13eb8")]
[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 AlwaysUnstoppableConviction;

[BepInPlugin("nachariah.whiteknuckle.alwaysunstoppableconviction", "AlwaysUnstoppableConviction", "1.0.0")]
public class AlwaysUnstoppableConviction : BaseUnityPlugin
{
	public const string pluginGuid = "nachariah.whiteknuckle.alwaysunstoppableconviction";

	public const string pluginName = "AlwaysUnstoppableConviction";

	public const string pluginVersion = "1.0.0";

	public void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Expected O, but got Unknown
		Harmony val = new Harmony("nachariah.whiteknuckle.alwaysunstoppableconviction");
		Type type = AccessTools.TypeByName("OS_Computer_Interface");
		if (type == null)
		{
			((BaseUnityPlugin)this).Logger.LogError((object)"Failed to find type 'OS_Computer_Interface'.");
			return;
		}
		MethodInfo methodInfo = AccessTools.Method(type, "SetSeed", new Type[1] { typeof(int) }, (Type[])null);
		MethodInfo methodInfo2 = AccessTools.Method(typeof(ComputerPatches), "SetSeed_UCPatch", (Type[])null, (Type[])null);
		if (methodInfo == null || methodInfo2 == null)
		{
			((BaseUnityPlugin)this).Logger.LogError((object)("Failed to locate methods. Original: " + (methodInfo == null) + ", Patch: " + (methodInfo2 == null)));
			return;
		}
		val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"AlwaysUnstoppableConviction Loaded");
	}
}
public class ComputerPatches
{
	public static bool SetSeed_UCPatch(OS_Computer_Interface __instance, int s)
	{
		FieldInfo fieldInfo = AccessTools.Field(typeof(OS_Computer_Interface), "seed");
		if (fieldInfo == null)
		{
			Debug.LogError((object)"Failed to find field 'seed' in OS_Computer_Interface!");
			return true;
		}
		if (__instance.computerID == "PG2")
		{
			fieldInfo.SetValue(__instance, 2929612);
		}
		else
		{
			fieldInfo.SetValue(__instance, s);
		}
		return false;
	}
}