Decompiled source of DampMine v0.0.8

DragonClawLib.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
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.SceneManagement;

[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: AssemblyCompany("DragonClaw")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+dbc8edd9d08b5fc59703b4afdb18f146082498b5")]
[assembly: AssemblyProduct("DragonClawLib")]
[assembly: AssemblyTitle("DragonClawLib")]
[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;
		}
	}
}
public class CastingPot : MonoBehaviour, IPunObservable
{
	public Transform pivot;

	public float pourThresholdAngle = 60f;

	public bool hasPoured = false;

	public CastingTray tray;

	public MoltenMetal moltenMetalPreset;

	private float initialRotation;

	public PhotonView photonView;

	private void Awake()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		photonView = ((Component)this).GetComponent<PhotonView>();
		initialRotation = pivot.localEulerAngles.x;
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		float x = pivot.localEulerAngles.x;
		float num = Mathf.DeltaAngle(initialRotation, x);
		if (!hasPoured && Mathf.Abs(num) >= pourThresholdAngle && tray.containedValuables.Count == 1)
		{
			if (SemiFunc.IsMultiplayer())
			{
				photonView.RPC("TriggerCasting", (RpcTarget)0, Array.Empty<object>());
			}
			else
			{
				TriggerCasting();
			}
		}
	}

	public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
	{
		if (stream.IsWriting)
		{
			stream.SendNext((object)hasPoured);
		}
		else
		{
			hasPoured = (bool)stream.ReceiveNext();
		}
	}

	[PunRPC]
	private void TriggerCasting()
	{
		if (!hasPoured)
		{
			hasPoured = true;
			tray.ApplyCastingToAll(moltenMetalPreset);
			tray.UpdateIndicatorColor();
			tray.PlayPouringVisuals();
			tray.DisableHurtCollider();
		}
	}
}
public class CastingTray : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <PourVisualCoroutine>d__29 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public CastingTray <>4__this;

		private List<GameObject>.Enumerator <>s__1;

		private GameObject <obj>5__2;

		private float <tFadeIn>5__3;

		private float <alpha>5__4;

		private Vector3 <start>5__5;

		private Vector3 <target>5__6;

		private float <t>5__7;

		private float <progress>5__8;

		private float <tFadeOut>5__9;

		private float <alpha>5__10;

		private List<GameObject>.Enumerator <>s__11;

		private GameObject <obj>5__12;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>s__1 = default(List<GameObject>.Enumerator);
			<obj>5__2 = null;
			<>s__11 = default(List<GameObject>.Enumerator);
			<obj>5__12 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>s__1 = <>4__this.pourVisuals.GetEnumerator();
				try
				{
					while (<>s__1.MoveNext())
					{
						<obj>5__2 = <>s__1.Current;
						if ((Object)(object)<obj>5__2 != (Object)null)
						{
							<obj>5__2.SetActive(true);
						}
						<obj>5__2 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__1).Dispose();
				}
				<>s__1 = default(List<GameObject>.Enumerator);
				if ((Object)(object)<>4__this.instancedLiquidMaterial != (Object)null)
				{
					<tFadeIn>5__3 = 0f;
					goto IL_015b;
				}
				goto IL_0197;
			case 1:
				<>1__state = -1;
				goto IL_015b;
			case 2:
				<>1__state = -1;
				goto IL_0270;
			case 3:
				<>1__state = -1;
				goto IL_0340;
			case 4:
				{
					<>1__state = -1;
					<>s__11 = <>4__this.pourVisuals.GetEnumerator();
					try
					{
						while (<>s__11.MoveNext())
						{
							<obj>5__12 = <>s__11.Current;
							if ((Object)(object)<obj>5__12 != (Object)null)
							{
								<obj>5__12.SetActive(false);
							}
							<obj>5__12 = null;
						}
					}
					finally
					{
						((IDisposable)<>s__11).Dispose();
					}
					<>s__11 = default(List<GameObject>.Enumerator);
					return false;
				}
				IL_0270:
				if (<t>5__7 < <>4__this.pourDuration)
				{
					<t>5__7 += Time.deltaTime;
					<progress>5__8 = Mathf.Clamp01(<t>5__7 / <>4__this.pourDuration);
					<>4__this.liquidLayer.localPosition = Vector3.Lerp(<start>5__5, <target>5__6, <progress>5__8);
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				<>4__this.liquidLayer.localPosition = <target>5__6;
				goto IL_02a4;
				IL_0340:
				if (<tFadeOut>5__9 < <>4__this.fadeDuration)
				{
					<tFadeOut>5__9 += Time.deltaTime;
					<alpha>5__10 = Mathf.Lerp(1f, 0f, <tFadeOut>5__9 / <>4__this.fadeDuration);
					<>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, <alpha>5__10);
					<>2__current = null;
					<>1__state = 3;
					return true;
				}
				<>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, 0f);
				goto IL_037e;
				IL_015b:
				if (<tFadeIn>5__3 < <>4__this.fadeDuration)
				{
					<tFadeIn>5__3 += Time.deltaTime;
					<alpha>5__4 = Mathf.Lerp(0f, 1f, <tFadeIn>5__3 / <>4__this.fadeDuration);
					<>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, <alpha>5__4);
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				<>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, 1f);
				goto IL_0197;
				IL_037e:
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 4;
				return true;
				IL_02a4:
				if ((Object)(object)<>4__this.instancedLiquidMaterial != (Object)null)
				{
					<tFadeOut>5__9 = 0f;
					goto IL_0340;
				}
				goto IL_037e;
				IL_0197:
				if ((Object)(object)<>4__this.liquidLayer != (Object)null)
				{
					<start>5__5 = <>4__this.liquidLayer.localPosition;
					<target>5__6 = <start>5__5 - new Vector3(0f, <>4__this.pourDepth, 0f);
					<t>5__7 = 0f;
					goto IL_0270;
				}
				goto IL_02a4;
			}
		}

		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 CastingPot castingPot;

	public string materialNameSkip;

	public GameObject hurtCollider;

	public List<ValuableObject> containedValuables = new List<ValuableObject>();

	private Dictionary<ValuableObject, int> colliderCounts = new Dictionary<ValuableObject, int>();

	[Header("Pour Visuals")]
	public List<GameObject> pourVisuals;

	public Transform liquidLayer;

	public float pourDepth = 0.5f;

	public float pourDuration = 1.5f;

	private Material instancedLiquidMaterial;

	[SerializeField]
	private float fadeDuration = 0.5f;

	[SerializeField]
	private string transparencyProperty = "_Transparency";

	[Header("Indicator Lamp")]
	public Renderer indicatorLampRenderer;

	public Color redEmission = Color.red;

	public Color orangeEmission = new Color(1f, 0.5f, 0f);

	public Color greenEmission = Color.green;

	private Color lastAppliedEmission = Color.clear;

	private Material indicatorMaterialInstance;

	private void Start()
	{
		if ((Object)(object)indicatorLampRenderer != (Object)null)
		{
			indicatorMaterialInstance = indicatorLampRenderer.material;
			UpdateIndicatorColor();
			PourVisualsInitialize();
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		ValuableObject componentInParent = ((Component)other).GetComponentInParent<ValuableObject>();
		if ((Object)(object)componentInParent == (Object)null)
		{
			return;
		}
		MeshRenderer[] componentsInChildren = ((Component)componentInParent).GetComponentsInChildren<MeshRenderer>();
		MeshRenderer[] array = componentsInChildren;
		foreach (MeshRenderer val in array)
		{
			Material[] sharedMaterials = ((Renderer)val).sharedMaterials;
			foreach (Material val2 in sharedMaterials)
			{
				if (!((Object)(object)val2 == (Object)null) && ((Object)val2).name.StartsWith(materialNameSkip))
				{
					return;
				}
			}
		}
		if (!colliderCounts.ContainsKey(componentInParent))
		{
			colliderCounts[componentInParent] = 0;
		}
		colliderCounts[componentInParent]++;
		if (!containedValuables.Contains(componentInParent))
		{
			containedValuables.Add(componentInParent);
			ValuableDestructionWatcher valuableDestructionWatcher = ((Component)componentInParent).GetComponent<ValuableDestructionWatcher>();
			if ((Object)(object)valuableDestructionWatcher == (Object)null)
			{
				valuableDestructionWatcher = ((Component)componentInParent).gameObject.AddComponent<ValuableDestructionWatcher>();
			}
			if ((Object)(object)valuableDestructionWatcher.tray != (Object)(object)this)
			{
				valuableDestructionWatcher.tray = this;
			}
			valuableDestructionWatcher.valuable = componentInParent;
		}
		UpdateIndicatorColor();
	}

	private void OnTriggerExit(Collider other)
	{
		ValuableObject componentInParent = ((Component)other).GetComponentInParent<ValuableObject>();
		if (!((Object)(object)componentInParent == (Object)null) && colliderCounts.ContainsKey(componentInParent))
		{
			colliderCounts[componentInParent]--;
			if (colliderCounts[componentInParent] <= 0)
			{
				containedValuables.Remove(componentInParent);
				colliderCounts.Remove(componentInParent);
				UpdateIndicatorColor();
			}
		}
	}

	public void OnValuableDestroyed(ValuableObject valuable)
	{
		containedValuables.Remove(valuable);
		colliderCounts.Remove(valuable);
		UpdateIndicatorColor();
	}

	public void UpdateIndicatorColor()
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: 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_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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_0094: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)indicatorMaterialInstance == (Object)null))
		{
			Color val = (((Object)(object)castingPot != (Object)null && castingPot.hasPoured) ? Color.black : ((containedValuables.Count == 0) ? redEmission : ((containedValuables.Count != 1) ? orangeEmission : greenEmission)));
			if (!(val == lastAppliedEmission))
			{
				lastAppliedEmission = val;
				indicatorMaterialInstance.SetColor("_Color", (val == Color.black) ? Color.white : val);
				indicatorMaterialInstance.SetColor("_EmissionColor", val);
			}
		}
	}

	public void ApplyCastingToAll(MoltenMetal metal)
	{
		Debug.Log((object)"Applying molten effect");
		foreach (ValuableObject containedValuable in containedValuables)
		{
			ApplyMoltenEffect(containedValuable, metal);
			UpdateImpactDetector(containedValuable);
		}
	}

	private void ApplyMoltenEffect(ValuableObject obj, MoltenMetal moltenMetalPreset)
	{
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Expected O, but got Unknown
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		MeshRenderer[] componentsInChildren = ((Component)obj).GetComponentsInChildren<MeshRenderer>();
		MeshRenderer[] array = componentsInChildren;
		foreach (MeshRenderer val in array)
		{
			if (!((Renderer)val).enabled)
			{
				continue;
			}
			Material[] array2 = (Material[])(object)new Material[((Renderer)val).sharedMaterials.Length];
			for (int j = 0; j < array2.Length; j++)
			{
				Material val2 = ((Renderer)val).sharedMaterials[j];
				if ((Object)(object)val2 == (Object)null)
				{
					array2[j] = null;
					continue;
				}
				Material val3 = new Material(val2);
				((Object)val3).name = ((Object)moltenMetalPreset.castedMaterial).name;
				val3.shader = moltenMetalPreset.castedMaterial.shader;
				val3.SetFloat("_Overlay_Albedo_Intensity", moltenMetalPreset.castedMaterial.GetFloat("_Overlay_Albedo_Intensity"));
				val3.SetFloat("_Overlay_Effects_Intensity", moltenMetalPreset.castedMaterial.GetFloat("_Overlay_Effects_Intensity"));
				val3.SetTexture("_Overlay_Albedo", moltenMetalPreset.castedMaterial.GetTexture("_Overlay_Albedo"));
				val3.SetColor("_Overlay_Color", moltenMetalPreset.castedMaterial.GetColor("_Overlay_Color"));
				val3.SetTexture("_Overlay_Metallic", moltenMetalPreset.castedMaterial.GetTexture("_Overlay_Metallic"));
				val3.SetTexture("_Overlay_Normal", moltenMetalPreset.castedMaterial.GetTexture("_Overlay_Normal"));
				val3.SetTexture("_Overlay_Roughness", moltenMetalPreset.castedMaterial.GetTexture("_Overlay_Roughness"));
				if (val2.HasProperty("_Metallic"))
				{
					if (val2.GetFloat("_Metallic") > val3.GetFloat("_Metallic"))
					{
						val3.SetFloat("_Metallic", val2.GetFloat("_Metallic"));
					}
					else
					{
						val3.SetFloat("_Metallic", moltenMetalPreset.castedMaterial.GetFloat("_Metallic"));
					}
				}
				if (val2.HasProperty("_BumpScale"))
				{
					if (val2.GetFloat("_BumpScale") > val3.GetFloat("_BumpScale"))
					{
						val3.SetFloat("_BumpScale", val2.GetFloat("_BumpScale"));
					}
					else
					{
						val3.SetFloat("_BumpScale", moltenMetalPreset.castedMaterial.GetFloat("_BumpScale"));
					}
				}
				if (val2.HasProperty("_GlossMapScale"))
				{
					if (val2.GetFloat("_GlossMapScale") > val3.GetFloat("_GlossMapScale"))
					{
						val3.SetFloat("_GlossMapScale", val2.GetFloat("_GlossMapScale"));
					}
					else
					{
						val3.SetFloat("_GlossMapScale", moltenMetalPreset.castedMaterial.GetFloat("_GlossMapScale"));
					}
				}
				array2[j] = val3;
			}
			((Renderer)val).materials = array2;
		}
		obj.dollarValueCurrent *= moltenMetalPreset.valueMultiplier;
		obj.durabilityPreset = moltenMetalPreset.castedDurability;
		obj.audioPreset = moltenMetalPreset.castedAudioPreset;
		obj.particleColors = moltenMetalPreset.castedParticleGradient;
		if (obj.physAttributePreset.mass < moltenMetalPreset.castedPhysAttribute.mass)
		{
			obj.physAttributePreset = moltenMetalPreset.castedPhysAttribute;
			((Component)obj).gameObject.GetComponent<Rigidbody>().mass = obj.physAttributePreset.mass;
		}
	}

	private void UpdateImpactDetector(ValuableObject valuable)
	{
		PhysGrabObjectImpactDetector component = ((Component)valuable).GetComponent<PhysGrabObjectImpactDetector>();
		if (!((Object)(object)component == (Object)null))
		{
			component.durability = valuable.durabilityPreset.durability;
			component.fragility = valuable.durabilityPreset.fragility;
			component.impactAudio = valuable.audioPreset;
			component.impactAudioPitch = valuable.audioPresetPitch;
			if ((Object)(object)component.particles != (Object)null)
			{
				component.particles.gradient = valuable.particleColors;
			}
		}
	}

	public void DisableHurtCollider()
	{
		hurtCollider.SetActive(false);
	}

	public void PlayPouringVisuals()
	{
		((MonoBehaviour)this).StartCoroutine(PourVisualCoroutine());
	}

	private void PourVisualsInitialize()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		Renderer val = default(Renderer);
		foreach (GameObject pourVisual in pourVisuals)
		{
			if ((Object)(object)pourVisual != (Object)null && pourVisual.TryGetComponent<Renderer>(ref val))
			{
				if ((Object)(object)instancedLiquidMaterial == (Object)null)
				{
					instancedLiquidMaterial = new Material(val.sharedMaterial);
				}
				val.material = instancedLiquidMaterial;
			}
			if ((Object)(object)pourVisual != (Object)null)
			{
				pourVisual.SetActive(false);
			}
		}
	}

	[IteratorStateMachine(typeof(<PourVisualCoroutine>d__29))]
	private IEnumerator PourVisualCoroutine()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PourVisualCoroutine>d__29(0)
		{
			<>4__this = this
		};
	}
}
public static class CoroutineRunner
{
	private class Runner : MonoBehaviour
	{
	}

