Decompiled source of CrowbarForAll v0.1.0

CrowbarForAll.dll

Decompiled 2 hours ago
using System;
using System.Collections.Immutable;
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 Bifrost.LocalizationData;
using CrowbarForAll;
using HarmonyLib;
using ItemsAPI.Builders;
using ItemsAPI.Descriptors;
using ItemsAPI.Helpers;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(global::CrowbarForAll.CrowbarForAll), "CrowbarForAll", "0.1.0", "Shlygly", null)]
[assembly: MelonGame("ReLUGames", "MIMESIS")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Shlygly")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e772a921ea931845552cdcaa033105748a017d48")]
[assembly: AssemblyProduct("CrowbarForAll")]
[assembly: AssemblyTitle("CrowbarForAll")]
[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 CrowbarForAll
{
	public class CrowbarForAll : MelonMod
	{
		public override void OnInitializeMelon()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			VendingMachineDescriptor val = new VendingMachineDescriptor(2900, 180, new Vector3(-7.141f, 0.33200002f, 31.07f), (Quaternion?)new Quaternion(0f, -0.8407627f, 0f, 0.5414039f))
			{
				ItemYOffset = 0.2f,
				ItemXRotation = 60f,
				ItemScale = 1.5f
			};
			VendingMachineBuilder.RegisterVendingMachine(val);
		}
	}
}
namespace CrowbarForAll.Patches
{
	[HarmonyPatch(typeof(Hub), "Start")]
	internal static class Hub_Start
	{
		private static void Postfix()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			DataManager val = ReflectionTools.GetFieldOrProperty<DataManager>((object)Hub.s, "<dataman>k__BackingField") ?? throw new NullReferenceException("DataManager not ready.");
			LocalizationData_MasterData val2 = new LocalizationData_MasterData
			{
				key = "STRING_CROWBAR_VENDING_MACHINE_TOOLTIP",
				ar = "إذا كان بإمكانك الدفاع عن نفسك بها، فيمكنك القتال بها أيضا\u064b!",
				de = "Wenn man sich damit verteidigen kann, kann man auch damit kämpfen!",
				en = "If you can defend yourself with it, you can fight with it too!",
				es = "¡Si puedes defenderte con ella, también puedes pelear con ella!",
				fr = "Si on peut se défendre avec, c'est qu'on peut aussi se battre avec !",
				it = "Se puoi difenderti con essa, puoi anche combattere con essa!",
				ja = "身を守れるなら、戦うことだってできる!",
				ko = "이걸로 자신을 지킬 수 있다면, 싸울 수도 있다!",
				pl = "Jeśli możesz się tym bronić, możesz też tym walczyć!",
				pt_br = "Se dá para se defender com isso, também dá para lutar!",
				ru = "Если этим можно защищаться, значит этим можно и драться!",
				th = "ถ\u0e49าใช\u0e49ป\u0e49องก\u0e31นต\u0e31วได\u0e49 ก\u0e47ใช\u0e49ส\u0e39\u0e49ได\u0e49เหม\u0e37อนก\u0e31น!",
				tr = "Kendini bununla savunabiliyorsan, bununla dövüşebilirsin de!",
				uk = "Якщо цим можна захищатися, то цим можна й битися!",
				vi = "Nếu có thể dùng nó để tự vệ, thì cũng có thể dùng nó để chiến đấu!",
				zh_cn = "既然能用它自卫,那当然也能用它来战斗!",
				zh_tw = "既然能用它自衛,那當然也能拿來戰鬥!"
			};
			ImmutableDictionary<string, LocalizationData_MasterData> value = val.ExcelDataManager.LocalizationDict.Remove(val2.key).Add(val2.key, val2);
			PropertyInfo propertyInfo = typeof(ExcelDataManager).GetProperty("LocalizationDict", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new Exception("Could not find ExcelDataManager.LocalizationDict property.");
			propertyInfo.SetValue(val.ExcelDataManager, value);
			ReflectionTools.SetFieldOrProperty((object)val.ExcelDataManager.ItemInfoDict[2900], "VendingMachineTooltip", (object)val2.key);
		}
	}
}