Decompiled source of SuperOldMan BepInEx v1.0.1

SuperOldMan.BepInExMod.dll

Decompiled 2 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 Assets.Scripts.Actors.Player;
using Assets.Scripts.Inventory__Items__Pickups;
using Assets.Scripts.Inventory__Items__Pickups.Stats;
using Assets.Scripts.Menu.Shop;
using Assets.Scripts._Data.Tomes;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("SuperOldMan.BepInExMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyInformationalVersion("1.0.0+f3aa37e2d9a43839204516c8ae961bb2b89d7db9")]
[assembly: AssemblyProduct("SuperOldMan.BepInExMod")]
[assembly: AssemblyTitle("SuperOldMan.BepInExMod")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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 SuperOldMan.BepInExMod
{
	[BepInPlugin("Slimaeus.SuperOldMan", "SuperOldMan", "1.0.1")]
	public class Core : BasePlugin
	{
		[HarmonyPatch(typeof(MyPlayer))]
		public static class PlayerPatches
		{
			[HarmonyPatch("Spawn")]
			[HarmonyPostfix]
			public static void Spawn_Postfix(MyPlayer __instance)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Expected O, but got Unknown
				TomeData val = DataManager.Instance.tomeData[(ETome)14];
				List<StatModifier> val2 = new List<StatModifier>();
				val2.Add(new StatModifier
				{
					stat = (EStat)32,
					modification = 9f,
					modifyType = (EStatModifyType)2
				});
				__instance.inventory.tomeInventory.AddTome(val, val2, (ERarity)0);
				for (int i = 0; i < 98; i++)
				{
					__instance.inventory.tomeInventory.AddTome(val, new List<StatModifier>(), (ERarity)5);
				}
			}
		}

		private const string MyGUID = "Slimaeus.SuperOldMan";

		private const string PluginName = "SuperOldMan";

		private const string VersionString = "1.0.1";

		public override void Load()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			Harmony.CreateAndPatchAll(typeof(PlayerPatches), (string)null);
			ManualLogSource log = ((BasePlugin)this).Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(19, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("SuperOldMan");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.1");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
		}
	}
}