	private static Runner _runner;

	public static Coroutine Run(IEnumerator coroutine)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		if ((Object)(object)_runner == (Object)null)
		{
			GameObject val = new GameObject("CoroutineRunner");
			Object.DontDestroyOnLoad((Object)(object)val);
			_runner = val.AddComponent<Runner>();
			((Object)_runner).hideFlags = (HideFlags)61;
		}
		return ((MonoBehaviour)_runner).StartCoroutine(coroutine);
	}
}
[CreateAssetMenu(menuName = "REPO Mod/Level Ambience Mapping", fileName = "LevelAmbienceMappingAsset")]
public class LevelAmbienceMappingAsset : ScriptableObject
{
	public List<LevelAmbience> customAmbiences = new List<LevelAmbience>();
}
[CreateAssetMenu(fileName = "NewMoltenMetal", menuName = "Phys Object/Molten Metal", order = 2)]
public class MoltenMetal : ScriptableObject
{
	[Header("Value Modification")]
	[Tooltip("Multiplier applied to the object's base value (e.g., 1.1 for +10%)")]
	public float valueMultiplier = 1.1f;

	[Header("Visual Replacement")]
	[Tooltip("Material that replaces the object's opaque parts")]
	public Material castedMaterial;

	[Header("Durability Replacement")]
	[Tooltip("Durability preset to replace the durability")]
	public Durability castedDurability;

