Decompiled source of Fumos v1.5.3

KisakiBomba.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
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.Logging;
using HarmonyLib;
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 = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: AssemblyCompany("Pekodayo")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("KisakiBomba")]
[assembly: AssemblyTitle("KisakiBomba")]
[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.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;
		}
	}
	[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 KisakiBomba
{
	[BepInPlugin("com.Pekodayo.kisakibomba", "Kisaki Bomba", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("com.Pekodayo.kisakibomba");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(PlayerController))]
	internal static class PlayerControllerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void Start_Prefix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Prefix");
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Postfix");
		}
	}
	public class KisakiBomba : Trap
	{
		[CompilerGenerated]
		private sealed class <BlinkCoroutine>d__31 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public KisakiBomba <>4__this;

			private float <warningIntensity>5__1;

			private float <blinkDuration>5__2;

			private float <elapsed>5__3;

			private Color <emissionColorOn>5__4;

			private float <fadeOutTime>5__5;

			private float <t>5__6;

			private float <fadeOut>5__7;

			private Color <fadeColor>5__8;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <BlinkCoroutine>d__31(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0088: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Expected O, but got Unknown
				//IL_013e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.isBlinking = true;
					<warningIntensity>5__1 = Mathf.Clamp01(<>4__this.explosionTimer / <>4__this.timeTillExplosion);
					<blinkDuration>5__2 = <>4__this.beepInterval * 0.5f;
					<elapsed>5__3 = 0f;
					<emissionColorOn>5__4 = <>4__this.warningColor * <>4__this.emissionIntensity;
					<>4__this.antenaMaterial.SetColor("_EmissionColor", <emissionColorOn>5__4);
					if (<>4__this.debugMode)
					{
					}
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<elapsed>5__3 = 0f;
					<fadeOutTime>5__5 = <blinkDuration>5__2 * 0.4f;
					break;
				case 2:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__3 < <fadeOutTime>5__5 && <>4__this.isBlinking)
				{
					<t>5__6 = <elapsed>5__3 / <fadeOutTime>5__5;
					<fadeOut>5__7 = 1f - <t>5__6;
					<fadeColor>5__8 = <>4__this.warningColor * (<fadeOut>5__7 * <>4__this.emissionIntensity);
					<>4__this.antenaMaterial.SetColor("_EmissionColor", <fadeColor>5__8);
					<elapsed>5__3 += Time.deltaTime;
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				<>4__this.antenaMaterial.SetColor("_EmissionColor", Color.black);
				<>4__this.isBlinking = false;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <TestEmission>d__26 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public KisakiBomba <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TestEmission>d__26(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_004c: 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_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if ((Object)(object)<>4__this.antenaMaterial != (Object)null)
					{
						<>4__this.antenaMaterial.SetColor("_EmissionColor", <>4__this.warningColor * <>4__this.emissionIntensity);
						<>2__current = (object)new WaitForSeconds(1f);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					<>4__this.antenaMaterial.SetColor("_EmissionColor", Color.black);
					break;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public UnityEvent onExplode;

		private ParticleScriptExplosion particleScriptExplosion;

		public MeshRenderer antenaMeshRenderer;

		public Transform center;

		public float explosionRadius = 1.2f;

		public int explosionPlayerDamage = 20;

		public int explosionEnemyDamage = 50;

		public float timeTillExplosion = 5f;

		public bool stunEffect = true;

		public Sound beepSound;

		private bool isBeeping = false;

		private bool isAboutToExplode = false;

		private float beepTimer = 0f;

		private float explosionTimer = 0f;

		private float beepInterval = 1f;

		private Material antenaMaterial;

		public Color normalColor = Color.white;

		public Color warningColor = new Color(1f, 0f, 0f, 1f);

		public float emissionIntensity = 3f;

		private bool isBlinking = false;

		private Coroutine blinkCoroutine;

		private bool debugMode = true;

		private bool isIrreversibleCountdown = false;

		public override void Start()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			((Trap)this).Start();
			particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>();
			FindAntenaMesh();
			SetupAntenaMaterial();
			PhysGrabObjectImpactDetector component = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
			if ((Object)(object)component != (Object)null)
			{
				component.onBreakHeavy.AddListener(new UnityAction(OnHeavyImpact));
				component.onDestroy.AddListener(new UnityAction(Explode));
			}
			if (!debugMode)
			{
			}
		}

		private void FindAntenaMesh()
		{
			if (!((Object)(object)antenaMeshRenderer == (Object)null))
			{
				return;
			}
			Transform val = ((Component)this).transform.Find("antena");
			if ((Object)(object)val != (Object)null)
			{
				antenaMeshRenderer = ((Component)val).GetComponent<MeshRenderer>();
			}
			if ((Object)(object)antenaMeshRenderer == (Object)null)
			{
				MeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshRenderer>();
				MeshRenderer[] array = componentsInChildren;
				foreach (MeshRenderer val2 in array)
				{
					if (((Object)val2).name.ToLower().Contains("antena"))
					{
						antenaMeshRenderer = val2;
						break;
					}
				}
			}
			if ((Object)(object)antenaMeshRenderer == (Object)null)
			{
				antenaMeshRenderer = ((Component)this).GetComponentInChildren<MeshRenderer>();
			}
		}

		private void SetupAntenaMaterial()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)antenaMeshRenderer != (Object)null && (Object)(object)((Renderer)antenaMeshRenderer).material != (Object)null)
			{
				antenaMaterial = new Material(((Renderer)antenaMeshRenderer).material);
				((Renderer)antenaMeshRenderer).material = antenaMaterial;
				if (!antenaMaterial.HasProperty("_EmissionColor"))
				{
					antenaMaterial.shader = Shader.Find("Standard");
				}
				antenaMaterial.EnableKeyword("_EMISSION");
				antenaMaterial.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)1;
				antenaMaterial.SetColor("_EmissionColor", Color.black);
				if (antenaMaterial.HasProperty("_Color"))
				{
					antenaMaterial.SetColor("_Color", normalColor);
				}
				((MonoBehaviour)this).StartCoroutine(TestEmission());
			}
		}

		[IteratorStateMachine(typeof(<TestEmission>d__26))]
		private IEnumerator TestEmission()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <TestEmission>d__26(0)
			{
				<>4__this = this
			};
		}

		public override void Update()
		{
			((Trap)this).Update();
			if ((Object)(object)base.physGrabObject != (Object)null && base.physGrabObject.grabbed && !isBeeping)
			{
				StartBeeping();
			}
			if (!isBeeping)
			{
				return;
			}
			beepTimer += Time.deltaTime;
			if (beepTimer >= beepInterval)
			{
				beepTimer = 0f;
				PlayBeepSound();
				TriggerBlink();
				beepInterval = Mathf.Max(0.1f, beepInterval * 0.8f);
			}
			if (isIrreversibleCountdown || ((Object)(object)base.physGrabObject != (Object)null && base.physGrabObject.grabbed))
			{
				explosionTimer += Time.deltaTime;
				UpdateVisualIntensity();
				if (explosionTimer >= timeTillExplosion)
				{
					Explode();
				}
			}
			else if (!isIrreversibleCountdown)
			{
				StopAllBlinks();
				isBeeping = false;
				explosionTimer = 0f;
				beepInterval = 1f;
				ResetVisuals();
			}
		}

		private void UpdateVisualIntensity()
		{
			float num = Mathf.Clamp01(explosionTimer / timeTillExplosion);
			if (debugMode && Time.frameCount % 60 != 0)
			{
			}
		}

		private void TriggerBlink()
		{
			StopAllBlinks();
			if ((Object)(object)antenaMaterial != (Object)null)
			{
				blinkCoroutine = ((MonoBehaviour)this).StartCoroutine(BlinkCoroutine());
			}
			else if (!debugMode)
			{
			}
		}

		private void StopAllBlinks()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if (blinkCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(blinkCoroutine);
				blinkCoroutine = null;
			}
			isBlinking = false;
			if ((Object)(object)antenaMaterial != (Object)null)
			{
				antenaMaterial.SetColor("_EmissionColor", Color.black);
			}
		}

		[IteratorStateMachine(typeof(<BlinkCoroutine>d__31))]
		private IEnumerator BlinkCoroutine()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <BlinkCoroutine>d__31(0)
			{
				<>4__this = this
			};
		}

		private void OnHeavyImpact()
		{
			if (GameManager.instance.gameMode == 0)
			{
				StartIrreversibleCountdown();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				base.photonView.RPC("StartIrreversibleCountdownRPC", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[PunRPC]
		private void StartIrreversibleCountdownRPC()
		{
			StartIrreversibleCountdown();
		}

		private void StartIrreversibleCountdown()
		{
			if (!isBeeping)
			{
				isIrreversibleCountdown = true;
				StartBeeping();
				if (!debugMode)
				{
				}
			}
		}

		private void StartBeeping()
		{
			if (GameManager.instance.gameMode == 0)
			{
				StartBeepingLogic();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				base.photonView.RPC("StartBeepingRPC", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[PunRPC]
		private void StartBeepingRPC()
		{
			StartBeepingLogic();
		}

		private void StartBeepingLogic()
		{
			isBeeping = true;
			beepTimer = 0f;
			explosionTimer = 0f;
			beepInterval = 1f;
			PlayBeepSound();
			TriggerBlink();
			base.enemyInvestigate = true;
			base.enemyInvestigateRange = 10f;
		}

		private void PlayBeepSound()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (beepSound != null)
			{
				beepSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
			}
		}

		private void ResetVisuals()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)antenaMaterial != (Object)null)
			{
				antenaMaterial.SetColor("_EmissionColor", Color.black);
			}
		}

		private void OnBreak()
		{
			Explode();
		}

		public void Explode()
		{
			if (GameManager.instance.gameMode == 0)
			{
				ExplodeLogic();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				base.photonView.RPC("ExplodeRPC", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[PunRPC]
		private void ExplodeRPC()
		{
			ExplodeLogic();
		}

		private void ExplodeLogic()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (isAboutToExplode)
			{
				return;
			}
			isAboutToExplode = true;
			StopAllBlinks();
			if ((Object)(object)particleScriptExplosion != (Object)null && (Object)(object)center != (Object)null)
			{
				particleScriptExplosion.Spawn(center.position, explosionRadius, explosionPlayerDamage, explosionEnemyDamage, 1f, false, false, 1f);
			}
			UnityEvent obj = onExplode;
			if (obj != null)
			{
				obj.Invoke();
			}
			if (SemiFunc.IsMasterClientOrSingleplayer())
			{
				PhysGrabObjectImpactDetector component = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
				if ((Object)(object)component != (Object)null)
				{
					component.DestroyObject(true);
				}
			}
		}
	}
}

PickSound.dll

Decompiled 4 days 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.Logging;
using HarmonyLib;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: AssemblyCompany("Pekodayo")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PickSound")]
[assembly: AssemblyTitle("PickSound")]
[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.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;
		}
	}
	[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 PickSoundMod
{
	[BepInPlugin("com.Pekodayo.picksound", "Pick Sound Mod for Fumos", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Fumos can talk!");
			Harmony val = new Harmony("com.Pekodayo.picksound");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(PlayerController))]
	internal static class PlayerControllerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void Start_Prefix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Prefix");
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Postfix");
		}
	}
	public class PickSound : MonoBehaviour
	{
		private PhysGrabObject physgrabobject;

		public AudioSource sound;

		private bool grabbed;

		private bool soundPlaying = false;

		private void Start()
		{
			physgrabobject = ((Component)this).GetComponent<PhysGrabObject>();
			if ((Object)(object)sound == (Object)null)
			{
				sound = ((Component)this).GetComponent<AudioSource>();
			}
		}

		private void Update()
		{
			if ((Object)(object)physgrabobject != (Object)null)
			{
				if (soundPlaying && !sound.isPlaying)
				{
					soundPlaying = false;
				}
				if (physgrabobject.grabbed)
				{
					if (!grabbed && !soundPlaying)
					{
						if ((Object)(object)sound != (Object)null)
						{
							sound.Play();
							soundPlaying = true;
						}
						else
						{
							Debug.LogWarning((object)"Sound component is null");
						}
						grabbed = true;
					}
				}
				else
				{
					grabbed = false;
				}
			}
			else
			{
				Debug.LogWarning((object)"PhysGrabObject component is null");
			}
		}
	}
}

