Decompiled source of StartWeaponMaxLevel v1.0.0

StartWeaponMaxLevel.MelonLoaderMod.dll

Decompiled a year 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 HarmonyLib;
using Il2Cpp;
using Il2CppAssets.Scripts.Actors.Player;
using Il2CppAssets.Scripts.Inventory__Items__Pickups;
using Il2CppAssets.Scripts.Inventory__Items__Pickups.Weapons;
using MelonLoader;
using Microsoft.CodeAnalysis;
using StartWeaponMaxLevel.MelonLoaderMod;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "StartWeaponMaxLevel", "1.0.0", "Slimaeus", null)]
[assembly: MelonGame("Ved", "Megabonk")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("StartWeaponMaxLevel.MelonLoaderMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ec1b2a2c1e5a1957787e8531421120a98f59de8e")]
[assembly: AssemblyProduct("StartWeaponMaxLevel.MelonLoaderMod")]
[assembly: AssemblyTitle("StartWeaponMaxLevel.MelonLoaderMod")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 StartWeaponMaxLevel.MelonLoaderMod
{
	public class Core : MelonMod
	{
		[HarmonyPatch(typeof(MyPlayer))]
		internal static class MyPlayerPatches
		{
			private const int _weaponMaxLevel = 40;

			[HarmonyPatch("Spawn")]
			[HarmonyPostfix]
			private static void SpawnPostfix(MyPlayer __instance)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: 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)
				ECharacter character = __instance.character;
				WeaponData weapon = DataManager.Instance.characterData[character].weapon;
				WeaponInventory weaponInventory = __instance.inventory.weaponInventory;
				while (weaponInventory.weapons[weapon.eWeapon].level < 40)
				{
					weaponInventory.AddWeapon(weapon, weapon.GetUpgradeOffer((ERarity)5));
				}
			}
		}
	}
}