	[Header("PhysAttribute Replacement")]
	[Tooltip("PhysAttribute to replace the physics properties like mass")]
	public PhysAttribute castedPhysAttribute;

	[Header("Audio Replacement")]
	[Tooltip("Audio replacement for physical properties")]
	public PhysAudio castedAudioPreset;

	[Header("Impact Particle Gradient Replacement")]
	[Tooltip("Gradient that replaces the particle colors for impacts")]
	public Gradient castedParticleGradient;
}
public class PersistentInjectorBootstrap : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <Inject>d__8 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public PersistentInjectorBootstrap <>4__this;

		private RoomOutlineMappingAsset[] <outlines>5__1;

		private LevelAmbienceMappingAsset[] <ambiences>5__2;

		private int <totalOutlines>5__3;

		private int <totalAmbiences>5__4;

		private RoomOutlineMappingAsset[] <>s__5;

		private int <>s__6;

		private RoomOutlineMappingAsset <asset>5__7;

		private LevelAmbienceMappingAsset[] <>s__8;

		private int <>s__9;

		private LevelAmbienceMappingAsset <asset>5__10;

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

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

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

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<outlines>5__1 = null;
			<ambiences>5__2 = null;
			<>s__5 = null;
			<asset>5__7 = null;
			<>s__8 = null;
			<asset>5__10 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = null;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<outlines>5__1 = Resources.LoadAll<RoomOutlineMappingAsset>("ScriptableObjects/RoomOutlineMappings");
				<ambiences>5__2 = Resources.LoadAll<LevelAmbienceMappingAsset>("ScriptableObjects/LevelAmbiences");
				if ((Object)(object)AudioManager.instance == (Object)null)
				{
					Debug.LogError((object)"[InjectorBootstrap] AudioManager.instance missing during injection!");
					return false;
				}
				if ((Object)(object)Map.Instance == (Object)null)
				{
					Debug.LogError((object)"[InjectorBootstrap] Map.Instance missing during injection!");
					return false;
				}
				<totalOutlines>5__3 = 0;
				<totalAmbiences>5__4 = 0;
				<>s__5 = <outlines>5__1;
				for (<>s__6 = 0; <>s__6 < <>s__5.Length; <>s__6++)
				{
					<asset>5__7 = <>s__5[<>s__6];
					if (<asset>5__7.customOutlines != null)
					{
						Map.Instance.RoomVolumeOutlineCustoms.AddRange(<asset>5__7.customOutlines);
						<totalOutlines>5__3 += <asset>5__7.customOutlines.Count;
					}
					<asset>5__7 = null;
				}
				<>s__5 = null;
				<>s__8 = <ambiences>5__2;
				for (<>s__9 = 0; <>s__9 < <>s__8.Length; <>s__9++)
				{
					<asset>5__10 = <>s__8[<>s__9];
					if (<asset>5__10.customAmbiences != null)
					{
						AudioManager.instance.levelAmbiences.AddRange(<asset>5__10.customAmbiences);
						<totalAmbiences>5__4 += <asset>5__10.customAmbiences.Count;
					}
					<asset>5__10 = null;
				}
				<>s__8 = null;
				Debug.Log((object)$"[InjectorBootstrap] Injected {<totalOutlines>5__3} outlines and {<totalAmbiences>5__4} ambiences.");
				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 <WaitAndInjectRoutine>d__7 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public PersistentInjectorBootstrap <>4__this;

		private int <i>5__1;

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

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

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

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

		private bool MoveNext()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(2f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<i>5__1 = 0;
				break;
			case 2:
				<>1__state = -1;
				<>4__this.injectedThisScene = true;
				return false;
			case 3:
				<>1__state = -1;
				<i>5__1++;
				break;
			}
			if (<i>5__1 < 10)
			{
				if ((Object)(object)AudioManager.instance != (Object)null && (Object)(object)Map.Instance != (Object)null)
				{
					<>2__current = <>4__this.Inject();
					<>1__state = 2;
					return true;
				}
				<>2__current = (object)new WaitForSeconds(0.5f);
				<>1__state = 3;
				return true;
			}
			Debug.LogWarning((object)"[InjectorBootstrap] Timeout waiting for systems to initialize.");
			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();
		}
	}

	private static bool created;

	private static PersistentInjectorBootstrap instance;

	private bool injectedThisScene = false;

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	private static void Init()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		if (!created)
		{
			GameObject val = new GameObject("PersistentInjector");
			Object.DontDestroyOnLoad((Object)(object)val);
			instance = val.AddComponent<PersistentInjectorBootstrap>();
			created = true;
			Debug.Log((object)"[InjectorBootstrap] Persistent injector created.");
		}
	}

	private void OnEnable()
	{
		SceneManager.activeSceneChanged += OnSceneChanged;
	}

	private void OnDisable()
	{
		SceneManager.activeSceneChanged -= OnSceneChanged;
	}

	private void OnSceneChanged(Scene oldScene, Scene newScene)
	{
		injectedThisScene = false;
		((MonoBehaviour)this).StartCoroutine(WaitAndInjectRoutine());
	}

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

	[IteratorStateMachine(typeof(<Inject>d__8))]
	private IEnumerator Inject()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <Inject>d__8(0)
		{
			<>4__this = this
		};
	}
}
[CreateAssetMenu(menuName = "REPO Mod/Room Outline Mapping", fileName = "RoomOutlineMappingAsset")]
public class RoomOutlineMappingAsset : ScriptableObject
{
	public List<RoomVolumeOutlineCustom> customOutlines = new List<RoomVolumeOutlineCustom>();
}
public class ValuableDestructionWatcher : MonoBehaviour
{
	public CastingTray tray;

