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 BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; [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("Desay1")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d2be5024990562bfe6035c7c0b5b65ab71e49f0f")] [assembly: AssemblyProduct("DesaValuables")] [assembly: AssemblyTitle("DesaValuables")] [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 ElMonoTrampa : Trap { public UnityEvent gramophoneTimer; [Space] [Header("Sounds")] public Sound GramophoneStart; public Sound GramophoneEnd; public Sound GramophoneMusic; private bool StartSequence; private bool endSequence; private float StartSequenceProgress; private float EndSequenceProgress; private bool MusicStart; public override void Start() { ((Trap)this).Start(); } public override void Update() { //IL_0066: 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) ((Trap)this).Update(); if (base.trapStart) { TrapActivate(); } if (!base.trapActive) { return; } base.enemyInvestigate = true; if (StartSequenceProgress == 0f && !StartSequence) { StartSequence = true; GramophoneStart.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f); } if (StartSequence) { StartSequenceProgress += Time.deltaTime; if (StartSequenceProgress >= 0.8f) { StartSequence = false; MusicStart = true; } } if (MusicStart) { GramophoneMusic.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); MusicStart = false; } if (endSequence) { EndSequenceProgress += Time.deltaTime; if (EndSequenceProgress >= 1f) { EndSequenceDone(); } } } private void EndSequenceDone() { base.trapActive = false; endSequence = false; } public void TrapStop() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) endSequence = true; GramophoneEnd.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f); } public void TrapActivate() { if (!base.trapTriggered) { gramophoneTimer.Invoke(); base.trapActive = true; base.trapTriggered = true; } } } public class ItemHolyGrenade : MonoBehaviour { public Color blinkColor; public UnityEvent onDetonate; private ItemToggle itemToggle; private ItemAttributes itemAttributes; internal bool isActive; private float grenadeTimer; private float soundTimer; public float tickTime = 3f; private PhotonView photonView; private PhysGrabObjectImpactDetector physGrabObjectImpactDetector; public Sound soundSplinter; public Sound soundTick; public Sound soundEffect; private Material grenadeEmissionMaterial; private ItemEquippable itemEquippable; private Vector3 grenadeStartPosition; private Quaternion grenadeStartRotation; private PhysGrabObject physGrabObject; private Vector3 prevPosition; [FormerlySerializedAs("isThiefGrenade")] [HideInInspector] public bool isSpawnedGrenade; public GameObject throwLine; private Rigidbody rb; private float throwLineTimer; private TrailRenderer throwLineTrail; private void Start() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) itemEquippable = ((Component)this).GetComponent(); itemToggle = ((Component)this).GetComponent(); itemAttributes = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); physGrabObjectImpactDetector = ((Component)this).GetComponent(); grenadeStartPosition = ((Component)this).transform.position; grenadeStartRotation = ((Component)this).transform.rotation; physGrabObject = ((Component)this).GetComponent(); rb = ((Component)this).GetComponent(); throwLineTrail = throwLine.GetComponent(); } private void FixedUpdate() { } private void Update() { //IL_00b4: 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_00c5: Unknown result type (might be due to invalid IL or missing references) if (soundTimer > 0f) { WaitForSound(); return; } soundTick.PlayLoop(isActive, 2f, 2f, 1f, 1f); if (itemEquippable.isEquipped) { if (isActive) { isActive = false; grenadeTimer = 0f; soundTimer = 0f; itemToggle.ToggleItem(false, -1); } return; } if (isActive) { float num = Mathf.PingPong(Time.time * 8f, 1f); Color val = blinkColor * Mathf.LinearToGammaSpace(num); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (itemToggle.toggleState && !isActive) { isActive = true; TickStart(); } if (isActive) { grenadeTimer += Time.deltaTime; if (grenadeTimer >= tickTime) { grenadeTimer = 0f; PlaySound(); WaitForSound(); } } } private void WaitForSound() { soundTimer += Time.deltaTime; if (soundTimer >= 1.8f) { soundTimer = 0f; TickEnd(); } } private void PlaySound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlaySoundRPC", (RpcTarget)0, Array.Empty()); } else { PlaySoundRPC(); } } [PunRPC] private void PlaySoundRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { soundEffect.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } private void GrenadeReset() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) isActive = false; grenadeTimer = 0f; soundTimer = 0f; throwLine.SetActive(false); itemToggle.ToggleItem(false, -1); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; foreach (PhysGrabber item in physGrabObject.playerGrabbing.ToList()) { if (!SemiFunc.IsMultiplayer()) { item.ReleaseObject(photonView.ViewID, 0.1f); continue; } item.photonView.RPC("ReleaseObjectRPC", (RpcTarget)0, new object[3] { false, 0.1f, photonView.ViewID }); } } private void TickStart() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClient()) { photonView.RPC("TickStartRPC", (RpcTarget)0, Array.Empty()); } else { TickStartRPC(); } } private void TickEnd() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClient()) { photonView.RPC("TickEndRPC", (RpcTarget)0, Array.Empty()); } else { TickEndRPC(); } } [PunRPC] private void TickStartRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { soundSplinter.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); isActive = true; } } [PunRPC] private void TickEndRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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_008f: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info) || itemEquippable.isEquipped) { return; } onDetonate.Invoke(); if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!SemiFunc.RunIsShop() || isSpawnedGrenade) { if (!isSpawnedGrenade) { StatsManager.instance.ItemRemove(itemAttributes.instanceName); } physGrabObjectImpactDetector.DestroyObject(true); } else { physGrabObject.Teleport(grenadeStartPosition, grenadeStartRotation); } } if (SemiFunc.RunIsShop() && !isSpawnedGrenade) { GrenadeReset(); } } } public class ItemHolyGrenadeExplosive : MonoBehaviour { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ItemHolyGrenadeExplosive <>4__this; private Rigidbody 5__1; private Vector3 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = ((Component)<>4__this).GetComponent(); 5__2 = ShopManager.instance.extractionPoint.forward; 5__2 += Vector3.up * Random.Range(0.1f, 0.5f); 5__2 += ShopManager.instance.extractionPoint.right * Random.Range(-0.5f, 0.5f); 5__1.AddForce(5__2 * (float)Random.Range(3, 7), (ForceMode)1); 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 ParticleScriptExplosion particleScriptExplosion; private void Start() { particleScriptExplosion = ((Component)this).GetComponent(); if (SemiFunc.RunIsShop() && SemiFunc.IsMasterClientOrSingleplayer()) { ItemToggle component = ((Component)this).GetComponent(); if (ShopManager.instance.isThief) { ((MonoBehaviour)this).StartCoroutine(ThiefLaunch()); component.ToggleItem(true, -1); ((Component)this).GetComponent().isSpawnedGrenade = true; } } } [IteratorStateMachine(typeof(d__2))] private IEnumerator ThiefLaunch() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } public void Explosion() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) particleScriptExplosion.Spawn(((Component)this).transform.position, 5f, 150, 300, 6f, false, false, 3f); } } public class ItemWard : MonoBehaviour { private float visionCheckTimer = 0f; private ItemMine mine; public Sound soundAlert; private List detectedEnemies = new List(); private void Start() { mine = ((Component)this).GetComponent(); } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 if ((int)mine.state == 2) { visionCheckTimer += Time.deltaTime; if (visionCheckTimer > 0.2f) { visionCheckTimer = 0f; CheckForEnemies(); } } } public void OnTriggered() { Debug.Log((object)"Triggered"); } private void CheckForEnemies() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) Collider[] colliders = Physics.OverlapSphere(((Component)this).transform.position, 15f); Collider[] array = colliders; foreach (Collider val in array) { if (((Component)val).CompareTag("Enemy")) { Debug.Log((object)("Enemy detected: " + ((Object)val).name)); if (!detectedEnemies.Contains(((Component)val).gameObject)) { detectedEnemies.Add(((Component)val).gameObject); soundAlert.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } } detectedEnemies = detectedEnemies.Where((GameObject enemy) => colliders.Any((Collider collider) => (Object)(object)((Component)collider).gameObject == (Object)(object)enemy)).ToList(); } } public class LiquidShaderController : MonoBehaviour { public Renderer liquidRenderer; public Transform bottle; [Range(0f, 1f)] public float fillAmount = 0.5f; private Material liquidMaterial; private Vector3 lastRotation; private Vector3 wobble; private void Start() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)liquidRenderer != (Object)null) { liquidMaterial = liquidRenderer.material; } lastRotation = bottle.eulerAngles; } private void Update() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //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_003f: 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) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)liquidMaterial == (Object)null) && !((Object)(object)bottle == (Object)null)) { Vector3 eulerAngles = bottle.eulerAngles; Vector3 val = eulerAngles - lastRotation; val.x = Mathf.DeltaAngle(lastRotation.x, eulerAngles.x); val.z = Mathf.DeltaAngle(lastRotation.z, eulerAngles.z); wobble = Vector3.Lerp(wobble, val, Time.deltaTime * 5f); liquidMaterial.SetVector("_WobbleMatrix", new Vector4(wobble.x, 0f, wobble.z, 0f)); lastRotation = eulerAngles; } } } public class MovingTexture : MonoBehaviour { public Renderer MovingTextureRenderer; private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) MovingTextureRenderer.material.mainTextureOffset = new Vector2(0f, Time.time * 0.1f); MovingTextureRenderer.material.mainTextureScale = new Vector2(2f + Mathf.Sin(Time.time * 1f) * 0.25f, 2f + Mathf.Sin(Time.time * 1f) * 0.25f); } } public class PocionGordura : MonoBehaviour { private enum State { Idle, Active } private PhysGrabObject physGrabObject; private List prefijo = new List(); private List comidas = new List(); private float coolDownUntilNextSentence = 3f; private State currentState; private string playerName = "[playerName]"; private void Start() { physGrabObject = ((Component)this).GetComponent(); InitializeWordLists(); } private void Update() { if (SemiFunc.IsMultiplayer()) { switch (currentState) { case State.Idle: StateIdle(); break; case State.Active: StateActive(); break; } } } private void StateIdle() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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)) { return; } bool flag = false; if (!SemiFunc.IsMultiplayer()) { playerName = "this potion"; flag = true; } else { List list = SemiFunc.PlayerGetAllPlayerAvatarWithinRange(10f, ((Component)PhysGrabber.instance).transform.position, false, default(LayerMask)); PlayerAvatar val = null; float num = float.MaxValue; foreach (PlayerAvatar item in list) { if (!((Object)(object)item == (Object)(object)PlayerAvatar.instance)) { float num2 = Vector3.Distance(((Component)PhysGrabber.instance).transform.position, ((Component)item).transform.position); if (num2 < num) { num = num2; val = item; } } } flag = true; if ((Object)(object)val != (Object)null) { playerName = val.playerName; } else { playerName = "this potion"; } } if (flag) { string text = GenerateGordoSentence(); currentState = State.Active; Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0.3f, 0.6f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val2, 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(5f, 15f); } else if (!ChatManager.instance.StateIsPossessed()) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(5f, 15f); } } private void InitializeWordLists() { prefijo.AddRange(new string[26] { "un acantilado", "un agujero negro", "un almacén", "una aspiradora", "un barril", "una bolsa", "una bóveda", "un camión volquete", "una cápsula", "un cementerio", "un cajón", "un container", "un depósito", "una fosa", "una galaxia", "un genocida", "un holocausto", "una jaula", "una montaña fofa", "una nave", "una purga", "un sepulcro", "un sicario", "un termotanque", "un vertedero", "una bola" }); comidas.AddRange(new string[36] { "alfajores", "azúcares", "canelones", "carbohidratos", "choripanes", "chinchulines", "chocotortas", "chocolates", "churros", "empanadas", "facturas", "flanes", "frituras", "grasas", "guisos", "hamburguesas", "harinas", "helados", "jamones", "locro", "manteca", "mantecol", "mayonesa", "medialunas", "milanesas", "mondongo", "morcillas", "pastas", "pastafrolas", "piononos", "pizzas", "quesos", "ravioles", "salchichas", "sánguches", "tortafritas" }); } private string GenerateGordoSentence() { if (playerName == "this potion") { return "Soy " + prefijo[Random.Range(0, prefijo.Count)] + " de " + comidas[Random.Range(0, comidas.Count)]; } return playerName + " es " + prefijo[Random.Range(0, prefijo.Count)] + " de " + comidas[Random.Range(0, comidas.Count)]; } } public class ValuableCacharro : Trap { private ParticleScriptExplosion particleScriptExplosion; private int HitCount; private int MaxHitCount = 3; public Transform Center; public override void Start() { ((Trap)this).Start(); particleScriptExplosion = ((Component)this).GetComponent(); } public void Explode() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) particleScriptExplosion.Spawn(Center.position, 2f, 100, 100, 1f, false, false, 1f); } public void PotentialExplode() { if (base.isLocal) { if (HitCount >= MaxHitCount - 1) { Explode(); } else { HitCount++; } } } } namespace ModsCacones.Patches { [HarmonyPatch(typeof(ItemMine))] public class ItemMinePatch { [HarmonyPrefix] [HarmonyPatch("DestroyMine")] public static bool DestroyPatch(ItemMine __instance) { if (__instance.destroyTimer == 101f) { return false; } return true; } } } namespace DesaValuables { public class BossCall : MonoBehaviour { private enum State { Idle, Active } private PhysGrabObject physGrabObject; private float coolDownUntilNextSentence = 3f; private State currentState; private void Start() { physGrabObject = ((Component)this).GetComponent(); } private void Update() { switch (currentState) { case State.Idle: StateIdle(); break; case State.Active: StateActive(); break; } float num = Mathf.Sin(Time.time * 15f) * 25f; foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (item.isLocal) { if (item.playerAvatar.playerName == "Chapita") { item.playerAvatar.playerExpression.OverrideExpressionSet(1, 100f); PlayerExpressionsUI.instance.playerExpression.OverrideExpressionSet(1, 100f); } else { item.playerAvatar.playerExpression.OverrideExpressionSet(6, 100f); PlayerExpressionsUI.instance.playerExpression.OverrideExpressionSet(6, 100f); PlayerExpressionsUI.instance.playerAvatarVisuals.HeadTiltOverride(num * 0.2f); } } else if (item.playerAvatar.playerName != "Chapita") { item.playerAvatar.playerAvatarVisuals.HeadTiltOverride(num); } } } private void StateIdle() { //IL_0163: 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 (coolDownUntilNextSentence > 0f && physGrabObject.grabbed) { coolDownUntilNextSentence -= Time.deltaTime; } 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)) { return; } Color val = default(Color); Color val2 = default(Color); foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (item.playerAvatar.playerName == "Chapita") { string text = "TODOS POOTOS"; currentState = State.Active; ((Color)(ref val))..ctor(1f, 0f, 0f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)3, text, 1f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } else { string text2 = "SOY EL BOSS"; currentState = State.Active; ((Color)(ref val2))..ctor(0f, 1f, 0f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, text2, 1f, val2, 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(5f, 15f); } else if (!ChatManager.instance.StateIsPossessed()) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(5f, 15f); } } } [BepInPlugin("Desay1.DesaValuables", "DesaValuables", "1.0")] public class DesaValuables : BaseUnityPlugin { internal static DesaValuables 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 PlayGrabAndReleaseSound : MonoBehaviour { public Sound grabSound; public Sound releaseSound; private bool grabbedPrev; private PhotonView photonView; private PhysGrabObject physGrabObject; private void Start() { physGrabObject = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } protected void Update() { if (physGrabObject.grabbed) { if (!grabbedPrev) { grabbedPrev = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlayGrabSound(); } } } else if (grabbedPrev) { grabbedPrev = false; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlayReleaseSound(); } } } private void PlayGrabSound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayGrabRPC", (RpcTarget)0, Array.Empty()); } else { PlayGrabRPC(); } } private void PlayReleaseSound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayReleaseRPC", (RpcTarget)0, Array.Empty()); } else { PlayReleaseRPC(); } } [PunRPC] private void PlayGrabRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { grabSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } [PunRPC] private void PlayReleaseRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { releaseSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } } public class PlayGrabSound : MonoBehaviour { public Sound grabSound; private bool grabbedPrev; private PhotonView photonView; private PhysGrabObject physGrabObject; private void Start() { physGrabObject = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } protected void Update() { if (physGrabObject.grabbed) { if (!grabbedPrev) { grabbedPrev = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlaySound(); } } } else { grabbedPrev = false; } } private void PlaySound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayHonkRPC", (RpcTarget)0, Array.Empty()); } else { PlayHonkRPC(); } } [PunRPC] private void PlayHonkRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { grabSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } } public class PlayGrabSoundRandom : MonoBehaviour { public Sound[] grabSounds; private PhotonView photonView; private PhysGrabObject physGrabObject; private bool grabbedPrev; private void Start() { physGrabObject = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } protected void Update() { if (physGrabObject.grabbed) { if (!grabbedPrev) { grabbedPrev = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlaySound(); } } } else { grabbedPrev = false; } } private void PlaySound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayHonkRPC", (RpcTarget)0, Array.Empty()); } else { PlayHonkRPC(); } } [PunRPC] private void PlayHonkRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { grabSounds[Random.Range(0, grabSounds.Length)].Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } } public class PlayReleaseSound : MonoBehaviour { public Sound releaseSound; private PhotonView photonView; private PhysGrabObject physGrabObject; private bool grabbedPrev; private void Start() { physGrabObject = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } protected void Update() { if (physGrabObject.grabbed) { grabbedPrev = true; } else if (grabbedPrev) { grabbedPrev = false; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlaySound(); } } } private void PlaySound() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayHonkRPC", (RpcTarget)0, Array.Empty()); } else { PlayHonkRPC(); } } [PunRPC] private void PlayHonkRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMultiplayer() || _info.Sender == PhotonNetwork.MasterClient) { releaseSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } } public class VoicePitchOnGrab : MonoBehaviour { public float pitch = 0.65f; private PhotonView photonView; private PhysGrabObject physGrabObject; private void Start() { physGrabObject = ((Component)this).GetComponent(); photonView = ((Component)this).GetComponent(); } protected void Update() { foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (Object.op_Implicit((Object)(object)item) && !item.isLocal) { item.playerAvatar.voiceChat.OverridePitch(pitch, 1f, 2f, 0.1f, 0f, 0f); } } } } }