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 GenerousLoddie.Settings;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using Microsoft.CodeAnalysis;
using TeamCherry.Localization;
using UnityEngine;
[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("GenerousLoddie")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8beae59e4163a629e72c0c2f0b211d87e8655199")]
[assembly: AssemblyProduct("GenerousLoddie")]
[assembly: AssemblyTitle("GenerousLoddie")]
[assembly: NeutralResourcesLanguage("EN")]
[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.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")]
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")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace GenerousLoddie
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("io.github.danielstegink.generousloddie", "GenerousLoddie", "1.0.0")]
public class GenerousLoddie : BaseUnityPlugin
{
internal static GenerousLoddie instance;
public const string Id = "io.github.danielstegink.generousloddie";
public static string Name => "GenerousLoddie";
public static string Version => "1.0.0";
private void Awake()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
instance = this;
new Harmony("io.github.danielstegink.generousloddie").PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)("Plugin " + Name + " (io.github.danielstegink.generousloddie) has loaded!"));
}
private void Start()
{
ConfigSettings.Initialize(((BaseUnityPlugin)this).Config);
}
internal void Log(string message)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)message);
}
}
}
namespace GenerousLoddie.Settings
{
public static class ConfigSettings
{
public static ConfigEntry<float> loddieMultiplier;
public static void Initialize(ConfigFile config)
{
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
LocalisedString val = default(LocalisedString);
((LocalisedString)(ref val))..ctor("Mods.io.github.danielstegink.generousloddie", "NAME");
LocalisedString val2 = default(LocalisedString);
((LocalisedString)(ref val2))..ctor("Mods.io.github.danielstegink.generousloddie", "DESC");
float num = 2f;
if (((LocalisedString)(ref val)).Exists && ((LocalisedString)(ref val2)).Exists)
{
loddieMultiplier = config.Bind<float>("Modifier", LocalisedString.op_Implicit(val), num, LocalisedString.op_Implicit(val2));
}
else
{
loddieMultiplier = config.Bind<float>("Modifier", "Multiplier", num, "How much to multiply Loddie's reward by");
}
}
}
}
namespace GenerousLoddie.Helpers
{
[HarmonyPatch(typeof(GetFsmInt), "OnEnter")]
public static class GetFsmInt_OnEnter
{
[HarmonyPostfix]
public static void Postfix(GetFsmInt __instance)
{
if (((Object)__instance.fsm).name.Equals("Pin Challenge") && ((Object)((Component)__instance.fsm).gameObject).name.Equals("Pin Challenge") && ((FsmStateAction)__instance).State.name.Equals("Evaluation"))
{
float num = __instance.storeValue.value;
float num2 = ConfigSettings.loddieMultiplier.Value - 1f;
float num3 = num * num2;
FsmInt storeValue = __instance.storeValue;
storeValue.value += (int)num3;
}
}
}
}