using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using REPOLib.Modules; using UnityEngine; using UnityEngine.AI; using UnityEngine.UI; [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("Gapi")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("REPO.Him")] [assembly: AssemblyTitle("REPO.Him")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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; } } } namespace REPO.Him { [HarmonyPatch] public static class GameHooks { [HarmonyPatch(typeof(MonoBehaviour), "Update")] public static class ValuableUpdatePatch { } private static bool _hasSpawnedInfectedClone; private static GameObject _infectedObject; [HarmonyPatch(typeof(PlayerAvatar), "Start")] [HarmonyPostfix] public static void PlayerStartPatch(PlayerAvatar __instance) { if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); HimPlugin.Logger.LogInfo("Attached ParanoiaManager to PlayerAvatar."); } } } public class ParanoiaManager : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static PCMReaderCallback <>9__20_0; public static Func <>9__30_0; public static Func <>9__36_0; public static Func <>9__36_1; internal void b__20_0(float[] data) { for (int i = 0; i < data.Length; i++) { data[i] = (float)((double)Random.value * 2.0 - 1.0) * 0.15f; } } internal bool b__30_0(Rigidbody r) { return ((Object)r).name.ToLower().Contains("cart"); } internal bool b__36_0(Component c) { return (Object)(object)c != (Object)null; } internal string b__36_1(Component c) { return ((object)c).GetType().Name; } } private PlayerAvatar _player; private Camera _playerCamera; private Text _staticTextNoise; private string[] _noiseFrames; private float _isolationRadius = 8f; private float _trackingRadius = 15f; private float _minHoldDist = 2.4f; public float _triggerLimit = 20f; private bool _isTimerRunning = false; public bool _hasParanoiaStarted = false; public bool _jumpscareTriggered = false; public bool _amITheTarget = false; public float _targetLockTimer = 0f; public float _spawnGraceTimer = 3f; public Transform _infectedItemTransform = null; public float _paranoiaTimer = 0f; private AudioSource _fakeFootstepsSource; private float _debugLogCooldown = 0f; private static Font _cachedSpookyFont; private EnemySetup _cachedScreamerSetup = null; private bool _forceAmbientOverride = false; private float _overrideAmbientIntensity = 0f; private float _overrideReflectionIntensity = 0f; private Color _overrideAmbientColor = Color.black; private void Start() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown _player = ((Component)this).GetComponent(); if (!_player.isLocal) { HimPlugin.Logger.LogInfo("[Him] Ignorato PlayerAvatar remoto."); Object.Destroy((Object)(object)this); return; } ((MonoBehaviour)this).StartCoroutine(AutoInfectRoutine()); _playerCamera = ((Component)this).GetComponentInChildren(); GameObject val = new GameObject("HorrorFakeFootsteps"); val.transform.SetParent(((Component)this).transform); _fakeFootstepsSource = val.AddComponent(); _fakeFootstepsSource.spatialBlend = 1f; _fakeFootstepsSource.volume = 0.6f; _fakeFootstepsSource.rolloffMode = (AudioRolloffMode)1; _fakeFootstepsSource.minDistance = 0.5f; _fakeFootstepsSource.maxDistance = 8f; GameObject val2 = new GameObject("SpookyRumbleAmbient"); val2.transform.SetParent(((Component)this).transform); AudioSource val3 = val2.AddComponent(); object obj = <>c.<>9__20_0; if (obj == null) { PCMReaderCallback val4 = delegate(float[] data) { for (int i = 0; i < data.Length; i++) { data[i] = (float)((double)Random.value * 2.0 - 1.0) * 0.15f; } }; <>c.<>9__20_0 = val4; obj = (object)val4; } val3.clip = AudioClip.Create("Spooky", 88200, 1, 44100, true, (PCMReaderCallback)obj); val3.loop = true; val3.volume = 0.5f; val3.spatialBlend = 0f; AudioLowPassFilter val5 = val2.AddComponent(); val5.cutoffFrequency = 350f; val3.Play(); HimPlugin.Logger.LogInfo("[Him] ParanoiaManager avviato sul player locale."); } public void SetAmbientOverride(float ambInt, float refInt, Color ambCol) { //IL_0017: 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_002b: Unknown result type (might be due to invalid IL or missing references) _forceAmbientOverride = true; _overrideAmbientIntensity = ambInt; _overrideReflectionIntensity = refInt; _overrideAmbientColor = ambCol; RenderSettings.ambientIntensity = ambInt; RenderSettings.reflectionIntensity = refInt; RenderSettings.ambientLight = ambCol; } public void ClearAmbientOverride() { _forceAmbientOverride = false; } private void ApplyAmbientOverride() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (_forceAmbientOverride) { RenderSettings.ambientIntensity = _overrideAmbientIntensity; RenderSettings.reflectionIntensity = _overrideReflectionIntensity; RenderSettings.ambientLight = _overrideAmbientColor; } } private void Update() { HandleDebugHotkey(); HandleParanoiaLogic(); ApplyAmbientOverride(); } private void LateUpdate() { ApplyAmbientOverride(); } private bool IsInCart(Transform item) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Transform parent = item.parent; while ((Object)(object)parent != (Object)null) { if (((Object)parent).name.ToLower().Contains("cart")) { return true; } parent = parent.parent; } IEnumerable enumerable = from r in Object.FindObjectsOfType() where ((Object)r).name.ToLower().Contains("cart") select r; foreach (Rigidbody item2 in enumerable) { if (Vector3.Distance(item.position, ((Component)item2).transform.position) < 1.8f) { return true; } } return false; } private IEnumerator AutoInfectRoutine() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { yield break; } while (true) { yield return (object)new WaitForSeconds(Random.Range(45f, 90f)); if ((Object)(object)_infectedItemTransform != (Object)null || _jumpscareTriggered) { continue; } ValuableObject[] allValuables = Object.FindObjectsOfType(); List cartValuables = allValuables.Where((ValuableObject v) => IsInCart(((Component)v).transform)).ToList(); List mapValuables = allValuables.Where((ValuableObject v) => !IsInCart(((Component)v).transform)).ToList(); if (cartValuables.Count <= 0 || mapValuables.Count <= 0) { continue; } ValuableObject itemToCopy = cartValuables[Random.Range(0, cartValuables.Count)]; ValuableObject hideSpotItem = mapValuables[Random.Range(0, mapValuables.Count)]; PhotonView pvHide = ((Component)hideSpotItem).GetComponent(); PhotonView pvCopy = ((Component)itemToCopy).GetComponent(); if ((Object)(object)pvHide != (Object)null && (Object)(object)pvCopy != (Object)null) { float triggerLimit = Random.Range(15f, 60f); if (PhotonNetwork.IsConnectedAndReady && PhotonNetwork.InRoom) { object[] data = new object[3] { pvHide.ViewID, pvCopy.ViewID, triggerLimit }; HimPlugin.InfectItemEvent.RaiseEvent((object)data, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } else { ApplyLocalInfectionDirect(((Component)hideSpotItem).transform, triggerLimit); } } } } public static void ApplyLocalInfectionDirect(Transform itemTransform, float triggerLimit) { if (!((Object)(object)itemTransform == (Object)null)) { ParanoiaManager[] array = Object.FindObjectsOfType(); ParanoiaManager[] array2 = array; foreach (ParanoiaManager paranoiaManager in array2) { paranoiaManager._infectedItemTransform = itemTransform; paranoiaManager._triggerLimit = triggerLimit; paranoiaManager._paranoiaTimer = 0f; paranoiaManager._hasParanoiaStarted = true; paranoiaManager._jumpscareTriggered = false; paranoiaManager._amITheTarget = false; paranoiaManager._targetLockTimer = 0f; } } } public static void SetGlobalTarget(int targetPlayerId) { PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if (!((Object)(object)val != (Object)null)) { return; } ParanoiaManager component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { int num = (((Object)(object)val.photonView != (Object)null) ? val.photonView.ViewID : 0); if (num != targetPlayerId) { component._jumpscareTriggered = true; component._infectedItemTransform = null; component._amITheTarget = false; component._hasParanoiaStarted = false; HimPlugin.Logger.LogWarning("[PARANOIA] Qualcun altro è il bersaglio. Disattivo il tracker per me."); } } } public static void ApplyLocalInfection(int hideViewID, int copyViewID, float triggerLimit) { //IL_0196: Unknown result type (might be due to invalid IL or missing references) PhotonView photonView = PhotonNetwork.GetPhotonView(hideViewID); PhotonView photonView2 = PhotonNetwork.GetPhotonView(copyViewID); if ((Object)(object)photonView == (Object)null || (Object)(object)photonView2 == (Object)null) { return; } ValuableObject component = ((Component)photonView).GetComponent(); ValuableObject component2 = ((Component)photonView2).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component2 == (Object)null) { return; } MeshFilter componentInChildren = ((Component)component).GetComponentInChildren(); MeshFilter componentInChildren2 = ((Component)component2).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren2 != (Object)null) { componentInChildren.sharedMesh = componentInChildren2.sharedMesh; } MeshRenderer componentInChildren3 = ((Component)component).GetComponentInChildren(); MeshRenderer componentInChildren4 = ((Component)component2).GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null && (Object)(object)componentInChildren4 != (Object)null) { ((Renderer)componentInChildren3).sharedMaterials = ((Renderer)componentInChildren4).sharedMaterials; } PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val != (Object)null) { ParanoiaManager component3 = ((Component)val).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3._infectedItemTransform = ((Component)component).transform; component3._paranoiaTimer = 0f; component3._triggerLimit = triggerLimit; component3._jumpscareTriggered = false; component3._spawnGraceTimer = 2f; component3._amITheTarget = false; component3._hasParanoiaStarted = false; HimPlugin.Logger.LogWarning("========================================================================="); HimPlugin.Logger.LogWarning("[PARANOIA] OGGETTO INFETTO SINCRONIZZATO IN MAPPA!"); HimPlugin.Logger.LogWarning("[PARANOIA] Il clone maledetto di '" + ((Object)component2).name + "' ha preso forma."); HimPlugin.Logger.LogWarning($"[PARANOIA] Si trova alle coordinate: {((Component)component).transform.position}"); HimPlugin.Logger.LogWarning("========================================================================="); } } } private void HandleDebugHotkey() { //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)269)) { HimPlugin.Logger.LogInfo("[DEBUG] Premuto - — Dump Hierarchy of Loom and Upscream..."); IReadOnlyList allEnemies = Enemies.AllEnemies; if (allEnemies != null) { string text = Path.Combine(Application.dataPath, "PrefabDump.txt"); using (StreamWriter streamWriter = new StreamWriter(text)) { foreach (EnemySetup item in allEnemies) { if (item.spawnObjects == null || item.spawnObjects.Count == 0 || (Object)(object)((PrefabRef)(object)item.spawnObjects[0]).Prefab == (Object)null) { continue; } EnemyParent componentInChildren = ((PrefabRef)(object)item.spawnObjects[0]).Prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { string text2 = componentInChildren.enemyName.ToLower(); if (text2.Contains("loom") || text2.Contains("upscream")) { streamWriter.WriteLine("========================================"); streamWriter.WriteLine("ENEMY: " + componentInChildren.enemyName); streamWriter.WriteLine("========================================"); DumpGameObject(((PrefabRef)(object)item.spawnObjects[0]).Prefab, streamWriter, ""); } } } } HimPlugin.Logger.LogInfo("[DEBUG] Dump completo in: " + text); } if ((Object)(object)EnemyDirector.instance != (Object)null) { IEnumerable enumerable = EnemyDirector.instance.enemiesDifficulty1.Concat(EnemyDirector.instance.enemiesDifficulty2).Concat(EnemyDirector.instance.enemiesDifficulty3); HimPlugin.Logger.LogInfo("[DEBUG] Nemici disponibili nel gioco:"); foreach (EnemySetup item2 in enumerable) { List spawnObjects = item2.spawnObjects; object obj; if (spawnObjects == null || spawnObjects.Count <= 0) { obj = null; } else { GameObject prefab = ((PrefabRef)(object)item2.spawnObjects[0]).Prefab; obj = ((prefab != null) ? prefab.GetComponent() : null); } EnemyParent val = (EnemyParent)obj; string text3 = (((Object)(object)val != (Object)null) ? val.enemyName : "(EnemyParent non trovato)"); HimPlugin.Logger.LogInfo("[DEBUG] ENEMY -> EnemySetup.name='" + ((Object)item2).name + "' | EnemyParent.enemyName='" + text3 + "'"); } } } if (!Input.GetKeyDown((KeyCode)268)) { return; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { HimPlugin.Logger.LogWarning("[DEBUG] Solo l'host può usare il tasto * per forzare un oggetto!"); return; } ValuableObject[] array = Object.FindObjectsOfType(); HimPlugin.Logger.LogInfo($"[DEBUG] ValuableObject trovati in scena: {array.Length}"); if (array.Length == 0) { HimPlugin.Logger.LogWarning("[DEBUG] Nessun ValuableObject trovato! Sei in-game? Prova ad aspettare che la mappa sia caricata."); return; } ValuableObject val2 = array.OrderBy((ValuableObject v) => Vector3.Distance(((Component)this).transform.position, ((Component)v).transform.position)).First(); PhotonView component = ((Component)val2).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)val2 != (Object)null) { float num = Random.Range(15f, 60f); if (PhotonNetwork.IsConnectedAndReady && PhotonNetwork.InRoom) { object[] array2 = new object[3] { component.ViewID, component.ViewID, num }; HimPlugin.InfectItemEvent.RaiseEvent((object)array2, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } else { ApplyLocalInfectionDirect(((Component)val2).transform, num); } ((Component)val2).transform.position = ((Component)this).transform.position + ((Component)this).transform.forward * 1.5f + Vector3.up * 0.2f; Rigidbody component2 = ((Component)val2).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.velocity = Vector3.zero; component2.angularVelocity = Vector3.zero; } HimPlugin.Logger.LogInfo("[DEBUG] INFETTATO E TELETRASPORTATO: '" + ((Object)val2).name + "'. Raccoglilo e mettilo nel carrello."); } } private void DumpGameObject(GameObject go, StreamWriter writer, string indent) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown if ((Object)(object)go == (Object)null) { return; } string text = string.Join(", ", from c in go.GetComponents() where (Object)(object)c != (Object)null select ((object)c).GetType().Name); writer.WriteLine(indent + "- " + ((Object)go).name + " [" + text + "]"); foreach (Transform item in go.transform) { Transform val = item; DumpGameObject(((Component)val).gameObject, writer, indent + " "); } } private void HandleParanoiaLogic() { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) if (_jumpscareTriggered) { return; } if (_spawnGraceTimer > 0f) { _spawnGraceTimer -= Time.deltaTime; return; } if ((Object)(object)_infectedItemTransform == (Object)null) { if (_amITheTarget && (Object)(object)EnemyDirector.instance != (Object)null) { HimPlugin.Logger.LogWarning("[PARANOIA] Oggetto ROTTO/DISTRUTTO! Jumpscare punitivo immediato!"); StartJumpscareSequence(((Component)this).transform.position); } return; } _debugLogCooldown -= Time.deltaTime; bool flag = _debugLogCooldown <= 0f; if (flag) { _debugLogCooldown = 1f; } Vector3 position = _infectedItemTransform.position; float num = Vector3.Distance(((Component)this).transform.position, position); bool flag2 = false; if ((Object)(object)_playerCamera == (Object)null) { _playerCamera = ((Component)this).GetComponentInChildren(); if ((Object)(object)_playerCamera == (Object)null) { _playerCamera = Camera.main; } } if ((Object)(object)_playerCamera != (Object)null) { Vector3 val = position - ((Component)_playerCamera).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; flag2 = Vector3.Dot(((Component)_playerCamera).transform.forward, normalized) > 0.8f; } if (num < _minHoldDist && flag2 && !_amITheTarget) { _targetLockTimer += Time.deltaTime; if (_targetLockTimer >= 1f) { _amITheTarget = true; if ((Object)(object)_player != (Object)null && (Object)(object)_player.photonView != (Object)null && PhotonNetwork.IsConnectedAndReady && PhotonNetwork.InRoom) { HimPlugin.TargetChosenEvent.RaiseEvent((object)_player.photonView.ViewID, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } else { int globalTarget = (((Object)(object)_player != (Object)null && (Object)(object)_player.photonView != (Object)null) ? _player.photonView.ViewID : 0); SetGlobalTarget(globalTarget); } string text = (((Object)(object)_player != (Object)null) ? ((Object)_player).name : "Un giocatore"); FieldInfo fieldInfo = ((object)_player)?.GetType().GetField("playerName", BindingFlags.Instance | BindingFlags.Public); if (fieldInfo != null && fieldInfo.FieldType == typeof(string)) { text = (string)fieldInfo.GetValue(_player); } HimPlugin.Logger.LogInfo("[PARANOIA] " + text + " ha firmato questo oggetto!"); } } else if (!_amITheTarget) { _targetLockTimer = 0f; } if (!IsInCart(_infectedItemTransform) || !_amITheTarget) { return; } if (!_hasParanoiaStarted) { bool flag3 = num < _trackingRadius; bool flag4 = true; PlayerAvatar[] array = Object.FindObjectsOfType(); foreach (PlayerAvatar val2 in array) { if ((Object)(object)val2 == (Object)(object)_player || !((Component)val2).gameObject.activeInHierarchy) { continue; } float num2 = Vector3.Distance(position, ((Component)val2).transform.position); if (num2 < _isolationRadius) { flag4 = false; if (flag) { HimPlugin.Logger.LogWarning($"[PARANOIA] Avvio bloccato: {((Object)val2).name} è troppo vicino al carrello! ({num2:F1}m < {_isolationRadius}m)"); } break; } } if (flag3 && flag4 && !flag2) { _hasParanoiaStarted = true; HimPlugin.Logger.LogWarning("[PARANOIA] Condizioni iniziali soddisfatte! L'accumulo della paranoia è INIZIATO in modo permanente."); } } if (!_hasParanoiaStarted) { return; } if (flag) { HimPlugin.Logger.LogInfo($"[STATE] itemPos={position:F1} | distToItem={num:F1}m | " + $"isLookingAtItem={flag2} | timer={_paranoiaTimer:F1}/{_triggerLimit:F1}s"); } if (!flag2) { _paranoiaTimer += Time.deltaTime; if (!_fakeFootstepsSource.isPlaying) { ((Component)_fakeFootstepsSource).transform.position = ((Component)_player).transform.position - ((Component)_player).transform.forward * 2f; } if (_paranoiaTimer >= _triggerLimit) { StartJumpscareSequence(position); } } } private void StartJumpscareSequence(Vector3 itemPosition) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) _jumpscareTriggered = true; _infectedItemTransform = null; HimPlugin.Logger.LogWarning("!!! INIZIO SEQUENZA JUMPSCARE !!!"); ((MonoBehaviour)this).StartCoroutine(JumpscareSequenceCoroutine(itemPosition)); } private IEnumerator JumpscareSequenceCoroutine(Vector3 itemPosition) { //IL_000e: 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) float origAmbientInt = RenderSettings.ambientIntensity; float origReflectInt = RenderSettings.reflectionIntensity; Color origAmbientColor = RenderSettings.ambientLight; for (int i = 0; i < 12; i++) { SetAmbientOverride(0f, 0f, Color.black); yield return (object)new WaitForSeconds(Random.Range(0.04f, 0.1f)); SetAmbientOverride(origAmbientInt * 1.1f, origReflectInt * 1.1f, origAmbientColor); yield return (object)new WaitForSeconds(Random.Range(0.05f, 0.18f)); } Coroutine flickerCoroutine = ((MonoBehaviour)this).StartCoroutine(ContinuousAmbientFlicker(35f, origAmbientInt, origReflectInt, origAmbientColor)); yield return ((MonoBehaviour)this).StartCoroutine(ShowThreateningTextSequence(itemPosition, origAmbientInt, origReflectInt, origAmbientColor, flickerCoroutine)); } private IEnumerator ContinuousAmbientFlicker(float duration, float origAmbientInt, float origReflectInt, Color origAmbientColor) { //IL_0023: 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) float elapsed = 0f; while (elapsed < duration) { float randState = Random.value; if (randState < 0.3f) { int count = Random.Range(2, 5); for (int i = 0; i < count; i++) { SetAmbientOverride(0f, 0f, Color.black); float darkTime = Random.Range(0.04f, 0.09f); elapsed += darkTime; yield return (object)new WaitForSeconds(darkTime); float lightMult = ((Random.value > 0.8f) ? 1.2f : 0.7f); SetAmbientOverride(origAmbientInt * lightMult, origReflectInt * lightMult, origAmbientColor * lightMult); float lightTime = Random.Range(0.04f, 0.09f); elapsed += lightTime; yield return (object)new WaitForSeconds(lightTime); } } else if (randState < 0.7f) { int count2 = Random.Range(2, 4); for (int j = 0; j < count2; j++) { float darkMult = ((Random.value > 0.5f) ? 0f : 0.05f); SetAmbientOverride(origAmbientInt * darkMult, origReflectInt * darkMult, Color.black); float darkTime2 = Random.Range(0.18f, 0.45f); elapsed += darkTime2; yield return (object)new WaitForSeconds(darkTime2); float lightMult2 = Random.Range(0.35f, 0.75f); SetAmbientOverride(origAmbientInt * lightMult2, origReflectInt * lightMult2, origAmbientColor * lightMult2); float lightTime2 = Random.Range(0.2f, 0.4f); elapsed += lightTime2; yield return (object)new WaitForSeconds(lightTime2); } } else { float dimMult = Random.Range(0.06f, 0.15f); SetAmbientOverride(origAmbientInt * dimMult, origReflectInt * dimMult, origAmbientColor * dimMult); float dimTime = Random.Range(1.2f, 2.6f); float halfTime = dimTime * 0.5f; elapsed += halfTime; yield return (object)new WaitForSeconds(halfTime); if (Random.value > 0.5f) { SetAmbientOverride(0f, 0f, Color.black); yield return (object)new WaitForSeconds(0.08f); elapsed += 0.08f; SetAmbientOverride(origAmbientInt * dimMult, origReflectInt * dimMult, origAmbientColor * dimMult); } elapsed += halfTime; yield return (object)new WaitForSeconds(halfTime); } float pauseTime = Random.Range(0.4f, 0.9f); SetAmbientOverride(0f, 0f, Color.black); elapsed += pauseTime; yield return (object)new WaitForSeconds(pauseTime); } SetAmbientOverride(origAmbientInt * 0.2f, origReflectInt * 0.2f, origAmbientColor * 0.2f); } private Vector3 GetRandomPositionAroundPlayer(float minDistance, float maxDistance) { //IL_0069: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_0078: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_player == (Object)null) { return Vector3.zero; } float num = Random.Range(0f, 360f) * (MathF.PI / 180f); float num2 = Random.Range(minDistance, maxDistance); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Cos(num) * num2, Random.Range(-0.5f, 1.2f), Mathf.Sin(num) * num2); return ((Component)_player).transform.position + val; } private void PlaySpookySoundWithDelay(Vector3 position, float delay, bool useImpact, float volume, float pitch) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(PlaySpookySoundWithDelayCoroutine(position, delay, useImpact, volume, pitch)); } private IEnumerator PlaySpookySoundWithDelayCoroutine(Vector3 position, float delay, bool useImpact, float volume, float pitch) { //IL_000e: 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) yield return (object)new WaitForSeconds(delay); PlaySpookySound(position, useImpact, volume, pitch); } private IEnumerator PlayScaryTextSoundSequence(Vector3 itemPos) { //IL_000e: 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) float runDelay = Random.Range(0f, 2f); PlaySpookySoundWithDelay(itemPos, runDelay, useImpact: false, 1f, 0.7f); yield return (object)new WaitForSeconds(2.7f); float callDelay = Random.Range(0f, 3f); PlaySpookySoundWithDelay(itemPos, callDelay, useImpact: true, 0.65f, 0.35f); yield return (object)new WaitForSeconds(3.7f); float hearDelay = Random.Range(0f, 3f); PlaySpookySoundWithDelay(itemPos, hearDelay, useImpact: false, 1.1f, 0.6f); yield return (object)new WaitForSeconds(4.7f); float finalDelay = Random.Range(0f, 0.7f); Vector3 nearPlayerPos = GetRandomPositionAroundPlayer(2.5f, 5f); PlaySpookySoundWithDelay(nearPlayerPos, finalDelay, useImpact: true, 1f, 0.48f); float finalWhisperDelay = 3f + Random.Range(0f, 3f); PlaySpookySoundWithDelay(itemPos, finalWhisperDelay, useImpact: false, 1.1f, 1.25f); } private IEnumerator ShowThreateningTextSequence(Vector3 itemPosition, float origAmbientInt, float origReflectInt, Color origAmbientColor, Coroutine flickerCoroutine) { //IL_000e: 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_0023: 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) GameObject canvasObj = new GameObject("HorrorTextCanvas"); Canvas canvas = canvasObj.AddComponent(); canvas.renderMode = (RenderMode)0; canvas.sortingOrder = 10000; GameObject staticObj = new GameObject("TVStaticGrain"); staticObj.transform.SetParent(canvasObj.transform, false); _staticTextNoise = staticObj.AddComponent(); _staticTextNoise.font = Resources.GetBuiltinResource("Arial.ttf"); _staticTextNoise.fontSize = 24; ((Graphic)_staticTextNoise).color = new Color(0.7f, 0f, 0f, 0.045f); _staticTextNoise.alignment = (TextAnchor)4; _staticTextNoise.horizontalOverflow = (HorizontalWrapMode)1; _staticTextNoise.verticalOverflow = (VerticalWrapMode)1; RectTransform staticRect = ((Component)_staticTextNoise).GetComponent(); staticRect.anchorMin = Vector2.zero; staticRect.anchorMax = Vector2.one; staticRect.sizeDelta = Vector2.zero; _noiseFrames = new string[6]; char[] noiseChars = new char[12] { '░', '▒', '▓', '.', ':', '-', '=', '+', '*', ' ', ' ', ' ' }; for (int f = 0; f < _noiseFrames.Length; f++) { StringBuilder sb = new StringBuilder(); for (int row = 0; row < 18; row++) { for (int col = 0; col < 62; col++) { sb.Append(noiseChars[Random.Range(0, noiseChars.Length)]); } sb.Append("\n"); } _noiseFrames[f] = sb.ToString(); } GameObject textObj = new GameObject("HorrorText"); textObj.transform.SetParent(canvasObj.transform, false); Text text = textObj.AddComponent(); text.font = Resources.GetBuiltinResource("Arial.ttf"); text.fontSize = 110; ((Graphic)text).color = new Color(0.8f, 0f, 0f, 0f); text.alignment = (TextAnchor)4; Outline outline = textObj.AddComponent(); ((Shadow)outline).effectColor = new Color(0.1f, 0f, 0f, 1f); ((Shadow)outline).effectDistance = new Vector2(4f, -4f); Shadow shadow = textObj.AddComponent(); shadow.effectColor = new Color(0f, 0f, 0f, 0.8f); shadow.effectDistance = new Vector2(8f, -8f); text.horizontalOverflow = (HorizontalWrapMode)1; text.verticalOverflow = (VerticalWrapMode)1; RectTransform rect = ((Component)text).GetComponent(); rect.anchorMin = new Vector2(0f, 0.15f); rect.anchorMax = new Vector2(1f, 0.35f); rect.sizeDelta = Vector2.zero; ((MonoBehaviour)this).StartCoroutine(PlayScaryTextSoundSequence(itemPosition)); yield return ((MonoBehaviour)this).StartCoroutine(FlickerFadeText(text, "RUN.", 2.5f)); yield return (object)new WaitForSeconds(0.2f); yield return ((MonoBehaviour)this).StartCoroutine(FlickerFadeText(text, "CALL FOR HELP.", 3.5f)); yield return (object)new WaitForSeconds(0.2f); yield return ((MonoBehaviour)this).StartCoroutine(FlickerFadeText(text, "HE CAN HEAR YOU.", 4.5f)); yield return (object)new WaitForSeconds(0.2f); ((MonoBehaviour)this).StartCoroutine(FlickerFadeText(text, "RUN NOW.\nHE IS HERE.", 16f)); yield return (object)new WaitForSeconds(0.8f); if (flickerCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(flickerCoroutine); } float fadeElapsed = 0f; float fadeDuration = 0.18f; float startAmbient = RenderSettings.ambientIntensity; float startReflect = RenderSettings.reflectionIntensity; Color startColor = RenderSettings.ambientLight; while (fadeElapsed < fadeDuration) { fadeElapsed += Time.deltaTime; float t = Mathf.Clamp01(fadeElapsed / fadeDuration); float currentAmbient = Mathf.Lerp(startAmbient, 0f, t); float currentReflect = Mathf.Lerp(startReflect, 0f, t); Color currentColor = Color.Lerp(startColor, Color.black, t); SetAmbientOverride(currentAmbient, currentReflect, currentColor); yield return null; } SetAmbientOverride(0f, 0f, Color.black); yield return (object)new WaitForSeconds(0.2f); PlaySpookySound(itemPosition, useImpact: true, 1.4f, 0.5f); PlaySpookySound(itemPosition, useImpact: false, 1.3f, 0.7f); TriggerJumpscare(itemPosition, origAmbientInt, origReflectInt, origAmbientColor); yield return (object)new WaitForSeconds(18f); Object.Destroy((Object)(object)canvasObj); _staticTextNoise = null; _noiseFrames = null; } public void PlaySpookySound(Vector3 position, bool useImpact, float volume = 1f, float pitch = 1f) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)AudioScare.instance == (Object)null) { return; } AudioClip[] array = (useImpact ? AudioScare.instance.impactSounds : AudioScare.instance.softSounds); if (array != null && array.Length != 0) { int num = Random.Range(0, array.Length); AudioClip val = array[num]; if ((Object)(object)val != (Object)null) { GameObject val2 = new GameObject("SpookyTextSFX"); val2.transform.position = position; AudioSource val3 = val2.AddComponent(); val3.clip = val; val3.volume = volume; val3.pitch = pitch; val3.spatialBlend = 1f; val3.rolloffMode = (AudioRolloffMode)0; val3.minDistance = 3f; val3.maxDistance = 150f; val3.Play(); Object.Destroy((Object)(object)val2, val.length / Mathf.Max(0.1f, pitch) + 0.5f); } } } private string GetCorruptedText(string original) { char[] array = original.ToCharArray(); char[] array2 = new char[9] { '░', '▒', '▓', '‡', '†', 'X', '?', '#', '%' }; for (int i = 0; i < array.Length; i++) { if (array[i] != ' ' && array[i] != '\n' && Random.value > 0.93f) { array[i] = array2[Random.Range(0, array2.Length)]; } } return new string(array); } private void ApplyTextGlitchJitter(Text textObj, Outline outline, Shadow shadow) { //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)textObj == (Object)null) { return; } if (Random.value > 0.12f) { float num = ((Random.value > 0.92f) ? 28f : 11f); float num2 = Random.Range(0f - num, num); float num3 = Random.Range(0f - num, num); ((Graphic)textObj).rectTransform.anchoredPosition = new Vector2(num2, num3); float num4 = Random.Range(-4f, 4f); ((Transform)((Graphic)textObj).rectTransform).localRotation = Quaternion.Euler(0f, 0f, num4); float num5 = 1f + Random.Range(-0.06f, 0.06f); float num6 = 1f + Random.Range(-0.06f, 0.06f); ((Transform)((Graphic)textObj).rectTransform).localScale = new Vector3(num5, num6, 1f); if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectDistance = new Vector2(Random.Range(3f, 6f), Random.Range(-6f, -3f)); } if ((Object)(object)shadow != (Object)null) { shadow.effectDistance = new Vector2(Random.Range(6f, 11f), Random.Range(-11f, -6f)); } } else { ((Graphic)textObj).rectTransform.anchoredPosition = Vector2.zero; ((Transform)((Graphic)textObj).rectTransform).localRotation = Quaternion.identity; ((Transform)((Graphic)textObj).rectTransform).localScale = Vector3.one; if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectDistance = new Vector2(4f, -4f); } if ((Object)(object)shadow != (Object)null) { shadow.effectDistance = new Vector2(8f, -8f); } } } private IEnumerator FlickerFadeText(Text textObj, string content, float displayTime) { if ((Object)(object)textObj == (Object)null) { yield break; } textObj.text = content; float flickerSpeed = 20f; Color _targetColor = new Color(0.8f, 0f, 0f, 1f); Outline outline = ((Component)textObj).GetComponent(); Shadow shadow = ((Component)textObj).GetComponent(); float elapsed = 0f; while (elapsed < 0.5f) { if ((Object)(object)textObj == (Object)null) { yield break; } float a = Mathf.PingPong(Time.time * flickerSpeed, 1f); ((Graphic)textObj).color = new Color(_targetColor.r, _targetColor.g, _targetColor.b, a); if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectColor = new Color(0.1f, 0f, 0f, a); } if ((Object)(object)shadow != (Object)null) { shadow.effectColor = new Color(0f, 0f, 0f, a * 0.8f); } textObj.text = GetCorruptedText(content); ApplyTextGlitchJitter(textObj, outline, shadow); if ((Object)(object)_staticTextNoise != (Object)null && _noiseFrames != null && _noiseFrames.Length != 0) { _staticTextNoise.text = _noiseFrames[Random.Range(0, _noiseFrames.Length)]; ((Graphic)_staticTextNoise).rectTransform.anchoredPosition = new Vector2(Random.Range(-10f, 10f), Random.Range(-10f, 10f)); } elapsed += Time.deltaTime; yield return null; } if ((Object)(object)textObj == (Object)null) { yield break; } ((Graphic)textObj).color = _targetColor; if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectColor = new Color(0.1f, 0f, 0f, 1f); } if ((Object)(object)shadow != (Object)null) { shadow.effectColor = new Color(0f, 0f, 0f, 0.8f); } float displayElapsed = 0f; while (displayElapsed < displayTime) { if ((Object)(object)textObj == (Object)null) { yield break; } textObj.text = GetCorruptedText(content); ApplyTextGlitchJitter(textObj, outline, shadow); if ((Object)(object)_staticTextNoise != (Object)null && _noiseFrames != null && _noiseFrames.Length != 0) { _staticTextNoise.text = _noiseFrames[Random.Range(0, _noiseFrames.Length)]; ((Graphic)_staticTextNoise).rectTransform.anchoredPosition = new Vector2(Random.Range(-10f, 10f), Random.Range(-10f, 10f)); } displayElapsed += Time.deltaTime; yield return null; } elapsed = 0f; while (elapsed < 0.5f) { if ((Object)(object)textObj == (Object)null) { yield break; } float a2 = Mathf.PingPong(Time.time * flickerSpeed, 1f); ((Graphic)textObj).color = new Color(_targetColor.r, _targetColor.g, _targetColor.b, a2); if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectColor = new Color(0.1f, 0f, 0f, a2); } if ((Object)(object)shadow != (Object)null) { shadow.effectColor = new Color(0f, 0f, 0f, a2 * 0.8f); } textObj.text = GetCorruptedText(content); ApplyTextGlitchJitter(textObj, outline, shadow); if ((Object)(object)_staticTextNoise != (Object)null && _noiseFrames != null && _noiseFrames.Length != 0) { _staticTextNoise.text = _noiseFrames[Random.Range(0, _noiseFrames.Length)]; ((Graphic)_staticTextNoise).rectTransform.anchoredPosition = new Vector2(Random.Range(-10f, 10f), Random.Range(-10f, 10f)); } elapsed += Time.deltaTime; yield return null; } if (!((Object)(object)textObj == (Object)null)) { ((Graphic)textObj).color = Color.clear; ((Graphic)textObj).rectTransform.anchoredPosition = Vector2.zero; ((Transform)((Graphic)textObj).rectTransform).localRotation = Quaternion.identity; ((Transform)((Graphic)textObj).rectTransform).localScale = Vector3.one; if ((Object)(object)outline != (Object)null) { ((Shadow)outline).effectColor = Color.clear; } if ((Object)(object)shadow != (Object)null) { shadow.effectColor = Color.clear; } } } public void RestoreLightsWithFlicker(float origAmbientInt, float origReflectInt, Color origAmbientColor) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(RestoreLightsCoroutine(origAmbientInt, origReflectInt, origAmbientColor)); } private IEnumerator RestoreLightsCoroutine(float origAmbientInt, float origReflectInt, Color origAmbientColor) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { SetAmbientOverride(origAmbientInt * 0.1f, origReflectInt * 0.1f, origAmbientColor * 0.1f); yield return (object)new WaitForSeconds(Random.Range(0.05f, 0.15f)); SetAmbientOverride(origAmbientInt * 0.4f, origReflectInt * 0.4f, origAmbientColor * 0.4f); yield return (object)new WaitForSeconds(Random.Range(0.1f, 0.25f)); } RenderSettings.ambientIntensity = origAmbientInt; RenderSettings.reflectionIntensity = origReflectInt; RenderSettings.ambientLight = origAmbientColor; ClearAmbientOverride(); } private void TriggerJumpscare(Vector3 itemPosition, float origAmbientInt, float origReflectInt, Color origAmbientColor) { //IL_0039: 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_003b: 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_0046: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006c: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) HimPlugin.Logger.LogWarning("!!! SPAWN UPSCREAM !!! Cerco setup..."); EnemySetup val = FindScreamerSetup(); if ((Object)(object)val == (Object)null) { HimPlugin.Logger.LogError("[JUMPSCARE] Nessun EnemySetup trovato! Impossibile spawnare il mostro."); return; } Vector3 val2 = itemPosition; val2 += Vector3.up * 0.5f; Quaternion val3 = Quaternion.LookRotation(((Component)_player).transform.position - val2); HimPlugin.Logger.LogInfo($"[JUMPSCARE] Inizio procedura spawn per '{((Object)val).name}' a {val2}..."); if (!SemiFunc.IsMasterClientOrSingleplayer()) { HimPlugin.Logger.LogInfo("[JUMPSCARE] Sono un client. Richiedo lo spawn all'Host!"); int num = (((Object)(object)_player.photonView != (Object)null) ? _player.photonView.ViewID : (-1)); HimPlugin.SpawnScreamerEvent.RaiseEvent((object)new object[3] { val2, val3, num }, NetworkingEvents.RaiseMasterClient, SendOptions.SendReliable); } else { HostSpawnScreamer(val2, val3, ((Object)(object)_player.photonView != (Object)null) ? _player.photonView.ViewID : (-1)); } } public static void HostSpawnScreamer(Vector3 spawnPos, Quaternion spawnRot, int targetPhotonId) { //IL_001f: 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_00e2: Unknown result type (might be due to invalid IL or missing references) ParanoiaManager paranoiaManager = Object.FindObjectOfType(); EnemySetup val = paranoiaManager.FindScreamerSetup(); if ((Object)(object)val == (Object)null) { return; } List list = Enemies.SpawnEnemy(val, spawnPos, spawnRot, false); if (list == null || list.Count == 0) { HimPlugin.Logger.LogError("[HOST] Enemies.SpawnEnemy() ha restituito null/vuoto. Spawn fallito."); return; } HimPlugin.Logger.LogInfo($"[HOST] Spawnati {list.Count} EnemyParent. Applico potenziamenti..."); foreach (EnemyParent item in list) { PhotonView component = ((Component)item).GetComponent(); int num = ((component != null) ? component.ViewID : 0); if (PhotonNetwork.IsConnectedAndReady && PhotonNetwork.InRoom) { if (num != 0) { HimPlugin.EnhanceScreamerEvent.RaiseEvent((object)new object[2] { num, targetPhotonId }, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } } else { ApplyEnhancementToEnemy(item, targetPhotonId); } } } public static void ApplyLocalEnhancement(int enemyViewId, int targetPlayerId) { PhotonView val = PhotonView.Find(enemyViewId); if ((Object)(object)val == (Object)null) { HimPlugin.Logger.LogWarning($"[CLIENT] Nessun PhotonView trovato con ID {enemyViewId}."); return; } EnemyParent component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { ApplyEnhancementToEnemy(component, targetPlayerId); } } public static void ApplyEnhancementToEnemy(EnemyParent ep, int targetPlayerId) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ep == (Object)null) { return; } if (SemiFunc.IsMasterClientOrSingleplayer()) { NavMeshAgent componentInChildren = ((Component)ep).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.speed *= 6.5f; componentInChildren.acceleration *= 6.5f; } } Transform transform = ((Component)ep).transform; transform.localScale *= 1.35f; UpscreamEnhancer upscreamEnhancer = ((Component)ep).gameObject.AddComponent(); upscreamEnhancer.enemyScript = ep; if (targetPlayerId == 0) { upscreamEnhancer.targetPlayer = SemiFunc.PlayerAvatarLocal(); } else { PlayerAvatar[] array = Object.FindObjectsOfType(); foreach (PlayerAvatar val in array) { if ((Object)(object)val.photonView != (Object)null && val.photonView.ViewID == targetPlayerId) { upscreamEnhancer.targetPlayer = val; break; } } } upscreamEnhancer.SetOriginalLights(RenderSettings.ambientIntensity, RenderSettings.reflectionIntensity, RenderSettings.ambientLight); } private EnemySetup FindScreamerSetup() { if ((Object)(object)_cachedScreamerSetup != (Object)null) { return _cachedScreamerSetup; } if ((Object)(object)EnemyDirector.instance == (Object)null) { HimPlugin.Logger.LogError("[FindScreamer] EnemyDirector.instance è null!"); return null; } IEnumerable enumerable = EnemyDirector.instance.enemiesDifficulty1.Concat(EnemyDirector.instance.enemiesDifficulty2).Concat(EnemyDirector.instance.enemiesDifficulty3); EnemySetup val = null; foreach (EnemySetup item in enumerable) { List spawnObjects = item.spawnObjects; object obj; if (spawnObjects == null || spawnObjects.Count <= 0) { obj = null; } else { GameObject prefab = ((PrefabRef)(object)item.spawnObjects[0]).Prefab; obj = ((prefab != null) ? prefab.GetComponent() : null); } EnemyParent val2 = (EnemyParent)obj; string text = (((Object)(object)val2 != (Object)null) ? val2.enemyName : ((Object)item).name); HimPlugin.Logger.LogInfo("[FindScreamer] Controllo: setup='" + ((Object)item).name + "' enemyName='" + text + "'"); string text2 = text.ToLowerInvariant(); if (text2.Contains("scream") || text2.Contains("shriek") || text2.Contains("howl")) { HimPlugin.Logger.LogInfo("[FindScreamer] TROVATO! '" + text + "'. (Cached)"); _cachedScreamerSetup = item; return item; } if ((Object)(object)val == (Object)null) { val = item; } } if ((Object)(object)val != (Object)null) { HimPlugin.Logger.LogWarning("[FindScreamer] 'scream' non trovato. Uso fallback: '" + ((Object)val).name + "'"); } _cachedScreamerSetup = val; return val; } } public class UpscreamEnhancer : MonoBehaviour { public PlayerAvatar targetPlayer; public EnemyParent enemyScript; private Material _blackMat; private Vector3 _originalScale; private float _origAmbientInt; private float _origReflectInt; private Color _origAmbientColor; private GameObject _darkCanvas; private bool _lightsRestored = false; private Transform _loomJawBone; private Quaternion _originalJawRot; private bool _enhancementApplied = false; private float _enhancementTimer = 0f; private List _earrapeSources = new List(); private int _customAttacks = 0; private State _lastState = (State)0; private float _escapeTimer = 0f; private Vector3 _escapeDestination = Vector3.zero; private bool _isEscaping = false; private Transform _loomHeadTrans; private GameObject _panicOverlay; private Image _panicImage; private float _escapeSoundTimer = 0f; private bool _escapeSoundPlayed = false; public void SetOriginalLights(float ambInt, float refInt, Color ambCol) { //IL_0010: 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) _origAmbientInt = ambInt; _origReflectInt = refInt; _origAmbientColor = ambCol; } private void Start() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0276: Expected O, but got Unknown //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetPlayer != (Object)null && targetPlayer.isLocal) { _darkCanvas = new GameObject("HorrorSoftDarkness"); Canvas val = _darkCanvas.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = 9998; RawImage val2 = _darkCanvas.AddComponent(); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0.45f); } if (SemiFunc.IsMasterClientOrSingleplayer()) { Object.Destroy((Object)(object)((Component)this).gameObject, 60f); } _blackMat = new Material(Shader.Find("Standard")); Texture2D val3 = new Texture2D(64, 64, (TextureFormat)3, false); for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = Mathf.PerlinNoise((float)j * 0.2f, (float)i * 0.2f); float num2 = Mathf.PerlinNoise((float)i * 0.4f, (float)j * 0.4f); float num3 = Mathf.Max(num, num2); float num4 = ((num3 > 0.65f) ? 0f : Mathf.Lerp(0.01f, 0.18f, num3)); val3.SetPixel(j, i, new Color(num4, num4, num4, 1f)); } } val3.Apply(); _blackMat.mainTexture = (Texture)(object)val3; _blackMat.color = Color.white; _blackMat.SetFloat("_Glossiness", 0.02f); _blackMat.SetFloat("_Metallic", 0f); ((Object)_blackMat).name = "TexturedBlackMat"; Light[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Light val4 in componentsInChildren) { ((Behaviour)val4).enabled = false; } _originalScale = ((Component)this).transform.localScale; Transform parent = ((Component)this).transform; Transform[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); foreach (Transform val5 in componentsInChildren2) { if (((Object)val5).name.ToLower().Contains("head")) { parent = val5; break; } } GameObject val6 = new GameObject("UpscreamFaceLight"); val6.transform.SetParent(parent); val6.transform.localPosition = new Vector3(0f, 0.2f, 0.3f); Light val7 = val6.AddComponent(); val7.type = (LightType)2; val7.range = 8f; val7.intensity = 0.6f; val7.color = new Color(0.8f, 0.9f, 1f); ReplaceHeadWithLoom(); TryForceAggro(); } private void ReplaceHeadWithLoom() { //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) IReadOnlyList allEnemies = Enemies.AllEnemies; EnemySetup val = null; if (allEnemies != null) { foreach (EnemySetup item in allEnemies) { if (item.spawnObjects != null && item.spawnObjects.Count > 0 && (Object)(object)((PrefabRef)(object)item.spawnObjects[0]).Prefab != (Object)null) { EnemyParent componentInChildren = ((PrefabRef)(object)item.spawnObjects[0]).Prefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.enemyName != null && componentInChildren.enemyName.ToLower().Contains("loom")) { val = item; break; } } } } if ((Object)(object)val == (Object)null || val.spawnObjects == null || val.spawnObjects.Count == 0) { HimPlugin.Logger.LogWarning("[ENHANCE] Impossibile trovare il nemico Loom o i suoi spawnObjects."); return; } GameObject prefab = ((PrefabRef)(object)val.spawnObjects[0]).Prefab; if ((Object)(object)prefab == (Object)null) { return; } Transform val2 = ((Component)this).transform; HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] DUMPING UPSCREAM HIERARCHY:"); Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Transform val3 in componentsInChildren) { HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] CHILD: " + ((Object)val3).name); } Transform[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(true); foreach (Transform val4 in componentsInChildren2) { string text = ((Object)val4).name.ToLower(); if (text.Contains("head") || text.Contains("neck")) { val2 = val4; HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] Found potential head bone: " + ((Object)val4).name); break; } } Renderer[] componentsInChildren3 = ((Component)val2).GetComponentsInChildren(true); foreach (Renderer val5 in componentsInChildren3) { string text2 = ((Object)((Component)val5).gameObject).name.ToLower(); if (text2.Contains("upscream_head") || text2.Contains("eye_")) { val5.enabled = false; MeshFilter component = ((Component)val5).GetComponent(); if ((Object)(object)component != (Object)null) { component.sharedMesh = null; } } } bool activeSelf = prefab.activeSelf; prefab.SetActive(false); GameObject val6 = Object.Instantiate(prefab); prefab.SetActive(activeSelf); ((Object)val6).name = "SpookyLoomHead"; val6.SetActive(false); Transform val7 = null; Transform val8 = null; Transform[] componentsInChildren4 = val6.GetComponentsInChildren(true); foreach (Transform val9 in componentsInChildren4) { if (((Object)val9).name.Contains("Head ANIM")) { val7 = val9; } else if (((Object)val9).name == "Particles" && (Object)(object)val9.parent == (Object)(object)val6.transform) { val8 = val9; } } if ((Object)(object)val7 != (Object)null) { _loomHeadTrans = val7; HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] ========================================"); HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] INIZIO SOSTITUZIONE TESTA"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Upscream Parent Pos: {val2.parent.position}"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Upscream Head Pos (World): {val2.position} | Scale (Lossy): {val2.lossyScale}"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Loom Original Pos (World): {val6.transform.position}"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Loom HeadANIM Pos (World pre-parent): {val7.position} | Scale (Lossy): {val7.lossyScale}"); Vector3 lossyScale = val7.lossyScale; val7.SetParent(val2, true); val7.localPosition = Vector3.zero; val7.localRotation = Quaternion.identity; val7.localScale = new Vector3(lossyScale.x / val2.lossyScale.x, lossyScale.y / val2.lossyScale.y, lossyScale.z / val2.lossyScale.z) * 0.81f; HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Loom HeadANIM Pos (World post-parent): {val7.position}"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Loom HeadANIM Scale (Local): {val7.localScale} | Scale (Lossy post-parent): {val7.lossyScale}"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Loom HeadANIM ActiveSelf: {((Component)val7).gameObject.activeSelf} | ActiveInHierarchy: {((Component)val7).gameObject.activeInHierarchy}"); if ((Object)(object)val8 != (Object)null) { HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] TROVATI PARTICLES LOOM: {((Object)val8).name}. Pos: {val8.position}"); val8.SetParent(val2, true); val8.localPosition = Vector3.zero; val8.localRotation = Quaternion.identity; } Animator[] componentsInChildren5 = ((Component)val7).GetComponentsInChildren(true); foreach (Animator val10 in componentsInChildren5) { Object.DestroyImmediate((Object)(object)val10); } int num = 0; Transform[] componentsInChildren6 = ((Component)val7).GetComponentsInChildren(true); foreach (Transform val11 in componentsInChildren6) { Vector3 localScale = val11.localScale; if (((Vector3)(ref localScale)).sqrMagnitude < 0.01f) { val11.localScale = Vector3.one; } string text3 = ((Object)val11).name.ToLower(); if (text3.Contains("jaw") && !text3.Contains("particle") && ((Object)(object)_loomJawBone == (Object)null || (text3.Contains("anim") && !((Object)_loomJawBone).name.ToLower().Contains("anim")))) { _loomJawBone = val11; _originalJawRot = val11.localRotation; HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] Mascella agganciata a: '" + ((Object)val11).name + "'"); } Renderer component2 = ((Component)val11).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.enabled = true; num++; string text4 = (((Object)(object)component2.material != (Object)null) ? ((Object)component2.material).name : "NULL_MATERIAL"); HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Renderer attivato: '{((Object)val11).name}' | Layer: {((Component)val11).gameObject.layer} | Mat: {text4} | Pos World: {val11.position} | Scale Lossy: {val11.lossyScale} | ActiveInHier: {((Component)val11).gameObject.activeInHierarchy}"); } } HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Totale renderers abilitati nella testa: {num}"); ((Component)val7).gameObject.SetActive(true); if ((Object)(object)val8 != (Object)null) { ((Component)val8).gameObject.SetActive(true); } HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Dopo aver forzato SetActive(true) -> HeadANIM ActiveInHierarchy: {((Component)val7).gameObject.activeInHierarchy}"); int num2 = 0; ParticleSystem[] componentsInChildren7 = ((Component)val2).GetComponentsInChildren(true); ParticleSystem[] array = componentsInChildren7; foreach (ParticleSystem val12 in array) { if (((Component)val12).transform.IsChildOf(val7) || (!((Object)(object)val8 == (Object)null) && ((Component)val12).transform.IsChildOf(val8))) { val12.Play(true); num2++; HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Play ParticleSystem: {((Object)((Component)val12).gameObject).name} | Pos: {((Component)val12).transform.position}"); } } HimPlugin.Logger.LogInfo($"[PARANOIA-DEBUG] Totale ParticleSystems avviati: {num2}"); HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] ========================================"); } else { HimPlugin.Logger.LogWarning("[PARANOIA-DEBUG] ATTENZIONE: 'Head ANIM' non trovata nel Loom!"); } HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] Distruggo il corpo originale del Loom..."); Object.Destroy((Object)(object)val6.gameObject); } private void DoubleHealthAndBuff() { //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)enemyScript == (Object)null) { return; } object obj = ((object)enemyScript).GetType().GetField("enemy", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(enemyScript); if (obj != null) { object obj2 = obj.GetType().GetField("Health", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj); if (obj2 != null) { FieldInfo field = obj2.GetType().GetField("health", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = obj2.GetType().GetField("healthCurrent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field2 != null) { field.SetValue(obj2, 1500); field2.SetValue(obj2, 1500); HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] Vita impostata a 1500!"); } obj2.GetType().GetField("objectHurtStun", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(obj2, false); } object obj3 = obj.GetType().GetField("StateStunned", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj); if (obj3 != null) { obj3.GetType().GetMethod("OverrideDisable")?.Invoke(obj3, new object[1] { 9999f }); obj3.GetType().GetField("active")?.SetValue(obj3, false); } } EnemyUpscream val = ((Component)enemyScript).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)enemyScript).GetComponentInChildren(); } if ((Object)(object)val != (Object)null && (Object)(object)val.upscreamAnim != (Object)null) { EnemyUpscreamAnim upscreamAnim = val.upscreamAnim; if (upscreamAnim.stepSound != null) { upscreamAnim.stepSound.Volume = 0.01f; upscreamAnim.stepSound.VolumeDefault = 0.01f; if ((Object)(object)upscreamAnim.stepSound.Source != (Object)null) { upscreamAnim.stepSound.Source.volume = 0.01f; } } Sound[] array = (Sound[])(object)new Sound[3] { upscreamAnim.sfxAttackGlobal, upscreamAnim.sfxAttackLocal, upscreamAnim.hurtSound }; Sound[] array2 = array; foreach (Sound val2 in array2) { if (val2 == null) { continue; } val2.Volume = 35f; val2.VolumeDefault = 35f; val2.Pitch = 0.78f; val2.PitchDefault = 0.78f; if ((Object)(object)val2.Source != (Object)null) { if (!_earrapeSources.Contains(val2.Source)) { _earrapeSources.Add(val2.Source); } val2.Source.volume = 1f; val2.Source.pitch = 0.78f; val2.Source.spatialBlend = 0f; if ((Object)(object)((Component)val2.Source).gameObject.GetComponent() == (Object)null) { AudioDistortionFilter val3 = ((Component)val2.Source).gameObject.AddComponent(); val3.distortionLevel = 0.85f; AudioReverbFilter val4 = ((Component)val2.Source).gameObject.AddComponent(); val4.reverbPreset = (AudioReverbPreset)9; HimPlugin.Logger.LogInfo("[PARANOIA-DEBUG] Riverbero e distorsione aggiunti a " + ((Object)((Component)val2.Source).gameObject).name); } } } } Transform[] componentsInChildren = ((Component)enemyScript).GetComponentsInChildren(); foreach (Transform val5 in componentsInChildren) { string text = ((Object)val5).name.ToLower(); if ((text.Contains("leg") || text.Contains("arm") || text.Contains("calf") || text.Contains("thigh") || text.Contains("foot") || text.Contains("toe") || text.Contains("knee")) && val5.localScale.y < 1.5f) { val5.localScale = new Vector3(val5.localScale.x, val5.localScale.y * 1.6f, val5.localScale.z); } } } private void TryForceAggro() { } private void ForcePlayerLookAtMonster() { //IL_00ab: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetPlayer == (Object)null || !targetPlayer.isLocal) { return; } Transform val = ((Component)this).transform; if ((Object)(object)_loomHeadTrans != (Object)null) { val = _loomHeadTrans; } PlayerController val2 = null; PlayerController[] array = Object.FindObjectsOfType(); foreach (PlayerController val3 in array) { if ((Object)(object)val3.playerAvatarScript == (Object)(object)targetPlayer) { val2 = val3; break; } } if ((Object)(object)val2 != (Object)null && (Object)(object)val2.cameraAim != (Object)null) { Vector3 val4 = val.position + Vector3.down * 0.08f; val2.cameraAim.AimTargetSet(val4, 0.5f, 40f, ((Component)this).gameObject, 100); val2.OverrideDisableTurn(0.6f, false); HimPlugin.Logger.LogWarning("[PARANOIA] Il mostro ti ha preso da vicino! Rotazione visuale forzata."); } } private void ForcePlayerLookContinuous(Vector3 targetPos) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetPlayer == (Object)null || !targetPlayer.isLocal) { return; } PlayerController val = null; PlayerController[] array = Object.FindObjectsOfType(); foreach (PlayerController val2 in array) { if ((Object)(object)val2.playerAvatarScript == (Object)(object)targetPlayer) { val = val2; break; } } if ((Object)(object)val != (Object)null && (Object)(object)val.cameraAim != (Object)null) { val.cameraAim.AimTargetSet(targetPos, 0.1f, 45f, ((Component)this).gameObject, 100); val.OverrideDisableTurn(0.15f, false); } } private Vector3 FindEscapePoint(Vector3 fromPos, Vector3 playerPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = fromPos - playerPos; Vector3 normalized = ((Vector3)(ref val)).normalized; if (normalized == Vector3.zero) { val = Random.insideUnitSphere; normalized = ((Vector3)(ref val)).normalized; } normalized.y = 0f; float[] array = new float[4] { 45f, 35f, 25f, 15f }; float[] array2 = new float[8] { 0f, 45f, -45f, 90f, -90f, 135f, -135f, 180f }; float[] array3 = array; NavMeshHit val4 = default(NavMeshHit); foreach (float num in array3) { float[] array4 = array2; foreach (float num2 in array4) { Vector3 val2 = Quaternion.Euler(0f, num2, 0f) * normalized; Vector3 val3 = fromPos + val2 * num; if (NavMesh.SamplePosition(val3, ref val4, 12f, -1)) { return ((NavMeshHit)(ref val4)).position; } } } return fromPos; } private void Update() { UpscreamUpdate(); } private void UpscreamUpdate() { //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Invalid comparison between Unknown and I4 //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Invalid comparison between Unknown and I4 //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Invalid comparison between Unknown and I4 //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Invalid comparison between Unknown and I4 //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Invalid comparison between Unknown and I4 //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0832: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_093a: Unknown result type (might be due to invalid IL or missing references) //IL_093f: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_0975: Expected O, but got Unknown //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Expected O, but got Unknown //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetPlayer == (Object)null || (Object)(object)enemyScript == (Object)null) { return; } EnemyUpscream val = ((Component)enemyScript).GetComponent(); if ((Object)(object)val == (Object)null) { val = ((Component)enemyScript).GetComponentInChildren(); } if (!_enhancementApplied) { _enhancementTimer += Time.deltaTime; bool flag = false; if ((Object)(object)val != (Object)null && (Object)(object)val.upscreamAnim != (Object)null && val.upscreamAnim.sfxAttackGlobal != null && (Object)(object)val.upscreamAnim.sfxAttackGlobal.Source != (Object)null) { flag = true; } if (flag || _enhancementTimer > 2.5f) { DoubleHealthAndBuff(); _enhancementApplied = true; } } else if ((Object)(object)val != (Object)null && (Object)(object)val.upscreamAnim != (Object)null) { EnemyUpscreamAnim upscreamAnim = val.upscreamAnim; if (upscreamAnim.stepSound != null) { upscreamAnim.stepSound.Volume = 0.01f; if ((Object)(object)upscreamAnim.stepSound.Source != (Object)null) { upscreamAnim.stepSound.Source.volume = 0.01f; } } Sound[] array = (Sound[])(object)new Sound[3] { upscreamAnim.sfxAttackGlobal, upscreamAnim.sfxAttackLocal, upscreamAnim.hurtSound }; Sound[] array2 = array; foreach (Sound val2 in array2) { if (val2 != null) { val2.Volume = 35f; val2.Pitch = 0.78f; if ((Object)(object)val2.Source != (Object)null) { val2.Source.volume = 1f; val2.Source.pitch = 0.78f; val2.Source.spatialBlend = 0f; } } } } if ((Object)(object)val == (Object)null) { return; } val.targetPlayer = targetPlayer; if ((Object)(object)val.enemy != (Object)null) { val.enemy.TargetPlayerAvatar = targetPlayer; val.enemy.TargetPlayerViewID = (((Object)(object)targetPlayer.photonView != (Object)null) ? targetPlayer.photonView.ViewID : 0); } val.attacks = 0; if ((int)val.currentState == 6 && (int)_lastState != 6) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position); if (num < 1.6f) { ForcePlayerLookAtMonster(); } _customAttacks++; HimPlugin.Logger.LogWarning($"[PARANOIA] Attacco registrato ({_customAttacks}/3)"); if (_customAttacks >= 3) { _isEscaping = true; _escapeTimer = 10f; _escapeSoundTimer = Random.Range(2.5f, 6f); _escapeSoundPlayed = false; _escapeDestination = FindEscapePoint(((Component)this).transform.position, ((Component)targetPlayer).transform.position); HimPlugin.Logger.LogWarning($"[PARANOIA] Fuga di 10 secondi iniziata verso: {_escapeDestination}"); } } _lastState = val.currentState; if (_isEscaping) { _escapeTimer -= Time.deltaTime; if (!_escapeSoundPlayed) { _escapeSoundTimer -= Time.deltaTime; if (_escapeSoundTimer <= 0f) { ParanoiaManager paranoiaManager = Object.FindObjectOfType(); if ((Object)(object)paranoiaManager != (Object)null) { paranoiaManager.PlaySpookySound(((Component)this).transform.position, useImpact: false, 0.85f, 0.72f); } _escapeSoundPlayed = true; HimPlugin.Logger.LogWarning("[PARANOIA] Suono ambientale di fuga riprodotto."); } } if (_escapeTimer <= 0f) { _isEscaping = false; _customAttacks = 0; HimPlugin.Logger.LogWarning("[PARANOIA] Fuga terminata. Il mostro ritorna a cacciare!"); } } NavMeshAgent componentInChildren = ((Component)enemyScript).GetComponentInChildren(); bool flag2 = false; bool flag3 = false; if (_isEscaping) { val.currentState = (State)7; flag2 = true; if ((Object)(object)componentInChildren != (Object)null && ((Behaviour)componentInChildren).isActiveAndEnabled) { componentInChildren.isStopped = false; componentInChildren.speed = 28f; componentInChildren.acceleration = 120f; componentInChildren.SetDestination(_escapeDestination); } } else { if ((int)val.currentState == 6 || (int)val.currentState == 4) { flag3 = true; } if ((int)val.currentState == 7) { flag2 = true; } if ((Object)(object)componentInChildren != (Object)null && ((Behaviour)componentInChildren).isActiveAndEnabled) { componentInChildren.isStopped = false; componentInChildren.speed = 23f; componentInChildren.acceleration = 80f; if (!flag2 && !flag3) { componentInChildren.SetDestination(((Component)targetPlayer).transform.position); } } if ((Object)(object)_loomHeadTrans != (Object)null) { if (flag3) { float num2 = Mathf.Sin(Time.time * 24f) * 9f; float num3 = Mathf.Cos(Time.time * 18f) * 9f; float num4 = Mathf.Sin(Time.time * 15f) * 6f; _loomHeadTrans.localRotation = Quaternion.Lerp(_loomHeadTrans.localRotation, Quaternion.Euler(num2, num3, num4), Time.deltaTime * 20f); float num5 = Random.Range(-0.02f, 0.02f); float num6 = Random.Range(-0.02f, 0.02f); float num7 = Random.Range(-0.02f, 0.02f); _loomHeadTrans.localPosition = Vector3.Lerp(_loomHeadTrans.localPosition, new Vector3(num5, num6, num7), Time.deltaTime * 20f); } else { float num8 = Mathf.Sin(Time.time * 2.2f) * 6.5f + Mathf.Cos(Time.time * 1.1f) * 3f; float num9 = Mathf.Cos(Time.time * 1.3f) * 8f; float num10 = Mathf.Sin(Time.time * 1.1f) * 9.5f; _loomHeadTrans.localRotation = Quaternion.Lerp(_loomHeadTrans.localRotation, Quaternion.Euler(num8, num9, num10), Time.deltaTime * 4.5f); float num11 = Mathf.Sin(Time.time * 2.2f) * 0.05f; float num12 = (Mathf.Cos(Time.time * 4.4f) - 1f) * 0.02f; float num13 = Mathf.Cos(Time.time * 2.2f) * 0.03f; _loomHeadTrans.localPosition = Vector3.Lerp(_loomHeadTrans.localPosition, new Vector3(num11, num12, num13), Time.deltaTime * 4.5f); } } if ((Object)(object)_loomJawBone != (Object)null) { if (flag3) { float num14 = 5f + Mathf.Sin(Time.time * 35f) * 8f; float num15 = Mathf.Cos(Time.time * 30f) * 5f; _loomJawBone.localRotation = Quaternion.Lerp(_loomJawBone.localRotation, _originalJawRot * Quaternion.Euler(num14, num15, 0f), Time.deltaTime * 18f); } else { _loomJawBone.localRotation = Quaternion.Lerp(_loomJawBone.localRotation, _originalJawRot * Quaternion.Euler(-32f, 0f, 0f), Time.deltaTime * 8f); } } } if (flag3 && (Object)(object)targetPlayer != (Object)null && targetPlayer.isLocal) { float num16 = Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position); if (num16 < 1.6f) { Transform val3 = (Transform)(((Object)(object)_loomHeadTrans != (Object)null) ? ((object)_loomHeadTrans) : ((object)((Component)this).transform)); Vector3 targetPos = val3.position + Vector3.down * 0.08f; ForcePlayerLookContinuous(targetPos); if ((Object)(object)_panicOverlay == (Object)null) { _panicOverlay = new GameObject("PanicOverlay"); Canvas val4 = _panicOverlay.AddComponent(); val4.renderMode = (RenderMode)0; val4.sortingOrder = 9999; GameObject val5 = new GameObject("RedImage"); val5.transform.SetParent(_panicOverlay.transform, false); _panicImage = val5.AddComponent(); ((Graphic)_panicImage).color = new Color(0.6f, 0f, 0f, 0f); RectTransform component = ((Component)_panicImage).GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.sizeDelta = Vector2.zero; } if ((Object)(object)_panicImage != (Object)null) { ((Graphic)_panicImage).color = new Color(0.5f, 0f, 0f, Random.Range(0.08f, 0.28f)); } } else if ((Object)(object)_panicOverlay != (Object)null) { Object.Destroy((Object)(object)_panicOverlay); _panicOverlay = null; _panicImage = null; } } else if ((Object)(object)_panicOverlay != (Object)null) { Object.Destroy((Object)(object)_panicOverlay); _panicOverlay = null; _panicImage = null; } } private void LateUpdate() { //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if ((Object)(object)enemyScript != (Object)null) { Type type = ((object)enemyScript).GetType(); FieldInfo field = type.GetField("isDead", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field.FieldType == typeof(bool) && (bool)field.GetValue(enemyScript)) { flag = true; } FieldInfo field2 = type.GetField("health", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field2 != null) { if (field2.FieldType == typeof(float) && (float)field2.GetValue(enemyScript) <= 0f) { flag = true; } if (field2.FieldType == typeof(int) && (int)field2.GetValue(enemyScript) <= 0) { flag = true; } } } if ((Object)(object)enemyScript == (Object)null || !((Component)enemyScript).gameObject.activeInHierarchy || !((Behaviour)enemyScript).enabled || flag) { RestoreLights(); } Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (val is ParticleSystemRenderer) { continue; } string text = ((Object)((Component)val).gameObject).name.ToLower(); if (text.Contains("screen") || text.Contains("face") || text.Contains("monitor") || text.Contains("canvas") || text.Contains("head") || text.Contains("eye") || text.Contains("mouth") || text.Contains("tv") || text.Contains("jaw") || val.materials.Length == 0) { continue; } bool flag2 = false; Material[] materials = val.materials; for (int j = 0; j < materials.Length; j++) { if (!((Object)(object)materials[j] == (Object)null)) { string text2 = ((Object)materials[j]).name.ToLower(); if (!text2.Contains("face") && !text2.Contains("screen") && !text2.Contains("head") && !text2.Contains("eye") && !text2.Contains("mouth") && !text2.Contains("monitor") && !text2.Contains("tv") && !text2.Contains("glass") && !text2.Contains("display") && ((Object)materials[j]).name != ((Object)_blackMat).name + " (Instance)") { materials[j] = _blackMat; flag2 = true; } } } if (flag2) { val.materials = materials; } } if (_originalScale != Vector3.zero) { ((Component)this).transform.localScale = _originalScale * 1.05f; } NavMeshAgent componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.isOnNavMesh && ((Behaviour)componentInChildren).isActiveAndEnabled) { if (!((Behaviour)componentInChildren).enabled) { ((Behaviour)componentInChildren).enabled = true; } componentInChildren.isStopped = false; componentInChildren.updatePosition = true; componentInChildren.updateRotation = true; if (_isEscaping) { componentInChildren.speed = 28f; componentInChildren.acceleration = 120f; componentInChildren.angularSpeed = 360f; componentInChildren.stoppingDistance = 0f; componentInChildren.SetDestination(_escapeDestination); } else { componentInChildren.speed = 28f; componentInChildren.acceleration = 120f; componentInChildren.angularSpeed = 360f; componentInChildren.stoppingDistance = 0f; if ((Object)(object)targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)targetPlayer).transform.position) > 40f) { componentInChildren.speed = 60f; } } } Animator componentInChildren2 = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && Time.timeScale > 0f && componentInChildren2.speed < 1.5f) { componentInChildren2.speed = 1.5f; } } private void RestoreLights() { //IL_00b4: 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_0063: Unknown result type (might be due to invalid IL or missing references) if (_lightsRestored) { return; } _lightsRestored = true; if ((Object)(object)targetPlayer != (Object)null && ((Component)targetPlayer).gameObject.activeInHierarchy) { ParanoiaManager component = ((Component)targetPlayer).GetComponent(); if ((Object)(object)component != (Object)null) { component.RestoreLightsWithFlicker(_origAmbientInt, _origReflectInt, _origAmbientColor); } else { RenderSettings.ambientIntensity = _origAmbientInt; RenderSettings.reflectionIntensity = _origReflectInt; RenderSettings.ambientLight = _origAmbientColor; } } else { RenderSettings.ambientIntensity = _origAmbientInt; RenderSettings.reflectionIntensity = _origReflectInt; RenderSettings.ambientLight = _origAmbientColor; } if ((Object)(object)_darkCanvas != (Object)null) { Object.Destroy((Object)(object)_darkCanvas); } if ((Object)(object)_panicOverlay != (Object)null) { Object.Destroy((Object)(object)_panicOverlay); } } private void OnDisable() { RestoreLights(); if ((Object)(object)_panicOverlay != (Object)null) { Object.Destroy((Object)(object)_panicOverlay); } } private void OnDestroy() { RestoreLights(); if ((Object)(object)_panicOverlay != (Object)null) { Object.Destroy((Object)(object)_panicOverlay); } } } [BepInPlugin("com.gapi.repo.him", "Him", "1.0.1")] public class HimPlugin : BaseUnityPlugin { private Harmony _harmony; public static bool IsDebug; public static NetworkedEvent SpawnScreamerEvent; public static NetworkedEvent EnhanceScreamerEvent; public static NetworkedEvent InfectItemEvent; public static NetworkedEvent TargetChosenEvent; public static HimPlugin Instance { get; private set; } internal static DebugLogger Logger { get; private set; } private void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown Instance = this; Logger = new DebugLogger(((BaseUnityPlugin)this).Logger); _harmony = new Harmony("com.gapi.repo.him"); _harmony.PatchAll(); SpawnScreamerEvent = new NetworkedEvent("Him_SpawnScreamer", (Action)OnSpawnScreamerReceived); EnhanceScreamerEvent = new NetworkedEvent("Him_EnhanceScreamer", (Action)OnEnhanceScreamerReceived); InfectItemEvent = new NetworkedEvent("Him_InfectItem", (Action)OnInfectItemReceived); TargetChosenEvent = new NetworkedEvent("Him_TargetChosen", (Action)OnTargetChosenReceived); Logger.LogInfo("Plugin com.gapi.repo.him is loaded and Horror Mechanic is active!"); try { using StreamWriter streamWriter = new StreamWriter("c:\\Users\\Gapi\\Desktop\\Projects\\RepoMod\\runtime_dump.txt"); string[] array = new string[5] { "Enemy", "EnemyHealth", "Sound", "EnemyStateStun", "EnemyStateStunned" }; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { Type[] types = assembly.GetTypes(); foreach (Type type in types) { if (Array.IndexOf(array, type.Name) < 0) { continue; } streamWriter.WriteLine("\n--- " + type.FullName + " ---"); FieldInfo[] fields = type.GetFields((BindingFlags)65535); foreach (FieldInfo fieldInfo in fields) { streamWriter.WriteLine("Field: " + fieldInfo.FieldType.Name + " " + fieldInfo.Name); } PropertyInfo[] properties = type.GetProperties((BindingFlags)65535); foreach (PropertyInfo propertyInfo in properties) { streamWriter.WriteLine("Prop: " + propertyInfo.PropertyType.Name + " " + propertyInfo.Name); } MethodInfo[] methods = type.GetMethods((BindingFlags)65535); foreach (MethodInfo methodInfo in methods) { if (methodInfo.DeclaringType == type) { streamWriter.WriteLine("Method: " + methodInfo.ReturnType.Name + " " + methodInfo.Name + "(" + string.Join(", ", from p in methodInfo.GetParameters() select p.ParameterType.Name + " " + p.Name) + ")"); } } } } } catch (Exception ex) { Logger.LogError("DUMP FALLITO: " + ex.Message); } } private void OnSpawnScreamerReceived(EventData eventData) { //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) //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_0048: 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_005a: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { object[] array = (object[])eventData.CustomData; Vector3 val = (Vector3)array[0]; Quaternion spawnRot = (Quaternion)array[1]; int num = (int)array[2]; Logger.LogInfo($"[HOST] Ricevuta richiesta di spawn Screamer da PhotonID {num} a {val}"); ParanoiaManager.HostSpawnScreamer(val, spawnRot, num); } } private void OnEnhanceScreamerReceived(EventData eventData) { object[] array = (object[])eventData.CustomData; int num = (int)array[0]; int num2 = (int)array[1]; Logger.LogInfo($"[CLIENT] Ricevuta richiesta di enhance per Screamer con ViewID {num}. Target: {num2}"); ParanoiaManager.ApplyLocalEnhancement(num, num2); } private void OnInfectItemReceived(EventData eventData) { object[] array = (object[])eventData.CustomData; int num = (int)array[0]; int copyViewID = (int)array[1]; float triggerLimit = (float)array[2]; Logger.LogInfo($"[CLIENT] Ricevuta infezione per item ViewID {num}."); ParanoiaManager.ApplyLocalInfection(num, copyViewID, triggerLimit); } private void OnTargetChosenReceived(EventData eventData) { int num = (int)eventData.CustomData; Logger.LogInfo($"[CLIENT] Bersaglio scelto: PhotonID {num}"); ParanoiaManager.SetGlobalTarget(num); } } internal class DebugLogger { private readonly ManualLogSource _logger; public DebugLogger(ManualLogSource logger) { _logger = logger; } public void LogInfo(object data) { if (HimPlugin.IsDebug) { _logger.LogInfo(data); } } public void LogWarning(object data) { if (HimPlugin.IsDebug) { _logger.LogWarning(data); } } public void LogError(object data) { _logger.LogError(data); } } }