Decompiled source of SillyValuables v6.1.8
SillyValuables.dll
Decompiled 11 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; 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; using UnityEngine.Video; [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("Sangrento")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SillyValuables")] [assembly: AssemblyTitle("SillyValuables")] [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 AleatorioMexer : MonoBehaviour { private PhysGrabObject physGrabObject; public float minScale = 0.5f; public float maxScale = 2f; public float changeInterval = 0.2f; private Vector3 originalScale; private float timer; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); originalScale = ((Component)this).transform.localScale; timer = 0f; } private void Update() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (physGrabObject.grabbed) { timer -= Time.deltaTime; if (timer <= 0f) { timer = changeInterval; float num = Random.Range(minScale, maxScale); float num2 = Random.Range(minScale, maxScale); float num3 = Random.Range(minScale, maxScale); ((Component)this).transform.localScale = new Vector3(num, num2, num3); } } else { ((Component)this).transform.localScale = originalScale; timer = 0f; } } } public class AnimCimaBaixo : MonoBehaviour { public float floatAmplitude = 0.5f; public float floatFrequency = 1f; public float baseHeightOffset = 0f; public float minDistanceToGround = 0.02f; public float raycastDistance = 1.5f; private Vector3 initialWorldPosition; private PhysGrabObject grabObject; private Rigidbody rb; private Collider col; private void Start() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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) grabObject = ((Component)this).GetComponent<PhysGrabObject>(); rb = ((Component)this).GetComponent<Rigidbody>(); col = ((Component)this).GetComponent<Collider>(); initialWorldPosition = ((Component)this).transform.position + Vector3.up * baseHeightOffset; if ((Object)(object)rb != (Object)null) { rb.isKinematic = true; rb.useGravity = false; } if ((Object)(object)col != (Object)null) { col.enabled = false; } } private void Update() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)grabObject != (Object)null) || !grabObject.grabbed) { float num = Mathf.Sin(Time.time * floatFrequency) * floatAmplitude; Vector3 val = initialWorldPosition + new Vector3(0f, num, 0f); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, raycastDistance, -1, (QueryTriggerInteraction)1)) { float num2 = ((RaycastHit)(ref val2)).point.y + minDistanceToGround; if (val.y < num2) { val.y = num2; } } ((Component)this).transform.position = val; if ((Object)(object)rb != (Object)null) { rb.isKinematic = true; rb.useGravity = false; } if ((Object)(object)col != (Object)null) { col.enabled = false; } } else { initialWorldPosition = ((Component)this).transform.position + Vector3.up * baseHeightOffset; if ((Object)(object)rb != (Object)null) { rb.isKinematic = false; rb.useGravity = true; } if ((Object)(object)col != (Object)null) { col.enabled = true; } } } } public class AnimGirar : MonoBehaviour { public Vector3 rotationSpeed = new Vector3(0f, 90f, 0f); private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Rotate(rotationSpeed * Time.deltaTime); } } public class TiroAutomatico : MonoBehaviour { private PhysGrabObject physGrabObject; private ItemToggle itemToggle; public int numberOfBullets = 1; [Range(0f, 65f)] public float gunRandomSpread; public float gunRange = 50f; public float distanceKeep = 0.8f; public float gunRecoilForce = 1f; public float cameraShakeMultiplier = 1f; public float torqueMultiplier = 1f; public float grabStrengthMultiplier = 1f; public float shootCooldown = 1f; public float batteryDrain = 0.1f; public bool batteryDrainFullBar; public int batteryDrainFullBars = 1; [Range(0f, 100f)] public float misfirePercentageChange = 50f; public AnimationCurve shootLineWidthCurve; public float grabVerticalOffset = -0.2f; public float aimVerticalOffset = -10f; public float investigateRadius = 20f; public Transform gunMuzzle; public GameObject bulletPrefab; public GameObject muzzleFlashPrefab; public Transform gunTrigger; public Sound soundShoot; public Sound soundShootGlobal; public Sound soundNoAmmoClick; public Sound soundHit; private float shootCooldownTimer; private ItemBattery itemBattery; private PhotonView photonView; private PhysGrabObjectImpactDetector impactDetector; private AnimationCurve triggerAnimationCurve; private float triggerAnimationEval; private bool triggerAnimationActive; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); itemToggle = ((Component)this).GetComponent<ItemToggle>(); itemBattery = ((Component)this).GetComponent<ItemBattery>(); photonView = ((Component)this).GetComponent<PhotonView>(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); triggerAnimationCurve = AssetManager.instance.animationCurveClickInOut; } private void Update() { if (physGrabObject.grabbed && physGrabObject.grabbedLocal) { PhysGrabber.instance.OverrideGrabDistance(distanceKeep); } UpdateTriggerAnimation(); if (physGrabObject.grabbedLocal && IsUseInputHeld()) { itemToggle.toggleState = true; if (shootCooldownTimer <= 0f) { Shoot(); shootCooldownTimer = shootCooldown; } } else { itemToggle.toggleState = false; } if (shootCooldownTimer > 0f) { shootCooldownTimer -= Time.deltaTime; } UpdateOnlyMaster(); } private void UpdateTriggerAnimation() { //IL_0050: 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) if (triggerAnimationActive) { float num = 45f; triggerAnimationEval += Time.deltaTime * 4f; gunTrigger.localRotation = Quaternion.Euler(num * triggerAnimationCurve.Evaluate(triggerAnimationEval), 0f, 0f); if (triggerAnimationEval >= 1f) { gunTrigger.localRotation = Quaternion.Euler(0f, 0f, 0f); triggerAnimationActive = false; triggerAnimationEval = 1f; } } } private void UpdateOnlyMaster() { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_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_00f0: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || !physGrabObject.grabbed) { 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 (itemBattery.batteryLife <= 0f) { physGrabObject.OverrideTorqueStrength(0.1f, 0.1f); } } else { physGrabObject.OverrideAngularDrag(40f, 0.1f); physGrabObject.OverrideTorqueStrength(6f, 0.1f); } } public void Shoot() { if (!(itemBattery.batteryLife <= 0f) || Random.Range(0, 10000) == 0) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("ShootRPC", (RpcTarget)0, Array.Empty<object>()); } else { ShootRPC(); } } } [PunRPC] public void ShootRPC() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: 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_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) float num = 3f * cameraShakeMultiplier; float num2 = 16f * cameraShakeMultiplier; SemiFunc.CameraShakeImpactDistance(gunMuzzle.position, 5f * cameraShakeMultiplier, 0.1f, num, num2); SemiFunc.CameraShakeDistance(gunMuzzle.position, 0.1f * cameraShakeMultiplier, 0.1f * cameraShakeMultiplier, num, num2); soundShoot.Play(gunMuzzle.position, 1f, 1f, 1f, 1f); soundShootGlobal.Play(gunMuzzle.position, 1f, 1f, 1f, 1f); MuzzleFlash(); StartTriggerAnimation(); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance != (Object)null && investigateRadius > 0f) { MethodInfo method = ((object)instance).GetType().GetMethod("SetInvestigate", new Type[2] { typeof(Vector3), typeof(float) }); if (method != null) { method.Invoke(instance, new object[2] { ((Component)this).transform.position, investigateRadius }); } } physGrabObject.rb.AddForceAtPosition(-gunMuzzle.forward * gunRecoilForce, gunMuzzle.position, (ForceMode)1); if (!batteryDrainFullBar) { ItemBattery obj = itemBattery; obj.batteryLife -= batteryDrain; } else { itemBattery.RemoveFullBar(batteryDrainFullBars); } RaycastHit val4 = default(RaycastHit); for (int i = 0; i < numberOfBullets; i++) { Vector3 val = gunMuzzle.forward; if (gunRandomSpread > 0f) { float num3 = Random.Range(0f, gunRandomSpread / 2f); float num4 = Random.Range(0f, 360f); Vector3 val2 = Vector3.Cross(val, Random.onUnitSphere); Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion val3 = Quaternion.AngleAxis(num3, normalized); val2 = Quaternion.AngleAxis(num4, val) * val3 * val; val = ((Vector3)(ref val2)).normalized; } Vector3 endPosition = gunMuzzle.position + val * gunRange; bool hit = false; if (Physics.Raycast(gunMuzzle.position, val, ref val4, gunRange, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct()) + LayerMask.GetMask(new string[1] { "Enemy" }))) { endPosition = ((RaycastHit)(ref val4)).point; hit = true; } ShootBullet(endPosition, hit); } } private void ShootBullet(Vector3 _endPosition, bool _hit) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("ShootBulletRPC", (RpcTarget)0, new object[2] { _endPosition, _hit }); } else { ShootBulletRPC(_endPosition, _hit); } } } [PunRPC] public void ShootBulletRPC(Vector3 _endPosition, bool _hit) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) if (physGrabObject.playerGrabbing.Count > 1) { foreach (PhysGrabber item in physGrabObject.playerGrabbing) { item.OverrideGrabRelease(); } } ItemGunBullet component = Object.Instantiate<GameObject>(bulletPrefab, gunMuzzle.position, gunMuzzle.rotation).GetComponent<ItemGunBullet>(); component.hitPosition = _endPosition; component.bulletHit = _hit; soundHit.Play(_endPosition, 1f, 1f, 1f, 1f); component.shootLineWidthCurve = shootLineWidthCurve; component.ActivateAll(); } private void MuzzleFlash() { //IL_000d: 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) Object.Instantiate<GameObject>(muzzleFlashPrefab, gunMuzzle.position, gunMuzzle.rotation, gunMuzzle).GetComponent<ItemGunMuzzleFlash>().ActivateAllEffects(); } private void StartTriggerAnimation() { triggerAnimationActive = true; triggerAnimationEval = 0f; } private bool IsUseInputHeld() { return Input.GetKey((KeyCode)101); } } public class BombaExplosiva : MonoBehaviour { public float explosionRadius = 5f; public float explosionForce = 700f; public float damage = 200f; public GameObject explosionEffect; public float explosionDelay = 0f; private bool hasExploded = false; private void Start() { if (explosionDelay > 0f) { ((MonoBehaviour)this).Invoke("Explode", explosionDelay); } } private void OnCollisionEnter(Collision collision) { if (!hasExploded && explosionDelay <= 0f) { Explode(); } } public void Explode() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (hasExploded) { return; } hasExploded = true; if ((Object)(object)explosionEffect != (Object)null) { Object.Instantiate<GameObject>(explosionEffect, ((Component)this).transform.position, Quaternion.identity); } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius); Collider[] array2 = array; foreach (Collider val in array2) { Rigidbody component = ((Component)val).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(explosionForce, ((Component)this).transform.position, explosionRadius); } PlayerHealth component2 = ((Component)val).GetComponent<PlayerHealth>(); if ((Object)(object)component2 != (Object)null) { component2.Hurt((int)damage, false, -1); } } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class MaterialGlowPulse : MonoBehaviour { public Renderer targetRenderer; public float glowInterval = 1f; public float glowIntensity = 2f; private Material material; private Color originalColor; private float time; private void Start() { //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) if ((Object)(object)targetRenderer == (Object)null) { targetRenderer = ((Component)this).GetComponent<Renderer>(); } material = targetRenderer.material; originalColor = material.color; } private void Update() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) time += Time.deltaTime; float num = (Mathf.Sin(time / glowInterval * MathF.PI * 2f) + 1f) / 2f; float num2 = Mathf.Lerp(1f, glowIntensity, num); material.color = originalColor * num2; } } public class RotateCameraWhileHeld : MonoBehaviour { private PhysGrabObject physGrabObject; private bool isHeld = false; private bool wasHeld = false; private bool isReturning = false; public float rotationSpeed = 180f; public float returnSpeed = 5f; private Quaternion originalRotation; private void Start() { //IL_0028: 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) physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); if ((Object)(object)Camera.main != (Object)null) { originalRotation = ((Component)Camera.main).transform.rotation; } } private void Update() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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) Camera main = Camera.main; if ((Object)(object)main == (Object)null || (Object)(object)physGrabObject == (Object)null) { return; } isHeld = physGrabObject.grabbed; if (isHeld) { isReturning = false; ((Component)main).transform.Rotate(Vector3.forward, rotationSpeed * Time.deltaTime); } else if (!isHeld && wasHeld) { isReturning = true; } if (isReturning) { ((Component)main).transform.rotation = Quaternion.Lerp(((Component)main).transform.rotation, originalRotation, returnSpeed * Time.deltaTime); if (Quaternion.Angle(((Component)main).transform.rotation, originalRotation) < 0.1f) { ((Component)main).transform.rotation = originalRotation; isReturning = false; } } wasHeld = isHeld; } } public class HurtColliderCura : MonoBehaviour { public float amount = 25f; private void OnTriggerEnter(Collider other) { PlayerHealth componentInParent = ((Component)other).GetComponentInParent<PlayerHealth>(); if ((Object)(object)componentInParent != (Object)null) { componentInParent.Heal((int)amount, true); } } } [DisallowMultipleComponent] public class CorParaTodos : MonoBehaviourPun { [Header("Renderers to affect (leave empty = auto-detect)")] public Renderer[] targetRenderers; [Header("Cor")] [Tooltip("Se true, gera uma cor aleatória forte. Se false, usa a cor fixa abaixo.")] public bool overrideWithRandomColor = true; [Tooltip("Cor fixa (usada se overrideWithRandomColor = false)")] public Color fixedColor = Color.white; [Tooltip("Cor que será realmente usada (gerada ou fixa, e persistente)")] public Color savedColor = new Color(0f, 0f, 0f, 0f); private void Start() { //IL_00e0: 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_003f: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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) if (savedColor.a == 0f) { if (PhotonNetwork.InRoom && ((MonoBehaviourPun)this).photonView.IsMine) { savedColor = (overrideWithRandomColor ? GenerateVibrantColor() : fixedColor); ((MonoBehaviourPun)this).photonView.RPC("SyncColorRPC", (RpcTarget)3, new object[3] { savedColor.r, savedColor.g, savedColor.b }); } else if (!PhotonNetwork.InRoom) { savedColor = (overrideWithRandomColor ? GenerateVibrantColor() : fixedColor); ApplyColor(savedColor); } } else { ApplyColor(savedColor); } } [PunRPC] private void SyncColorRPC(float r, float g, float b) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) savedColor = new Color(r, g, b); ApplyColor(savedColor); } private void ApplyColor(Color color) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) Renderer[] array = (Renderer[])((targetRenderers != null && targetRenderers.Length != 0) ? ((Array)targetRenderers) : ((Array)((Component)this).GetComponentsInChildren<Renderer>())); Renderer[] array2 = array; foreach (Renderer val in array2) { if (!((Object)(object)val == (Object)null)) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); val.GetPropertyBlock(val2); Material sharedMaterial = val.sharedMaterial; if (sharedMaterial.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", color); } else if (sharedMaterial.HasProperty("_Color")) { val2.SetColor("_Color", color); } val.SetPropertyBlock(val2); } } Light[] componentsInChildren = ((Component)this).GetComponentsInChildren<Light>(true); Light[] array3 = componentsInChildren; foreach (Light val3 in array3) { val3.color = color; } } public static Color GenerateVibrantColor() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) return Color.HSVToRGB(Random.value, 0.7f, 0.9f); } } public class Curar : MonoBehaviour { private void OnDestroy() { PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth; playerHealth.health = Mathf.Min(playerHealth.health + 50, playerHealth.maxHealth); } } public class CustomPrefabPool : MonoBehaviour, IPunPrefabPool { private readonly Dictionary<string, GameObject> prefabDictionary = new Dictionary<string, GameObject>(); private readonly string[] ignoreLogsContains = new string[7] { "PlayerAvatar", "Voice", "Level/", "Start Room", "Manor", "Lobby", "Module" }; public void RegisterValuable(string prefabName) { if (string.IsNullOrEmpty(prefabName)) { Debug.LogError((object)"[CustomPrefabPool] Nome do prefab vazio!"); } else if (!prefabDictionary.ContainsKey(prefabName)) { GameObject val = Resources.Load<GameObject>(prefabName); if ((Object)(object)val == (Object)null) { Debug.LogError((object)("[CustomPrefabPool] Não encontrado em Resources: " + prefabName)); return; } prefabDictionary[prefabName] = val; Debug.Log((object)("[CustomPrefabPool] Registrado prefab: " + prefabName)); } } public GameObject Instantiate(string prefabId, Vector3 position, Quaternion rotation) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) string[] array = ignoreLogsContains; foreach (string value in array) { if (prefabId.Contains(value)) { return null; } } if (prefabDictionary.TryGetValue(prefabId, out GameObject value2)) { GameObject val = Object.Instantiate<GameObject>(value2, position, rotation); val.SetActive(false); return val; } GameObject val2 = Resources.Load<GameObject>(prefabId); if ((Object)(object)val2 != (Object)null) { GameObject val3 = Object.Instantiate<GameObject>(val2, position, rotation); val3.SetActive(false); Debug.LogWarning((object)("[CustomPrefabPool] '" + prefabId + "' não registrado. Usando fallback de Resources.")); return val3; } Debug.LogError((object)("[CustomPrefabPool] ERRO: '" + prefabId + "' não encontrado!")); return null; } public void Destroy(GameObject go) { Object.Destroy((Object)(object)go); } } public class Doomsekkar : MonoBehaviour { private bool isItemHeld = false; private float holdTime = 0f; public float holdThreshold = 2f; private bool isSpeaking = false; private string GenerateAffectionateSentence() { string[] array = new string[1] { "Destiny's powerful hand has made the bed of my future, and it's up to me to lie in it." }; return array[Random.Range(0, array.Length)]; } private void Update() { if (Input.GetKey((KeyCode)101)) { if (!isItemHeld) { isItemHeld = true; } if (isItemHeld) { holdTime += Time.deltaTime; if (!isSpeaking && holdTime >= holdThreshold) { StartSpeaking(); } } } else if (isItemHeld) { isItemHeld = false; holdTime = 0f; isSpeaking = false; } } public void StartSpeaking() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) isSpeaking = true; string text = GenerateAffectionateSentence(); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.3f, 0.6f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } public class PulaPulaEin : MonoBehaviour { public float launchForce = 6f; public float jumpForce = 4f; public float cooldown = 0.5f; public float minImpactForce = 2f; private Rigidbody rb; private bool launched = false; private void Start() { rb = ((Component)this).GetComponent<Rigidbody>(); } private void OnCollisionEnter(Collision collision) { //IL_0013: 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) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) if (!launched && collision.contacts.Length != 0) { Vector3 val = collision.relativeVelocity; if (((Vector3)(ref val)).magnitude > minImpactForce) { val = ((Component)this).transform.forward; Vector3 val2 = ((Vector3)(ref val)).normalized * launchForce + Vector3.up * jumpForce; rb.AddForce(val2, (ForceMode)2); launched = true; ((MonoBehaviour)this).Invoke("ResetLaunch", cooldown); } } } private void ResetLaunch() { launched = false; } } public class ChangeEixo : MonoBehaviour { private PhysGrabObject physGrabObject; public float changeInterval = 0.5f; private float timer = 0f; private Quaternion startRotation; private Quaternion targetRotation; private bool isRotating = false; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); startRotation = ((Component)this).transform.rotation; targetRotation = startRotation; } private void Update() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cf: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) if (physGrabObject.grabbed) { if (!isRotating) { timer = 0f; startRotation = ((Component)this).transform.rotation; int num = Random.Range(0, 3); int[] array = new int[3] { 90, 180, 270 }; int num2 = array[Random.Range(0, array.Length)]; Vector3 zero = Vector3.zero; switch (num) { case 0: ((Vector3)(ref zero))..ctor((float)num2, 0f, 0f); break; case 1: ((Vector3)(ref zero))..ctor(0f, (float)num2, 0f); break; case 2: ((Vector3)(ref zero))..ctor(0f, 0f, (float)num2); break; } targetRotation = startRotation * Quaternion.Euler(zero); isRotating = true; } else { timer += Time.deltaTime; float num3 = timer / changeInterval; ((Component)this).transform.rotation = Quaternion.Slerp(startRotation, targetRotation, num3); if (num3 >= 1f) { isRotating = false; } } } else { isRotating = false; timer = 0f; } } } public class ItemBehaviour : MonoBehaviour { public GameObject valuablePrefab; public GameObject explosionEffectPrefab; public Vector3 spawnOffset = new Vector3(2f, 1f, 0f); private bool _used = false; public float raycastDistance = 10f; [Range(0f, 1f)] public float explosionChance = 0.3f; public float explosionRadius = 5f; public int explosionDamage = 20; private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (!Input.GetMouseButtonDown(0)) { return; } Ray val = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject && !_used) { _used = true; if (Random.Range(0f, 1f) <= explosionChance) { Explode(); } else { GenerateNewValuable(); } } } private void GenerateNewValuable() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)valuablePrefab == (Object)null) { Debug.LogError((object)"Prefab de valuable não foi atribuído!"); return; } Vector3 val = ((Component)this).transform.position + spawnOffset; Object.Instantiate<GameObject>(valuablePrefab, val, Quaternion.identity); Debug.Log((object)"Novo valuable gerado!"); } private void Explode() { //IL_0040: 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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Explodindo!"); if ((Object)(object)explosionEffectPrefab != (Object)null) { Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity); } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius); Collider[] array2 = array; foreach (Collider val in array2) { if (((Component)val).CompareTag("Player")) { PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null) { Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}"); PlayerHealth playerHealth = componentInParent.playerHealth; playerHealth.health -= explosionDamage; componentInParent.playerHealth.Hurt(explosionDamage, false, -1); } } } Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius); } } public class ItemBehaviour2 : MonoBehaviour { [Header("Spawn de")] public GameObject[] valuablePrefabs; public Vector3 spawnOffset = new Vector3(2f, 1f, 0f); [Header("Explosão")] public GameObject explosionEffectPrefab; public float explosionRadius = 5f; public int explosionDamage = 20; [Range(0f, 1f)] public float explosionChance = 0.3f; [Header("Interação")] public float raycastDistance = 10f; private bool _used = false; private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (!Input.GetMouseButtonDown(0)) { return; } Ray val = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject && !_used) { _used = true; if (Random.Range(0f, 1f) <= explosionChance) { Explode(); } else { GenerateRandomValuable(); } } } private void GenerateRandomValuable() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (valuablePrefabs == null || valuablePrefabs.Length == 0) { Debug.LogError((object)"Nenhum prefab de valuable foi atribuído!"); return; } int num = Random.Range(0, valuablePrefabs.Length); GameObject val = valuablePrefabs[num]; Vector3 val2 = ((Component)this).transform.position + spawnOffset; Object.Instantiate<GameObject>(val, val2, Quaternion.identity); Debug.Log((object)("Valuable gerado: " + ((Object)val).name)); } private void Explode() { //IL_0040: 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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Explodindo!"); if ((Object)(object)explosionEffectPrefab != (Object)null) { Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity); } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius); Collider[] array2 = array; foreach (Collider val in array2) { if (((Component)val).CompareTag("Player")) { PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null) { Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}"); PlayerHealth playerHealth = componentInParent.playerHealth; playerHealth.health -= explosionDamage; componentInParent.playerHealth.Hurt(explosionDamage, false, -1); } } } Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius); } } public class ItemBehaviourSemLimite : MonoBehaviour { [Header("Spawn de Valuables")] public GameObject[] valuablePrefabs; public Vector3 spawnOffset = new Vector3(2f, 1f, 0f); [Header("Explosão")] public GameObject explosionEffectPrefab; public float explosionRadius = 5f; public int explosionDamage = 20; [Range(0f, 1f)] public float explosionChance = 0.3f; [Header("Som da Explosão")] public AudioClip explosionSound; private AudioSource audioSource; [Header("Interação")] public float raycastDistance = 10f; private void Start() { audioSource = ((Component)this).GetComponent<AudioSource>(); } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!Input.GetMouseButtonDown(0)) { return; } Ray val = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, raycastDistance) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject) { if (Random.Range(0f, 1f) <= explosionChance) { Explode(); } else { GenerateRandomValuable(); } } } private void GenerateRandomValuable() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (valuablePrefabs == null || valuablePrefabs.Length == 0) { Debug.LogError((object)"Nenhum prefab de valuable foi atribuído!"); return; } int num = Random.Range(0, valuablePrefabs.Length); GameObject val = valuablePrefabs[num]; Vector3 val2 = ((Component)this).transform.position + spawnOffset; Object.Instantiate<GameObject>(val, val2, Quaternion.identity); Debug.Log((object)("Valuable gerado: " + ((Object)val).name)); } private void Explode() { //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) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Explodindo!"); if ((Object)(object)explosionEffectPrefab != (Object)null) { Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity); } if ((Object)(object)explosionSound != (Object)null) { if ((Object)(object)audioSource != (Object)null) { audioSource.PlayOneShot(explosionSound); } else { AudioSource.PlayClipAtPoint(explosionSound, ((Component)this).transform.position); } } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius); Collider[] array2 = array; foreach (Collider val in array2) { if (((Component)val).CompareTag("Player")) { PlayerAvatar componentInParent = ((Component)val).GetComponentInParent<PlayerAvatar>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null) { Debug.Log((object)$"Dano aplicado ao jogador: {explosionDamage}"); PlayerHealth playerHealth = componentInParent.playerHealth; playerHealth.health -= explosionDamage; componentInParent.playerHealth.Hurt(explosionDamage, false, -1); } } } } private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, explosionRadius); } } public class ExplodeOnDestroy : MonoBehaviourPun { public GameObject explosionEffectPrefab; public float explosionRadius = 5f; public float explosionForce = 500f; public int explosionDamage = 30; public float damageRadius = 3f; public bool beingExtracted = false; private void OnDestroy() { //IL_0050: 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) //IL_0032: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) if (beingExtracted) { return; } if ((Object)(object)explosionEffectPrefab != (Object)null) { GameObject val = Object.Instantiate<GameObject>(explosionEffectPrefab, ((Component)this).transform.position, Quaternion.identity); Object.Destroy((Object)(object)val, 5f); } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, explosionRadius); Collider[] array2 = array; Ray val4 = default(Ray); RaycastHit val5 = default(RaycastHit); foreach (Collider val2 in array2) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); Rigidbody component = ((Component)val2).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(explosionForce, ((Component)this).transform.position, explosionRadius); } if (!(num <= damageRadius) || !((Component)val2).CompareTag("Player")) { continue; } Vector3 val3 = ((Component)val2).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; ((Ray)(ref val4))..ctor(((Component)this).transform.position, normalized); if (Physics.Raycast(val4, ref val5, damageRadius) && (Object)(object)((Component)((RaycastHit)(ref val5)).collider).gameObject == (Object)(object)((Component)val2).gameObject) { PhotonView component2 = ((Component)val2).GetComponent<PhotonView>(); if (!SemiFunc.IsMultiplayer() || ((Object)(object)component2 != (Object)null && component2.IsMine)) { PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth; playerHealth.health -= explosionDamage; PlayerAvatar.instance.playerHealth.Hurt(explosionDamage, false, -1); } } } } } public class TalkingValuable : MonoBehaviour { private bool isItemHeld = false; private float holdTime = 0f; public float holdThreshold = 2f; private bool isSpeaking = false; private string GenerateAffectionateSentence() { string[] array = new string[5] { "STAAN", "STAAAN", "STAAAAAN", "STAAAAAAAN", "STAAAAAAAAAAAN" }; return array[Random.Range(0, array.Length)]; } public void StartSpeaking() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) isSpeaking = true; string text = GenerateAffectionateSentence(); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.3f, 0.6f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)1, text, 1f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } public class FaladorEngracado : MonoBehaviourPun { private enum EstadoDeFala { Silencioso, Tagarelando } public PhysGrabObject objetoFalante; private float tempoDeReativacao = 0.5f; private EstadoDeFala estadoAtual = EstadoDeFala.Silencioso; private readonly string[] frasesEngracadas = new string[5] { "STAAAAAN", "I just wanted a normal day, man.", "Everything I know is a lie!", "Kyle, what the hell is going on?", "Sometimes I feel like I’m the only sane one here." }; private void Start() { if ((Object)(object)objetoFalante == (Object)null) { objetoFalante = ((Component)this).GetComponent<PhysGrabObject>(); } } private void Update() { if (SemiFunc.IsMultiplayer()) { AtualizarEstadoDeFala(); } } private void AtualizarEstadoDeFala() { switch (estadoAtual) { case EstadoDeFala.Silencioso: ChecarPegadaInicial(); break; case EstadoDeFala.Tagarelando: VerificarSeSoltou(); break; } } private void ChecarPegadaInicial() { if (tempoDeReativacao > 0f && objetoFalante.grabbed) { tempoDeReativacao -= Time.deltaTime; } else if ((Object)(object)PhysGrabber.instance != (Object)null && PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)objetoFalante) { estadoAtual = EstadoDeFala.Tagarelando; ExibirFraseNoChat(); } } private void VerificarSeSoltou() { if (!ChatManager.instance.StateIsPossessed() || (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)objetoFalante) { estadoAtual = EstadoDeFala.Silencioso; tempoDeReativacao = Random.Range(1f, 3f); } } private void ExibirFraseNoChat() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) string text = frasesEngracadas[Random.Range(0, frasesEngracadas.Length)]; Color val = default(Color); ((Color)(ref val))..ctor(0.05f, 0.68f, 0.68f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)0, text, 3f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } public class FaladorEngracado2 : MonoBehaviourPun { private enum EstadoDeFala { Silencioso, Tagarelando } public PhysGrabObject objetoFalante; private float tempoDeReativacao = 0.5f; private EstadoDeFala estadoAtual = EstadoDeFala.Silencioso; private readonly string[] frasesEngracadas = new string[5] { "I may be small, but I’m full of energy!", "Being happy is my superpower!", "Time for some splashy fun!", "Everything's more fun with friends!", "Let’s go on an adventure!" }; private void Start() { if ((Object)(object)objetoFalante == (Object)null) { objetoFalante = ((Component)this).GetComponent<PhysGrabObject>(); } } private void Update() { if (SemiFunc.IsMultiplayer()) { AtualizarEstadoDeFala(); } } private void AtualizarEstadoDeFala() { switch (estadoAtual) { case EstadoDeFala.Silencioso: ChecarPegadaInicial(); break; case EstadoDeFala.Tagarelando: VerificarSeSoltou(); break; } } private void ChecarPegadaInicial() { if (tempoDeReativacao > 0f && objetoFalante.grabbed) { tempoDeReativacao -= Time.deltaTime; } else if ((Object)(object)PhysGrabber.instance != (Object)null && PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)objetoFalante) { estadoAtual = EstadoDeFala.Tagarelando; ExibirFraseNoChat(); } } private void VerificarSeSoltou() { if (!ChatManager.instance.StateIsPossessed() || (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)objetoFalante) { estadoAtual = EstadoDeFala.Silencioso; tempoDeReativacao = Random.Range(1f, 3f); } } private void ExibirFraseNoChat() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) string text = frasesEngracadas[Random.Range(0, frasesEngracadas.Length)]; Color val = default(Color); ((Color)(ref val))..ctor(0.05f, 0.68f, 0.68f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)0, text, 3f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } public class FaladorEngracadoDano3 : MonoBehaviourPun { private enum EstadoDeFala { Silencioso, Tagarelando } public PhysGrabObject objetoFalante; private float tempoDeReativacao = 0.5f; private EstadoDeFala estadoAtual = EstadoDeFala.Silencioso; private readonly string[] frasesEngracadas = new string[3] { "Herobrine", "Have you seen the Herobrine?", "Only God can help you now." }; private float tempoParaProximoDano = 1f; private float intervaloDano = 1f; private int danoPorTick = 1; private void Start() { if ((Object)(object)objetoFalante == (Object)null) { objetoFalante = ((Component)this).GetComponent<PhysGrabObject>(); } } private void Update() { if (SemiFunc.IsMultiplayer()) { AtualizarEstadoDeFala(); AplicarDanoSeNecessario(); } } private void AtualizarEstadoDeFala() { if ((Object)(object)PhysGrabber.instance != (Object)null && PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)objetoFalante) { if (estadoAtual == EstadoDeFala.Silencioso) { estadoAtual = EstadoDeFala.Tagarelando; tempoParaProximoDano = intervaloDano; ExibirFraseNoChat(); } } else if (estadoAtual == EstadoDeFala.Tagarelando) { estadoAtual = EstadoDeFala.Silencioso; tempoDeReativacao = Random.Range(1f, 3f); } } private void AplicarDanoSeNecessario() { if (estadoAtual != EstadoDeFala.Tagarelando || (PhotonNetwork.IsConnected && !((MonoBehaviourPun)this).photonView.IsMine)) { return; } tempoParaProximoDano -= Time.deltaTime; if (tempoParaProximoDano <= 0f) { tempoParaProximoDano = intervaloDano; if ((Object)(object)PlayerAvatar.instance != (Object)null && (Object)(object)PlayerAvatar.instance.playerHealth != (Object)null) { PlayerAvatar.instance.playerHealth.Hurt(danoPorTick, false, -1); } } } private void ExibirFraseNoChat() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) string text = frasesEngracadas[Random.Range(0, frasesEngracadas.Length)]; Color val = default(Color); ((Color)(ref val))..ctor(0.05f, 0.68f, 0.68f, 1f); ChatManager.instance.PossessChatScheduleStart(10); ChatManager.instance.PossessChat((PossessChatID)0, text, 3f, val, 0f, false, 0, (UnityEvent)null); ChatManager.instance.PossessChatScheduleEnd(); } } public class Falatorio : MonoBehaviourPunCallbacks { private enum State { Idle, Active } public PhysGrabObject physGrabObject; private float coolDownUntilNextSentence = 0.5f; private State currentState = State.Idle; private ParticleScriptExplosion particleScriptExplosion; public Transform Center; public Sound PreExplosionSound; private bool isExploding = false; [Range(0f, 100f)] public float ExplosionChance = 25f; private void Start() { particleScriptExplosion = ((Component)this).GetComponent<ParticleScriptExplosion>(); if ((Object)(object)particleScriptExplosion == (Object)null) { Debug.LogError((object)"ParticleScriptExplosion component not found!"); } if ((Object)(object)Center == (Object)null) { Debug.LogError((object)"Center transform is not assigned!"); } } private void Update() { if (SemiFunc.IsMultiplayer()) { switch (currentState) { case State.Idle: StateIdle(); break; case State.Active: StateActive(); break; } } } private void StateIdle() { if (coolDownUntilNextSentence > 0f && physGrabObject.grabbed) { coolDownUntilNextSentence -= Time.deltaTime; } else if ((Object)(object)PhysGrabber.instance != (Object)null && PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject == (Object)(object)physGrabObject) { currentState = State.Active; Debug.Log((object)"CHICKEN JOCKEY activated!"); } } private void StateActive() { if (PhysGrabber.instance.grabbed && (Object)(object)PhysGrabber.instance.grabbedPhysGrabObject != (Object)(object)physGrabObject) { currentState = State.Idle; coolDownUntilNextSentence = Random.Range(1f, 3f); } else { 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. Attach the component."); return; } if ((Object)(object)Center == (Object)null) { Debug.LogError((object)"Center transform is not assigned."); 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) { ((MonoBehaviourPun)this).photonView.RPC("StartExplosionRpc", (RpcTarget)0, Array.Empty<object>()); } } } [PunRPC] public void StartExplosionRpc() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) isExploding = true; Sound preExplosionSound = PreExplosionSound; if (preExplosionSound != null) { preExplosionSound.Play(Center.position, 1f, 1f, 1f, 1f); } ((MonoBehaviour)this).Invoke("Explode", 1.1f); } } public class GiraGirandoPo : MonoBehaviour { private PhysGrabObject physGrabObject; private Rigidbody rb; public float forceAmount = 50f; public float rotationRadius = 1.5f; public float rotationSpeed = 3f; private Vector3 centerOffset; private float angle = 0f; private void Start() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //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) physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); rb = ((Component)this).GetComponent<Rigidbody>(); centerOffset = Vector3.right * rotationRadius; } private void FixedUpdate() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_009e: Unknown result type (might be due to invalid IL or missing references) if (physGrabObject.grabbed) { angle += rotationSpeed * Time.fixedDeltaTime; Vector3 val = new Vector3(Mathf.Cos(angle), 0f, Mathf.Sin(angle)) * rotationRadius; Vector3 val2 = val - centerOffset; Vector3 val3 = ((Vector3)(ref val2)).normalized * forceAmount; rb.AddForce(new Vector3(val3.x, 0f, val3.z), (ForceMode)5); centerOffset = val; } } } public class GiraGiraEin : MonoBehaviour { public float rotationRadius = 1f; public float angularSpeed = 360f; public float duration = 2f; public float minImpactForce = 2f; public float groundCheckDistance = 0.15f; private Rigidbody rb; private bool rotating = false; private float rotateTimer = 0f; private float currentAngle = 0f; private Vector3 centerPoint; private void Start() { rb = ((Component)this).GetComponent<Rigidbody>(); } private void OnCollisionEnter(Collision collision) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (!rotating) { Vector3 relativeVelocity = collision.relativeVelocity; if (((Vector3)(ref relativeVelocity)).magnitude > minImpactForce && IsGrounded()) { rotating = true; rotateTimer = duration; centerPoint = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y, ((Component)this).transform.position.z); currentAngle = 0f; } } } private void FixedUpdate() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d3: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (rotating) { rotateTimer -= Time.fixedDeltaTime; if (rotateTimer <= 0f) { rotating = false; rb.velocity = new Vector3(0f, rb.velocity.y, 0f); return; } currentAngle += angularSpeed * (MathF.PI / 180f) * Time.fixedDeltaTime; Vector3 val = new Vector3(Mathf.Cos(currentAngle), 0f, Mathf.Sin(currentAngle)) * rotationRadius; Vector3 val2 = centerPoint + val; Vector3 val3 = (val2 - ((Component)this).transform.position) / Time.fixedDeltaTime; rb.velocity = new Vector3(val3.x, rb.velocity.y, val3.z); } } private bool IsGrounded() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return Physics.Raycast(((Component)this).transform.position, Vector3.down, groundCheckDistance + 0.01f); } } public class GranadaJogavel : MonoBehaviour { public Color blinkColor; private ItemToggle itemToggle; private ItemAttributes itemAttributes; internal bool isActive; private float grenadeTimer; public float tickTime = 3f; private PhotonView photonView; private PhysGrabObjectImpactDetector physGrabObjectImpactDetector; public Sound soundSplinter; public Sound soundTick; private float splinterAnimationProgress; public AnimationCurve splinterAnimationCurve; private Transform splinterTransform; 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 bool isThrownRocket; public float rocketForce = 20f; private ItemGrenadeExplosive grenadeExplosive; private void Start() { //IL_0098: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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) itemEquippable = ((Component)this).GetComponent<ItemEquippable>(); itemToggle = ((Component)this).GetComponent<ItemToggle>(); itemAttributes = ((Component)this).GetComponent<ItemAttributes>(); photonView = ((Component)this).GetComponent<PhotonView>(); physGrabObjectImpactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); splinterTransform = ((Component)this).transform.Find("Splinter"); Transform val = ((Component)this).transform.Find("Mesh"); if ((Object)(object)val != (Object)null) { Renderer component = ((Component)val).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { grenadeEmissionMaterial = component.material; } } grenadeStartPosition = ((Component)this).transform.position; grenadeStartRotation = ((Component)this).transform.rotation; physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); rb = ((Component)this).GetComponent<Rigidbody>(); grenadeExplosive = ((Component)this).GetComponent<ItemGrenadeExplosive>(); prevPosition = ((Component)this).transform.position; if ((Object)(object)throwLine != (Object)null) { throwLineTrail = throwLine.GetComponent<TrailRenderer>(); throwLine.SetActive(false); } } private void FixedUpdate() { //IL_0050: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)itemEquippable != (Object)null && (itemEquippable.isEquipped || itemEquippable.wasEquippedTimer > 0f)) { if ((Object)(object)rb != (Object)null) { prevPosition = rb.position; } } else if (!((Object)(object)rb == (Object)null) && !((Object)(object)physGrabObject == (Object)null)) { Vector3 val = (rb.position - prevPosition) / Time.fixedDeltaTime; prevPosition = rb.position; if (!physGrabObject.grabbed && ((Vector3)(ref val)).magnitude > 2f) { throwLineTimer = 0.2f; } if ((Object)(object)throwLineTrail != (Object)null) { throwLineTrail.emitting = throwLineTimer > 0f; } if (throwLineTimer > 0f) { throwLineTimer -= Time.fixedDeltaTime; } } } private void Update() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) Sound obj = soundTick; if (obj != null) { obj.PlayLoop(isActive, 2f, 2f, 1f); } if ((Object)(object)itemEquippable != (Object)null && itemEquippable.isEquipped) { if (isActive) { isActive = false; grenadeTimer = 0f; splinterAnimationProgress = 0f; ItemToggle obj2 = itemToggle; if (obj2 != null) { obj2.ToggleItem(false, -1); } if ((Object)(object)splinterTransform != (Object)null) { splinterTransform.localEulerAngles = Vector3.zero; } if ((Object)(object)grenadeEmissionMaterial != (Object)null) { grenadeEmissionMaterial.SetColor("_EmissionColor", Color.black); } isThrownRocket = false; if ((Object)(object)throwLine != (Object)null) { throwLine.SetActive(false); } } return; } if ((Object)(object)itemEquippable != (Object)null && !itemEquippable.isEquipped && isActive && !isThrownRocket && (Object)(object)physGrabObject != (Object)null && !physGrabObject.grabbed) { isThrownRocket = true; LaunchAsRocket(); } if (isActive) { if (splinterAnimationProgress < 1f) { splinterAnimationProgress += 5f * Time.deltaTime; float num = ((splinterAnimationCurve != null) ? splinterAnimationCurve.Evaluate(splinterAnimationProgress) : 0f); if ((Object)(object)splinterTransform != (Object)null) { splinterTransform.localEulerAngles = new Vector3(num * 90f, 0f, 0f); } } float num2 = Mathf.PingPong(Time.time * 8f, 1f); Color val = blinkColor * Mathf.LinearToGammaSpace(num2); if ((Object)(object)grenadeEmissionMaterial != (Object)null) { grenadeEmissionMaterial.SetColor("_EmissionColor", val); } } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)itemToggle != (Object)null && itemToggle.toggleState && !isActive) { isActive = true; TickStart(); } } private void LaunchAsRocket() { //IL_003a: 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) //IL_003f: 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_0057: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)rb == (Object)null)) { Vector3 val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : ((Component)this).transform.forward); rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; rb.AddForce(val * rocketForce, (ForceMode)2); if ((Object)(object)throwLine != (Object)null) { throwLine.SetActive(true); } } } private void OnCollisionEnter(Collision collision) { if (isThrownRocket && SemiFunc.IsMasterClientOrSingleplayer()) { TickEnd(); } } private void GrenadeReset() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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) isActive = false; grenadeTimer = 0f; splinterAnimationProgress = 0f; ItemToggle obj = itemToggle; if (obj != null) { obj.ToggleItem(false, -1); } if ((Object)(object)splinterTransform != (Object)null) { splinterTransform.localEulerAngles = Vector3.zero; } if ((Object)(object)grenadeEmissionMaterial != (Object)null) { grenadeEmissionMaterial.SetColor("_EmissionColor", Color.black); } isThrownRocket = false; if ((Object)(object)throwLine != (Object)null) { throwLine.SetActive(false); } if (SemiFunc.IsMasterClientOrSingleplayer() && (Object)(object)rb != (Object)null) { rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; } } public void TickStart() { if ((Object)(object)photonView == (Object)null) { Debug.LogWarning((object)"photonView está null ao tentar chamar TickStartRPC."); } else if (SemiFunc.IsMasterClient()) { photonView.RPC("TickStartRPC", (RpcTarget)0, Array.Empty<object>()); } else { TickStartRPC(); } } private void TickEnd() { if ((Object)(object)photonView == (Object)null) { Debug.LogWarning((object)"photonView está null ao tentar chamar TickEndRPC."); } else if (SemiFunc.IsMasterClient()) { photonView.RPC("TickEndRPC", (RpcTarget)0, Array.Empty<object>()); } else { TickEndRPC(); } } [PunRPC] private void TickStartRPC() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) Sound obj = soundSplinter; if (obj != null) { obj.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } isActive = true; } [PunRPC] private void TickEndRPC() { //IL_00d6: 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) if (!isThrownRocket) { return; } if ((Object)(object)grenadeExplosive == (Object)null || (Object)(object)physGrabObject == (Object)null || (Object)(object)itemAttributes == (Object)null || (Object)(object)physGrabObjectImpactDetector == (Object)null) { Debug.LogWarning((object)"TickEndRPC: componentes ausentes. Cancelando execução."); return; } grenadeExplosive.Explosion(); if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!SemiFunc.RunIsShop() || isSpawnedGrenade) { if (!isSpawnedGrenade && (Object)(object)StatsManager.instance != (Object)null) { StatsManager.instance.ItemRemove(itemAttributes.instanceName); } physGrabObjectImpactDetector.DestroyObject(true); } else { physGrabObject.Teleport(grenadeStartPosition, grenadeStartRotation); } } if (SemiFunc.RunIsShop() && !isSpawnedGrenade) { GrenadeReset(); } } } [BepInPlugin("com.seuprojeto.suprimirlog", "SuprimirLogsUnity", "1.0.0")] public class SuprimirLogsUnity : BaseUnityPlugin { private class CustomLogHandler : ILogHandler { private readonly ILogHandler originalHandler; public CustomLogHandler(ILogHandler original) { originalHandler = original; } public void LogFormat(LogType logType, Object context, string format, params object[] args) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) if ((int)logType != 2 || format == null || !format.Contains("CustomPrefabPool: failed to register network prefab")) { originalHandler.LogFormat(logType, context, format, args); } } public void LogException(Exception exception, Object context) { string stackTrace = exception.StackTrace; if ((!(exception is NullReferenceException) || stackTrace == null || !stackTrace.Contains("ItemBattery.Update")) && (!(exception is MissingMethodException) || !exception.Message.Contains("PlayerAvatar.ChatMessageSend")) && (stackTrace == null || stackTrace.Contains("SillyValuables") || stackTrace.Contains("SuprimirLogsUnity"))) { originalHandler.LogException(exception, context); } } } private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown Debug.Log((object)"[SuprimirLogsUnity] Iniciando plugin..."); Debug.unityLogger.logHandler = (ILogHandler)(object)new CustomLogHandler(Debug.unityLogger.logHandler); Harmony val = new Harmony("com.seuprojeto.batteryfix"); val.PatchAll(); Debug.Log((object)"[SuprimirLogsUnity] Plugin carregado com sucesso."); } } [HarmonyPatch(typeof(ItemBattery), "BatteryLookAt")] public class Patch_ItemBattery_BatteryLookAt { private static bool Prefix(ItemBattery __instance) { //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) try { object? obj = ((object)__instance).GetType().GetField("batteryTransform", BindingFlags.Instance | BindingFlags.Public)?.GetValue(__instance); Transform val = (Transform)((obj is Transform) ? obj : null); FieldInfo field = ((object)__instance).GetType().GetField("mainCamera", BindingFlags.Instance | BindingFlags.NonPublic); object? obj2 = field?.GetValue(__instance); Camera val2 = (Camera)((obj2 is Camera) ? obj2 : null); bool valueOrDefault = ((bool?)((object)__instance).GetType().GetField("showBattery", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(__instance)).GetValueOrDefault(); bool valueOrDefault2 = ((bool?)((object)__instance).GetType().GetField("batteryActive", BindingFlags.Instance | BindingFlags.Public)?.GetValue(__instance)).GetValueOrDefault(); bool valueOrDefault3 = ((bool?)((object)__instance).GetType().GetField("isCharging", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(__instance)).GetValueOrDefault(); float? num = (float?)((object)__instance).GetType().GetField("upOffset", BindingFlags.Instance | BindingFlags.Public)?.GetValue(__instance); if ((Object)(object)val == (Object)null || !num.HasValue) { return false; } PhysGrabObject component = ((Component)__instance).GetComponent<PhysGrabObject>(); if ((Object)(object)component != (Object)null && component.grabbed && component.grabbedLocal) { if (((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(false); } return false; } if ((Object)(object)val2 == (Object)null) { val2 = Camera.main; if ((Object)(object)val2 != (Object)null) { field?.SetValue(__instance, val2); } } if ((Object)(object)val2 == (Object)null) { return false; } if (valueOrDefault || valueOrDefault2 || valueOrDefault3) { val.LookAt(((Component)val2).transform); float num2 = Vector3.Distance(val.position, ((Component)val2).transform.position); val.localScale = Vector3.one * num2 * 0.8f; if (val.localScale.x > 3f) { val.localScale = Vector3.one * 3f; } val.Rotate(0f, 180f, 0f); val.position = ((Component)__instance).transform.position + Vector3.up * num.Value; } } catch (Exception ex) { Debug.LogError((object)("[Harmony] Erro em BatteryLookAt: " + ex)); } return false; } } [HarmonyPatch(typeof(ItemBattery), "Update")] public class Patch_ItemBattery_Update { private static void Postfix(ItemBattery __instance) { try { PhysGrabObject component = ((Component)__instance).GetComponent<PhysGrabObject>(); if ((Object)(object)component != (Object)null && component.grabbed && component.grabbedLocal) { object? obj = ((object)__instance).GetType().GetField("batteryTransform", BindingFlags.Instance | BindingFlags.Public)?.GetValue(__instance); Transform val = (Transform)((obj is Transform) ? obj : null); if ((Object)(object)val != (Object)null && ((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(false); Debug.Log((object)"[Harmony] Forçando ocultação da barra de bateria na mão (Update)."); } } } catch (Exception ex) { Debug.LogError((object)("[Harmony] Erro ao ocultar barra de bateria no Update: " + ex)); } } } [HarmonyPatch(typeof(TiroAutomatico), "Shoot")] public class Patch_TiroAutomatico_Shoot { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); string text = "SetInvestigate"; for (int i = 0; i < list.Count; i++) { CodeInstruction val = list[i]; if ((val.opcode == OpCodes.Call || val.opcode == OpCodes.Callvirt) && val.operand is MethodInfo methodInfo && methodInfo.Name == text && methodInfo.GetParameters().Length == 2 && methodInfo.GetParameters()[0].ParameterType == typeof(Vector3) && methodInfo.GetParameters()[1].ParameterType == typeof(float)) { Debug.Log((object)"[Harmony] Removendo chamada EnemyDirector.SetInvestigate."); list.RemoveAt(i); list.RemoveAt(i - 1); list.RemoveAt(i - 2); break; } } return list; } } public class FazSumi : MonoBehaviour { private PhysGrabObject physGrabObject; private Renderer[] renderers; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); renderers = ((Component)this).GetComponentsInChildren<Renderer>(); } private void Update() { if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed) { SetRenderersVisible(visible: false); } else { SetRenderersVisible(visible: true); } } private void SetRenderersVisible(bool visible) { Renderer[] array = renderers; foreach (Renderer val in array) { val.enabled = visible; } } } public class IrFrente : MonoBehaviour { public float moveSpeed = 3f; public float cooldown = 0.5f; public float minImpactForce = 2f; public float driftIntensity = 0.5f; public float driftFrequency = 5f; private Rigidbody rb; private bool moving = false; private float moveTimer = 0f; private float lastMoveTime = float.NegativeInfinity; private float driftTimer = 0f; private void Start() { rb = ((Component)this).GetComponent<Rigidbody>(); } private void OnCollisionEnter(Collision collision) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!moving) { Vector3 relativeVelocity = collision.relativeVelocity; if (((Vector3)(ref relativeVelocity)).magnitude > minImpactForce && Time.time > lastMoveTime + cooldown) { moving = true; moveTimer = 2f; lastMoveTime = Time.time; driftTimer = 0f; } } } private void FixedUpdate() { //IL_0027: 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_0037: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00f3: Unknown result type (might be due to invalid IL or missing references) if (moving) { driftTimer += Time.fixedDeltaTime; Vector3 val = ((Component)this).transform.forward * moveSpeed; Vector3 val2 = ((Component)this).transform.right * Mathf.Sin(driftTimer * driftFrequency) * driftIntensity; Vector3 val3 = val + val2; float y = rb.velocity.y; Vector3 velocity = default(Vector3); ((Vector3)(ref velocity))..ctor(val3.x, y, val3.z); rb.velocity = velocity; moveTimer -= Time.fixedDeltaTime; if (moveTimer <= 0f) { moving = false; rb.velocity = new Vector3(0f, rb.velocity.y, 0f); } } } } public class GiraIsso : MonoBehaviour { private PhysGrabObject physGrabObject; [Header("Configuração da rotação")] public Vector3 rotationSpeed = new Vector3(0f, 90f, 0f); private Vector3 currentRotation; private void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); currentRotation = ((Component)this).transform.localEulerAngles; } private void Update() { //IL_0024: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) if ((Object)(object)physGrabObject != (Object)null && physGrabObject.grabbed) { currentRotation += rotationSpeed * Time.deltaTime; currentRotation.x %= 360f; currentRotation.y %= 360f; currentRotation.z %= 360f; ((Component)this).transform.localEulerAngles = currentRotation; } } } public class FazAparecerItem : MonoBehaviour { public GameObject[] valuablesToSpawn; public Transform spawnPoint; public float spawnForce = 2f; private ItemToggle itemToggle; private ItemEquippable itemEquippable; private ItemAttributes itemAttributes; private PhotonView photonView; private PhysGrabObject physGrabObject; [Space] public ParticleSystem[] particles; public ParticleSystem[] rejectParticles; [Space] public PropLight propLight; public AnimationCurve lightIntensityCurve; private float lightIntensityLerp; public MeshRenderer mesh; private Material material; private Color materialEmissionOriginal; private int materialPropertyEmission = Shader.PropertyToID("_EmissionColor"); [Space] public Sound soundUse; public Sound soundReject; private bool used; private void Start() { //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) itemToggle = ((Component)this).GetComponent<ItemToggle>(); itemEquippable = ((Component)this).GetComponent<ItemEquippable>(); itemAttributes = ((Component)this).GetComponent<ItemAttributes>(); photonView = ((Component)this).GetComponent<PhotonView>(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); material = (Object.op_Implicit((Object)(object)mesh) ? ((Renderer)mesh).material : null); if ((Object)(object)material != (Object)null) { materialEmissionOriginal = material.GetColor(materialPropertyEmission); } DebugCheckComponent((Object)(object)itemToggle, "ItemToggle"); DebugCheckComponent((Object)(object)itemEquippable, "ItemEquippable"); DebugCheckComponent((Object)(object)itemAttributes, "ItemAttributes"); DebugCheckComponent((Object)(object)photonView, "PhotonView"); DebugCheckComponent((Object)(object)physGrabObject, "PhysGrabObject"); DebugCheckComponent((Object)(object)mesh, "MeshRenderer"); DebugCheckComponent((Object)(object)propLight, "PropLight"); if (valuablesToSpawn == null || valuablesToSpawn.Length == 0) { Debug.LogWarning((object)"[FazAparecerItem] Nenhum Valuable atribuído no array 'valuablesToSpawn'!"); } } private void DebugCheckComponent(Object component, string name) { if (component == (Object)null) { Debug.LogError((object)("[FazAparecerItem] Componente obrigatório '" + name + "' está faltando em '" + ((Object)((Component)this).gameObject).name + "'")); } } private void Update() { if (SemiFunc.RunIsShop()) { return; } LightLogic(); if (SemiFunc.IsMasterClientOrSingleplayer() && itemToggle.toggleState && !used) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("UsedRPC", (RpcTarget)0, Array.Empty<object>()); } else { UsedRPC(); } StatsManager.instance.ItemRemove(itemAttributes.instanceName); physGrabObject.impactDetector.indestructibleBreakEffects = true; } } private void LightLogic() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (used && lightIntensityLerp < 1f) { lightIntensityLerp += Time.deltaTime; float num = lightIntensityCurve.Evaluate(lightIntensityLerp); if ((Object)(object)propLight != (Object)null && (Object)(object)propLight.lightComponent != (Object)null) { propLight.lightComponent.intensity = num; propLight.originalIntensity = num; } if ((Object)(object)material != (Object)null) { material.SetColor(materialPropertyEmission, Color.Lerp(Color.black, materialEmissionOriginal, num)); } } } [PunRPC] private void UsedRPC() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_00ee: Unknown result type (might be due to invalid IL or missing references) ItemToggle obj = itemToggle; if (obj != null) { obj.ToggleDisable(true); } ItemAttributes obj2 = itemAttributes; if (obj2 != null) { obj2.DisableUI(true); } if ((Object)(object)itemEquippable != (Object)null) { Object.Destroy((Object)(object)itemEquippable); } if (valuablesToSpawn.Length != 0) { GameObject val = valuablesToSpawn[Random.Range(0, valuablesToSpawn.Length)]; if ((Object)(object)val == (Object)null) { Debug.LogError((object)"Prefab nulo dentro de valuablesToSpawn!"); return; } string text = ((Object)val).name.Trim(); Vector3 val2 = (Object.op_Implicit((Object)(object)spawnPoint) ? spawnPoint.position : (((Component)this).transform.position + ((Component)this).transform.forward)); Quaternion identity = Quaternion.identity; if (PhotonNetwork.InRoom) { if (PhotonNetwork.IsMasterClient) { PhotonNetwork.Instantiate(text, val2, identity, (byte)0, (object[])null); } } else { GameObject val3 = Object.Instantiate<GameObject>(val, val2, identity); Rigidbody val4 = default(Rigidbody); if (val3.TryGetComponent<Rigidbody>(ref val4)) { val4.AddForce(((Component)this).transform.forward * spawnForce, (ForceMode)1); } } } ParticleSystem[] array = particles; foreach (ParticleSystem val5 in array) { if (val5 != null) { val5.Play(); } } Sound obj3 = soundUse; if (obj3 != null) { obj3.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)this).transform.position, 0.2f); used = true; } [PunRPC] private void RejectRPC() { //IL_0077: 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) PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(itemToggle.playerTogglePhotonID); if ((Object)(object)val != (Object)null && val.isLocal) { val.physGrabber.ReleaseObjectRPC(false, 1f); } ParticleSystem[] array = rejectParticles; foreach (ParticleSystem val2 in array) { if (val2 != null) { val2.Play(); } } Sound obj = soundReject; if (obj != null) { obj.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } GameDirector.instance.CameraImpact.ShakeDistance(5f, 1f, 6f, ((Component)this).transform.position, 0.2f); } private void OnDestroy() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] array = particles; foreach (ParticleSystem val in array) { if ((Object)(object)val != (Object)null && val.isPlaying) { ((Component)val).transform.SetParent((Transform)null); MainModule main = val.main; ((MainModule)(ref main)).stopAction = (ParticleSystemStopAction)2; } } ParticleSystem[] array2 = rejectParticles; foreach (ParticleSystem val2 in array2) { if ((Object)(object)val2 != (Object)null && val2.isPlaying) { ((Component)val2).transform.SetParent((Transform)null); MainModule main2 = val2.main; ((MainModule)(ref main2)).stopAction = (ParticleSystemStopAction)2; } } } } public class KillPlayer : MonoBehaviourPun { private PhotonView? pv; private void Awake() { pv = ((Component)this).GetComponent<PhotonView>(); } private void OnDestroy() { if (SemiFunc.IsMultiplayer()) { if ((Object)(object)pv != (Object)null && pv.IsMine && PlayerIsInSight(PlayerAvatar.instance)) { ChatManager.instance.Posse