	public ValuableObject valuable;

	private void OnDestroy()
	{
		if ((Object)(object)tray != (Object)null && (Object)(object)valuable != (Object)null)
		{
			tray.OnValuableDestroyed(valuable);
		}
	}
}
namespace DragonClawLib
{
	public class CustomValuableLogic : MonoBehaviour
	{
		public Material defaultMaterial;

		public Material heldMaterial;

		private Renderer objectRenderer;

		private PhysGrabObject physGrabObject;

		private PhotonView photonView;

		private bool isHeld = false;

		private void Start()
		{
			photonView = ((Component)this).GetComponent<PhotonView>();
			physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
			objectRenderer = ((Component)this).GetComponentInChildren<Renderer>();
			ApplyMaterial(defaultMaterial);
		}

		private void Update()
		{
			if (!SemiFunc.IsMultiplayer())
			{
				UpdateHeldStateLocal();
			}
			else if (photonView.IsMine)
			{
				CheckHeldStateMultiplayer();
			}
		}

		private void UpdateHeldStateLocal()
		{
			bool flag = PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject;
			if (flag != isHeld)
			{
				isHeld = flag;
				ApplyMaterial(isHeld ? heldMaterial : defaultMaterial);
			}
		}

		private void CheckHeldStateMultiplayer()
		{
			bool flag = PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject;
			if (flag != isHeld)
			{
				isHeld = flag;
				photonView.RPC("SyncHeldMaterial", (RpcTarget)0, new object[1] { isHeld });
			}
		}

