Silhygames.REPO.FUMO.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Silhygames")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Script Repository for F.U.M.O., a mod for the game 'R.E.P.O.'")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-dev")]
[assembly: AssemblyProduct("FUMO")]
[assembly: AssemblyTitle("Silhygames.REPO.FUMO")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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;
		}
	}
	[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;
		}
	}
}
public class CustomAudioPlayer : MonoBehaviour
{
	public AudioSource AudioSource;

	public AudioClip[] Clips;

	private PhotonView _photonView;

	private void Start()
	{
		_photonView = ((Component)this).GetComponent<PhotonView>();
	}

	public void PlayRandomClipHostOnly()
	{
		if (SemiFunc.IsMasterClientOrSingleplayer())
		{
			PlayRandomClip();
		}
	}

	public void PlayClipHostOnly(int index)
	{
		if (SemiFunc.IsMasterClientOrSingleplayer())
		{
			PlayClip(index);
		}
	}

	public void PlayRandomClip()
	{
		int index = Random.Range(0, Clips.Length);
		PlayClip(index);
	}

	public void PlayClip(int index)
	{
		if (SemiFunc.IsMultiplayer())
		{
			_photonView.RPC("PlayClipRPC", (RpcTarget)0, new object[1] { index });
		}
		else
		{
			PlayClipLocal(index);
		}
	}

	[PunRPC]
	private void PlayClipRPC(int index)
	{
		PlayClipLocal(index);
	}

	private void PlayClipLocal(int index)
	{
		AudioClip val = Clips[index];
		AudioSource.PlayOneShot(val);
	}
}
public class CustomAudioPlayerV2 : MonoBehaviour
{
	public AudioSource AudioSource;

	public AudioClip[] Clips;

	private PhotonView _photonView;

	private bool isPlayingClip = false;

	private void Start()
	{
		_photonView = ((Component)this).GetComponent<PhotonView>();
	}

	public void PlayRandomClipHostOnly()
	{
		if (SemiFunc.IsMasterClientOrSingleplayer())
		{
			PlayRandomClip();
		}
	}

	public void PlayClipHostOnly(int index)
	{
		if (SemiFunc.IsMasterClientOrSingleplayer())
		{
			PlayClip(index);
		}
	}

	public void PlayRandomClip()
	{
		int index = Random.Range(0, Clips.Length);
		PlayClip(index);
	}

	public void PlayClip(int index)
	{
		if (!isPlayingClip)
		{
			if (SemiFunc.IsMultiplayer())
			{
				_photonView.RPC("PlayClipRPC", (RpcTarget)0, new object[1] { index });
			}
			else
			{
				PlayClipLocal(index);
			}
		}
	}

	[PunRPC]
	private void PlayClipRPC(int index)
	{
		PlayClipLocal(index);
	}

	private void PlayClipLocal(int index)
	{
		if (!isPlayingClip)
		{
			AudioClip val = Clips[index];
			if (!((Object)(object)val == (Object)null))
			{
				AudioSource.PlayOneShot(val);
				((MonoBehaviour)this).StartCoroutine(WaitForClipToFinish(val.length));
			}
		}
	}

	private IEnumerator WaitForClipToFinish(float duration)
	{
		isPlayingClip = true;
		yield return (object)new WaitForSeconds(duration);
		isPlayingClip = false;
	}
}
public class AudioPlayerAtParent : MonoBehaviour
{
	[SerializeField]
	private AudioClip clipToPlay;

	[SerializeField]
	private float volume = 1f;

	public void PlayAudioAtParentPosition()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)clipToPlay != (Object)null)
		{
			AudioSource.PlayClipAtPoint(clipToPlay, ((Component)this).transform.position, volume);
		}
		else
		{
			Debug.LogWarning((object)"No audio clip assigned to play.");
		}
	}
}
public class OnPickup : MonoBehaviour
{
	private PhysGrabObject physgrabobject;

	public UnityEvent ScriptToRun;

	private bool grabbed;

	private float lastInvokeTime = float.NegativeInfinity;

	public float invokeCooldown = 15f;

	private void Start()
	{
		physgrabobject = ((Component)this).GetComponent<PhysGrabObject>();
	}

	private void Update()
	{
		if (physgrabobject.grabbed)
		{
			if (!grabbed)
			{
				grabbed = true;
				if (Time.time - lastInvokeTime >= invokeCooldown)
				{
					ScriptToRun.Invoke();
					lastInvokeTime = Time.time;
				}
			}
		}
		else
		{
			grabbed = false;
		}
	}
}
[RequireComponent(typeof(AudioSource))]
public class SeijaFlip : MonoBehaviour
{
	[Header("Rotation Settings")]
	public Transform targetChild;

	public float rotationDuration = 1f;

	[Header("Sound Settings")]
	public AudioClip soundEffect;

	private AudioSource audioSource;

	private Quaternion initialRotation;

	private Quaternion targetRotation;

	public void StartFlip()
	{
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: 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)
		if ((Object)(object)targetChild == (Object)null)
		{
			Debug.LogError((object)"No child assigned to 'targetChild'. Please assign a child transform in the Inspector.");
			return;
		}
		audioSource = ((Component)this).GetComponent<AudioSource>();
		if ((Object)(object)soundEffect != (Object)null)
		{
			audioSource.clip = soundEffect;
			audioSource.Play();
		}
		else
		{
			Debug.LogWarning((object)"No sound effect assigned.");
		}
		initialRotation = targetChild.rotation;
		targetRotation = initialRotation * Quaternion.Euler(180f, 0f, 0f);
		((MonoBehaviour)this).StartCoroutine(RotateOverTime());
	}

	private IEnumerator RotateOverTime()
	{
		float elapsed = 0f;
		while (elapsed < rotationDuration)
		{
			targetChild.rotation = Quaternion.Slerp(initialRotation, targetRotation, elapsed / rotationDuration);
			elapsed += Time.deltaTime;
			yield return null;
		}
		targetChild.rotation = targetRotation;
	}
}
namespace FUMO
{
	[BepInPlugin("Silhygames.REPO.FUMO", "FUMO", "1.0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Prepare yourself. FUMOs are coming.");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Silhygames.REPO.FUMO";

		public const string PLUGIN_NAME = "FUMO";

		public const string PLUGIN_VERSION = "0.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}