Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PSCP106 v1.1.4
SCP106.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLib.Modules; using Microsoft.CodeAnalysis; using SCP106.NetcodePatcher; using SCP106.Scripts; using SCP106.Utils; using Unity.Netcode; using UnityEngine; [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: AssemblyCompany("SCP106")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("SCP106")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+61ae28ae1926dec15c7c3852f02930da8e1998e2")] [assembly: AssemblyProduct("SCP106")] [assembly: AssemblyTitle("SCP106")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SCP106 { [BepInPlugin("project_scp.scp_106", "SCP_106", "1.1.4")] public class SCP106Plugin : BaseUnityPlugin { private const string GUID = "project_scp.scp_106"; private const string NAME = "SCP_106"; private const string VERSION = "1.1.4"; public static SCP106Plugin instance; public GameObject dimensionObject; public GameObject actualDimensionObjectInstantiated; public SCP106DimensionManager actualDimensionObjectManager; public ConfigEntry<float> monsterWalkSpeed; public ConfigEntry<float> monsterChaseSpeed; public ConfigEntry<float> monsterInDimensionSpeed; public ConfigEntry<string> spawnMoonRarity; public ConfigEntry<float> dimensionPosY; public ConfigEntry<float> trapLifeTime; public ConfigEntry<bool> trapInstantTeleport; public ConfigEntry<int> numberOfGoodDoor; public ConfigEntry<bool> screamSound; public ConfigEntry<bool> debug; private void Awake() { instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"SCP_106 starting...."); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "scp106"); AssetBundle bundle = AssetBundle.LoadFromFile(text); ((BaseUnityPlugin)this).Logger.LogInfo((object)"SCP_106 bundle found !"); NetcodePatcher(); LoadConfigs(); RegisterMonster(bundle); LoadDimension(bundle); ((BaseUnityPlugin)this).Logger.LogInfo((object)"SCP_106 is ready!"); } public void LoadDimension(AssetBundle bundle) { GameObject val = (dimensionObject = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/SCP106/DimensionSCP106.prefab")); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val).name + " FOUND")); Utilities.FixMixerGroups(val); } public void InstantiateDimension(SCP106EnemyAI enemyAI) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)enemyAI == (Object)null) && ((Object)(object)actualDimensionObjectInstantiated == (Object)null || (Object)(object)enemyAI != (Object)(object)actualDimensionObjectManager._scp106EnemyAI)) { DestroyDimension(); actualDimensionObjectInstantiated = Object.Instantiate<GameObject>(dimensionObject, Vector3.up * (0f - dimensionPosY.Value), Quaternion.identity); actualDimensionObjectManager = actualDimensionObjectInstantiated.GetComponent<SCP106DimensionManager>(); actualDimensionObjectManager._scp106EnemyAI = enemyAI; if (((NetworkBehaviour)enemyAI).IsServer) { enemyAI.ServerRunAfterCreatedDimension(); } } } public void DestroyDimension() { if ((Object)(object)actualDimensionObjectInstantiated != (Object)null) { Object.Destroy((Object)(object)actualDimensionObjectInstantiated); Object.Destroy((Object)(object)actualDimensionObjectManager); actualDimensionObjectInstantiated = null; actualDimensionObjectManager = null; } } private string RarityString(int rarity) { return $"Modded:{rarity},ExperimentationLevel:{rarity},AssuranceLevel:{rarity},VowLevel:{rarity},OffenseLevel:{rarity},MarchLevel:{rarity},RendLevel:{rarity},DineLevel:{rarity},TitanLevel:{rarity},Adamance:{rarity},Embrion:{rarity},Artifice:{rarity}"; } private void LoadConfigs() { monsterWalkSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "WalkSpeed", 5f, "SCP 106 walk speed. You don't need to restart the game :)"); CreateFloatConfig(monsterWalkSpeed, 0f, 30f); monsterChaseSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ChaseSpeed", 7f, "SCP 106 chase speed. You don't need to restart the game :)"); CreateFloatConfig(monsterChaseSpeed, 0f, 30f); monsterInDimensionSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "InDimensionSpeed", 9f, "SCP 106 in dimension speed. You don't need to restart the game :)"); CreateFloatConfig(monsterInDimensionSpeed, 0f, 30f); spawnMoonRarity = ((BaseUnityPlugin)this).Config.Bind<string>("General", "SpawnRarity", "Modded:40,ExperimentationLevel:20,AssuranceLevel:20,VowLevel:20,OffenseLevel:25,MarchLevel:25,RendLevel:30,DineLevel:30,TitanLevel:50,Adamance:50,Embrion:50,Artifice:55", "Chance for SCP 106 to spawn for any moon, example => assurance:100,offense:50 . You need to restart the game."); CreateStringConfig(spawnMoonRarity, requireRestart: true); trapLifeTime = ((BaseUnityPlugin)this).Config.Bind<float>("General", "trapLifeTime", 60f, "Trap life duration (seconds). No need to restart the game !"); CreateFloatConfig(trapLifeTime, 0f, 200f); screamSound = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Scream Sound", true, "Enable SCP106 to scream when he see a player. No need to restart the game !"); CreateBoolConfig(screamSound); trapInstantTeleport = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "trapInstantTeleport", false, "Enable traps to instant teleport players into pocket dimension. No need to restart the game !"); CreateBoolConfig(trapInstantTeleport); numberOfGoodDoor = ((BaseUnityPlugin)this).Config.Bind<int>("Pocket Dimension", "numberOfGoodDoor", 1, "Number of door that make you escape in the pocket dimension. No need to restart the game !"); CreateIntConfig(numberOfGoodDoor, 1, 4); dimensionPosY = ((BaseUnityPlugin)this).Config.Bind<float>("Pocket Dimension", "dimensionPosY", 550f, "Dimension Y position. No need to restart the game !"); CreateFloatConfig(dimensionPosY, 0f, 3000f); debug = ((BaseUnityPlugin)this).Config.Bind<bool>("Dev", "Debug", false, "Enable debug logs"); CreateBoolConfig(debug); } private void RegisterMonster(AssetBundle bundle) { EnemyType val = bundle.LoadAsset<EnemyType>("Assets/LethalCompany/Mods/SCP106/SCP106.asset"); TerminalNode terminalNode = bundle.LoadAsset<TerminalNode>("Assets/LethalCompany/Mods/SCP106/SCP106TerminalNode.asset"); TerminalKeyword terminalKeyword = bundle.LoadAsset<TerminalKeyword>("Assets/LethalCompany/Mods/SCP106/SCP106TerminalKeyword.asset"); val.MaxCount = 1; ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val).name + " FOUND")); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"{val.enemyPrefab} prefab"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); Utilities.FixMixerGroups(val.enemyPrefab); RegisterUtil.RegisterEnemyWithConfig(spawnMoonRarity.Value, val, terminalNode, terminalKeyword, val.PowerLevel, val.MaxCount); GameObject val2 = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/SCP106/SCPTrap.prefab"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val2).name + " prefab")); NetworkPrefabs.RegisterNetworkPrefab(val2); } private static void NetcodePatcher() { Type[] array; try { array = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { array = ex.Types.Where((Type type) => type != null).ToArray(); } Type[] array2 = array; foreach (Type type2 in array2) { MethodInfo[] methods = type2.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } private void CreateFloatConfig(ConfigEntry<float> configEntry, float min = 0f, float max = 100f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown FloatSliderOptions val = new FloatSliderOptions(); ((BaseRangeOptions<float>)val).Min = min; ((BaseRangeOptions<float>)val).Max = max; ((BaseOptions)val).RequiresRestart = false; FloatSliderConfigItem val2 = new FloatSliderConfigItem(configEntry, val); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); } private void CreateIntConfig(ConfigEntry<int> configEntry, int min = 0, int max = 100) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown IntSliderOptions val = new IntSliderOptions(); ((BaseRangeOptions<int>)val).Min = min; ((BaseRangeOptions<int>)val).Max = max; ((BaseOptions)val).RequiresRestart = false; IntSliderConfigItem val2 = new IntSliderConfigItem(configEntry, val); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); } private void CreateStringConfig(ConfigEntry<string> configEntry, bool requireRestart = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown TextInputFieldConfigItem val = new TextInputFieldConfigItem(configEntry, new TextInputFieldOptions { RequiresRestart = requireRestart }); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val); } public bool StringContain(string name, string verifiedName) { string text = name.ToLower(); while (text.Contains(" ")) { text = text.Replace(" ", ""); } string text2 = verifiedName.ToLower(); while (text2.Contains(" ")) { text2 = text2.Replace(" ", ""); } return text.Contains(text2); } private void CreateBoolConfig(ConfigEntry<bool> configEntry) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown BoolCheckBoxConfigItem val = new BoolCheckBoxConfigItem(configEntry, new BoolCheckBoxOptions { RequiresRestart = false }); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val); } } public static class PluginInfo { public const string PLUGIN_GUID = "SCP106"; public const string PLUGIN_NAME = "SCP106"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace SCP106.Utils { public class RegisterUtil { public static void RegisterEnemyWithConfig(string configMoonRarity, EnemyType enemy, TerminalNode terminalNode, TerminalKeyword terminalKeyword, float powerLevel, int spawnCount) { enemy.MaxCount = spawnCount; enemy.PowerLevel = powerLevel; var (dictionary, dictionary2) = ConfigParsing(configMoonRarity); Enemies.RegisterEnemy(enemy, dictionary, dictionary2, terminalNode, terminalKeyword); } public static void RegisterScrapWithConfig(string configMoonRarity, Item scrap) { var (dictionary, dictionary2) = ConfigParsing(configMoonRarity); Items.RegisterScrap(scrap, dictionary, dictionary2); } public static void RegisterShopItemWithConfig(bool enabledScrap, Item item, TerminalNode terminalNode, int itemCost, string configMoonRarity) { Items.RegisterShopItem(item, (TerminalNode)null, (TerminalNode)null, terminalNode, itemCost); if (enabledScrap) { RegisterScrapWithConfig(configMoonRarity, item); } } public static (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) ConfigParsing(string configMoonRarity) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>(); Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); foreach (string item in from s in configMoonRarity.Split(',') select s.Trim()) { string[] array = item.Split(':'); if (array.Length != 2) { continue; } string text = array[0]; if (!int.TryParse(array[1], out var result)) { continue; } if (Enum.TryParse<LevelTypes>(text, ignoreCase: true, out LevelTypes result2)) { dictionary[result2] = result; continue; } string value = text + "Level"; if (Enum.TryParse<LevelTypes>(value, ignoreCase: true, out result2)) { dictionary[result2] = result; } else { dictionary2[text] = result; } } return (dictionary, dictionary2); } } } namespace SCP106.Scripts { public class SCP106DimensionGate : MonoBehaviour { [CompilerGenerated] private sealed class <KillPlayerAnimation>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public SCP106DimensionGate <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillPlayerAnimation>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0046: 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_0056: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.25f); <>1__state = 1; return true; case 1: <>1__state = -1; player.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3), false); player.disableMoveInput = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly int Open = Animator.StringToHash("open"); public bool EscapeEnabled; public SCP106DimensionManager dimensionManager; public int id; public Animator animator; public AudioSource audioSource; public AudioClip openClip; public void OnPlayerOpenDoor(PlayerControllerB player) { dimensionManager._scp106EnemyAI.OnPlayerOpenDoorServerRpc(id, player.playerClientId); } public void DoorAnimation(PlayerControllerB player) { if (EscapeEnabled) { dimensionManager._scp106EnemyAI.PlayerEscapedDimensionServerRpc(player.playerClientId); return; } animator.SetTrigger(Open); player.disableMoveInput = true; player.JumpToFearLevel(0.8f, true); audioSource.PlayOneShot(openClip); ((MonoBehaviour)this).StartCoroutine(KillPlayerAnimation(player)); } [IteratorStateMachine(typeof(<KillPlayerAnimation>d__9))] private IEnumerator KillPlayerAnimation(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <KillPlayerAnimation>d__9(0) { <>4__this = this, player = player }; } } public class SCP106DimensionManager : NetworkBehaviour { public Transform spawnPosition; public SCP106EnemyAI _scp106EnemyAI; public List<SCP106DimensionGate> gates; public AudioSource SFXAudio; public AudioClip EnterSfx; public void SetGateToEscape(List<int> ids) { gates.ForEach(delegate(SCP106DimensionGate g) { g.EscapeEnabled = ids.Contains(g.id); }); } public void OnPlayerEnter() { SFXAudio.PlayOneShot(EnterSfx); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SCP106DimensionManager"; } } public class SCP106EnemyAI : EnemyAI { [CompilerGenerated] private sealed class <AfterCreatedDimension>d__71 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SCP106EnemyAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AfterCreatedDimension>d__71(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.SetRandomGateEscapeServerRpc(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GoToPortalLocal>d__55 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 pos; public Vector3 nextPos; public SCP106EnemyAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GoToPortalLocal>d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: 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_0079: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Component)<>4__this).transform.position = pos; ((EnemyAI)<>4__this).creatureAnimator.SetTrigger(GoToPortal); ((EnemyAI)<>4__this).creatureVoice.PlayOneShot(<>4__this.killPlayerSound); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this).transform.position = nextPos; ((EnemyAI)<>4__this).creatureAnimator.SetTrigger(OutOfPortal); <>4__this.alreadyCreatedPortal = false; if (((NetworkBehaviour)<>4__this).IsServer) { ((EnemyAI)<>4__this).SyncPositionToClients(); <>4__this.isGoingToPortal = false; <>4__this.createPortalTimer = <>4__this.createPortalDelay; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SetGateEscape>d__66 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List<int> ids; public SCP106EnemyAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SetGateEscape>d__66(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)SCP106Plugin.instance.actualDimensionObjectManager != (Object)null)); <>1__state = 1; return true; case 1: <>1__state = -1; SCP106Plugin.instance.actualDimensionObjectManager.SetGateToEscape(ids); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly int GoToPortal = Animator.StringToHash("GoToPortal"); private static readonly int OutOfPortal = Animator.StringToHash("OutOfPortal"); private static readonly int Punch = Animator.StringToHash("Punch"); private static readonly int Run = Animator.StringToHash("Run"); private static readonly int Spawn = Animator.StringToHash("Spawn"); public GameObject TrapObject; public ParticleSystem SendToPocketParticles; public List<AudioClip> walkSounds; public AudioClip seePlayerSound; public AudioClip killPlayerSound; public AudioClip damagePlayerSound; private float visionWidth = 80f; private float baseSpeed = 5f; private float runSpeed = 7f; private float inDimensionSpeed = 9f; private float spawningTimer = 7f; public LayerMask layerRoom; private float createPortalDelay = 30f; private float createPortalTimer = 30f; private float createTrapDelay = 45f; private float createTrapTimer = 10f; private List<Vector3> savedWallPosition = new List<Vector3>(); private float saveWallPosTimer = 0f; private float saveWallPosDelay = 20f; private bool alreadyCreatedPortal = false; private bool isGoingToPortal = false; private float chaseTimer = 0f; private float chaseDelay = 5f; private float hitTimer = 0f; private float hitDelay = 1f; private float aiInterval = 0.2f; private int lastBehaviorState = 0; private List<ulong> playersIdsInDimension = new List<ulong>(); private float goToPocketDimensionTimer = 30f; private float goToPocketDimensionDelay = 30f; private float walkSoundTimer = 0f; private float walkSoundDelayWalk = 0.9f; private float walkSoundDelayRun = 0.5f; private Vector3 spawnPos; private Vector3 portalGoingToPos; private ulong playerChasingId; public override void Start() { //IL_0043: 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) ((EnemyAI)this).Start(); base.agent.speed = baseSpeed; base.agent.acceleration = 255f; base.agent.angularSpeed = 900f; spawnPos = ((Component)this).transform.position; if (((NetworkBehaviour)this).IsServer) { SetSpeedValuesServerRpc(); } } [ServerRpc] private void SetSpeedValuesServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3413509130u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3413509130u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetSpeedValuesClientRpc(SCP106Plugin.instance.monsterWalkSpeed.Value, SCP106Plugin.instance.monsterChaseSpeed.Value, SCP106Plugin.instance.monsterInDimensionSpeed.Value); } } [ClientRpc] private void SetSpeedValuesClientRpc(float walkSpeed, float chaseSpeed, float dimensionSpeed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3720618267u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref walkSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref chaseSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref dimensionSpeed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3720618267u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; baseSpeed = walkSpeed; runSpeed = chaseSpeed; inDimensionSpeed = dimensionSpeed; } } } public override void Update() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: 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_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.currentBehaviourStateIndex == 1 && GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 100f, 60, -1f, -1)) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.8f, true); } if (lastBehaviorState != base.currentBehaviourStateIndex) { if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)$"New behavior state : {base.currentBehaviourStateIndex} last : {lastBehaviorState}"); } lastBehaviorState = base.currentBehaviourStateIndex; AllClientOnSwitchBehaviorState(); } walkSoundTimer -= Time.deltaTime; hitTimer -= Time.deltaTime; spawningTimer -= Time.deltaTime; if (spawningTimer < 0f && walkSoundTimer <= 0f) { AudioClip val = walkSounds[Random.Range(0, walkSounds.Count)]; base.creatureSFX.PlayOneShot(val); walkSoundTimer = ((base.currentBehaviourStateIndex == 1) ? walkSoundDelayRun : walkSoundDelayWalk); } if (!((NetworkBehaviour)this).IsServer) { return; } if (goToPocketDimensionTimer <= 0f && base.currentBehaviourStateIndex != 2 && (Object)(object)SCP106Plugin.instance.actualDimensionObjectManager != (Object)null) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((Behaviour)base.agent).enabled = false; ((Component)this).transform.position = SCP106Plugin.instance.actualDimensionObjectManager.spawnPosition.position; ((Behaviour)base.agent).enabled = true; ((EnemyAI)this).SyncPositionToClients(); ((EnemyAI)this).SwitchToBehaviourState(2); } createPortalTimer -= Time.deltaTime; saveWallPosTimer -= Time.deltaTime; aiInterval -= Time.deltaTime; createTrapTimer -= Time.deltaTime; if (base.currentBehaviourStateIndex == 1) { chaseTimer -= Time.deltaTime; } if (GetPlayerCountInDimension() > 0) { goToPocketDimensionTimer -= Time.deltaTime; } if (aiInterval <= 0f && ((NetworkBehaviour)this).IsServer) { aiInterval = base.AIIntervalTime; ((EnemyAI)this).DoAIInterval(); } Vector3 forward = ((Component)this).transform.forward; RaycastHit val2 = default(RaycastHit); if (saveWallPosTimer <= 0f && Physics.Raycast(base.eye.position, forward, ref val2, 10f, LayerMask.op_Implicit(layerRoom)) && base.currentBehaviourStateIndex != 2) { saveWallPosTimer = saveWallPosDelay; SavePortalPosition(((RaycastHit)(ref val2)).point - forward * 0.05f); } RaycastHit val3 = default(RaycastHit); if (createTrapTimer <= 0f && Physics.Raycast(base.eye.position, Vector3.down, ref val3, 3f, LayerMask.op_Implicit(layerRoom)) && base.currentBehaviourStateIndex != 2) { if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)"Create trap"); } createTrapTimer = createTrapDelay; GameObject val4 = Object.Instantiate<GameObject>(TrapObject, ((RaycastHit)(ref val3)).point + Vector3.up * 0.2f, Quaternion.identity); SCP106Trap component = val4.GetComponent<SCP106Trap>(); component._scp106EnemyAI = this; val4.GetComponent<NetworkObject>().Spawn(true); component.SetEnemyAIReferenceServerRpc(new NetworkObjectReference(((NetworkBehaviour)this).NetworkObject)); } } public override void DoAIInterval() { //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (spawningTimer > 0f || base.stunNormalizedTimer > 0f || !((NetworkBehaviour)this).IsServer) { return; } switch (base.currentBehaviourStateIndex) { case 0: ((EnemyAI)this).TargetClosestPlayer(1.5f, true, visionWidth, false, false, true); if ((Object)(object)base.targetPlayer == (Object)null) { if (createPortalTimer <= 0f) { if (alreadyCreatedPortal) { break; } if (createPortalTimer <= -15f) { createPortalTimer = createPortalDelay; alreadyCreatedPortal = false; break; } if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)$"Go through wall {createPortalTimer} {isGoingToPortal} {savedWallPosition.Count}"); } if (!isGoingToPortal && savedWallPosition.Count > 1) { Vector3 closestWallPosition = GetClosestWallPosition(); ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SetDestinationToPosition(closestWallPosition, false); portalGoingToPos = closestWallPosition; isGoingToPortal = true; } else if (isGoingToPortal && base.agent.remainingDistance <= base.agent.stoppingDistance) { if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)"Going Portal"); } ((Component)this).transform.LookAt(portalGoingToPos); ((Component)this).transform.eulerAngles = new Vector3(0f, ((Component)this).transform.eulerAngles.y, 0f); Vector3 nextPos = savedWallPosition[Random.Range(0, savedWallPosition.Count)]; GoToPortalServerRpc(((Component)this).transform.position, nextPos); alreadyCreatedPortal = true; } } else if (!base.currentSearch.inProgress) { AISearchRoutine val = new AISearchRoutine(); val.searchWidth = 100f; val.searchPrecision = 8f; ((EnemyAI)this).StartSearch(((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)this).transform.position, true, 0, false, 50, -1).position, val); } } else if (((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false, true)) { chaseTimer = chaseDelay; playerChasingId = base.targetPlayer.playerClientId; ((EnemyAI)this).StopSearch(base.currentSearch, true); base.currentSearch.inProgress = false; ((EnemyAI)this).SwitchToBehaviourState(1); } break; case 1: base.targetPlayer = GetChasingPlayer(); if (chaseTimer <= 0f) { ((EnemyAI)this).TargetClosestPlayer(1.5f, true, visionWidth, false, false, true); if ((Object)(object)base.targetPlayer != (Object)null) { playerChasingId = base.targetPlayer.playerClientId; chaseTimer += 1f; } else { chaseTimer = chaseDelay; ((EnemyAI)this).SwitchToBehaviourState(0); } } if ((Object)(object)base.targetPlayer != (Object)null && ((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false, true)) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); } break; case 2: { if (GetPlayerCountInDimension() <= 0) { TpToRandomWallPoint(); } PlayerControllerB closestPlayer = ((EnemyAI)this).GetClosestPlayer(false, false, false); if (((EnemyAI)this).PlayerIsTargetable(closestPlayer, false, false, true)) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(closestPlayer); } break; } } } private void AllClientOnSwitchBehaviorState() { switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = baseSpeed; base.creatureAnimator.SetBool(Run, false); break; case 1: if (SCP106Plugin.instance.screamSound.Value) { base.creatureVoice.PlayOneShot(seePlayerSound); } base.agent.speed = runSpeed; base.creatureAnimator.SetBool(Run, true); createPortalTimer = createPortalDelay; alreadyCreatedPortal = false; break; case 2: if (SCP106Plugin.instance.screamSound.Value) { base.creatureVoice.PlayOneShot(seePlayerSound); } base.agent.speed = inDimensionSpeed; base.creatureAnimator.SetBool(Run, true); break; } } private Vector3 GetClosestWallPosition() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Vector3 closestWallPosition = savedWallPosition[0]; savedWallPosition.ForEach(delegate(Vector3 wall) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0028: 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) if (Vector3.Distance(wall, ((Component)this).transform.position) < Vector3.Distance(((Component)this).transform.position, closestWallPosition)) { closestWallPosition = wall; } }); return closestWallPosition; } private PlayerControllerB GetChasingPlayer() { PlayerControllerB playerControllerB = null; StartOfRound.Instance.allPlayerScripts.ToList().ForEach(delegate(PlayerControllerB p) { if (!p.isPlayerDead && p.playerClientId == playerChasingId) { playerControllerB = p; } }); return playerControllerB; } private void SavePortalPosition(Vector3 pos) { //IL_0007: 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_003e: Unknown result type (might be due to invalid IL or missing references) bool canSave = true; savedWallPosition.ForEach(delegate(Vector3 p) { //IL_0001: 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) if (Vector3.Distance(p, pos) < 3f) { canSave = false; } }); if (canSave) { savedWallPosition.Add(pos); } } private int GetPlayerCountInDimension() { int count = 0; StartOfRound.Instance.allPlayerScripts.ToList().ForEach(delegate(PlayerControllerB p) { if (!p.isPlayerDead && playersIdsInDimension.Contains(p.playerClientId)) { count++; } }); return count; } [ServerRpc] public void CreatePortalServerRpc(Vector3 position, Vector3 connectedPosition, bool goToPos = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Invalid comparison between Unknown and I4 //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2370794587u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref connectedPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref goToPos, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2370794587u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; CreatePortalClientRpc(position, connectedPosition, goToPos); } } [ClientRpc] public void CreatePortalClientRpc(Vector3 position, Vector3 connectedPosition, bool goToPos = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2096729736u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref connectedPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref goToPos, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2096729736u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (goToPos) { base.agent.SetDestination(position); createPortalTimer = createPortalDelay; } } } [ServerRpc] private void GoToPortalServerRpc(Vector3 pos, Vector3 nextPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4221289024u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref nextPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4221289024u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GoToPortalClientRpc(pos, nextPos); } } [ClientRpc] private void GoToPortalClientRpc(Vector3 pos, Vector3 nextPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3120413834u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref nextPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3120413834u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(GoToPortalLocal(pos, nextPos)); } } } [IteratorStateMachine(typeof(<GoToPortalLocal>d__55))] private IEnumerator GoToPortalLocal(Vector3 pos, Vector3 nextPos) { //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_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GoToPortalLocal>d__55(0) { <>4__this = this, pos = pos, nextPos = nextPos }; } private void TpToRandomWallPoint() { //IL_004d: 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) goToPocketDimensionTimer = goToPocketDimensionDelay; ((Behaviour)base.agent).enabled = false; ((Component)this).transform.position = ((savedWallPosition.Count > 0) ? savedWallPosition[Random.Range(0, savedWallPosition.Count)] : spawnPos); ((Behaviour)base.agent).enabled = true; spawningTimer = 2f; base.creatureAnimator.SetTrigger(Spawn); ((EnemyAI)this).SwitchToBehaviourState(0); } [ServerRpc(RequireOwnership = false)] public void PlayerEscapedDimensionServerRpc(ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(405554850u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 405554850u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerEscapedDimensionClientRpc(id); } } } [ClientRpc] public void PlayerEscapedDimensionClientRpc(ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(862753145u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 862753145u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong id2 = id; playersIdsInDimension.Remove(id2); StartOfRound.Instance.allPlayerScripts.ToList().ForEach(delegate(PlayerControllerB p) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (p.playerClientId == id2 && !p.isPlayerDead) { ((Component)p).transform.position = ((savedWallPosition.Count > 0) ? savedWallPosition[Random.Range(0, savedWallPosition.Count)] : spawnPos); } }); } [ServerRpc(RequireOwnership = false)] private void PlayerKilledInDimensionServerRpc(ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3478430421u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3478430421u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TpToRandomWallPoint(); PlayerKilledInDimensionClientRpc(id); } } } [ClientRpc] private void PlayerKilledInDimensionClientRpc(ulong id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1092713157u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1092713157u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong id2 = id; StartOfRound.Instance.allPlayerScripts.ToList().ForEach(delegate(PlayerControllerB p) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (p.playerClientId != id2 && !p.isPlayerDead && playersIdsInDimension.Contains(p.playerClientId)) { ((Component)p).transform.position = ((savedWallPosition.Count > 0) ? savedWallPosition[Random.Range(0, savedWallPosition.Count)] : spawnPos); } }); playersIdsInDimension.Remove(id2); base.creatureVoice.PlayOneShot(killPlayerSound); } [ServerRpc(RequireOwnership = false)] public void PlayerInDimensionServerRpc(ulong id, bool withParticules = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3236595390u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref withParticules, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3236595390u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; goToPocketDimensionTimer = goToPocketDimensionDelay; PlayerInDimensionClientRpc(id, withParticules); } } } [ClientRpc] private void PlayerInDimensionClientRpc(ulong id, bool withParticules = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2333158317u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref withParticules, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2333158317u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SCP106Plugin.instance.InstantiateDimension(this); playersIdsInDimension.Add(id); if (withParticules) { SendToPocketParticles.Clear(); SendToPocketParticles.Play(); } } } private int GetRandomGateId() { return SCP106Plugin.instance.actualDimensionObjectManager.gates[Random.Range(0, SCP106Plugin.instance.actualDimensionObjectManager.gates.Count)].id; } [ServerRpc(RequireOwnership = false)] public void SetRandomGateEscapeServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3018912064u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3018912064u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; List<int> list = new List<int>(); while (list.Count < SCP106Plugin.instance.numberOfGoodDoor.Value) { int randomGateId = GetRandomGateId(); if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)$"ORIGINAL GATE ID TO ADD {randomGateId}"); } while (list.Contains(randomGateId)) { if (SCP106Plugin.instance.debug.Value) { Debug.Log((object)$"GATE ID TO ADD {randomGateId}"); } randomGateId = GetRandomGateId(); } list.Add(randomGateId); } SetRandomGateEscapeClientRpc(list.ToArray()); } [ClientRpc] public void SetRandomGateEscapeClientRpc(int[] ids) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3703455650u, val, (RpcDelivery)0); bool flag = ids != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<int>(ids, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3703455650u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (SCP106Plugin.instance.debug.Value) { ids.ToList().ForEach(delegate(int id) { Debug.Log((object)$"GOOD GATE ID : {id}"); }); } ((MonoBehaviour)this).StartCoroutine(SetGateEscape(ids.ToList())); } [IteratorStateMachine(typeof(<SetGateEscape>d__66))] private IEnumerator SetGateEscape(List<int> ids) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetGateEscape>d__66(0) { <>4__this = this, ids = ids }; } [ServerRpc(RequireOwnership = false)] public void OnPlayerOpenDoorServerRpc(int doorId, ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2912786795u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, doorId); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2912786795u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnPlayerOpenDoorClientRpc(doorId, playerId); } } } [ClientRpc] public void OnPlayerOpenDoorClientRpc(int doorId, ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3185833938u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, doorId); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3185833938u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ulong playerId2 = playerId; int doorId2 = doorId; PlayerControllerB player = null; StartOfRound.Instance.allPlayerScripts.ToList().ForEach(delegate(PlayerControllerB p) { if (p.playerClientId == playerId2 && !p.isPlayerDead) { player = p; } }); SCP106Plugin.instance.actualDimensionObjectManager.gates.ForEach(delegate(SCP106DimensionGate g) { if (g.id == doorId2) { g.DoorAnimation(player); } }); } public override void OnCollideWithPlayer(Collider other) { //IL_008a: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (spawningTimer > 0f) { return; } base.creatureAnimator.SetTrigger(Punch); PlayerControllerB val = (base.targetPlayer = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, true)); if ((Object)(object)val != (Object)null && hitTimer <= 0f) { base.creatureVoice.PlayOneShot(damagePlayerSound); hitTimer = hitDelay; if (base.currentBehaviourStateIndex == 2) { val.KillPlayer(Vector3.forward * 3f, true, (CauseOfDeath)0, 0, default(Vector3), false); PlayerKilledInDimensionServerRpc(val.playerClientId); } if (val.health > 40) { val.DamagePlayer(30, true, true, (CauseOfDeath)12, 0, false, default(Vector3)); return; } val.isUnderwater = false; SCP106Plugin.instance.InstantiateDimension(this); ((Component)val).transform.position = SCP106Plugin.instance.actualDimensionObjectManager.spawnPosition.position; SCP106Plugin.instance.actualDimensionObjectManager.OnPlayerEnter(); PlayerInDimensionServerRpc(val.playerClientId); } } public void ServerRunAfterCreatedDimension() { ((MonoBehaviour)this).StartCoroutine(AfterCreatedDimension()); } [IteratorStateMachine(typeof(<AfterCreatedDimension>d__71))] public IEnumerator AfterCreatedDimension() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AfterCreatedDimension>d__71(0) { <>4__this = this }; } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); SCP106Plugin.instance.DestroyDimension(); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3413509130u, new RpcReceiveHandler(__rpc_handler_3413509130), "SetSpeedValuesServerRpc"); ((NetworkBehaviour)this).__registerRpc(3720618267u, new RpcReceiveHandler(__rpc_handler_3720618267), "SetSpeedValuesClientRpc"); ((NetworkBehaviour)this).__registerRpc(2370794587u, new RpcReceiveHandler(__rpc_handler_2370794587), "CreatePortalServerRpc"); ((NetworkBehaviour)this).__registerRpc(2096729736u, new RpcReceiveHandler(__rpc_handler_2096729736), "CreatePortalClientRpc"); ((NetworkBehaviour)this).__registerRpc(4221289024u, new RpcReceiveHandler(__rpc_handler_4221289024), "GoToPortalServerRpc"); ((NetworkBehaviour)this).__registerRpc(3120413834u, new RpcReceiveHandler(__rpc_handler_3120413834), "GoToPortalClientRpc"); ((NetworkBehaviour)this).__registerRpc(405554850u, new RpcReceiveHandler(__rpc_handler_405554850), "PlayerEscapedDimensionServerRpc"); ((NetworkBehaviour)this).__registerRpc(862753145u, new RpcReceiveHandler(__rpc_handler_862753145), "PlayerEscapedDimensionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3478430421u, new RpcReceiveHandler(__rpc_handler_3478430421), "PlayerKilledInDimensionServerRpc"); ((NetworkBehaviour)this).__registerRpc(1092713157u, new RpcReceiveHandler(__rpc_handler_1092713157), "PlayerKilledInDimensionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3236595390u, new RpcReceiveHandler(__rpc_handler_3236595390), "PlayerInDimensionServerRpc"); ((NetworkBehaviour)this).__registerRpc(2333158317u, new RpcReceiveHandler(__rpc_handler_2333158317), "PlayerInDimensionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3018912064u, new RpcReceiveHandler(__rpc_handler_3018912064), "SetRandomGateEscapeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3703455650u, new RpcReceiveHandler(__rpc_handler_3703455650), "SetRandomGateEscapeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2912786795u, new RpcReceiveHandler(__rpc_handler_2912786795), "OnPlayerOpenDoorServerRpc"); ((NetworkBehaviour)this).__registerRpc(3185833938u, new RpcReceiveHandler(__rpc_handler_3185833938), "OnPlayerOpenDoorClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3413509130(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0076: 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).SetSpeedValuesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3720618267(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float walkSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref walkSpeed, default(ForPrimitives)); float chaseSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref chaseSpeed, default(ForPrimitives)); float dimensionSpeed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref dimensionSpeed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).SetSpeedValuesClientRpc(walkSpeed, chaseSpeed, dimensionSpeed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2370794587(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0096: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00cd: 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_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Vector3 connectedPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref connectedPosition); bool goToPos = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref goToPos, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).CreatePortalServerRpc(position, connectedPosition, goToPos); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2096729736(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Vector3 connectedPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref connectedPosition); bool goToPos = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref goToPos, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).CreatePortalClientRpc(position, connectedPosition, goToPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4221289024(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0090: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 nextPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref nextPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).GoToPortalServerRpc(pos, nextPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3120413834(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 nextPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref nextPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).GoToPortalClientRpc(pos, nextPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_405554850(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerEscapedDimensionServerRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_862753145(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerEscapedDimensionClientRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3478430421(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerKilledInDimensionServerRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1092713157(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerKilledInDimensionClientRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3236595390(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool withParticules = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref withParticules, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerInDimensionServerRpc(id, withParticules); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2333158317(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool withParticules = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref withParticules, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).PlayerInDimensionClientRpc(id, withParticules); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3018912064(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).SetRandomGateEscapeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3703455650(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); int[] randomGateEscapeClientRpc = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref randomGateEscapeClientRpc, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).SetRandomGateEscapeClientRpc(randomGateEscapeClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2912786795(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int doorId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref doorId); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).OnPlayerOpenDoorServerRpc(doorId, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3185833938(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int doorId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref doorId); ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP106EnemyAI)(object)target).OnPlayerOpenDoorClientRpc(doorId, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SCP106EnemyAI"; } } public class SCP106Portal : MonoBehaviour { [CompilerGenerated] private sealed class <KillPortalCoroutine>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SCP106Portal <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillPortalCoroutine>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.TimeLife); <>1__state = 1; return true; case 1: <>1__state = -1; Object.Destroy((Object)(object)((Component)<>4__this).gameObject); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public float TimeLife = 20f; private float tpPlayerTimer = 0f; private float tpPlayerDelay = 2f; public Vector3 connectedPos; private void Start() { ((MonoBehaviour)this).StartCoroutine(KillPortalCoroutine()); } private void Update() { tpPlayerTimer -= Time.deltaTime; ((Componen