WildDoro.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
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.Logging;
using HarmonyLib;
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 = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: AssemblyCompany("Pekodayo")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WildDoro")]
[assembly: AssemblyTitle("WildDoro")]
[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.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;
		}
	}
	[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 WildDoro
{
	public class WildDoro : Trap
	{
		[CompilerGenerated]
		private sealed class <ContinuousBlinkCoroutine>d__47 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public WildDoro <>4__this;

			private float <dangerLevel>5__1;

			private List<Material>.Enumerator <>s__2;

			private Material <mat>5__3;

			private List<Material>.Enumerator <>s__4;

			private Material <mat>5__5;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ContinuousBlinkCoroutine>d__47(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>s__2 = default(List<Material>.Enumerator);
				<mat>5__3 = null;
				<>s__4 = default(List<Material>.Enumerator);
				<mat>5__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_01af: Unknown result type (might be due to invalid IL or missing references)
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Expected O, but got Unknown
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Expected O, but got Unknown
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					<>s__4 = <>4__this.doroMaterials.GetEnumerator();
					try
					{
						while (<>s__4.MoveNext())
						{
							<mat>5__5 = <>s__4.Current;
							if ((Object)(object)<mat>5__5 != (Object)null)
							{
								<mat>5__5.SetColor("_EmissionColor", Color.black);
							}
							<mat>5__5 = null;
						}
					}
					finally
					{
						((IDisposable)<>s__4).Dispose();
					}
					<>s__4 = default(List<Material>.Enumerator);
					<>2__current = (object)new WaitForSeconds(0.5f / <>4__this.blinkSpeed);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					break;
				case 3:
					<>1__state = -1;
					break;
				}
				if (<>4__this.isUnstable && !<>4__this.isExploding)
				{
					<dangerLevel>5__1 = ((<>4__this.grabCount >= <>4__this.maxGrabCount - 1) ? 1f : 0.6f);
					if (<>4__this.doroMaterials.Count > 0)
					{
						<>s__2 = <>4__this.doroMaterials.GetEnumerator();
						try
						{
							while (<>s__2.MoveNext())
							{
								<mat>5__3 = <>s__2.Current;
								if ((Object)(object)<mat>5__3 != (Object)null)
								{
									<mat>5__3.SetColor("_EmissionColor", <>4__this.dangerColor * 2f * <dangerLevel>5__1);
									<mat>5__3.EnableKeyword("_EMISSION");
								}
								<mat>5__3 = null;
							}
						}
						finally
						{
							((IDisposable)<>s__2).Dispose();
						}
						<>s__2 = default(List<Material>.Enumerator);
						<>2__current = (object)new WaitForSeconds(0.5f / <>4__this.blinkSpeed);
						<>1__state = 1;
						return true;
					}
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 3;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[SerializeField]
		public UnityEvent onExplode;

		[SerializeField]
		private ParticleScriptExplosion particleScriptExplosion;

		[SerializeField]
		private Rigidbody rb;

		private MeshRenderer[] meshRenderers;

		private List<Material> doroMaterials = new List<Material>();

		[SerializeField]
		public Transform center;

		public float explosionRadius = 3f;

		public int explosionPlayerDamage = 75;

		public int explosionEnemyDamage = 200;

		public int maxGrabCount = 6;

		public float shakeDuration = 0.5f;

		public float shakeIntensity = 0.05f;

		[SerializeField]
		public Sound squeakSound;

		[SerializeField]
		public Sound bounceSound;

		[SerializeField]
		public Sound warningSound;

		[SerializeField]
		public Sound explodeSound;

		private int grabCount = 0;

		private bool isUnstable = false;

		private bool isShaking = false;

		private bool isAboutToExplode = false;

		private bool isExploding = false;

		private bool isBouncing = false;

		private float shakeTimer = 0f;

		private Quaternion initialRotation;

		private Vector3 initialPosition;

		private Vector3 shakeStartPosition;

		private Quaternion shakeStartRotation;

		private float detonationTimer = 0f;

		private float lastCollisionTime = 0f;

		public float bounceForce = 5f;

		public float bounceTorque = 20f;

		public float bounceInterval = 0.5f;

		private float bounceTimer = 0f;

		public Color normalColor = Color.white;

		public Color warningColor = Color.yellow;

		public Color dangerColor = Color.red;

		[SerializeField]
		public AnimationCurve instabilityVisualCurve;

		public float blinkSpeed = 2f;

		private float totalBounceTime = 10f;

		private float bounceTimeRemaining = 0f;

		private bool hasReachedMaxBounceTime = false;

		private Coroutine blinkCoroutine;

		private bool wasGrabbed = false;

		public override void Start()
		{
			//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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			((Trap)this).Start();
			particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>();
			rb = ((Component)this).GetComponent<Rigidbody>();
			meshRenderers = ((Component)this).GetComponentsInChildren<MeshRenderer>();
			if (meshRenderers != null && meshRenderers.Length != 0)
			{
				MeshRenderer[] array = meshRenderers;
				foreach (MeshRenderer val in array)
				{
					if ((Object)(object)((Renderer)val).material != (Object)null)
					{
						doroMaterials.Add(((Renderer)val).material);
					}
				}
			}
			initialRotation = ((Component)this).transform.rotation;
			initialPosition = ((Component)this).transform.position;
		}

		public override void Update()
		{
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			((Trap)this).Update();
			if ((Object)(object)base.physGrabObject != (Object)null)
			{
				if (base.physGrabObject.grabbed && !wasGrabbed)
				{
					OnGrabbed();
					wasGrabbed = true;
				}
				else if (!base.physGrabObject.grabbed && wasGrabbed)
				{
					wasGrabbed = false;
				}
			}
			if (isUnstable && !hasReachedMaxBounceTime && !base.physGrabObject.grabbed && !isExploding)
			{
				if (bounceTimeRemaining > 0f)
				{
					bounceTimeRemaining -= Time.deltaTime;
					HandleBouncing();
				}
				else
				{
					StopBouncing();
				}
			}
			if (isShaking)
			{
				shakeTimer += Time.deltaTime;
				if (shakeTimer >= shakeDuration)
				{
					shakeTimer = 0f;
					isShaking = false;
					if ((Object)(object)base.physGrabObject != (Object)null && !base.physGrabObject.grabbed)
					{
						((Component)this).transform.rotation = shakeStartRotation;
						((Component)this).transform.position = shakeStartPosition;
					}
				}
				else
				{
					ApplyShakeEffect();
				}
			}
			if (isExploding)
			{
				detonationTimer += Time.deltaTime;
				if (detonationTimer >= 3f)
				{
					Explode();
				}
			}
		}

		private void StopBouncing()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!hasReachedMaxBounceTime)
			{
				hasReachedMaxBounceTime = true;
				if ((Object)(object)rb != (Object)null && SemiFunc.IsMasterClientOrSingleplayer())
				{
					rb.velocity = Vector3.zero;
					rb.angularVelocity = Vector3.zero;
				}
				StartContinuousBlinking();
			}
		}

		private void StartContinuousBlinking()
		{
			if (blinkCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(blinkCoroutine);
			}
			blinkCoroutine = ((MonoBehaviour)this).StartCoroutine(ContinuousBlinkCoroutine());
		}

		[IteratorStateMachine(typeof(<ContinuousBlinkCoroutine>d__47))]
		private IEnumerator ContinuousBlinkCoroutine()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ContinuousBlinkCoroutine>d__47(0)
			{
				<>4__this = this
			};
		}

		private void OnGrabbed()
		{
			if (GameManager.instance.gameMode == 0)
			{
				OnGrabbedLogic();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				base.photonView.RPC("OnGrabbedRPC", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[PunRPC]
		private void OnGrabbedRPC()
		{
			OnGrabbedLogic();
		}

		private void OnGrabbedLogic()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			grabCount++;
			if (!isUnstable && squeakSound != null)
			{
				squeakSound.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f);
			}
			else if (isUnstable && bounceSound != null)
			{
				bounceSound.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f);
			}
			if (grabCount == 4 && !isUnstable)
			{
				isUnstable = true;
				isBouncing = true;
				bounceTimeRemaining = totalBounceTime;
				if (warningSound != null)
				{
					warningSound.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f);
				}
				base.enemyInvestigate = true;
				base.enemyInvestigateRange = 15f;
			}
			else if (grabCount == 5 && isUnstable)
			{
				blinkSpeed *= 1.5f;
				if (warningSound != null)
				{
					warningSound.Play(base.physGrabObject.centerPoint, 1.2f, 1.5f, 1f, 1f);
				}
				base.enemyInvestigateRange = 20f;
			}
			else if (grabCount >= 6 && !isExploding)
			{
				StartExploding();
			}
			shakeStartPosition = ((Component)this).transform.position;
			shakeStartRotation = ((Component)this).transform.rotation;
			isShaking = true;
			shakeTimer = 0f;
		}

		private void StartExploding()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			if (isExploding)
			{
				return;
			}
			isExploding = true;
			detonationTimer = 0f;
			if (blinkCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(blinkCoroutine);
			}
			if (explodeSound != null)
			{
				explodeSound.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f);
			}
			foreach (Material doroMaterial in doroMaterials)
			{
				if ((Object)(object)doroMaterial != (Object)null)
				{
					doroMaterial.SetColor("_EmissionColor", dangerColor * 3f);
					doroMaterial.EnableKeyword("_EMISSION");
				}
			}
			base.enemyInvestigateRange = 25f;
		}

		private void ApplyShakeEffect()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.physGrabObject != (Object)null && !base.physGrabObject.grabbed)
			{
				float num = Mathf.Clamp01((float)grabCount / (float)maxGrabCount);
				float num2 = shakeIntensity * num;
				Vector3 val = new Vector3(Random.Range(0f - num2, num2), Random.Range(0f - num2, num2), Random.Range(0f - num2, num2)) * 100f;
				((Component)this).transform.rotation = shakeStartRotation * Quaternion.Euler(val);
				Vector3 val2 = new Vector3(Random.Range(0f - num2, num2), Random.Range(0f - num2, num2), Random.Range(0f - num2, num2)) * 0.1f;
				((Component)this).transform.position = shakeStartPosition + val2;
			}
		}

		private void HandleBouncing()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)rb != (Object)null))
			{
				return;
			}
			Vector3 val = rb.velocity;
			if (!(((Vector3)(ref val)).magnitude < 1f))
			{
				return;
			}
			bounceTimer += Time.deltaTime;
			if (!(bounceTimer >= bounceInterval))
			{
				return;
			}
			bounceTimer = 0f;
			if (!SemiFunc.IsMasterClientOrSingleplayer())
			{
				return;
			}
			val = new Vector3(Random.Range(-1f, 1f), Random.Range(0.5f, 1f), Random.Range(-1f, 1f));
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			rb.AddForce(normalized * bounceForce, (ForceMode)1);
			rb.AddTorque(Random.insideUnitSphere * bounceTorque, (ForceMode)1);
			if (bounceSound != null)
			{
				if (SemiFunc.IsMultiplayer())
				{
					base.photonView.RPC("PlayBounceSoundRPC", (RpcTarget)0, Array.Empty<object>());
				}
				else
				{
					PlayBounceSound();
				}
			}
		}

		[PunRPC]
		private void PlayBounceSoundRPC()
		{
			PlayBounceSound();
		}

		private void PlayBounceSound()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			if (bounceSound != null)
			{
				bounceSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
			}
		}

		private void OnCollisionEnter(Collision collision)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			if (!isUnstable || hasReachedMaxBounceTime || isExploding || !(Time.time - lastCollisionTime > 0.2f))
			{
				return;
			}
			lastCollisionTime = Time.time;
			if (bounceSound != null)
			{
				bounceSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
			}
			if ((Object)(object)rb != (Object)null)
			{
				Vector3 velocity = rb.velocity;
				if (((Vector3)(ref velocity)).magnitude < bounceForce && SemiFunc.IsMasterClientOrSingleplayer())
				{
					velocity = rb.velocity;
					Vector3 val = Vector3.Reflect(((Vector3)(ref velocity)).normalized, ((ContactPoint)(ref collision.contacts[0])).normal);
					rb.AddForce(val * bounceForce * 0.5f, (ForceMode)1);
					rb.AddTorque(Random.insideUnitSphere * bounceTorque * 0.5f, (ForceMode)1);
				}
			}
		}

		public void Explode()
		{
			if (GameManager.instance.gameMode == 0)
			{
				ExplodeLogic();
			}
			else if (PhotonNetwork.IsMasterClient)
			{
				base.photonView.RPC("ExplodeRPC", (RpcTarget)0, Array.Empty<object>());
			}
		}

		[PunRPC]
		private void ExplodeRPC()
		{
			ExplodeLogic();
		}

		private void ExplodeLogic()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (isAboutToExplode)
			{
				return;
			}
			isAboutToExplode = true;
			if (blinkCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(blinkCoroutine);
			}
			if ((Object)(object)particleScriptExplosion != (Object)null && (Object)(object)center != (Object)null)
			{
				particleScriptExplosion.Spawn(center.position, explosionRadius, explosionPlayerDamage, explosionEnemyDamage, 1f, false, false, 1f);
			}
			UnityEvent obj = onExplode;
			if (obj != null)
			{
				obj.Invoke();
			}
			if (SemiFunc.IsMasterClientOrSingleplayer())
			{
				PhysGrabObjectImpactDetector component = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
				if ((Object)(object)component != (Object)null)
				{
					component.DestroyObject(true);
				}
			}
		}
	}
}
namespace WildDoroMod
{
	[BepInPlugin("com.Pekodayo.WildDoro", "Wild Doro", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("com.Pekodayo.WildDoro");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(PlayerController))]
	internal static class PlayerControllerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void Start_Prefix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Prefix");
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Start_Postfix(PlayerController __instance)
		{
			Plugin.Log.LogDebug((object)$"{__instance} Start Postfix");
		}
	}
}