Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of DampMine v0.0.17
DragonClawLib.dll
Decompiled a week agousing 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; [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+4d9c00f51fc41f588c571007f243546a70df37da")] [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 { [Header("Pot Settings")] public Transform pivot; public HingeJoint pivotHinge; public float pourThresholdAngle = 60f; public bool hasPoured = false; [Header("Tray & Metal")] public CastingTray tray; public MoltenMetal moltenMetalPreset; private float initialRotation; public PhotonView photonView; private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) photonView = ((Component)this).GetComponent<PhotonView>(); if ((Object)(object)pivot != (Object)null) { initialRotation = pivot.localEulerAngles.x; } } private void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!CanPour()) { return; } 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(); } } } private bool CanPour() { return (Object)(object)pivot != (Object)null && (Object)(object)pivotHinge != (Object)null; } 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__33 : 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 <alpha>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__33(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_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_0152; } goto IL_018e; case 1: <>1__state = -1; goto IL_0152; case 2: <>1__state = -1; goto IL_0316; case 3: { <>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_018e: 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_0316; } goto IL_03be; IL_03be: <>2__current = (object)new WaitForSeconds(1f); <>1__state = 3; return true; IL_0152: 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_018e; IL_0316: 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); if ((Object)(object)<>4__this.instancedLiquidMaterial != (Object)null) { <alpha>5__9 = Mathf.Lerp(1f, 0f, <progress>5__8); <>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, <alpha>5__9); } if ((Object)(object)<>4__this.liquidLayerMaterialInstance != (Object)null) { <alpha>5__10 = Mathf.Lerp(1f, 0f, <progress>5__8); <>4__this.liquidLayerMaterialInstance.SetFloat(<>4__this.transparencyProperty, <alpha>5__10); } <>2__current = null; <>1__state = 2; return true; } <>4__this.liquidLayer.localPosition = <target>5__6; if ((Object)(object)<>4__this.instancedLiquidMaterial != (Object)null) { <>4__this.instancedLiquidMaterial.SetFloat(<>4__this.transparencyProperty, 0f); } if ((Object)(object)<>4__this.liquidLayerMaterialInstance != (Object)null) { <>4__this.liquidLayerMaterialInstance.SetFloat(<>4__this.transparencyProperty, 0f); } goto IL_03be; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Allowed Volume Types")] public List<Type> allowedVolumeTypes = new List<Type>(); 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; private Material liquidLayerMaterialInstance; private Renderer liquidLayerRenderer; [SerializeField] private float fadeDuration = 0.5f; [SerializeField] private string transparencyProperty = "_Transparency"; [Header("Indicator Lamps")] public List<Renderer> indicatorLampRenderers = new List<Renderer>(); 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 List<Material> indicatorMaterialInstances = new List<Material>(); private void Start() { InitializeIndicatorLamps(); UpdateIndicatorColor(); PourVisualsInitialize(); } private void InitializeIndicatorLamps() { indicatorMaterialInstances.Clear(); foreach (Renderer indicatorLampRenderer in indicatorLampRenderers) { if (!((Object)(object)indicatorLampRenderer == (Object)null)) { Material material = indicatorLampRenderer.material; indicatorMaterialInstances.Add(material); } } } private void OnTriggerEnter(Collider other) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) ValuableObject componentInParent = ((Component)other).GetComponentInParent<ValuableObject>(); if ((Object)(object)componentInParent == (Object)null || (allowedVolumeTypes.Count > 0 && !allowedVolumeTypes.Contains(componentInParent.volumeType))) { 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0089: 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_0085: 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_009c: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00e0: 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) if (indicatorMaterialInstances.Count == 0) { return; } Color val = (((Object)(object)castingPot != (Object)null && castingPot.hasPoured) ? Color.black : ((containedValuables.Count == 0) ? redEmission : ((containedValuables.Count != 1) ? orangeEmission : greenEmission))); if (val == lastAppliedEmission) { return; } lastAppliedEmission = val; foreach (Material indicatorMaterialInstance in indicatorMaterialInstances) { if (!((Object)(object)indicatorMaterialInstance == (Object)null)) { indicatorMaterialInstance.SetColor("_Color", (val == Color.black) ? Color.white : val); indicatorMaterialInstance.SetColor("_EmissionColor", val); } } } public void ApplyCastingToAll(MoltenMetal metal) { foreach (ValuableObject containedValuable in containedValuables) { ApplyMoltenEffect(containedValuable, metal); UpdateImpactDetector(containedValuable); } } private void ApplyMoltenEffect(ValuableObject obj, MoltenMetal moltenMetalPreset) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] componentsInChildren = ((Component)obj).GetComponentsInChildren<MeshRenderer>(true); MeshRenderer[] array = componentsInChildren; foreach (MeshRenderer val in array) { 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")); val3.SetFloat("_Overlay_Emission_Strength", moltenMetalPreset.castedMaterial.GetFloat("_Overlay_Emission_Strength")); val3.SetTexture("_Overlay_Emission", moltenMetalPreset.castedMaterial.GetTexture("_Overlay_Emission")); val3.SetColor("_Overlay_EmissionColor", moltenMetalPreset.castedMaterial.GetColor("_Overlay_EmissionColor")); if (val3.HasProperty("_Brightness_Minimum")) { val3.SetFloat("_Brightness_Minimum", moltenMetalPreset.castedMaterial.GetFloat("_Brightness_Minimum")); } if (val3.HasProperty("_Brightness_Maximum")) { val3.SetFloat("_Brightness_Maximum", moltenMetalPreset.castedMaterial.GetFloat("_Brightness_Maximum")); } if (val3.HasProperty("_Pulse_Speed")) { val3.SetFloat("_Pulse_Speed", moltenMetalPreset.castedMaterial.GetFloat("_Pulse_Speed")); } 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //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); } } if ((Object)(object)liquidLayer != (Object)null) { liquidLayerRenderer = ((Component)liquidLayer).GetComponent<Renderer>(); if ((Object)(object)liquidLayerRenderer != (Object)null) { liquidLayerMaterialInstance = new Material(liquidLayerRenderer.sharedMaterial); liquidLayerRenderer.material = liquidLayerMaterialInstance; } } } [IteratorStateMachine(typeof(<PourVisualCoroutine>d__33))] private IEnumerator PourVisualCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PourVisualCoroutine>d__33(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); } } public class EntranceModuleAssetInjector : MonoBehaviour { [CompilerGenerated] private sealed class <Start>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EntranceModuleAssetInjector <>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 <Start>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; break; case 1: <>1__state = -1; <i>5__1++; break; } if (<i>5__1 < 20) { if (<>4__this.TryInject()) { return false; } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 1; return true; } Debug.LogWarning((object)"[EntranceInjector] Failed to inject after retries."); 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(); } } [Header("Mappings (assign in prefab / bundle)")] public RoomOutlineMappingAsset outlineMapping; public LevelAmbienceMappingAsset ambienceMapping; private bool injected; private void Awake() { TryInject(); } [IteratorStateMachine(typeof(<Start>d__4))] private IEnumerator Start() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Start>d__4(0) { <>4__this = this }; } private bool TryInject() { if (injected) { return true; } if ((Object)(object)Map.Instance == (Object)null || (Object)(object)AudioManager.instance == (Object)null) { return false; } int num = 0; int num2 = 0; if ((Object)(object)outlineMapping != (Object)null) { foreach (RoomVolumeOutlineCustom customOutline in outlineMapping.customOutlines) { if (!Map.Instance.RoomVolumeOutlineCustoms.Contains(customOutline)) { Map.Instance.RoomVolumeOutlineCustoms.Add(customOutline); num++; } } } if ((Object)(object)ambienceMapping != (Object)null) { foreach (LevelAmbience customAmbience in ambienceMapping.customAmbiences) { if (!AudioManager.instance.levelAmbiences.Contains(customAmbience)) { AudioManager.instance.levelAmbiences.Add(customAmbience); num2++; } } } injected = true; Debug.Log((object)$"[EntranceInjector] Injected {num} outlines, {num2} ambiences"); return true; } } [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; } [RequireComponent(typeof(Projector))] public class ProjectorBoundsUpdater : MonoBehaviour { private void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Projector component = ((Component)this).GetComponent<Projector>(); component.material = new Material(component.material); Vector3 position = ((Component)this).transform.parent.position; component.material.SetFloat("_OffsetX", position.x); component.material.SetFloat("_OffsetZ", position.z); } } [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; } } [RequireComponent(typeof(PhotonView))] public class ModuleRandomizerManager : MonoBehaviourPun { private List<RandomChildActivator> randomizers = new List<RandomChildActivator>(); private void Awake() { randomizers = ((Component)this).GetComponentsInChildren<RandomChildActivator>(true).ToList(); randomizers = randomizers.OrderBy((RandomChildActivator r) => GetHierarchyPath(((Component)r).transform)).ToList(); } private void Start() { if (SemiFunc.IsMasterClientOrSingleplayer()) { RandomizeAll(); } } public void RandomizeAll() { if (randomizers.Count != 0) { int[] array = new int[randomizers.Count]; for (int i = 0; i < randomizers.Count; i++) { int selectedIndex = (array[i] = randomizers[i].PickRandomIndex()); randomizers[i].ActivateObject(selectedIndex); } if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("RPC_ApplyResults", (RpcTarget)4, new object[1] { array }); } } } [PunRPC] private void RPC_ApplyResults(int[] results) { for (int i = 0; i < randomizers.Count && i < results.Length; i++) { randomizers[i].ActivateObject(results[i]); } } private string GetHierarchyPath(Transform t) { string text = ((Object)t).name; while ((Object)(object)t.parent != (Object)null && (Object)(object)t.parent != (Object)(object)((Component)this).transform) { t = t.parent; text = ((Object)t).name + "/" + text; } return text; } } public class RandomChildActivator : MonoBehaviour { [Tooltip("If true, allows the possibility that no object is enabled")] public bool allowNone = false; [Tooltip("Objects that can be randomly activated instead of all children")] public List<GameObject> objectsToChooseFrom; public int PickRandomIndex() { if (objectsToChooseFrom.Count == 0 && !allowNone) { return -1; } float num = 0f; List<float> list = new List<float>(); foreach (GameObject item in objectsToChooseFrom) { if ((Object)(object)item == (Object)null) { list.Add(0f); continue; } WeightedRandom component = item.GetComponent<WeightedRandom>(); float num2 = (((Object)(object)component != (Object)null) ? component.weight : 1f); list.Add(num2); num += num2; } if (allowNone) { 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 void ActivateObject(int selectedIndex) { for (int i = 0; i < objectsToChooseFrom.Count; i++) { GameObject val = objectsToChooseFrom[i]; if (!((Object)(object)val == (Object)null)) { bool active = i == selectedIndex; val.SetActive(active); } } if (!allowNone || selectedIndex != objectsToChooseFrom.Count) { return; } foreach (GameObject item in objectsToChooseFrom) { if ((Object)(object)item != (Object)null) { item.SetActive(false); } } } } 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!"); } } }