Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Garn47Mappack v0.0.1
Plugins/Gearmasteri.BlueGentle.dll
Decompiled 18 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BlueGentle.Configuration; using GameNetcodeStuff; using Gearmasteri.BlueGentle.NetcodePatcher; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [assembly: UnityAPICompatibilityVersion("2022.3.62f3", new string[] { "UnityEngine.CoreModule:6503E8CDF1A95D43A6F6700B950B862DBC66B629", "UnityEngine.AudioModule:3905046837BE277D45470E574F6622F7444FD262", "UnityEngine.PhysicsModule:ACC9726B217ADE09A40ECC5F0B4EB3C651F0E4D3", "UnityEngine.AssetBundleModule:E497ADE001168DE11E2FB800C276D6B79B2EFF52", "UnityEngine.AIModule:692A2553AC914AE4629136FB0596BB498B769FA0", "UnityEngine.AnimationModule:43D6DE488041A9F7350F23F6B69650AA49410D0B" })] [assembly: AssemblyTitle("Gearmasteri.BlueGentle")] [assembly: AssemblyProduct("BlueGentle")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCompany("Gearmasteri.BlueGentle")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: NetcodePatchedAssembly] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [Embedded] [CompilerGenerated] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [Embedded] [CompilerGenerated] [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 BlueGentle { internal class AutoBoombox : MonoBehaviour { private void Start() { ((MonoBehaviour)this).StartCoroutine(Play()); } private IEnumerator Play() { BoomboxItem bm = ((Component)this).GetComponent<BoomboxItem>(); yield return (object)new WaitForSeconds(3f); bm.isPlayingMusic = true; } } internal class BlueGentleAI : EnemyAI, INoiseListener { private enum State { SearchingForPlayer, Looking, ChasingPlayer } public Transform turnCompass = null; public Transform Head = null; public Vector3 RandLook1; public Vector3 RandLook2; public Transform Looker = null; public AudioSource AlarmSFX = null; public GameObject Laser = null; public GameObject Bomb = null; public Transform firepoint = null; public AudioClip MeleeSFX = null; public AudioClip DONTGOHOUSE = null; public static BlueGentleAI AlarmPlayer; private float timeSinceHittingLocalPlayer; private float lookTimer; private float RandLookInterval = 4f; private float RandLookTimer; private float WaitCD; private float LaserRate = 0.25f; private float shootTimer; private float BurstRate = 3f; private float burstTimer; private int burstShots = 5; private int burstShotsMax = 5; private float SprintTimer = 2.5f; private float IgnoreRange = 100f; private bool Sprinting = false; private List<Vector3> IgnorePoints = new List<Vector3>(); private Vector3 LastTargetPos; private Vector3 TargetVelocity; private NetworkVariable<Vector3> LookerPos = new NetworkVariable<Vector3>(default(Vector3), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private const float HeadLookLerpSpeed = 1f; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { Plugin.Logger.LogInfo((object)text); } public override void Start() { //IL_0021: 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_007b: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); timeSinceHittingLocalPlayer = 0f; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); AlarmSFX.Play(); AlarmSFX.Stop(); EntranceTeleport[] array = Object.FindObjectsOfType<EntranceTeleport>(); foreach (EntranceTeleport val in array) { IgnorePoints.Add(((Component)val).transform.position); } IgnorePoints.Add(Vector3.zero); } public override void Update() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); HandleLooking(); if (WaitCD > 0f) { WaitCD -= Time.deltaTime; } timeSinceHittingLocalPlayer += Time.deltaTime; if (base.agent.speed > 1f) { NavMeshAgent agent = base.agent; agent.speed -= Time.deltaTime * 75f; } if (base.agent.speed < 0f) { base.agent.speed = 0f; } int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if ((Object)(object)base.targetPlayer != (Object)null && currentBehaviourStateIndex == 2) { PredictPlayer(); base.creatureAnimator.SetBool("Looking", false); if ((Object)(object)AlarmPlayer == (Object)null) { AlarmPlayer = this; PlayAlarmClientRpc(new NetworkObjectReference(((NetworkBehaviour)this).NetworkObject), Value: true); } if (((NetworkBehaviour)this).IsServer) { HandleShooting(); } } if (currentBehaviourStateIndex == 0) { base.creatureAnimator.SetBool("Looking", false); LastTargetPos = Vector3.zero; if ((Object)(object)AlarmPlayer == (Object)(object)this) { PlayAlarmClientRpc(new NetworkObjectReference(((NetworkBehaviour)this).NetworkObject), Value: false); AlarmPlayer = null; } RandLookInterval = 4f; if (base.agent.remainingDistance <= 5f && !base.agent.pathPending && (Object)(object)base.currentSearch.currentTargetNode != (Object)null) { base.agent.Warp(base.agent.destination); if (Vector3.Distance(((Component)this).transform.position, base.currentSearch.currentTargetNode.transform.position) < 2f) { lookTimer = 2.5f; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } } if (currentBehaviourStateIndex == 1) { base.creatureAnimator.SetBool("Looking", true); LastTargetPos = Vector3.zero; lookTimer -= Time.deltaTime; RandLookInterval = 1f; if (lookTimer <= 0f) { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } } public void ShootLaser() { //IL_003b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_006c: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 val2 = firepoint.forward + val / 10f; Vector3 normalized = ((Vector3)(ref val2)).normalized; GameObject val3 = Object.Instantiate<GameObject>(Laser, firepoint.position, Quaternion.LookRotation(normalized)); NetworkObject component = val3.GetComponent<NetworkObject>(); component.Spawn(false); val3.GetComponent<GentleLaser>().Init(normalized); } public bool ShootBomb(Vector3 Target, float MaxVel) { //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) //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_0027: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0078: 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_007e: 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) Vector3 val = Vector3.zero; float power = 0f; for (int i = 0; (float)i <= MaxVel; i++) { power = i; val = CalculateVelocity(firepoint.position, Target, i); if (val != Vector3.zero) { break; } } if (val == Vector3.zero) { return false; } GameObject val2 = Object.Instantiate<GameObject>(Bomb, firepoint.position, Quaternion.LookRotation(val)); NetworkObject component = val2.GetComponent<NetworkObject>(); component.Spawn(false); val2.GetComponent<GentleBomb>().Init(val, power); return true; } public void RandomLook() { //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) RandLookTimer = 0f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(RandLook1.x, RandLook2.x), Random.Range(RandLook1.y, RandLook2.y), Random.Range(RandLook1.z, RandLook2.z)); LookerPos.Value = ((Component)this).transform.position + val; } public override void DoAIInterval() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_0106: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (StartOfRound.Instance.allPlayersDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: if (FoundClosestPlayerInRange(75f, 75f)) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } break; case 1: if (FoundClosestPlayerInRange(150f, 150f)) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } break; case 2: if (!TargetClosestPlayerInAnyCase() || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer.gameplayCamera).transform.position) > 200f || !PointAvailable(((Component)base.targetPlayer.gameplayCamera).transform.position)) { base.creatureSFX.PlayOneShot(DONTGOHOUSE); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)this).SetDestinationToPosition(((Component)base.targetPlayer.gameplayCamera).transform.position, false); } break; } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0054: 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_007d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, false, true); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f, false, false, true); range = senseRange; } return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range && PointAvailable(((Component)base.targetPlayer).transform.position); } private bool TargetClosestPlayerInAnyCase() { //IL_001e: 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) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (num < base.mostOptimalDistance) { base.mostOptimalDistance = num; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } return (Object)(object)base.targetPlayer != (Object)null; } public override void OnCollideWithPlayer(Collider other) { //IL_003b: 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_004a: 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) //IL_005e: 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_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_007b: Unknown result type (might be due to invalid IL or missing references) if (!(timeSinceHittingLocalPlayer < 1f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceHittingLocalPlayer = 0f; Vector3 val2 = ((Component)this).transform.forward * 50f + Vector3.up * 10f; val.DamagePlayer(25, true, true, (CauseOfDeath)8, 0, false, val2); val.externalForceAutoFade += val2; base.creatureSFX.PlayOneShot(MeleeSFX); } } } private void HandleLooking() { //IL_0017: 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_0032: 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) ((Component)Looker).transform.position = Vector3.Lerp(((Component)Looker).transform.position, LookerPos.Value, Time.deltaTime * 10f); Head.LookAt(Looker.position); if (RandLookTimer < RandLookInterval) { RandLookTimer += Time.deltaTime; } else { RandomLook(); } } private Vector3 Predict(float Speed) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0033: 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_003b: 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_0046: 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_004b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)base.targetPlayer.gameplayCamera).transform.position; Vector3 val = position - firepoint.position; float num = ((Vector3)(ref val)).magnitude / Speed; return position + TargetVelocity * num; } private void PredictPlayer() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_009c: Unknown result type (might be due to invalid IL or missing references) if (LastTargetPos == Vector3.zero) { LastTargetPos = ((Component)base.targetPlayer).transform.position; } TargetVelocity = (((Component)base.targetPlayer).transform.position - LastTargetPos) / Time.deltaTime; LastTargetPos = ((Component)base.targetPlayer).transform.position; if ((Object)(object)Looker != (Object)null && ((NetworkBehaviour)this).IsServer) { Vector3 value = Predict(250f); LookerPos.Value = value; } turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(0f, turnCompass.eulerAngles.y, 0f), 4f * Time.deltaTime); } private void HandleShooting() { //IL_01d1: 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) shootTimer += Time.deltaTime; burstTimer += Time.deltaTime; if (burstTimer >= BurstRate) { if (burstShots <= 0) { burstShots = burstShotsMax; burstTimer = 0f; } else if (shootTimer >= LaserRate && (Object)(object)base.targetPlayer != (Object)null) { ShootLaser(); shootTimer = 0f; burstShots--; } } SprintTimer -= Time.deltaTime; if (!((Object)(object)base.targetPlayer != (Object)null)) { return; } if (base.targetPlayer.inVehicleAnimation) { if (!(SprintTimer <= 0f)) { return; } if (Sprinting) { Sprinting = false; SprintTimer = 3f; if (!ShootBomb(Predict(33f), 100f)) { Sprinting = true; base.creatureAnimator.SetBool("Stopped", false); SprintTimer = 5f; } } else { Sprinting = true; SprintTimer = 5f; } } else { if (!(SprintTimer <= 0f)) { return; } if (Sprinting) { Sprinting = false; base.creatureAnimator.SetBool("Stopped", true); SprintTimer = 3f; if (!ShootBomb(Predict(33f), 100f)) { Sprinting = true; base.creatureAnimator.SetBool("Stopped", false); SprintTimer = 5f; } } else { Sprinting = true; base.creatureAnimator.SetBool("Stopped", false); SprintTimer = 5f; } } } private Vector3 CalculateVelocity(Vector3 origin, Vector3 target, float speed) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0076: 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_00c6: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target - origin; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); float y = val.y; float magnitude = ((Vector3)(ref val2)).magnitude; float num = Mathf.Abs(Physics.gravity.y); float num2 = speed * speed; float num3 = num2 * num2; float num4 = num3 - num * (num * magnitude * magnitude + 2f * y * num2); if (num4 < 0f) { return Vector3.zero; } float num5 = Mathf.Atan((num2 + Mathf.Sqrt(num4)) / (num * magnitude)); Vector3 result = ((Vector3)(ref val2)).normalized * speed * Mathf.Cos(num5); result.y = speed * Mathf.Sin(num5); return result; } public bool PointAvailable(Vector3 point) { //IL_0012: 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) //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) foreach (Vector3 ignorePoint in IgnorePoints) { if (Vector3.Distance(point, ignorePoint) < IgnoreRange) { return false; } } return true; } [ClientRpc] public void PlayAlarmClientRpc(NetworkObjectReference Gentle, bool Value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) 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(2455955201u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref Gentle, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref Value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2455955201u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref Gentle)).TryGet(ref val3, (NetworkManager)null)) { BlueGentleAI component = ((Component)val3).GetComponent<BlueGentleAI>(); if (Value) { component.AlarmSFX.Play(); AlarmPlayer = component; } else { component.AlarmSFX.Stop(); AlarmPlayer = null; } } } protected override void __initializeVariables() { if (LookerPos == null) { throw new Exception("BlueGentleAI.LookerPos cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)LookerPos).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)LookerPos, "LookerPos"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)LookerPos); ((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 ((NetworkBehaviour)this).__registerRpc(2455955201u, new RpcReceiveHandler(__rpc_handler_2455955201), "PlayAlarmClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2455955201(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference gentle = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref gentle, default(ForNetworkSerializable)); bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BlueGentleAI)(object)target).PlayAlarmClientRpc(gentle, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BlueGentleAI"; } } internal class BlueGentleAnimEvents : MonoBehaviour { public BlueGentleAI ai = null; public AudioClip stepSFX = null; public AudioClip turnSFXA = null; public AudioClip turnSFXB = null; public void StepSFX() { ((EnemyAI)ai).creatureSFX.PlayOneShot(stepSFX); } public void Step() { ((EnemyAI)ai).agent.speed = 25f; } public void TurnA() { ((EnemyAI)ai).creatureSFX.PlayOneShot(turnSFXA); } public void TurnB() { ((EnemyAI)ai).creatureSFX.PlayOneShot(turnSFXB); } } internal class FreeCruiser : MonoBehaviour { public Transform CarPoint = null; public GameObject CarPref = null; private void Update() { VehicleController val = Object.FindObjectOfType<VehicleController>(); if ((Object)(object)val != (Object)null && ((Behaviour)val).enabled) { ((Component)this).gameObject.SetActive(false); } } public void Spawn() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) NetworkObject component = Object.Instantiate<GameObject>(CarPref, CarPoint.position, CarPoint.rotation).GetComponent<NetworkObject>(); component.Spawn(false); ((Component)component).GetComponent<VehicleController>().hasBeenSpawned = true; } } internal class GentleBomb : NetworkBehaviour { public GameObject explosionPrefab = null; public AudioSource audioSource = null; private float lifeTime = 30f; private bool Armed = false; private float ArmTimer = 0.5f; public void Init(Vector3 dir, float power) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) ((Component)this).GetComponent<Rigidbody>().velocity = ((Vector3)(ref dir)).normalized * power; ((Component)this).GetComponent<Rigidbody>().angularVelocity = new Vector3(Random.Range(-5f, 5f), Random.Range(-5f, 5f), Random.Range(-5f, 5f)); } private void Start() { audioSource.PlayOneShot(audioSource.clip); } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).Invoke("DestroySelf", lifeTime); } } private void Update() { if (((NetworkBehaviour)this).IsServer && !Armed) { ArmTimer -= Time.deltaTime; if (ArmTimer <= 0f) { Armed = true; } } } private void OnCollisionEnter(Collision collision) { //IL_0026: 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) if (Armed && ((NetworkBehaviour)this).IsServer) { OnHit(((Component)this).transform.position, Vector3.up); } } private void OnHit(Vector3 pos, Vector3 normal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) SpawnExplosionClientRpc(pos, normal); DestroySelf(); } [ClientRpc] private void SpawnExplosionClientRpc(Vector3 pos, Vector3 normal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(705956110u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref normal); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 705956110u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Object.Instantiate<GameObject>(explosionPrefab, pos, ((Component)this).transform.rotation); } } } private void DestroySelf() { if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(705956110u, new RpcReceiveHandler(__rpc_handler_705956110), "SpawnExplosionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_705956110(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 normal = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref normal); target.__rpc_exec_stage = (__RpcExecStage)1; ((GentleBomb)(object)target).SpawnExplosionClientRpc(pos, normal); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GentleBomb"; } } internal class GentleLaser : NetworkBehaviour { public GameObject explosionPrefab = null; public AudioSource audioSource = null; public LayerMask collisionMask; private Vector3 direction; private float lifeTime = 5f; private float speed = 250f; public void Init(Vector3 dir) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) direction = ((Vector3)(ref dir)).normalized; } private void Start() { audioSource.PlayOneShot(audioSource.clip); } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).Invoke("DestroySelf", lifeTime); } } private void Update() { //IL_0023: 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_0032: 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_006a: 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_0049: 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) if (((NetworkBehaviour)this).IsServer) { float num = speed * Time.deltaTime; RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position, direction, ref val, num, LayerMask.op_Implicit(collisionMask))) { OnHit(((RaycastHit)(ref val)).point, ((RaycastHit)(ref val)).normal); return; } Transform transform = ((Component)this).transform; transform.position += direction * num; } } private void OnHit(Vector3 pos, Vector3 normal) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) SpawnExplosionClientRpc(pos, normal); DestroySelf(); } [ClientRpc] private void SpawnExplosionClientRpc(Vector3 pos, Vector3 normal) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1770224960u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref normal); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1770224960u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Object.Instantiate<GameObject>(explosionPrefab, pos, ((Component)this).transform.rotation); } } } private void DestroySelf() { if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } protected override void __initializeVariables() { ((NetworkBehaviour)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 ((NetworkBehaviour)this).__registerRpc(1770224960u, new RpcReceiveHandler(__rpc_handler_1770224960), "SpawnExplosionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1770224960(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Vector3 normal = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref normal); target.__rpc_exec_stage = (__RpcExecStage)1; ((GentleLaser)(object)target).SpawnExplosionClientRpc(pos, normal); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GentleLaser"; } } internal class GentleLaserExplosion : NetworkBehaviour { public AudioSource audioSource = null; public float radius = 6f; public float power = 200f; public int Damage = 10; public ScreenShakeType shakeType = (ScreenShakeType)0; private void Start() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_01fa: 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_00ce: 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_00e4: 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_0100: 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_010f: 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_012d: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) audioSource.PlayOneShot(audioSource.clip); Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, radius); Collider[] array2 = array; foreach (Collider val in array2) { if ((Object)(object)((Component)val).gameObject.GetComponent<Rigidbody>() != (Object)null) { ((Component)val).gameObject.GetComponent<Rigidbody>().AddExplosionForce(power, ((Component)this).transform.position, radius, 1.5f, (ForceMode)1); } if ((Object)(object)((Component)val).gameObject.GetComponent<PlayerControllerB>() != (Object)null) { PlayerControllerB component = ((Component)val).gameObject.GetComponent<PlayerControllerB>(); Vector3 val2 = Vector3.Normalize(((Component)component.gameplayCamera).transform.position - ((Component)this).transform.position) * (power / 2f) / Vector3.Distance(((Component)component.gameplayCamera).transform.position, ((Component)this).transform.position); component.DamagePlayer(Damage, false, true, (CauseOfDeath)3, 0, false, val2); float num = Vector3.Distance(((Component)component).transform.position, ((Component)this).transform.position); Vector3 val3 = Vector3.Normalize(((Component)component).transform.position + Vector3.up * num - ((Component)this).transform.position) / (num * 0.35f) * (power / 4f); component.externalForceAutoFade += val3; } } float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position); if (num2 < radius * 3f) { HUDManager.Instance.ShakeCamera(shakeType); } killSelf(); } private IEnumerator killSelf() { yield return (object)new WaitForSeconds(1f); if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "GentleLaserExplosion"; } } internal class Lava : MonoBehaviour { private PlayerControllerB LocalPlayer = null; private float CD = 1f; private void Update() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0080: 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_00d8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)LocalPlayer == (Object)null) { LocalPlayer = GameNetworkManager.Instance.localPlayerController; return; } if (CD > 0f) { CD -= Time.deltaTime; return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)LocalPlayer.thisPlayerBody).transform.position + Vector3.up, -Vector3.up); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 6f, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1) && (Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject == (Object)(object)((Component)this).gameObject) { LocalPlayer.DamagePlayer(10, true, true, (CauseOfDeath)13, 0, false, default(Vector3)); CD = 0.5f; } } } internal class NoMagnet : MonoBehaviour { private VehicleController car = null; private void Update() { if ((Object)(object)car == (Object)null) { car = ((Component)this).GetComponent<VehicleController>(); } else { car.magnetedToShip = false; } } } [BepInPlugin("Gearmasteri.BlueGentle", "BlueGentle", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static AssetBundle? ModAssets; internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "modassets"; ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path)); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); return; } EnemyType val = ModAssets.LoadAsset<EnemyType>("BlueGentleObj"); TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("BlueGentleTN"); TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("BlueGentleTK"); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(ModAssets.LoadAsset<GameObject>("Laser")); NetworkPrefabs.RegisterNetworkPrefab(ModAssets.LoadAsset<GameObject>("GentleBomb")); NetworkPrefabs.RegisterNetworkPrefab(ModAssets.LoadAsset<GameObject>("GarnCruiser")); Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3); Logger.LogInfo((object)"Plugin Gearmasteri.BlueGentle is loaded!"); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "Gearmasteri.BlueGentle"; public const string PLUGIN_NAME = "BlueGentle"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace BlueGentle.Configuration { public class PluginConfig { public ConfigEntry<int> SpawnWeight; public PluginConfig(ConfigFile cfg) { SpawnWeight = cfg.Bind<int>("General", "Spawn weight", 20, "The spawn chance weight for BlueGentle, relative to other existing enemies.\nGoes up from 0, lower is more rare, 100 and up is very common."); ClearUnusedEntries(cfg); } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<Vector3>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<Vector3>(); } } } namespace Gearmasteri.BlueGentle.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }