Decompiled source of UnluckyLumble v0.1.1

UnluckyLumble.dll

Decompiled 4 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using Microsoft.CodeAnalysis;
using TeamCherry.Localization;
using UnityEngine;
using UnluckyLumble.Settings;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UnluckyLumble")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyInformationalVersion("0.1.1+0055c0de33ba6aba53d8d39ab85a52ab34d8e8d9")]
[assembly: AssemblyProduct("UnluckyLumble")]
[assembly: AssemblyTitle("UnluckyLumble")]
[assembly: NeutralResourcesLanguage("EN")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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;
		}
	}
	[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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace UnluckyLumble
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("io.github.danielstegink.unluckylumble", "UnluckyLumble", "0.1.1")]
	public class UnluckyLumble : BaseUnityPlugin
	{
		internal static UnluckyLumble instance;

		public const string Id = "io.github.danielstegink.unluckylumble";

		public static string Name => "UnluckyLumble";

		public static string Version => "0.1.1";

		private void Awake()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			new Harmony("io.github.danielstegink.unluckylumble").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)("Plugin " + Name + " (io.github.danielstegink.unluckylumble) has loaded!"));
		}

		private void Start()
		{
			ConfigSettings.Initialize(((BaseUnityPlugin)this).Config);
		}

		internal void Log(string message)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)message);
		}
	}
}
namespace UnluckyLumble.Settings
{
	public static class ConfigSettings
	{
		public static ConfigEntry<int> winChance;

		public static void Initialize(ConfigFile config)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			LocalisedString val = default(LocalisedString);
			((LocalisedString)(ref val))..ctor("Mods.io.github.danielstegink.unluckylumble", "NAME");
			LocalisedString val2 = default(LocalisedString);
			((LocalisedString)(ref val2))..ctor("Mods.io.github.danielstegink.unluckylumble", "DESC");
			int num = 25;
			if (((LocalisedString)(ref val)).Exists && ((LocalisedString)(ref val2)).Exists)
			{
				winChance = config.Bind<int>("Modifier", LocalisedString.op_Implicit(val), num, LocalisedString.op_Implicit(val2));
			}
			else
			{
				winChance = config.Bind<int>("Modifier", "1", num, "2");
			}
		}
	}
}
namespace UnluckyLumble.Helpers
{
	[HarmonyPatch(typeof(BoolTest), "OnEnter")]
	public static class BoolTest_OnEnter
	{
		[HarmonyPrefix]
		public static void Prefix(BoolTest __instance)
		{
			if (((FsmStateAction)__instance).fsm.name.Equals("Play Control") && ((FsmStateAction)__instance).State.name.Equals("Who Won?") && ((NamedVariable)__instance.boolVariable).Name.Equals("Perfect Roll") && Random.Range(1, 101) <= ConfigSettings.winChance.Value)
			{
				__instance.boolVariable.Value = true;
			}
		}
	}
}