Decompiled source of Lockout3 v0.3.14

plugins/LockoutMania.dll

Decompiled 3 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("LockoutMania")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LockoutMania")]
[assembly: AssemblyTitle("LockoutMania")]
[assembly: TargetPlatform("Windows7.0")]
[assembly: SupportedOSPlatform("Windows7.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LockoutMania
{
	[BepInPlugin("LockoutMania.GUID", "LockoutMania", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class EntryPoint : BasePlugin
	{
		private Harmony _Harmony = null;

		public override void Load()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			_Harmony = new Harmony("LockoutMania.Harmony");
			_Harmony.PatchAll();
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(32, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin has loaded with ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(_Harmony.GetPatchedMethods().Count());
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" patches!");
			}
			Logger.Info(val);
		}

		public override bool Unload()
		{
			_Harmony.UnpatchSelf();
			return ((BasePlugin)this).Unload();
		}
	}
	internal static class Logger
	{
		private static readonly ManualLogSource _Logger;

		static Logger()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			_Logger = new ManualLogSource("LockoutMania");
			Logger.Sources.Add((ILogSource)(object)_Logger);
		}

		private static string Format(object msg)
		{
			return msg.ToString();
		}

		public static void Info(BepInExInfoLogInterpolatedStringHandler handler)
		{
			_Logger.LogInfo(handler);
		}

		public static void Info(string str)
		{
			_Logger.LogMessage((object)str);
		}

		public static void Info(object data)
		{
			_Logger.LogMessage((object)Format(data));
		}

		public static void Debug(BepInExDebugLogInterpolatedStringHandler handler)
		{
			_Logger.LogDebug(handler);
		}

		public static void Debug(string str)
		{
			_Logger.LogDebug((object)str);
		}

		public static void Debug(object data)
		{
			_Logger.LogDebug((object)Format(data));
		}

		public static void Error(BepInExErrorLogInterpolatedStringHandler handler)
		{
			_Logger.LogError(handler);
		}

		public static void Error(string str)
		{
			_Logger.LogError((object)str);
		}

		public static void Error(object data)
		{
			_Logger.LogError((object)Format(data));
		}

		public static void Fatal(BepInExFatalLogInterpolatedStringHandler handler)
		{
			_Logger.LogFatal(handler);
		}

		public static void Fatal(string str)
		{
			_Logger.LogFatal((object)str);
		}

		public static void Fatal(object data)
		{
			_Logger.LogFatal((object)Format(data));
		}

		public static void Warn(BepInExWarningLogInterpolatedStringHandler handler)
		{
			_Logger.LogWarning(handler);
		}

		public static void Warn(string str)
		{
			_Logger.LogWarning((object)str);
		}

		public static void Warn(object data)
		{
			_Logger.LogWarning((object)Format(data));
		}

		[Conditional("DEBUG")]
		public static void DebugOnly(object data)
		{
			_Logger.LogDebug((object)Format(data));
		}
	}
	[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
	public class Watermark
	{
		public static void Postfix(PUI_Watermark __instance)
		{
			string text = "4.6.2+gitf831086-dirty-main".Remove("x.x.x".Length);
			((TMP_Text)__instance.m_watermarkText).SetText("<color=red>MODDED</color> <color=orange>" + text + "</color>\n" + string.Empty + "<color=#00ae9d>LOCKOUT MANIA</color> <color=orange>(</color><color=#00ae9d>obsessivebun</color><color=orange>)</color>", true);
		}
	}
	[GeneratedCode("VersionInfoGenerator", "2.1.3+git35c0c2a-master")]
	[CompilerGenerated]
	internal static class VersionInfo
	{
		public const string RootNamespace = "LockoutMania";

		public const string Version = "1.0.0";

		public const string VersionPrerelease = null;

		public const string VersionMetadata = null;

		public const string SemVer = "1.0.0";

		public const string GitRevShort = null;

		public const string GitRevLong = null;

		public const string GitBranch = null;

		public const string GitTag = null;

		public const int GitCommitsSinceTag = 0;

		public const bool GitIsDirty = false;
	}
}

plugins/LockoutManiaLights.dll

Decompiled 3 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using Il2CppSystem;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("MadnessLights")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MadnessLights")]
[assembly: AssemblyTitle("MadnessLights")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace MadnessLights
{
	[GeneratedCode("VersionInfoGenerator", "2.0.0+git50a4b1a-master")]
	[CompilerGenerated]
	internal static class VersionInfo
	{
		public const string RootNamespace = "MadnessLights";

		public const string Version = "1.0.0";

		public const string VersionPrerelease = null;

		public const string VersionMetadata = null;

		public const string SemVer = "1.0.0";

		public const string GitRevShort = null;

		public const string GitRevLong = null;

		public const string GitBranch = null;

		public const string GitTag = null;

		public const bool GitIsDirty = false;
	}
}
namespace LockoutManiaLights
{
	[BepInPlugin("LockoutManiaLights", "LockoutManiaLights", "0.0.2")]
	public class Plugin : BasePlugin
	{
		private class LockoutManiaLights : MonoBehaviour
		{
			[CompilerGenerated]
			private sealed class <SetLightIntensity>d__3 : IEnumerator<object>, IDisposable, IEnumerator
			{
				private int <>1__state;

				private object <>2__current;

				public LG_Light obj;

				public LockoutManiaLights <>4__this;

				private bool <hirnudirection>5__2;

				private float <hirnuintensity>5__3;

				private float <origintensity>5__4;

				object IEnumerator<object>.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				object IEnumerator.Current
				{
					[DebuggerHidden]
					get
					{
						return <>2__current;
					}
				}

				[DebuggerHidden]
				public <SetLightIntensity>d__3(int <>1__state)
				{
					this.<>1__state = <>1__state;
				}

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_0147: Unknown result type (might be due to invalid IL or missing references)
					//IL_0151: Expected O, but got Unknown
					//IL_0103: Unknown result type (might be due to invalid IL or missing references)
					//IL_010d: Expected O, but got Unknown
					int num = <>1__state;
					LockoutManiaLights lockoutManiaLights = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<hirnudirection>5__2 = true;
						<hirnuintensity>5__3 = 0.02f;
						((Object)obj).GetInstanceID();
						<origintensity>5__4 = obj.m_intensity;
						goto IL_005c;
					case 1:
						<>1__state = -1;
						goto IL_011d;
					case 2:
						<>1__state = -1;
						goto IL_005c;
					case 3:
						{
							<>1__state = -1;
							return false;
						}
						IL_005c:
						if (lockoutManiaLights._valot | WorldEventManager.GetCondition(10))
						{
							goto IL_011d;
						}
						goto IL_0130;
						IL_011d:
						if (lockoutManiaLights._valot | WorldEventManager.GetCondition(10))
						{
							if ((<hirnuintensity>5__3 > 0.1f) & <hirnudirection>5__2)
							{
								<hirnudirection>5__2 = false;
								<hirnuintensity>5__3 = 0.09f;
							}
							if (<hirnuintensity>5__3 < 0.01f && !<hirnudirection>5__2)
							{
								<hirnudirection>5__2 = true;
							}
							if (<hirnudirection>5__2)
							{
								<hirnuintensity>5__3 += 0.003f;
							}
							if (!<hirnudirection>5__2)
							{
								<hirnuintensity>5__3 -= 0.003f;
							}
							obj.ChangeIntensity(<hirnuintensity>5__3);
							<>2__current = (object)new WaitForSeconds(0.04f);
							<>1__state = 1;
							return true;
						}
						goto IL_0130;
						IL_0130:
						obj.ChangeIntensity(<origintensity>5__4);
						<>2__current = (object)new WaitForSeconds(0.5f);
						<>1__state = 2;
						return true;
					}
				}

				bool IEnumerator.MoveNext()
				{
					//ILSpy generated this explicit interface implementation from .override directive in MoveNext
					return this.MoveNext();
				}

				[DebuggerHidden]
				void IEnumerator.Reset()
				{
					throw new NotSupportedException();
				}
			}

			public bool _valot;

			public void Initialize()
			{
				foreach (LG_Light item in Object.FindObjectsOfType<LG_Light>())
				{
					CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(SetLightIntensity(item)), (Action)null);
				}
			}

			private void Start()
			{
				Debug.Log(Object.op_Implicit("Lights - Camera - Action!"));
			}

			[IteratorStateMachine(typeof(<SetLightIntensity>d__3))]
			private IEnumerator SetLightIntensity(LG_Light obj)
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <SetLightIntensity>d__3(0)
				{
					<>4__this = this,
					obj = obj
				};
			}
		}

		public override void Load()
		{
			LG_Factory.OnFactoryBuildDone += Action.op_Implicit((Action)((BasePlugin)this).AddComponent<LockoutManiaLights>().Initialize);
		}
	}
}