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 LethalSaboteurs v0.1.0
Zeldahu.LethalSaboteurs.dll
Decompiled a week agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using LethalSaboteurs.Configuration; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using Zeldahu.LethalSaboteurs.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: AssemblyCompany("Zeldahu.LethalSaboteurs")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+72d9ac40688ba8c48bb58f6d8290b16d9c10d02c")] [assembly: AssemblyProduct("LethalSaboteurs")] [assembly: AssemblyTitle("Zeldahu.LethalSaboteurs")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [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 LethalSaboteurs { internal class DepositBox : NetworkBehaviour { public int totalScrapValueOnMoon = 0; public int currentQuota = 0; public int currentQuotaProgress = 0; private GameObject shipLeverRef = null; private InteractTrigger shipLeverInteractScript = null; public static Random? random; public int randomSeed = 0; private int saboteurRealAmount = 0; private List<PlayerControllerB> connectedPlayersList = new List<PlayerControllerB>(); private List<PlayerControllerB> workersList = new List<PlayerControllerB>(); private List<PlayerControllerB> saboteursList = new List<PlayerControllerB>(); private List<ulong> workerClientIds = new List<ulong>(); private List<ulong> saboteurClientIds = new List<ulong>(); private List<string> saboteurNamesList = new List<string>(); private bool hasAnnouncedProgress25 = false; private bool hasAnnouncedProgress50 = false; private bool hasAnnouncedProgress75 = false; private bool hasAnnouncedQuotaFulfilled = false; private GameObject displayDaysLeftRef = null; private GameObject displayDaysLeftRef2 = null; private TMP_Text displayDaysLeftRefText = null; private TMP_Text displayDaysLeftRefText2 = null; private bool localPlayerIsSaboteur = false; private int winState = 0; public void Start() { shipLeverRef = ((Component)Object.FindObjectOfType<StartMatchLever>()).gameObject; shipLeverInteractScript = shipLeverRef.GetComponent<InteractTrigger>(); displayDaysLeftRef = GameObject.Find("Systems/UI/Canvas/SpecialGraphics/ProfitQuotaMet/DaysLeft/MaskImage (1)/Image/MetQuotaText"); displayDaysLeftRefText = displayDaysLeftRef.GetComponent<TMP_Text>(); displayDaysLeftRef2 = GameObject.Find("Systems/UI/Canvas/SpecialGraphics/ProfitQuotaMet/DaysLeft/MaskImage (1)/Image/MetQuotaText (2)"); displayDaysLeftRefText2 = displayDaysLeftRef2.GetComponent<TMP_Text>(); if (((NetworkBehaviour)this).IsServer) { randomSeed = Random.RandomRangeInt(1, 100000); } } [ClientRpc] public void SyncRandomSeedClientRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(322844017u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 322844017u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (random == null) { random = new Random(seed); } } } public void HandleStartOfRound() { //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) winState = 0; if (((NetworkBehaviour)this).IsServer) { SyncRandomSeedClientRpc(randomSeed); } Debug.Log((object)"Round has started! Handling custom mechanics..."); totalScrapValueOnMoon = 0; GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>(); foreach (GrabbableObject val in array) { totalScrapValueOnMoon += val.scrapValue; } currentQuotaProgress = 0; currentQuota = totalScrapValueOnMoon * Plugin.BoundConfig.QuotaAmountInPercentage.Value / 100; Debug.Log((object)("Total value of scraps on the moon : " + totalScrapValueOnMoon + ". Daily quota set to " + Plugin.BoundConfig.QuotaAmountInPercentage.Value + "%, for a value of : " + currentQuota)); shipLeverInteractScript.disabledHoverTip = "[Daily quota not met! (" + currentQuotaProgress + " / " + currentQuota + ")]"; shipLeverInteractScript.interactable = false; connectedPlayersList.Clear(); workersList.Clear(); saboteursList.Clear(); for (int j = 0; j < StartOfRound.Instance.connectedPlayersAmount + 1; j++) { connectedPlayersList.Add(StartOfRound.Instance.allPlayerScripts[j]); } if (((NetworkBehaviour)this).IsServer) { float num = Plugin.BoundConfig.SaboteurAmount.Value; num /= 100f; Debug.Log((object)("Config set to : " + num)); saboteurRealAmount = Mathf.RoundToInt((float)StartOfRound.Instance.connectedPlayersAmount * num); Debug.Log((object)("There are " + StartOfRound.Instance.connectedPlayersAmount + " players in the lobby, config set to " + num * 100f + "%, selecting " + saboteurRealAmount + " to be saboteurs")); if (saboteurRealAmount == 0) { saboteurRealAmount = 1; } Shuffle(connectedPlayersList); int num2 = 0; for (int k = 0; k < connectedPlayersList.Count; k++) { if (num2 < saboteurRealAmount) { saboteursList.Add(connectedPlayersList[k]); } else { workersList.Add(connectedPlayersList[k]); } num2++; } Debug.Log((object)"LISTING WORKERS"); foreach (PlayerControllerB workers in workersList) { Debug.Log((object)workers.playerUsername); } Debug.Log((object)"LISTING SABOTEURS"); foreach (PlayerControllerB saboteurs in saboteursList) { Debug.Log((object)saboteurs.playerUsername); } workerClientIds.Clear(); saboteurClientIds.Clear(); foreach (PlayerControllerB workers2 in workersList) { workerClientIds.Add(((NetworkBehaviour)workers2).OwnerClientId); } foreach (PlayerControllerB saboteurs2 in saboteursList) { saboteurClientIds.Add(((NetworkBehaviour)saboteurs2).OwnerClientId); AddSaboteurNameClientRpc(new NetworkObjectReference(((Component)saboteurs2).gameObject)); } ClientRpcParams workerRoleClientRpc = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = workerClientIds.ToArray() } }; ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = saboteurClientIds.ToArray() } }; SetWorkerRoleClientRpc(workerRoleClientRpc); SetSaboteurRoleClientRpc(saboteurRealAmount, clientRpcParams); } hasAnnouncedProgress25 = false; hasAnnouncedProgress50 = false; hasAnnouncedProgress75 = false; hasAnnouncedQuotaFulfilled = false; } public void HandlePlayerDeath() { if (!((NetworkBehaviour)this).IsServer) { return; } bool flag = true; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (workersList.Contains(val) && !val.isPlayerDead) { flag = false; break; } } if (!flag) { return; } if (winState == 1) { if (!(Plugin.BoundConfig.WinConditionCheckTiming.Value == "On lever pulled")) { winState = 2; AnnounceClutchSaboteurWinClientRpc(); } } else { winState = 2; StartOfRound.Instance.ShipLeaveAutomatically(false); AnnounceSaboteurWinClientRpc(mercilessWin: true); } } public void HandleShipLeavingAtMidnight() { if (((NetworkBehaviour)this).IsServer) { Debug.LogError((object)"MIDNIGHT HIT, SHIP IS LEAVING. CHECKING FOR WIN CONDITIONS..."); if (Plugin.BoundConfig.WorkersWinIfMidnightQuota.Value && currentQuotaProgress >= currentQuota) { winState = 1; AnnounceWorkerWinClientRpc(clutchVictory: true); } else { winState = 2; AnnounceSaboteurWinClientRpc(mercilessWin: false); } } } public void HandleLeverPulled() { if (((NetworkBehaviour)this).IsServer && currentQuotaProgress >= currentQuota) { winState = 1; AnnounceWorkerWinClientRpc(clutchVictory: false); } } public void HandleEndOfGame() { if (((NetworkBehaviour)this).IsServer) { Debug.Log((object)"End of game reached. Displaying final winners..."); switch (winState) { case 0: Debug.LogError((object)"ERROR: Win state null"); break; case 1: EndOfGameDisplayWorkerWinClientRpc(saboteurRealAmount); break; case 2: EndOfGameDisplaySaboteurWinClientRpc(saboteurRealAmount); break; } } GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>(); foreach (GrabbableObject val in array) { val.SetScrapValue(0); } } public void Shuffle<PlayerControllerB>(List<PlayerControllerB> list) { int num = list.Count; while (num > 1) { num--; int index = random.Next(num + 1); PlayerControllerB value = list[index]; list[index] = list[num]; list[num] = value; } } public void ItemDeposited() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>(); foreach (GrabbableObject val in array) { if ((Object)(object)val.playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController && !val.isPocketed) { if (hasAnnouncedQuotaFulfilled & (currentQuotaProgress + val.scrapValue >= currentQuota)) { HUDManager.Instance.DisplayTip("Quota already fulfilled!", "You do not need to deposit more items, pull the lever to win the game !", false, false, "LC_Tip1"); } ItemDepositedServerRpc(new NetworkObjectReference(((Component)val).gameObject)); HUDManager.Instance.DisplayStatusEffect("You deposited " + val.itemProperties.itemName + " for a value of " + val.scrapValue + " credits!"); Debug.LogError((object)("YOUR SABOTEUR STATUS : " + localPlayerIsSaboteur)); val.playerHeldBy.DestroyItemInSlotAndSync(val.playerHeldBy.currentItemSlot); break; } } } [ServerRpc(RequireOwnership = false)] public void ItemDepositedServerRpc(NetworkObjectReference itemDeposited) { //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_00e3: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2352155786u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref itemDeposited, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2352155786u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ItemDepositedClientRpc(itemDeposited); } } } [ClientRpc] public void ItemDepositedClientRpc(NetworkObjectReference itemDeposited) { //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_00e2: 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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3523318509u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref itemDeposited, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3523318509u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = NetworkObjectReference.op_Implicit(itemDeposited); GrabbableObject component = val3.GetComponent<GrabbableObject>(); Debug.Log((object)("Item deposited : " + component.itemProperties.itemName + ", value : " + component.scrapValue)); currentQuotaProgress += component.scrapValue; Terminal obj = Object.FindObjectOfType<Terminal>(); obj.groupCredits += component.scrapValue; shipLeverInteractScript.disabledHoverTip = "[Daily quota not met! (" + currentQuotaProgress + " / " + currentQuota + ")]"; if ((float)currentQuotaProgress >= (float)currentQuota * 0.25f && !hasAnnouncedProgress25 && Plugin.BoundConfig.AnnounceProgressMilestones.Value == "Every 25%") { HUDManager.Instance.DisplayTip("Quota 25% complete!", "Keep going, and watch your back...", false, false, "LC_Tip1"); hasAnnouncedProgress25 = true; } if ((float)currentQuotaProgress >= (float)currentQuota * 0.5f && !hasAnnouncedProgress50 && Plugin.BoundConfig.AnnounceProgressMilestones.Value != "Disabled") { HUDManager.Instance.DisplayTip("Quota 50% complete!", "Halfway there to a happy company, and angry saboteurs !", false, false, "LC_Tip1"); hasAnnouncedProgress50 = true; } if ((float)currentQuotaProgress >= (float)currentQuota * 0.75f && !hasAnnouncedProgress75 && Plugin.BoundConfig.AnnounceProgressMilestones.Value == "Every 25%") { HUDManager.Instance.DisplayTip("Quota 75% complete!", "Victory is within reach, but the company still needs you to be careful !", false, false, "LC_Tip1"); hasAnnouncedProgress75 = true; } if (currentQuotaProgress >= currentQuota && !hasAnnouncedQuotaFulfilled) { HUDManager.Instance.DisplayTip("QUOTA FULFILLED", "The lever is unlocked, take off to win the game !", false, false, "LC_Tip1"); shipLeverInteractScript.interactable = true; hasAnnouncedQuotaFulfilled = true; } } } [ClientRpc] public void SetWorkerRoleClientRpc(ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1552399052u, clientRpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1552399052u, clientRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(SetWorkerRoleCoroutine()); } } } private IEnumerator SetWorkerRoleCoroutine() { localPlayerIsSaboteur = false; DisplayWorkerRole(); yield return (object)new WaitForSeconds(4f); HUDManager.Instance.DisplayTip("GET TO WORK!", "Today's quota is set to " + currentQuota + " credits. Good luck!", false, false, "LC_Tip1"); } [ClientRpc] public void SetSaboteurRoleClientRpc(int saboteurAmount, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2639075884u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, saboteurAmount); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2639075884u, clientRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(SetSaboteurRoleCoroutine(saboteurAmount)); } } } private IEnumerator SetSaboteurRoleCoroutine(int saboteurAmount) { localPlayerIsSaboteur = true; DisplaySaboteurRole(); yield return (object)new WaitForSeconds(4f); string alliesText = ((saboteurAmount != 2) ? "Your allies are " : "Your ally is "); int k = 0; foreach (string playerName in saboteurNamesList) { if (!(playerName == StartOfRound.Instance.localPlayerController.playerUsername)) { k++; alliesText = ((k < saboteurNamesList.Count) ? (alliesText + playerName + ", ") : (alliesText + "and " + playerName)); } } if (saboteurAmount >= 2) { HUDManager.Instance.DisplayTip("WORK TOGETHER!", alliesText, false, false, "LC_Tip1"); } } [ClientRpc] public void AddSaboteurNameClientRpc(NetworkObjectReference player) { //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_00e2: 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(1751121460u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref player, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1751121460u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = NetworkObjectReference.op_Implicit(player); PlayerControllerB component = val3.GetComponent<PlayerControllerB>(); saboteurNamesList.Add(component.playerUsername); } } } public void DisplayWorkerRole() { string text = "WORKER"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text; displayDaysLeftRefText.text = "COMPLETE THE QUOTA"; displayDaysLeftRefText2.text = "COMPLETE THE QUOTA"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeftCalm"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.profitQuotaDaysLeftCalmSFX); } public void DisplaySaboteurRole() { string text = "SABOTEUR"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text; displayDaysLeftRefText.text = "KILL THE WORKERS"; displayDaysLeftRefText2.text = "KILL THE WORKERS"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeft"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.OneDayToMeetQuotaSFX); } [ClientRpc] public void AnnounceSaboteurWinClientRpc(bool mercilessWin) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2286161670u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref mercilessWin, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2286161670u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (localPlayerIsSaboteur) { if (mercilessWin) { HUDManager.Instance.DisplayTip("VICTORY!", "All workers are dead.", false, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("VICTORY!", "The ship returned to orbit without the quota fulfilled.", false, false, "LC_Tip1"); } } else if (mercilessWin) { HUDManager.Instance.DisplayTip("DEFEAT!", "All workers are dead.", true, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("DEFEAT!", "The ship returned to orbit without the quota fulfilled.", true, false, "LC_Tip1"); } } [ClientRpc] public void AnnounceWorkerWinClientRpc(bool clutchVictory) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4178013927u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref clutchVictory, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4178013927u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (localPlayerIsSaboteur) { if (clutchVictory) { HUDManager.Instance.DisplayTip("DEFEAT!", "Despite running out of time, the ship returned with the quota.", true, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("DEFEAT!", "The quota was met, and the ship is returning safely to orbit.", true, false, "LC_Tip1"); } } else if (clutchVictory) { HUDManager.Instance.DisplayTip("VICTORY!", "Despite running out of time, the ship returned with the quota.", false, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("VICTORY!", "The quota was met, and the ship is returning safely to orbit.", false, false, "LC_Tip1"); } } [ClientRpc] public void AnnounceClutchSaboteurWinClientRpc() { //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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(431529780u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 431529780u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HUDManager.Instance.DisplayTip("CLUTCH!", "The last worker was eliminated while the ship was returning to orbit. The saboteurs WIN!", true, false, "LC_Tip1"); } } } [ClientRpc] public void EndOfGameDisplayWorkerWinClientRpc(int saboteurAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2484681507u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, saboteurAmount); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2484681507u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(EndOfGameDisplayWorkerWinCoroutine(saboteurAmount)); } } } [ClientRpc] public void EndOfGameDisplaySaboteurWinClientRpc(int saboteurAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(492315085u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, saboteurAmount); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 492315085u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(EndOfGameDisplaySaboteurWinCoroutine(saboteurAmount)); } } } private IEnumerator EndOfGameDisplayWorkerWinCoroutine(int saboteurAmount) { if (!localPlayerIsSaboteur) { string text = "VICTORY"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text; displayDaysLeftRefText.text = "THE COMPANY IS HAPPY"; displayDaysLeftRefText2.text = "THE COMPANY IS HAPPY"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeftCalm"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.profitQuotaDaysLeftCalmSFX); } else { string text2 = "DEFEAT"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text2; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text2; displayDaysLeftRefText.text = "THE WORKERS WIN!"; displayDaysLeftRefText2.text = "THE WORKERS WIN!"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeft"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.OneDayToMeetQuotaSFX); } yield return (object)new WaitForSeconds(4f); RevealSaboteurs(saboteurAmount); saboteurNamesList.Clear(); } private IEnumerator EndOfGameDisplaySaboteurWinCoroutine(int saboteurAmount) { if (localPlayerIsSaboteur) { string text = "VICTORY"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text; displayDaysLeftRefText.text = "YOU STOPPED THE COMPANY"; displayDaysLeftRefText2.text = "YOU STOPPED THE COMPANY"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeftCalm"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.profitQuotaDaysLeftCalmSFX); } else { string text2 = "DEFEAT"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = text2; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = text2; displayDaysLeftRefText.text = "YOUR CONTRACT WITH THE COMPANY IS ENDED"; displayDaysLeftRefText2.text = "YOUR CONTRACT WITH THE COMPANY IS ENDED"; HUDManager.Instance.reachedProfitQuotaAnimator.SetTrigger("displayDaysLeft"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.OneDayToMeetQuotaSFX); } yield return (object)new WaitForSeconds(4f); RevealSaboteurs(saboteurAmount); } public void RevealSaboteurs(int saboteurAmount) { string text = ""; int num = 0; foreach (string saboteurNames in saboteurNamesList) { num++; text = ((num != saboteurNamesList.Count) ? (text + saboteurNames + ", ") : (text + "and " + saboteurNames)); } if (saboteurAmount == 1) { HUDManager.Instance.DisplayTip("THE SABOTEUR WAS: ", saboteurNamesList[0], false, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("THE SABOTEURS WERE: ", text, false, false, "LC_Tip1"); } } 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 //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(322844017u, new RpcReceiveHandler(__rpc_handler_322844017), "SyncRandomSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(2352155786u, new RpcReceiveHandler(__rpc_handler_2352155786), "ItemDepositedServerRpc"); ((NetworkBehaviour)this).__registerRpc(3523318509u, new RpcReceiveHandler(__rpc_handler_3523318509), "ItemDepositedClientRpc"); ((NetworkBehaviour)this).__registerRpc(1552399052u, new RpcReceiveHandler(__rpc_handler_1552399052), "SetWorkerRoleClientRpc"); ((NetworkBehaviour)this).__registerRpc(2639075884u, new RpcReceiveHandler(__rpc_handler_2639075884), "SetSaboteurRoleClientRpc"); ((NetworkBehaviour)this).__registerRpc(1751121460u, new RpcReceiveHandler(__rpc_handler_1751121460), "AddSaboteurNameClientRpc"); ((NetworkBehaviour)this).__registerRpc(2286161670u, new RpcReceiveHandler(__rpc_handler_2286161670), "AnnounceSaboteurWinClientRpc"); ((NetworkBehaviour)this).__registerRpc(4178013927u, new RpcReceiveHandler(__rpc_handler_4178013927), "AnnounceWorkerWinClientRpc"); ((NetworkBehaviour)this).__registerRpc(431529780u, new RpcReceiveHandler(__rpc_handler_431529780), "AnnounceClutchSaboteurWinClientRpc"); ((NetworkBehaviour)this).__registerRpc(2484681507u, new RpcReceiveHandler(__rpc_handler_2484681507), "EndOfGameDisplayWorkerWinClientRpc"); ((NetworkBehaviour)this).__registerRpc(492315085u, new RpcReceiveHandler(__rpc_handler_492315085), "EndOfGameDisplaySaboteurWinClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_322844017(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).SyncRandomSeedClientRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2352155786(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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemDeposited = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref itemDeposited, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).ItemDepositedServerRpc(itemDeposited); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3523318509(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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference itemDeposited = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref itemDeposited, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).ItemDepositedClientRpc(itemDeposited); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1552399052(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).SetWorkerRoleClientRpc(client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2639075884(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int saboteurAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref saboteurAmount); ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).SetSaboteurRoleClientRpc(saboteurAmount, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1751121460(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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference player = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref player, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).AddSaboteurNameClientRpc(player); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2286161670(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) { bool mercilessWin = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref mercilessWin, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).AnnounceSaboteurWinClientRpc(mercilessWin); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4178013927(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) { bool clutchVictory = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref clutchVictory, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).AnnounceWorkerWinClientRpc(clutchVictory); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_431529780(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; ((DepositBox)(object)target).AnnounceClutchSaboteurWinClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2484681507(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int saboteurAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref saboteurAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).EndOfGameDisplayWorkerWinClientRpc(saboteurAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_492315085(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int saboteurAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref saboteurAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((DepositBox)(object)target).EndOfGameDisplaySaboteurWinClientRpc(saboteurAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DepositBox"; } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { [HarmonyPostfix] [HarmonyPatch("KillPlayerServerRpc")] public static void KillPlayerServerRpcPatch(ref PlayerControllerB __instance) { Object.FindObjectOfType<DepositBox>().HandlePlayerDeath(); } } [BepInPlugin("Zeldahu.LethalSaboteurs", "Lethal Saboteurs", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string PLUGIN_GUID = "Zeldahu.LethalSaboteurs"; private const string PLUGIN_NAME = "Lethal Saboteurs"; private const string PLUGIN_VERSION = "0.1.0"; internal static ManualLogSource Logger; public static AssetBundle? ModAssets; private readonly Harmony harmony = new Harmony("Zeldahu.LethalSaboteurs"); internal static PluginConfig BoundConfig { get; private set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string path = "lethalsaboteurs"; 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; } UnlockableItem val = ModAssets.LoadAsset<UnlockablesList>("LSUnlockablesList").unlockables[0]; NetworkPrefabs.RegisterNetworkPrefab(val.prefabObject); Unlockables.RegisterUnlockable(val, 20, (StoreType)0); harmony.PatchAll(); Logger.LogInfo((object)"Plugin Zeldahu.LethalSaboteurs is loaded!"); } private static void InitializeNetworkBehaviours() { IEnumerable<Type> enumerable; try { enumerable = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { enumerable = ex.Types.Where((Type t) => t != null); } foreach (Type item in enumerable) { MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPostfix] [HarmonyPatch("LoadUnlockables")] public static void LoadUnlockablesPatch(ref StartOfRound __instance) { for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++) { if (__instance.unlockablesList.unlockables[i].unlockableName == "Deposit Box") { __instance.UnlockShipObject(i); break; } } } [HarmonyPostfix] [HarmonyPatch("openingDoorsSequence")] public static IEnumerator OpeningDoorsSequencePatch(IEnumerator result) { while (result.MoveNext()) { yield return result.Current; } Object.FindObjectOfType<DepositBox>().HandleStartOfRound(); } [HarmonyPostfix] [HarmonyPatch("ShipLeaveAutomatically")] public static void ShipLeaveAutomaticallyPatch(ref StartOfRound __instance, bool leavingOnMidnight) { Debug.LogError((object)"SHIP IS LEAVING, CHECKING IF MIDNIGHT"); if (leavingOnMidnight) { Object.FindObjectOfType<DepositBox>().HandleShipLeavingAtMidnight(); } } [HarmonyPrefix] [HarmonyPatch("PassTimeToNextDay")] public static bool PassTimeToNextDayPatch(ref StartOfRound __instance) { if (__instance.isChallengeFile) { TimeOfDay.Instance.globalTime = 100f; __instance.SetMapScreenInfoToCurrentLevel(); return false; } float num = TimeOfDay.Instance.globalTimeAtEndOfDay - TimeOfDay.Instance.globalTime; _ = TimeOfDay.Instance.totalTime / TimeOfDay.Instance.lengthOfHours; TimeOfDay.Instance.globalTime = 100f; return false; } [HarmonyPostfix] [HarmonyPatch("EndOfGame")] public static IEnumerator EndOfGamePatch(IEnumerator result) { while (result.MoveNext()) { yield return result.Current; } Object.FindObjectOfType<DepositBox>().HandleEndOfGame(); } } [HarmonyPatch(typeof(StartMatchLever))] internal class StartMatchLeverPatch { [HarmonyPostfix] [HarmonyPatch("PullLever")] public static void PullLeverPatch(ref StartMatchLever __instance) { if (!__instance.leverHasBeenPulled) { Object.FindObjectOfType<DepositBox>().HandleLeverPulled(); } } } public static class PluginInfo { public const string PLUGIN_GUID = "Zeldahu.LethalSaboteurs"; public const string PLUGIN_NAME = "LethalSaboteurs"; public const string PLUGIN_VERSION = "0.1.0"; } } namespace LethalSaboteurs.Configuration { public class PluginConfig { public ConfigEntry<int> SaboteurAmount; public ConfigEntry<int> QuotaAmountInPercentage; public ConfigEntry<string> AnnounceProgressMilestones; public ConfigEntry<bool> DestroyShipItemsBetweenRounds; public ConfigEntry<string> WinConditionCheckTiming; public ConfigEntry<bool> WorkersWinIfMidnightQuota; public PluginConfig(ConfigFile cfg) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown SaboteurAmount = cfg.Bind<int>("General config", "Saboteur Amount", 30, new ConfigDescription("The amount of saboteurs, as a percentage of players, rounded to the nearest unit. Consult the chart in the readme to determine what percentage is better for you", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); QuotaAmountInPercentage = cfg.Bind<int>("General config", "Percentage of moon scrap as quota", 45, new ConfigDescription("How much the quota will be every day, as a percentage of the total value of all the scraps generated on the moon", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); AnnounceProgressMilestones = cfg.Bind<string>("General config", "Announce progress milestones to everyone", "Every 25%", new ConfigDescription("Display announcements to every player when quota is progressed", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Disabled", "Every 25%", "50% only" }), Array.Empty<object>())); WinConditionCheckTiming = cfg.Bind<string>("Edge Cases", "Timing for the win condition check", "On lever pulled", new ConfigDescription("Determines when the game checks the win condition. If the saboteurs eliminate the last worker while the ship is taking off after completing the quota, this configuration resolves the ambiguity. 'On lever pulled' would make the workers win, and ignore anything that happens while the ship is taking off. 'On orbit reached' would make the saboteurs win and require the workers to protect themselves until everyone is invulnerable and dead players are revived.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "On lever pulled", "On orbit reached" }), Array.Empty<object>())); WorkersWinIfMidnightQuota = cfg.Bind<bool>("Edge Cases", "Can workers win if ship leaves at midnight with quota", false, "Should the workers win if the ship is forced to leave at midnight but the quota is filled?"); 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 System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace Zeldahu.LethalSaboteurs.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }