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.NewtonsApple.NetcodePatcher; using ChaosSuite.Runtime; using GameNetcodeStuff; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [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.NewtonsApple")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a3464fa3098fa6be253d588a5b7ca9ba01bef4dd")] [assembly: AssemblyProduct("ChaosSuite.NewtonsApple")] [assembly: AssemblyTitle("ChaosSuite.NewtonsApple")] [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.NewtonsApple { public enum ApplePhase : byte { Dormant, Telegraph, Shift, Travel, Stunned, Recovering, Dead } public enum GravityDirection : byte { Floor, Ceiling, Left, Right, Forward, Rear } public readonly record struct AxisVector(float X, float Y, float Z) { public static AxisVector operator +(AxisVector left, AxisVector right) { return new AxisVector(left.X + right.X, left.Y + right.Y, left.Z + right.Z); } } public readonly record struct AppleMassSample(GravityDirection Direction, float Mass, bool Valid); public readonly record struct AppleState(ApplePhase Phase, GravityDirection Direction, double PhaseEndsAt, byte Impacts, uint Revision); public readonly record struct AppleTuning(double TelegraphSeconds, double ShiftSeconds, double StunSeconds, double RecoverySeconds) { public static AppleTuning Default => new AppleTuning(2.0, 6.0, 4.0, 2.0); public AppleTuning Validated() { return new AppleTuning(Math.Clamp(TelegraphSeconds, 0.5, 5.0), Math.Clamp(ShiftSeconds, 0.5, 15.0), Math.Clamp(StunSeconds, 0.5, 15.0), Math.Clamp(RecoverySeconds, 0.25, 10.0)); } } public static class AppleDirectionSelector { public static GravityDirection Select(IReadOnlyList samples, GravityDirection fallback, AxisVector impactBias) { Span span = stackalloc float[6]; foreach (AppleMassSample sample in samples) { if (sample.Valid && sample.Mass > 0f) { span[(int)sample.Direction] += sample.Mass; } } span[(int)FromAxis(impactBias, fallback)] += Magnitude(impactBias) * 2f; GravityDirection result = fallback; float num = span[(int)fallback]; for (int i = 0; i < span.Length; i++) { if (!(span[i] <= num)) { num = span[i]; result = (GravityDirection)i; } } return result; } public static GravityDirection FromAxis(AxisVector vector, GravityDirection fallback) { float num = Math.Abs(vector.X); float num2 = Math.Abs(vector.Y); float num3 = Math.Abs(vector.Z); if (num <= float.Epsilon && num2 <= float.Epsilon && num3 <= float.Epsilon) { return fallback; } if (num2 >= num && num2 >= num3) { if (!(vector.Y >= 0f)) { return GravityDirection.Floor; } return GravityDirection.Ceiling; } if (num >= num3) { if (!(vector.X >= 0f)) { return GravityDirection.Left; } return GravityDirection.Right; } if (!(vector.Z >= 0f)) { return GravityDirection.Rear; } return GravityDirection.Forward; } private static float Magnitude(AxisVector value) { return MathF.Sqrt(value.X * value.X + value.Y * value.Y + value.Z * value.Z); } } public sealed class AppleController { private readonly AppleTuning tuning; private AxisVector accumulatedImpacts; private double gravityEndsAt; public AppleState State { get; private set; } = new AppleState(ApplePhase.Dormant, GravityDirection.Floor, 0.0, 0, 0u); public AxisVector ImpactBias => accumulatedImpacts; public double GravityEndsAt => gravityEndsAt; public AppleController(AppleTuning? tuning = null) { this.tuning = (tuning ?? AppleTuning.Default).Validated(); } public bool BeginTelegraph(GravityDirection direction, double now) { ApplePhase phase = State.Phase; if ((phase != ApplePhase.Dormant && phase != ApplePhase.Travel) || 1 == 0) { return false; } State = new AppleState(ApplePhase.Telegraph, direction, now + tuning.TelegraphSeconds, State.Impacts, State.Revision + 1); return true; } public bool Advance(double now) { AppleState state = State; AppleState state2; switch (State.Phase) { case ApplePhase.Telegraph: if (now >= State.PhaseEndsAt) { state2 = BeginShift(now); break; } goto default; case ApplePhase.Shift: if (now >= State.PhaseEndsAt) { state2 = State with { Phase = ApplePhase.Travel, PhaseEndsAt = gravityEndsAt, Revision = State.Revision + 1 }; break; } goto default; case ApplePhase.Travel: if (now >= State.PhaseEndsAt) { state2 = State with { Phase = ApplePhase.Stunned, PhaseEndsAt = now + tuning.StunSeconds, Revision = State.Revision + 1 }; break; } goto default; case ApplePhase.Stunned: if (now >= State.PhaseEndsAt) { state2 = State with { Phase = ApplePhase.Recovering, PhaseEndsAt = now + tuning.RecoverySeconds, Revision = State.Revision + 1 }; break; } goto default; case ApplePhase.Recovering: if (now >= State.PhaseEndsAt) { state2 = State with { Phase = ApplePhase.Dormant, Revision = State.Revision + 1 }; break; } goto default; default: state2 = State; break; } State = state2; return state != State; } public bool RegisterStunImpact(AxisVector direction) { if (State.Phase != ApplePhase.Stunned) { return false; } accumulatedImpacts += direction; State = State with { Impacts = (byte)Math.Min(3, State.Impacts + 1), Revision = State.Revision + 1 }; return true; } public bool Impact(double now) { ApplePhase phase = State.Phase; if (phase - 2 > ApplePhase.Telegraph) { return false; } State = State with { Phase = ApplePhase.Stunned, PhaseEndsAt = now + tuning.StunSeconds, Revision = State.Revision + 1 }; return true; } public AxisVector ConsumeImpactBias() { if (State.Impacts < 3) { return default(AxisVector); } AxisVector result = accumulatedImpacts; accumulatedImpacts = default(AxisVector); State = State with { Impacts = 0, Revision = State.Revision + 1 }; return result; } public void Kill() { State = State with { Phase = ApplePhase.Dead, PhaseEndsAt = 0.0, Revision = State.Revision + 1 }; } public void Reset() { accumulatedImpacts = default(AxisVector); gravityEndsAt = 0.0; State = new AppleState(ApplePhase.Dormant, GravityDirection.Floor, 0.0, 0, State.Revision + 1); } private AppleState BeginShift(double now) { gravityEndsAt = now + tuning.ShiftSeconds; double num = Math.Min(0.75, Math.Max(0.1, tuning.ShiftSeconds / 3.0)); return State with { Phase = ApplePhase.Shift, PhaseEndsAt = now + num, Revision = State.Revision + 1 }; } } public sealed class NewtonsAppleEnemy : EnemyAI, IHittable { private const int OverlapCapacity = 64; private readonly Collider[] overlap = (Collider[])(object)new Collider[64]; private readonly int[] seenBodies = new int[64]; private readonly List massSamples = new List(64); private readonly AppleController controller = new AppleController(); private readonly Dictionary lastHitSequence = new Dictionary(); private readonly Dictionary nextHitAt = new Dictionary(); private readonly HashSet cleanupAffectedOwners = new HashSet(); private readonly NetworkVariable phase = new NetworkVariable((byte)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable gravityDirection = new NetworkVariable((byte)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable phaseEndsAt = new NetworkVariable(0.0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable gravityEndsAt = new NetworkVariable(0.0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable revision = new NetworkVariable(0u, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private readonly NetworkVariable coreExposed = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private double nextGravityTick; private int seenBodyCount; private GameObject? directionIndicator; private Transform? authoredCore; private bool localGravityActive; private Vector3 localGravity; private double localGravityEndsAt; private uint localHitSequence; private bool roundEndingHandled; [Header("Authored prefab references")] [SerializeField] private BoxCollider influenceVolume; [SerializeField] private Transform stem; [SerializeField] private GameObject blackCorePrefab; [SerializeField] [Min(1f)] private float gravityAcceleration = 16f; [SerializeField] [Min(0.2f)] private float gravityTickSeconds = 0.2f; [SerializeField] [Min(0.5f)] private float travelSpeed = 4.5f; public override void Start() { ((EnemyAI)this).Start(); base.AIIntervalTime = 0.2f; if ((Object)(object)((Component)this).GetComponentInChildren(true) == (Object)null && (Object)(object)NewtonsApplePlugin.VisualPrefab != (Object)null) { Object.Instantiate(NewtonsApplePlugin.VisualPrefab, ((Component)this).transform, false); } authoredCore = FindNamed(((Component)this).transform, "BlackCore") ?? FindNamed(((Component)this).transform, "Core"); CreateDirectionIndicator(); SetCoreExposed(coreExposed.Value); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); RegisterPersistentCleanup(); NetworkVariable obj = phase; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityStateChanged)); NetworkVariable obj2 = gravityDirection; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityDirectionChanged)); NetworkVariable obj3 = gravityEndsAt; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityDeadlineChanged)); RefreshLocalGravity(); } public override void DoAIInterval() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (!((NetworkBehaviour)this).IsServer || base.isEnemyDead || (Object)(object)influenceVolume == (Object)null) { return; } if (RoundEnding()) { if (!roundEndingHandled) { roundEndingHandled = true; CleanupPersistentEffect(); } return; } roundEndingHandled = false; NetworkTime serverTime = ((NetworkBehaviour)this).NetworkManager.ServerTime; double time = ((NetworkTime)(ref serverTime)).Time; if (controller.Advance(time)) { PublishState(); if (controller.State.Phase == ApplePhase.Shift) { ShiftPresentationClientRpc(); BeginPlayerGravity(DirectionVector(controller.State.Direction)); if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).enabled) { ((Behaviour)base.agent).enabled = false; } } else if (controller.State.Phase == ApplePhase.Stunned) { ClearPlayerGravity(); HideDirectionClientRpc(); ReattachAgent(); } if (controller.State.Phase == ApplePhase.Stunned) { ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1, "apple impact stun"); } } } if (controller.State.Phase == ApplePhase.Dormant) { ChaosSuiteRuntimePlugin instance2 = ChaosSuiteRuntimePlugin.Instance; if (instance2 == null || !instance2.ThreatBudget.TryAcquire(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1)) { return; } GravityDirection direction = SelectDirection(); if (controller.BeginTelegraph(direction, time)) { PublishState(); TelegraphDirectionClientRpc((byte)direction); PlayMechanicClientRpc(); } } ApplePhase applePhase = controller.State.Phase; bool flag = applePhase - 2 <= ApplePhase.Telegraph; if (flag && time >= nextGravityTick) { nextGravityTick = time + (double)gravityTickSeconds; ApplyRigidBodyGravity(DirectionVector(controller.State.Direction)); } if (controller.State.Phase == ApplePhase.Travel) { MoveApple(DirectionVector(controller.State.Direction), time); } } public override void Update() { //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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!localGravityActive) { RefreshLocalGravity(); } if (!localGravityActive) { return; } PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val == (Object)null) && !val.isPlayerDead && !val.disconnectedMidGame && !val.isClimbingLadder && !val.teleportedLastFrame && !val.isInHangarShipRoom && !((Object)(object)StartOfRound.Instance == (Object)null) && !StartOfRound.Instance.shipIsLeaving && !StartOfRound.Instance.inShipPhase && !((Object)(object)NetworkManager.Singleton == (Object)null)) { NetworkTime serverTime = NetworkManager.Singleton.ServerTime; if (!(((NetworkTime)(ref serverTime)).Time >= localGravityEndsAt) && IsInsideInfluence(((Component)val).transform.position)) { val.externalForces += localGravity * Time.deltaTime; return; } } localGravityActive = false; } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //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) if (((NetworkBehaviour)this).IsServer && !((Object)(object)playerWhoHit == (Object)null)) { NetworkTime serverTime = ((NetworkBehaviour)this).NetworkManager.ServerTime; if (TryAuthorizeStemHit(playerWhoHit, ((NetworkTime)(ref serverTime)).Time)) { RegisterAuthorizedStemImpact(playerWhoHit); } } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB? playerWhoHit, bool playHitSFX, int hitID) { //IL_004b: 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) if (((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); } else if ((Object)(object)playerWhoHit != (Object)null) { localHitSequence++; if (localHitSequence == 0) { localHitSequence = 1u; } RegisterStemHitServerRpc(((NetworkBehaviour)playerWhoHit).OwnerClientId, localHitSequence); } return phase.Value == 4; } [ServerRpc(RequireOwnership = false)] private void RegisterStemHitServerRpc(ulong claimedPlayer, uint sequence, 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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(1609497886u, rpc, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, claimedPlayer); BytePacker.WriteValueBitPacked(val, sequence); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1609497886u, 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 || RoundEnding() || rpc.Receive.SenderClientId != claimedPlayer || sequence == 0 || (lastHitSequence.TryGetValue(claimedPlayer, out var value) && sequence <= value)) { return; } PlayerControllerB val2 = FindPlayer(claimedPlayer); if (!((Object)(object)val2 == (Object)null)) { NetworkTime serverTime = ((NetworkBehaviour)this).NetworkManager.ServerTime; if (TryAuthorizeStemHit(val2, ((NetworkTime)(ref serverTime)).Time)) { lastHitSequence[claimedPlayer] = sequence; RegisterAuthorizedStemImpact(val2); } } } public override void KillEnemy(bool destroy = false) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead) { return; } if (((NetworkBehaviour)this).IsServer && (Object)(object)blackCorePrefab != (Object)null) { NetworkObject component = Object.Instantiate(blackCorePrefab, ((Component)this).transform.position, Quaternion.identity).GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(true); } } controller.Kill(); lastHitSequence.Clear(); nextHitAt.Clear(); ClearPlayerGravity(); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1, "apple killed"); } ((EnemyAI)this).KillEnemy(destroy); } public override void OnNetworkDespawn() { localGravityActive = false; roundEndingHandled = false; NetworkVariable obj = phase; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityStateChanged)); NetworkVariable obj2 = gravityDirection; obj2.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityDirectionChanged)); NetworkVariable obj3 = gravityEndsAt; obj3.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj3.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnGravityDeadlineChanged)); lastHitSequence.Clear(); nextHitAt.Clear(); if (((NetworkBehaviour)this).IsServer) { ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1, "apple despawned"); } } ((NetworkBehaviour)this).OnNetworkDespawn(); } private void OnDisable() { localGravityActive = false; } private bool TryAuthorizeStemHit(PlayerControllerB player, double now) { //IL_0064: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00d3: 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_00f8: Unknown result type (might be due to invalid IL or missing references) if (controller.State.Phase != ApplePhase.Stunned || player.isPlayerDead || player.disconnectedMidGame || (!(player.currentlyHeldObjectServer is Shovel) && !(player.currentlyHeldObjectServer is KnifeItem))) { return false; } Vector3 val = (((Object)(object)stem != (Object)null) ? stem.position : ((Component)this).transform.position); if (Vector3.SqrMagnitude(((Component)player).transform.position - val) > 16f) { return false; } if (nextHitAt.TryGetValue(((NetworkBehaviour)player).OwnerClientId, out var value) && now < value) { return false; } Vector3 val2 = ((Component)player).transform.position + Vector3.up * 1.2f + ((Component)player).transform.forward * 0.35f; int num = (((Object)(object)StartOfRound.Instance != (Object)null) ? StartOfRound.Instance.collidersAndRoomMaskAndDefault : (-1)); RaycastHit val3 = default(RaycastHit); if (Physics.Linecast(val2, val, ref val3, num, (QueryTriggerInteraction)1) && (Object)(object)((RaycastHit)(ref val3)).transform != (Object)(object)((Component)this).transform && !((RaycastHit)(ref val3)).transform.IsChildOf(((Component)this).transform)) { return false; } nextHitAt[((NetworkBehaviour)player).OwnerClientId] = now + 0.18; return true; } private GravityDirection SelectDirection() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_003d: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) massSamples.Clear(); seenBodyCount = 0; Bounds bounds = ((Collider)influenceVolume).bounds; int num = Physics.OverlapBoxNonAlloc(((Bounds)(ref bounds)).center, ((Bounds)(ref bounds)).extents, overlap, ((Component)influenceVolume).transform.rotation, -1, (QueryTriggerInteraction)1); for (int i = 0; i < num; i++) { Collider val = overlap[i]; if ((Object)(object)val == (Object)null || ((Component)val).transform.IsChildOf(((Component)this).transform)) { continue; } PlayerControllerB componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { if (!componentInParent.isPlayerDead && !componentInParent.isInHangarShipRoom && TryRemember(((Object)componentInParent).GetInstanceID())) { massSamples.Add(new AppleMassSample(ToDirection(((Component)componentInParent).transform.position - ((Bounds)(ref bounds)).center), Mathf.Max(1f, componentInParent.carryWeight), Valid: true)); } continue; } Rigidbody attachedRigidbody = val.attachedRigidbody; if (!((Object)(object)attachedRigidbody == (Object)null) && !attachedRigidbody.isKinematic && TryRemember(((Object)attachedRigidbody).GetInstanceID())) { massSamples.Add(new AppleMassSample(ToDirection(attachedRigidbody.worldCenterOfMass - ((Bounds)(ref bounds)).center), Mathf.Clamp(attachedRigidbody.mass, 0.1f, 50f), Valid: true)); } } AxisVector impactBias = controller.ConsumeImpactBias(); return AppleDirectionSelector.Select(massSamples, GravityDirection.Floor, impactBias); } private void BeginPlayerGravity(Vector3 direction) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) DisassociateGravityOwners(); Bounds bounds = ((Collider)influenceVolume).bounds; int num = Physics.OverlapBoxNonAlloc(((Bounds)(ref bounds)).center, ((Bounds)(ref bounds)).extents, overlap, ((Component)influenceVolume).transform.rotation, -1, (QueryTriggerInteraction)1); ulong[] array = new ulong[StartOfRound.Instance.allPlayerScripts.Length]; int num2 = 0; for (int i = 0; i < num; i++) { Collider val = overlap[i]; if (!((Object)(object)val == (Object)null) && !((Component)val).transform.IsChildOf(((Component)this).transform)) { PlayerControllerB componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && !componentInParent.isPlayerDead && !componentInParent.isInHangarShipRoom && !Contains(array, num2, ((NetworkBehaviour)componentInParent).OwnerClientId)) { array[num2++] = ((NetworkBehaviour)componentInParent).OwnerClientId; } } } if (num2 == 0) { return; } if (num2 != array.Length) { Array.Resize(ref array, num2); } ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; EffectCleanupRegistry val2 = ((instance != null) ? instance.Cleanup : null); EntityId val3 = default(EntityId); ((EntityId)(ref val3))..ctor(((NetworkBehaviour)this).NetworkObjectId); for (int j = 0; j < array.Length; j++) { if (val2 != null) { val2.AssociateAffectedOwner(val3, array[j]); } cleanupAffectedOwners.Add(array[j]); } ApplyGravityClientRpc(array, direction, gravityAcceleration, controller.GravityEndsAt); } private void ApplyRigidBodyGravity(Vector3 direction) { //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_000e: 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_002b: 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_0093: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = ((Collider)influenceVolume).bounds; int num = Physics.OverlapBoxNonAlloc(((Bounds)(ref bounds)).center, ((Bounds)(ref bounds)).extents, overlap, ((Component)influenceVolume).transform.rotation, -1, (QueryTriggerInteraction)1); for (int i = 0; i < num; i++) { Collider val = overlap[i]; if (!((Object)(object)val == (Object)null) && !((Component)val).transform.IsChildOf(((Component)this).transform) && !((Object)(object)((Component)val).GetComponentInParent() != (Object)null)) { Rigidbody attachedRigidbody = val.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null && !attachedRigidbody.isKinematic) { attachedRigidbody.AddForce(direction * gravityAcceleration, (ForceMode)5); } } } } [ClientRpc] private void ApplyGravityClientRpc(ulong[] affectedClients, Vector3 direction, float acceleration, double endsAt) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014f: 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_00db: 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) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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(1688451801u, val2, (RpcDelivery)0); bool flag = affectedClients != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(affectedClients, default(ForPrimitives)); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val)).WriteValueSafe(ref acceleration, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref endsAt, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1688451801u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((Object)(object)NetworkManager.Singleton == (Object)null) && Contains(affectedClients, affectedClients.Length, NetworkManager.Singleton.LocalClientId)) { PlayerControllerB val3 = GameNetworkManager.Instance?.localPlayerController; if (!((Object)(object)val3 == (Object)null) && !val3.isInHangarShipRoom) { localGravity = direction * Mathf.Clamp(acceleration, 0f, 30f); localGravityEndsAt = endsAt; localGravityActive = true; } } } [ClientRpc] private void ClearGravityClientRpc() { //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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(316672261u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 316672261u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; localGravityActive = false; } } } 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() { localGravityActive = false; if (((NetworkBehaviour)this).IsServer) { roundEndingHandled = true; ClearGravityClientRpc(); HideDirectionClientRpc(); DisassociateGravityOwners(); controller.Reset(); PublishState(); ReattachAgent(); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1, "apple persistent cleanup"); } } } private void ClearPlayerGravity() { localGravityActive = false; if (((NetworkBehaviour)this).IsServer) { ClearGravityClientRpc(); DisassociateGravityOwners(); } } private void DisassociateGravityOwners() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (cleanupAffectedOwners.Count == 0) { return; } ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; EffectCleanupRegistry val = ((instance != null) ? instance.Cleanup : null); EntityId val2 = default(EntityId); ((EntityId)(ref val2))..ctor(((NetworkBehaviour)this).NetworkObjectId); foreach (ulong cleanupAffectedOwner in cleanupAffectedOwners) { if (val != null) { val.DisassociateAffectedOwner(val2, cleanupAffectedOwner); } } cleanupAffectedOwners.Clear(); } [ClientRpc] private void PlayMechanicClientRpc() { //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(2147994083u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2147994083u, 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.creatureVoice != (Object)null && (Object)(object)NewtonsApplePlugin.MechanicClip != (Object)null) { base.creatureVoice.PlayOneShot(NewtonsApplePlugin.MechanicClip); } } } [ClientRpc] private void ShiftPresentationClientRpc() { //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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(317251569u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 317251569u, 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); } } } [ClientRpc] private void TelegraphDirectionClientRpc(byte direction) { //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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) 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(2232205684u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref direction, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2232205684u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val3 = DirectionVector((GravityDirection)Mathf.Clamp((int)direction, 0, 5)); if ((Object)(object)directionIndicator == (Object)null) { CreateDirectionIndicator(); } if (!((Object)(object)directionIndicator == (Object)null)) { directionIndicator.transform.rotation = Quaternion.FromToRotation(Vector3.up, val3); directionIndicator.SetActive(true); } } } [ClientRpc] private void HideDirectionClientRpc() { //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(352819245u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 352819245u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)directionIndicator != (Object)null) { directionIndicator.SetActive(false); } } } [ClientRpc] private void ExposeCoreClientRpc() { //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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3678215996u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3678215996u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetCoreExposed(exposed: true); ChaosPresentation.TriggerAction((Component)(object)this); } } } private void PublishState() { phase.Value = (byte)controller.State.Phase; gravityDirection.Value = (byte)controller.State.Direction; phaseEndsAt.Value = controller.State.PhaseEndsAt; gravityEndsAt.Value = controller.GravityEndsAt; revision.Value = controller.State.Revision; } private void RefreshLocalGravity() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00c2: 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) ApplePhase value = (ApplePhase)phase.Value; NetworkManager singleton = NetworkManager.Singleton; PlayerControllerB val = GameNetworkManager.Instance?.localPlayerController; bool flag = value - 2 <= ApplePhase.Telegraph; if (flag && !((Object)(object)singleton == (Object)null) && !((Object)(object)val == (Object)null) && !val.isPlayerDead && !val.disconnectedMidGame && !val.isInHangarShipRoom) { NetworkTime serverTime = singleton.ServerTime; if (!(((NetworkTime)(ref serverTime)).Time >= gravityEndsAt.Value) && IsInsideInfluence(((Component)val).transform.position)) { localGravity = DirectionVector((GravityDirection)Mathf.Clamp((int)gravityDirection.Value, 0, 5)) * Mathf.Clamp(gravityAcceleration, 0f, 30f); localGravityEndsAt = gravityEndsAt.Value; localGravityActive = true; return; } } localGravityActive = false; } private bool IsInsideInfluence(Vector3 position) { //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_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)influenceVolume == (Object)null || !((Collider)influenceVolume).enabled) { return false; } return Vector3.SqrMagnitude(((Collider)influenceVolume).ClosestPoint(position) - position) <= 0.0001f; } private void OnGravityStateChanged(byte previous, byte current) { RefreshLocalGravity(); } private void OnGravityDirectionChanged(byte previous, byte current) { RefreshLocalGravity(); } private void OnGravityDeadlineChanged(double previous, double current) { RefreshLocalGravity(); } private static bool Contains(ulong[] values, int count, ulong target) { for (int i = 0; i < count; i++) { if (values[i] == target) { return true; } } return false; } private void RegisterAuthorizedStemImpact(PlayerControllerB player) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (coreExposed.Value) { ((EnemyAI)this).HitEnemy(10, player, true, -1); return; } Vector3 val = ((Component)this).transform.position - ((Component)player).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; if (controller.RegisterStunImpact(new AxisVector(normalized.x, normalized.y, normalized.z))) { if (controller.State.Impacts >= 3) { coreExposed.Value = true; ExposeCoreClientRpc(); } PublishState(); } } private void MoveApple(Vector3 direction, double now) { //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_001a: 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_00b0: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = travelSpeed * base.AIIntervalTime; Vector3 position = ((Component)this).transform.position; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(position, 0.62f, direction, ref val, num, -1, (QueryTriggerInteraction)1) && !((RaycastHit)(ref val)).transform.IsChildOf(((Component)this).transform)) { ((Component)this).transform.position = ((RaycastHit)(ref val)).point - direction * 0.62f; if (controller.Impact(now)) { PublishState(); ClearPlayerGravity(); HideDirectionClientRpc(); ReattachAgent(); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; if (instance != null) { instance.ThreatBudget.Release(((NetworkBehaviour)this).NetworkObject, (SystemicThreatKind)1, "apple collided"); } } } else { ((Component)this).transform.position = position + direction * num; } } private void ReattachAgent() { //IL_0022: 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_005d: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if (!((Object)(object)base.agent == (Object)null) && !((Behaviour)base.agent).enabled && NavMesh.SamplePosition(((Component)this).transform.position, ref val, 3f, -1)) { ((Component)this).transform.position = ((NavMeshHit)(ref val)).position; ((Behaviour)base.agent).enabled = true; base.agent.Warp(((NavMeshHit)(ref val)).position); } } private bool TryRemember(int instanceId) { for (int i = 0; i < seenBodyCount; i++) { if (seenBodies[i] == instanceId) { return false; } } if (seenBodyCount >= seenBodies.Length) { return false; } seenBodies[seenBodyCount++] = instanceId; return true; } private void CreateDirectionIndicator() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0041: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_0092: 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_009e: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f5: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //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_013d: 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_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 (!((Object)(object)directionIndicator != (Object)null)) { directionIndicator = new GameObject("GravityDirectionIndicator"); directionIndicator.transform.SetParent(((Component)this).transform, false); directionIndicator.transform.localPosition = Vector3.up * 1.15f; Material material = new Material(Shader.Find("Sprites/Default")) { color = new Color(0.72f, 0.18f, 0.09f, 0.95f) }; CreateIndicatorLine("Shaft", (Vector3[])(object)new Vector3[2] { Vector3.zero, Vector3.up * 0.9f }, material); CreateIndicatorLine("HeadLeft", (Vector3[])(object)new Vector3[2] { Vector3.up * 0.9f, Vector3.up * 0.62f + Vector3.left * 0.2f }, material); CreateIndicatorLine("HeadRight", (Vector3[])(object)new Vector3[2] { Vector3.up * 0.9f, Vector3.up * 0.62f + Vector3.right * 0.2f }, material); directionIndicator.SetActive(false); } } private void CreateIndicatorLine(string name, Vector3[] points, Material material) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(directionIndicator.transform, false); LineRenderer obj = val.AddComponent(); obj.useWorldSpace = false; ((Renderer)obj).sharedMaterial = material; obj.widthMultiplier = 0.065f; obj.positionCount = points.Length; obj.SetPositions(points); obj.numCapVertices = 2; } private void SetCoreExposed(bool exposed) { //IL_001e: 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_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)authoredCore != (Object)null) { authoredCore.localScale = (exposed ? (Vector3.one * 1.22f) : Vector3.one); } } private static Transform? FindNamed(Transform root, string fragment) { Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)componentsInChildren[i]).name.Contains(fragment, StringComparison.OrdinalIgnoreCase)) { return componentsInChildren[i]; } } return null; } private static PlayerControllerB? FindPlayer(ulong clientId) { PlayerControllerB[] array = StartOfRound.Instance?.allPlayerScripts; if (array == null) { return null; } for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && ((NetworkBehaviour)array[i]).OwnerClientId == clientId) { return array[i]; } } return null; } private static GravityDirection ToDirection(Vector3 offset) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return AppleDirectionSelector.FromAxis(new AxisVector(offset.x, offset.y, offset.z), GravityDirection.Floor); } private static bool RoundEnding() { if (Object.op_Implicit((Object)(object)StartOfRound.Instance) && !StartOfRound.Instance.shipIsLeaving) { return StartOfRound.Instance.inShipPhase; } return true; } private static Vector3 DirectionVector(GravityDirection direction) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //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_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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(direction switch { GravityDirection.Floor => Vector3.down, GravityDirection.Ceiling => Vector3.up, GravityDirection.Left => Vector3.left, GravityDirection.Right => Vector3.right, GravityDirection.Forward => Vector3.forward, GravityDirection.Rear => Vector3.back, _ => Vector3.down, }); } protected override void __initializeVariables() { if (phase == null) { throw new Exception("NewtonsAppleEnemy.phase cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)phase).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)phase, "phase"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)phase); if (gravityDirection == null) { throw new Exception("NewtonsAppleEnemy.gravityDirection cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)gravityDirection).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)gravityDirection, "gravityDirection"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)gravityDirection); if (phaseEndsAt == null) { throw new Exception("NewtonsAppleEnemy.phaseEndsAt cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)phaseEndsAt).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)phaseEndsAt, "phaseEndsAt"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)phaseEndsAt); if (gravityEndsAt == null) { throw new Exception("NewtonsAppleEnemy.gravityEndsAt cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)gravityEndsAt).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)gravityEndsAt, "gravityEndsAt"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)gravityEndsAt); if (revision == null) { throw new Exception("NewtonsAppleEnemy.revision cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)revision).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)revision, "revision"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)revision); if (coreExposed == null) { throw new Exception("NewtonsAppleEnemy.coreExposed cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)coreExposed).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)coreExposed, "coreExposed"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)coreExposed); ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1609497886u, new RpcReceiveHandler(__rpc_handler_1609497886), "RegisterStemHitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1688451801u, new RpcReceiveHandler(__rpc_handler_1688451801), "ApplyGravityClientRpc"); ((NetworkBehaviour)this).__registerRpc(316672261u, new RpcReceiveHandler(__rpc_handler_316672261), "ClearGravityClientRpc"); ((NetworkBehaviour)this).__registerRpc(2147994083u, new RpcReceiveHandler(__rpc_handler_2147994083), "PlayMechanicClientRpc"); ((NetworkBehaviour)this).__registerRpc(317251569u, new RpcReceiveHandler(__rpc_handler_317251569), "ShiftPresentationClientRpc"); ((NetworkBehaviour)this).__registerRpc(2232205684u, new RpcReceiveHandler(__rpc_handler_2232205684), "TelegraphDirectionClientRpc"); ((NetworkBehaviour)this).__registerRpc(352819245u, new RpcReceiveHandler(__rpc_handler_352819245), "HideDirectionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3678215996u, new RpcReceiveHandler(__rpc_handler_3678215996), "ExposeCoreClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1609497886(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 claimedPlayer = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref claimedPlayer); uint sequence = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref sequence); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((NewtonsAppleEnemy)(object)target).RegisterStemHitServerRpc(claimedPlayer, sequence, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1688451801(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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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(ref flag, default(ForPrimitives)); ulong[] affectedClients = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref affectedClients, default(ForPrimitives)); } Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); float acceleration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref acceleration, default(ForPrimitives)); double endsAt = default(double); ((FastBufferReader)(ref reader)).ReadValueSafe(ref endsAt, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NewtonsAppleEnemy)(object)target).ApplyGravityClientRpc(affectedClients, direction, acceleration, endsAt); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_316672261(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; ((NewtonsAppleEnemy)(object)target).ClearGravityClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2147994083(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; ((NewtonsAppleEnemy)(object)target).PlayMechanicClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_317251569(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; ((NewtonsAppleEnemy)(object)target).ShiftPresentationClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2232205684(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_0044: 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) { byte direction = default(byte); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NewtonsAppleEnemy)(object)target).TelegraphDirectionClientRpc(direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_352819245(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; ((NewtonsAppleEnemy)(object)target).HideDirectionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3678215996(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; ((NewtonsAppleEnemy)(object)target).ExposeCoreClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NewtonsAppleEnemy"; } } [BepInPlugin("com.chaossuite.newtonsapple", "Newton's Apple", "0.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class NewtonsApplePlugin : BaseUnityPlugin { public const string PluginGuid = "com.chaossuite.newtonsapple"; public const string PluginName = "Newton's Apple"; public const string PluginVersion = "0.2.0"; private static bool netcodeInitialized; internal static NewtonsApplePlugin Instance { get; private set; } internal static GameObject? VisualPrefab { get; private set; } internal static AudioClip? MechanicClip { get; private set; } private void Awake() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) Instance = this; InitializeGeneratedNetcode(); ChaosSuiteRuntimePlugin instance = ChaosSuiteRuntimePlugin.Instance; AssetBundleRegistry val = ((instance != null) ? instance.Assets : null); string text = ChaosAssetPaths.BundleName("NewtonsApple"); AssetBundle val2 = default(AssetBundle); if (val != null && val.TryLoadModuleBundle("NewtonsApple", typeof(NewtonsApplePlugin).Assembly, ref val2)) { GameObject visualPrefab = default(GameObject); val.TryLoadAsset(text, ChaosAssetPaths.VisualPrefab("NewtonsApple"), ref visualPrefab); AudioClip mechanicClip = default(AudioClip); val.TryLoadAsset(text, ChaosAssetPaths.AudioClip("NewtonsApple", "mechanic.wav"), ref mechanicClip); VisualPrefab = visualPrefab; MechanicClip = mechanicClip; } ChaosSuiteRuntimePlugin instance2 = ChaosSuiteRuntimePlugin.Instance; if (instance2 != null) { instance2.RegisterFeatureContent("NewtonsApple", typeof(NewtonsApplePlugin).Assembly); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Newton's Apple loaded. Gravity is room-local; global Physics.gravity is never modified."); } private static void InitializeGeneratedNetcode() { if (netcodeInitialized) { return; } netcodeInitialized = true; Type[] types = typeof(NewtonsApplePlugin).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); } } } } } } 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(); } } } namespace ChaosSuite.NewtonsApple.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }