Decompiled source of DomainExpansion v1.0.0

Mods/DomainExpansion.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using DomainExpansion;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppRUMBLE.Players.Subsystems;
using Il2CppRUMBLE.Poses;
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(Main), "DomainExpansion", "1.0.0", "PeppaStone", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 51, 238)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("DomainExpansion")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DomainExpansion")]
[assembly: AssemblyTitle("DomainExpansion")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace DomainExpansion
{
	public class Main : MelonMod
	{
		[HarmonyPatch(typeof(PlayerPoseSystem), "OnPoseCompleted", new Type[] { typeof(PoseData) })]
		private static class PosePatch
		{
			private static void Postfix(PoseData pose)
			{
				if (((Object)pose).name != "Poses_StructureX")
				{
					AddMove(((Object)pose).name);
				}
			}
		}

		public static string[] moves = new string[4];

		private GameObject soundPlayer;

		private static AudioSource audio;

		private Il2CppAssetBundle assetBundle;

		public static void AddMove(string move)
		{
			for (int i = 0; i < moves.Length - 1; i++)
			{
				moves[i] = moves[i + 1];
			}
			moves[3] = move;
			if (moves[0] == "Sprint" && moves[1] == "Poses_Pillar_015" && moves[2] == "Sprint" && moves[3] == "Poses_Pillar_015" && !audio.isPlaying)
			{
				audio.Play();
			}
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			if (!(sceneName == "Loader"))
			{
				soundPlayer = Object.Instantiate<GameObject>(assetBundle.LoadAsset<GameObject>("DomainExpansion"));
				MelonLogger.Msg(((Object)soundPlayer).name);
				audio = soundPlayer.GetComponent<AudioSource>();
			}
		}

		public override void OnLateInitializeMelon()
		{
			assetBundle = LoadBundle("DomainExpansion.bundles.domainexpansion");
		}

		public Il2CppAssetBundle LoadBundle(string path)
		{
			using Stream stream = ((MelonBase)this).MelonAssembly.Assembly.GetManifestResourceStream(path);
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			return Il2CppAssetBundleManager.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array));
		}
	}
}