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 RDD Valuables v0.1.11
RDDValuables.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using REPOLib.Modules; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Autodesk.Fbx")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")] [assembly: IgnoresAccessChecksTo("Klattersynth")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonChat")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")] [assembly: IgnoresAccessChecksTo("PhotonVoice.API")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization")] [assembly: IgnoresAccessChecksTo("Sirenix.Utilities")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("websocket-sharp")] [assembly: AssemblyCompany("RedDragonDev")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RDDValuables")] [assembly: AssemblyTitle("RDDValuables")] [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 ValuableNZap : Trap { private PhotonView photonView; private float laserTimer; public SemiLaser semiLaser; public Transform laserTransform; private Rigidbody rb; public float fireCooldown; private float cooldownTimer = 0f; public int uses = 3; private PhysGrabObject physGrabObject; private ItemToggle itemToggle; private float distanceKeep = 0.75f; private PhysGrabObjectImpactDetector pgoid; public Sound ReloadSound; private bool gunMode = false; private float grabVerticalOffset = -0.2f; private float aimVerticalOffset = -10f; private float torqueMultiplier = 1f; private float grabStrengthMultiplier = 1f; public override void Start() { ((Trap)this).Start(); itemToggle = ((Component)this).GetComponent<ItemToggle>(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); photonView = ((Component)this).GetComponent<PhotonView>(); rb = ((Component)this).GetComponent<Rigidbody>(); pgoid = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); } public override void Update() { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if (physGrabObject.grabbed && physGrabObject.grabbedLocal) { PhysGrabber.instance.OverrideGrabDistance(distanceKeep); } if (itemToggle.toggleState && SemiFunc.IsMasterClientOrSingleplayer() && !gunMode) { itemToggle.toggleState = false; if (!gunMode) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("GunModeRPC", (RpcTarget)0, Array.Empty<object>()); } else { GunModeRPC(); } } } updateMaster(); if (uses == 0 && laserTimer <= 0f && cooldownTimer <= fireCooldown - 1f) { pgoid.DestroyObject(true); return; } if (laserTimer > 0f) { laserTimer -= Time.deltaTime; Vector3 val = laserTransform.position + laserTransform.forward * 15f; bool flag = false; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(laserTransform.position, laserTransform.forward, ref val2, 15f, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct()))) { val = ((RaycastHit)(ref val2)).point; flag = true; } semiLaser.LaserActive(laserTransform.position, val, flag); } else if (cooldownTimer > 0f) { cooldownTimer -= Time.deltaTime; if (cooldownTimer <= 0f) { ReloadSound.Play(((Component)physGrabObject).transform.position, 1f, 1f, 1f, 1f); } } if (itemToggle.toggleState && SemiFunc.IsMasterClientOrSingleplayer() && cooldownTimer <= 0f && laserTimer <= 0f) { float num = Random.Range(0.5f, 1f); if (SemiFunc.IsMultiplayer()) { photonView.RPC("NZapLaserRPC", (RpcTarget)0, new object[1] { num }); } else { NZapLaserRPC(num); } itemToggle.toggleState = false; } if (itemToggle.toggleState) { itemToggle.toggleState = false; } } private void updateMaster() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || !physGrabObject.grabbed || !gunMode) { return; } Quaternion val = Quaternion.Euler(aimVerticalOffset, 0f, 0f); Quaternion val2 = Quaternion.Euler(0f, 0f, 0f); Quaternion identity = Quaternion.identity; bool flag = false; bool flag2 = false; bool flag3 = true; foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (flag3) { if (item.playerAvatar.isCrouching || item.playerAvatar.isCrawling) { flag2 = true; } flag3 = false; } if (item.isRotating) { flag = true; } } if (!flag) { physGrabObject.TurnXYZ(val, val2, identity); } float num = grabVerticalOffset; if (flag2) { num += 0.5f; } physGrabObject.OverrideGrabVerticalPosition(num); if (!flag) { if (grabStrengthMultiplier != 1f) { physGrabObject.OverrideGrabStrength(grabStrengthMultiplier, 0.1f); } if (torqueMultiplier != 1f) { physGrabObject.OverrideTorqueStrength(torqueMultiplier, 0.1f); } } if (flag) { physGrabObject.OverrideAngularDrag(40f, 0.1f); physGrabObject.OverrideTorqueStrength(6f, 0.1f); } } private void FixedUpdate() { if (SemiFunc.IsMasterClientOrSingleplayer() && !(laserTimer > 0f)) { } } [PunRPC] public void NZapLaserRPC(float _time) { laserTimer = _time; cooldownTimer = fireCooldown; uses--; } [PunRPC] public void GunModeRPC() { gunMode = true; } } namespace RDDValuables { public class BienfuValuable : Trap { private ParticleScriptExplosion particleScriptExplosion; public Transform Center; public PhysGrabObject physgrabobject; public Sound PreExplosionSound; private bool isExploding = false; public override void Start() { ((Trap)this).Start(); particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>(); } public void Explode() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) particleScriptExplosion.Spawn(Center.position, 7f, 1000, 1000, 2f, false, false, 5f); physgrabobject.dead = true; } public void StartCountdown() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!isExploding) { isExploding = true; PreExplosionSound.Play(Center.position, 1f, 1f, 1f, 1f); ((MonoBehaviour)this).Invoke("Explode", 0.95f); } } } public class ValuableChickenJockey : Trap { private enum State { Idle, Active } public PhysGrabObject physGrabObject; private float coolDownUntilNextSentence = 0.5f; private State currentState; private ParticleScriptExplosion particleScriptExplosion; public Transform Center; public Sound PreExplosionSound; private bool isExploding = false; [Range(0f, 100f)] public float ExplosionChance = 25f; public override void Start() { ((Trap)this).Start(); particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>(); } public override void Update() { if (SemiFunc.IsMultiplayer()) { switch (currentState) { case State.Idle: StateIdle(); break; case State.Active: StateActive(); break; } } } private void StateIdle() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (coolDownUntilNextSentence > 0f && physGrabObject.grabbed) { coolDownUntilNextSentence -= Time.deltaTime; } else if (Object.op_Implicit((Object)(object)PhysGrabber.instance) && PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject) { currentState = State.Active; Color val = default(Color); ((Color)(ref val))..ctor(0.0549f, 0.6824f, 0.6824f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, "CHICKEN JOCKEY", 3f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } private void StateActive() { if (PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)physGrabObject) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(1f, 3f); } else if (!ChatManager.instance.StateIsPossessed()) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(1f, 3f); } } public void Explode() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)particleScriptExplosion == (Object)null) { Debug.LogError((object)"particleScriptExplosion is null. Ensure the ParticleScriptExplosion component is attached."); return; } if ((Object)(object)Center == (Object)null) { Debug.LogError((object)"Center is null. Assign a valid Transform to the Center field."); return; } particleScriptExplosion.Spawn(Center.position, 3f, 150, 150, 2f, false, false, 5f); physGrabObject.dead = true; } public void TryExplosion() { if (SemiFunc.IsMasterClient()) { bool flag = Random.Range(0f, 1f) < ExplosionChance / 100f; if (!isExploding && flag) { base.photonView.RPC("startExplosionRpc", (RpcTarget)0, Array.Empty<object>()); } } } [PunRPC] public void startExplosionRpc() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) isExploding = true; PreExplosionSound.Play(Center.position, 1f, 1f, 1f, 1f); ((MonoBehaviour)this).Invoke("Explode", 1.1f); } } public class DamagedSoundValuable : Trap { public List<Sound> damageLines = new List<Sound>(); public Transform audioCenter; public Sound testSound; public override void Start() { ((Trap)this).Start(); base.physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); base.photonView = ((Component)this).GetComponent<PhotonView>(); } public void OnABreak() { if (SemiFunc.IsMasterClient()) { Console.WriteLine("Numsounds is " + damageLines.Count); int num = Random.Range(0, damageLines.Count); base.photonView.RPC("PlaySound", (RpcTarget)0, new object[1] { num }); } else { Console.WriteLine("Not master or client"); } } [PunRPC] public void PlaySound(int songInt) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) Console.WriteLine("Playing sound! " + songInt); Sound val = damageLines[songInt]; val.Play(audioCenter.position, 1f, 1f, 1f, 1f); } } public class ValuableFakeCake : Trap { private PhysGrabObjectImpactDetector pgoid; public override void Start() { ((Trap)this).Start(); base.physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); base.photonView = ((Component)this).GetComponent<PhotonView>(); pgoid = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); } public override void Update() { if (base.physGrabObject.grabbed) { ((MonoBehaviour)this).Invoke("DestroySelf", 5f); } } public void DestroySelf() { pgoid.DestroyObject(true); } } public class ValuableFlintNSteel : MonoBehaviour { private enum State { Idle, Active } private PhysGrabObject physGrabObject; private float coolDownUntilNextSentence = 0.5f; private State currentState; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); } private void Update() { if (SemiFunc.IsMultiplayer()) { switch (currentState) { case State.Idle: StateIdle(); break; case State.Active: StateActive(); break; } } } private void StateIdle() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (coolDownUntilNextSentence > 0f && physGrabObject.grabbed) { coolDownUntilNextSentence -= Time.deltaTime; } else if (Object.op_Implicit((Object)(object)PhysGrabber.instance) && PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject) { currentState = State.Active; Color val = default(Color); ((Color)(ref val))..ctor(0f, 0.3f, 1f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, "FLINT AND STEEL", 1f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } private void StateActive() { if (PhysGrabber.instance.grabbed && Object.op_Implicit((Object)(object)PhysGrabber.instance.grabbedPhysGrabObject) && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)physGrabObject) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(0.1f, 1f); } else if (!ChatManager.instance.StateIsPossessed()) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(0.1f, 1f); } } } public class ValuableMeridasBeacon : Trap { public PhysGrabObject physGrabObject; public Transform Center; public Sound CommonGrabSound; public Sound RareGrabSound; [Range(0f, 100f)] public float chanceToPlayRare; private bool played = false; public override void Start() { ((Trap)this).Start(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); } public override void Update() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (physGrabObject.grabbed && !played) { played = true; float num = Random.Range(0f, 1f); if (num > chanceToPlayRare / 100f) { if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayCommonSound", (RpcTarget)0, Array.Empty<object>()); } else { PlayCommonSound(); } } else if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayRareSound", (RpcTarget)0, Array.Empty<object>()); } else { PlayRareSound(); } } else if (!physGrabObject.grabbed) { played = false; } } [PunRPC] private void PlayCommonSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) CommonGrabSound.Play(Center.position, 1f, 1f, 1f, 1f); } [PunRPC] private void PlayRareSound() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) RareGrabSound.Play(Center.position, 1f, 1f, 1f, 1f); } } public class ValuablePrisonRealm : MonoBehaviour { private PhysGrabObject physGrabObject; private PhotonView photonView; private PhysGrabObjectImpactDetector pgoid; public Sound breakSound; private bool activated = false; public float delay = 5f; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); photonView = ((Component)this).GetComponent<PhotonView>(); pgoid = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); } public void onBreak() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (activated) { return; } activated = true; breakSound.Play(((Component)physGrabObject).transform.position, 1f, 1f, 1f, 1f); if (SemiFunc.IsMasterClientOrSingleplayer()) { List<string> list = new List<string>(); List<EnemySetup> list2 = new List<EnemySetup>(Enemies.AllEnemies); for (int i = 0; i < list2.Count; i++) { list.Add(((Object)list2[i]).name); } string text = list[Random.Range(0, list.Count)]; if (SemiFunc.IsMultiplayer()) { photonView.RPC("spawnEnemy", (RpcTarget)0, new object[1] { text }); } else { spawnEnemy(text); } ((MonoBehaviour)this).Invoke("selfD", delay); } } private void selfD() { pgoid.DestroyObject(true); } [PunRPC] public void spawnEnemy(string enemyName) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) List<LevelPoint> levelpoints = SemiFunc.LevelPointGetWithinDistance(((Component)physGrabObject).transform.position, 0f, 250f); LevelPoint val = findClosestPoint(((Component)physGrabObject).transform.position, levelpoints); if ((Object)(object)val != (Object)null) { enemySpawn(enemyName, ((Component)val).transform); } else { MonoBehaviour.print((object)"No Levelpoint found"); } } private LevelPoint findClosestPoint(Vector3 position, List<LevelPoint> levelpoints) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) LevelPoint result = null; float num = float.PositiveInfinity; foreach (LevelPoint levelpoint in levelpoints) { float num2 = Vector3.Distance(position, ((Component)levelpoint).transform.position); if (num2 < num) { num = num2; result = levelpoint; } } return result; } public void enemySpawn(string enemyName, Transform transform) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) EnemySetup val = default(EnemySetup); if (Enemies.TryGetEnemyByName(enemyName, ref val)) { Enemies.SpawnEnemy(val, ((Component)physGrabObject).transform.position, Quaternion.identity, false); } else { MonoBehaviour.print((object)"Enemy not found"); } } } public class TrappedValuable : Trap { private string trigger = ""; private string trap = ""; private string[] triggers = new string[1] { "damage" }; private string[] traps = new string[1] { "explodeAll" }; public override void Start() { ((Trap)this).Start(); trigger = triggers[Random.Range(0, triggers.Length)]; trap = traps[Random.Range(0, traps.Length)]; } public void damageTrigger() { } } [BepInPlugin("RedDragonDev.RDDValuables", "RDDValuables", "1.0")] public class RDDValuables : BaseUnityPlugin { internal static RDDValuables Instance { get; private set; } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Patch(); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); } internal void Patch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { } } public class ValuableSpamton : Trap { private PhysGrabObject physGrabObject; public Sound theSound; public Sound killSound; private bool delay = false; public Transform audioCenter; public int maxLinks = 2; public int killLinks = 3; public bool maxKill = false; private PhysGrabObjectImpactDetector pgoid; private List<string> theLinks = new List<string> { "https://leekspin.co/", "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/watch?v=Yp8o35zahgo", "https://www.youtube.com/watch?v=LFE2IebjQgA", "https://www.youtube.com/watch?v=MobkO51msMI", "https://www.youtube.com/watch?v=KYdDUXyFocY", "https://www.youtube.com/watch?v=R_FQU4KzN7A", "https://www.youtube.com/watch?v=iOztnsBPrAA&list=PL3tRBEVW0hiDL09lO0xjKEix84OY27xet&index=1", "https://www.youtube.com/watch?v=BQb4CCsKQ8c", "https://www.youtube.com/watch?v=hmc3mgz9Ck0", "https://www.youtube.com/watch?v=TMhiIT8WOmc", "https://www.youtube.com/watch?v=72tHaw7Hxgs", "https://www.youtube.com/watch?v=YMPQdaq-qqk", "https://www.youtube.com/watch?v=Q9wDLSrLeUE", "https://www.amazon.com/CloseoutWarehouse-Oxidized-Sterling-Silver-Thorns/dp/B075ZD8TTX?crid=3KQRMF3D54WQW&dib=eyJ2IjoiMSJ9.pXvzYFXUmQQI_76n_aU_V51puMzsU27c3FKTuVwJB_UMGL-GEyeBPGir_DuMeirkhtNMlwfdEsMzcguTHQ1Hbo7I42q1sMK-_IfKsITQCRBv5Q-Sig6JrcqCJiCrzn-N2PvTqeuKHSQPiuDSVVwtWESUu2O5iGrFl3RON_Ye6cJrg46qTJWSMmTSI96s6GEQXVUz3Evb4tFfSsGUwQF5Hpi_BEyI4SytM4Es4vZ_H6tRQwj5BHWcLG0iCuPgBWdjtsq2c-qrbm2vaL537tbHIjh0h9yQan4yZoHKlfqMHc0.6Al9NdoHvTjCaY_SYIzus9cKELCa9Q0xPblL_kCAqMo&dib_tag=se&keywords=thorn%2Bring&qid=1749610812&sprefix=thorn%2Brin%2Caps%2C148&sr=8-17&th=1&psc=1", "https://www.netflix.com/watch/70196252?trackId=251672233&tctx=9%2C2%2C63dd613d-894d-477b-9df8-46e6d17cfeaa-237309924%2CNES_74DF552F0D852F15032296ACAA6E2E-00482E08E9924D-4570FD5658_p_1749611061302%2C%2C%2C%2C%2C%2CVideo%3A70143836%2CdetailsPagePlayButton", "https://www.netflix.com/watch/81221020?trackId=268410292&tctx=0%2C0%2C64395bc2-7a69-49c1-9b65-3369209ebf18-236438581%2C64395bc2-7a69-49c1-9b65-3369209ebf18-236438581%7C2%2C%2C%2C%2C%2C81220429%2CVideo%3A81221020%2CdetailsPageEpisodePlayButton", "https://www.netflix.com/watch/80107105?trackId=268410292s", "https://photricity.com/flw/ajax/", "https://www.youtube.com/watch?v=XjwCRHlgRQs", "https://store.steampowered.com/app/1671210/DELTARUNE/", "https://www.fangamer.com/collections/deltarune/products/deltarune-ch2-ralsei-plush", "https://www.fangamer.com/collections/deltarune/products/deltarune-spamton-plush" }; public override void Start() { ((Trap)this).Start(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); pgoid = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); } public void OpenLink() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!delay && maxLinks > 0) { theSound.Play(((Component)audioCenter).transform.position, 1f, 1f, 1f, 1f); delay = true; maxLinks--; ((MonoBehaviour)this).Invoke("doOpen", 2f); } if (!delay && maxLinks == 0) { delay = true; openMultiple(); } } public void doOpen() { delay = false; int index = Random.Range(0, theLinks.Count); Application.OpenURL(theLinks[index]); } public void openMultiple() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) killSound.Play(((Component)audioCenter).transform.position, 1f, 1f, 1f, 1f); ((MonoBehaviour)this).Invoke("SelfDestruct", 2.5f); for (int i = 0; i < killLinks; i++) { int index = Random.Range(0, theLinks.Count); Application.OpenURL(theLinks[index]); } } public void SelfDestruct() { pgoid.DestroyObject(true); } } public class ThatBoatValuable : Trap { public Transform Center; public Sound ImpactSound; private bool playedSound = false; public override void Start() { ((Trap)this).Start(); } public void OnImpact() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!playedSound) { ImpactSound.Play(Center.position, 1f, 1f, 1f, 1f); } } } public class ValuableTouchSound : Trap { private PhysGrabObject physGrabObject; public bool playOnce = true; public Sound GrabSound; public Sound RareGrabSound; [Range(0f, 100f)] public float chanceToPlayRare; private bool played = false; public override void Start() { ((Trap)this).Start(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); } public override void Update() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (physGrabObject.grabbed && !played) { played = true; if (RareGrabSound != null) { float num = Random.Range(0f, 1f); if (num > chanceToPlayRare / 100f) { if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayCommonSound", (RpcTarget)0, Array.Empty<object>()); } else { PlayCommonSound(); } } else if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayRareSound", (RpcTarget)0, Array.Empty<object>()); } else { PlayRareSound(); } } else if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayCommonSound", (RpcTarget)0, Array.Empty<object>()); } else { PlayCommonSound(); } } else if (!physGrabObject.grabbed && !playOnce) { played = false; } } [PunRPC] private void PlayCommonSound() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) GrabSound.Play(((Component)physGrabObject).transform.position, 1f, 1f, 1f, 1f); } [PunRPC] private void PlayRareSound() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) RareGrabSound.Play(((Component)physGrabObject).transform.position, 1f, 1f, 1f, 1f); } } }