Decompiled source of RevolverReloadAnimation v0.0.1

revolver.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using GameData;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("revolver")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("revolver")]
[assembly: AssemblyTitle("revolver")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
		}
	}
}
namespace RevolverAnimation
{
	[BepInPlugin("Caera.RevolverReloadAnimation", "RevolverReloadAnimation", "0.0.1")]
	internal sealed class EntryPoint : BasePlugin
	{
		public const string MODNAME = "RevolverReloadAnimation";

		private static Harmony? _harmony;

		public override void Load()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			((BasePlugin)this).Log.LogMessage((object)"Loading RevolverReloadAnimation");
			_harmony = new Harmony("RevolverReloadAnimation");
			_harmony.PatchAll();
			((BasePlugin)this).Log.LogMessage((object)"Loaded RevolverReloadAnimation");
		}
	}
	[HarmonyPatch]
	internal static class RevolverPatch
	{
		[HarmonyPatch(typeof(GameDataInit), "Initialize")]
		[HarmonyPostfix]
		public static void UpdateRevolverReload()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004c: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Expected O, but got Unknown
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Expected O, but got Unknown
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Expected O, but got Unknown
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Expected O, but got Unknown
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Expected O, but got Unknown
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Expected O, but got Unknown
			GearFrontPartDataBlock block = GameDataBlockBase<GearFrontPartDataBlock>.GetBlock(36u);
			block.ReloadSequence = new List<WeaponAnimSequenceItem>();
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0f,
				StringData = "RevolverReload_Revolver_1_anim",
				Type = (eWeaponAnimSequenceItemType)0
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0f,
				StringData = "Front_Revolver_1_reload",
				Type = (eWeaponAnimSequenceItemType)1
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0f,
				StringData = "Front_Revolver_1_reload",
				Type = (eWeaponAnimSequenceItemType)2
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0f,
				StringData = "Front_Revolver_1_reload",
				Type = (eWeaponAnimSequenceItemType)4
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0f,
				StringData = "generic_reload_foley_quick",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0.1f,
				StringData = "revolver_open",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0.2f,
				StringData = "revolver_reload_foley",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0.5f,
				StringData = "revolver_reload_grab_mag",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0.8f,
				StringData = "revolver_mag_in",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 0.85f,
				Type = (eWeaponAnimSequenceItemType)6
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 1.35f,
				StringData = "revolver_close",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 1.5f,
				StringData = "revolver_reload_foley",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 1.55f,
				StringData = "generic_reload_grab_heavy_weapon",
				Type = (eWeaponAnimSequenceItemType)5
			});
			block.ReloadSequence.Add(new WeaponAnimSequenceItem
			{
				TriggerTime = 2f,
				Type = (eWeaponAnimSequenceItemType)7
			});
		}
	}
}