Please disclose if any significant portion of your mod was created 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 PSCP06 v1.0.0
SCP106.dll
Decompiled a year 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+48b13207e5ff8a439a28f2104d08876fd8fe24b6")] [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] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<NetworkObjectReference>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<NetworkObjectReference>(); } } 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.0.0")] public class SCP106Plugin : BaseUnityPlugin { private const string GUID = "project_scp.scp_106"; private const string NAME = "SCP_106"; private const string VERSION = "1.0.0"; public static SCP106Plugin instance; public GameObject dimensionObject; public GameObject actualDimensionObjectInstantiated; public SCP106DimensionManager actualDimensionObjectManager; public ConfigEntry<string> spawnMoonRarity; public ConfigEntry<float> dimensionPosY; public ConfigEntry<float> trapLifeTime; public ConfigEntry<int> numberOfGoodDoor; 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() { 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); 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) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown EnemyType val = bundle.LoadAsset<EnemyType>("Assets/LethalCompany/Mods/SCP106/SCP106.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); TerminalNode val2 = new TerminalNode(); val2.creatureName = "SCP106"; val2.displayText = ""; TerminalKeyword val3 = new TerminalKeyword(); val3.word = "SCP106"; RegisterUtil.RegisterEnemyWithConfig(spawnMoonRarity.Value, val, val2, val3, val.PowerLevel, val.MaxCount); GameObject val4 = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/SCP106/SCPTrap.prefab"); ((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)val4).name + " prefab")); NetworkPrefabs.RegisterNetworkPrefab(val4); } 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)); 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 void SetGateToEscape(List<int> ids) { gates.ForEach(delegate(SCP106DimensionGate g) { g.EscapeEnabled = ids.Contains(g.id); }); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SCP106DimensionManager"; } } public class SCP106EnemyAI : EnemyAI { [CompilerGenerated] private sealed class <AfterCreatedDimension>d__67 : 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__67(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__51 : 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__51(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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0079: 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); <>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__62 : 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__62(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; 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 = 10f; 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; } 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_040d: 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)) { 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); } 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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); 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, false).position, val); } } else if (((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false)) { 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); 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)) { ((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)) { ((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: base.creatureVoice.PlayOneShot(seePlayerSound); base.agent.speed = runSpeed; base.creatureAnimator.SetBool(Run, true); createPortalTimer = createPortalDelay; alreadyCreatedPortal = false; break; case 2: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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)) { 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_00fd: 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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost) && 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_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)) { 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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 != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(GoToPortalLocal(pos, nextPos)); } } } [IteratorStateMachine(typeof(<GoToPortalLocal>d__51))] 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__51(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) 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)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } 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) 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)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } 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); } [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) 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)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 == 2 && (networkManager.IsClient || networkManager.IsHost)) { 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) 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; } 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_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 != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } 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__62))] private IEnumerator SetGateEscape(List<int> ids) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SetGateEscape>d__62(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) 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)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (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 != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_00cd: 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) { hitTimer = hitDelay; if (base.currentBehaviourStateIndex == 2) { val.KillPlayer(Vector3.forward * 3f, true, (CauseOfDeath)0, 0, default(Vector3)); PlayerKilledInDimensionServerRpc(val.playerClientId); } if (val.health >= 40) { val.DamagePlayer(30, true, true, (CauseOfDeath)12, 0, false, default(Vector3)); return; } SCP106Plugin.instance.InstantiateDimension(this); ((Component)val).transform.position = SCP106Plugin.instance.actualDimensionObjectManager.spawnPosition.position; PlayerInDimensionServerRpc(val.playerClientId); } } public void ServerRunAfterCreatedDimension() { ((MonoBehaviour)this).StartCoroutine(AfterCreatedDimension()); } [IteratorStateMachine(typeof(<AfterCreatedDimension>d__67))] public IEnumerator AfterCreatedDimension() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AfterCreatedDimension>d__67(0) { <>4__this = this }; } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); SCP106Plugin.instance.DestroyDimension(); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_SCP106EnemyAI() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2370794587u, new RpcReceiveHandler(__rpc_handler_2370794587)); NetworkManager.__rpc_func_table.Add(2096729736u, new RpcReceiveHandler(__rpc_handler_2096729736)); NetworkManager.__rpc_func_table.Add(4221289024u, new RpcReceiveHandler(__rpc_handler_4221289024)); NetworkManager.__rpc_func_table.Add(3120413834u, new RpcReceiveHandler(__rpc_handler_3120413834)); NetworkManager.__rpc_func_table.Add(405554850u, new RpcReceiveHandler(__rpc_handler_405554850)); NetworkManager.__rpc_func_table.Add(862753145u, new RpcReceiveHandler(__rpc_handler_862753145)); NetworkManager.__rpc_func_table.Add(3478430421u, new RpcReceiveHandler(__rpc_handler_3478430421)); NetworkManager.__rpc_func_table.Add(1092713157u, new RpcReceiveHandler(__rpc_handler_1092713157)); NetworkManager.__rpc_func_table.Add(3236595390u, new RpcReceiveHandler(__rpc_handler_3236595390)); NetworkManager.__rpc_func_table.Add(2333158317u, new RpcReceiveHandler(__rpc_handler_2333158317)); NetworkManager.__rpc_func_table.Add(3018912064u, new RpcReceiveHandler(__rpc_handler_3018912064)); NetworkManager.__rpc_func_table.Add(3703455650u, new RpcReceiveHandler(__rpc_handler_3703455650)); NetworkManager.__rpc_func_table.Add(2912786795u, new RpcReceiveHandler(__rpc_handler_2912786795)); NetworkManager.__rpc_func_table.Add(3185833938u, new RpcReceiveHandler(__rpc_handler_3185833938)); } 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)2; ((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)2; ((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)2; ((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)2; ((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)2; ((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)2; ((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)2; ((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; ((Component)this).transform.LookAt(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform); } [IteratorStateMachine(typeof(<KillPortalCoroutine>d__6))] private IEnumerator KillPortalCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <KillPortalCoroutine>d__6(0) { <>4__this = this }; } private void OnCollisionEnter(Collision other) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) Debug.Log((object)$"{((Object)other.gameObject).name} POS {connectedPos} FROM {((Component)this).transform.position}"); _ = connectedPos; if (!(tpPlayerTimer <= 0f)) { tpPlayerTimer = tpPlayerDelay; PlayerControllerB component = other.gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && GameNetworkManager.Instance.localPlayerController.playerSteamId == component.playerSteamId) { ((Component)GameNetworkManager.Instance.localPlayerController).transform.position = connectedPos; } } } } public class SCP106Trap : NetworkBehaviour { [CompilerGenerated] private sealed class <OnLifeTimeEnd>d__10 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SCP106Trap <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OnLifeTimeEnd>d__10(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 WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; ((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true); 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 End = Animator.StringToHash("end"); public SCP106EnemyAI _scp106EnemyAI; public ParticleSystem SendToPocketParticles; public Animator Animator; private NetworkVariable<NetworkObjectReference> enemyAIRef = new NetworkVariable<NetworkObjectReference>(default(NetworkObjectReference), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private float lifeTimer = 60f; private void Start() { if (((NetworkBehaviour)this).IsServer) { SetLifeTimeServerRpc(SCP106Plugin.instance.trapLifeTime.Value); } } private void Update() { lifeTimer -= Time.deltaTime; if (lifeTimer < 0f) { Animator.SetTrigger(End); if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(OnLifeTimeEnd()); } } } [ServerRpc] private void SetLifeTimeServerRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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)base.__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(233398385u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 233398385u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetLifeTimeClientRpc(value); } } [ClientRpc] private void SetLifeTimeClientRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3980101929u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3980101929u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { lifeTimer = value; } } } [IteratorStateMachine(typeof(<OnLifeTimeEnd>d__10))] private IEnumerator OnLifeTimeEnd() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OnLifeTimeEnd>d__10(0) { <>4__this = this }; } public override void OnNetworkSpawn() { //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) ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsClient) { NetworkObjectReference value = enemyAIRef.Value; NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref value)).TryGet(ref val, (NetworkManager)null)) { _scp106EnemyAI = ((Component)val).GetComponent<SCP106EnemyAI>(); } } NetworkVariable<NetworkObjectReference> obj = enemyAIRef; obj.OnValueChanged = (OnValueChangedDelegate<NetworkObjectReference>)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<NetworkObjectReference>(OnEnemyAIReferenceChanged)); } private void OnEnemyAIReferenceChanged(NetworkObjectReference previous, NetworkObjectReference current) { NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref current)).TryGet(ref val, (NetworkManager)null)) { _scp106EnemyAI = ((Component)val).GetComponent<SCP106EnemyAI>(); } } [ServerRpc] public void SetEnemyAIReferenceServerRpc(NetworkObjectReference aiRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0123: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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)base.__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(64716128u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref aiRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 64716128u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { enemyAIRef.Value = aiRef; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref aiRef)).TryGet(ref val3, (NetworkManager)null)) { _scp106EnemyAI = ((Component)val3).GetComponent<SCP106EnemyAI>(); } } } private void OnTriggerEnter(Collider other) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_scp106EnemyAI) && ((Component)other).CompareTag("Player")) { PlayerControllerB component = ((Component)other).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && !component.isPlayerDead && component.playerClientId == GameNetworkManager.Instance.localPlayerController.playerClientId) { SCP106Plugin.instance.InstantiateDimension(_scp106EnemyAI); OnPlayerCollideServerRpc(component.playerClientId); ((Component)component).transform.position = SCP106Plugin.instance.actualDimensionObjectManager.spawnPosition.position; } } } [ServerRpc(RequireOwnership = false)] private void OnPlayerCollideServerRpc(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