		[PunRPC]
		public void SyncHeldMaterial(bool held)
		{
			ApplyMaterial(held ? heldMaterial : defaultMaterial);
		}

		private void ApplyMaterial(Material mat)
		{
			if ((Object)(object)objectRenderer != (Object)null && (Object)(object)mat != (Object)null)
			{
				objectRenderer.material = mat;
			}
		}
	}
	public static class MeshGenerator
	{
		private static Mesh frustumMesh;

		public static Mesh GetFrustumMesh(float fov, float aspect, float near, float far)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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)
			if ((Object)(object)frustumMesh != (Object)null)
			{
				return frustumMesh;
			}
			frustumMesh = new Mesh();
			((Object)frustumMesh).name = "ProjectorFrustum";
			float num = Mathf.Tan(MathF.PI / 180f * fov * 0.5f);
			float num2 = num * near * 2f;
			float num3 = num2 * aspect;
			float num4 = num * far * 2f;
			float num5 = num4 * aspect;
			Vector3[] vertices = (Vector3[])(object)new Vector3[8]
			{
				new Vector3((0f - num3) / 2f, (0f - num2) / 2f, 0f - near),
				new Vector3(num3 / 2f, (0f - num2) / 2f, 0f - near),
				new Vector3(num3 / 2f, num2 / 2f, 0f - near),
				new Vector3((0f - num3) / 2f, num2 / 2f, 0f - near),
				new Vector3((0f - num5) / 2f, (0f - num4) / 2f, 0f - far),
				new Vector3(num5 / 2f, (0f - num4) / 2f, 0f - far),
				new Vector3(num5 / 2f, num4 / 2f, 0f - far),
				new Vector3((0f - num5) / 2f, num4 / 2f, 0f - far)
			};
			int[] triangles = new int[36]
			{
				0, 2, 1, 0, 3, 2, 4, 5, 6, 4,
				6, 7, 0, 1, 5, 0, 5, 4, 2, 3,
				7, 2, 7, 6, 1, 2, 6, 1, 6, 5,
				3, 0, 4, 3, 4, 7
			};
			frustumMesh.vertices = vertices;
			frustumMesh.triangles = triangles;
			frustumMesh.RecalculateNormals();
			return frustumMesh;
		}
	}
	public class ModularValuableBuilder : MonoBehaviourPun
	{
		private Rigidbody rb;

		[Header("Names of child parts (e.g., Valuable_Slot_Blade, Valuable_Slot_Guard, Valuable_Slot_Hilt)")]
		public List<string> partGroupNames = new List<string>();

		private bool buildOnAwake = true;

		private void Awake()
		{
			rb = ((Component)this).GetComponent<Rigidbody>();
			if ((Object)(object)rb != (Object)null)
			{
				rb.useGravity = false;
				rb.isKinematic = true;
			}
			if (buildOnAwake && SemiFunc.IsMasterClientOrSingleplayer())
			{
				BuildAndSyncParts();
			}
		}

		private void Start()
		{
			buildOnAwake = false;
			if ((Object)(object)rb != (Object)null)
			{
				rb.useGravity = true;
				rb.isKinematic = false;
			}
		}

		public void BuildAndSyncParts()
		{
			List<int> list = new List<int>();
			foreach (string partGroupName in partGroupNames)
			{
				Transform val = ((Component)this).transform.Find(partGroupName);
				if ((Object)(object)val == (Object)null || val.childCount == 0)
				{
					Debug.LogWarning((object)("[ModularBuilder] Missing or empty group '" + partGroupName + "'"));
					list.Add(-1);
				}
				else
				{
					int num = Random.Range(0, val.childCount);
					list.Add(num);
					EnableOnly(val, num);
				}
			}
			((MonoBehaviourPun)this).photonView.RPC("RPC_SyncParts", (RpcTarget)4, new object[1] { list.ToArray() });
		}

		[PunRPC]
		private void RPC_SyncParts(int[] selectedIndexes)
		{
			for (int i = 0; i < partGroupNames.Count && i < selectedIndexes.Length; i++)
			{
				string text = partGroupNames[i];
				int num = selectedIndexes[i];
				Transform val = ((Component)this).transform.Find(text);
				if (!((Object)(object)val == (Object)null) && num >= 0 && num < val.childCount)
				{
					EnableOnly(val, num);
				}
			}
		}

		private void EnableOnly(Transform group, int index)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			foreach (Transform item in group)
			{
				Transform val = item;
				((Component)val).gameObject.SetActive(false);
			}
			Transform child = group.GetChild(index);
			EnableRecursively(((Component)child).gameObject);
		}

		private void EnableRecursively(GameObject obj)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			obj.SetActive(true);
			foreach (Transform item in obj.transform)
			{
				Transform val = item;
				EnableRecursively(((Component)val).gameObject);
			}
		}
	}
	public class ModularValuableLogic : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <ApplyPartValuesLater>d__5 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ModularValuableLogic <>4__this;

			private float <baseValue>5__1;

			private float <modifierTotal>5__2;

			private float <finalValue>5__3;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitUntil((Func<bool>)(() => <>4__this.valuableObject.dollarValueSet));
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<baseValue>5__1 = <>4__this.valuableObject.dollarValueOriginal;
					<modifierTotal>5__2 = 1f + 0.1f * <>4__this.parts.Sum((ValueModifierPart part) => part.valueModifier);
					<finalValue>5__3 = Mathf.Round(<baseValue>5__1 * <modifierTotal>5__2);
					if (SemiFunc.IsMultiplayer())
					{
						if (SemiFunc.IsMasterClient())
						{
							<>4__this.valuableObject.dollarValueOriginal = <finalValue>5__3;
							<>4__this.valuableObject.dollarValueCurrent = <finalValue>5__3;
							<>4__this.photonView.RPC("SyncFinalValue", (RpcTarget)1, new object[1] { <finalValue>5__3 });
						}
					}
					else
					{
						<>4__this.valuableObject.dollarValueOriginal = <finalValue>5__3;
						<>4__this.valuableObject.dollarValueCurrent = <finalValue>5__3;
					}
					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();
			}
		}

		private ValuableObject valuableObject;

		private PhotonView photonView;

		public List<ValueModifierPart> parts = new List<ValueModifierPart>();

		private void Awake()
		{
			valuableObject = ((Component)this).GetComponent<ValuableObject>();
			photonView = ((Component)this).GetComponent<PhotonView>();
		}

		private void Start()
		{
			parts = (from p in ((Component)this).GetComponentsInChildren<ValueModifierPart>(true)
				where ((Component)p).gameObject.activeInHierarchy
				select p).ToList();
			((MonoBehaviour)this).StartCoroutine(ApplyPartValuesLater());
		}

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

		[PunRPC]
		private void SyncFinalValue(float value)
		{
			valuableObject.dollarValueOriginal = value;
			valuableObject.dollarValueCurrent = value;
			valuableObject.dollarValueSet = true;
		}
	}
	public class RandomChildActivator : MonoBehaviourPun
	{
		[Tooltip("If true, allows the possibility that no object is enabled")]
		public bool allowNone = false;

		[Tooltip("If true, pick a random object every time this object enables. Otherwise only once at Start.")]
		public bool randomizeOnEnable = true;

		[Tooltip("Objects that can be randomly activated instead of all children")]
		public List<GameObject> objectsToChooseFrom;

		private void Start()
		{
			if (!randomizeOnEnable && SemiFunc.IsMasterClientOrSingleplayer())
			{
				PickAndSyncRandomObject();
			}
		}

		private void OnEnable()
		{
			if (randomizeOnEnable && SemiFunc.IsMasterClientOrSingleplayer())
			{
				PickAndSyncRandomObject();
			}
		}

		private void PickAndSyncRandomObject()
		{
			if (objectsToChooseFrom.Count != 0 || allowNone)
			{
				int num = PickWeightedIndex(objectsToChooseFrom, allowNone);
				ActivateObject(num);
				if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient)
				{
					((MonoBehaviourPun)this).photonView.RPC("RPC_ActivateObject", (RpcTarget)4, new object[1] { num });
				}
			}
		}

		[PunRPC]
		public void RPC_ActivateObject(int selectedIndex)
		{
			ActivateObject(selectedIndex);
		}

		private void ActivateObject(int selectedIndex)
		{
			if (allowNone && selectedIndex == objectsToChooseFrom.Count)
			{
				foreach (GameObject item in objectsToChooseFrom)
				{
					if ((Object)(object)item != (Object)null)
					{
						item.SetActive(false);
					}
				}
				return;
			}
			for (int i = 0; i < objectsToChooseFrom.Count; i++)
			{
				if ((Object)(object)objectsToChooseFrom[i] != (Object)null)
				{
					objectsToChooseFrom[i].SetActive(i == selectedIndex);
				}
			}
		}

		private int PickWeightedIndex(List<GameObject> objects, bool allowNoneOption)
		{
			float num = 0f;
			List<float> list = new List<float>();
			foreach (GameObject @object in objects)
			{
				if ((Object)(object)@object == (Object)null)
				{
					list.Add(0f);
					continue;
				}
				WeightedRandom component = @object.GetComponent<WeightedRandom>();
				float num2 = (((Object)(object)component != (Object)null) ? component.weight : 1f);
				list.Add(num2);
				num += num2;
			}
			if (allowNoneOption)
			{
				float num3 = 1f;
				list.Add(num3);
				num += num3;
			}
			float num4 = Random.Range(0f, num);
			float num5 = 0f;
			for (int i = 0; i < list.Count; i++)
			{
				num5 += list[i];
				if (num4 <= num5)
				{
					return i;
				}
			}
			return list.Count - 1;
		}
	}
	public class RotatorComponent : MonoBehaviour
	{
		[Tooltip("Rotation speed in degrees per second")]
		public float RotationSpeed = 45f;

		private void Update()
		{
			((Component)this).transform.Rotate(0f, RotationSpeed * Time.deltaTime, 0f);
		}
	}
	[ExecuteAlways]
	[RequireComponent(typeof(Projector))]
	public class ShaderGraphProjectorBinder : MonoBehaviour
	{
		private Projector projector;

		private Material mat;

		private void OnEnable()
		{
			projector = ((Component)this).GetComponent<Projector>();
			if ((Object)(object)projector.material != (Object)null)
			{
				mat = projector.material;
			}
		}

		private void LateUpdate()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//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_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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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)
			if (Object.op_Implicit((Object)(object)projector) && Object.op_Implicit((Object)(object)mat))
			{
				Matrix4x4 worldToLocalMatrix = ((Component)projector).transform.worldToLocalMatrix;
				Matrix4x4 val = (projector.orthographic ? Matrix4x4.Ortho((0f - projector.orthographicSize) * projector.aspectRatio, projector.orthographicSize * projector.aspectRatio, 0f - projector.orthographicSize, projector.orthographicSize, projector.nearClipPlane, projector.farClipPlane) : Matrix4x4.Perspective(projector.fieldOfView, projector.aspectRatio, projector.nearClipPlane, projector.farClipPlane));
				Matrix4x4 gPUProjectionMatrix = GL.GetGPUProjectionMatrix(val, false);
				Matrix4x4 val2 = gPUProjectionMatrix * worldToLocalMatrix;
				Matrix4x4 val3 = val2;
				mat.SetMatrix("_Projector", val2);
				mat.SetMatrix("_ProjectorClip", val3);
			}
		}
	}
	[RequireComponent(typeof(Rigidbody))]
	public class SleepTweaker : MonoBehaviour
	{
		private void Awake()
		{
			Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
			component.sleepThreshold = 0.2f;
		}
	}
	[ExecuteAlways]
	public class URPProjector : MonoBehaviour
	{
		[Header("Projector Material")]
		public Material material;

		[Header("Projection Settings")]
		public float fieldOfView = 45f;

		public float aspectRatio = 1f;

		public float nearClipPlane = 0.1f;

		public float farClipPlane = 20f;

		public LayerMask affectedLayers = LayerMask.op_Implicit(-1);

		[Header("Gizmos")]
		public bool drawGizmos = true;

		private Matrix4x4 _matrix;

		private void LateUpdate()
		{
			//IL_003c: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)material))
			{
				float num = fieldOfView * (MathF.PI / 180f);
				float num2 = 1f / Mathf.Tan(num * 0.5f);
				Matrix4x4 val = default(Matrix4x4);
				((Matrix4x4)(ref val))[0, 0] = num2 / aspectRatio;
				((Matrix4x4)(ref val))[1, 1] = num2;
				((Matrix4x4)(ref val))[2, 2] = (farClipPlane + nearClipPlane) / (nearClipPlane - farClipPlane);
				((Matrix4x4)(ref val))[2, 3] = 2f * farClipPlane * nearClipPlane / (nearClipPlane - farClipPlane);
				((Matrix4x4)(ref val))[3, 2] = -1f;
				((Matrix4x4)(ref val))[3, 3] = 0f;
				Matrix4x4 worldToLocalMatrix = ((Component)this).transform.worldToLocalMatrix;
				_matrix = GL.GetGPUProjectionMatrix(val, false) * worldToLocalMatrix;
				material.SetMatrix("_Projector", _matrix);
				material.SetMatrix("_ProjectorClip", _matrix);
			}
		}

		private void OnRenderObject()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)material))
			{
				material.SetPass(0);
				Graphics.DrawMeshNow(MeshGenerator.GetFrustumMesh(fieldOfView, aspectRatio, nearClipPlane, farClipPlane), ((Component)this).transform.localToWorldMatrix);
			}
		}

		private void OnDrawGizmos()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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)
			if (drawGizmos)
			{
				Gizmos.color = Color.yellow;
				Gizmos.matrix = ((Component)this).transform.localToWorldMatrix;
				Gizmos.DrawFrustum(Vector3.zero, fieldOfView, farClipPlane, nearClipPlane, aspectRatio);
			}
		}
	}
	public class ValuableDetacher : MonoBehaviour
	{
		[Tooltip("Name of the decorative object (e.g., Sword_Rack_01) to detach at runtime")]
		public string detachableName = "Holder";

		private Rigidbody rb;

		private Transform rack;

		private void Awake()
		{
			rb = ((Component)this).GetComponent<Rigidbody>();
			if ((Object)(object)rb != (Object)null)
			{
				rb.constraints = (RigidbodyConstraints)126;
			}
			rack = ((Component)this).transform.Find(detachableName);
			if ((Object)(object)rack != (Object)null)
			{
				rack.SetParent((Transform)null);
			}
		}

		private void Start()
		{
			if ((Object)(object)rb != (Object)null)
			{
				rb.constraints = (RigidbodyConstraints)0;
			}
		}
	}
	public class ValueModifierPart : MonoBehaviour
	{
		[Tooltip("Percentage that this part adds to the base value of the item.")]
		public float valueModifier = 0f;
	}
	public class WeightedRandom : MonoBehaviour
	{
		[Range(0.05f, 1f)]
		public float weight = 1f;
	}
	[BepInPlugin("DragonClaw.DragonClawLib", "DragonClawLib", "1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class DragonClawLib : BaseUnityPlugin
	{
		public static DragonClawLib Instance;

		private void Awake()
		{
			Instance = this;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"DragonClawLib plugin has been loaded!");
		}
	}
}