Decompiled source of SillyValuables v6.5.7
SillyValuables.dll
Decompiled 2 days 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.Rendering.PostProcessing; 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 ValuableExplosivo : Trap { private class TriggerInternoExplosivo : MonoBehaviour { private ValuableExplosivo explosivo; public void Inicializar(ValuableExplosivo referencia) { explosivo = referencia; } private void OnTriggerEnter(Collider other) { if (!((Object)(object)explosivo == (Object)null)) { PlayerController componentInParent = ((Component)other).GetComponentInParent<PlayerController>(); PlayerAvatar componentInParent2 = ((Component)other).GetComponentInParent<PlayerAvatar>(); PhysGrabObject componentInParent3 = ((Component)other).GetComponentInParent<PhysGrabObject>(); bool flag = (Object)(object)componentInParent3 != (Object)null && componentInParent3.isEnemy; if ((Object)(object)componentInParent != (Object)null || (Object)(object)componentInParent2 != (Object)null || flag) { explosivo.AtivarPorTrigger(); } } } } [Header("Áudio")] public AudioSource somPrincipal; public AudioSource somDirecional; public AudioClip somAlarme; public AudioClip somExplosao; [Header("Explosão")] public float chanceExplodir = 1f; public float raioExplosao = 0.35f; public int dano = 120; public int danoInimigo = 200; public float forcaExplosao = 1.2f; [Header("Alerta Inimigo")] public float alcanceSom = 15f; public float alcanceExplosao = 60f; [Header("Trigger")] public Collider triggerColisor; [Header("Partículas")] public GameObject explosaoPrefab; private Rigidbody rb; private PhysGrabObjectImpactDetector detectorImpacto; private float ultimoToque = -999f; public float intervaloToque = 0.2f; private bool explodido = false; public override void Start() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown ((Trap)this).Start(); rb = ((Component)this).GetComponent<Rigidbody>(); detectorImpacto = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); if ((Object)(object)somPrincipal == (Object)null) { somPrincipal = ((Component)this).GetComponent<AudioSource>(); } if ((Object)(object)somDirecional == (Object)null && (Object)(object)((Component)this).transform.Find("SomDirecional") != (Object)null) { somDirecional = ((Component)((Component)this).transform.Find("SomDirecional")).GetComponent<AudioSource>(); } if ((Object)(object)detectorImpacto != (Object)null) { detectorImpacto.onImpactMedium.RemoveListener(new UnityAction(ImpactoMedio)); detectorImpacto.onImpactHeavy.RemoveListener(new UnityAction(ImpactoForte)); detectorImpacto.onImpactMedium.AddListener(new UnityAction(ImpactoMedio)); detectorImpacto.onImpactHeavy.AddListener(new UnityAction(ImpactoForte)); } if ((Object)(object)triggerColisor != (Object)null) { ((Component)triggerColisor).gameObject.AddComponent<TriggerInternoExplosivo>().Inicializar(this); } } private void OnDestroy() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if ((Object)(object)detectorImpacto != (Object)null) { detectorImpacto.onImpactMedium.RemoveListener(new UnityAction(ImpactoMedio)); detectorImpacto.onImpactHeavy.RemoveListener(new UnityAction(ImpactoForte)); } } private void ImpactoMedio() { TocarAlarme("ImpactoMédio"); } private void ImpactoForte() { TocarAlarme("ImpactoForte"); } private void TocarAlarme(string tipo) { if (!explodido && !(Time.time - ultimoToque < intervaloToque)) { ultimoToque = Time.time; TocarSom(); if (SemiFunc.IsMultiplayer() && (Object)(object)base.photonView != (Object)null) { base.photonView.RPC("RPC_ReproduzirSom", (RpcTarget)1, new object[1] { tipo }); } } } public void AtivarPorTrigger() { if (!explodido && !(Time.time - ultimoToque < intervaloToque)) { ultimoToque = Time.time; TocarSom(); if (SemiFunc.IsMultiplayer() && (Object)(object)base.photonView != (Object)null) { base.photonView.RPC("RPC_ReproduzirSom", (RpcTarget)1, new object[1] { "Trigger" }); } } } private void TocarSom() { AudioSource val = (((Object)(object)somDirecional != (Object)null) ? somDirecional : somPrincipal); if ((Object)(object)val != (Object)null && (Object)(object)somAlarme != (Object)null) { val.maxDistance = alcanceSom; val.PlayOneShot(somAlarme); } } [PunRPC] public void RPC_ReproduzirSom(string tipo) { if (!explodido) { TocarSom(); if (Random.value < chanceExplodir) { explodido = true; Explodir(); } else { base.enemyInvestigate = true; base.enemyInvestigateRange = alcanceSom; } } } private void Explodir() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"[ValuableExplosivo] Explodiu!"); if ((Object)(object)somPrincipal != (Object)null && (Object)(object)somExplosao != (Object)null) { somPrincipal.maxDistance = alcanceExplosao; somPrincipal.PlayOneShot(somExplosao); } if ((Object)(object)explosaoPrefab != (Object)null) { GameObject val = Object.Instantiate<GameObject>(explosaoPrefab, ((Component)this).transform.position, Quaternion.identity); Object.Destroy((Object)(object)val, 5f); } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, raioExplosao); Collider[] array2 = array; foreach (Collider val2 in array2) { Rigidbody attachedRigidbody = val2.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null) { attachedRigidbody.AddExplosionForce(500f * forcaExplosao, ((Component)this).transform.position, raioExplosao); } PlayerAvatar componentInParent = ((Component)val2).GetComponentInParent<PlayerAvatar>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.playerHealth != (Object)null) { componentInParent.playerHealth.health = Mathf.Max(0, componentInParent.playerHealth.health - dano); } PhysGrabObject componentInParent2 = ((Component)val2).GetComponentInParent<PhysGrabObject>(); if ((Object)(object)componentInParent2 != (Object)null && componentInParent2.isEnemy && !componentInParent2.dead) { componentInParent2.dead = true; } } base.enemyInvestigate = true; base.enemyInvestigateRange = alcanceExplosao; if ((Object)(object)base.physGrabObject != (Object)null) { base.physGrabObject.dead = true; } } } public class Armadilha1 : Trap { [Header("Visuais")] public ParticleSystem particulasAtivacao; public AudioClip somAlto; public float volumeSom = 1f; public float alcanceAlerta = 50f; [Header("Áudio")] public AudioSource fonteAudio; [Header("Câmera")] public float intensidadeCamera = 2.5f; public float tempoShake = 0.5f; public float distanciaMin = 4f; public float distanciaMax = 12f; [Header("Tempo de efeito")] public float duracaoParticula = 3f; public float duracaoSom = 3f; private bool efeitoParticulaAtivo = false; private bool efeitoSomAtivo = false; private bool cameraTremendo = false; private bool armadilhaAtiva = false; private float cronometroParticula = 0f; private float cronometroSom = 0f; private PhysGrabObject pegaObjeto; private bool segurandoAntes = false; public override void Start() { ((Trap)this).Start(); if ((Object)(object)fonteAudio == (Object)null) { fonteAudio = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)fonteAudio == (Object)null) { fonteAudio = ((Component)this).gameObject.AddComponent<AudioSource>(); fonteAudio.spatialBlend = 1f; } } pegaObjeto = ((Component)this).GetComponent<PhysGrabObject>(); } public override void Update() { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) ((Trap)this).Update(); bool flag = (Object)(object)pegaObjeto != (Object)null && pegaObjeto.grabbed; if (!armadilhaAtiva && !base.trapTriggered && flag) { ((Trap)this).TrapActivateSync(); base.trapTriggered = true; base.trapStart = true; DispararArmadilha(); armadilhaAtiva = true; } if (base.trapTriggered && !flag && segurandoAntes && !armadilhaAtiva) { base.trapTriggered = false; base.trapStart = false; } segurandoAntes = flag; if (efeitoParticulaAtivo && (Object)(object)particulasAtivacao != (Object)null) { cronometroParticula += Time.deltaTime; if (cronometroParticula >= duracaoParticula) { particulasAtivacao.Stop(true, (ParticleSystemStopBehavior)1); efeitoParticulaAtivo = false; } } if (efeitoSomAtivo && (Object)(object)fonteAudio != (Object)null) { cronometroSom += Time.deltaTime; if (cronometroSom >= duracaoSom) { fonteAudio.Stop(); efeitoSomAtivo = false; } } if (cameraTremendo) { if ((Object)(object)GameDirector.instance?.CameraImpact != (Object)null) { GameDirector.instance.CameraImpact.ShakeDistance(intensidadeCamera, distanciaMin, distanciaMax, ((Component)this).transform.position, 0.2f); } if (!efeitoParticulaAtivo && !efeitoSomAtivo) { cameraTremendo = false; } } if (armadilhaAtiva && !efeitoParticulaAtivo && !efeitoSomAtivo && !cameraTremendo && !flag) { armadilhaAtiva = false; base.trapTriggered = false; base.trapStart = false; } } private void DispararArmadilha() { if ((Object)(object)particulasAtivacao != (Object)null) { particulasAtivacao.Play(); efeitoParticulaAtivo = true; cronometroParticula = 0f; } if ((Object)(object)somAlto != (Object)null && (Object)(object)fonteAudio != (Object)null) { fonteAudio.PlayOneShot(somAlto, volumeSom); efeitoSomAtivo = true; cronometroSom = 0f; } cameraTremendo = true; base.enemyInvestigate = true; base.enemyInvestigateRange = alcanceAlerta; } } public class FalarCustomizado : MonoBehaviourPun { private enum EstadoDeFala { Silencioso, Tagarelando } public PhysGrabObject objetoFalante; [Header("Frases Personalizadas")] [Tooltip("Frases que o objeto pode dizer ao ser pego")] public 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 float tempoDeReativacao = 0.5f; private EstadoDeFala estadoAtual = EstadoDeFala.Silencioso; 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_0066: Unknown result type (might be due to invalid IL or missing references) if (frasesEngracadas != null && frasesEngracadas.Length != 0) { 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 PulinPulin : Trap { public float impulsoVertical = 6f; public float impulsoFrontal = 3f; public float intervaloEntreSaltos = 0.25f; public AudioSource somSource; public AudioClip somPulo; [Header("Atrair Inimigos")] public float raioDeAlerta = 7f; private Rigidbody corpo; private PhysGrabObjectImpactDetector impactoDetector; private float momentoUltimoPulo = -999f; public override void Start() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown ((Trap)this).Start(); corpo = ((Component)this).GetComponent<Rigidbody>(); impactoDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); if ((Object)(object)somSource == (Object)null) { somSource = ((Component)this).GetComponent<AudioSource>(); } if ((Object)(object)impactoDetector != (Object)null) { impactoDetector.onAllImpacts.AddListener(new UnityAction(QuandoBate)); } } private void OnDestroy() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if ((Object)(object)impactoDetector != (Object)null) { impactoDetector.onAllImpacts.RemoveListener(new UnityAction(QuandoBate)); } } private void QuandoBate() { if (!(Time.time - momentoUltimoPulo < intervaloEntreSaltos)) { momentoUltimoPulo = Time.time; FazerPulo(); if (SemiFunc.IsMultiplayer() && (Object)(object)base.photonView != (Object)null) { base.photonView.RPC("SincronizarSalto", (RpcTarget)1, Array.Empty<object>()); } } } [PunRPC] public void SincronizarSalto() { FazerPulo(); } private void FazerPulo() { //IL_001c: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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 (!((Object)(object)corpo == (Object)null)) { corpo.velocity = Vector3.zero; corpo.angularVelocity = Vector3.zero; Vector3 val = Vector3.up * impulsoVertical + ((Component)this).transform.forward * impulsoFrontal; corpo.AddForce(val, (ForceMode)1); if ((Object)(object)somSource != (Object)null && (Object)(object)somPulo != (Object)null) { somSource.PlayOneShot(somPulo); } base.enemyInvestigate = true; base.enemyInvestigateRange = raioDeAlerta; } } } public class X0 : MonoBehaviour { } [BepInPlugin("x.y.z.ctrlrev", "CTRL_REVERT", "1.0.0")] public class Y0 : BaseUnityPlugin { [HarmonyPatch(typeof(SemiFunc), "InputMovementX")] public class Z1 { private static void Postfix(ref float __result) { if (a1) { __result = 0f - __result; } } } [HarmonyPatch(typeof(SemiFunc), "InputMovementY")] public class Z2 { private static void Postfix(ref float __result) { if (a1) { __result = 0f - __result; } } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public class Z3 { private static void Prefix(PlayerController __instance) { bool v = false; GameObject physGrabObject = __instance.physGrabObject; if ((Object)(object)physGrabObject != (Object)null && (Object)(object)physGrabObject.GetComponent<X0>() != (Object)null) { v = true; } b1(v); } } private static bool a1; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) new Harmony("x.y.z.ctrlrev").PatchAll(); } public static void b1(bool v) { a1 = v; } } public class CuraValiosa : MonoBehaviour { [Header("Componentes")] private PhysGrabObject physGrabObject; [Header("Configuração da Cura")] public float quantidadeDeCura = 10f; public float intervaloDeCura = 2f; [Header("Limites de Uso")] public bool usoInfinito = false; public int maxCurativos = 10; private int curativosAtuais = 0; private float timer; private PlayerHealth targetHealth; private bool isBeingHeld = false; private void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); if ((Object)(object)physGrabObject == (Object)null) { Debug.LogError((object)"ERRO EM CURAVALIOSA: Componente PhysGrabObject não encontrado!"); } } private void LateUpdate() { if (physGrabObject.grabbed && !isBeingHeld) { isBeingHeld = true; timer = intervaloDeCura; } else if (!physGrabObject.grabbed && isBeingHeld) { isBeingHeld = false; targetHealth = null; } if (!isBeingHeld) { return; } if ((Object)(object)targetHealth == (Object)null) { TryToFindTargetHealth(); } if ((Object)(object)targetHealth != (Object)null && (usoInfinito || curativosAtuais < maxCurativos)) { timer -= Time.deltaTime; if (timer <= 0f) { timer = intervaloDeCura; CurarJogador(); } } } private void TryToFindTargetHealth() { if (physGrabObject.playerGrabbing.Count == 0) { return; } foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if ((Object)(object)item != (Object)null && (item.photonView.IsMine || !PhotonNetwork.IsConnected) && (Object)(object)item.playerAvatar != (Object)null) { targetHealth = ((Component)item.playerAvatar).GetComponentInChildren<PlayerHealth>(true); if ((Object)(object)targetHealth != (Object)null) { Debug.Log((object)"SUCESSO: Alvo de cura [PlayerHealth] encontrado e armazenado!"); break; } } } } private void CurarJogador() { if (!((Object)(object)targetHealth == (Object)null)) { int num = Mathf.RoundToInt(quantidadeDeCura); targetHealth.health = Mathf.Min(targetHealth.health + num, targetHealth.maxHealth); if (!usoInfinito) { curativosAtuais++; } Debug.Log((object)string.Format("Jogador curado em {0}. Usos restantes: {1}", num, usoInfinito ? "Infinito" : ((object)(maxCurativos - curativosAtuais)))); } } } 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 FaladorEngracadoTeto : 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] { "TETO", "TETOOO", "PEARTO", "PEARTOO", "TETO PEARTO" }; 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 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) { StatsManag