Decompiled source of KesosBitsAndBobs v0.1.0

KesoBitsAndBobs.dll

Decompiled a month 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 Microsoft.CodeAnalysis;
using Unity.VisualScripting;
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: AssemblyCompany("Kesomannen")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("KesoBitsAndBobs")]
[assembly: AssemblyTitle("KesoBitsAndBobs")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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 KesoItems
{
	public class BearTrapValuable : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <Effect>d__15 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PlayerController player;

			public BearTrapValuable <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Expected O, but got Unknown
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					player.rb.MovePosition(((Component)<>4__this).transform.position);
					<>2__current = (object)new WaitForSeconds(<>4__this._duration * 2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this._impactDetector.DestroyObject(true);
					<>4__this._expireSound.Play(((Component)<>4__this).transform.position, 1f, 1f, 1f, 1f);
					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]
		private float _duration;

		[SerializeField]
		private HurtCollider _hurtCollider;

		[SerializeField]
		private LayerMask _groundLayerMask;

		[SerializeField]
		private Transform _groundCheckObject;

		[SerializeField]
		private float _groundCheckRadius;

		[Space]
		[SerializeField]
		private Sound _triggerSound;

		[SerializeField]
		private Sound _slowlyReleaseSound;

		[SerializeField]
		private Sound _expireSound;

		[Space]
		[SerializeField]
		private float _shakeStrength;

		[SerializeField]
		private float _shakeDuration;

		[Space]
		[SerializeField]
		private Animator _animator;

		private PhysGrabObjectImpactDetector _impactDetector;

		private bool _triggered;

		private void Awake()
		{
			_impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>();
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			if (_triggered)
			{
				return;
			}
			PlayerAvatarCollision componentInParent = ((Component)other).GetComponentInParent<PlayerAvatarCollision>();
			if (!((Object)(object)componentInParent == (Object)null))
			{
				Collider[] array = Physics.OverlapSphere(_groundCheckObject.position, _groundCheckRadius, LayerMask.op_Implicit(_groundLayerMask), (QueryTriggerInteraction)1);
				if (array.Length != 0)
				{
					_triggered = true;
					componentInParent.PlayerController.InputDisableTimer = _duration;
					componentInParent.PlayerController.kinematicTimer = _duration;
					((Component)_hurtCollider).gameObject.SetActive(true);
					_triggerSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
					_slowlyReleaseSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f);
					GameDirector.instance.CameraShake.Shake(_shakeStrength, _shakeDuration);
					GameDirector.instance.CameraImpact.Shake(_shakeStrength, _shakeDuration);
					CameraGlitch.Instance.PlayShort();
					((MonoBehaviour)this).StartCoroutine(Effect(componentInParent.PlayerController));
					_animator.Play("Trigger");
					Debug.Log((object)"Bear trap triggered!");
				}
			}
		}

		[IteratorStateMachine(typeof(<Effect>d__15))]
		private IEnumerator Effect(PlayerController player)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Effect>d__15(0)
			{
				<>4__this = this,
				player = player
			};
		}
	}
	[DefaultExecutionOrder(1)]
	public class MegaphoneValuable : MonoBehaviour
	{
		[SerializeField]
		private float _holdDistance;

		[SerializeField]
		private float _volumeBoost;

		[SerializeField]
		private float _distortionLevel;

		private PhysGrabObject _physGrabObject;

		private Rigidbody _rb;

		private void Awake()
		{
			_physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
			_rb = ((Component)this).GetComponent<Rigidbody>();
		}

		private void Update()
		{
			if (!_physGrabObject.grabbed)
			{
				return;
			}
			if (_physGrabObject.grabbedLocal)
			{
				PhysGrabber.instance.OverrideGrabDistance(_holdDistance);
			}
			foreach (PhysGrabber item in _physGrabObject.playerGrabbing)
			{
				if (Object.op_Implicit((Object)(object)item) && !item.isLocal)
				{
					PlayerVoiceChat voiceChat = item.playerAvatar.voiceChat;
					AudioLowPassLogic lowPassLogic = voiceChat.lowPassLogic;
					lowPassLogic.Volume *= _volumeBoost;
					AudioDistortionFilter val = ((Component)voiceChat).GetComponent<AudioDistortionFilter>();
					if ((Object)(object)val == (Object)null)
					{
						val = ComponentHolderProtocol.AddComponent<AudioDistortionFilter>((Object)(object)voiceChat);
					}
					val.distortionLevel = _distortionLevel;
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("KesoBitsAndBobs", "KesoBitsAndBobs", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "KesoBitsAndBobs";

		public const string PLUGIN_NAME = "KesoBitsAndBobs";

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