using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using ChaosSuite.Core; using ChaosSuite.Runtime; using ChaosSuite.Webhead.NetcodePatcher; using GameNetcodeStuff; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ChaosSuite.Webhead")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a3464fa3098fa6be253d588a5b7ca9ba01bef4dd")] [assembly: AssemblyProduct("ChaosSuite.Webhead")] [assembly: AssemblyTitle("ChaosSuite.Webhead")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ChaosSuite.Webhead { [BepInPlugin("com.chaossuite.webhead", "Webhead", "0.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class WebheadPlugin : BaseUnityPlugin { public const string PluginGuid = "com.chaossuite.webhead"; public const string PluginName = "Webhead"; public const string PluginVersion = "0.2.0"; private static bool netcodeInitialized; internal static GameObject? VisualPrefab { get; private set; } private void Awake() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) InitializeGeneratedNetcode(); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; AssetBundleRegistry val = ((instance != null) ? instance.Assets : null); AssetBundle val2 = default(AssetBundle); if (val != null && val.TryLoadModuleBundle("Webhead", typeof(WebheadPlugin).Assembly, ref val2)) { GameObject visualPrefab = default(GameObject); val.TryLoadAsset(ChaosAssetPaths.BundleName("Webhead"), ChaosAssetPaths.VisualPrefab("Webhead"), ref visualPrefab); VisualPrefab = visualPrefab; } ChaosSuiteRuntimePlugin instance2 = ChaosSuiteRuntimePlugin.Instance; if (instance2 != null) { instance2.RegisterFeatureContent("Webhead", typeof(WebheadPlugin).Assembly); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Webhead gameplay adapter loaded with host-authoritative staged webs and rescue interaction."); } private static void InitializeGeneratedNetcode() { if (netcodeInitialized) { return; } netcodeInitialized = true; Type[] types = typeof(WebheadPlugin).Assembly.GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].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); } } } } } public enum WebheadPhase : byte { Crawling, Swinging, Aiming, Recovering, Stunned, Dead } public enum WebStage : byte { None, Tethered, Wrapped, Cocooned } public readonly record struct WebVictimState(EntityId Victim, EntityId Anchor, WebStage Stage, double RescueDeadline, uint Revision); public readonly record struct SwingState(EntityId StartAnchor, EntityId EndAnchor, ushort NormalizedProgress, WebheadPhase Phase, uint Revision); public static class WebRules { public static WebVictimState Apply(WebVictimState current, EntityId victim, EntityId anchor, double deadline) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return new WebVictimState(victim, anchor, (WebStage)Math.Min(3, (int)(current.Stage + 1)), deadline, current.Revision + 1); } public static WebVictimState Clear(WebVictimState current) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return new WebVictimState(EntityId.None, EntityId.None, WebStage.None, 0.0, current.Revision + 1); } public static bool CanRescue(WebStage stage, double distance, double maximumDistance) { if (stage != WebStage.None && distance >= 0.0 && maximumDistance > 0.0) { return distance <= maximumDistance; } return false; } public static bool MatchesRescueSnapshot(ulong activeVictim, uint activeRevision, ulong expectedVictim, uint expectedRevision) { if (activeVictim != 0L && activeVictim == expectedVictim) { return activeRevision == expectedRevision; } return false; } } public sealed class WebheadEnemyAI : EnemyAI { private const float RescueDistance = 3f; private const float TetherRadius = 4.5f; private const float WrappedRadius = 2.8f; private const double RescueRequestInterval = 0.2; private const double CocoonDuration = 12.0; private const double FatalOutcomeRetryInterval = 0.75; private const double FatalOutcomeTimeout = 4.0; private const byte FatalOutcomeMaximumAttempts = 5; private static readonly FieldInfo? MovementSpeedField = typeof(PlayerControllerB).GetField("movementSpeed", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo? JumpForceField = typeof(PlayerControllerB).GetField("jumpForce", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private readonly NetworkVariable phase = new NetworkVariable((byte)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable webStage = new NetworkVariable((byte)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable victimId = new NetworkVariable(0uL, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable victimAnchor = new NetworkVariable(default(Vector3), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable rescueDeadline = new NetworkVariable(0.0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable webRevision = new NetworkVariable(0u, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable swingStart = new NetworkVariable(default(Vector3), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable swingEnd = new NetworkVariable(default(Vector3), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable swingProgress = new NetworkVariable((ushort)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable shotRevision = new NetworkVariable(0u, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable spiderEmployee = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly Dictionary nextRescueRequestByClient = new Dictionary(); private readonly ulong[] fatalOutcomeTarget = new ulong[1]; private PlayerControllerB? victim; private PlayerControllerB? restrictedLocalPlayer; private double phaseEndsAt; private double swingStartedAt; private double nextProgressPublish; private double minionWebExpiresAt; private double stageExpiresAt; private double nextLocalCocoonCorrection; private ulong cleanupAffectedOwner = ulong.MaxValue; private double nextMinionShotAt; private double nextLocalRescueRequestAt; private double nextHudAt; private uint localAnchorHitSequence; private uint fatalOutcomeSequence; private uint pendingFatalOutcomeRevision; private ulong pendingFatalOutcomeClient = ulong.MaxValue; private Vector3 pendingFatalOutcomePosition; private double nextFatalOutcomeRetryAt; private double fatalOutcomeExpiresAt; private byte fatalOutcomeAttempts; private bool fatalOutcomeAcknowledged; private Vector3 controlPoint; private GameObject? visualInstance; private GameObject? anchorKnot; private LineRenderer? webLine; private LineRenderer? aimLine; private Material? webMaterial; private AudioLowPassFilter? voiceMuffle; private bool savedDisableMoveInput; private float? savedMovementSpeed; private float? savedJumpForce; public WebheadPhase Phase => (WebheadPhase)phase.Value; public WebStage VictimStage => (WebStage)webStage.Value; public bool IsSpiderEmployee => spiderEmployee.Value; protected override void __initializeVariables() { ((NetworkVariableBase)phase).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)phase, "phase"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)phase); ((NetworkVariableBase)webStage).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)webStage, "webStage"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)webStage); ((NetworkVariableBase)victimId).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)victimId, "victimId"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)victimId); ((NetworkVariableBase)victimAnchor).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)victimAnchor, "victimAnchor"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)victimAnchor); ((NetworkVariableBase)rescueDeadline).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)rescueDeadline, "rescueDeadline"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)rescueDeadline); ((NetworkVariableBase)webRevision).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)webRevision, "webRevision"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)webRevision); ((NetworkVariableBase)swingStart).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)swingStart, "swingStart"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)swingStart); ((NetworkVariableBase)swingEnd).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)swingEnd, "swingEnd"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)swingEnd); ((NetworkVariableBase)swingProgress).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)swingProgress, "swingProgress"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)swingProgress); ((NetworkVariableBase)shotRevision).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)shotRevision, "shotRevision"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)shotRevision); ((NetworkVariableBase)spiderEmployee).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)spiderEmployee, "spiderEmployee"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)spiderEmployee); ((EnemyAI)this).__initializeVariables(); } public override void Start() { ((EnemyAI)this).Start(); base.AIIntervalTime = 0.15f; if ((Object)(object)((Component)this).GetComponentInChildren(true) == (Object)null) { GameObject visualPrefab = WebheadPlugin.VisualPrefab; if (visualPrefab != null && Object.op_Implicit((Object)(object)visualPrefab)) { visualInstance = Object.Instantiate(visualPrefab, ((Component)this).transform, false); } } if (Object.op_Implicit((Object)(object)base.agent)) { base.agent.speed = 3.5f; } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); RegisterPersistentCleanup(); NetworkVariable obj = webStage; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnWebStageChanged)); NetworkVariable obj2 = victimId; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnVictimChanged)); NetworkVariable obj3 = victimAnchor; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnAnchorChanged)); NetworkVariable obj4 = shotRevision; obj4.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj4.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnShotRevisionChanged)); NetworkVariable obj5 = spiderEmployee; obj5.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj5.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnSpiderEmployeeChanged)); CreateWebPresentation(); RefreshLocalRestriction(); RefreshMinionPresentation(); } public override void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); UpdateLocalWebPresentation(); UpdateLocalRestrictionAndRescue(); if (((NetworkBehaviour)this).IsServer && Phase == WebheadPhase.Swinging && !base.isEnemyDead && !IsSpiderEmployee) { double num = Math.Max(0.25, phaseEndsAt - swingStartedAt); float num2 = Mathf.Clamp01((float)((Time.timeAsDouble - swingStartedAt) / num)); float num3 = 1f - num2; ((Component)this).transform.position = num3 * num3 * swingStart.Value + 2f * num3 * num2 * controlPoint + num2 * num2 * swingEnd.Value; Transform transform = ((Component)this).transform; Vector3 forward = ((Component)this).transform.forward; Vector3 val = swingEnd.Value - ((Component)this).transform.position; transform.forward = Vector3.Slerp(forward, ((Vector3)(ref val)).normalized, Time.deltaTime * 8f); if (Time.timeAsDouble >= nextProgressPublish) { swingProgress.Value = (ushort)Mathf.RoundToInt(num2 * 65535f); nextProgressPublish = Time.timeAsDouble + 0.1; } RaycastHit val2 = default(RaycastHit); if (Physics.Linecast(((Component)this).transform.position, swingEnd.Value, ref val2, -1, (QueryTriggerInteraction)1) && ((RaycastHit)(ref val2)).distance < 0.4f) { Crash(); } } } public override void DoAIInterval() { //IL_0194: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (!((NetworkBehaviour)this).IsServer || base.isEnemyDead) { return; } double timeAsDouble = Time.timeAsDouble; if (pendingFatalOutcomeClient != ulong.MaxValue) { AdvanceFatalOutcome(timeAsDouble); return; } if (RoundEnding()) { ClearWeb(); return; } PlayerControllerB val = victim; if (val != null && (!val.isPlayerControlled || val.isPlayerDead || val.disconnectedMidGame || val.teleportedLastFrame || val.isInHangarShipRoom)) { ClearWeb(); } if (IsSpiderEmployee) { DoSpiderEmployeeInterval(timeAsDouble); return; } if ((int)VictimStage >= 2) { PlayerControllerB val2 = victim; if (val2 != null && Object.op_Implicit((Object)(object)val2.currentlyHeldObjectServer) && val2.currentlyHeldObjectServer.itemProperties.twoHanded) { val2.DropAllHeldItemsAndSyncNonexact(); } } WebStage victimStage = VictimStage; bool flag = victimStage - 1 <= WebStage.Tethered; if (flag && timeAsDouble >= stageExpiresAt) { DecayWebStage(timeAsDouble); } switch (Phase) { case WebheadPhase.Crawling: { if (timeAsDouble < phaseEndsAt) { return; } if (VictimStage == WebStage.None) { if (!((EnemyAI)this).TargetClosestPlayer(4f, true, 100f, false, true, false) || !Object.op_Implicit((Object)(object)base.targetPlayer)) { return; } victim = base.targetPlayer; } PlayerControllerB val3 = victim; if (val3 == null || !Object.op_Implicit((Object)(object)val3) || val3.isPlayerDead) { ClearWeb(); return; } victimId.Value = val3.playerClientId + 1; if (TryBeginSwing(((Component)val3).transform.position)) { return; } BeginAiming(timeAsDouble, 0.7); break; } case WebheadPhase.Swinging: if (timeAsDouble >= phaseEndsAt) { BeginAiming(timeAsDouble, 0.65); } break; case WebheadPhase.Aiming: if (timeAsDouble >= phaseEndsAt) { FireWeb(); SetPhase(WebheadPhase.Recovering, timeAsDouble + 1.1); } break; case WebheadPhase.Recovering: if (timeAsDouble >= phaseEndsAt) { SetPhase(WebheadPhase.Crawling, timeAsDouble + 2.4); } break; case WebheadPhase.Stunned: if (timeAsDouble >= phaseEndsAt) { SetPhase(WebheadPhase.Crawling, timeAsDouble + 2.4); } break; } if (VictimStage == WebStage.Cocooned && timeAsDouble >= rescueDeadline.Value) { PlayerControllerB val4 = victim; if (val4 != null && !val4.isPlayerDead) { BeginFatalOutcome(val4, timeAsDouble); } } } [ServerRpc(RequireOwnership = false)] private void RequestCutWebServerRpc(ulong expectedVictimId, uint expectedRevision, ServerRpcParams rpc = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3010056802u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, expectedVictimId); BytePacker.WriteValueBitPacked(val, expectedRevision); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3010056802u, rpc, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer || pendingFatalOutcomeClient != ulong.MaxValue || RoundEnding() || VictimStage == WebStage.None || !WebRules.MatchesRescueSnapshot(victimId.Value, webRevision.Value, expectedVictimId, expectedRevision)) { return; } ulong senderClientId = rpc.Receive.SenderClientId; double timeAsDouble = Time.timeAsDouble; if (!nextRescueRequestByClient.TryGetValue(senderClientId, out var value) || !(timeAsDouble < value)) { nextRescueRequestByClient[senderClientId] = timeAsDouble + 0.2; PlayerControllerB val2 = FindPlayerByOwner(senderClientId); if (val2 != null && Object.op_Implicit((Object)(object)val2) && !val2.isPlayerDead && val2.isPlayerControlled && !val2.disconnectedMidGame && val2.playerClientId + 1 != victimId.Value) { TryCutWeb(val2); } } } [ServerRpc(RequireOwnership = false)] private void RequestAnchorHitServerRpc(ulong claimedPlayer, uint sequence, ulong expectedVictimId, uint expectedRevision, ServerRpcParams rpc = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01af: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2277259762u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, claimedPlayer); BytePacker.WriteValueBitPacked(val, sequence); BytePacker.WriteValueBitPacked(val, expectedVictimId); BytePacker.WriteValueBitPacked(val, expectedRevision); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2277259762u, rpc, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer || pendingFatalOutcomeClient != ulong.MaxValue || rpc.Receive.SenderClientId != claimedPlayer || sequence == 0 || RoundEnding() || !WebRules.MatchesRescueSnapshot(victimId.Value, webRevision.Value, expectedVictimId, expectedRevision)) { return; } PlayerControllerB val2 = FindPlayerByOwner(claimedPlayer); if (!((Object)(object)val2 == (Object)null) && !val2.isPlayerDead && !val2.disconnectedMidGame && (val2.currentlyHeldObjectServer is Shovel || val2.currentlyHeldObjectServer is KnifeItem) && !(Vector3.SqrMagnitude(((Component)val2).transform.position - victimAnchor.Value) > 9f) && HasLineOfSight((Component)(object)val2, victimAnchor.Value)) { ClearWeb(); if (!IsSpiderEmployee) { SetPhase(WebheadPhase.Stunned, Time.timeAsDouble + 2.5); } } } internal void HitAnchor(PlayerControllerB player) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || VictimStage == WebStage.None) { return; } if (((NetworkBehaviour)this).IsServer) { TryCutWeb(player); return; } localAnchorHitSequence++; if (localAnchorHitSequence == 0) { localAnchorHitSequence = 1u; } RequestAnchorHitServerRpc(((NetworkBehaviour)player).OwnerClientId, localAnchorHitSequence, victimId.Value, webRevision.Value); } public bool TryCutWeb(PlayerControllerB rescuer) { //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_0078: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && pendingFatalOutcomeClient == ulong.MaxValue && !RoundEnding() && Object.op_Implicit((Object)(object)rescuer) && !rescuer.isPlayerDead) { PlayerControllerB val = victim; if (val != null && !val.isPlayerDead) { float num = Vector3.Distance(((Component)rescuer).transform.position, victimAnchor.Value); if (!WebRules.CanRescue(VictimStage, num, 3.0) || !HasLineOfSight((Component)(object)rescuer, victimAnchor.Value)) { return false; } ClearWeb(); if (!IsSpiderEmployee) { SetPhase(WebheadPhase.Stunned, Time.timeAsDouble + 2.5); } return true; } } return false; } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB? setStunnedByPlayer = null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); if (((NetworkBehaviour)this).IsServer && setToStunned) { ClearWeb(); SetPhase(WebheadPhase.Stunned, Time.timeAsDouble + (double)Mathf.Max(0.5f, setToStunTime)); } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (((NetworkBehaviour)this).IsServer && force > 0 && playerWhoHit != null && Object.op_Implicit((Object)(object)playerWhoHit) && VictimStage != WebStage.None) { TryCutWeb(playerWhoHit); } } public override void KillEnemy(bool destroy) { if (((NetworkBehaviour)this).IsServer) { ClearFatalOutcomeState(); ClearWeb(); phase.Value = 5; } ((EnemyAI)this).KillEnemy(destroy); } public override void OnNetworkDespawn() { NetworkVariable obj = webStage; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnWebStageChanged)); NetworkVariable obj2 = victimId; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnVictimChanged)); NetworkVariable obj3 = victimAnchor; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnAnchorChanged)); NetworkVariable obj4 = shotRevision; obj4.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj4.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnShotRevisionChanged)); NetworkVariable obj5 = spiderEmployee; obj5.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj5.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnSpiderEmployeeChanged)); if (((NetworkBehaviour)this).IsServer) { ClearFatalOutcomeState(); ClearWeb(); } RestoreLocalRestriction(); DestroyWebPresentation(); nextRescueRequestByClient.Clear(); GameObject val = visualInstance; if (val != null && Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void OnDestroy() { RestoreLocalRestriction(); DestroyWebPresentation(); nextRescueRequestByClient.Clear(); ClearFatalOutcomeState(); ((EnemyAI)this).OnDestroy(); } private void OnDisable() { RestoreLocalRestriction(); RemoveVoiceMuffle(); LineRenderer val = webLine; if (val != null && Object.op_Implicit((Object)(object)val)) { ((Renderer)val).enabled = false; } LineRenderer val2 = aimLine; if (val2 != null && Object.op_Implicit((Object)(object)val2)) { ((Renderer)val2).enabled = false; } GameObject val3 = anchorKnot; if (val3 != null && Object.op_Implicit((Object)(object)val3)) { val3.SetActive(false); } } private bool TryBeginSwing(Vector3 toward) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003d: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00d7: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.up, ref val, 9f, -1, (QueryTriggerInteraction)1)) { return false; } Vector3 val2 = Vector3.ProjectOnPlane(toward - ((Component)this).transform.position, Vector3.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; RaycastHit val3 = default(RaycastHit); if (!Physics.Raycast(((RaycastHit)(ref val)).point - Vector3.up * 0.2f, normalized, ref val3, 12f, -1, (QueryTriggerInteraction)1)) { return false; } swingStart.Value = ((Component)this).transform.position; swingEnd.Value = ((RaycastHit)(ref val3)).point - normalized * 0.6f; controlPoint = (swingStart.Value + swingEnd.Value) * 0.5f + Vector3.up * 4f; swingProgress.Value = 0; if (Object.op_Implicit((Object)(object)base.agent)) { ((Behaviour)base.agent).enabled = false; } swingStartedAt = Time.timeAsDouble; SetPhase(WebheadPhase.Swinging, swingStartedAt + 1.8); return true; } private void FireWeb() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = victim; if (val == null || val.isPlayerDead) { return; } Vector3 val2 = ((Component)this).transform.position + Vector3.up; Vector3 val3 = ((Component)val).transform.position + Vector3.up - val2; Vector3 normalized = ((Vector3)(ref val3)).normalized; NetworkVariable obj = shotRevision; uint value = obj.Value; obj.Value = value + 1; ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.Noise.TryEmit(new EntityId(((NetworkBehaviour)this).NetworkObjectId), val2, 18f, 0.65f, 9921, Time.timeAsDouble, 0.2, false); } RaycastHit val4 = default(RaycastHit); if (!Physics.SphereCast(val2, 0.18f, normalized, ref val4, 18f, -1, (QueryTriggerInteraction)1) || (Object)(object)((Component)((RaycastHit)(ref val4)).collider).GetComponentInParent() != (Object)(object)val) { return; } if (VictimStage == WebStage.None) { ChaosSuiteRuntimePlugin instance2 = ChaosSuiteRuntimePlugin.Instance; if (instance2 == null || !instance2.ThreatBudget.TryAcquire(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)0)) { return; } } if (VictimStage == WebStage.None) { SetCleanupAffectedOwner(((NetworkBehaviour)val).OwnerClientId); victimAnchor.Value = FindSafeAnchor(val); } WebStage webStage = (WebStage)Math.Min(3, (int)(VictimStage + 1)); this.webStage.Value = (byte)webStage; stageExpiresAt = ((webStage == WebStage.Cocooned) ? 0.0 : (Time.timeAsDouble + 6.0)); rescueDeadline.Value = ((webStage == WebStage.Cocooned) ? (Time.timeAsDouble + 12.0) : 0.0); NetworkVariable obj2 = webRevision; value = obj2.Value; obj2.Value = value + 1; if ((int)webStage >= 2 && Object.op_Implicit((Object)(object)val.currentlyHeldObjectServer) && val.currentlyHeldObjectServer.itemProperties.twoHanded) { val.DropAllHeldItemsAndSyncNonexact(); } } private void BeginAiming(double now, double duration) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) SetPhase(WebheadPhase.Aiming, now + duration); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.Noise.TryEmit(new EntityId(((NetworkBehaviour)this).NetworkObjectId), ((Component)this).transform.position, 14f, 0.42f, 9920, now, 0.5, false); } TelegraphShotClientRpc(); } [ClientRpc] private void TelegraphShotClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1710922175u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1710922175u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChaosPresentation.TriggerAction((Component)(object)this); if ((Object)(object)base.creatureSFX != (Object)null) { ((Component)base.creatureSFX).gameObject.SendMessage("Play", (SendMessageOptions)1); } } } [ClientRpc] private void ApplyCocoonFatalOutcomeClientRpc(ulong targetClient, uint outcomeRevision, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(300530035u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, targetClient); BytePacker.WriteValueBitPacked(val, outcomeRevision); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 300530035u, clientRpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkManager singleton = NetworkManager.Singleton; if (singleton == null || singleton.LocalClientId != targetClient) { return; } PlayerControllerB val2 = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val2 == (Object)null) && ((NetworkBehaviour)val2).OwnerClientId == targetClient) { if (!val2.isPlayerDead) { val2.KillPlayer(Vector3.zero, true, (CauseOfDeath)5, 0, Vector3.zero, false); } if (val2.isPlayerDead) { AcknowledgeCocoonFatalOutcomeServerRpc(outcomeRevision); } } } [ServerRpc(RequireOwnership = false)] private void AcknowledgeCocoonFatalOutcomeServerRpc(uint outcomeRevision, ServerRpcParams rpc = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1584528627u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, outcomeRevision); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1584528627u, rpc, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer && pendingFatalOutcomeClient != ulong.MaxValue && rpc.Receive.SenderClientId == pendingFatalOutcomeClient && outcomeRevision != 0 && outcomeRevision == pendingFatalOutcomeRevision) { fatalOutcomeAcknowledged = true; PlayerControllerB val2 = FindPlayerByOwner(pendingFatalOutcomeClient); if ((Object)(object)val2 != (Object)null && val2.isPlayerDead) { CommitFatalOutcome(); } } } private void BeginFatalOutcome(PlayerControllerB target, double now) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && pendingFatalOutcomeClient == ulong.MaxValue && !((Object)(object)target == (Object)null) && !target.isPlayerDead) { fatalOutcomeSequence++; if (fatalOutcomeSequence == 0) { fatalOutcomeSequence = 1u; } pendingFatalOutcomeRevision = fatalOutcomeSequence; pendingFatalOutcomeClient = ((NetworkBehaviour)target).OwnerClientId; pendingFatalOutcomePosition = ((Component)target).transform.position; fatalOutcomeExpiresAt = now + 4.0; nextFatalOutcomeRetryAt = now; fatalOutcomeAttempts = 0; fatalOutcomeAcknowledged = false; AdvanceFatalOutcome(now); } } private void AdvanceFatalOutcome(double now) { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsServer || pendingFatalOutcomeClient == ulong.MaxValue) { return; } PlayerControllerB val = FindPlayerByOwner(pendingFatalOutcomeClient); if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)val) && fatalOutcomeAcknowledged && val.isPlayerDead) { CommitFatalOutcome(); } else if (RoundEnding() || (Object)(object)val == (Object)null || !Object.op_Implicit((Object)(object)val) || val.disconnectedMidGame || (!val.isPlayerControlled && !val.isPlayerDead) || val.teleportedLastFrame || val.isInHangarShipRoom) { AbortFatalOutcome("victim left the active round"); } else if (now >= fatalOutcomeExpiresAt) { AbortFatalOutcome("owner acknowledgement timed out"); } else if (fatalOutcomeAttempts < 5 && !(now < nextFatalOutcomeRetryAt)) { NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton == (Object)null || !singleton.IsListening || !singleton.ConnectedClients.ContainsKey(pendingFatalOutcomeClient)) { AbortFatalOutcome("victim owner disconnected"); return; } fatalOutcomeAttempts++; nextFatalOutcomeRetryAt = now + 0.75; fatalOutcomeTarget[0] = pendingFatalOutcomeClient; ApplyCocoonFatalOutcomeClientRpc(pendingFatalOutcomeClient, pendingFatalOutcomeRevision, new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = fatalOutcomeTarget } }); } } private void CommitFatalOutcome() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer && pendingFatalOutcomeClient != ulong.MaxValue) { Vector3 spawnPosition = pendingFatalOutcomePosition; ClearFatalOutcomeState(); BecomeSpiderEmployee(spawnPosition); } } private void AbortFatalOutcome(string reason) { if (((NetworkBehaviour)this).IsServer && pendingFatalOutcomeClient != ulong.MaxValue) { Debug.LogWarning((object)("[ChaosSuite.Webhead] Cocoon fatal outcome cancelled: " + reason + ".")); ClearFatalOutcomeState(); ClearWeb(); if (!RoundEnding() && !base.isEnemyDead) { SetPhase(WebheadPhase.Stunned, Time.timeAsDouble + 2.0); } } } private void ClearFatalOutcomeState() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) pendingFatalOutcomeClient = ulong.MaxValue; pendingFatalOutcomeRevision = 0u; pendingFatalOutcomePosition = Vector3.zero; nextFatalOutcomeRetryAt = 0.0; fatalOutcomeExpiresAt = 0.0; fatalOutcomeAttempts = 0; fatalOutcomeAcknowledged = false; } private Vector3 FindSafeAnchor(PlayerControllerB target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)target).transform.position + Vector3.up * 0.8f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.up, ref val2, 4f, -1, (QueryTriggerInteraction)1) && !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent())) { return ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * 0.8f; } Vector3 val3 = ((Component)this).transform.position - val; Vector3 normalized = ((Vector3)(ref val3)).normalized; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val, normalized, ref val4, 5f, -1, (QueryTriggerInteraction)1) && !Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val4)).collider).GetComponentInParent())) { return ((RaycastHit)(ref val4)).point + ((RaycastHit)(ref val4)).normal * 0.8f; } return ((Component)target).transform.position; } private void DoSpiderEmployeeInterval(double now) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) if (VictimStage != WebStage.None && now >= minionWebExpiresAt) { ClearWeb(); } if (!((EnemyAI)this).TargetClosestPlayer(4f, true, 100f, false, true, false) || !Object.op_Implicit((Object)(object)base.targetPlayer)) { return; } ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer).transform.position, true); if (now < nextMinionShotAt || VictimStage != WebStage.None || Vector3.SqrMagnitude(((Component)base.targetPlayer).transform.position - ((Component)this).transform.position) > 36f || !HasLineOfSight((Component)(object)this, base.targetPlayer)) { return; } ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null && instance.ThreatBudget.TryAcquire(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)0)) { victim = base.targetPlayer; SetCleanupAffectedOwner(((NetworkBehaviour)base.targetPlayer).OwnerClientId); victimId.Value = base.targetPlayer.playerClientId + 1; victimAnchor.Value = FindSafeAnchor(base.targetPlayer); webStage.Value = 1; rescueDeadline.Value = 0.0; NetworkVariable obj = webRevision; uint value = obj.Value; obj.Value = value + 1; minionWebExpiresAt = now + 5.0; stageExpiresAt = now + 5.0; nextMinionShotAt = now + 8.0; ChaosSuiteRuntimePlugin instance2 = ChaosSuiteRuntimePlugin.Instance; if (instance2 != null) { instance2.Noise.TryEmit(new EntityId(((NetworkBehaviour)this).NetworkObjectId), ((Component)this).transform.position, 12f, 0.45f, 9922, now, 0.5, false); } } } private void BecomeSpiderEmployee(Vector3 spawnPosition) { //IL_001f: 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) ClearWeb(); spiderEmployee.Value = true; base.enemyHP = 1; ((Component)this).transform.position = spawnPosition; if (Object.op_Implicit((Object)(object)base.agent)) { if (!((Behaviour)base.agent).enabled) { ((Behaviour)base.agent).enabled = true; } base.agent.speed = 2.2f; if (base.agent.isOnNavMesh) { base.agent.Warp(spawnPosition); } } SetPhase(WebheadPhase.Crawling, Time.timeAsDouble + 1.5); } private void Crash() { if (((NetworkBehaviour)this).IsServer) { if (Object.op_Implicit((Object)(object)base.agent) && !((Behaviour)base.agent).enabled) { ((Behaviour)base.agent).enabled = true; } SetPhase(WebheadPhase.Stunned, Time.timeAsDouble + 3.0); } } private void ClearWeb() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) ClearFatalOutcomeState(); if (((NetworkBehaviour)this).IsServer && (victimId.Value != 0L || VictimStage != WebStage.None || !((Object)(object)victim == (Object)null))) { SetCleanupAffectedOwner(ulong.MaxValue); victim = null; victimId.Value = 0uL; victimAnchor.Value = Vector3.zero; webStage.Value = 0; rescueDeadline.Value = 0.0; minionWebExpiresAt = 0.0; stageExpiresAt = 0.0; NetworkVariable obj = webRevision; uint value = obj.Value; obj.Value = value + 1; ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)0, "web cleared"); } } } private void RegisterPersistentCleanup() { if (((NetworkBehaviour)this).IsServer && !((Object)(object)((NetworkBehaviour)this).NetworkObject == (Object)null) && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.Cleanup.Register(((NetworkBehaviour)this).NetworkObject, (Action)CleanupPersistentEffect); } } } private void CleanupPersistentEffect() { ClearWeb(); } private void SetCleanupAffectedOwner(ulong nextOwner) { //IL_003f: 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) if (((NetworkBehaviour)this).IsServer && cleanupAffectedOwner != nextOwner) { ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; EffectCleanupRegistry val = ((instance != null) ? instance.Cleanup : null); EntityId val2 = default(EntityId); ((EntityId)(ref val2))..ctor(((NetworkBehaviour)this).NetworkObjectId); if (cleanupAffectedOwner != ulong.MaxValue && val != null) { val.DisassociateAffectedOwner(val2, cleanupAffectedOwner); } cleanupAffectedOwner = nextOwner; if (cleanupAffectedOwner != ulong.MaxValue && val != null) { val.AssociateAffectedOwner(val2, cleanupAffectedOwner); } } } private void DecayWebStage(double now) { bool flag = !((NetworkBehaviour)this).IsServer; if (!flag) { WebStage victimStage = VictimStage; bool flag2 = victimStage - 1 <= WebStage.Tethered; flag = !flag2; } if (!flag) { WebStage webStage = VictimStage - 1; if (webStage == WebStage.None) { ClearWeb(); return; } this.webStage.Value = (byte)webStage; rescueDeadline.Value = 0.0; stageExpiresAt = now + 6.0; NetworkVariable obj = webRevision; uint value = obj.Value; obj.Value = value + 1; } } private void SetPhase(WebheadPhase next, double deadline) { phase.Value = (byte)next; phaseEndsAt = deadline; if (Object.op_Implicit((Object)(object)base.agent) && next != WebheadPhase.Swinging && !((Behaviour)base.agent).enabled) { ((Behaviour)base.agent).enabled = true; } } private void UpdateLocalRestrictionAndRescue() { //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB local = GameNetworkManager.Instance?.localPlayerController; if (local == null || !Object.op_Implicit((Object)(object)local) || local.isPlayerDead || RoundEnding()) { RestoreLocalRestriction(); return; } PlayerControllerB val = FindPlayerByToken(victimId.Value); if (val == null || !Object.op_Implicit((Object)(object)val) || VictimStage == WebStage.None) { RestoreLocalRestriction(); } else if ((Object)(object)local == (Object)(object)val) { if ((Object)(object)restrictedLocalPlayer != (Object)(object)local) { RefreshLocalRestriction(); } float num = ((VictimStage == WebStage.Tethered) ? 4.5f : 2.8f); Vector3 val2 = ((Component)local).transform.position - victimAnchor.Value; if (((Vector3)(ref val2)).sqrMagnitude > num * num) { PlayerControllerB obj = local; obj.externalForces += Vector3.ClampMagnitude((victimAnchor.Value + ((Vector3)(ref val2)).normalized * num - ((Component)local).transform.position) * 8f, 22f) * Time.deltaTime; } if (VictimStage != WebStage.Cocooned) { return; } local.disableMoveInput = true; if (Time.timeAsDouble >= nextLocalCocoonCorrection && Vector3.SqrMagnitude(((Component)local).transform.position - victimAnchor.Value) > 0.0625f) { TeleportCleanupGuard.RunWithoutCleanup((Action)delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) local.TeleportPlayer(victimAnchor.Value, false, 0f, false, true); }); nextLocalCocoonCorrection = Time.timeAsDouble + 0.25; } ShowRescueTimer(local); } else { RestoreLocalRestriction(); float num2 = Vector3.Distance(((Component)local).transform.position, victimAnchor.Value); if (VictimStage == WebStage.Cocooned && num2 <= 8f) { ShowRescueTimer(local); } else if (WebRules.CanRescue(VictimStage, num2, 3.0)) { ShowCutPrompt(); } if (WebRules.CanRescue(VictimStage, num2, 3.0) && !(Time.timeAsDouble < nextLocalRescueRequestAt) && InteractPressed()) { nextLocalRescueRequestAt = Time.timeAsDouble + 0.2; RequestCutWebServerRpc(victimId.Value, webRevision.Value); } } } private void ShowRescueTimer(PlayerControllerB local) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (!(Time.timeAsDouble < nextHudAt) && Object.op_Implicit((Object)(object)HUDManager.Instance)) { nextHudAt = Time.timeAsDouble + 1.0; double value = rescueDeadline.Value; NetworkTime serverTime = ((NetworkBehaviour)this).NetworkManager.ServerTime; double num = Math.Max(0.0, Math.Ceiling(value - ((NetworkTime)(ref serverTime)).Time)); HUDManager.Instance.DisplayTip("WEB COCOON", $"Rescue window: {num:0}s — teammate interact cuts the strand", true, false, "ChaosSuite_WebheadRescue"); } } private void ShowCutPrompt() { if (!(Time.timeAsDouble < nextHudAt) && Object.op_Implicit((Object)(object)HUDManager.Instance)) { nextHudAt = Time.timeAsDouble + 1.0; HUDManager.Instance.DisplayTip("WEB ANCHOR", "Interact near the knot to cut your teammate free", false, false, "ChaosSuite_WebheadCut"); } } private static bool InteractPressed() { IngamePlayerSettings instance = IngamePlayerSettings.Instance; object obj; if (instance == null) { obj = null; } else { PlayerInput playerInput = instance.playerInput; obj = ((playerInput != null) ? playerInput.actions : null); } if ((Object)obj == (Object)null) { return false; } InputAction obj2 = instance.playerInput.actions.FindAction("Interact", false); if (obj2 == null) { return false; } return obj2.WasPressedThisFrame(); } private void RefreshLocalRestriction() { PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; PlayerControllerB val2 = FindPlayerByToken(victimId.Value); if (val == null || !Object.op_Implicit((Object)(object)val) || (Object)(object)val != (Object)(object)val2 || VictimStage == WebStage.None) { RestoreLocalRestriction(); return; } if ((Object)(object)restrictedLocalPlayer != (Object)(object)val) { RestoreLocalRestriction(); restrictedLocalPlayer = val; savedDisableMoveInput = val.disableMoveInput; savedMovementSpeed = ReadFloat(MovementSpeedField, val); savedJumpForce = ReadFloat(JumpForceField, val); } WebStage victimStage = VictimStage; if (victimStage == WebStage.Tethered) { WriteLowerFloat(MovementSpeedField, val, savedMovementSpeed, 3.2f); } if ((int)victimStage >= 2) { WriteLowerFloat(MovementSpeedField, val, savedMovementSpeed, 2.4f); WriteLowerFloat(JumpForceField, val, savedJumpForce, 7.5f); } val.disableMoveInput = victimStage == WebStage.Cocooned || savedDisableMoveInput; } private void RestoreLocalRestriction() { PlayerControllerB val = restrictedLocalPlayer; if (val == null || !Object.op_Implicit((Object)(object)val)) { restrictedLocalPlayer = null; return; } val.disableMoveInput = savedDisableMoveInput; if (savedMovementSpeed.HasValue) { MovementSpeedField?.SetValue(val, savedMovementSpeed.Value); } if (savedJumpForce.HasValue) { JumpForceField?.SetValue(val, savedJumpForce.Value); } restrictedLocalPlayer = null; savedMovementSpeed = null; savedJumpForce = null; } private static float? ReadFloat(FieldInfo? field, PlayerControllerB player) { object obj = field?.GetValue(player); if (!(obj is float)) { return null; } return (float)obj; } private static void WriteLowerFloat(FieldInfo? field, PlayerControllerB player, float? baseline, float cap) { if (field != null && baseline.HasValue) { field.SetValue(player, Mathf.Min(baseline.Value, cap)); } } private void CreateWebPresentation() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ChaosSuite Web Strand"); val.transform.SetParent(((Component)this).transform, false); webLine = val.AddComponent(); webLine.positionCount = 2; webLine.useWorldSpace = true; webLine.numCapVertices = 3; ((Renderer)webLine).enabled = false; Shader val2 = Shader.Find("Sprites/Default"); if (Object.op_Implicit((Object)(object)val2)) { webMaterial = new Material(val2); ((Renderer)webLine).material = webMaterial; } GameObject val3 = new GameObject("ChaosSuite Web Aim Telegraph"); val3.transform.SetParent(((Component)this).transform, false); aimLine = val3.AddComponent(); aimLine.positionCount = 2; aimLine.useWorldSpace = true; aimLine.startWidth = 0.025f; aimLine.endWidth = 0.025f; aimLine.startColor = new Color(1f, 0.35f, 0.25f, 0.7f); aimLine.endColor = new Color(1f, 0.8f, 0.7f, 0.25f); ((Renderer)aimLine).enabled = false; if (Object.op_Implicit((Object)(object)webMaterial)) { ((Renderer)aimLine).material = webMaterial; } anchorKnot = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)anchorKnot).name = "ChaosSuite Web Anchor Knot"; anchorKnot.transform.localScale = Vector3.one * 0.22f; Collider component = anchorKnot.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.isTrigger = true; } anchorKnot.AddComponent().Initialize(this); anchorKnot.SetActive(false); } private void UpdateLocalWebPresentation() { //IL_007e: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) LineRenderer val = webLine; GameObject val2 = anchorKnot; LineRenderer val3 = aimLine; if (val != null && Object.op_Implicit((Object)(object)val) && val2 != null && Object.op_Implicit((Object)(object)val2) && val3 != null && Object.op_Implicit((Object)(object)val3)) { PlayerControllerB val4 = FindPlayerByToken(victimId.Value); if (((Renderer)val3).enabled = val4 != null && Object.op_Implicit((Object)(object)val4) && Phase == WebheadPhase.Aiming && !IsSpiderEmployee) { val3.SetPosition(0, ((Component)this).transform.position + Vector3.up); val3.SetPosition(1, ((Component)val4).transform.position + Vector3.up); } bool flag2 = (((Renderer)val).enabled = val4 != null && Object.op_Implicit((Object)(object)val4) && VictimStage != WebStage.None); val2.SetActive(flag2); if (flag2) { val.startWidth = ((VictimStage == WebStage.Cocooned) ? 0.18f : ((VictimStage == WebStage.Wrapped) ? 0.1f : 0.055f)); val.endWidth = val.startWidth; val.SetPosition(0, victimAnchor.Value); val.SetPosition(1, ((Component)val4).transform.position + Vector3.up); val2.transform.position = victimAnchor.Value; RefreshVoiceMuffle(val4); } } } private void DestroyWebPresentation() { LineRenderer val = webLine; if (val != null && Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).gameObject); } LineRenderer val2 = aimLine; if (val2 != null && Object.op_Implicit((Object)(object)val2)) { Object.Destroy((Object)(object)((Component)val2).gameObject); } GameObject val3 = anchorKnot; if (val3 != null && Object.op_Implicit((Object)(object)val3)) { Object.Destroy((Object)(object)val3); } Material val4 = webMaterial; if (val4 != null && Object.op_Implicit((Object)(object)val4)) { Object.Destroy((Object)(object)val4); } RemoveVoiceMuffle(); webLine = null; aimLine = null; anchorKnot = null; webMaterial = null; } private void OnWebStageChanged(byte previous, byte current) { if (current != previous && current != 0) { ChaosPresentation.TriggerAction((Component)(object)this); } RefreshLocalRestriction(); if (current < 2) { RemoveVoiceMuffle(); } } private void OnVictimChanged(ulong previous, ulong current) { RefreshLocalRestriction(); if (current == 0L) { RemoveVoiceMuffle(); } } private void OnAnchorChanged(Vector3 previous, Vector3 current) { UpdateLocalWebPresentation(); } private void OnShotRevisionChanged(uint previous, uint current) { if (current != previous) { ChaosPresentation.TriggerAction((Component)(object)this); if (Object.op_Implicit((Object)(object)base.creatureVoice) && Object.op_Implicit((Object)(object)base.creatureVoice.clip)) { base.creatureVoice.PlayOneShot(base.creatureVoice.clip); } } } private void OnSpiderEmployeeChanged(bool previous, bool current) { RefreshMinionPresentation(); } private void RefreshMinionPresentation() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) GameObject val = visualInstance; if (val != null && Object.op_Implicit((Object)(object)val)) { val.transform.localScale = (IsSpiderEmployee ? (Vector3.one * 0.72f) : Vector3.one); } } private void RefreshVoiceMuffle(PlayerControllerB target) { AudioSource currentVoiceChatAudioSource = target.currentVoiceChatAudioSource; if ((int)VictimStage < 2 || currentVoiceChatAudioSource == null || !Object.op_Implicit((Object)(object)currentVoiceChatAudioSource)) { RemoveVoiceMuffle(); return; } AudioLowPassFilter val = voiceMuffle; if (val == null || !Object.op_Implicit((Object)(object)val) || !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)currentVoiceChatAudioSource).gameObject)) { RemoveVoiceMuffle(); voiceMuffle = ((Component)currentVoiceChatAudioSource).gameObject.AddComponent(); voiceMuffle.cutoffFrequency = 900f; voiceMuffle.lowpassResonanceQ = 1.1f; } } private void RemoveVoiceMuffle() { AudioLowPassFilter val = voiceMuffle; if (val != null && Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } voiceMuffle = null; } private static PlayerControllerB? FindPlayerByOwner(ulong ownerClientId) { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null) { return null; } for (int i = 0; i < array.Length; i++) { if (Object.op_Implicit((Object)(object)array[i]) && ((NetworkBehaviour)array[i]).OwnerClientId == ownerClientId) { return array[i]; } } return null; } private static PlayerControllerB? FindPlayerByToken(ulong token) { if (token == 0L) { return null; } PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null) { return null; } ulong num = token - 1; for (int i = 0; i < array.Length; i++) { if (Object.op_Implicit((Object)(object)array[i]) && array[i].playerClientId == num) { return array[i]; } } return null; } private static bool HasLineOfSight(Component source, PlayerControllerB target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = source.transform.position + Vector3.up; Vector3 val2 = ((Component)target).transform.position + Vector3.up; RaycastHit val3 = default(RaycastHit); if (Physics.Linecast(val, val2, ref val3, -1, (QueryTriggerInteraction)1)) { return (Object)(object)((Component)((RaycastHit)(ref val3)).collider).GetComponentInParent() == (Object)(object)target; } return true; } private static bool HasLineOfSight(Component source, Vector3 target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_003b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = source.transform.position + Vector3.up * 1.2f; Vector3 val2 = target - val; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude <= 0.05f)) { return !Physics.Raycast(val, val2 / magnitude, magnitude, -1, (QueryTriggerInteraction)1); } return true; } private static bool RoundEnding() { if (Object.op_Implicit((Object)(object)StartOfRound.Instance) && !StartOfRound.Instance.shipIsLeaving) { return StartOfRound.Instance.inShipPhase; } return true; } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3010056802u, new RpcReceiveHandler(__rpc_handler_3010056802), "RequestCutWebServerRpc"); ((NetworkBehaviour)this).__registerRpc(2277259762u, new RpcReceiveHandler(__rpc_handler_2277259762), "RequestAnchorHitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1710922175u, new RpcReceiveHandler(__rpc_handler_1710922175), "TelegraphShotClientRpc"); ((NetworkBehaviour)this).__registerRpc(300530035u, new RpcReceiveHandler(__rpc_handler_300530035), "ApplyCocoonFatalOutcomeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1584528627u, new RpcReceiveHandler(__rpc_handler_1584528627), "AcknowledgeCocoonFatalOutcomeServerRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3010056802(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_003d: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong expectedVictimId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref expectedVictimId); uint expectedRevision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref expectedRevision); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((WebheadEnemyAI)(object)target).RequestCutWebServerRpc(expectedVictimId, expectedRevision, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2277259762(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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong claimedPlayer = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref claimedPlayer); uint sequence = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref sequence); ulong expectedVictimId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref expectedVictimId); uint expectedRevision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref expectedRevision); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((WebheadEnemyAI)(object)target).RequestAnchorHitServerRpc(claimedPlayer, sequence, expectedVictimId, expectedRevision, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1710922175(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; ((WebheadEnemyAI)(object)target).TelegraphShotClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_300530035(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_003d: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong targetClient = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref targetClient); uint outcomeRevision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref outcomeRevision); ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((WebheadEnemyAI)(object)target).ApplyCocoonFatalOutcomeClientRpc(targetClient, outcomeRevision, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1584528627(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_0031: 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_0040: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { uint outcomeRevision = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref outcomeRevision); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((WebheadEnemyAI)(object)target).AcknowledgeCocoonFatalOutcomeServerRpc(outcomeRevision, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "WebheadEnemyAI"; } } internal sealed class WebAnchorHitProxy : MonoBehaviour, IHittable { private WebheadEnemyAI? owner; internal void Initialize(WebheadEnemyAI webhead) { owner = webhead; } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB? playerWhoHit, bool playHitSFX = false, int hitID = -1) { if (force <= 0 || (Object)(object)playerWhoHit == (Object)null || (Object)(object)owner == (Object)null || !Object.op_Implicit((Object)(object)owner)) { return false; } owner.HitAnchor(playerWhoHit); return true; } } } namespace System.Runtime.CompilerServices { internal static class IsExternalInit { } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace ChaosSuite.Webhead.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }