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 Plagues Of Evil v1.1.4
bcs4313_Plagues_Of_Evil.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLib.Modules; using Microsoft.CodeAnalysis; using On; using On.GameNetcodeStuff; using PlaguesOfDoom.src.Soul_Devourer; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.SceneManagement; using UnityEngine.UI; using bcs4313_Plagues_Of_Evil.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: AssemblyCompany("bcs4313")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Evil Plagues for Lethal Company.")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d281c8602246f8fa3bf4536ffca3fe971b0d7508")] [assembly: AssemblyProduct("Plagues")] [assembly: AssemblyTitle("bcs4313_Plagues_Of_Evil")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SoulDev { internal class EntityWarp { public struct entrancePack { public EntranceTeleport tele; public Vector3 navPosition; } public static EntranceTeleport[] mapEntrances; public static entrancePack findNearestEntrance(EnemyAI __instance) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0065: Unknown result type (might be due to invalid IL or missing references) float num = 100000000f; EntranceTeleport val = null; EntranceTeleport[] array = mapEntrances; for (int i = 0; i < array.Length; i++) { if (__instance.isOutside == array[i].isEntranceToBuilding && Vector3.Distance(((Component)__instance).transform.position, ((Component)array[i]).transform.position) < num) { num = Vector3.Distance(((Component)__instance).transform.position, ((Component)array[i]).transform.position); val = array[i]; } } entrancePack result = default(entrancePack); NavMeshHit val2 = default(NavMeshHit); if ((Object)(object)val != (Object)null && NavMesh.SamplePosition(((Component)val).transform.position, ref val2, 10f, -1)) { result.navPosition = ((NavMeshHit)(ref val2)).position; } result.tele = val; return result; } public static void SendEnemyInside(EnemyAI __instance) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) __instance.isOutside = false; __instance.allAINodes = GameObject.FindGameObjectsWithTag("AINode"); EntranceTeleport tele = findNearestEntrance(__instance).tele; if (!Object.op_Implicit((Object)(object)tele)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find entrance teleport."); } Transform entrancePoint = tele.entrancePoint; if (!Object.op_Implicit((Object)(object)entrancePoint)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find best exit position."); } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)entrancePoint).transform.position, ref val, 10f, -1)) { __instance.serverPosition = ((NavMeshHit)(ref val)).position; ((Component)__instance).transform.position = ((NavMeshHit)(ref val)).position; __instance.agent.Warp(__instance.serverPosition); __instance.SyncPositionToClients(); } else { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find exit NavmeshHit position"); } } public static void SendEnemyOutside(EnemyAI __instance, bool SpawnOnDoor = true) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) __instance.isOutside = true; __instance.allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode"); EntranceTeleport tele = findNearestEntrance(__instance).tele; if (!Object.op_Implicit((Object)(object)tele)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find entrance teleport."); } Transform entrancePoint = tele.entrancePoint; if (!Object.op_Implicit((Object)(object)entrancePoint)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find best exit position."); } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)entrancePoint).transform.position, ref val, 10f, -1)) { __instance.serverPosition = ((NavMeshHit)(ref val)).position; ((Component)__instance).transform.position = ((NavMeshHit)(ref val)).position; __instance.agent.Warp(__instance.serverPosition); __instance.SyncPositionToClients(); } else { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find exit NavmeshHit position"); } } } } namespace PlaguesOfDoom { [BepInPlugin("bcs4313_Plagues_Of_Evil", "Plagues", "1.0.0")] public class Plugin : BaseUnityPlugin { public static class Assets { public static AssetBundle MainAssetBundle; public static void PopulateAssets() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); MainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "bcs_plaguesofdoom")); if ((Object)(object)MainAssetBundle == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_SetPlanetsWeather <>9__6_0; public static hook_LoadNewLevel <>9__6_1; public static hook_OnHourChanged <>9__6_2; public static hook_OnCollideWithPlayer <>9__6_3; public static hook_DamagePlayerClientRpc <>9__6_4; public static hook_ItemActivate <>9__6_5; internal void <Awake>b__6_0(orig_SetPlanetsWeather orig, StartOfRound self, int connectedPlayersOnServer) { orig.Invoke(self, connectedPlayersOnServer); try { PlagueInfectionHUD.EnsureExists(); PlagueStatus.Cure(); PoopPlague[] array = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } } catch (Exception ex) { Debug.LogError((object)("Plagues of Evil Error: " + ex.ToString())); } } internal void <Awake>b__6_1(orig_LoadNewLevel orig, RoundManager self, int randomSeed, SelectableLevel newLevel) { orig.Invoke(self, randomSeed, newLevel); try { PlagueInfectionHUD.EnsureExists(); PlagueStatus.Cure(); PoopPlague[] array = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } if (((NetworkBehaviour)RoundManager.Instance).IsHost && (Object)(object)NetRelay == (Object)null) { NetRelay = Object.Instantiate<GameObject>(NetRelayPrefab); NetRelay.GetComponent<NetworkObject>().Spawn(false); } } catch (Exception ex) { Debug.LogError((object)("Plagues of Evil Error: " + ex.ToString())); } } internal void <Awake>b__6_2(orig_OnHourChanged orig, TimeOfDay self, int amount) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, amount); if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } try { if ((float)Random.Range(0, 100) < poopInfectionChance.Value) { <>c__DisplayClass6_0 CS$<>8__locals3 = new <>c__DisplayClass6_0 { plagues = Object.FindObjectsOfType<PoopPlague>() }; EnemyAI[] array = Object.FindObjectsOfType<EnemyAI>().Where(delegate(EnemyAI enemy) { <>c__DisplayClass6_1 CS$<>8__locals6 = new <>c__DisplayClass6_1 { enemy = enemy }; return !CS$<>8__locals3.plagues.Any((PoopPlague p) => p.IsRiding(CS$<>8__locals6.enemy)); }).ToArray(); if (array.Length != 0) { Vector3 position = ((Component)array[Random.RandomRangeInt(0, array.Length)]).transform.position; SpawnPoopPlague(position, dontInfectPlayer: true); } } if (!((float)Random.Range(0, 100) < magnetInfectionChance.Value)) { return; } <>c__DisplayClass6_2 CS$<>8__locals5 = new <>c__DisplayClass6_2 { plagues = Object.FindObjectsOfType<CarPlague>() }; EnemyAI[] array2 = Object.FindObjectsOfType<EnemyAI>().Where(delegate(EnemyAI enemy) { <>c__DisplayClass6_3 CS$<>8__locals7 = new <>c__DisplayClass6_3 { enemy = enemy }; return !CS$<>8__locals5.plagues.Any((CarPlague p) => p.IsRiding(CS$<>8__locals7.enemy)); }).ToArray(); if (array2.Length != 0) { Vector3 position2 = ((Component)array2[Random.RandomRangeInt(0, array2.Length)]).transform.position; SpawnMagnetPlague(position2, dontInfectPlayer: true); } } catch (Exception ex) { Debug.LogError((object)ex); } } internal void <Awake>b__6_3(orig_OnCollideWithPlayer orig, EnemyAI self, Collider other) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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) <>c__DisplayClass6_4 CS$<>8__locals14 = new <>c__DisplayClass6_4 { self = self }; orig.Invoke(CS$<>8__locals14.self, other); try { if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { if (!lastRelaySent.TryGetValue(((NetworkBehaviour)CS$<>8__locals14.self).NetworkObjectId, out var value) || !(Time.time - value < relayCooldown)) { lastRelaySent[((NetworkBehaviour)CS$<>8__locals14.self).NetworkObjectId] = Time.time; if (!Object.op_Implicit((Object)(object)NetRelay)) { NetRelay = ((Component)Object.FindObjectsOfType<PlagueNetRelay>()[0]).gameObject; } NetRelay.GetComponent<PlagueNetRelay>().RelayCollisionServerRpc(((NetworkBehaviour)CS$<>8__locals14.self).NetworkObjectId); } return; } } catch (Exception ex) { Debug.Log((object)("Plagues of Evil: Client Net Relay Error -> " + ex.ToString())); } CS$<>8__locals14.player = null; float num = float.MaxValue; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && !val.isPlayerDead) { float num2 = Vector3.Distance(((Component)val).transform.position, ((Component)CS$<>8__locals14.self).transform.position); if (num2 < num) { num = num2; CS$<>8__locals14.player = val; } } } if (!((Object)(object)CS$<>8__locals14.player == (Object)null)) { List<PoopPlague> plagues = PoopPlague.plagues; bool flag = plagues.Any((PoopPlague p) => p.IsRiding(CS$<>8__locals14.self)); bool flag2 = plagues.Any((PoopPlague p) => p.IsRiding(CS$<>8__locals14.player)); if (flag && !flag2) { SpawnPoopPlague(((Component)CS$<>8__locals14.player).transform.position, dontInfectPlayer: false); } List<CarPlague> plagues2 = CarPlague.plagues; flag = plagues2.Any((CarPlague p) => p.IsRiding(CS$<>8__locals14.self)); flag2 = plagues2.Any((CarPlague p) => p.IsRiding(CS$<>8__locals14.player)); if (flag && !flag2) { SpawnMagnetPlague(((Component)CS$<>8__locals14.player).transform.position, dontInfectPlayer: false); } } } internal void <Awake>b__6_4(orig_DamagePlayerClientRpc orig, PlayerControllerB self, int damageNumber, int newHealthAmount) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass6_5 CS$<>8__locals8 = new <>c__DisplayClass6_5(); orig.Invoke(self, damageNumber, newHealthAmount); if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } CS$<>8__locals8.player = null; float num = float.MaxValue; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val == (Object)null) && val.isPlayerControlled && !val.isPlayerDead) { float num2 = Vector3.Distance(((Component)val).transform.position, ((Component)self).transform.position); if (num2 < num) { num = num2; CS$<>8__locals8.player = val; } } } if ((Object)(object)CS$<>8__locals8.player == (Object)null) { return; } List<EnemyAI> list = new List<EnemyAI>(); EnemyAI[] array = Object.FindObjectsOfType<EnemyAI>(); foreach (EnemyAI val2 in array) { if (Vector3.Distance(((Component)val2).transform.position, ((Component)CS$<>8__locals8.player).transform.position) < infectionDistanceThreshold * MeasureMonsterScale(val2)) { list.Add(val2); } } PoopPlague[] source = Object.FindObjectsOfType<PoopPlague>(); using (List<EnemyAI>.Enumerator enumerator = list.GetEnumerator()) { while (enumerator.MoveNext()) { bool flag = source.Any(new <>c__DisplayClass6_6 { monster = enumerator.Current }.<Awake>b__14); bool flag2 = source.Any((PoopPlague p) => p.IsRiding(CS$<>8__locals8.player)); if (flag && !flag2) { SpawnPoopPlague(((Component)CS$<>8__locals8.player).transform.position, dontInfectPlayer: false); } } } CarPlague[] source2 = Object.FindObjectsOfType<CarPlague>(); using List<EnemyAI>.Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { bool flag3 = source2.Any(new <>c__DisplayClass6_7 { monster = enumerator2.Current }.<Awake>b__16); bool flag4 = source2.Any((CarPlague p) => p.IsRiding(CS$<>8__locals8.player)); if (flag3 && !flag4) { SpawnMagnetPlague(((Component)CS$<>8__locals8.player).transform.position, dontInfectPlayer: false); } } } internal void <Awake>b__6_5(orig_ItemActivate orig, TetraChemicalItem self, bool used, bool buttonDown) { orig.Invoke(self, used, buttonDown); try { PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController; if (!((Object)(object)((GrabbableObject)self).playerHeldBy == (Object)(object)RoundManager.Instance.playersManager.localPlayerController)) { return; } if (PlagueStatus.VirusName.Equals("Diarrhea Diabolica") && PlagueStatus.IsLocalPlayerInfected && localPlayerController.drunkness > 0.72f) { Debug.Log((object)"Plagues of Evil: Diarrhea Diabolica Cure attempted"); PlagueStatus.Cure(); PoopPlague[] array = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array) { if ((Object)(object)poopPlague.playerVictim == (Object)(object)localPlayerController) { if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } else { poopPlague.DestroySelfServerRpc(); } } } } if (!PlagueStatus.VirusName.Equals("Lodestone Rot") || !PlagueStatus.IsLocalPlayerInfected || !(localPlayerController.drunkness > 0.72f)) { return; } Debug.Log((object)"Plagues of Evil: Lodestone Rot Cure attempted"); PlagueStatus.Cure(); CarPlague[] array2 = Object.FindObjectsOfType<CarPlague>(); foreach (CarPlague carPlague in array2) { if ((Object)(object)carPlague.playerVictim == (Object)(object)localPlayerController) { if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Object.Destroy((Object)(object)((Component)carPlague).gameObject); } else { carPlague.DestroySelfServerRpc(); } } } } catch (Exception ex) { Debug.LogError((object)("Plagues of Evil: Error with TZP Inhalant: error -> " + ex.ToString())); } } } [CompilerGenerated] private sealed class <>c__DisplayClass6_0 { public PoopPlague[] plagues; internal bool <Awake>b__6(EnemyAI enemy) { <>c__DisplayClass6_1 CS$<>8__locals1 = new <>c__DisplayClass6_1 { enemy = enemy }; return !plagues.Any((PoopPlague p) => p.IsRiding(CS$<>8__locals1.enemy)); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_1 { public EnemyAI enemy; internal bool <Awake>b__7(PoopPlague p) { return p.IsRiding(enemy); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_2 { public CarPlague[] plagues; internal bool <Awake>b__8(EnemyAI enemy) { <>c__DisplayClass6_3 CS$<>8__locals1 = new <>c__DisplayClass6_3 { enemy = enemy }; return !plagues.Any((CarPlague p) => p.IsRiding(CS$<>8__locals1.enemy)); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_3 { public EnemyAI enemy; internal bool <Awake>b__9(CarPlague p) { return p.IsRiding(enemy); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_4 { public EnemyAI self; public PlayerControllerB player; internal bool <Awake>b__10(PoopPlague p) { return p.IsRiding(self); } internal bool <Awake>b__11(PoopPlague p) { return p.IsRiding(player); } internal bool <Awake>b__12(CarPlague p) { return p.IsRiding(self); } internal bool <Awake>b__13(CarPlague p) { return p.IsRiding(player); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_5 { public PlayerControllerB player; public Func<PoopPlague, bool> <>9__15; public Func<CarPlague, bool> <>9__17; internal bool <Awake>b__15(PoopPlague p) { return p.IsRiding(player); } internal bool <Awake>b__17(CarPlague p) { return p.IsRiding(player); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_6 { public EnemyAI monster; internal bool <Awake>b__14(PoopPlague p) { return p.IsRiding(monster); } } [CompilerGenerated] private sealed class <>c__DisplayClass6_7 { public EnemyAI monster; internal bool <Awake>b__16(CarPlague p) { return p.IsRiding(monster); } } public static Harmony _harmony; public static ManualLogSource Logger; public static GameObject PoopPlagueGO; public static GameObject MagnetPlagueGO; public static GameObject NetRelay; public static GameObject NetRelayPrefab; public static float relayCooldown = 0.5f; public static Dictionary<ulong, float> lastRelaySent = new Dictionary<ulong, float>(); public static float infectionDistanceThreshold = 1f; public static float playerReferenceHeight = 2f; public static ConfigEntry<float> poopInfectionChance; public static ConfigEntry<float> magnetInfectionChance; public static ConfigEntry<float> magnetCarMinSpawnDelay; public static ConfigEntry<float> magnetCarMaxSpawnDelay; public static ConfigEntry<float> magnetCarBaseForce; private void Awake() { //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_00bb: 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_00c6: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Assets.PopulateAssets(); bindVars(); 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); } } } Random.InitState((int)DateTime.Now.Ticks); object obj = <>c.<>9__6_0; if (obj == null) { hook_SetPlanetsWeather val = delegate(orig_SetPlanetsWeather orig, StartOfRound self, int connectedPlayersOnServer) { orig.Invoke(self, connectedPlayersOnServer); try { PlagueInfectionHUD.EnsureExists(); PlagueStatus.Cure(); PoopPlague[] array3 = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array3) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } } catch (Exception ex2) { Debug.LogError((object)("Plagues of Evil Error: " + ex2.ToString())); } }; <>c.<>9__6_0 = val; obj = (object)val; } StartOfRound.SetPlanetsWeather += (hook_SetPlanetsWeather)obj; object obj2 = <>c.<>9__6_1; if (obj2 == null) { hook_LoadNewLevel val2 = delegate(orig_LoadNewLevel orig, RoundManager self, int randomSeed, SelectableLevel newLevel) { orig.Invoke(self, randomSeed, newLevel); try { PlagueInfectionHUD.EnsureExists(); PlagueStatus.Cure(); PoopPlague[] array3 = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array3) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } if (((NetworkBehaviour)RoundManager.Instance).IsHost && (Object)(object)NetRelay == (Object)null) { NetRelay = Object.Instantiate<GameObject>(NetRelayPrefab); NetRelay.GetComponent<NetworkObject>().Spawn(false); } } catch (Exception ex2) { Debug.LogError((object)("Plagues of Evil Error: " + ex2.ToString())); } }; <>c.<>9__6_1 = val2; obj2 = (object)val2; } RoundManager.LoadNewLevel += (hook_LoadNewLevel)obj2; try { PoopPlagueGO = Assets.MainAssetBundle.LoadAsset<GameObject>("FartPlague"); NetworkPrefabs.RegisterNetworkPrefab(PoopPlagueGO); MagnetPlagueGO = Assets.MainAssetBundle.LoadAsset<GameObject>("MagnetPlague"); NetworkPrefabs.RegisterNetworkPrefab(MagnetPlagueGO); NetRelayPrefab = Assets.MainAssetBundle.LoadAsset<GameObject>("bcs_PlagueNetRelay"); NetworkPrefabs.RegisterNetworkPrefab(NetRelayPrefab); Debug.Log((object)("Plagues of Evil loaded! -> " + (object)NetRelayPrefab)); } catch (Exception ex) { Debug.LogError((object)("Error initializing Plagues of Doom: error -> " + ex.ToString())); } object obj3 = <>c.<>9__6_2; if (obj3 == null) { hook_OnHourChanged val3 = delegate(orig_OnHourChanged orig, TimeOfDay self, int amount) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, amount); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { try { if ((float)Random.Range(0, 100) < poopInfectionChance.Value) { PoopPlague[] plagues = Object.FindObjectsOfType<PoopPlague>(); EnemyAI[] array3 = (from enemy in Object.FindObjectsOfType<EnemyAI>() where !plagues.Any((PoopPlague p) => p.IsRiding(enemy)) select enemy).ToArray(); if (array3.Length != 0) { Vector3 position = ((Component)array3[Random.RandomRangeInt(0, array3.Length)]).transform.position; SpawnPoopPlague(position, dontInfectPlayer: true); } } if ((float)Random.Range(0, 100) < magnetInfectionChance.Value) { CarPlague[] plagues2 = Object.FindObjectsOfType<CarPlague>(); EnemyAI[] array4 = (from enemy in Object.FindObjectsOfType<EnemyAI>() where !plagues2.Any((CarPlague p) => p.IsRiding(enemy)) select enemy).ToArray(); if (array4.Length != 0) { Vector3 position2 = ((Component)array4[Random.RandomRangeInt(0, array4.Length)]).transform.position; SpawnMagnetPlague(position2, dontInfectPlayer: true); } } } catch (Exception ex2) { Debug.LogError((object)ex2); } } }; <>c.<>9__6_2 = val3; obj3 = (object)val3; } TimeOfDay.OnHourChanged += (hook_OnHourChanged)obj3; object obj4 = <>c.<>9__6_3; if (obj4 == null) { hook_OnCollideWithPlayer val4 = delegate(orig_OnCollideWithPlayer orig, EnemyAI self, Collider other) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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) orig.Invoke(self, other); try { if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { if (!lastRelaySent.TryGetValue(((NetworkBehaviour)self).NetworkObjectId, out var value) || !(Time.time - value < relayCooldown)) { lastRelaySent[((NetworkBehaviour)self).NetworkObjectId] = Time.time; if (!Object.op_Implicit((Object)(object)NetRelay)) { NetRelay = ((Component)Object.FindObjectsOfType<PlagueNetRelay>()[0]).gameObject; } NetRelay.GetComponent<PlagueNetRelay>().RelayCollisionServerRpc(((NetworkBehaviour)self).NetworkObjectId); } return; } } catch (Exception ex2) { Debug.Log((object)("Plagues of Evil: Client Net Relay Error -> " + ex2.ToString())); } PlayerControllerB player = null; float num = float.MaxValue; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val7 in allPlayerScripts) { if (!((Object)(object)val7 == (Object)null) && val7.isPlayerControlled && !val7.isPlayerDead) { float num2 = Vector3.Distance(((Component)val7).transform.position, ((Component)self).transform.position); if (num2 < num) { num = num2; player = val7; } } } if (!((Object)(object)player == (Object)null)) { List<PoopPlague> plagues = PoopPlague.plagues; bool flag = plagues.Any((PoopPlague p) => p.IsRiding(self)); bool flag2 = plagues.Any((PoopPlague p) => p.IsRiding(player)); if (flag && !flag2) { SpawnPoopPlague(((Component)player).transform.position, dontInfectPlayer: false); } List<CarPlague> plagues2 = CarPlague.plagues; flag = plagues2.Any((CarPlague p) => p.IsRiding(self)); flag2 = plagues2.Any((CarPlague p) => p.IsRiding(player)); if (flag && !flag2) { SpawnMagnetPlague(((Component)player).transform.position, dontInfectPlayer: false); } } }; <>c.<>9__6_3 = val4; obj4 = (object)val4; } EnemyAI.OnCollideWithPlayer += (hook_OnCollideWithPlayer)obj4; object obj5 = <>c.<>9__6_4; if (obj5 == null) { hook_DamagePlayerClientRpc val5 = delegate(orig_DamagePlayerClientRpc orig, PlayerControllerB self, int damageNumber, int newHealthAmount) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageNumber, newHealthAmount); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { PlayerControllerB player = null; float num = float.MaxValue; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val7 in allPlayerScripts) { if (!((Object)(object)val7 == (Object)null) && val7.isPlayerControlled && !val7.isPlayerDead) { float num2 = Vector3.Distance(((Component)val7).transform.position, ((Component)self).transform.position); if (num2 < num) { num = num2; player = val7; } } } if (!((Object)(object)player == (Object)null)) { List<EnemyAI> list = new List<EnemyAI>(); EnemyAI[] array3 = Object.FindObjectsOfType<EnemyAI>(); foreach (EnemyAI val8 in array3) { if (Vector3.Distance(((Component)val8).transform.position, ((Component)player).transform.position) < infectionDistanceThreshold * MeasureMonsterScale(val8)) { list.Add(val8); } } PoopPlague[] source = Object.FindObjectsOfType<PoopPlague>(); foreach (EnemyAI monster in list) { bool flag = source.Any((PoopPlague p) => p.IsRiding(monster)); bool flag2 = source.Any((PoopPlague p) => p.IsRiding(player)); if (flag && !flag2) { SpawnPoopPlague(((Component)player).transform.position, dontInfectPlayer: false); } } CarPlague[] source2 = Object.FindObjectsOfType<CarPlague>(); foreach (EnemyAI monster2 in list) { bool flag3 = source2.Any((CarPlague p) => p.IsRiding(monster2)); bool flag4 = source2.Any((CarPlague p) => p.IsRiding(player)); if (flag3 && !flag4) { SpawnMagnetPlague(((Component)player).transform.position, dontInfectPlayer: false); } } } } }; <>c.<>9__6_4 = val5; obj5 = (object)val5; } PlayerControllerB.DamagePlayerClientRpc += (hook_DamagePlayerClientRpc)obj5; object obj6 = <>c.<>9__6_5; if (obj6 == null) { hook_ItemActivate val6 = delegate(orig_ItemActivate orig, TetraChemicalItem self, bool used, bool buttonDown) { orig.Invoke(self, used, buttonDown); try { PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController; if ((Object)(object)((GrabbableObject)self).playerHeldBy == (Object)(object)RoundManager.Instance.playersManager.localPlayerController) { if (PlagueStatus.VirusName.Equals("Diarrhea Diabolica") && PlagueStatus.IsLocalPlayerInfected && localPlayerController.drunkness > 0.72f) { Debug.Log((object)"Plagues of Evil: Diarrhea Diabolica Cure attempted"); PlagueStatus.Cure(); PoopPlague[] array3 = Object.FindObjectsOfType<PoopPlague>(); foreach (PoopPlague poopPlague in array3) { if ((Object)(object)poopPlague.playerVictim == (Object)(object)localPlayerController) { if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Object.Destroy((Object)(object)((Component)poopPlague).gameObject); } else { poopPlague.DestroySelfServerRpc(); } } } } if (PlagueStatus.VirusName.Equals("Lodestone Rot") && PlagueStatus.IsLocalPlayerInfected && localPlayerController.drunkness > 0.72f) { Debug.Log((object)"Plagues of Evil: Lodestone Rot Cure attempted"); PlagueStatus.Cure(); CarPlague[] array4 = Object.FindObjectsOfType<CarPlague>(); foreach (CarPlague carPlague in array4) { if ((Object)(object)carPlague.playerVictim == (Object)(object)localPlayerController) { if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Object.Destroy((Object)(object)((Component)carPlague).gameObject); } else { carPlague.DestroySelfServerRpc(); } } } } } } catch (Exception ex2) { Debug.LogError((object)("Plagues of Evil: Error with TZP Inhalant: error -> " + ex2.ToString())); } }; <>c.<>9__6_5 = val6; obj6 = (object)val6; } TetraChemicalItem.ItemActivate += (hook_ItemActivate)obj6; PlagueSpawnerConfig.Init(((BaseUnityPlugin)this).Config); } public static void SpawnPoopPlague(Vector3 pos, bool dontInfectPlayer) { //IL_0006: 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) GameObject val = Object.Instantiate<GameObject>(PoopPlagueGO, pos, Quaternion.identity); val.GetComponent<PoopPlague>().noPlayerInfectionAllowed = dontInfectPlayer; val.GetComponent<NetworkObject>().Spawn(false); } public static void SpawnMagnetPlague(Vector3 pos, bool dontInfectPlayer) { //IL_0006: 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) GameObject val = Object.Instantiate<GameObject>(MagnetPlagueGO, pos, Quaternion.identity); val.GetComponent<CarPlague>().noPlayerInfectionAllowed = dontInfectPlayer; val.GetComponent<NetworkObject>().Spawn(false); } public static float MeasureMonsterScale(EnemyAI mob) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)mob == (Object)null) { return 1f; } float num = 0f; float num2 = 0f; float num3 = 0f; float num4 = 0f; Collider[] componentsInChildren = ((Component)mob).GetComponentsInChildren<Collider>(); foreach (Collider val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { Bounds bounds = val.bounds; Vector3 size = ((Bounds)(ref bounds)).size; num3 = Mathf.Max(num3, size.y); num4 = Mathf.Max(num4, Mathf.Max(size.x, size.z)); if (!val.isTrigger) { num = Mathf.Max(num, size.y); num2 = Mathf.Max(num2, Mathf.Max(size.x, size.z)); } } } if (num <= 0.01f) { num = num3; num2 = num4; } if (num <= 0.01f) { return 1f; } float num5 = num / playerReferenceHeight; float num6 = num2 / playerReferenceHeight; return Mathf.Clamp(Mathf.Sqrt(num5 * num6), 0.5f, 6f); } public void bindVars() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00e4: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0114: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0144: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_0174: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01a4: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown poopInfectionChance = ((BaseUnityPlugin)this).Config.Bind<float>("Diarrhea Diabolica", "Enemy Infection Chance", 5f, "% Chance for an enemy to be randomly infected every lethal company hour. The illness can spread to players if the enemy contacts you OR when you take dmg while they are very close."); magnetInfectionChance = ((BaseUnityPlugin)this).Config.Bind<float>("Loadstone Rot", "Enemy Infection Chance", 5f, "% Chance for an enemy to be randomly infected every lethal company hour. The illness can spread to players if the enemy contacts you OR when you take dmg while they are very close."); magnetCarMinSpawnDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Loadstone Rot", "Minimum Base Car Spawn Delay", 34f, "Minimum time in seconds before a murderous car spawns while affected with the disease. Reduced as disease progresses (cars despawn in 100 seconds)."); magnetCarMaxSpawnDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Loadstone Rot", "Maximum Base Car Spawn Delay", 60f, "Maximum time in seconds before a murderous car spawns while affected with the disease. Reduced as disease progresses (cars despawn in 100 seconds)."); magnetCarBaseForce = ((BaseUnityPlugin)this).Config.Bind<float>("Loadstone Rot", "Car Attraction Base Force", 6f, "The higher this number, the stronger the attraction cars have to you (i.e more murderous)"); ConfigEntry<float> obj = poopInfectionChance; FloatInputFieldOptions val = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val).Min = 0f; ((BaseRangeOptions<float>)val).Max = 100f; FloatInputFieldConfigItem val2 = new FloatInputFieldConfigItem(obj, val); ConfigEntry<float> obj2 = magnetInfectionChance; FloatInputFieldOptions val3 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val3).Min = 0f; ((BaseRangeOptions<float>)val3).Max = 100f; FloatInputFieldConfigItem val4 = new FloatInputFieldConfigItem(obj2, val3); ConfigEntry<float> obj3 = magnetCarMinSpawnDelay; FloatInputFieldOptions val5 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val5).Min = 0f; ((BaseRangeOptions<float>)val5).Max = 100000f; FloatInputFieldConfigItem val6 = new FloatInputFieldConfigItem(obj3, val5); ConfigEntry<float> obj4 = magnetCarMaxSpawnDelay; FloatInputFieldOptions val7 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val7).Min = 0f; ((BaseRangeOptions<float>)val7).Max = 100000f; FloatInputFieldConfigItem val8 = new FloatInputFieldConfigItem(obj4, val7); ConfigEntry<float> obj5 = magnetCarBaseForce; FloatInputFieldOptions val9 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val9).Min = -100f; ((BaseRangeOptions<float>)val9).Max = 100f; FloatInputFieldConfigItem val10 = new FloatInputFieldConfigItem(obj5, val9); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val6); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val10); } } public class CarPlague : NetworkBehaviour { public enum State { SearchingForPlayer } public bool noPlayerInfectionAllowed = false; [HideInInspector] public EnemyAI enemyVictim = null; [HideInInspector] public PlayerControllerB playerVictim = null; public static List<CarPlague> plagues = new List<CarPlague>(); public ParticleSystem sparkParticleStream; public GameObject burstParticles; public AudioSource magnetContinuousNoise; public float infectionSeverity = 0f; public static Action<Vector3> SpawnRequested; [HideInInspector] public float secondsToSpawnCar = 0f; public static float carLifetime = 100f; public float severitySyncInterval = 0.25f; [HideInInspector] public float severitySyncTimer = 0f; private float enemyScaleEst = 1f; private float spawnCarMinRadius = 5f; private float spawnCarMaxRadius = 30f; public static float gravitateMinTime = 0.25f; public static float gravitateMaxTime = 1f; public float secondsToGravitate = 0f; public List<Rigidbody> carRigidBodies = new List<Rigidbody>(); private float pSyncTimer = 0f; private float progressionSpeed = 0.004f; public static float playerReferenceHeight = 2f; public static float lateralForceMult = 0.15f; public static float upwardForceMult = 0.015f; [Header("AI Debug")] public bool debugThoughts = true; public bool IsRiding(EnemyAI mob) { return (Object)(object)enemyVictim != (Object)null && (Object)(object)enemyVictim == (Object)(object)mob && !enemyVictim.isEnemyDead; } public bool IsRiding(PlayerControllerB ply) { return (Object)(object)playerVictim != (Object)null && (Object)(object)playerVictim == (Object)(object)ply; } public void Start() { //IL_01d3: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) PlagueInfectionHUD.EnsureExists(); secondsToSpawnCar = Random.Range(Plugin.magnetCarMinSpawnDelay.Value, Plugin.magnetCarMaxSpawnDelay.Value); float num = 99999f; PlayerControllerB val = null; EnemyAI val2 = null; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; PlayerControllerB[] array = allPlayerScripts; foreach (PlayerControllerB val3 in array) { if (!((Object)(object)val3 == (Object)null) && !val3.isPlayerDead && !noPlayerInfectionAllowed) { float num2 = Vector3.Distance(((Component)val3).transform.position, ((Component)this).transform.position); if (num2 < num) { val = val3; val2 = null; num = num2; } } } List<EnemyAI> spawnedEnemies = RoundManager.Instance.SpawnedEnemies; if (spawnedEnemies != null) { foreach (EnemyAI item in spawnedEnemies) { if (!((Object)(object)item == (Object)null) && !item.isEnemyDead) { float num3 = Vector3.Distance(((Component)item).transform.position, ((Component)this).transform.position); if (num3 < num) { val2 = item; val = null; num = num3; } } } } if ((Object)(object)val2 != (Object)null) { enemyVictim = val2; Think("attached to monster -> " + EnemyLabel(enemyVictim) + " at " + num.ToString("F1") + "m"); float num4 = MeasureMonsterScale(enemyVictim); ((Component)sparkParticleStream).transform.localScale = new Vector3(num4, num4, num4); enemyScaleEst = num4; } else if ((Object)(object)val != (Object)null) { playerVictim = val; Think("attached to player -> " + playerVictim.playerUsername + " at " + num.ToString("F1") + "m"); } else { Debug.LogError((object)"Loadstone Rot -> Attachment Failure Error, the plague will not function properly."); } sparkParticleStream.Play(); plagues.Add(this); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); plagues.Remove(this); } public void Update() { //IL_0042: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!sparkParticleStream.isPlaying) { sparkParticleStream.Play(); } if (Object.op_Implicit((Object)(object)playerVictim)) { ((Component)this).transform.position = ((Component)playerVictim).transform.position; ((Component)this).transform.rotation = ((Component)playerVictim).transform.rotation; } if (Object.op_Implicit((Object)(object)enemyVictim)) { ((Component)this).transform.position = ((Component)enemyVictim).transform.position; ((Component)this).transform.rotation = ((Component)enemyVictim).transform.rotation; } if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } infectionSeverity += Time.deltaTime; if (Object.op_Implicit((Object)(object)playerVictim)) { if (playerVictim.isPlayerDead) { InfectionClearedClientRpc(((NetworkBehaviour)playerVictim).NetworkObjectId); Object.Destroy((Object)(object)((Component)this).gameObject); return; } severitySyncTimer -= Time.deltaTime; if (severitySyncTimer <= 0f) { severitySyncTimer = severitySyncInterval; InfectionSyncClientRpc(((NetworkBehaviour)playerVictim).NetworkObjectId, infectionSeverity); } if (pSyncTimer < 0f) { ParticleSyncClientRpc(infectionSeverity, enemyScaleEst); } RunSymptoms(); } else if (Object.op_Implicit((Object)(object)enemyVictim)) { if (enemyVictim.isEnemyDead) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (pSyncTimer < 0f) { ParticleSyncClientRpc(infectionSeverity, enemyScaleEst); } RunSymptoms(); } secondsToSpawnCar -= Time.deltaTime; secondsToGravitate -= Time.deltaTime; pSyncTimer -= Time.deltaTime; } private void RunSymptoms() { float severityDivisor = getSeverityDivisor(); if (secondsToSpawnCar <= 0f && (Object)(object)playerVictim != (Object)null) { SendCar(); secondsToSpawnCar = Random.Range(Plugin.magnetCarMinSpawnDelay.Value, Plugin.magnetCarMaxSpawnDelay.Value) / severityDivisor; } if (secondsToGravitate <= 0f && (Object)(object)playerVictim != (Object)null) { Gravitate(); secondsToGravitate = Random.Range(gravitateMinTime, gravitateMaxTime); } } public void Gravitate() { //IL_007e: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) carRigidBodies.RemoveAll((Rigidbody c) => (Object)(object)c == (Object)null); foreach (Rigidbody carRigidBody in carRigidBodies) { if ((Object)(object)carRigidBody != (Object)null && (Object)(object)((Component)carRigidBody).gameObject != (Object)null) { float num = Plugin.magnetCarBaseForce.Value * getSeverityDivisor(); Vector3 val = Vector3.Normalize(((Component)playerVictim).transform.position - ((Component)carRigidBody).transform.position); carRigidBody.AddForce(val * num, (ForceMode)2); } } } private void SendCar() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)playerVictim == (Object)null) { return; } try { Debug.Log((object)"Plagues of Evil: Spawning Magnetized Car (Lodestone Rot)"); Vector3 position = ((Component)playerVictim).transform.position; position.x += Random.Range(spawnCarMinRadius, spawnCarMaxRadius) * (float)((Random.Range(0, 2) != 0) ? 1 : (-1)); position.y += Random.Range(spawnCarMinRadius, spawnCarMaxRadius) * (float)((Random.Range(0, 2) != 0) ? 1 : (-1)); position.z += Random.Range(spawnCarMinRadius, spawnCarMaxRadius) * (float)((Random.Range(0, 2) != 0) ? 1 : (-1)); NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val, spawnCarMaxRadius * 2f, -1)) { Object obj = Resources.FindObjectsOfTypeAll(typeof(VehicleController))[0]; VehicleController val2 = (VehicleController)(object)((obj is VehicleController) ? obj : null); GameObject val3 = Object.Instantiate<GameObject>(((Component)val2).gameObject, ((NavMeshHit)(ref val)).position, ((Component)playerVictim).transform.rotation, new GameObject().transform); val3.GetComponent<NetworkObject>().Spawn(true); val3.GetComponent<VehicleController>().hasBeenSpawned = true; carRigidBodies.Add(val3.GetComponent<Rigidbody>()); SetSpawnedStatusClientRpc(new NetworkObjectReference(val3.GetComponent<NetworkObject>())); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Object.Destroy((Object)(object)val3, carLifetime); } } } catch (Exception ex) { Debug.LogError((object)("Plagues of Evil Exception from spawning Magnetized Car -> " + ex.ToString())); } } [ClientRpc] public void SetSpawnedStatusClientRpc(NetworkObjectReference carReference) { //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(2229004698u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref carReference, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2229004698u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (!((NetworkObjectReference)(ref carReference)).TryGet(ref val3, (NetworkManager)null)) { Debug.LogWarning((object)"Could not resolve spawned car."); return; } VehicleController component = ((Component)val3).GetComponent<VehicleController>(); component.hasBeenSpawned = true; } } [ServerRpc(RequireOwnership = false)] public void DestroySelfServerRpc() { //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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2205167095u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2205167095u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Object.Destroy((Object)(object)((Component)this).gameObject); } } } [ClientRpc] public void InfectionSyncClientRpc(ulong pid, float severity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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(2833463181u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, pid); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref severity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2833463181u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).NetworkObjectId == pid) { SetInfectionDetails(); PlagueStatus.ReportInfection(severity); } } } [ClientRpc] public void ParticleSyncClientRpc(float severity, float scale) { //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) //IL_012d: 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(69942052u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref severity, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref scale, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 69942052u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sparkParticleStream.emissionRate = Math.Min(severity / 5f, 100f); ((Component)sparkParticleStream).gameObject.transform.localScale = new Vector3(scale, scale, scale); pSyncTimer = 0.5f; } } } [ClientRpc] public void InfectionClearedClientRpc(ulong pid) { //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(2604561824u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, pid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2604561824u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).NetworkObjectId == pid) { PlagueStatus.ReportClear(); } } } public static void SetInfectionDetails() { PlagueStatus.VirusName = "Lodestone Rot"; PlagueStatus.VirusStrain = "STRAIN MG-TO"; PlagueStatus.CureHint = "CURE: TZP"; PlagueStatus.StageNames = new string[5] { "STAGE 1 - INCUBATING FUNGUS", "STAGE 2 - CONSTRUCTING MAGNETIC FIELD", "STAGE 3 - SKELETAL COMPOUNDS COMPROMISED", "STAGE 4 - LIVING MAGNET", "STAGE 5 - TERMINAL" }; } public float getSeverityDivisor() { return Math.Min(1f + infectionSeverity * progressionSpeed, 4f); } public static float MeasureMonsterScale(EnemyAI mob) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)mob == (Object)null) { return 1f; } float num = 0f; float num2 = 0f; float num3 = 0f; float num4 = 0f; Collider[] componentsInChildren = ((Component)mob).GetComponentsInChildren<Collider>(); foreach (Collider val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { Bounds bounds = val.bounds; Vector3 size = ((Bounds)(ref bounds)).size; num3 = Mathf.Max(num3, size.y); num4 = Mathf.Max(num4, Mathf.Max(size.x, size.z)); if (!val.isTrigger) { num = Mathf.Max(num, size.y); num2 = Mathf.Max(num2, Mathf.Max(size.x, size.z)); } } } if (num <= 0.01f) { num = num3; num2 = num4; } if (num <= 0.01f) { return 1f; } float num5 = num / playerReferenceHeight; float num6 = num2 / playerReferenceHeight; return Mathf.Clamp(Mathf.Sqrt(num5 * num6), 0.5f, 6f); } public Vector3 GetRandomLateralPosition(Transform target) { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 position = target.position; position.x += Random.Range(-0.5f, 0.5f); position.z += Random.Range(-0.5f, 0.5f); return position; } public PlayerControllerB GetPlayer(ulong pid) { PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; PlayerControllerB[] array = allPlayerScripts; foreach (PlayerControllerB val in array) { if (((NetworkBehaviour)val).NetworkObjectId == pid) { return val; } } return null; } private string EnemyLabel(EnemyAI mob) { if ((Object)(object)mob == (Object)null) { return "null"; } if ((Object)(object)mob.enemyType == (Object)null) { return ((Object)mob).name; } return mob.enemyType.enemyName; } private void Think(string msg) { if (debugThoughts) { Debug.Log((object)$"[PoopPlague@{Time.time:F1}] {msg}"); } } 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 ((NetworkBehaviour)this).__registerRpc(2229004698u, new RpcReceiveHandler(__rpc_handler_2229004698), "SetSpawnedStatusClientRpc"); ((NetworkBehaviour)this).__registerRpc(2205167095u, new RpcReceiveHandler(__rpc_handler_2205167095), "DestroySelfServerRpc"); ((NetworkBehaviour)this).__registerRpc(2833463181u, new RpcReceiveHandler(__rpc_handler_2833463181), "InfectionSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(69942052u, new RpcReceiveHandler(__rpc_handler_69942052), "ParticleSyncClientRpc"); ((NetworkBehaviour)this).__registerRpc(2604561824u, new RpcReceiveHandler(__rpc_handler_2604561824), "InfectionClearedClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2229004698(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 spawnedStatusClientRpc = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref spawnedStatusClientRpc, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CarPlague)(object)target).SetSpawnedStatusClientRpc(spawnedStatusClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2205167095(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; ((CarPlague)(object)target).DestroySelfServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2833463181(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong pid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref pid); float severity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref severity, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CarPlague)(object)target).InfectionSyncClientRpc(pid, severity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_69942052(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_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float severity = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref severity, default(ForPrimitives)); float scale = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref scale, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CarPlague)(object)target).ParticleSyncClientRpc(severity, scale); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2604561824(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong pid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref pid); target.__rpc_exec_stage = (__RpcExecStage)1; ((CarPlague)(object)target).InfectionClearedClientRpc(pid); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CarPlague"; } } public class PlagueInfectionHUD : MonoBehaviour { [Header("Badge (persistent, while infected)")] public CanvasGroup badgeGroup; public TextMeshProUGUI virusNameLabel; public TextMeshProUGUI stageLabel; public TextMeshProUGUI percentLabel; public Image severityBar; public Image stageIndicatorImage; public TextMeshProUGUI cureHintLabel; [Header("Banner (one-shot, on infection)")] public CanvasGroup bannerGroup; public TextMeshProUGUI bannerTitle; public TextMeshProUGUI bannerSubtitle; public TextMeshProUGUI bannerHint; public float bannerHoldTime = 3f; [Header("Feel")] public float fadeSpeed = 3f; public float syncTimeout = 3f; public float pulseSpeed = 4f; [Range(0f, 1f)] public float pulseAmount = 0.45f; public Color[] stageColors = (Color[])(object)new Color[5] { new Color(0.35f, 0.9f, 0.35f), new Color(0.95f, 0.85f, 0.25f), new Color(0.98f, 0.55f, 0.15f), new Color(0.9f, 0.15f, 0.12f), new Color(0.78f, 0.1f, 0.48f) }; [Header("Audio (optional)")] public AudioClip onsetClip; public AudioClip stageClip; [Range(0f, 1f)] public float audioVolume = 0.7f; [Header("Runtime UI build")] public bool autoBuildUI = true; public TMP_FontAsset fontOverride; public Vector2 referenceResolution = new Vector2(1920f, 1080f); private AudioSource _audio; private Coroutine _bannerRoutine; private RectTransform _badgeRT; private float _punch; private int _lastStage = -1; private int _lastPercent = -1; private static Sprite _whiteSprite; public static PlagueInfectionHUD Instance { get; private set; } private static Sprite WhiteSprite { get { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001e: 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_0054: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_whiteSprite == (Object)null) { Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false); val.SetPixel(0, 0, Color.white); val.Apply(); _whiteSprite = Sprite.Create(val, new Rect(0f, 0f, 1f, 1f), new Vector2(0.5f, 0.5f), 100f); ((Object)_whiteSprite).name = "PlagueWhite1x1"; } return _whiteSprite; } } public static PlagueInfectionHUD EnsureExists() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return Instance; } GameObject val = new GameObject("PlagueInfectionHUD"); Object.DontDestroyOnLoad((Object)(object)val); return val.AddComponent<PlagueInfectionHUD>(); } private void Awake() { //IL_0114: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); if (autoBuildUI && (Object)(object)badgeGroup == (Object)null) { BuildRuntimeUI(); } if ((Object)(object)badgeGroup != (Object)null) { ref RectTransform badgeRT = ref _badgeRT; Transform transform = ((Component)badgeGroup).transform; badgeRT = (RectTransform)(object)((transform is RectTransform) ? transform : null); badgeGroup.alpha = 0f; badgeGroup.blocksRaycasts = false; badgeGroup.interactable = false; } if ((Object)(object)bannerGroup != (Object)null) { bannerGroup.alpha = 0f; bannerGroup.blocksRaycasts = false; bannerGroup.interactable = false; } if ((Object)(object)stageIndicatorImage != (Object)null) { ((Graphic)stageIndicatorImage).color = StageColor(0); } _audio = ((Component)this).gameObject.GetComponent<AudioSource>(); if ((Object)(object)_audio == (Object)null) { _audio = ((Component)this).gameObject.AddComponent<AudioSource>(); } _audio.playOnAwake = false; _audio.spatialBlend = 0f; _audio.volume = 1f; PlagueStatus.ResetState(); SceneManager.sceneLoaded += HandleSceneLoaded; } private void OnDestroy() { SceneManager.sceneLoaded -= HandleSceneLoaded; if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } private void OnEnable() { PlagueStatus.OnInfected += HandleInfected; PlagueStatus.OnCleared += HandleCleared; PlagueStatus.OnStageChanged += HandleStageChanged; } private void OnDisable() { PlagueStatus.OnInfected -= HandleInfected; PlagueStatus.OnCleared -= HandleCleared; PlagueStatus.OnStageChanged -= HandleStageChanged; } private void HandleSceneLoaded(Scene scene, LoadSceneMode mode) { PlagueStatus.ReportClear(); } private void Update() { if (PlagueStatus.IsLocalPlayerInfected && Time.time - PlagueStatus.LastSyncTime > syncTimeout) { PlagueStatus.ReportClear(); } DriveBadge(); DrivePunch(); } private void DriveBadge() { if ((Object)(object)badgeGroup == (Object)null) { return; } float num = (PlagueStatus.IsLocalPlayerInfected ? 1f : 0f); badgeGroup.alpha = Mathf.MoveTowards(badgeGroup.alpha, num, Time.deltaTime * fadeSpeed); if (badgeGroup.alpha <= 0.001f || !PlagueStatus.IsLocalPlayerInfected) { return; } int stageIndex = PlagueStatus.StageIndex; float normalizedSeverity = PlagueStatus.NormalizedSeverity; if (_lastStage != stageIndex) { _lastStage = stageIndex; ApplyStageVisuals(stageIndex); } int num2 = Mathf.RoundToInt(normalizedSeverity * 100f); if (_lastPercent != num2) { _lastPercent = num2; if ((Object)(object)percentLabel != (Object)null) { ((TMP_Text)percentLabel).text = num2 + "%"; } } if ((Object)(object)severityBar != (Object)null) { severityBar.fillAmount = normalizedSeverity; } if ((Object)(object)virusNameLabel != (Object)null) { if (stageIndex >= PlagueStatus.StageNames.Length - 1) { float num3 = 0.5f + 0.5f * Mathf.Sin(Time.time * pulseSpeed); ((TMP_Text)virusNameLabel).alpha = Mathf.Lerp(1f - pulseAmount, 1f, num3); } else if (!Mathf.Approximately(((TMP_Text)virusNameLabel).alpha, 1f)) { ((TMP_Text)virusNameLabel).alpha = 1f; } } } private void DrivePunch() { //IL_0050: 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) if (!(_punch <= 0f)) { _punch = Mathf.MoveTowards(_punch, 0f, Time.deltaTime * 2.5f); if ((Object)(object)_badgeRT != (Object)null) { ((Transform)_badgeRT).localScale = Vector3.one * (1f + 0.09f * _punch); } } } private void ApplyStageVisuals(int stage) { //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) Color val = StageColor(stage); if ((Object)(object)virusNameLabel != (Object)null) { ((TMP_Text)virusNameLabel).text = PlagueStatus.VirusName; ((Graphic)virusNameLabel).color = new Color(val.r, val.g, val.b, 1f); } if ((Object)(object)stageLabel != (Object)null) { ((TMP_Text)stageLabel).text = PlagueStatus.CurrentStageName; } if ((Object)(object)stageIndicatorImage != (Object)null) { ((Graphic)stageIndicatorImage).color = val; } if ((Object)(object)severityBar != (Object)null) { ((Graphic)severityBar).color = val; } } public Color StageColor(int stage) { //IL_003a: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (stageColors == null || stageColors.Length == 0) { return Color.white; } return stageColors[Mathf.Clamp(stage, 0, stageColors.Length - 1)]; } private void HandleInfected() { _lastStage = -1; _lastPercent = -1; if ((Object)(object)_audio != (Object)null && (Object)(object)onsetClip != (Object)null) { _audio.PlayOneShot(onsetClip, audioVolume); } if (!((Object)(object)bannerGroup == (Object)null)) { if ((Object)(object)bannerTitle != (Object)null) { ((TMP_Text)bannerTitle).text = "INFECTED"; } if ((Object)(object)bannerSubtitle != (Object)null) { ((TMP_Text)bannerSubtitle).text = PlagueStatus.VirusName + " - " + PlagueStatus.VirusStrain; } if ((Object)(object)bannerHint != (Object)null) { ((TMP_Text)bannerHint).text = PlagueStatus.CureHint; } if (_bannerRoutine != null) { ((MonoBehaviour)this).StopCoroutine(_bannerRoutine); } _bannerRoutine = ((MonoBehaviour)this).StartCoroutine(BannerRoutine()); } } private void HandleCleared() { if ((Object)(object)_audio != (Object)null) { _audio.Stop(); } } private void HandleStageChanged(int stage) { _punch = 1f; if ((Object)(object)_audio != (Object)null && (Object)(object)stageClip != (Object)null && stage > 0) { _audio.PlayOneShot(stageClip, audioVolume); } } private IEnumerator BannerRoutine() { float t = 0f; while (t < 0.12f) { t += Time.deltaTime; bannerGroup.alpha = Mathf.Clamp01(t / 0.12f); yield return null; } bannerGroup.alpha = 1f; yield return (object)new WaitForSeconds(bannerHoldTime); t = 0f; while (t < 0.45f) { t += Time.deltaTime; bannerGroup.alpha = Mathf.Clamp01(1f - t / 0.45f); yield return null; } bannerGroup.alpha = 0f; _bannerRoutine = null; } private void BuildRuntimeUI() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0710: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("PlagueInfectionCanvas"); val.transform.SetParent(((Component)this).transform, false); Canvas val2 = val.AddComponent<Canvas>(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 100; CanvasScaler val3 = val.AddComponent<CanvasScaler>(); val3.uiScaleMode = (ScaleMode)1; val3.referenceResolution = referenceResolution; val3.matchWidthOrHeight = 0.5f; TMP_FontAsset font = (((Object)(object)fontOverride != (Object)null) ? fontOverride : ResolveFont()); RectTransform val4 = CreateRect("Badge", ((Component)val2).transform); SetRect(val4, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -44f), new Vector2(460f, 106f)); badgeGroup = ((Component)val4).gameObject.AddComponent<CanvasGroup>(); Image val5 = CreateImage("Background", (Transform)(object)val4, new Color(0f, 0f, 0f, 0.62f)); Stretch(((Graphic)val5).rectTransform, 0f, 0f, 0f, 0f); stageIndicatorImage = CreateImage("StageStrip", (Transform)(object)val4, StageColor(0)); SetRect(((Graphic)stageIndicatorImage).rectTransform, new Vector2(0f, 0f), new Vector2(0f, 1f), new Vector2(0f, 0.5f), new Vector2(0f, 0f), new Vector2(5f, 0f)); virusNameLabel = CreateText("VirusName", (Transform)(object)val4, PlagueStatus.VirusName, 26f, Color.white, (TextAlignmentOptions)257, font, (FontStyles)1); SetRect(((TMP_Text)virusNameLabel).rectTransform, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(16f, -8f), new Vector2(320f, 30f)); percentLabel = CreateText("Percent", (Transform)(object)val4, "0%", 20f, new Color(1f, 1f, 1f, 0.75f), (TextAlignmentOptions)260, font, (FontStyles)0); SetRect(((TMP_Text)percentLabel).rectTransform, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(-16f, -12f), new Vector2(110f, 24f)); stageLabel = CreateText("Stage", (Transform)(object)val4, PlagueStatus.CurrentStageName, 17f, new Color(1f, 1f, 1f, 0.7f), (TextAlignmentOptions)257, font, (FontStyles)0); SetRect(((TMP_Text)stageLabel).rectTransform, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(16f, -40f), new Vector2(400f, 22f)); cureHintLabel = CreateText("CureHint", (Transform)(object)val4, PlagueStatus.CureHint, 15f, new Color(0.55f, 0.95f, 0.6f), (TextAlignmentOptions)257, font, (FontStyles)0); SetRect(((TMP_Text)cureHintLabel).rectTransform, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(16f, -62f), new Vector2(420f, 22f)); Image val6 = CreateImage("SeverityBarBg", (Transform)(object)val4, new Color(1f, 1f, 1f, 0.12f)); SetRect(((Graphic)val6).rectTransform, new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 10f), new Vector2(-32f, 6f)); severityBar = CreateImage("SeverityBarFill", (Transform)(object)((Graphic)val6).rectTransform, StageColor(0)); Stretch(((Graphic)severityBar).rectTransform, 0f, 0f, 0f, 0f); severityBar.type = (Type)3; severityBar.fillMethod = (FillMethod)0; severityBar.fillOrigin = 0; severityBar.fillAmount = 0f; RectTransform val7 = CreateRect("Banner", ((Component)val2).transform); SetRect(val7, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), new Vector2(1400f, 320f)); bannerGroup = ((Component)val7).gameObject.AddComponent<CanvasGroup>(); bannerTitle = CreateText("BannerTitle", (Transform)(object)val7, "INFECTED", 92f, new Color(0.92f, 0.12f, 0.12f), (TextAlignmentOptions)514, font, (FontStyles)1); SetRect(((TMP_Text)bannerTitle).rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 70f), new Vector2(1400f, 120f)); bannerSubtitle = CreateText("BannerSubtitle", (Transform)(object)val7, PlagueStatus.VirusName + " - " + PlagueStatus.VirusStrain, 30f, new Color(1f, 1f, 1f, 0.85f), (TextAlignmentOptions)514, font, (FontStyles)0); SetRect(((TMP_Text)bannerSubtitle).rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -10f), new Vector2(1400f, 44f)); bannerHint = CreateText("BannerHint", (Transform)(object)val7, "QUARANTINE FAILED - DO NOT SHARE EQUIPMENT", 20f, new Color(1f, 1f, 1f, 0.45f), (TextAlignmentOptions)514, font, (FontStyles)0); SetRect(((TMP_Text)bannerHint).rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -60f), new Vector2(1400f, 30f)); } private static TMP_FontAsset ResolveFont() { if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null) { return TMP_Settings.defaultFontAsset; } TMP_FontAsset val = Resources.Load<TMP_FontAsset>("Fonts & Materials/LiberationSans SDF"); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)"[PlagueInfectionHUD] No TMP font asset found. Set 'fontOverride' or assign the HUD references yourself."); } return val; } private static RectTransform CreateRect(string name, Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent(parent, false); return val2; } private static void SetRect(RectTransform rt, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 anchoredPos, Vector2 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) rt.anchorMin = anchorMin; rt.anchorMax = anchorMax; rt.pivot = pivot; rt.anchoredPosition = anchoredPos; rt.sizeDelta = size; } private static void Stretch(RectTransform rt, float left, float right, float top, float bottom) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0043: Unknown result type (might be due to invalid IL or missing references) rt.anchorMin = Vector2.zero; rt.anchorMax = Vector2.one; rt.pivot = new Vector2(0.5f, 0.5f); rt.offsetMin = new Vector2(left, bottom); rt.offsetMax = new Vector2(0f - right, 0f - top); } private static Image CreateImage(string name, Transform parent, Color color) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateRect(name, parent); Image val2 = ((Component)val).gameObject.AddComponent<Image>(); val2.sprite = WhiteSprite; ((Graphic)val2).color = color; ((Graphic)val2).raycastTarget = false; return val2; } private static TextMeshProUGUI CreateText(string name, Transform parent, string content, float fontSize, Color color, TextAlignmentOptions align, TMP_FontAsset font, FontStyles style) { //IL_003d: 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_004f: Unknown result type (might be due to invalid IL or missing references) RectTransform val = CreateRect(name, parent); TextMeshProUGUI val2 = ((Component)val).gameObject.AddComponent<TextMeshProUGUI>(); if ((Object)(object)font != (Object)null) { ((TMP_Text)val2).font = font; } ((TMP_Text)val2).text = content; ((TMP_Text)val2).fontSize = fontSize; ((TMP_Text)val2).fontStyle = style; ((Graphic)val2).color = color; ((TMP_Text)val2).alignment = align; ((TMP_Text)val2).enableWordWrapping = false; ((TMP_Text)val2).overflowMode = (TextOverflowModes)0; ((Graphic)val2).raycastTarget = false; return val2; } } public static class PlagueSpawnerConfig { [CompilerGenerated] private static class <>O { public static GenericButtonHandler <0>__OnSpawnClickedFart; public static GenericButtonHandler <1>__OnSpawnClickedLoadstone; public static GenericButtonHandler <2>__OnPrintCoordsClicked; } private const string Section = "Plague Spawner"; private static ConfigEntry<float> _spawnX; private static ConfigEntry<float> _spawnY; private static ConfigEntry<float> _spawnZ; public static void Init(ConfigFile config) { //IL_0063: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_008d: Expected O, but got Unknown //IL_0088: Unknown result